polotno 2.4.4 → 2.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/canvas/tooltip.js +1 -1
- package/canvas/workspace-canvas.js +1 -1
- package/model/group-model.js +1 -1
- package/model/page-model.js +1 -1
- package/model/store.d.ts +1 -0
- package/model/store.js +1 -1
- package/package.json +1 -1
- package/polotno-app.d.ts +2 -0
- package/polotno.bundle.js +9 -9
- package/side-panel/side-panel.js +1 -1
package/polotno.bundle.js
CHANGED
|
@@ -113,17 +113,17 @@ https://iconscout.com/developers, https://iconscout.com/legal/api-license-develo
|
|
|
113
113
|
https://polotno.com/docs/server-api`,aW={unsplashList:({query:e,page:t=1})=>`${aU}/get-unsplash?query=${e}&per_page=20&page=${t}&KEY=${a3()}`,unsplashDownload:e=>`${aU}/download-unsplash?id=${e}&KEY=${a3()}`,svgapiList:({query:e,page:t=0})=>`${aU}/get-svgapi?query=${e}&page=${t}&per_page=20&KEY=${a3()}`,svgapiDownload:e=>`${aU}/download-svgapi?path=${e}&KEY=${a3()}`,iconscoutList:({query:e,page:t=1})=>(aV("iconscout",aG),`${aU}/get-iconscout?query=${e}&page=${t}&KEY=${a3()}`),iconscoutDownload:e=>(aV("iconscout",aG),`${aU}/download-iconscout?uuid=${e}&KEY=${a3()}`),templateList:({query:e,page:t=1,sizeQuery:n})=>`${aU}/get-templates?${n}&query=${e}&per_page=30&page=${t}&KEY=${a3()}`},a$=()=>`${aU}/get-google-fonts?KEY=${a3()}`,aK=e=>`https://api.polotno.com/google-fonts-previews/black/${aq(e," ","-")}.png`,aY=()=>`${aU}/remove-image-background?KEY=${a3()}`,aX=e=>aW.templateList(e),aZ=()=>`${aU}/get-text-templates?KEY=${a3()}`,aQ=e=>aW.unsplashList(e),aJ=e=>aW.unsplashDownload(e),a0=y.observable({value:!1}),a1=y.action(()=>{a0.value=!0}),a2="",a3=()=>a2||"",a5=window.location.origin,a6=navigator.userAgent.indexOf("Headless")>-1,a4=navigator.userAgent.indexOf("Electron")>-1;"file://"===a5&&a6&&(a5="headless"),"file://"===a5&&a4&&(a5="electron");let a8=`%cPolotno error! Current domain is not allowed. It may lead to unexpected behavior and stop working. Please add "${a5}" here: https://polotno.com/cabinet`;async function a9(e){for(let n=0;n<5;n++)try{var t;let n=await fetch(aU+"/validate-key",{method:"POST",body:JSON.stringify({key:e,site:location.host})});if(!e)return console.warn("Polotno API is initialized without API key. It may lead to unexpected behavior and stop working. Please create API key here: https://polotno.com/cabinet"),!1;if(200!==n.status){await new Promise(e=>setTimeout(e,3e3));continue}let r=await n.json();return r.is_valid||console.warn("Polotno API key is not valid. Please get new API key here: https://polotno.com/cabinet"),r.is_paid||console.log("%cPolotno Free Version. Development or non-commercial usage only. https://polotno.com/","background: rgb(0, 161, 255); color: white; padding: 5px; margin: 5px;"),r.is_domain_valid||console.log(a8,"background: rgba(247, 101, 68, 1); color: white; padding: 5px; margin: 5px;"),t=r.remove_background_enabled,ik.removeBackgroundEnabled=t,r.is_paid||!1}catch(e){await new Promise(e=>setTimeout(e,3e3))}return console.error("Can not validate Polotno API key. Please report to anton@polotno.com immediately."),!0}async function a7(e,t){a2=e,(!await a9(e)||t)&&a1()}let le=({px:e,unit:t="px",dpi:n})=>{switch(t){case"pt":default:return e;case"mm":return e/(n/25.4);case"cm":return e/(n/2.54);case"in":return e/n}},lt=({px:e,precious:t=2,dpi:n=72,unit:r="px"})=>parseFloat(le({px:e,dpi:n,unit:r}).toFixed(t)),ln=({unitVal:e,dpi:t,unit:n})=>e/le({px:1,unit:n,dpi:t}),lr=e=>{let t=parseFloat(le(e).toFixed(1));switch(e.unit){case"pt":return`${Math.round(t)}pt`;case"mm":return`${t}mm`;case"cm":return`${t}cm`;case"in":return`${t}in`;default:return`${Math.round(t)}px`}},li=new(l(A)).Group;li.add(new(l(A)).Rect({width:20,height:20,fill:"white"})),li.add(new(l(A)).Path({scaleX:20/24,scaleY:20/24,data:"M4.98313549,11.0001422 C5.49589839,10.9914935 5.92501998,11.3703506 5.99116425,11.8666444 L5.99985778,11.9831355 L6.00348884,12.2068855 C6.11245031,15.4321748 8.76323537,17.9999971 11.9999971,17.9999971 C12.1869612,17.9999971 12.3726725,17.9914753 12.5567465,17.9745765 L12.2928932,17.7071068 C11.9023689,17.3165825 11.9023689,16.6834175 12.2928932,16.2928932 C12.6834175,15.9023689 13.3165825,15.9023689 13.7071068,16.2928932 L15.7071068,18.2928932 C16.0976311,18.6834175 16.0976311,19.3165825 15.7071068,19.7071068 L13.7071068,21.7071068 C13.3165825,22.0976311 12.6834175,22.0976311 12.2928932,21.7071068 C11.9023689,21.3165825 11.9023689,20.6834175 12.2928932,20.2928932 L12.6111505,19.9769552 C12.4086045,19.9922816 12.2047796,19.9999971 11.9999971,19.9999971 C7.7687005,19.9999971 4.28886152,16.7094374 4.01666425,12.5105203 L4.00420123,12.2575143 L4.00014222,12.0168645 C3.9908282,11.4646583 4.43092928,11.0094562 4.98313549,11.0001422 Z M11.7071068,2.29289322 C12.0675907,2.65337718 12.0953203,3.22060824 11.7902954,3.61289944 L11.7071068,3.70710678 L11.3891629,4.0230186 C11.5916051,4.00770767 11.7953244,4 12,4 C16.418278,4 20,7.581722 20,12 C20,12.5522847 19.5522847,13 19,13 C18.4477153,13 18,12.5522847 18,12 C18,8.6862915 15.3137085,6 12,6 C11.8129339,6 11.6271216,6.00853145 11.4429483,6.02544919 L11.7071068,6.29289322 C12.0976311,6.68341751 12.0976311,7.31658249 11.7071068,7.70710678 C11.3466228,8.06759074 10.7793918,8.09532028 10.3871006,7.79029539 L10.2928932,7.70710678 L8.29289322,5.70710678 C7.93240926,5.34662282 7.90467972,4.77939176 8.20970461,4.38710056 L8.29289322,4.29289322 L10.2928932,2.29289322 C10.6834175,1.90236893 11.3165825,1.90236893 11.7071068,2.29289322 Z",fill:"black"}));let lo=li.toCanvas({pixelRatio:2,width:20,height:20}),la={enabledAnchors:["top-left","top-center","top-right","middle-left","bottom-left","bottom-right","bottom-center","middle-right"],borderEnabled:!0,rotateEnabled:!0,rotationSnaps:[0,45,90,135,180,225,270,315],ignoreStroke:!0,flipEnabled:!1,anchorStrokeWidth:2,borderStrokeWidth:2,rotateAnchorOffset:30,anchorStyleFunc:e=>{e.hasName("rotater")&&e.setAttrs({width:20,height:20,cornerRadius:10,offsetX:10,offsetY:10,fillPatternImage:lo,fillPatternScaleX:.5,fillPatternScaleY:.5,fillPriority:"pattern",fillPatternRepeat:"no-repeat"})}},ll={text:{enabledAnchors:["top-left","top-right","middle-left","bottom-left","bottom-right","middle-right"]},svg:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},line:{enabledAnchors:[],borderEnabled:!1,rotateEnabled:!1},image:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},many:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]},group:{enabledAnchors:["top-left","top-right","bottom-left","bottom-right"]}},ls=e=>(0,p.jsx)(rW,{...e,preventDefault:!1}),lu=({url:e,...t})=>{let[n,r]=l(r0)(e,"anonymous"),i=n?function(e,t,n="scale"){let r,i;let o=t.width/t.height;o>=e.width/e.height?(r=e.width,i=e.width/o):(r=e.height*o,i=e.height);let a=0,l=0;return"left-top"===n?(a=0,l=0):"left-middle"===n?(a=0,l=(e.height-i)/2):"left-bottom"===n?(a=0,l=e.height-i):"center-top"===n?(a=(e.width-r)/2,l=0):"center-middle"===n?(a=(e.width-r)/2,l=(e.height-i)/2):"center-bottom"===n?(a=(e.width-r)/2,l=e.height-i):"right-top"===n?(a=e.width-r,l=0):"right-middle"===n?(a=e.width-r,l=(e.height-i)/2):"right-bottom"===n?(a=e.width-r,l=e.height-i):"scale"===n?(a=0,l=0,r=e.width,i=e.height):console.error(Error("Unknown clip position property - "+n)),{cropX:a,cropY:l,cropWidth:r,cropHeight:i}}(n,{width:t.width,height:t.height},"center-middle"):{};return or(r,"background"),(0,p.jsx)(rK,{image:n,...t,...i})},lc=e=>(0,p.jsx)(rW,{...e}),ld=e=>{let{background:t,scale:n,borderColor:r,...i}=e,o=l(v).useMemo(()=>!!l(A).Util.colorToRGBA(t),[t]),a=l(v).useMemo(()=>{let e=document.createElement("canvas");e.width=60,e.height=60;let t=e.getContext("2d");return t&&(t.fillStyle="black",t.fillRect(30,0,30,30),t.fillRect(0,30,30,30)),e},[]);return(0,p.jsxs)(l(v).Fragment,{children:[(0,p.jsx)(rW,{fillPatternImage:a,...i,opacity:.1,hideInExport:!0}),o?(0,p.jsx)(lc,{fill:t,...i}):(0,p.jsx)(lu,{url:t,...i})]})},lh=P(({selection:e})=>e.visible?(0,p.jsx)(rW,{name:"selection",x:Math.min(e.x1,e.x2),y:Math.min(e.y1,e.y2),width:Math.abs(e.x1-e.x2),height:Math.abs(e.y1-e.y2),fill:"rgba(0, 161, 255, 0.3)"}):null),lf=P(({x:e,y:t,width:n,height:r,rotation:i,anchor:o,store:a})=>{let s=ac({x:e,y:t,width:n,height:r,rotation:l(A).Util.radToDeg(i)});if(void 0===o)return null;let u=(r/2+70)*Math.cos(i-Math.PI/2),c=(r/2+70)*Math.sin(i-Math.PI/2),d=lt({unit:a.unit,dpi:a.dpi,px:n/a.scale,precious:"px"===a.unit?0:1})+" x "+lt({unit:a.unit,dpi:a.dpi,px:r/a.scale,precious:"px"===a.unit?0:1})+("px"===a.unit?"":" "+a.unit);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)(rG,{x:(s.minX+s.maxX)/2+u,y:(s.minY+s.maxY)/2+c,offsetX:14,offsetY:14,visible:"rotater"===o,children:[(0,p.jsx)("Tag",{cornerRadius:5,fill:"rgb(0, 161, 255)"}),(0,p.jsx)(rY,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:Math.round(l(A).Util.radToDeg(i)).toString()+"°"})]}),(0,p.jsxs)(rG,{x:(s.minX+s.maxX)/2,y:s.maxY+20,visible:"rotater"!==o,children:[(0,p.jsx)("Tag",{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"up",pointerHeight:0,pointerWidth:0}),(0,p.jsx)(rY,{align:"center",verticalAlign:"middle",fill:"white",padding:8,text:d})]})]})}),lp=P(({elements:e,store:t})=>{let n=e.filter(e=>e.alwaysOnTop),r=e.filter(e=>!e.alwaysOnTop).concat(n);return(0,p.jsx)(l(v).Fragment,{children:r.map(e=>(0,p.jsx)(aB,{store:t,element:e,onClick:()=>{console.warn("Polotno warning: onClick callback is deprecated. Just stop using it. Polotno will do selection automatically.")}},e.id))})}),lg=null,lm=e=>{lg=e};var lv=P(({store:e,page:t,width:n,height:r,pageControlsEnabled:i,backColor:o,pageBorderColor:a,activePageBorderColor:s,components:u,bleedColor:c})=>{var d;let h=e.bleedVisible?t.bleed:0,f=t.computedWidth+2*h,g=t.computedHeight+2*h,m=(n-f*e.scale)/2,b=(r-g*e.scale)/2,w=l(v).useRef(null),x=l(v).useRef(null),_=l(v).useRef(null),[E,S]=l(v).useState(null),[C,O]=l(v).useState({}),k=e.selectedElements.find(e=>e._cropModeEnabled),P=e.selectedShapes.filter(e=>!e.resizable).length>0,T=e.selectedShapes.filter(e=>!e.draggable).length>0,N=e.selectedElements.filter(e=>!e.visible).length>0;l(v).useLayoutEffect(()=>{if(!w.current)return;let t=w.current.getStage(),n=e.selectedShapes.map(e=>e._cropModeEnabled?null:t.findOne("#"+e.id)).filter(e=>e),r=1===e.selectedElements.length&&e.selectedElements[0]?.type||"many";ll[r]?(w.current.setAttrs({...la,...ll[r]}),"svg"!==r&&"image"!==r||e.selectedElements[0].keepRatio||w.current.setAttrs({enabledAnchors:la.enabledAnchors}),"text"===r&&ik.textVerticalResizeEnabled&&w.current.setAttrs({enabledAnchors:ll.text.enabledAnchors?.concat(["bottom-center"])})):w.current.setAttrs(la),P&&w.current.enabledAnchors([]),T&&w.current.rotateEnabled(!1),n.find(e=>e?.isDragging())&&n.forEach(e=>{e.isDragging()||e?.startDrag()}),w.current.nodes(n),w.current.getLayer()?.batchDraw()},[e.selectedElements,k,P,N,T]);let j=(d=()=>({visible:!1,x1:0,y1:0,x2:0,y2:0}),(0,v.useState)(function(){return(0,y.observable)(d(),void 0,{autoBind:!0})})[0]),R=l(v).useRef(!1),I=iI(),L=(0,y.action)(e=>{if(I)return;R.current=!1;let t=e.target.findAncestor(".elements-container"),n=e.target.findAncestor("Transformer"),r=e.target.findAncestor(".page-abs-container");if(t||n||r)return;let i=e.target.getStage()?.getPointerPosition();i&&(j.visible=!0,j.x1=i.x,j.y1=i.y,j.x2=i.x,j.y2=i.y,e.target.getStage()?.getPointersPositions().length>=2&&(j.visible=!1))});l(v).useEffect(()=>{let t=(0,y.action)(e=>{if(!j.visible)return;x.current?.setPointersPositions(e);let t=x.current?.getPointerPosition()||{x:j.x2,y:j.y2};j.x2=t.x,j.y2=t.y}),n=(0,y.action)(()=>{if(!j.visible||!x.current)return;let t=x.current.findOne(".selection"),n=t?t.getClientRect():{width:0,height:0,x:0,y:0};if(n.width&&n.height){let t=[];x.current.find(".element").forEach(r=>{let i=r.getClientRect(),o=e.getElementById(r.id()),a=o?.draggable,s=o?.selectable;l(A).Util.haveIntersection(n,i)&&a&&s&&t.push(o.top.id)});let r=[...new Set(t)];e.selectElements(r)}j.visible=!1,R.current=!0});return window.addEventListener("mousemove",t),window.addEventListener("touchmove",t),window.addEventListener("mouseup",n),window.addEventListener("touchend",n),()=>{window.removeEventListener("mousemove",t),window.removeEventListener("touchmove",t),window.removeEventListener("mouseup",n),window.removeEventListener("touchend",n)}},[]);let M=n=>{if(e.activePage!==t&&t.select(),R.current)return;let r=n.evt.ctrlKey||n.evt.metaKey||n.evt.shiftKey,i=n.target.findAncestor(".elements-container"),o=n.target.findAncestor(".page-abs-container"),a=n.target.findAncestor("Transformer");if(!r&&!i&&!a&&!o){e.selectElements([]);return}let l=n.target.findAncestor(".element",!0),s=e.getElementById(l?.id()),u=s?.top,c=u?.id,d=e.selectedElementsIds.indexOf(c)>=0;c&&r&&!d?e.selectElements(e.selectedElementsIds.concat([c])):c&&r&&d?e.selectElements(e.selectedElementsIds.filter(e=>e!==c)):!c||r||d||e.selectElements([c])};!function(e){let t=e=>e.hasName("element")||e.hasName("page-background")||e.hasName("elements-area");function n(n){let r=e.current?.getStage();var i=[],o=[];return r.find(t).forEach(e=>{if(!(n.indexOf(e)>=0)){var t=e.getClientRect({skipShadow:!0,skipStroke:!0});i.push(t.x,t.x+t.width,t.x+t.width/2),o.push(t.y,t.y+t.height,t.y+t.height/2)}}),{vertical:i,horizontal:o}}function r(t){let n=e.current?.getLayer(),r=n?.children.find(e=>"line-guides"===e.name());t.forEach(e=>{if("H"===e.orientation){var t=new(l(A)).Line({points:[-6e3,e.lineGuide,6e3,e.lineGuide],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});r?.add(t),n.batchDraw()}else if("V"===e.orientation){var t=new(l(A)).Line({points:[e.lineGuide,-6e3,e.lineGuide,6e3],stroke:"rgb(0, 161, 255)",strokeWidth:1,name:"guid-line",dash:[4,6]});r?.add(t)}})}let i=e=>{e.target.getLayer().children.find(e=>"line-guides"===e.name()).destroyChildren();var t=ah(n(e.target.nodes()),function(e){let t=e.__getNodeRect(),n=ac({...t,rotation:l(A).Util.radToDeg(t.rotation)}),r=e.getAbsolutePosition();return{vertical:[{guide:n.x,offset:r.x-n.x,snap:"start"},{guide:n.x+n.width/2,offset:r.x-n.x-n.width/2,snap:"center"},{guide:n.x+n.width,offset:r.x-n.x-n.width,snap:"end"}],horizontal:[{guide:n.y,offset:r.y-n.y,snap:"start"},{guide:n.y+n.height/2,offset:r.y-n.y-n.height/2,snap:"center"},{guide:n.y+n.height,offset:r.y-n.y-n.height,snap:"end"}]}}(e.target));if(!t.length)return;r(t);let i=e.target.getAbsolutePosition(),o={...i};t.forEach(e=>{switch(e.snap){case"start":case"center":case"end":switch(e.orientation){case"V":o.x=e.lineGuide+e.offset;break;case"H":o.y=e.lineGuide+e.offset}}});let a=o.x-i.x,s=o.y-i.y;e.evt.ctrlKey||e.evt.metaKey||e.target.nodes().forEach(e=>{let t=e.getAbsolutePosition();e.setAbsolutePosition({x:t.x+a,y:t.y+s})})},o=(t,i,o)=>{let a=e.current,l=a.getLayer();if(l.children.find(e=>"line-guides"===e.name()).destroyChildren(),"rotater"===a.getActiveAnchor()||Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2))>50||!l)return i;var s=ah(n(a.nodes()),{vertical:[{guide:i.x,offset:0,snap:"start"}],horizontal:[{guide:i.y,offset:0,snap:"start"}]});if(!s.length||(r(s),o.ctrlKey||o.metaKey))return i;let u=i.x,c=i.x;s.forEach(e=>{switch(e.orientation){case"V":u=e.lineGuide;break;case"H":c=e.lineGuide}});let d=Math.abs(i.x-u),h=Math.abs(i.y-c),f=d<10,p=h<10;return f&&!p?{x:u,y:t.y}:p&&!f?{x:t.x,y:c}:f&&p?{x:u,y:c}:i},a=e=>{if(!e.target)return;let t=e.target.getLayer();t.children.find(e=>"line-guides"===e.name()).destroyChildren(),t.batchDraw()};l(v).useEffect(()=>{e.current&&(e.current.anchorDragBoundFunc(o),e.current.on("dragstart",()=>{setTimeout(()=>{let e=[...l(A).DD._dragElements.entries()];e.reverse(),l(A).DD._dragElements.clear(),e.forEach(([e,t])=>{l(A).DD._dragElements.set(e,t)})})}),e.current.on("dragmove",i),e.current.on("dragend",a),e.current.on("transformend",a),e.current.on("transform",t=>{t.evt.ctrlKey||t.evt.metaKey?e.current?.rotationSnapTolerance(0):e.current?.rotationSnapTolerance(5)}))},[])}(w);let D=e.activePage===t,F=u?.PageControls,z=u?.Tooltip,B=1/e.scale,U=0/e.scale;return(0,p.jsxs)("div",{ref:_,onDragOver:e=>e.preventDefault(),onDrop:n=>{if(n.preventDefault(),!x.current)return;x.current.setPointersPositions(n);let r=x.current.findOne(".elements-container").getRelativePointerPosition(),i=x.current.getPointerPosition(),o=x.current.getAllIntersections(i).map(e=>e.findAncestor(".element",!0)).filter(Boolean),a=[...new Set(o.reverse())].map(t=>e.getElementById(t.id())),l=a[0];lg&&(lg(r,l,{elements:a,page:t}),lg=null)},style:{position:"relative",width:n+"px"},className:"polotno-page-container"+(D?" active-page":""),children:[(0,p.jsx)(rJ,{ref:x,width:Math.min(n,4*window.innerWidth),height:Math.min(r,4*window.innerHeight),onClick:M,onTap:M,onMouseDown:L,onMouseMove:n=>{if(!n.evt.altKey&&E){S(null);return}if(!n.evt.altKey)return;let r=n.target.findAncestor(".element",!0),i=r?.id();if(!e.selectedElements[0]||e.selectedElementsIds.includes(i))return;let o=ad(e.selectedElements),a=ac(i?e.getElementById(i):{x:0,y:0,width:t.computedWidth,height:t.computedHeight,rotation:0}),l=[];o.minX>a.maxX&&l.push({distance:o.minX-a.maxX,box1:o,box2:a,points:[{x:o.minX,y:o.minY+o.height/2},{x:a.maxX,y:o.minY+o.height/2},{x:a.maxX,y:a.minY+a.height/2}]}),o.maxX<a.minX&&l.push({distance:a.minX-o.maxX,box1:o,box2:a,points:[{x:o.maxX,y:o.minY+o.height/2},{x:a.minX,y:o.minY+o.height/2},{x:a.minX,y:a.minY+a.height/2}]}),o.minY>a.maxY&&l.push({box1:o,box2:a,distance:o.minY-a.maxY,points:[{x:o.minX+o.width/2,y:o.minY},{x:o.minX+o.width/2,y:a.maxY},{x:a.minX+a.width/2,y:a.maxY}]}),o.maxY<a.minY&&l.push({box1:o,box2:a,distance:a.minY-o.maxY,points:[{x:o.minX+o.width/2,y:o.maxY},{x:o.minX+o.width/2,y:a.minY},{x:a.minX+a.width/2,y:a.minY}]}),o.minX>=a.minX&&o.maxX<=a.maxX&&o.minY>=a.minY&&o.maxY<=a.maxY&&(l.push({distance:o.minX-a.minX,box1:o,box2:a,points:[{x:o.minX,y:o.minY+o.height/2},{x:a.minX,y:o.minY+o.height/2},{x:a.minX,y:a.minY+a.height/2}]}),l.push({distance:a.maxX-o.maxX,box1:o,box2:a,points:[{x:o.maxX,y:o.minY+o.height/2},{x:a.maxX,y:o.minY+o.height/2},{x:a.maxX,y:a.minY+a.height/2}]}),l.push({box1:o,box2:a,distance:o.minY-a.minY,points:[{x:o.minX+o.width/2,y:o.minY},{x:o.minX+o.width/2,y:a.minY},{x:a.minX+a.width/2,y:a.minY}]}),l.push({box1:o,box2:a,distance:a.maxY-o.maxY,points:[{x:o.minX+o.width/2,y:o.maxY},{x:o.minX+o.width/2,y:a.maxY},{x:a.minX+a.width/2,y:a.maxY}]})),JSON.stringify(E)!==JSON.stringify(l)&&S(l)},onTouchStart:L,onDragStart:t=>{let n=t.target.findAncestor(".element",!0);if(n){let r=e.getElementById(n?.id()),i=r?.top,o=i?.id;!(e.selectedElementsIds.indexOf(o)>=0)&&o&&(e.selectElements([o]),t.target.stopDrag(),t.target.startDrag(t),w.current?.startDrag(t))}E&&S(null)},pageId:t.id,style:{position:"relative"},children:(0,p.jsxs)("Layer",{children:[(0,p.jsx)(ls,{width:n,height:r,fill:o}),(0,p.jsx)(rq,{x:m,y:b,scaleX:e.scale,scaleY:e.scale,name:"page-container",children:(0,p.jsxs)(rq,{name:"page-container-2",children:[(0,p.jsx)(rq,{name:"page-background-group",x:h,y:h,children:(0,p.jsx)(ld,{x:-t.bleed,y:-t.bleed,width:t.computedWidth+2*t.bleed,height:t.computedHeight+2*t.bleed,background:t.background,shadowBlur:10,shadowColor:"lightgrey",name:"page-background",preventDefault:!1,scale:e.scale})}),(0,p.jsxs)(rq,{x:h,y:h,name:"elements-container",listening:!e.isPlaying,children:[(0,p.jsx)(rW,{name:"elements-area",width:t.computedWidth,height:t.computedHeight,listening:!1}),(0,p.jsx)(lp,{elements:t.children,store:e})]}),(0,p.jsx)(rW,{stroke:c,name:"bleed",strokeWidth:t.bleed,x:t.bleed/2,y:t.bleed/2,width:t.computedWidth+t.bleed,height:t.computedHeight+t.bleed,listening:!1,visible:t.bleed>0&&e.bleedVisible,hideInExport:!0})]})}),(0,p.jsx)(r$,{name:"workspace-background",points:[0,0,n,0,n,r,0,r,0,0,m,b,m,r-b,n-m,r-b,n-m,b,m,b],listening:!1,closed:!0,fill:o}),(0,p.jsx)(rq,{x:m,y:b,scaleX:e.scale,scaleY:e.scale,children:(0,p.jsx)(rW,{name:"page-highlight",hideInExport:!0,x:-B/2-U,y:-B/2-U,width:f+B+2*U,height:g+B+2*U,stroke:D&&e.pages.length>1?s:a,strokeWidth:2,listening:!1,strokeScaleEnabled:!1})}),(0,p.jsxs)(rq,{x:m+h*e.scale,y:b+h*e.scale,scaleX:e.scale,scaleY:e.scale,name:"page-abs-container",children:[(0,p.jsx)(rZ,{ref:w,onDragStart:n=>{n.evt?.altKey&&e.selectedElements.forEach(e=>{let n=e.clone({},{skipSelect:!0}),r=t.children.indexOf(e);t.setElementZIndex(n.id,r)}),e.history.startTransaction()},onDragEnd:()=>{e.history.endTransaction()},onTransformStart:()=>{e.history.startTransaction()},boundBoxFunc:(e,t)=>{let n=1>Math.abs(t.width)||1>Math.abs(t.height),r=1>Math.abs(e.width)||1>Math.abs(e.height);return n&&!r?e:t},onTransform:e=>{let t=w.current?.__getNodeRect();O({anchor:w.current?.getActiveAnchor(),x:t.x,y:t.y,rotation:t.rotation,width:t.width,height:t.height})},onTransformEnd:t=>{O({}),e.history.endTransaction()},visible:!e.isPlaying}),E&&E.map(({points:t,distance:n,box1:r,box2:i},o)=>(0,p.jsxs)(rq,{name:"distances-container",hideInExport:!0,listening:!1,children:[(0,p.jsx)(rW,{...r,stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),(0,p.jsx)(rW,{...i,stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),(0,p.jsx)(r$,{points:[t[0].x,t[0].y,t[1].x,t[1].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),(0,p.jsx)(r$,{points:[t[1].x,t[1].y,t[2].x,t[2].y],stroke:"rgb(0, 161, 255)",strokeWidth:1,strokeScaleEnabled:!1}),(0,p.jsxs)(rG,{x:(t[0].x+t[1].x)/2,y:(t[0].y+t[1].y)/2,offsetY:-10,scaleX:1/e.scale,scaleY:1/e.scale,children:[(0,p.jsx)("Tag",{cornerRadius:5,fill:"rgb(0, 161, 255)",pointerDirection:"down"}),(0,p.jsx)(rY,{align:"center",verticalAlign:"middle",fill:"white",padding:5,text:lr({unit:e.unit,dpi:e.dpi,px:n})})]})]},o)),t._rendering&&(0,p.jsxs)(rq,{children:[(0,p.jsx)(rW,{width:f,height:g,fill:"rgba(255,255,255,0.9)"}),(0,p.jsx)(rY,{text:"Rendering...",fontSize:60,width:f,height:g,align:"center",verticalAlign:"middle"})]}),z&&(0,p.jsx)(z,{components:u,store:e,page:t,stageRef:x})]}),(0,p.jsx)(lf,{...C,store:e}),(0,p.jsx)(lh,{selection:j}),a0.value&&(0,p.jsx)(rY,{text:"Powered by polotno.com",fontSize:14,fill:"rgba(0,0,0,0.6)",x:n-170,y:r-18,onMouseEnter:e=>{e.target.getStage().container().style.cursor="pointer"},onMouseLeave:e=>{e.target.getStage().container().style.cursor=""},onTouchStart:e=>{e.cancelBubble=!0},onMouseDown:e=>{e.cancelBubble=!0},onClick:()=>{window.open("https://polotno.com")},onTap:()=>{window.open("https://polotno.com")}}),(0,p.jsx)(rq,{name:"line-guides"})]})}),(i??!0)&&D&&F&&(0,p.jsx)(F,{store:e,page:t,xPadding:m,yPadding:b})]})}),v=h("8NFma");let ly=[.1,.2,.5,1,2,5,10,20,25,50,100,200,500,1e3,2e3,5e3,1e4],lb=e=>ly.find(t=>e(t)>30)||1e4,lw=P(({store:e,width:t,height:n})=>{let r=l(v).useRef(null);if(!e.activePage)return null;let i=e.activePage;e.bleedVisible&&i.bleed;let o=i.computedWidth*e.scale,a=i.computedHeight*e.scale,s=(t-o)/2,u=lb(t=>ln({unitVal:t,dpi:e.dpi,unit:e.unit})*e.scale),c=ln({unitVal:u,dpi:e.dpi,unit:e.unit})*e.scale,d=Math.round(o/c)+1,h=Math.round(a/c)+1,f=ad(e.selectedShapes);return(0,p.jsxs)("div",{style:{position:"absolute",top:0,left:0,pointerEvents:"none"},ref:r,children:[(0,p.jsxs)("div",{style:{width:t+"px",height:"14px",position:"sticky",fontSize:"8px",lineHeight:"14px",top:"0px",left:"0px",color:"grey",borderBottom:"1px solid grey",backgroundColor:"#e8e8e8",overflow:"hidden"},children:[[...Array(d)].map((t,n)=>(0,p.jsx)("div",{style:{position:"absolute",left:s+n*c+"px",borderLeft:"1px solid grey",paddingLeft:"2px",width:c+"px"},children:"px"===e.unit||u>=1?Math.round(u*n):(u*n).toFixed(1)},n)),!!e.selectedShapes.length&&(0,p.jsx)("div",{style:{position:"absolute",left:s+f.x*e.scale+"px",height:"14px",width:f.width*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}})]}),e.pages.map((t,r)=>{let i=(n-t.computedHeight*e.scale)/2;return(0,p.jsxs)("div",{style:{left:"0px",width:"14px",height:n+"px",position:"sticky",fontSize:"8px",lineHeight:"14px",color:"grey",borderRight:"1px solid grey",backgroundColor:"#e8e8e8",overflow:"hidden"},children:[[...Array(h)].map((t,n)=>(0,p.jsx)("div",{style:{position:"absolute",left:"14px",top:i+n*c-14+"px",borderLeft:"1px solid grey",paddingLeft:"2px",transform:"rotate(90deg)",transformOrigin:"left top",width:c+"px",overflow:"hidden"},children:"px"===e.unit||u>=1?Math.round(u*n):(u*n).toFixed(1)},n)),e.selectedShapes[0]?.page===t&&(0,p.jsx)("div",{style:{position:"absolute",top:i+f.y*e.scale-14+"px",width:"14px",height:f.height*e.scale,backgroundColor:"rgba(0,0,0,0.15)"}})]},t.id)})]})});var lx=(h("58B0H"),h("58B0H"));let l_=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>((t&=63)<36?e+=t.toString(36):t<62?e+=(t-26).toString(36).toUpperCase():t>62?e+="-":e+="_",e),"");var lx=(h("58B0H"),h("58B0H"));let lE=function(e,t){if(e===t)return!0;if("object"!=typeof e||null==e||"object"!=typeof t||null==t||Object.keys(e).length!=Object.keys(t).length)return!1;for(var n in e)if(!t.hasOwnProperty(n)||!lE(e[n],t[n]))return!1;return!0};Object.assign(lx.types);let lS=(0,lx.types).model("UndoManager",{history:(0,lx.types).array((0,lx.types).frozen()),undoIdx:-1,targetPath:""}).views(e=>({get canUndo(){return e.undoIdx>0},get canRedo(){return e.undoIdx<e.history.length-1}})).actions(e=>{let t,n;let r=!1,i=null,o=0,a=0,l=()=>a>0;function s(){let e=(0,lx.getSnapshot)(t);return{pages:e.pages,width:e.width,height:e.height}}function u(e){lE(t.pages.map(e=>e.id),e.pages.map(e=>e.id))?t.pages.forEach((t,n)=>{(0,lx.applySnapshot)(t,e.pages[n])}):(0,lx.applySnapshot)(t.pages,e.pages),t.setSize(e.width,e.height)}return{startTransaction(){a++},endTransaction(e){a--,e||this.requestAddState(s())},async ignore(t,n=!1,r=!1){r&&await new Promise(e=>setTimeout(e,10)),o&&e.addUndoState();let i=l();e.startTransaction();let s=a;try{await t()}catch(e){setTimeout(()=>{throw e})}let u=s!==a;e.endTransaction(!u),n||i||e.replaceState(),u||(clearTimeout(o),o=0)},async transaction(t){await e.ignore(t,!0),this.addUndoState()},requestAddState(e){if(i=e,!o&&!l()){if(r){r=!1;return}o=setTimeout(()=>{clearTimeout(o=0),l()||this.addUndoState()},100)}},addUndoState(){if(r){r=!1;return}let t=e.history[e.undoIdx];lE(i,t)||(clearTimeout(o),o=0,e.history.splice(e.undoIdx+1),e.history.push(i),e.undoIdx=e.history.length-1)},afterCreate(){if(!(t=(0,lx.resolvePath)(e,"..")))throw Error("Failed to find target store for UndoManager. Please provide `targetPath` property, or a `targetStore` in the environment");n=(0,lx.onSnapshot)(t,()=>{this.requestAddState(s())}),0===e.history.length&&this.requestAddState(s())},clear(){clearTimeout(o),o=0,e.history.splice(0,e.history.length),e.undoIdx=-1,e.addUndoState(s())},beforeDestroy(){n()},undo(){if(o&&this.addUndoState(),!e.canUndo){console.warn("No undo history. Please check `store.history.canUndo` before calling undo action.");return}e.undoIdx--,r=!0,u(e.history[e.undoIdx])},redo(){if(o&&this.addUndoState(),!e.canRedo){console.warn("No redo history. Please check `store.history.canRedo` before calling redo action.");return}e.undoIdx++,r=!0,u(e.history[e.undoIdx])},replaceState(){e.history[e.undoIdx]=s()}}});async function lC(e,t){let n=await (await fetch(e)).blob(),r=document.createElement("a"),i=URL.createObjectURL(n);r.href=i,r.download=t,document.body.appendChild(r),r.click(),setTimeout(function(){document.body.removeChild(r),window.URL.revokeObjectURL(i)},0)}async function lO({width:e,height:t}){return new(await (window.GIF?Promise.resolve(window.GIF):new Promise(e=>{var t=document.createElement("script");t.onload=function(){e(window.GIF)},t.src="https://cdnjs.cloudflare.com/ajax/libs/gif.js/0.2.0/gif.js",document.head.appendChild(t)})))({workers:4,width:e,height:t,workerScript:URL.createObjectURL(new Blob([`// gif.worker.js 0.2.0 - https://github.com/jnordberg/gif.js
|
|
114
114
|
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){var NeuQuant=require("./TypedNeuQuant.js");var LZWEncoder=require("./LZWEncoder.js");function ByteArray(){this.page=-1;this.pages=[];this.newPage()}ByteArray.pageSize=4096;ByteArray.charMap={};for(var i=0;i<256;i++)ByteArray.charMap[i]=String.fromCharCode(i);ByteArray.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(ByteArray.pageSize);this.cursor=0};ByteArray.prototype.getData=function(){var rv="";for(var p=0;p<this.pages.length;p++){for(var i=0;i<ByteArray.pageSize;i++){rv+=ByteArray.charMap[this.pages[p][i]]}}return rv};ByteArray.prototype.writeByte=function(val){if(this.cursor>=ByteArray.pageSize)this.newPage();this.pages[this.page][this.cursor++]=val};ByteArray.prototype.writeUTFBytes=function(string){for(var l=string.length,i=0;i<l;i++)this.writeByte(string.charCodeAt(i))};ByteArray.prototype.writeBytes=function(array,offset,length){for(var l=length||array.length,i=offset||0;i<l;i++)this.writeByte(array[i])};function GIFEncoder(width,height){this.width=~~width;this.height=~~height;this.transparent=null;this.transIndex=0;this.repeat=-1;this.delay=0;this.image=null;this.pixels=null;this.indexedPixels=null;this.colorDepth=null;this.colorTab=null;this.neuQuant=null;this.usedEntry=new Array;this.palSize=7;this.dispose=-1;this.firstFrame=true;this.sample=10;this.dither=false;this.globalPalette=false;this.out=new ByteArray}GIFEncoder.prototype.setDelay=function(milliseconds){this.delay=Math.round(milliseconds/10)};GIFEncoder.prototype.setFrameRate=function(fps){this.delay=Math.round(100/fps)};GIFEncoder.prototype.setDispose=function(disposalCode){if(disposalCode>=0)this.dispose=disposalCode};GIFEncoder.prototype.setRepeat=function(repeat){this.repeat=repeat};GIFEncoder.prototype.setTransparent=function(color){this.transparent=color};GIFEncoder.prototype.addFrame=function(imageData){this.image=imageData;this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null;this.getImagePixels();this.analyzePixels();if(this.globalPalette===true)this.globalPalette=this.colorTab;if(this.firstFrame){this.writeLSD();this.writePalette();if(this.repeat>=0){this.writeNetscapeExt()}}this.writeGraphicCtrlExt();this.writeImageDesc();if(!this.firstFrame&&!this.globalPalette)this.writePalette();this.writePixels();this.firstFrame=false};GIFEncoder.prototype.finish=function(){this.out.writeByte(59)};GIFEncoder.prototype.setQuality=function(quality){if(quality<1)quality=1;this.sample=quality};GIFEncoder.prototype.setDither=function(dither){if(dither===true)dither="FloydSteinberg";this.dither=dither};GIFEncoder.prototype.setGlobalPalette=function(palette){this.globalPalette=palette};GIFEncoder.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};GIFEncoder.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};GIFEncoder.prototype.analyzePixels=function(){if(!this.colorTab){this.neuQuant=new NeuQuant(this.pixels,this.sample);this.neuQuant.buildColormap();this.colorTab=this.neuQuant.getColormap()}if(this.dither){this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null)}else{this.indexPixels()}this.pixels=null;this.colorDepth=8;this.palSize=7;if(this.transparent!==null){this.transIndex=this.findClosest(this.transparent,true)}};GIFEncoder.prototype.indexPixels=function(imgq){var nPix=this.pixels.length/3;this.indexedPixels=new Uint8Array(nPix);var k=0;for(var j=0;j<nPix;j++){var index=this.findClosestRGB(this.pixels[k++]&255,this.pixels[k++]&255,this.pixels[k++]&255);this.usedEntry[index]=true;this.indexedPixels[j]=index}};GIFEncoder.prototype.ditherPixels=function(kernel,serpentine){var kernels={FalseFloydSteinberg:[[3/8,1,0],[3/8,0,1],[2/8,1,1]],FloydSteinberg:[[7/16,1,0],[3/16,-1,1],[5/16,0,1],[1/16,1,1]],Stucki:[[8/42,1,0],[4/42,2,0],[2/42,-2,1],[4/42,-1,1],[8/42,0,1],[4/42,1,1],[2/42,2,1],[1/42,-2,2],[2/42,-1,2],[4/42,0,2],[2/42,1,2],[1/42,2,2]],Atkinson:[[1/8,1,0],[1/8,2,0],[1/8,-1,1],[1/8,0,1],[1/8,1,1],[1/8,0,2]]};if(!kernel||!kernels[kernel]){throw"Unknown dithering kernel: "+kernel}var ds=kernels[kernel];var index=0,height=this.height,width=this.width,data=this.pixels;var direction=serpentine?-1:1;this.indexedPixels=new Uint8Array(this.pixels.length/3);for(var y=0;y<height;y++){if(serpentine)direction=direction*-1;for(var x=direction==1?0:width-1,xend=direction==1?width:0;x!==xend;x+=direction){index=y*width+x;var idx=index*3;var r1=data[idx];var g1=data[idx+1];var b1=data[idx+2];idx=this.findClosestRGB(r1,g1,b1);this.usedEntry[idx]=true;this.indexedPixels[index]=idx;idx*=3;var r2=this.colorTab[idx];var g2=this.colorTab[idx+1];var b2=this.colorTab[idx+2];var er=r1-r2;var eg=g1-g2;var eb=b1-b2;for(var i=direction==1?0:ds.length-1,end=direction==1?ds.length:0;i!==end;i+=direction){var x1=ds[i][1];var y1=ds[i][2];if(x1+x>=0&&x1+x<width&&y1+y>=0&&y1+y<height){var d=ds[i][0];idx=index+x1+y1*width;idx*=3;data[idx]=Math.max(0,Math.min(255,data[idx]+er*d));data[idx+1]=Math.max(0,Math.min(255,data[idx+1]+eg*d));data[idx+2]=Math.max(0,Math.min(255,data[idx+2]+eb*d))}}}}};GIFEncoder.prototype.findClosest=function(c,used){return this.findClosestRGB((c&16711680)>>16,(c&65280)>>8,c&255,used)};GIFEncoder.prototype.findClosestRGB=function(r,g,b,used){if(this.colorTab===null)return-1;if(this.neuQuant&&!used){return this.neuQuant.lookupRGB(r,g,b)}var c=b|g<<8|r<<16;var minpos=0;var dmin=256*256*256;var len=this.colorTab.length;for(var i=0,index=0;i<len;index++){var dr=r-(this.colorTab[i++]&255);var dg=g-(this.colorTab[i++]&255);var db=b-(this.colorTab[i++]&255);var d=dr*dr+dg*dg+db*db;if((!used||this.usedEntry[index])&&d<dmin){dmin=d;minpos=index}}return minpos};GIFEncoder.prototype.getImagePixels=function(){var w=this.width;var h=this.height;this.pixels=new Uint8Array(w*h*3);var data=this.image;var srcPos=0;var count=0;for(var i=0;i<h;i++){for(var j=0;j<w;j++){this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];this.pixels[count++]=data[srcPos++];srcPos++}}};GIFEncoder.prototype.writeGraphicCtrlExt=function(){this.out.writeByte(33);this.out.writeByte(249);this.out.writeByte(4);var transp,disp;if(this.transparent===null){transp=0;disp=0}else{transp=1;disp=2}if(this.dispose>=0){disp=dispose&7}disp<<=2;this.out.writeByte(0|disp|0|transp);this.writeShort(this.delay);this.out.writeByte(this.transIndex);this.out.writeByte(0)};GIFEncoder.prototype.writeImageDesc=function(){this.out.writeByte(44);this.writeShort(0);this.writeShort(0);this.writeShort(this.width);this.writeShort(this.height);if(this.firstFrame||this.globalPalette){this.out.writeByte(0)}else{this.out.writeByte(128|0|0|0|this.palSize)}};GIFEncoder.prototype.writeLSD=function(){this.writeShort(this.width);this.writeShort(this.height);this.out.writeByte(128|112|0|this.palSize);this.out.writeByte(0);this.out.writeByte(0)};GIFEncoder.prototype.writeNetscapeExt=function(){this.out.writeByte(33);this.out.writeByte(255);this.out.writeByte(11);this.out.writeUTFBytes("NETSCAPE2.0");this.out.writeByte(3);this.out.writeByte(1);this.writeShort(this.repeat);this.out.writeByte(0)};GIFEncoder.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);var n=3*256-this.colorTab.length;for(var i=0;i<n;i++)this.out.writeByte(0)};GIFEncoder.prototype.writeShort=function(pValue){this.out.writeByte(pValue&255);this.out.writeByte(pValue>>8&255)};GIFEncoder.prototype.writePixels=function(){var enc=new LZWEncoder(this.width,this.height,this.indexedPixels,this.colorDepth);enc.encode(this.out)};GIFEncoder.prototype.stream=function(){return this.out};module.exports=GIFEncoder},{"./LZWEncoder.js":2,"./TypedNeuQuant.js":3}],2:[function(require,module,exports){var EOF=-1;var BITS=12;var HSIZE=5003;var masks=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535];function LZWEncoder(width,height,pixels,colorDepth){var initCodeSize=Math.max(2,colorDepth);var accum=new Uint8Array(256);var htab=new Int32Array(HSIZE);var codetab=new Int32Array(HSIZE);var cur_accum,cur_bits=0;var a_count;var free_ent=0;var maxcode;var clear_flg=false;var g_init_bits,ClearCode,EOFCode;function char_out(c,outs){accum[a_count++]=c;if(a_count>=254)flush_char(outs)}function cl_block(outs){cl_hash(HSIZE);free_ent=ClearCode+2;clear_flg=true;output(ClearCode,outs)}function cl_hash(hsize){for(var i=0;i<hsize;++i)htab[i]=-1}function compress(init_bits,outs){var fcode,c,i,ent,disp,hsize_reg,hshift;g_init_bits=init_bits;clear_flg=false;n_bits=g_init_bits;maxcode=MAXCODE(n_bits);ClearCode=1<<init_bits-1;EOFCode=ClearCode+1;free_ent=ClearCode+2;a_count=0;ent=nextPixel();hshift=0;for(fcode=HSIZE;fcode<65536;fcode*=2)++hshift;hshift=8-hshift;hsize_reg=HSIZE;cl_hash(hsize_reg);output(ClearCode,outs);outer_loop:while((c=nextPixel())!=EOF){fcode=(c<<BITS)+ent;i=c<<hshift^ent;if(htab[i]===fcode){ent=codetab[i];continue}else if(htab[i]>=0){disp=hsize_reg-i;if(i===0)disp=1;do{if((i-=disp)<0)i+=hsize_reg;if(htab[i]===fcode){ent=codetab[i];continue outer_loop}}while(htab[i]>=0)}output(ent,outs);ent=c;if(free_ent<1<<BITS){codetab[i]=free_ent++;htab[i]=fcode}else{cl_block(outs)}}output(ent,outs);output(EOFCode,outs)}function encode(outs){outs.writeByte(initCodeSize);remaining=width*height;curPixel=0;compress(initCodeSize+1,outs);outs.writeByte(0)}function flush_char(outs){if(a_count>0){outs.writeByte(a_count);outs.writeBytes(accum,0,a_count);a_count=0}}function MAXCODE(n_bits){return(1<<n_bits)-1}function nextPixel(){if(remaining===0)return EOF;--remaining;var pix=pixels[curPixel++];return pix&255}function output(code,outs){cur_accum&=masks[cur_bits];if(cur_bits>0)cur_accum|=code<<cur_bits;else cur_accum=code;cur_bits+=n_bits;while(cur_bits>=8){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}if(free_ent>maxcode||clear_flg){if(clear_flg){maxcode=MAXCODE(n_bits=g_init_bits);clear_flg=false}else{++n_bits;if(n_bits==BITS)maxcode=1<<BITS;else maxcode=MAXCODE(n_bits)}}if(code==EOFCode){while(cur_bits>0){char_out(cur_accum&255,outs);cur_accum>>=8;cur_bits-=8}flush_char(outs)}}this.encode=encode}module.exports=LZWEncoder},{}],3:[function(require,module,exports){var ncycles=100;var netsize=256;var maxnetpos=netsize-1;var netbiasshift=4;var intbiasshift=16;var intbias=1<<intbiasshift;var gammashift=10;var gamma=1<<gammashift;var betashift=10;var beta=intbias>>betashift;var betagamma=intbias<<gammashift-betashift;var initrad=netsize>>3;var radiusbiasshift=6;var radiusbias=1<<radiusbiasshift;var initradius=initrad*radiusbias;var radiusdec=30;var alphabiasshift=10;var initalpha=1<<alphabiasshift;var alphadec;var radbiasshift=8;var radbias=1<<radbiasshift;var alpharadbshift=alphabiasshift+radbiasshift;var alpharadbias=1<<alpharadbshift;var prime1=499;var prime2=491;var prime3=487;var prime4=503;var minpicturebytes=3*prime4;function NeuQuant(pixels,samplefac){var network;var netindex;var bias;var freq;var radpower;function init(){network=[];netindex=new Int32Array(256);bias=new Int32Array(netsize);freq=new Int32Array(netsize);radpower=new Int32Array(netsize>>3);var i,v;for(i=0;i<netsize;i++){v=(i<<netbiasshift+8)/netsize;network[i]=new Float64Array([v,v,v,0]);freq[i]=intbias/netsize;bias[i]=0}}function unbiasnet(){for(var i=0;i<netsize;i++){network[i][0]>>=netbiasshift;network[i][1]>>=netbiasshift;network[i][2]>>=netbiasshift;network[i][3]=i}}function altersingle(alpha,i,b,g,r){network[i][0]-=alpha*(network[i][0]-b)/initalpha;network[i][1]-=alpha*(network[i][1]-g)/initalpha;network[i][2]-=alpha*(network[i][2]-r)/initalpha}function alterneigh(radius,i,b,g,r){var lo=Math.abs(i-radius);var hi=Math.min(i+radius,netsize);var j=i+1;var k=i-1;var m=1;var p,a;while(j<hi||k>lo){a=radpower[m++];if(j<hi){p=network[j++];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}if(k>lo){p=network[k--];p[0]-=a*(p[0]-b)/alpharadbias;p[1]-=a*(p[1]-g)/alpharadbias;p[2]-=a*(p[2]-r)/alpharadbias}}}function contest(b,g,r){var bestd=~(1<<31);var bestbiasd=bestd;var bestpos=-1;var bestbiaspos=bestpos;var i,n,dist,biasdist,betafreq;for(i=0;i<netsize;i++){n=network[i];dist=Math.abs(n[0]-b)+Math.abs(n[1]-g)+Math.abs(n[2]-r);if(dist<bestd){bestd=dist;bestpos=i}biasdist=dist-(bias[i]>>intbiasshift-netbiasshift);if(biasdist<bestbiasd){bestbiasd=biasdist;bestbiaspos=i}betafreq=freq[i]>>betashift;freq[i]-=betafreq;bias[i]+=betafreq<<gammashift}freq[bestpos]+=beta;bias[bestpos]-=betagamma;return bestbiaspos}function inxbuild(){var i,j,p,q,smallpos,smallval,previouscol=0,startpos=0;for(i=0;i<netsize;i++){p=network[i];smallpos=i;smallval=p[1];for(j=i+1;j<netsize;j++){q=network[j];if(q[1]<smallval){smallpos=j;smallval=q[1]}}q=network[smallpos];if(i!=smallpos){j=q[0];q[0]=p[0];p[0]=j;j=q[1];q[1]=p[1];p[1]=j;j=q[2];q[2]=p[2];p[2]=j;j=q[3];q[3]=p[3];p[3]=j}if(smallval!=previouscol){netindex[previouscol]=startpos+i>>1;for(j=previouscol+1;j<smallval;j++)netindex[j]=i;previouscol=smallval;startpos=i}}netindex[previouscol]=startpos+maxnetpos>>1;for(j=previouscol+1;j<256;j++)netindex[j]=maxnetpos}function inxsearch(b,g,r){var a,p,dist;var bestd=1e3;var best=-1;var i=netindex[g];var j=i-1;while(i<netsize||j>=0){if(i<netsize){p=network[i];dist=p[1]-g;if(dist>=bestd)i=netsize;else{i++;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}if(j>=0){p=network[j];dist=g-p[1];if(dist>=bestd)j=-1;else{j--;if(dist<0)dist=-dist;a=p[0]-b;if(a<0)a=-a;dist+=a;if(dist<bestd){a=p[2]-r;if(a<0)a=-a;dist+=a;if(dist<bestd){bestd=dist;best=p[3]}}}}}return best}function learn(){var i;var lengthcount=pixels.length;var alphadec=30+(samplefac-1)/3;var samplepixels=lengthcount/(3*samplefac);var delta=~~(samplepixels/ncycles);var alpha=initalpha;var radius=initradius;var rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(i=0;i<rad;i++)radpower[i]=alpha*((rad*rad-i*i)*radbias/(rad*rad));var step;if(lengthcount<minpicturebytes){samplefac=1;step=3}else if(lengthcount%prime1!==0){step=3*prime1}else if(lengthcount%prime2!==0){step=3*prime2}else if(lengthcount%prime3!==0){step=3*prime3}else{step=3*prime4}var b,g,r,j;var pix=0;i=0;while(i<samplepixels){b=(pixels[pix]&255)<<netbiasshift;g=(pixels[pix+1]&255)<<netbiasshift;r=(pixels[pix+2]&255)<<netbiasshift;j=contest(b,g,r);altersingle(alpha,j,b,g,r);if(rad!==0)alterneigh(rad,j,b,g,r);pix+=step;if(pix>=lengthcount)pix-=lengthcount;i++;if(delta===0)delta=1;if(i%delta===0){alpha-=alpha/alphadec;radius-=radius/radiusdec;rad=radius>>radiusbiasshift;if(rad<=1)rad=0;for(j=0;j<rad;j++)radpower[j]=alpha*((rad*rad-j*j)*radbias/(rad*rad))}}}function buildColormap(){init();learn();unbiasnet();inxbuild()}this.buildColormap=buildColormap;function getColormap(){var map=[];var index=[];for(var i=0;i<netsize;i++)index[network[i][3]]=i;var k=0;for(var l=0;l<netsize;l++){var j=index[l];map[k++]=network[j][0];map[k++]=network[j][1];map[k++]=network[j][2]}return map}this.getColormap=getColormap;this.lookupRGB=inxsearch}module.exports=NeuQuant},{}],4:[function(require,module,exports){var GIFEncoder,renderFrame;GIFEncoder=require("./GIFEncoder.js");renderFrame=function(frame){var encoder,page,stream,transfer;encoder=new GIFEncoder(frame.width,frame.height);if(frame.index===0){encoder.writeHeader()}else{encoder.firstFrame=false}encoder.setTransparent(frame.transparent);encoder.setRepeat(frame.repeat);encoder.setDelay(frame.delay);encoder.setQuality(frame.quality);encoder.setDither(frame.dither);encoder.setGlobalPalette(frame.globalPalette);encoder.addFrame(frame.data);if(frame.last){encoder.finish()}if(frame.globalPalette===true){frame.globalPalette=encoder.getGlobalPalette()}stream=encoder.stream();frame.data=stream.pages;frame.cursor=stream.cursor;frame.pageSize=stream.constructor.pageSize;if(frame.canTransfer){transfer=function(){var i,len,ref,results;ref=frame.data;results=[];for(i=0,len=ref.length;i<len;i++){page=ref[i];results.push(page.buffer)}return results}();return self.postMessage(frame,transfer)}else{return self.postMessage(frame)}};self.onmessage=function(event){return renderFrame(event.data)}},{"./GIFEncoder.js":1}]},{},[4]);
|
|
115
115
|
`],{type:"application/javascript"}))})}async function lk(e){for(let t=0;t<30;t++){let t=await e();if(t)return t;await new Promise(e=>setTimeout(e,50))}}function lP(e){return new Promise(t=>{let n=document.createElement("img");n.onload=async()=>{0===n.width||0===n.height?t(await iX(e)):t({width:n.width,height:n.height})},n.crossOrigin="anonymous",n.src=e})}function lT(e){return new Promise((t,n)=>{let r=document.createElement("img");r.onload=()=>{t(r)},r.onerror=e=>{n(e)},r.crossOrigin="anonymous",r.src=e})}async function lA(e,t){let n,r;let i=await lT(e),o=document.createElement("canvas");o.width=2*i.width,o.height=2*i.height,o.getContext("2d").drawImage(i,0,0,o.width,o.height);let a=document.createElement("canvas");a.width=t.width,a.height=t.height;let l=a.getContext("2d"),{cropX:s,cropY:u}=t,c=o.width*t.cropWidth,d=o.height*t.cropHeight,h=t.width/t.height,f=c/d;return"svg"===t.type?(n=c,r=d):h>=f?(n=c,r=c/h):(n=d*h,r=d),l.drawImage(o,s*o.width,u*o.height,n,r,0,0,a.width,a.height),a.toDataURL("image/png")}function lN(e,t){let n,r;let{width:i,height:o}=e,a=i/o;a>=t.width/t.height?(n=t.width,r=t.width/a):(n=t.height*a,r=t.height);let l=(t.width-n)/2,s=(t.height-r)/2;return{cropX:l/t.width,cropY:s/t.height,cropWidth:n/t.width,cropHeight:r/t.height}}let lj=(e,t,...n)=>({type:e,props:t,children:n||[]}),lR=async({element:e,page:t,store:n})=>{let r,i,{src:o}=e;"svg"===e.type&&Object.keys(e.colorsReplace).length&&(o=iJ(await iK(o),new Map(Object.entries(e.colorsReplace))));let a="";e.flipX&&(a+="scaleX(-1)"),e.flipY&&(a+="scaleY(-1)"),a||(a="none");let l={};if(e.clipSrc){let t=await i$(e.clipSrc);l["clip-path"]=`url(${t})`}let s=await lT(o),u=s.width*e.cropWidth,c=s.height*e.cropHeight,d=e.width/e.height;"svg"===e.type?(r=u,i=c):d>=u/c?(r=u,i=u/d):(r=c*d,i=c);let h=r/s.width,f=i/s.height,p=r/i>e.width/e.height?e.height/i:e.width/r,g=r*p/h,m=i*p/f,v=e.cropX*p*s.width,y=e.cropY*p*s.height;return lj("div",{style:{...l,width:"100%",height:"100%","border-radius":e.cornerRadius+"px",border:e.borderSize?`${e.borderSize}px solid ${e.borderColor}`:"none",background:`url(${o})`,transform:a,"background-size":`${Math.round(g)}px ${Math.round(m)}px`,"background-position-x":`${-Math.round(v)}px`,"background-position-y":`${-Math.round(y)}px`}})},lI=({element:e,type:t})=>{let n={"stroke-width":e.height,stroke:e.color,"line-cap":"round","stroke-linejoin":"round",opacity:e.opacity};return"arrow"===t||"triangle"===t?lj("polyline",{points:`${3*e.height},${-(2*e.height)} 0,0 ${3*e.height},${2*e.height}`,...n}):"bar"===t?lj("polyline",{points:`0,${-(2*e.height)} 0,${2*e.height}`,...n}):"circle"===t?lj("circle",{r:e.height,...n}):"square"===t?lj("polyline",{points:`${-e.height},${-e.height} ${-e.height},${e.height} ${e.height},${e.height} ${e.height},${-e.height}`,...n}):null},lL={image:lR,svg:lR,text:async({element:e,page:t,store:n})=>{let r={};e.fill.indexOf("gradient")>=0&&(r={...r,"background-color":e.fill,"background-image":e.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"});let i=e.backgroundPadding*(e.fontSize*e.lineHeight),o=lj("div",{style:{position:"absolute",top:-i/2+"px",left:-i/2+"px",display:e.backgroundEnabled?"block":"none",width:e.width+i+"px",height:e.height+i+"px","background-color":e.backgroundColor,"border-radius":e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)+"px"}}),a=lj("div",{style:{...r,position:"absolute",top:0,left:0,width:e.width+"px",color:e.fill,"white-space":"pre-wrap","font-size":e.fontSize+"px","text-align":e.align,"font-family":e.fontFamily,"text-decoration":e.textDecoration||"none","line-height":e.lineHeight,"letter-spacing":e.letterSpacing+"em","font-style":e.fontStyle,"font-weight":e.fontWeight,"-webkit-text-stroke":`${e.strokeWidth}px ${e.stroke}`,"text-stroke":`${e.strokeWidth}px ${e.stroke}`}},e.text.split("\n").join("<br />"));return lj("div",{style:{position:"relative"}},o,a)},line:async({element:e,page:t,store:n})=>lj("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},lj("rect",{x:0,y:0,width:e.width,height:e.height,fill:e.color}),lj("g",{transform:`translate(0 ${e.height/2})`},lI({element:e,type:e.startHead})),lj("g",{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},lI({element:e,type:e.endHead}))),figure:async({element:e,page:t,store:n,elementHook:r})=>{let i=lj("div",{innerHTML:aL(e)});return r&&r({dom:i,element:e})||i},group:async({element:e,page:t,store:n,elementHook:r})=>{let i=await Promise.all(e.children.map(e=>lM({element:e,page:t,store:n,elementHook:r}))),o=lj("div",{style:{"transform-origin":"top left",opacity:e.opacity}},...i);return r&&r({dom:o,element:e})||o}};async function lM({element:e,page:t,store:n,elementHook:r}){let i=await lL[e.type];i||(i=()=>lj("div",{}),console.error(`HTML export does not support ${e.type} type...`));let o=await i({element:e,page:t,store:n}),a=[];e.blurEnabled&&a.push(`blur(${e.blurRadius/2}px)`),e.brightnessEnabled&&a.push(`brightness(${100*e.brightness+100}%)`),e.sepiaEnabled&&a.push("sepia()"),e.grayscaleEnabled&&a.push("grayscale()"),e.shadowEnabled&&a.push(`drop-shadow(${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${e.shadowColor})`);let l=lj("div",{style:{position:"absolute",left:e.x+"px",top:e.y+"px",width:e.width+"px",height:e.height+"px",transform:`rotate(${e.rotation}deg)`,"transform-origin":"top left",opacity:e.opacity,filter:a.join(" ")||"none"}},o);return r&&r({dom:l,element:e})||l}async function lD({page:e,store:t,elementHook:n}){let r=await Promise.all(e.children.map(r=>lM({element:r,page:e,store:t,elementHook:n}))),i={};if(e.background.indexOf("url")>=0||e.background.indexOf("http")>=0||e.background.indexOf(".jpg")>=0||e.background.indexOf(".png")>=0||e.background.indexOf(".jpeg")>=0){let{width:n,height:i}=await lT(e.background),o=await lR({element:{x:0,y:0,width:t.width,height:t.height,src:e.background,cornerRadius:0,...lN({width:t.width,height:t.height},{width:n,height:i})},page:e,store:t});r.unshift(o)}else i={...i,"background-color":e.background};return lj("div",{className:"page",style:{...i,width:t.width+"px",height:t.height+"px",border:"1px solid grey",overflow:"hidden",position:"relative"}},...r)}async function lF({json:e,elementHook:t}){let n=await Promise.all(e.pages.map(n=>lD({page:n,store:e,elementHook:t}))),r=[];e.pages.forEach(e=>{e.children.forEach(e=>{"text"===e.type&&-1===r.indexOf(e.fontFamily)&&r.push(e.fontFamily)})});let i=r.map(t=>e.fonts.find(e=>e.fontFamily===t)?lj("style",{},""):lj("link",{href:`https://fonts.googleapis.com/css?family=${t}`,rel:"stylesheet"}));return lj("div",{className:"design"},...i,...n)}let lz=(e,t)=>"object"==typeof t?`${e}="${Object.keys(t).map(e=>`${e}:${t[e]};`).join(" ")}"`:`${e}="${t}"`,lB=({dom:e})=>{if("string"==typeof e)return e;if(!e)return"";let{innerHTML:t,...n}=e.props;return`<${e.type} ${Object.keys(n).map(t=>lz(t,e.props[t])).join(" ")}>${t||e.children.map(e=>lB({dom:e})).join("")}</${e.type}>`};async function lU({json:e,elementHook:t}){return lB({dom:await lF({json:e,elementHook:t})})}let lH=(e,t,...n)=>({type:e,props:t,children:n||[]}),lV=async e=>{let t=await lT(e),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").drawImage(t,0,0),n.toDataURL("image/png")},lq=async({element:e,page:t,store:n})=>{let r,i,{src:o}=e;"svg"===e.type&&(o=iJ(await iK(o),new Map(Object.entries(e.colorsReplace))));let a="";e.flipX&&(a+="scaleX(-1)"),e.flipY&&(a+="scaleY(-1)");let l={};if(e.clipSrc){let t=await i$(e.clipSrc);l["clip-path"]=`url(${t})`}let s=await lT(o),u=s.width*e.cropWidth,c=s.height*e.cropHeight,d=e.width/e.height;"svg"===e.type?(r=u,i=c):d>=u/c?(r=u,i=u/d):(r=c*d,i=c);let h=r/s.width,f=i/s.height,p=r/i>e.width/e.height?e.height/i:e.width/r,g=r*p/h,m=i*p/f,v=e.cropX*p*s.width,y=e.cropY*p*s.height,b=`clip-${Math.random()}`;return lH("g",{style:{"clip-path":l["clip-path"],transform:a}},lH("defs",{},lH("clipPath",{id:b},lH("rect",{x:v,y:y,width:g,height:m}))),lH("image",{"xlink:href":await lV(o),width:e.width,height:e.height,preserveAspectRatio:"none","clip-path":`url(#${b})`}))},lG=({element:e,type:t})=>{let n={"stroke-width":e.height,stroke:e.color,"line-cap":"round","stroke-linejoin":"round",opacity:e.opacity};return"arrow"===t||"triangle"===t?lH("polyline",{points:`${3*e.height},${-(2*e.height)} 0,0 ${3*e.height},${2*e.height}`,...n}):"bar"===t?lH("polyline",{points:`0,${-(2*e.height)} 0,${2*e.height}`,...n}):"circle"===t?lH("circle",{r:e.height,...n}):"square"===t?lH("polyline",{points:`${-e.height},${-e.height} ${-e.height},${e.height} ${e.height},${e.height} ${e.height},${-e.height}`,...n}):null},lW={image:lq,svg:lq,text:async({element:e,page:t,store:n})=>{let r={};e.fill.indexOf("gradient")>=0&&(r={...r,"background-color":e.fill,"background-image":e.fill,"background-clip":"text","text-fill-color":"transparent","-webkit-background-clip":"text","-webkit-text-fill-color":"transparent"});let i=e.backgroundPadding*(e.fontSize*e.lineHeight),o=lH("div",{style:{position:"absolute",top:-i/2+"px",left:-i/2+"px",display:e.backgroundEnabled?"block":"none",width:e.width+i+"px",height:e.height+i+"px","background-color":e.backgroundColor,"border-radius":e.backgroundCornerRadius*(e.fontSize*e.lineHeight*.5)+"px"}}),a=lH("div",{style:{...r,position:"absolute",top:0,left:0,width:e.width+"px",color:e.fill,"white-space":"pre-wrap","font-size":e.fontSize+"px","text-align":e.align,"font-family":e.fontFamily,"text-decoration":e.textDecoration||"none","line-height":e.lineHeight,"letter-spacing":e.letterSpacing+"em","font-style":e.fontStyle,"font-weight":e.fontWeight,"-webkit-text-stroke":`${e.strokeWidth}px ${e.stroke}`,"text-stroke":`${e.strokeWidth}px ${e.stroke}`}},e.text.split("\n").join("<br />"));return lH("foreignObject",{width:e.width,height:e.height},lH("div",{style:{position:"relative"},xmlns:"http://www.w3.org/1999/xhtml"},o,a))},line:async({element:e,page:t,store:n})=>lH("svg",{style:{width:"100%",height:"100%",contain:"layout style size",overflow:"visible"}},lH("rect",{x:0,y:0,width:e.width,height:e.height,fill:e.color}),lH("g",{transform:`translate(0 ${e.height/2})`},lG({element:e,type:e.startHead})),lH("g",{transform:`translate(${e.width} ${e.height/2}) rotate(180)`},lG({element:e,type:e.endHead}))),group:async({element:e,page:t,store:n,elementHook:r})=>{let i=await Promise.all(e.children.map(e=>l$({element:e,page:t,store:n,elementHook:r}))),o=lH("g",{opacity:e.opacity,style:{"transform-origin":"top left"}},...i);return r&&r({dom:o,element:e})||o}};async function l$({element:e,page:t,store:n,elementHook:r}){let i=await lW[e.type];i||(i=()=>lH("div",{}),console.error(`HTML export does not support ${e.type} type...`));let o=await i({element:e,page:t,store:n}),a=[];e.blurEnabled&&a.push(`blur(${e.blurRadius/2}px)`),e.brightnessEnabled&&a.push(`brightness(${100*e.brightness+100}%)`),e.sepiaEnabled&&a.push("sepia()"),e.grayscaleEnabled&&a.push("grayscale()"),e.shadowEnabled&&a.push(`drop-shadow(${e.shadowOffsetX}px ${e.shadowOffsetY}px ${e.shadowBlur}px ${e.shadowColor})`);let l=lH("g",{transform:`translate(${e.x}, ${e.y}) rotate(${e.rotation})`,rotation:e.rotation,width:e.width,height:e.height,opacity:e.opacity,style:{"transform-origin":"top left",filter:a.join(" ")}},o);return r&&r({dom:l,element:e})||l}async function lK({page:e,store:t,elementHook:n}){let r=await Promise.all(e.children.map(r=>l$({element:r,page:e,store:t,elementHook:n}))),i={};if(e.background.indexOf("url")>=0||e.background.indexOf("http")>=0||e.background.indexOf(".jpg")>=0||e.background.indexOf(".png")>=0||e.background.indexOf(".jpeg")>=0){let n=await lT(e.background),r=await lA(e.background,{width:t.width,height:t.height,x:0,y:0,...lN({width:t.width,height:t.height},{width:n.width,height:n.height})});i={...i,"background-image":`url(${r})`}}return lH("g",{className:"page",style:{...i,background:e.background}},lH("rect",{x:0,y:0,width:t.width,height:t.height,fill:e.background}),...r)}async function lY({json:e,elementHook:t}){let n=await Promise.all(e.pages.map(n=>lK({page:n,store:e,elementHook:t}))),r=[];e.pages.forEach(e=>{e.children.forEach(e=>{"text"===e.type&&-1===r.indexOf(e.fontFamily)&&r.push(e.fontFamily)})});let i=r.map(t=>e.fonts.find(e=>e.fontFamily===t)?lH("style",{},""):lH("link",{href:`https://fonts.googleapis.com/css?family=${t}`,rel:"stylesheet"}));return lH("svg",{xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:`0 0 ${e.width} ${e.height}`,preserveAspectRatio:"xMidYMin slice"},...i,...n)}let lX=(e,t)=>"object"==typeof t?`${e}="${Object.keys(t).map(e=>`${e}:${t[e]};`).join(" ")}"`:`${e}="${t}"`,lZ=({dom:e})=>"string"==typeof e?e:e?`<${e.type} ${Object.keys(e.props).map(t=>lX(t,e.props[t])).join(" ")}>${e.children.map(e=>lZ({dom:e})).join("")}</${e.type}>
|
|
116
|
-
`:"";async function lQ({json:e,elementHook:t}){return lZ({dom:await lY({json:e,elementHook:t})})}var lx=h("58B0H");let lJ=(0,lx.types).model("Page",{id:lx.types.identifier,children:(0,lx.types).array((0,lx.types).late(()=>sa)),width:(0,lx.types).optional((0,lx.types).union(lx.types.number,(0,lx.types).literal("auto")),"auto"),height:(0,lx.types).optional((0,lx.types).union(lx.types.number,(0,lx.types).literal("auto")),"auto"),background:"white",bleed:0,custom:(0,lx.types).frozen(),duration:5e3,_exporting:!1,_rendering:!1}).postProcessSnapshot(e=>{let t={...e},n={};for(var r in t)"_"!==r[0]&&(n[r]=e[r]);return n}).views(e=>({get store(){return(0,lx.getParentOfType)(e,l1)},get startTime(){let t=0;for(let n of e.store.pages){if(n.id===e.id)break;t+=n.duration}return t}})).views(e=>({get computedWidth(){if("auto"===e.width)return e.store.width;return e.width},get computedHeight(){if("auto"===e.height)return e.store.height;return e.height}})).actions(e=>({toJSON:()=>JSON.parse(JSON.stringify((0,lx.getSnapshot)(e))),_forEachElementUp(t,n){let r=t.map(t=>({id:t,index:e.children.findIndex(e=>e.id===t)}));for(let{index:i}of(r.sort((e,t)=>t.index-e.index),r)){if(-1==i)continue;let r=i<e.children.length-1&&e.children[i+1],o=t.indexOf(r?.id)>=0;i===e.children.length-1||o||n(i)}},_forEachElementDown(t,n){let r=t.map(t=>({id:t,index:e.children.findIndex(e=>e.id===t)}));for(let{index:i}of(r.sort((e,t)=>e.index-t.index),r)){if(-1==i)continue;let r=i>0&&e.children[i-1],o=t.indexOf(r?.id)>=0;0===i||o||n(i)}return!1}})).actions(e=>({clone(t={}){let n=e.toJSON();n.children.forEach(e=>{e.id=l_(10),si(e,e=>{e.id=l_(10)})});let r={...n,id:l_(10),...t},i=e.store.addPage(r),o=e.store.pages.indexOf(e);i.setZIndex(o+1),i.select()},setZIndex(t){e.store.setPageZIndex(e.id,t)},set(t){Object.assign(e,t)},select(){e.store.selectPage(e.id)},addElement(t,{skipSelect:n=!1}={}){let r=su[t.type];if(!r){console.error("Can not find model with type "+t.type);return}t.children&&t.children.forEach(e=>{e.id=l_(10)});let i=r.create({id:l_(10),...t});return e.children.push(i),i.selectable&&!n&&e.store.selectElements([i.id]),i},canMoveElementsUp(t){let n=!1;return e._forEachElementUp(t,()=>{n=n||!0}),n},moveElementsUp(t){e._forEachElementUp(t,t=>{let n=e.children[t];(0,lx.detach)(n),e.children.splice(t+1,0,n)})},canMoveElementsTop(e){return this.canMoveElementsUp(e)},moveElementsTop(t){let n=[],r=[];e.children.forEach(e=>{t.indexOf(e.id)>=0?n.push(e):r.push(e)}),e.children.replace(r.concat(n))},canMoveElementsDown(t){let n=!1;return e._forEachElementDown(t,()=>{n=n||!0}),n},moveElementsDown(t){e._forEachElementDown(t,t=>{let n=e.children[t];(0,lx.detach)(n),e.children.splice(t-1,0,n)})},canMoveElementsBottom(e){return this.canMoveElementsDown(e)},moveElementsBottom(t){let n=[],r=[];e.children.forEach(e=>{t.indexOf(e.id)>=0?n.push(e):r.push(e)}),e.children.replace(n.concat(r))},setElementZIndex(t,n){let r=e.children.find(e=>e.id===t);r&&((0,lx.detach)(r),e.children.remove(r),e.children.splice(n,0,r))},setSize({width:t,height:n,useMagic:r,softChange:i}){if(r){let r=t/e.computedWidth,i=n/e.computedHeight,o=Math.min(r,i),a=Math.max(0,(t-e.computedWidth*o)/2),l=Math.max(0,(n-e.computedHeight*o)/2);si(e,async t=>{"group"!==t.type&&("image"===t.type&&t.x<1&&t.y<1&&t.width>=e.computedWidth-2&&t.height>=e.computedHeight-2?t.set({x:t.x*o,y:t.y*o,width:t.width*r,height:t.height*i,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(t.set({x:a+t.x*o,y:l+t.y*o,width:t.width*o,height:t.height*o}),"text"===t.type&&t.set({fontSize:t.fontSize*o})))})}i||(e.width=t),i||(e.height=n)}})).actions(e=>({moveElementUp(t){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),e.moveElementsUp([t])},moveElementDown(t){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),e.moveElementsDown([t])},moveElementTop(t){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),e.moveElementsTop([t])},moveElementBottom(t){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),e.moveElementsBottom([t])}}));(0,lx.setLivelinessChecking)("ignore");let l0=(0,lx.types).model("Font",{fontFamily:lx.types.string,url:(0,lx.types).optional(lx.types.string,""),styles:(0,lx.types).frozen()}).preProcessSnapshot(e=>({...e,fontFamily:e.fontFamily||e.name})),l1=(0,lx.types).model("Store",{role:"",pages:(0,lx.types).array(lJ),fonts:(0,lx.types).array(l0),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",selectedElementsIds:(0,lx.types).array(lx.types.string),animatedElementsIds:(0,lx.types).array(lx.types.string),history:(0,lx.types).optional(lS,{targetPath:"../pages"}),_elementsPixelRatio:2,_activePageId:""}).views(e=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),e.bleedVisible},get selectedElements(){return e.selectedElementsIds.map(t=>{for(let n of e.pages)for(let e of n.children)if(e.id===t)return e}).filter(e=>!!e)},get children(){return e.pages},get selectedShapes(){let t=[];return e.selectedElementsIds.forEach(n=>{for(let r of e.pages)for(let e of r.children)e.id===n&&"group"!==e.type&&t.push(e),"group"===e.type&&e.id===n&&t.push(...e.children)}),t},get activePage(){return e.pages.slice().find(t=>t.id===e._activePageId)||(e.pages.length?e.pages[0]:null)},get duration(){let t=0;return e.pages.forEach(e=>{t+=e.duration}),t},find(t){let n;return si({children:e.pages},e=>{if(!n&&t(e))return n=e,!0}),n},getElementById:t=>e.find(e=>e.id===t)})).actions(e=>{let t=0;return{afterCreate(){e.history.canUndo},setCurrentTime(t){e.currentTime=t},play({animatedElementsIds:n=[],currentTime:r=0}={}){e.animatedElementsIds=(0,lx.cast)(n),e.currentTime=r,e.isPlaying=!0,t=Date.now(),requestAnimationFrame(e.seek)},seek(){if(!e.isPlaying)return;let n=Date.now(),r=n-t;for(let i of(t=n,e.currentTime+=r,e.pages)){if(e.currentTime>=i.startTime&&e.currentTime<i.startTime+i.duration){e.selectPage(i.id);break}i.duration}e.isPlaying&&e.currentTime<e.duration?requestAnimationFrame(e.seek):e.stop()},stop(){e.isPlaying=!1,e.currentTime=0,e.animatedElementsIds=(0,lx.cast)([])}}}).actions(e=>({setUnit({unit:t,dpi:n}){e.unit=t||e.unit,e.dpi=n||e.dpi},setRole(t){e.role=t},addPage(t){let n=lJ.create({id:l_(10),...t});return e.pages.push(n),e._activePageId=n.id,n},selectPage(t){e._activePageId=t},selectElements(t){let n=t.map(t=>e.getElementById(t)).sort((e,t)=>e.page.children.indexOf(e)-e.page.children.indexOf(t)).filter(e=>!!e).map(e=>e.id);e.selectedElementsIds=(0,lx.cast)(n)},toggleBleed(t){e.bleedVisible=t??!e.bleedVisible},toggleRulers(t){e.rulesVisible=t??!e.rulesVisible},openSidePanel(t){e.openedSidePanel=t},setScale(t){e.scale=t},_setScaleToFit(t){e.scaleToFit=t},setElementsPixelRatio(t){e._elementsPixelRatio=t},setSize(t,n,r){e.pages.forEach(e=>{e.setSize({width:t,height:n,useMagic:r,softChange:!0})}),e.width=t,e.height=n},setPageZIndex(t,n){let r=e.pages.find(e=>e.id===t);r&&((0,lx.detach)(r),e.pages.remove(r),e.pages.splice(n,0,r))},deletePages(t){let n=e.pages.indexOf(e.activePage);t.forEach(t=>{let n=e.pages.find(e=>e.id===t);(0,lx.destroy)(n)});let r=Math.min(e.pages.length-1,n),i=e.pages[r];i&&(e._activePageId=i.id),e.selectedElementsIds=(0,lx.cast)(e.selectedElementsIds.filter(t=>e.getElementById(t)))},groupElements(t){let n=t.map(t=>e.getElementById(t));n.forEach(e=>{e&&(0,lx.detach)(e)});let r=e.activePage,i={id:l_(10),children:n,type:"group"};return r.children.push(i),e.selectedElementsIds=(0,lx.cast)([i.id]),i},ungroupElements(t){let n=t.map(t=>e.getElementById(t)),r=[];n.forEach(e=>{if(e&&"group"===e.type){let t=e.page,n=t.children.indexOf(e);e.children.forEach(e=>{r.push(e.id)}),e.children.forEach(e=>{(0,lx.detach)(e),t.children.push(e)}),t.children.splice(n,1)}}),e.selectedElementsIds=(0,lx.cast)(r)},deleteElements(t){t.forEach(t=>{e.pages.forEach(e=>{let n=e.children.find(e=>e.id===t);n&&(0,lx.destroy)(n)})}),e.selectedElementsIds=(0,lx.cast)(e.selectedElementsIds.filter(t=>e.getElementById(t)))},on(t,n){if("change"===t){let t=e.toJSON();return(0,lx.onSnapshot)(e,r=>{let i=e.toJSON();lE(t,i)||(t=i,n(i))})}},async _toCanvas({pixelRatio:t,ignoreBackground:n,pageId:r,mimeType:i,includeBleed:o}={}){let a=t||1;r=r||e.pages[0]?.id;let s=e.pages.find(e=>e.id===r);if(!s)throw Error(`No page for export with id ${r}`);s?.set({_exporting:!0});let u=await lk(()=>l(A).stages.find(e=>e.getAttr("pageId")===r));if(!u)throw Error(`Export is failed. Can not find stage for page ${r}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);let c=!!u.findOne(".page-container");await e.waitLoading();let d=u.findOne(".page-container");if(!d)throw Error(`Export is failed. Can't find page container. ${c}`);u.find("Transformer").forEach(e=>e.visible(!1)),d.find(".page-background").forEach(e=>e.shadowEnabled(!1)),d.find(".page-background").forEach(e=>e.strokeEnabled(!1)),d.find(".highlighter").forEach(e=>e.visible(!1));let h=d.findOne(".page-background-group"),f=h.clip();h.clip({x:null,y:null,width:null,height:null});let p=d.findOne(".elements-container"),g=p.clip();p.clip({x:null,y:null,width:null,height:null});let m=d.find(e=>e.getAttr("hideInExport"));m.forEach(e=>{e.setAttr("oldVisible",e.visible()),e.hide()});let v=d.find(e=>!e.visible()&&e.getAttr("editModeEnabled"));v.forEach(e=>{e.setAttr("oldVisible",e.visible()),e.show()}),n&&d.find(".page-background").forEach(e=>e.hide());let y=o?s.bleed:0,b=y;!e.bleedVisible&&o||(e.bleedVisible||o?e.bleedVisible&&o?b=0:e.bleedVisible&&!o&&(b=-s.bleed):b=0);let w=document.createElement("canvas");w.width=Math.round((s.computedWidth+2*y)*a),w.height=Math.round((s.computedHeight+2*y)*a);let x=w.getContext("2d");"image/jpeg"===i&&(x.fillStyle="white",x.fillRect(0,0,w.width,w.height));let _=d.scale();d.scale({x:1,y:1});let E=d.toCanvas({x:d.x()-b,y:d.y()-b,width:s.computedWidth+2*y,height:s.computedHeight+2*y,pixelRatio:a});return d.scale(_),x.drawImage(E,0,0,w.width,w.height),l(A).Util.releaseCanvas(E),n&&d.find(".page-background").forEach(e=>e.show()),m.forEach(e=>{e.visible(e.getAttr("oldVisible"))}),v.forEach(e=>{e.visible(e.getAttr("oldVisible"))}),d.find(".page-background").forEach(e=>e.shadowEnabled(!0)),d.find(".page-background").forEach(e=>e.strokeEnabled(!0)),u.find("Transformer").forEach(e=>e.visible(!0)),d.find(".highlighter").forEach(e=>e.visible(!0)),h.clip(f),p.clip(g),s?.set({_exporting:!1}),w},async toDataURL({pixelRatio:t,ignoreBackground:n,pageId:r,mimeType:i,includeBleed:o,quality:a}={}){let s=await e._toCanvas({pixelRatio:t,ignoreBackground:n,pageId:r,mimeType:i,includeBleed:o}),u=s.toDataURL(i,a);return l(A).Util.releaseCanvas(s),u},async toBlob({pixelRatio:t,ignoreBackground:n,pageId:r,mimeType:i,includeBleed:o,quality:a}={}){let s=await e._toCanvas({pixelRatio:t,ignoreBackground:n,pageId:r,mimeType:i,includeBleed:o}),u=new Promise(e=>{s.toBlob(e,i,a)});return l(A).Util.releaseCanvas(s),u},async saveAsImage({fileName:t,...n}={}){let r=n.mimeType||"image/png",i=r.split("/")[1];lC(await e.toDataURL(n),t||"polotno."+i,r)},async _toPDF(n){let r=n.dpi||e.dpi,i=n.parallel||1,o=n.unit||("px"===e.unit?"mm":e.unit),a=n.pixelRatio||1,l=n.pageIds||e.pages.map(e=>e.id),s=e.pages.filter(e=>l.includes(e.id)),u=await (t?Promise.resolve(t):new Promise(e=>{var n=document.createElement("script");n.onload=function(){e(t=window.jspdf.jsPDF)},n.src="https://unpkg.com/jspdf@2.2.0/dist/jspdf.umd.min.js",document.head.appendChild(n)})),c=e=>le({px:e,unit:o,dpi:r}),d=c(n.cropMarkSize||0),h=s[0]||{},f=n.includeBleed?h.bleed:0,p=c(h.computedWidth+2*f)+2*d,g=c(h.computedHeight+2*f)+2*d;var m=new u({unit:o,orientation:p>g?"landscape":"portrait",format:[p,g],compress:!0,putOnlyUsedFonts:!0});m.deletePage(1);let v=e._elementsPixelRatio;for(let t of(e.setElementsPixelRatio(a),await new Promise(e=>setTimeout(e)),((e,t)=>{for(var n=[],r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n})(s,i))){let r=t.map(async t=>{let r=n.includeBleed?t.bleed:0,i=c(t.computedWidth+2*r)+2*d,o=c(t.computedHeight+2*r)+2*d,l=0,s=a;for(;l<10;){2===(l+=1)&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");let r=await e.toDataURL({...n,pageId:t.id,pixelRatio:s});if(r.length>20)return{url:r,width:i,height:o};s*=.8}});(await Promise.all(r)).forEach(({url:e,width:t,height:n})=>{m.addPage([t,n],t>n?"landscape":"portrait"),d&&(m.setLineWidth(c(1)),m.line(2*d,0,2*d,d),m.line(0,2*d,d,2*d),m.line(t-2*d,0,t-2*d,d),m.line(t,2*d,t-d,2*d),m.line(0,n-2*d,d,n-2*d),m.line(2*d,n,2*d,n-d),m.line(t,n-2*d,t-d,n-2*d),m.line(t-2*d,n,t-2*d,n-d)),m.addImage(e,d,d,t-2*d,n-2*d,void 0,"FAST")})}return e.setElementsPixelRatio(v),m},toPDFDataURL:async t=>(await e._toPDF({mimeType:"image/jpeg",...t})).output("datauristring"),async toGIFDataURL(t={}){let n=t.pixelRatio||1,r=await lO({width:e.width*n,height:e.height*n}),i=1e3/(t.fps||10),o=e.duration/i;for(let t=0;t<o-1;t++){let o=t*i||1;e.setCurrentTime(o);let a=0,l="";for(let t of e.pages)if(a+=t.duration,t.set({_rendering:a>o}),a>o){l=t.id;break}let s=await e._toCanvas({pixelRatio:n,pageId:l});r.addFrame(s.getContext("2d"),{delay:i,copy:!0})}for(let t of e.pages)t.set({_rendering:!1});return e.stop(),r.render(),new Promise(e=>{r.on("finished",function(t){var n;(n=new FileReader).onload=function(t){e(t.target.result)},n.readAsDataURL(t)})})},async saveAsGIF({fileName:t,...n}={}){lC(await e.toGIFDataURL(n),t||"polotno.gif")},toHTML:async()=>lU({json:e.toJSON()}),async saveAsHTML({fileName:t}={}){let n=await e.toHTML();lC("data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(n))),t||"polotno.html")},toSVG:async()=>lQ({json:e.toJSON()}),async saveAsSVG({fileName:t}={}){let n=await e.toSVG();lC("data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(n))),t||"polotno.svg")},async saveAsPDF({fileName:t,...n}={}){(await e._toPDF({mimeType:"image/jpeg",...n})).save(t||"polotno.pdf")},async waitLoading(){await new Promise(e=>setTimeout(e,50)),await new Promise(e=>{var t;return t=()=>{il()?setTimeout(e,300):e(!0)},void(0===iu?t():ic.push(t))})},toJSON:()=>({width:e.width,height:e.height,fonts:(0,lx.getSnapshot)(e.fonts),pages:(0,lx.getSnapshot)(e.pages),unit:e.unit,dpi:e.dpi}),loadJSON(t,n=!1){let r={...t},i=e.pages.indexOf(e.activePage),o=(r.pages[i]||r.pages[0])?.id;r._activePageId=o;let a={...(0,lx.getSnapshot)(e)};Object.assign(a,r),n?a.history=e.history.toJSON():a.history={history:[],undoIdx:-1},(0,lx.applySnapshot)(e,a)},clear({keepHistory:t=!1}={}){let n=e.pages.map(e=>e.id);e.deletePages(n),t||e.history.clear()},addFont(t){e.removeFont(t.fontFamily),e.fonts.push(t),e.loadFont(t.fontFamily)},removeFont(t){e.fonts.filter(e=>e.fontFamily===t).forEach(e=>(0,lx.destroy)(e))},async loadFont(t){let n=e.fonts.find(e=>e.fontFamily===t)||ib.find(e=>e.fontFamily===t);n?function(e){let t=e.fontFamily;if(iO[t]||!e.url&&!e.styles)return;let n=document.createElement("style");n.type="text/css";let r=e.styles||(e.url?[{src:`url("${e.url}")`}]:[]),i="";r.forEach(e=>{i+=`
|
|
116
|
+
`:"";async function lQ({json:e,elementHook:t}){return lZ({dom:await lY({json:e,elementHook:t})})}var lx=h("58B0H");let lJ=(0,lx.types).model("Page",{id:lx.types.identifier,children:(0,lx.types).array((0,lx.types).late(()=>sa)),width:(0,lx.types).optional((0,lx.types).union(lx.types.number,(0,lx.types).literal("auto")),"auto"),height:(0,lx.types).optional((0,lx.types).union(lx.types.number,(0,lx.types).literal("auto")),"auto"),background:"white",bleed:0,custom:(0,lx.types).frozen(),duration:5e3,_exporting:!1,_rendering:!1}).postProcessSnapshot(e=>{let t={...e},n={};for(var r in t)"_"!==r[0]&&(n[r]=e[r]);return n}).views(e=>({get store(){return(0,lx.getParentOfType)(e,l1)},get startTime(){let t=0;for(let n of e.store.pages){if(n.id===e.id)break;t+=n.duration}return t}})).views(e=>({get computedWidth(){if("auto"===e.width)return e.store.width;return e.width},get computedHeight(){if("auto"===e.height)return e.store.height;return e.height}})).actions(e=>({toJSON:()=>JSON.parse(JSON.stringify((0,lx.getSnapshot)(e))),_forEachElementUp(t,n){let r=t.map(t=>({id:t,index:e.children.findIndex(e=>e.id===t)}));for(let{index:i}of(r.sort((e,t)=>t.index-e.index),r)){if(-1==i)continue;let r=i<e.children.length-1&&e.children[i+1],o=t.indexOf(r?.id)>=0;i===e.children.length-1||o||n(i)}},_forEachElementDown(t,n){let r=t.map(t=>({id:t,index:e.children.findIndex(e=>e.id===t)}));for(let{index:i}of(r.sort((e,t)=>e.index-t.index),r)){if(-1==i)continue;let r=i>0&&e.children[i-1],o=t.indexOf(r?.id)>=0;0===i||o||n(i)}return!1}})).actions(e=>({clone(t={}){let n=e.toJSON();n.children.forEach(e=>{e.id=l_(10),si(e,e=>{e.id=l_(10)})});let r={...n,id:l_(10),...t},i=e.store.addPage(r),o=e.store.pages.indexOf(e);i.setZIndex(o+1),i.select()},setZIndex(t){e.store.setPageZIndex(e.id,t)},set(t){Object.assign(e,t)},select(){e.store.selectPage(e.id)},addElement(t,{skipSelect:n=!1}={}){let r=su[t.type];if(!r){console.error("Can not find model with type "+t.type);return}t.children&&t.children.forEach(e=>{e.id=l_(10)});let i=r.create({id:l_(10),...t});return e.children.push(i),i.selectable&&!n&&e.store.selectElements([i.id]),i},canMoveElementsUp(t){let n=!1;return e._forEachElementUp(t,()=>{n=n||!0}),n},moveElementsUp(t){e._forEachElementUp(t,t=>{let n=e.children[t];(0,lx.detach)(n),e.children.splice(t+1,0,n)})},canMoveElementsTop(e){return this.canMoveElementsUp(e)},moveElementsTop(t){let n=[],r=[];e.children.forEach(e=>{t.indexOf(e.id)>=0?n.push(e):r.push(e)}),e.children.replace(r.concat(n))},canMoveElementsDown(t){let n=!1;return e._forEachElementDown(t,()=>{n=n||!0}),n},moveElementsDown(t){e._forEachElementDown(t,t=>{let n=e.children[t];(0,lx.detach)(n),e.children.splice(t-1,0,n)})},canMoveElementsBottom(e){return this.canMoveElementsDown(e)},moveElementsBottom(t){let n=[],r=[];e.children.forEach(e=>{t.indexOf(e.id)>=0?n.push(e):r.push(e)}),e.children.replace(n.concat(r))},setElementZIndex(t,n){let r=e.children.find(e=>e.id===t);r&&((0,lx.detach)(r),e.children.remove(r),e.children.splice(n,0,r))},setSize({width:t,height:n,useMagic:r,softChange:i}){if(r){let r=t/e.computedWidth,i=n/e.computedHeight,o=Math.min(r,i),a=Math.max(0,(t-e.computedWidth*o)/2),l=Math.max(0,(n-e.computedHeight*o)/2);si(e,t=>{"group"!==t.type&&("image"===t.type&&t.x<1&&t.y<1&&t.width>=e.computedWidth-2&&t.height>=e.computedHeight-2?t.set({x:t.x*o,y:t.y*o,width:t.width*r,height:t.height*i,cropX:0,cropY:0,cropWidth:1,cropHeight:1}):(t.set({x:a+t.x*o,y:l+t.y*o,width:t.width*o,height:t.height*o}),"text"===t.type&&t.set({fontSize:t.fontSize*o})))})}i||(e.width=t),i||(e.height=n)}})).actions(e=>({moveElementUp(t){console.warn("page.moveElementUp(id) is deprecated. Please use page.moveElementsUp([id1, id2]) instead."),e.moveElementsUp([t])},moveElementDown(t){console.warn("page.moveElementDown(id) is deprecated. Please use page.moveElementsDown([id1, id2]) instead."),e.moveElementsDown([t])},moveElementTop(t){console.warn("page.moveElementTop(id) is deprecated. Please use page.moveElementsTop([id1, id2]) instead."),e.moveElementsTop([t])},moveElementBottom(t){console.warn("page.moveElementBottom(id) is deprecated. Please use page.moveElementsBottom([id1, id2]) instead."),e.moveElementsBottom([t])}}));(0,lx.setLivelinessChecking)("ignore");let l0=(0,lx.types).model("Font",{fontFamily:lx.types.string,url:(0,lx.types).optional(lx.types.string,""),styles:(0,lx.types).frozen()}).preProcessSnapshot(e=>({...e,fontFamily:e.fontFamily||e.name})),l1=(0,lx.types).model("Store",{role:"",pages:(0,lx.types).array(lJ),fonts:(0,lx.types).array(l0),width:1080,height:1080,currentTime:0,isPlaying:!1,scale:1,scaleToFit:1,unit:"px",dpi:72,bleedVisible:!1,rulesVisible:!1,openedSidePanel:"",selectedElementsIds:(0,lx.types).array(lx.types.string),animatedElementsIds:(0,lx.types).array(lx.types.string),history:(0,lx.types).optional(lS,{targetPath:"../pages"}),_elementsPixelRatio:2,_activePageId:""}).views(e=>({get _bleedVisible(){return console.warn("store._bleedVisible is deprecated. Please use store.bleedVisible instead."),e.bleedVisible},get selectedElements(){return e.selectedElementsIds.map(t=>{for(let n of e.pages)for(let e of n.children)if(e.id===t)return e}).filter(e=>!!e)},get children(){return e.pages},get selectedShapes(){let t=[];return e.selectedElementsIds.forEach(n=>{for(let r of e.pages)for(let e of r.children)e.id===n&&"group"!==e.type&&t.push(e),"group"===e.type&&e.id===n&&t.push(...e.children)}),t},get activePage(){return e.pages.slice().find(t=>t.id===e._activePageId)||(e.pages.length?e.pages[0]:null)},get duration(){let t=0;return e.pages.forEach(e=>{t+=e.duration}),t},get _hasCroppedImages(){return e.find(e=>"image"===e.type&&e._cropModeEnabled)},find(t){let n;return si({children:e.pages},e=>{if(!n&&t(e))return n=e,!0}),n},getElementById:t=>e.find(e=>e.id===t)})).actions(e=>{let t=0;return{afterCreate(){e.history.canUndo},setCurrentTime(t){e.currentTime=t},play({animatedElementsIds:n=[],currentTime:r=0}={}){e.animatedElementsIds=(0,lx.cast)(n),e.currentTime=r,e.isPlaying=!0,t=Date.now(),requestAnimationFrame(e.seek)},seek(){if(!e.isPlaying)return;let n=Date.now(),r=n-t;for(let i of(t=n,e.currentTime+=r,e.pages)){if(e.currentTime>=i.startTime&&e.currentTime<i.startTime+i.duration){e.selectPage(i.id);break}i.duration}e.isPlaying&&e.currentTime<e.duration?requestAnimationFrame(e.seek):e.stop()},stop(){e.isPlaying=!1,e.currentTime=0,e.animatedElementsIds=(0,lx.cast)([])}}}).actions(e=>({setUnit({unit:t,dpi:n}){e.unit=t||e.unit,e.dpi=n||e.dpi},setRole(t){e.role=t},addPage(t){let n=lJ.create({id:l_(10),...t});return e.pages.push(n),e._activePageId=n.id,n},selectPage(t){e._activePageId=t},selectElements(t){let n=t.map(t=>e.getElementById(t)).sort((e,t)=>e.page.children.indexOf(e)-e.page.children.indexOf(t)).filter(e=>!!e).map(e=>e.id);e.selectedElementsIds=(0,lx.cast)(n)},toggleBleed(t){e.bleedVisible=t??!e.bleedVisible},toggleRulers(t){e.rulesVisible=t??!e.rulesVisible},openSidePanel(t){e.openedSidePanel=t},setScale(t){e.scale=t},_setScaleToFit(t){e.scaleToFit=t},setElementsPixelRatio(t){e._elementsPixelRatio=t},setSize(t,n,r){e.pages.forEach(e=>{e.setSize({width:t,height:n,useMagic:r,softChange:!0})}),e.width=t,e.height=n},setPageZIndex(t,n){let r=e.pages.find(e=>e.id===t);r&&((0,lx.detach)(r),e.pages.remove(r),e.pages.splice(n,0,r))},deletePages(t){let n=e.pages.indexOf(e.activePage);t.forEach(t=>{let n=e.pages.find(e=>e.id===t);(0,lx.destroy)(n)});let r=Math.min(e.pages.length-1,n),i=e.pages[r];i&&(e._activePageId=i.id),e.selectedElementsIds=(0,lx.cast)(e.selectedElementsIds.filter(t=>e.getElementById(t)))},groupElements(t){let n=t.map(t=>e.getElementById(t));n.forEach(e=>{e&&(0,lx.detach)(e)});let r=e.activePage,i={id:l_(10),children:n,type:"group"};return r.children.push(i),e.selectedElementsIds=(0,lx.cast)([i.id]),i},ungroupElements(t){let n=t.map(t=>e.getElementById(t)),r=[];n.forEach(e=>{if(e&&"group"===e.type){let t=e.page,n=t.children.indexOf(e);e.children.forEach(e=>{r.push(e.id)}),e.children.forEach(e=>{(0,lx.detach)(e),t.children.push(e)}),t.children.splice(n,1)}}),e.selectedElementsIds=(0,lx.cast)(r)},deleteElements(t){t.forEach(t=>{e.pages.forEach(e=>{let n=e.children.find(e=>e.id===t);n&&(0,lx.destroy)(n)})}),e.selectedElementsIds=(0,lx.cast)(e.selectedElementsIds.filter(t=>e.getElementById(t)))},on(t,n){if("change"===t){let t=e.toJSON();return(0,lx.onSnapshot)(e,r=>{let i=e.toJSON();lE(t,i)||(t=i,n(i))})}},async _toCanvas({pixelRatio:t,ignoreBackground:n,pageId:r,mimeType:i,includeBleed:o}={}){let a=t||1;r=r||e.pages[0]?.id;let s=e.pages.find(e=>e.id===r);if(!s)throw Error(`No page for export with id ${r}`);s?.set({_exporting:!0});let u=await lk(()=>l(A).stages.find(e=>e.getAttr("pageId")===r));if(!u)throw Error(`Export is failed. Can not find stage for page ${r}. Looks like <Workspace /> component is not mounted, but it is required in order to process the export.`);let c=!!u.findOne(".page-container");await e.waitLoading();let d=u.findOne(".page-container");if(!d)throw Error(`Export is failed. Can't find page container. ${c}`);u.find("Transformer").forEach(e=>e.visible(!1)),d.find(".page-background").forEach(e=>e.shadowEnabled(!1)),d.find(".page-background").forEach(e=>e.strokeEnabled(!1)),d.find(".highlighter").forEach(e=>e.visible(!1));let h=d.findOne(".page-background-group"),f=h.clip();h.clip({x:null,y:null,width:null,height:null});let p=d.findOne(".elements-container"),g=p.clip();p.clip({x:null,y:null,width:null,height:null});let m=d.find(e=>e.getAttr("hideInExport"));m.forEach(e=>{e.setAttr("oldVisible",e.visible()),e.hide()});let v=d.find(e=>!e.visible()&&e.getAttr("editModeEnabled"));v.forEach(e=>{e.setAttr("oldVisible",e.visible()),e.show()}),n&&d.find(".page-background").forEach(e=>e.hide());let y=o?s.bleed:0,b=y;!e.bleedVisible&&o||(e.bleedVisible||o?e.bleedVisible&&o?b=0:e.bleedVisible&&!o&&(b=-s.bleed):b=0);let w=document.createElement("canvas");w.width=Math.round((s.computedWidth+2*y)*a),w.height=Math.round((s.computedHeight+2*y)*a);let x=w.getContext("2d");"image/jpeg"===i&&(x.fillStyle="white",x.fillRect(0,0,w.width,w.height));let _=d.scale();d.scale({x:1,y:1});let E=d.toCanvas({x:d.x()-b,y:d.y()-b,width:s.computedWidth+2*y,height:s.computedHeight+2*y,pixelRatio:a});return d.scale(_),x.drawImage(E,0,0,w.width,w.height),l(A).Util.releaseCanvas(E),n&&d.find(".page-background").forEach(e=>e.show()),m.forEach(e=>{e.visible(e.getAttr("oldVisible"))}),v.forEach(e=>{e.visible(e.getAttr("oldVisible"))}),d.find(".page-background").forEach(e=>e.shadowEnabled(!0)),d.find(".page-background").forEach(e=>e.strokeEnabled(!0)),u.find("Transformer").forEach(e=>e.visible(!0)),d.find(".highlighter").forEach(e=>e.visible(!0)),h.clip(f),p.clip(g),s?.set({_exporting:!1}),w},async toDataURL({pixelRatio:t,ignoreBackground:n,pageId:r,mimeType:i,includeBleed:o,quality:a}={}){let s=await e._toCanvas({pixelRatio:t,ignoreBackground:n,pageId:r,mimeType:i,includeBleed:o}),u=s.toDataURL(i,a);return l(A).Util.releaseCanvas(s),u},async toBlob({pixelRatio:t,ignoreBackground:n,pageId:r,mimeType:i,includeBleed:o,quality:a}={}){let s=await e._toCanvas({pixelRatio:t,ignoreBackground:n,pageId:r,mimeType:i,includeBleed:o}),u=new Promise(e=>{s.toBlob(e,i,a)});return l(A).Util.releaseCanvas(s),u},async saveAsImage({fileName:t,...n}={}){let r=n.mimeType||"image/png",i=r.split("/")[1];lC(await e.toDataURL(n),t||"polotno."+i,r)},async _toPDF(n){let r=n.dpi||e.dpi,i=n.parallel||1,o=n.unit||("px"===e.unit?"mm":e.unit),a=n.pixelRatio||1,l=n.pageIds||e.pages.map(e=>e.id),s=e.pages.filter(e=>l.includes(e.id)),u=await (t?Promise.resolve(t):new Promise(e=>{var n=document.createElement("script");n.onload=function(){e(t=window.jspdf.jsPDF)},n.src="https://unpkg.com/jspdf@2.2.0/dist/jspdf.umd.min.js",document.head.appendChild(n)})),c=e=>le({px:e,unit:o,dpi:r}),d=c(n.cropMarkSize||0),h=s[0]||{},f=n.includeBleed?h.bleed:0,p=c(h.computedWidth+2*f)+2*d,g=c(h.computedHeight+2*f)+2*d;var m=new u({unit:o,orientation:p>g?"landscape":"portrait",format:[p,g],compress:!0,putOnlyUsedFonts:!0});m.deletePage(1);let v=e._elementsPixelRatio;for(let t of(e.setElementsPixelRatio(a),await new Promise(e=>setTimeout(e)),((e,t)=>{for(var n=[],r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n})(s,i))){let r=t.map(async t=>{let r=n.includeBleed?t.bleed:0,i=c(t.computedWidth+2*r)+2*d,o=c(t.computedHeight+2*r)+2*d,l=0,s=a;for(;l<10;){2===(l+=1)&&console.error("Polotno can not export PDF with current settings. Quality is automatically reduced.");let r=await e.toDataURL({...n,pageId:t.id,pixelRatio:s});if(r.length>20)return{url:r,width:i,height:o};s*=.8}});(await Promise.all(r)).forEach(({url:e,width:t,height:n})=>{m.addPage([t,n],t>n?"landscape":"portrait"),d&&(m.setLineWidth(c(1)),m.line(2*d,0,2*d,d),m.line(0,2*d,d,2*d),m.line(t-2*d,0,t-2*d,d),m.line(t,2*d,t-d,2*d),m.line(0,n-2*d,d,n-2*d),m.line(2*d,n,2*d,n-d),m.line(t,n-2*d,t-d,n-2*d),m.line(t-2*d,n,t-2*d,n-d)),m.addImage(e,d,d,t-2*d,n-2*d,void 0,"FAST")})}return e.setElementsPixelRatio(v),m},toPDFDataURL:async t=>(await e._toPDF({mimeType:"image/jpeg",...t})).output("datauristring"),async toGIFDataURL(t={}){let n=t.pixelRatio||1,r=await lO({width:e.width*n,height:e.height*n}),i=1e3/(t.fps||10),o=e.duration/i;for(let t=0;t<o-1;t++){let o=t*i||1;e.setCurrentTime(o);let a=0,l="";for(let t of e.pages)if(a+=t.duration,t.set({_rendering:a>o}),a>o){l=t.id;break}let s=await e._toCanvas({pixelRatio:n,pageId:l});r.addFrame(s.getContext("2d"),{delay:i,copy:!0})}for(let t of e.pages)t.set({_rendering:!1});return e.stop(),r.render(),new Promise(e=>{r.on("finished",function(t){var n;(n=new FileReader).onload=function(t){e(t.target.result)},n.readAsDataURL(t)})})},async saveAsGIF({fileName:t,...n}={}){lC(await e.toGIFDataURL(n),t||"polotno.gif")},toHTML:async()=>lU({json:e.toJSON()}),async saveAsHTML({fileName:t}={}){let n=await e.toHTML();lC("data:text/html;base64,"+window.btoa(unescape(encodeURIComponent(n))),t||"polotno.html")},toSVG:async()=>lQ({json:e.toJSON()}),async saveAsSVG({fileName:t}={}){let n=await e.toSVG();lC("data:text/svg;base64,"+window.btoa(unescape(encodeURIComponent(n))),t||"polotno.svg")},async saveAsPDF({fileName:t,...n}={}){(await e._toPDF({mimeType:"image/jpeg",...n})).save(t||"polotno.pdf")},async waitLoading(){await new Promise(e=>setTimeout(e,50)),await new Promise(e=>{var t;return t=()=>{il()?setTimeout(e,300):e(!0)},void(0===iu?t():ic.push(t))})},toJSON:()=>({width:e.width,height:e.height,fonts:(0,lx.getSnapshot)(e.fonts),pages:(0,lx.getSnapshot)(e.pages),unit:e.unit,dpi:e.dpi}),loadJSON(t,n=!1){let r={...t},i=e.pages.indexOf(e.activePage),o=(r.pages[i]||r.pages[0])?.id;r._activePageId=o;let a={...(0,lx.getSnapshot)(e)};Object.assign(a,r),n?a.history=e.history.toJSON():a.history={history:[],undoIdx:-1},(0,lx.applySnapshot)(e,a)},clear({keepHistory:t=!1}={}){let n=e.pages.map(e=>e.id);e.deletePages(n),t||e.history.clear()},addFont(t){e.removeFont(t.fontFamily),e.fonts.push(t),e.loadFont(t.fontFamily)},removeFont(t){e.fonts.filter(e=>e.fontFamily===t).forEach(e=>(0,lx.destroy)(e))},async loadFont(t){let n=e.fonts.find(e=>e.fontFamily===t)||ib.find(e=>e.fontFamily===t);n?function(e){let t=e.fontFamily;if(iO[t]||!e.url&&!e.styles)return;let n=document.createElement("style");n.type="text/css";let r=e.styles||(e.url?[{src:`url("${e.url}")`}]:[]),i="";r.forEach(e=>{i+=`
|
|
117
117
|
@font-face {
|
|
118
118
|
font-family: '${t}';
|
|
119
119
|
src: ${e.src};
|
|
120
120
|
font-style: ${e.fontStyle||"normal"};
|
|
121
121
|
font-weight: ${e.fontWeight||"normal"};
|
|
122
122
|
}
|
|
123
|
-
`}),n.innerHTML=i,document.getElementsByTagName("head")[0].appendChild(n),iO[e.fontFamily]=!0}(n):function(e){if(iC[e])return;let t=e.replace(/ /g,"+"),n=`https://fonts.googleapis.com/css?family=${t}:400,400italic,700,700italic`,r=document.createElement("link");r.type="text/css",r.href=n,r.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(r),iC[e]=!0}(t),await iS(t)},validate:e=>l1.validate(e,[{path:"",type:l1}]).map(e=>({path:"store"+e.context.map(e=>e.path).join("."),message:e.message}))})),l2=(0,lx.types).model("Node",{id:lx.types.identifier,type:"none",name:"",opacity:1,custom:(0,lx.types).frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(e=>{for(var t in e)null===e[t]&&(e[t]=void 0);return e}).postProcessSnapshot(e=>{let t={...e},n={};for(var r in t)"_"!==r[0]&&(n[r]=e[r]);return n}).views(e=>({get locked(){return!e.draggable&&!e.contentEditable&&!e.styleEditable&&!e.resizable},get page(){return(0,lx.getParentOfType)(e,lJ)},get store(){return(0,lx.getParentOfType)(e,l1)},get top(){let t=e;for(;;){if(!(0,lx.hasParentOfType)(t,sl))return t;t=(0,lx.getParentOfType)(t,sl)}},get parent(){if((0,lx.hasParentOfType)(e,sl))return(0,lx.getParentOfType)(e,sl);if((0,lx.hasParentOfType)(e,lJ))return(0,lx.getParentOfType)(e,lJ);if((0,lx.hasParentOfType)(e,l1))return(0,lx.getParentOfType)(e,l1);return null}})).actions(e=>({toJSON:()=>({...(0,lx.getSnapshot)(e)})})).actions(e=>({clone(t={},{skipSelect:n=!1}={}){let r=JSON.parse(JSON.stringify(e.toJSON()));return t.id=t.id||l_(10),si(r,e=>{e.id=l_(10)}),Object.assign(r,t),e.page.addElement(r,{skipSelect:n})},set(t){Object.assign(e,t)},moveUp(){e.page.moveElementsUp([e.id])},moveTop(){e.page.moveElementsTop([e.id])},moveDown(){e.page.moveElementsDown([e.id])},moveBottom(){e.page.moveElementsBottom([e.id])},beforeDestroy(){}}));var lx=h("58B0H");let l3={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}},l5={fade:({dTime:e,element:t,animation:n})=>{let r=e/n.duration;return"enter"===n.type?{opacity:r*t.opacity}:{opacity:(1-r)*t.opacity}},move:({dTime:e,element:t,animation:n})=>{let r=l3[n.data.direction]||l3.right,i={};for(var o in r.from){let a=t[o]+r.from[o],l=t[o]+r.to[o];if("exit"===n.type){let e=a;a=l,l=-e}let s=l-a;i[o]=a+e/n.duration*s}return i},zoom:({dTime:e,element:t,animation:n})=>{let r={},i={x:t.x+t.width/3,y:t.y+t.height/3,width:t.width/3,height:t.height/3,fontSize:t.fontSize/3},o={x:t.x,y:t.y,width:t.width,height:t.height,fontSize:t.fontSize};for(var a in i){let t=i[a],l=o[a];if("exit"===n.type){let e=t;t=l,l=e}let s=l-t;r[a]=t+e/n.duration*s}return r}},l6=({element:e,dTime:t,animation:n})=>{let r=l5[n.name];return r?r({element:e,dTime:t,animation:n}):(console.error("Can not find animation type: "+n.name),{})},l4=(0,lx.types).model("Animation",{delay:0,duration:500,enabled:!0,type:(0,lx.types).enumeration("Type",["enter","exit"]),name:"none",data:(0,lx.types).frozen({})}),l8=l2.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:(0,lx.types).array(l4),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(e=>{let t={...e,x:e.x||0,y:e.y||0};return"width"in e&&(t.width=t.width||1),"height"in e&&(t.height=t.height||1),e.locked&&(t.draggable=!1,t.contentEditable=!1,t.styleEditable=!1,t.resizable=!1),t}).views(e=>({get a(){let{currentTime:t}=e.store,n={x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation,opacity:e.opacity,color:e.color,fontSize:e.fontSize};if(0===t)return n;let r=t-e.page.startTime;if(r>e.page.duration||r<0)return n;let i=e.store.animatedElementsIds;if(i.length&&!i.includes(e.id))return n;let o=e.animations.find(e=>"enter"===e.type);if(o?.enabled&&r<o.delay&&(n.opacity=0),o?.enabled&&r>=o.delay&&r<=o.delay+o.duration){let t=r-o.delay;Object.assign(n,l6({element:e,animation:o,dTime:t}))}let a=e.animations.find(e=>"exit"===e.type);if(a?.enabled&&r>=e.page.duration-a.duration){let t=r-(e.page.duration-a.duration);Object.assign(n,l6({element:e,animation:a,dTime:t}))}return n},animated:t=>e.a[t]})).actions(e=>({setAnimation(t,n){let r=e.animations.find(e=>e.type===t);r?Object.assign(r,n):e.animations.push({type:t,...n})}}));var lx=h("58B0H");let l9=l8.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:(0,lx.types).optional((0,lx.types).union(lx.types.number,lx.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(e=>({...e})).actions(e=>({toggleEditMode(t){e._editModeEnabled=t??!e._editModeEnabled,e._editModeEnabled?e.store.history.startTransaction():e.store.history.endTransaction()}})),l7=l8.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,_cropModeEnabled:!1}).actions(e=>({toggleCropMode(t){e._cropModeEnabled=t??!e._cropModeEnabled,e._cropModeEnabled?e.store.history.startTransaction():e.store.history.endTransaction()},beforeDestroy(){e._cropModeEnabled&&e.store.history.endTransaction()}})),se=l7.named("Video").props({type:"video",duration:0,startTime:0,endTime:1});var lx=h("58B0H");let st=l8.named("Line").props({type:"line",width:400,height:10,color:"black",dash:(0,lx.types).array(lx.types.number),startHead:"",endHead:""}).actions(e=>({}));var lx=h("58B0H");let sn=l8.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:(0,lx.types).map(lx.types.string)}).preProcessSnapshot(e=>({...e,src:e.src||e.svgSource})).actions(e=>({replaceColor(t,n){e.colorsReplace.set(t,n)}}));var lx=h("58B0H");let sr=l8.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:(0,lx.types).array(lx.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0}),si=(e,t)=>{if(e.children)for(let n of e.children){if(t(n))break;si(n,t)}},so=[...Array(20)].map((e,t)=>(0,lx.types).late(()=>ss[t])),sa=(0,lx.types).union({dispatcher:e=>{let t=su[e.type];if(!t)throw Error(`Unknown element type: "${e.type}"`);return t}},sn,l9,l7,st,se,sr,(0,lx.types).late(()=>sl),...so),sl=l2.named("Group").props({type:"group",children:(0,lx.types).array(sa)}).views(e=>({get draggable(){let t=!0;return si(e,e=>{e.draggable||(t=!1)}),t},get resizable(){let t=!0;return si(e,e=>{e.resizable||(t=!1)}),t},get contentEditable(){let t=!0;return si(e,e=>{e.contentEditable||(t=!1)}),t},get styleEditable(){let t=!0;return si(e,e=>{e.styleEditable||(t=!1)}),t},get locked(){let t=!0;return si(e,e=>{e.locked||(t=!1)}),t}})).actions(e=>({set({draggable:t,contentEditable:n,styleEditable:r,resizable:i,...o}){void 0!==t&&si(e,e=>{e.set({draggable:t})}),void 0!==n&&si(e,e=>{e.set({contentEditable:n})}),void 0!==r&&si(e,e=>{e.set({styleEditable:r})}),void 0!==i&&si(e,e=>{e.set({resizable:i})}),Object.assign(e,o)}})),ss=[],su={svg:sn,text:l9,image:l7,group:sl,line:st,video:se,figure:sr},sc=[],sd="",sh="polotno_clipboard",sf=e=>{sc=JSON.parse(JSON.stringify(e));try{localStorage.setItem(sh,JSON.stringify(e))}catch(e){}},sp=()=>{try{let e=localStorage.getItem(sh);if(e)return JSON.parse(e)}catch(e){}return sc};var y=h("2SBKn");let sg=(0,y.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",removeClip:"Remove clip",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width"},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Upload Image",uploadTip:"Do you want to upload your own images?",background:"Background",resize:"Resize",layers:"Layers",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"}}),sm=e=>e&&"object"==typeof e;(0,y.action)(e=>{!function e(t,n){Object.keys(n).forEach(r=>{let i=t[r],o=n[r];sm(o)&&sm(i)?e(i,o):t[r]=o})}(sg,e)});let sv={},sy=e=>{let t=function(e,t){var n,r=t.split("."),i=e;for(n=0;n<r.length;++n){if(void 0==i[r[n]])return;i=i[r[n]]}return i}(sg,e);if(void 0!==t)return t;sv[e]||(sv[e]=!0,console.warn(`Missing translation '${e}'`));let n=e.split("."),r=n[n.length-1]||" ";return r.charAt(0).toUpperCase()+r.slice(1)},sb=(e,t,n)=>Math.max(t,Math.min(n,e)),sw=`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
123
|
+
`}),n.innerHTML=i,document.getElementsByTagName("head")[0].appendChild(n),iO[e.fontFamily]=!0}(n):function(e){if(iC[e])return;let t=e.replace(/ /g,"+"),n=`https://fonts.googleapis.com/css?family=${t}:400,400italic,700,700italic`,r=document.createElement("link");r.type="text/css",r.href=n,r.rel="stylesheet",document.getElementsByTagName("head")[0].appendChild(r),iC[e]=!0}(t),await iS(t)},validate:e=>l1.validate(e,[{path:"",type:l1}]).map(e=>({path:"store"+e.context.map(e=>e.path).join("."),message:e.message}))})),l2=(0,lx.types).model("Node",{id:lx.types.identifier,type:"none",name:"",opacity:1,custom:(0,lx.types).frozen(),visible:!0,selectable:!0,removable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(e=>{for(var t in e)null===e[t]&&(e[t]=void 0);return e}).postProcessSnapshot(e=>{let t={...e},n={};for(var r in t)"_"!==r[0]&&(n[r]=e[r]);return n}).views(e=>({get locked(){return!e.draggable&&!e.contentEditable&&!e.styleEditable&&!e.resizable},get page(){return(0,lx.getParentOfType)(e,lJ)},get store(){return(0,lx.getParentOfType)(e,l1)},get top(){let t=e;for(;;){if(!(0,lx.hasParentOfType)(t,sl))return t;t=(0,lx.getParentOfType)(t,sl)}},get parent(){if((0,lx.hasParentOfType)(e,sl))return(0,lx.getParentOfType)(e,sl);if((0,lx.hasParentOfType)(e,lJ))return(0,lx.getParentOfType)(e,lJ);if((0,lx.hasParentOfType)(e,l1))return(0,lx.getParentOfType)(e,l1);return null}})).actions(e=>({toJSON:()=>({...(0,lx.getSnapshot)(e)})})).actions(e=>({clone(t={},{skipSelect:n=!1}={}){let r=JSON.parse(JSON.stringify(e.toJSON()));return t.id=t.id||l_(10),si(r,e=>{e.id=l_(10)}),Object.assign(r,t),e.page.addElement(r,{skipSelect:n})},set(t){Object.assign(e,t)},moveUp(){e.page.moveElementsUp([e.id])},moveTop(){e.page.moveElementsTop([e.id])},moveDown(){e.page.moveElementsDown([e.id])},moveBottom(){e.page.moveElementsBottom([e.id])},beforeDestroy(){}}));var lx=h("58B0H");let l3={right:{from:{x:-200},to:{x:0}},left:{from:{x:200},to:{x:0}},up:{from:{y:200},to:{y:0}},down:{from:{y:-200},to:{y:0}},"bottom-right":{from:{x:-200,y:-200},to:{x:0,y:0}},"bottom-left":{from:{x:200,y:-200},to:{x:0,y:0}},"top-right":{from:{x:-200,y:200},to:{x:0,y:0}},"top-left":{from:{x:200,y:200},to:{x:0,y:0}}},l5={fade:({dTime:e,element:t,animation:n})=>{let r=e/n.duration;return"enter"===n.type?{opacity:r*t.opacity}:{opacity:(1-r)*t.opacity}},move:({dTime:e,element:t,animation:n})=>{let r=l3[n.data.direction]||l3.right,i={};for(var o in r.from){let a=t[o]+r.from[o],l=t[o]+r.to[o];if("exit"===n.type){let e=a;a=l,l=-e}let s=l-a;i[o]=a+e/n.duration*s}return i},zoom:({dTime:e,element:t,animation:n})=>{let r={},i={x:t.x+t.width/3,y:t.y+t.height/3,width:t.width/3,height:t.height/3,fontSize:t.fontSize/3},o={x:t.x,y:t.y,width:t.width,height:t.height,fontSize:t.fontSize};for(var a in i){let t=i[a],l=o[a];if("exit"===n.type){let e=t;t=l,l=e}let s=l-t;r[a]=t+e/n.duration*s}return r}},l6=({element:e,dTime:t,animation:n})=>{let r=l5[n.name];return r?r({element:e,dTime:t,animation:n}):(console.error("Can not find animation type: "+n.name),{})},l4=(0,lx.types).model("Animation",{delay:0,duration:500,enabled:!0,type:(0,lx.types).enumeration("Type",["enter","exit"]),name:"none",data:(0,lx.types).frozen({})}),l8=l2.named("Shape").props({x:0,y:0,width:100,height:100,rotation:0,opacity:1,animations:(0,lx.types).array(l4),blurEnabled:!1,blurRadius:10,brightnessEnabled:!1,brightness:0,sepiaEnabled:!1,grayscaleEnabled:!1,shadowEnabled:!1,shadowBlur:5,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"black",shadowOpacity:1,visible:!0,draggable:!0,resizable:!0,selectable:!0,contentEditable:!0,styleEditable:!0,alwaysOnTop:!1,showInExport:!0}).preProcessSnapshot(e=>{let t={...e,x:e.x||0,y:e.y||0};return"width"in e&&(t.width=t.width||1),"height"in e&&(t.height=t.height||1),e.locked&&(t.draggable=!1,t.contentEditable=!1,t.styleEditable=!1,t.resizable=!1),t}).views(e=>({get a(){let{currentTime:t}=e.store,n={x:e.x,y:e.y,width:e.width,height:e.height,rotation:e.rotation,opacity:e.opacity,color:e.color,fontSize:e.fontSize};if(0===t)return n;let r=t-e.page.startTime;if(r>e.page.duration||r<0)return n;let i=e.store.animatedElementsIds;if(i.length&&!i.includes(e.id))return n;let o=e.animations.find(e=>"enter"===e.type);if(o?.enabled&&r<o.delay&&(n.opacity=0),o?.enabled&&r>=o.delay&&r<=o.delay+o.duration){let t=r-o.delay;Object.assign(n,l6({element:e,animation:o,dTime:t}))}let a=e.animations.find(e=>"exit"===e.type);if(a?.enabled&&r>=e.page.duration-a.duration){let t=r-(e.page.duration-a.duration);Object.assign(n,l6({element:e,animation:a,dTime:t}))}return n},animated:t=>e.a[t]})).actions(e=>({setAnimation(t,n){let r=e.animations.find(e=>e.type===t);r?Object.assign(r,n):e.animations.push({type:t,...n})}}));var lx=h("58B0H");let l9=l8.named("Text").props({type:"text",text:"",placeholder:"",fontSize:14,fontFamily:"Roboto",fontStyle:"normal",fontWeight:"normal",textDecoration:"",fill:"black",align:"center",width:100,height:0,verticalAlign:"top",strokeWidth:0,stroke:"black",lineHeight:(0,lx.types).optional((0,lx.types).union(lx.types.number,lx.types.string),1.2),letterSpacing:0,_editModeEnabled:!1,backgroundEnabled:!1,backgroundColor:"#7ED321",backgroundOpacity:1,backgroundCornerRadius:.5,backgroundPadding:.5}).preProcessSnapshot(e=>({...e})).actions(e=>({toggleEditMode(t){e._editModeEnabled=t??!e._editModeEnabled,e._editModeEnabled?e.store.history.startTransaction():e.store.history.endTransaction()}})),l7=l8.named("Image").props({type:"image",width:100,height:100,src:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,cornerRadius:0,flipX:!1,flipY:!1,clipSrc:"",borderColor:"black",borderSize:0,keepRatio:!1,_cropModeEnabled:!1}).actions(e=>({toggleCropMode(t){e._cropModeEnabled=t??!e._cropModeEnabled,e._cropModeEnabled?e.store.history.startTransaction():e.store.history.endTransaction()},beforeDestroy(){e._cropModeEnabled&&e.store.history.endTransaction()}})),se=l7.named("Video").props({type:"video",duration:0,startTime:0,endTime:1});var lx=h("58B0H");let st=l8.named("Line").props({type:"line",width:400,height:10,color:"black",dash:(0,lx.types).array(lx.types.number),startHead:"",endHead:""}).actions(e=>({}));var lx=h("58B0H");let sn=l8.named("SVG").props({type:"svg",src:"",maskSrc:"",cropX:0,cropY:0,cropWidth:1,cropHeight:1,keepRatio:!0,flipX:!1,flipY:!1,width:100,height:100,borderColor:"black",borderSize:0,cornerRadius:0,colorsReplace:(0,lx.types).map(lx.types.string)}).preProcessSnapshot(e=>({...e,src:e.src||e.svgSource})).actions(e=>({replaceColor(t,n){e.colorsReplace.set(t,n)}}));var lx=h("58B0H");let sr=l8.named("Figure").props({type:"figure",subType:"rect",fill:"rgb(0, 161, 255)",dash:(0,lx.types).array(lx.types.number),strokeWidth:0,stroke:"rgba(98, 197, 255, 1)",cornerRadius:0}),si=(e,t)=>{if(e.children)for(let n of e.children){if(!0===t(n))break;si(n,t)}},so=[...Array(20)].map((e,t)=>(0,lx.types).late(()=>ss[t])),sa=(0,lx.types).union({dispatcher:e=>{let t=su[e.type];if(!t)throw Error(`Unknown element type: "${e.type}"`);return t}},sn,l9,l7,st,se,sr,(0,lx.types).late(()=>sl),...so),sl=l2.named("Group").props({type:"group",children:(0,lx.types).array(sa)}).views(e=>({get draggable(){let t=!0;return si(e,e=>{e.draggable||(t=!1)}),t},get resizable(){let t=!0;return si(e,e=>{e.resizable||(t=!1)}),t},get contentEditable(){let t=!0;return si(e,e=>{e.contentEditable||(t=!1)}),t},get styleEditable(){let t=!0;return si(e,e=>{e.styleEditable||(t=!1)}),t},get locked(){let t=!0;return si(e,e=>{e.locked||(t=!1)}),t}})).actions(e=>({set({draggable:t,contentEditable:n,styleEditable:r,resizable:i,...o}){void 0!==t&&si(e,e=>{e.set({draggable:t})}),void 0!==n&&si(e,e=>{e.set({contentEditable:n})}),void 0!==r&&si(e,e=>{e.set({styleEditable:r})}),void 0!==i&&si(e,e=>{e.set({resizable:i})}),Object.assign(e,o)}})),ss=[],su={svg:sn,text:l9,image:l7,group:sl,line:st,video:se,figure:sr},sc=[],sd="",sh="polotno_clipboard",sf=e=>{sc=JSON.parse(JSON.stringify(e));try{localStorage.setItem(sh,JSON.stringify(e))}catch(e){}},sp=()=>{try{let e=localStorage.getItem(sh);if(e)return JSON.parse(e)}catch(e){}return sc};var y=h("2SBKn");let sg=(0,y.observable)({toolbar:{duration:"Duration",opacity:"Opacity",effects:"Effects",blur:"Blur",textBackground:"Background",backgroundCornerRadius:"Corner radius",backgroundOpacity:"Opacity",backgroundPadding:"Padding",brightness:"Brightness",sepia:"Sepia",grayscale:"Grayscale",textStroke:"Text Stroke",shadow:"Shadow",border:"Border",cornerRadius:"Corner Radius",position:"Position",layering:"Layering",toForward:"To forward",up:"Up",down:"Down",toBottom:"To bottom",alignLeft:"Align left",alignCenter:"Align center",alignRight:"Align right",alignTop:"Align top",alignMiddle:"Align middle",alignBottom:"Align bottom",flip:"Flip",flipHorizontally:"Flip horizontally",flipVertically:"Flip vertically",fitToBackground:"Fit to page",removeBackground:"Remove background",removeBackgroundTitle:"Remove background from image",cancelRemoveBackground:"Cancel",confirmRemoveBackground:"Confirm",crop:"Crop",cropDone:"Done",cropCancel:"Cancel",removeClip:"Remove clip",removeMask:"Remove mask",transparency:"Transparency",lockedDescription:"Object is locked. Unlock it to allow changes from canvas.",unlockedDescription:"Object is unlocked. Lock it to prevent changes from canvas.",removeElements:"Remove elements",duplicateElements:"Duplicate elements",download:"Download",saveAsImage:"Save as image",saveAsPDF:"Save as PDF",lineHeight:"Line height",letterSpacing:"Letter spacing",offsetX:"Offset X",offsetY:"Offset Y",color:"Color",selectable:"Selectable",draggable:"Draggable",removable:"Removable",resizable:"Resizable",contentEditable:"Can change content",styleEditable:"Can change style",alwaysOnTop:"Always on top",showInExport:"Show in export",ungroupElements:"Ungroup",groupElements:"Group",lineSize:"Line size",fade:"Fade",move:"Move",zoom:"Zoom",animate:"Animate",spaceEvenly:"Space evenly",horizontalDistribution:"Horizontally",verticalDistribution:"Vertically",strokeWidth:"Stroke Width"},workspace:{noPages:"There are no pages yet...",addPage:"Add page",removePage:"Remove page",duplicatePage:"Duplicate page",moveUp:"Move up",moveDown:"Move down"},scale:{reset:"Reset"},error:{removeBackground:"Ops! Something went wrong. Background can not be removed."},sidePanel:{templates:"Templates",searchTemplatesWithSameSize:"Show templates with the same size",searchPlaceholder:"Search...",otherFormats:"Other formats",noResults:"No results",error:"Loading is failed...",text:"Text",uploadFont:"Upload font",myFonts:"My fonts",photos:"Photos",elements:"Elements",shapes:"Shapes",lines:"Lines",upload:"Upload",uploadImage:"Upload Image",uploadTip:"Do you want to upload your own images?",background:"Background",resize:"Resize",layers:"Layers",layerTypes:{image:"Image",text:"Text",svg:"SVG",line:"Line",figure:"Figure",group:"Group"},layersTip:"Elements on your active page:",noLayers:"No elements on the page...",namePlaceholder:"Type element name...",useMagicResize:"Use magic resize",width:"Width",height:"Height",magicResizeDescription:"Magic resize will automatically resize and move all elements on the canvas",headerText:"Header",createHeader:"Create header",subHeaderText:"Sub Header",createSubHeader:"Create sub header",bodyText:"Body text",createBody:"Create body text"}}),sm=e=>e&&"object"==typeof e;(0,y.action)(e=>{!function e(t,n){Object.keys(n).forEach(r=>{let i=t[r],o=n[r];sm(o)&&sm(i)?e(i,o):t[r]=o})}(sg,e)});let sv={},sy=e=>{let t=function(e,t){var n,r=t.split("."),i=e;for(n=0;n<r.length;++n){if(void 0==i[r[n]])return;i=i[r[n]]}return i}(sg,e);if(void 0!==t)return t;sv[e]||(sv[e]=!0,console.warn(`Missing translation '${e}'`));let n=e.split("."),r=n[n.length-1]||" ";return r.charAt(0).toUpperCase()+r.slice(1)},sb=(e,t,n)=>Math.max(t,Math.min(n,e)),sw=`Polotno warning: <Workspace /> component can not automatically detect its size.
|
|
124
124
|
Width or height of parent elements is equal 0.
|
|
125
125
|
Please make sure it has non-zero size. You may need to adjust it with your styles. <Workspace /> will automatically fit into parent container.
|
|
126
|
-
For simpler debugging here is the log of the parent element:`,sx=(e,t,n,r,i,o)=>{let a=l(v).useRef({width:t,height:n}),s=l(v).useRef({top:0,left:0}),u=l(v).useRef(!1),c=l(v).useRef(i.pages.length);u.current=c.current!==i.pages.length,c.current=i.pages.length,l(v).useEffect(()=>{let t=e.current,n=e=>{s.current={top:t.scrollTop,left:t.scrollLeft}};return t.addEventListener("scroll",n),()=>{t.removeEventListener("scroll",n)}},[]),l(v).useLayoutEffect(()=>{if(!e.current||u.current)return;let r=e.current,i=(s.current.left+r.offsetWidth/2)/a.current.width,l=(s.current.top+r.offsetHeight/2)/a.current.height;o.current=!0,r.scrollLeft=i*t-r.offsetWidth/2,r.scrollTop=l*n-r.offsetHeight/2,a.current={width:t,height:n}},[r,t,n])},s_=(e,t,n,r,i)=>{let o=l(v).useRef(!1),a=l(v).useRef(null);l(v).useEffect(()=>{let t=e.current,n=()=>{if(i.current)return};return t.addEventListener("scroll",n),()=>{t.removeEventListener("scroll",n)}},[]);let s=n.pages.indexOf(n.activePage);return l(v).useLayoutEffect(()=>{if(!n.activePage||!e.current||o.current)return;let r=e.current,a=n.pages.indexOf(n.activePage)*t;Math.abs(a-r.scrollTop)>.5*t&&(i.current=!0,r.scrollTop=a)},[n.activePage,s]),{handleScroll:e=>{if(i.current){i.current=!1;return}o.current=!0,clearTimeout(a.current),a.current=setTimeout(()=>{o.current=!1},300);let t=e.currentTarget.childNodes[0].offsetHeight,l=Math.floor((e.currentTarget.scrollTop+r.height/3)/t),s=n.pages[l];s&&s.select()}}},sE=({store:e})=>(0,p.jsxs)("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"},children:[(0,p.jsx)("p",{children:sy("workspace.noPages")}),(0,p.jsx)("button",{onClick:()=>{e.addPage()},children:sy("workspace.addPage")})]}),sS=({width:e,height:t,xPadding:n,yPadding:r,backgroundColor:i})=>(0,p.jsx)("div",{style:{width:e+"px",height:t+"px",backgroundColor:i,paddingLeft:n+"px",paddingRight:n+"px",paddingTop:r+"px",paddingBottom:r+"px"},children:(0,p.jsx)("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}})}),sC=P(({store:e,pageControlsEnabled:t,backgroundColor:n,pageBorderColor:r,activePageBorderColor:i,bleedColor:o,components:a,onKeyDown:s,paddingX:u,paddingY:c})=>{let d=u??20,h=c??55,[f,g]=l(v).useState({width:100,height:100}),m=l(v).useRef(f),y=l(v).useRef(null),b=l(v).useRef(null),w=e.bleedVisible?Math.max(0,...e.pages.map(e=>e.bleed)):0,x=Math.max(...e.pages.map(e=>e.computedWidth)),_=Math.max(...e.pages.map(e=>e.computedHeight)),E=x+2*w,S=_+2*w,C=async()=>{if(await new Promise(e=>setTimeout(e,50)),null===y.current)return;let
|
|
126
|
+
For simpler debugging here is the log of the parent element:`,sx=(e,t,n,r,i,o)=>{let a=l(v).useRef({width:t,height:n}),s=l(v).useRef({top:0,left:0}),u=l(v).useRef(!1),c=l(v).useRef(i.pages.length);u.current=c.current!==i.pages.length,c.current=i.pages.length,l(v).useEffect(()=>{let t=e.current,n=e=>{s.current={top:t.scrollTop,left:t.scrollLeft}};return t.addEventListener("scroll",n),()=>{t.removeEventListener("scroll",n)}},[]),l(v).useLayoutEffect(()=>{if(!e.current||u.current)return;let r=e.current,i=(s.current.left+r.offsetWidth/2)/a.current.width,l=(s.current.top+r.offsetHeight/2)/a.current.height;o.current=!0,r.scrollLeft=i*t-r.offsetWidth/2,r.scrollTop=l*n-r.offsetHeight/2,a.current={width:t,height:n}},[r,t,n])},s_=(e,t,n,r,i)=>{let o=l(v).useRef(!1),a=l(v).useRef(null);l(v).useEffect(()=>{let t=e.current,n=()=>{if(i.current)return};return t.addEventListener("scroll",n),()=>{t.removeEventListener("scroll",n)}},[]);let s=n.pages.indexOf(n.activePage);return l(v).useLayoutEffect(()=>{if(!n.activePage||!e.current||o.current)return;let r=e.current,a=n.pages.indexOf(n.activePage)*t;Math.abs(a-r.scrollTop)>.5*t&&(i.current=!0,r.scrollTop=a)},[n.activePage,s]),{handleScroll:e=>{if(i.current){i.current=!1;return}o.current=!0,clearTimeout(a.current),a.current=setTimeout(()=>{o.current=!1},300);let t=e.currentTarget.childNodes[0].offsetHeight,l=Math.floor((e.currentTarget.scrollTop+r.height/3)/t),s=n.pages[l];s&&s.select()}}},sE=({store:e})=>(0,p.jsxs)("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",textAlign:"center"},children:[(0,p.jsx)("p",{children:sy("workspace.noPages")}),(0,p.jsx)("button",{onClick:()=>{e.addPage()},children:sy("workspace.addPage")})]}),sS=({width:e,height:t,xPadding:n,yPadding:r,backgroundColor:i})=>(0,p.jsx)("div",{style:{width:e+"px",height:t+"px",backgroundColor:i,paddingLeft:n+"px",paddingRight:n+"px",paddingTop:r+"px",paddingBottom:r+"px"},children:(0,p.jsx)("div",{style:{width:" 100%",height:"100%",backgroundColor:"white"}})}),sC=P(({store:e,pageControlsEnabled:t,backgroundColor:n,pageBorderColor:r,activePageBorderColor:i,bleedColor:o,components:a,onKeyDown:s,paddingX:u,paddingY:c})=>{let d=u??20,h=c??55,[f,g]=l(v).useState({width:100,height:100}),m=l(v).useRef(f),y=l(v).useRef(null),b=l(v).useRef(null),w=e.bleedVisible?Math.max(0,...e.pages.map(e=>e.bleed)):0,x=Math.max(...e.pages.map(e=>e.computedWidth)),_=Math.max(...e.pages.map(e=>e.computedHeight)),E=x+2*w,S=_+2*w,C=async({skipTimeout:t}={skipTimeout:!1})=>{if(t||await new Promise(e=>setTimeout(e,50)),null===y.current)return;let n=y.current.getBoundingClientRect();(0===n.width||0===n.height)&&(console.warn(sw),console.log(y.current));let r=b.current.clientWidth||n.width,i={width:r,height:n.height};(m.current.width!==i.width||m.current.height!==i.height)&&(g(i),m.current=i);let o=Math.max(Math.min((r-2*d)/E,(n.height-2*h)/S),.01);e.scaleToFit!==o&&(e.setScale(o),e._setScaleToFit(o))};l(v).useLayoutEffect(()=>{C({skipTimeout:!0})},[]),l(v).useEffect(()=>{C()},[E,S]),l(v).useEffect(()=>{let e=y.current;if(window.ResizeObserver){let t=new ResizeObserver(C);return t.observe(e),()=>t.unobserve(e)}{let e=setInterval(C,100);return()=>clearInterval(e)}},[E,S]);let O=Math.max(d,(f.width-E*e.scale)/2),k=S*e.scale*e.pages.length,P=Math.max(h,(f.height-k)/e.pages.length/2);l(v).useEffect(()=>{let t=t=>{(s||function(e,t){if(document.activeElement?.tagName==="INPUT"||document.activeElement?.tagName==="TEXTAREA"||document.activeElement?.contentEditable==="true")return;let n=t.selectedElements.filter(e=>e.removable),r=n.map(e=>e.id);(46===e.keyCode||8===e.keyCode)&&t.deleteElements(r);let i=e.ctrlKey||e.metaKey,o=e.shiftKey;if(i&&!o&&"KeyZ"===e.code&&(e.preventDefault(),t.history.undo()),i&&o&&"KeyZ"===e.code&&(e.preventDefault(),t.history.redo()),i&&"KeyA"===e.code){e.preventDefault();let n=t.activePage?.children.filter(e=>e.selectable),r=n?.map(e=>e.id)||[];t.selectElements(r)}if(i&&"KeyC"===e.code&&(e.preventDefault(),sd=t.activePage?.id,sf(t.selectedElements.map(e=>e.toJSON()))),i&&"KeyX"===e.code&&(e.preventDefault(),sd=t.activePage?.id,sf(t.selectedElements.map(e=>e.toJSON())),t.deleteElements(n)),i&&"KeyV"===e.code){e.preventDefault();let n=0;sd===t.activePage?.id&&(n=t.width/20),sd=t.activePage?.id,t.history.transaction(()=>{let e=[],r=sp();si({children:r},e=>{delete e.id,"group"!==e.type&&(e.x+=n,e.y+=n)}),console.log(r),r.forEach(n=>{let r=t.activePage?.addElement(n);r&&e.push(r.id)}),sf(r),t.selectElements(e)})}"ArrowDown"===e.code&&(e.preventDefault(),t.selectedElements.forEach(e=>{e.set({y:e.y+1})})),"ArrowUp"===e.code&&(e.preventDefault(),t.selectedElements.forEach(e=>{e.set({y:e.y-1})})),"ArrowLeft"===e.code&&(e.preventDefault(),t.selectedElements.forEach(e=>{e.set({x:e.x-1})})),"ArrowRight"===e.code&&(e.preventDefault(),t.selectedElements.forEach(e=>{e.set({x:e.x+1})}))})(t,e)};return window.addEventListener("keydown",t),()=>window.removeEventListener("keydown",t)},[]),l(v).useEffect(()=>{let t=t=>{if(t.ctrlKey||t.metaKey){t.preventDefault();let n=Math.max(3,e.scaleToFit),r=Math.min(.1,e.scaleToFit),i=sb(t.deltaY<0?1.05*e.scale:e.scale/1.05,r,n);e.setScale(i);return}};return b.current?.addEventListener("wheel",t),()=>b.current?.removeEventListener("wheel",t)},[]);let T=l(v).useRef(!1);sx(b,E*e.scale+2*O,S*e.scale+2*P,e.scale,e,T);let{handleScroll:A}=s_(b,S*e.scale+2*P,e,f,T),N=f.width>=E*e.scale+2*O,j=n||"rgba(232, 232, 232, 0.9)",R=e.pages.indexOf(e.activePage),I=a?.NoPages||sE;return(0,p.jsx)("div",{ref:y,style:{width:"100%",height:"100%",position:"relative",outline:"none",flex:1,backgroundColor:j},tabIndex:0,className:"polotno-workspace-container",children:(0,p.jsxs)("div",{ref:b,onScroll:A,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"auto",overflowX:N?"hidden":"auto"},className:"polotno-workspace-inner",children:[e.pages.map((n,l)=>1>=Math.abs(l-R)||n._exporting?(0,p.jsx)(lv,{page:n,xPadding:O,yPadding:P,width:E*e.scale+2*O,height:S*e.scale+2*P,store:e,pageControlsEnabled:t,backColor:j,pageBorderColor:r||"lightgrey",activePageBorderColor:i||"rgb(0, 161, 255)",bleedColor:o||"rgba(255, 0, 0, 0.1)",components:a},n.id):(0,p.jsx)(sS,{width:E*e.scale+2*O,height:S*e.scale+2*P,backgroundColor:j,xPadding:O,yPadding:P},n.id)),e.rulesVisible&&(0,p.jsx)(lw,{store:e,xPadding:O,yPadding:P,width:E*e.scale+2*O,height:S*e.scale+2*P}),0===e.pages.length&&(0,p.jsx)(I,{store:e})]})})});h("8NFma");var sO=h("gztBd"),sk={};!/*!
|
|
127
127
|
Copyright (c) 2018 Jed Watson.
|
|
128
128
|
Licensed under the MIT License (MIT), see
|
|
129
129
|
http://jedwatson.github.io/classnames
|
|
@@ -131,7 +131,7 @@ For simpler debugging here is the log of the parent element:`,sx=(e,t,n,r,i,o)=>
|
|
|
131
131
|
${iR(`
|
|
132
132
|
width: auto !important;
|
|
133
133
|
`)}
|
|
134
|
-
`,mM=({type:e,usedItems:t,components:n})=>{let r=[];return Object.keys(n).forEach(n=>{0!==n.toLowerCase().indexOf(e)||t.includes(n)||r.push(n)}),t.filter(e=>!!e).concat(r)},mD=({items:e,itemRender:t})=>{let[n,r]=l(v).useState(0),i=l(v).useRef(null),o=()=>{if(null===i.current)return;let e=i.current.parentElement,t=0;[...i.current.parentElement.children].forEach(e=>{e!==i.current&&(t+=e.offsetWidth)}),r(Math.max(20,e.offsetWidth-t-10))};return l(v).useLayoutEffect(()=>{o()}),l(v).useLayoutEffect(()=>{let e=i.current.parentElement.parentElement;if(window.ResizeObserver){let t=new ResizeObserver(o);return t.observe(e),()=>t.unobserve(e)}{let e=setInterval(o,100);return()=>clearInterval(e)}},[]),(0,p.jsx)(mL,{style:{width:n+"px"},ref:i,className:"bp5-navbar-group bp5-align-left",children:(0,p.jsx)(mj,{items:e,style:{width:"100%"},visibleItemRenderer:t,collapseFrom:mN.END,overflowRenderer:e=>(0,p.jsx)(mw,{content:(0,p.jsx)("div",{style:{padding:"10px",display:"flex"},children:e.map(t)}),position:sj.BOTTOM,children:(0,p.jsx)(pA,{icon:"more",minimal:!0,style:{marginLeft:"10px"}})})})})};h("8NFma");let mF=P(({store:e})=>{let t=e.selectedElements.length>0;return(0,p.jsx)(mC,{content:sy("toolbar.duplicateElements"),disabled:!t,position:"bottom",children:(0,p.jsx)(pA,{icon:"duplicate",minimal:!0,onClick:()=>{let t=[];e.selectedElements.forEach(e=>{let n=e.clone();"group"===e.type?n.children.forEach(e=>{e.set({x:e.x+50,y:e.y+50})}):n.set({x:e.x+50,y:e.y+50}),t.push(n.id)}),e.selectElements(t)},disabled:!t})})});h("8NFma");let mz=P(({store:e})=>{let t=e.selectedElements.filter(e=>e.removable);return(0,p.jsx)(mC,{content:sy("toolbar.removeElements"),disabled:!t.length,position:"bottom",children:(0,p.jsx)(pA,{icon:"trash",minimal:!0,onClick:()=>{e.deleteElements(t.map(e=>e.id))},disabled:!t.length,style:{marginLeft:"auto"}})})});h("8NFma");var sO=h("gztBd"),v=h("8NFma"),mB=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e,t=this.props,n=t.className,r=t.children,i=t.large,o=t.small,a=t.ulRef,s=(0,sO.__rest)(t,["className","children","large","small","ulRef"]),u=l(sk)(n,sP.MENU,((e={})[sP.LARGE]=i,e[sP.SMALL]=o,e));return v.createElement("ul",(0,sO.__assign)({role:"menu"},s,{className:u,ref:a}),r)},t.displayName="".concat(pa,".Menu"),t}(pO),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma");function mU(e,t){return v.forwardRef(function(n,r){var i=n.className,o=n.children,a=(0,sO.__rest)(n,["className","children"]);return v.createElement(e,(0,sO.__assign)((0,sO.__assign)({},a),{className:l(sk)(t,i),ref:r}),o)})}mU("h1",uy),mU("h2",uy),mU("h3",uy),mU("h4",uy),mU("h5",uy);var mH=mU("h6",uy);mU("blockquote",ug),mU("code",um),mU("pre",uv),mU("label",c1),mU("ol",ub),mU("ul",ub);var mV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.title,r=e.titleId;return null==n?v.createElement("li",{className:l(sk)(sP.MENU_DIVIDER,t),role:"separator"}):v.createElement("li",{className:l(sk)(sP.MENU_HEADER,t),role:"separator"},v.createElement(mH,{id:r},n))},t.displayName="".concat(pa,".MenuDivider"),t}(v.Component),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),py=h("leH9B"),mq=v.forwardRef(function(e,t){var n=e.size>=py.IconSize.LARGE,r=n?py.IconSize.LARGE:py.IconSize.STANDARD,i="".concat(-1*r/.05/2);return v.createElement(pS,(0,sO.__assign)({iconName:"caret-right",ref:t},e),v.createElement("path",{d:n?"M280 200C280 206.2 277 211.4 272.6 215.2L272.8 215.4L152.8 315.4L152.6 315.2C149.2 318 144.8 320 140 320C129 320 120 311 120 300V100C120 89 129 80 140 80C144.8 80 149.2 82 152.6 84.8L152.8 84.6L272.8 184.6L272.6 184.8C277 188.6 280 193.8 280 200z":"M220 160C220 163 218.6 165.6 216.6 167.4L216.6 167.4L136.6 237.4L136.6 237.4C134.8 239 132.6 240 130 240C124.4 240 120 235.6 120 230V90C120 84.4 124.4 80 130 80C132.6 80 134.8 81 136.6 82.6C136.6 82.6 136.6 82.6 136.6 82.6L216.6 152.6L216.6 152.6C218.6 154.4 220 157 220 160z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")")}))});mq.defaultProps={size:py.IconSize.STANDARD},mq.displayName="Blueprint5.Icon.CaretRight";var sO=h("gztBd"),v=h("8NFma"),py=h("leH9B"),mG=v.forwardRef(function(e,t){var n=e.size>=py.IconSize.LARGE,r=n?py.IconSize.LARGE:py.IconSize.STANDARD,i="".concat(-1*r/.05/2);return v.createElement(pS,(0,sO.__assign)({iconName:"small-tick",ref:t},e),v.createElement("path",{d:n?"M300 300C294.4000000000001 300 289.4000000000001 297.8 285.8 294.2L160 168.2L114.2 214.2C110.6 217.8 105.6 220 100 220C89 220 80 211 80 200C80 194.4 82.2 189.4 85.8 185.8L145.8 125.8C149.4 122.2 154.4 120 160 120S170.6 122.2 174.2 125.8L314.2000000000001 265.8C317.8 269.4 320 274.4 320 280C320 291 311 300 300 300z":"M240 220C234.4 220 229.4 217.8 225.8 214.2L140 128.2L94.2 174.2C90.6 177.8 85.6 180 80 180C69 180 60 171 60 160C60 154.4 62.2 149.4 65.8 145.8L125.8 85.8C129.4 82.2 134.4 80 140 80S150.6 82.2 154.2 85.8L254.2 185.8C257.8 189.4 260 194.4 260 200C260 211 251 220 240 220z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")")}))});mG.defaultProps={size:py.IconSize.STANDARD},mG.displayName="Blueprint5.Icon.SmallTick";var mW=v.forwardRef(function(e,t){var n,r,i=e.active,o=e.className,a=e.children,s=e.disabled,u=e.icon,c=e.intent,d=e.labelClassName,h=e.labelElement,f=e.multiline,p=e.popoverProps,g=e.roleStructure,m=void 0===g?"menuitem":g,y=e.selected,b=e.shouldDismissPopover,w=e.submenuProps,x=e.text,_=e.textClassName,E=e.tagName,S=e.htmlTitle,C=(0,sO.__rest)(e,["active","className","children","disabled","icon","intent","labelClassName","labelElement","multiline","popoverProps","roleStructure","selected","shouldDismissPopover","submenuProps","text","textClassName","tagName","htmlTitle"]),O="listoption"===m?["option",void 0,!!y]:"menuitem"===m?["none","menuitem",void 0]:"none"===m?["none",void 0,void 0]:[void 0,void 0,void 0],k=O[0],P=O[1],T=O[2],A="listoption"===m,N=A&&y,j=null!=u,R=null!=a,I=sP.intentClass(c),L=l(sk)(sP.MENU_ITEM,I,((n={})[sP.ACTIVE]=i,n[sP.DISABLED]=s,n[sP.POPOVER_DISMISS]=b&&!s&&!R,n[sP.MENU_ITEM_IS_SELECTABLE]=A,n[sP.SELECTED]=N,n),o),M=null==e.label&&null==h?null:v.createElement("span",{className:l(sk)(sP.MENU_ITEM_LABEL,d)},e.label,h),D=v.createElement(void 0===E?"a":E,(0,sO.__assign)((0,sO.__assign)((0,sO.__assign)({onKeyDown:fv(["Enter"," "]),role:R?"none":P,tabIndex:R?-1:0},ps(C)),s?mK:{}),{className:L}),N?v.createElement(mG,{className:sP.MENU_ITEM_SELECTED_ICON}):void 0,j?v.createElement("span",{className:sP.MENU_ITEM_ICON},v.createElement(pC,{icon:u,"aria-hidden":!0,tabIndex:-1})):void 0,v.createElement(pT,{className:l(sk)(sP.FILL,_),ellipsize:!f,title:S},x),M,R?v.createElement(mq,{className:sP.MENU_SUBMENU_ICON,title:"Open sub menu"}):void 0),F=l(sk)(((r={})[sP.MENU_SUBMENU]=R,r));return v.createElement("li",{className:F,ref:t,role:k,"aria-selected":T},null==a?D:v.createElement(mw,(0,sO.__assign)({autoFocus:!1,captureDismiss:!1,disabled:s,enforceFocus:!1,hoverCloseDelay:0,interactionKind:"hover",modifiers:m$,targetProps:{role:P,tabIndex:0},placement:"right-start",usePortal:!1},p,{content:v.createElement(mB,(0,sO.__assign)({},w),a),minimal:!0,popoverClassName:l(sk)(sP.MENU_SUBMENU,null==p?void 0:p.popoverClassName)}),D))});mW.defaultProps={active:!1,disabled:!1,multiline:!1,popoverProps:{},selected:void 0,shouldDismissPopover:!0,text:""},mW.displayName="".concat(pa,".MenuItem");var m$={flip:{options:{rootBoundary:"viewport",padding:20},enabled:!0},offset:{options:{offset:[-5,0]},enabled:!0},preventOverflow:{options:{rootBoundary:"viewport",padding:20},enabled:!0}},mK={"aria-disabled":!0,href:void 0,onClick:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,tabIndex:-1};let mY=P(({store:e})=>{let t=e.selectedElements.length>0,n=e.selectedElementsIds,r=e.selectedElements.every(e=>e.draggable),i=!e.selectedElements.some(e=>"group"===e.type)&&r;i&&e.selectedElements.length;let o=i&&e.selectedElements.length>1;return(0,p.jsx)(mw,{disabled:!t,content:(0,p.jsxs)(mB,{style:{width:"280px"},children:[(0,p.jsx)(mV,{title:sy("toolbar.layering")}),(0,p.jsxs)("div",{style:{display:"flex"},children:[(0,p.jsxs)("div",{style:{width:"50%"},children:[(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"chevron-up",text:sy("toolbar.up"),disabled:!e.activePage?.canMoveElementsUp(n),onClick:()=>{e.activePage?.moveElementsUp(n)}}),(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"double-chevron-up",text:sy("toolbar.toForward"),disabled:!e.activePage?.canMoveElementsTop(n),onClick:()=>{e.activePage?.moveElementsTop(n)}})]}),(0,p.jsxs)("div",{style:{width:"50%"},children:[(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"chevron-down",text:sy("toolbar.down"),disabled:!e.activePage?.canMoveElementsDown(n),onClick:()=>{e.activePage?.moveElementsDown(n)}}),(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"double-chevron-down",text:sy("toolbar.toBottom"),disabled:!e.activePage?.canMoveElementsBottom(n),onClick:()=>{e.activePage?.moveElementsBottom(n)}})]})]}),i&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(mV,{title:sy("toolbar.position")}),(0,p.jsxs)("div",{style:{display:"flex"},children:[(0,p.jsxs)("div",{style:{width:"50%"},children:[(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"alignment-left",text:sy("toolbar.alignLeft"),onClick:()=>{let t=e.activePage?.computedWidth;e.selectedElements.forEach(e=>{t=Math.min(t,ac(e).x)}),1===e.selectedElements.length&&(t=0),e.selectedElements.forEach(e=>{let n=ac(e);e.set({x:e.x-n.x+t})})}}),(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"alignment-vertical-center",text:sy("toolbar.alignCenter"),onClick:()=>{let t=e.activePage?.computedWidth,n=0;e.selectedElements.forEach(e=>{let r=ac(e);t=Math.min(t,r.x),n=Math.max(n,r.x+r.width)});let r=(n+t)/2;1===e.selectedElements.length&&(r=e.activePage?.computedWidth/2),e.selectedElements.forEach(e=>{let t=ac(e),n=e.x-t.x;e.set({x:r+n-t.width/2})})}}),(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"alignment-right",text:sy("toolbar.alignRight"),onClick:()=>{let t=0;e.selectedElements.forEach(e=>{let n=ac(e);t=Math.max(t,n.x+n.width)}),1===e.selectedElements.length&&(t=e.activePage?.computedWidth),e.selectedElements.forEach(e=>{let n=ac(e);e.set({x:e.x-n.x+t-n.width})})}})]}),(0,p.jsxs)("div",{style:{width:"50%"},children:[(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"alignment-top",text:sy("toolbar.alignTop"),onClick:()=>{let t=e.activePage?.computedHeight;e.selectedElements.forEach(e=>{t=Math.min(t,ac(e).y)}),1===e.selectedElements.length&&(t=0),e.selectedElements.forEach(e=>{let n=ac(e);e.set({y:e.y-n.y+t})})}}),(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"alignment-horizontal-center",text:sy("toolbar.alignMiddle"),onClick:()=>{let t=e.activePage?.computedHeight,n=0;e.selectedElements.forEach(e=>{let r=ac(e);t=Math.min(t,r.y),n=Math.max(n,r.y+r.height)});let r=(n+t)/2;1===e.selectedElements.length&&(r=e.activePage?.computedHeight/2),e.selectedElements.forEach(e=>{let t=ac(e),n=e.y-t.y;e.set({y:r+n-t.height/2})})}}),(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"alignment-bottom",text:sy("toolbar.alignBottom"),onClick:()=>{let t=0;e.selectedElements.forEach(e=>{let n=ac(e);t=Math.max(t,n.y+n.height)}),1===e.selectedElements.length&&(t=e.activePage?.computedHeight),e.selectedElements.forEach(e=>{let n=ac(e);e.set({y:e.y-n.y+t-n.height})})}})]})]})]}),o&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(mV,{title:sy("toolbar.spaceEvenly")}),(0,p.jsxs)("div",{style:{display:"flex"},children:[(0,p.jsxs)("div",{style:{width:"50%"},children:[" ",(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"vertical-distribution",text:sy("toolbar.verticalDistribution"),onClick:()=>{let t=e.activePage?.computedHeight,n=0,r=0;e.selectedElements.forEach(e=>{let i=ac(e);t=Math.min(t,i.y),n=Math.max(n,i.y+i.height),r+=i.height});let i=(n-t-r)/(e.selectedElements.length-1),o=e.selectedElements.slice().sort((e,t)=>{let n=ac(e),r=ac(t);return n.y-r.y}),a=0;o.forEach(e=>{let n=ac(e);e.set({y:e.y-n.y+t+a}),a+=n.height+i})}})]}),(0,p.jsx)("div",{style:{width:"50%"},children:(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"horizontal-distribution",text:sy("toolbar.horizontalDistribution"),onClick:()=>{let t=e.activePage?.computedWidth,n=0,r=0;e.selectedElements.forEach(e=>{let i=ac(e);t=Math.min(t,i.x),n=Math.max(n,i.x+i.width),r+=i.width});let i=(n-t-r)/(e.selectedElements.length-1),o=e.selectedElements.slice().sort((e,t)=>{let n=ac(e),r=ac(t);return n.x-r.x}),a=0;o.forEach(e=>{let n=ac(e);e.set({x:e.x-n.x+t+a}),a+=n.width+i})}})})]})]})]}),children:(0,p.jsx)(pA,{icon:"layers",minimal:!0,text:sy("toolbar.position"),disabled:!t})})});function mX(e,t){return e.classList.contains(t)?e:e.parentElement?mX(e.parentElement,t):null}let mZ=P(({store:e,page:t,components:n,stageRef:r})=>{let i=ad(e.selectedShapes),o=e.selectedShapes.every(e=>e.page===t),a=l(v).useRef(null),[s,u]=l(v).useState(!1),c=e.find(e=>"image"===e.type&&e._cropModeEnabled);l(v).useEffect(()=>{let e=()=>{u(!0)},t=()=>{u(!1)};r?.current?.on("dragstart",e),r?.current?.on("dragend",t);let n=r?.current?.findOne("Transformer");return n?.on("transformstart",e),n?.on("transformend",t),()=>{r?.current?.off("dragstart",e),r?.current?.off("dragend",t),n?.off("transformstart",e),n?.off("transformend",t)}},[]);let[d,h]=l(v).useState({fit:!0,needCalculate:!1,token:Math.random()});if(l(v).useEffect(()=>{0!==e.selectedElements.length&&h({fit:!0,needCalculate:!0,token:Math.random()})},[e.selectedElements,s]),l(v).useEffect(()=>{setTimeout(()=>{if(!a.current||!d.needCalculate)return;let e=mX(a.current,"polotno-workspace-container");if(!e)return;let t=e.getBoundingClientRect(),n=a.current.getBoundingClientRect();n.right,t.left;let r=n.top-t.top;n.left,t.left;let i=n.bottom-t.top;r<20&&d.fit&&h({fit:!1,needCalculate:!1,token:d.token}),i-t.height>-20&&!d.fit&&h({fit:!0,needCalculate:!1,token:d.token})},10)},[d.needCalculate,a.current,d.token]),l(v).useEffect(()=>{let t=mX(r.current.content,"polotno-workspace-inner"),n=()=>{e.selectedElements.length&&h({fit:!0,needCalculate:!0,token:Math.random()})};return t?.addEventListener("scroll",n),()=>{t?.removeEventListener("scroll",n)}},[]),0===e.selectedShapes.length||s||!o||e.activePage!==t||c)return null;let f=n?.Position||mY,g=n?.Duplicate||mF,m=n?.Remove||mz,y=mM({components:n,type:e.selectedElements[0].type,usedItems:[]}),b=r?.current?.findOne("Transformer")?.rotation()||0,w=30;return 5>Math.abs(b)&&d.fit&&(w=80),Math.abs(b)>160&&!d.fit&&(w=80),(0,p.jsx)(r3,{transformFunc:e=>{let t=i.x+i.width/2,n=d.fit?i.y*e.scaleY-w:i.y*e.scaleY+i.height*e.scaleY+w;return{...e,x:e.x+t*e.scaleX,y:e.y+n,scaleX:1,scaleY:1}},divProps:{style:{pointerEvents:"none"}},children:(0,p.jsx)("div",{ref:a,style:{pointerEvents:"none"},children:(0,p.jsx)(mA,{style:{padding:"2px",borderRadius:"5px",height:"34px",transform:"translate(-50%, -50%)",pointerEvents:"auto"},children:(0,p.jsxs)(mP,{style:{height:"30px"},children:[y.map(t=>{let r=n[t];return(0,p.jsx)(r,{elements:e.selectedElements,element:e.selectedElements[0],store:e},t)}),(0,p.jsx)(g,{store:e}),(0,p.jsx)(m,{store:e}),(0,p.jsx)(f,{store:e})]})})})})});var mQ=({components:e,...t})=>((e=e||{}).PageControls=e.PageControls??mO,e.Tooltip=e.Tooltip??mZ,(0,p.jsx)(sC,{...t,components:e})),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),mJ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.tagName,r=(0,sO.__rest)(e,["className","tagName"]),i=l(sk)(cr,t);return v.createElement(void 0===n?"div":n,(0,sO.__assign)((0,sO.__assign)({},r),{className:i}))},t.displayName="".concat(pa,".Divider"),t}(pO);h("8NFma");let m0=P(({store:e})=>(0,p.jsxs)(mA.Group,{align:sT.LEFT,children:[(0,p.jsx)(pA,{icon:"undo",minimal:!0,onClick:()=>{e.history.undo()},disabled:!e.history.canUndo}),(0,p.jsx)(pA,{icon:"redo",minimal:!0,onClick:()=>{e.history.redo()},disabled:!e.history.canRedo})]}));var v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),m1=v.forwardRef(function(e,t){var n,r=e.alignText,i=e.className,o=e.fill,a=e.minimal,s=e.large,u=e.vertical,c=(0,sO.__rest)(e,["alignText","className","fill","minimal","large","vertical"]),d=l(sk)(sP.BUTTON_GROUP,((n={})[sP.FILL]=o,n[sP.LARGE]=s,n[sP.MINIMAL]=a,n[sP.VERTICAL]=u,n),sP.alignmentClass(r),i);return v.createElement("div",(0,sO.__assign)({},c,{ref:t,className:d}),e.children)});m1.displayName="".concat(pa,".ButtonGroup");var sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),m2=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.state={hasPendingUpdate:!1,isComposing:!1,nextValue:n.props.value,value:n.props.value},n.cancelPendingCompositionEnd=null,n.handleCompositionStart=function(e){var t,r,i;null===(t=n.cancelPendingCompositionEnd)||void 0===t||t.call(n),n.setState({isComposing:!0}),null===(i=(r=n.props).onCompositionStart)||void 0===i||i.call(r,e)},n.handleCompositionEnd=function(e){var r,i;n.cancelPendingCompositionEnd=n.setTimeout(function(){return n.setState({isComposing:!1})},t.COMPOSITION_END_DELAY),null===(i=(r=n.props).onCompositionEnd)||void 0===i||i.call(r,e)},n.handleChange=function(e){var t,r,i=e.target.value;n.setState({nextValue:i}),null===(r=(t=n.props).onChange)||void 0===r||r.call(t,e)},n}return(0,sO.__extends)(t,e),t.getDerivedStateFromProps=function(e,t){return t.isComposing||void 0===e.value?null:t.nextValue!==t.value?e.value===t.nextValue?t.hasPendingUpdate?{value:e.value,hasPendingUpdate:!1}:{value:t.nextValue}:e.value===t.value?{hasPendingUpdate:!0}:{value:e.value,nextValue:e.value,hasPendingUpdate:!1}:{value:e.value,nextValue:e.value,hasPendingUpdate:!1}},t.prototype.render=function(){var e=this.state,t=e.isComposing,n=e.hasPendingUpdate,r=e.value,i=e.nextValue,o=this.props,a=o.inputRef,l=(0,sO.__rest)(o,["inputRef"]);return v.createElement("input",(0,sO.__assign)({},l,{ref:a,value:t||n?i:r,onCompositionStart:this.handleCompositionStart,onCompositionEnd:this.handleCompositionEnd,onChange:this.handleChange}))},t.displayName="".concat(pa,".AsyncControllableInput"),t.COMPOSITION_END_DELAY=10,t}(pO),m3=["onValueChange"],m5=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={},t.leftElement=null,t.rightElement=null,t.refHandlers={leftElement:function(e){return t.leftElement=e},rightElement:function(e){return t.rightElement=e}},t.handleInputChange=function(e){var n,r,i,o,a=e.target.value;null===(r=(n=t.props).onChange)||void 0===r||r.call(n,e),null===(o=(i=t.props).onValueChange)||void 0===o||o.call(i,a,e.target)},t}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e,t=this.props,n=t.asyncControl,r=t.className,i=t.disabled,o=t.fill,a=t.inputClassName,s=t.inputRef,u=t.intent,c=t.large,d=t.readOnly,h=t.round,f=t.small,p=t.tagName,g=l(sk)(sP.INPUT_GROUP,sP.intentClass(u),((e={})[sP.DISABLED]=i,e[sP.READ_ONLY]=d,e[sP.FILL]=o,e[sP.LARGE]=c,e[sP.SMALL]=f,e[sP.ROUND]=h,e),r),m=(0,sO.__assign)((0,sO.__assign)({},this.props.style),{paddingLeft:this.state.leftElementWidth,paddingRight:this.state.rightElementWidth}),y=(0,sO.__assign)((0,sO.__assign)({type:"text"},ps(this.props,m3,!0)),{"aria-disabled":i,className:l(sk)(sP.INPUT,a),onChange:this.handleInputChange,style:m}),b=void 0!==n&&n?v.createElement(m2,(0,sO.__assign)({},y,{inputRef:s})):v.createElement("input",(0,sO.__assign)({},y,{ref:s}));return v.createElement(void 0===p?"div":p,{className:g},this.maybeRenderLeftElement(),b,this.maybeRenderRightElement())},t.prototype.componentDidMount=function(){this.updateInputWidth()},t.prototype.componentDidUpdate=function(e){var t=this.props,n=t.leftElement,r=t.rightElement;(e.leftElement!==n||e.rightElement!==r)&&this.updateInputWidth()},t.prototype.validateProps=function(e){null!=e.leftElement&&null!=e.leftIcon&&console.warn(f_)},t.prototype.maybeRenderLeftElement=function(){var e=this.props,t=e.leftElement,n=e.leftIcon;return null!=t?v.createElement("span",{className:sP.INPUT_LEFT_CONTAINER,ref:this.refHandlers.leftElement},t):null!=n?v.createElement(pC,{icon:n,"aria-hidden":!0,tabIndex:-1}):void 0},t.prototype.maybeRenderRightElement=function(){var e=this.props.rightElement;if(null!=e)return v.createElement("span",{className:sP.INPUT_ACTION,ref:this.refHandlers.rightElement},e)},t.prototype.updateInputWidth=function(){var e=this.state,t=e.leftElementWidth,n=e.rightElementWidth;if(null!=this.leftElement){var r=this.leftElement.clientWidth;(void 0===t||Math.abs(r-t)>2)&&this.setState({leftElementWidth:r})}else this.setState({leftElementWidth:void 0});if(null!=this.rightElement){var r=this.rightElement.clientWidth;(void 0===n||Math.abs(r-n)>2)&&this.setState({rightElementWidth:r})}else this.setState({rightElementWidth:void 0})},t.displayName="".concat(pa,".InputGroup"),t}(pO),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),py=h("leH9B"),m6=v.forwardRef(function(e,t){var n=e.size>=py.IconSize.LARGE,r=n?py.IconSize.LARGE:py.IconSize.STANDARD,i="".concat(-1*r/.05/2);return v.createElement(pS,(0,sO.__assign)({iconName:"chevron-down",ref:t},e),v.createElement("path",{d:n?"M320 280C314.4000000000001 280 309.4000000000001 277.8 305.8 274.2L200 168.2L94.2 274.2C90.6 277.8 85.6 280 80 280C69 280 60 271 60 260C60 254.4 62.2 249.4 65.8 245.8L185.8 125.8C189.4 122.2 194.4 120 200 120S210.6 122.2 214.2 125.8L334.2000000000001 245.8C337.8 249.4 340 254.4 340 260C340 271 331 280 320 280z":"M240 220C234.4 220 229.4 217.8 225.8 214.2L160 148.2L94.2 214.2C90.6 217.8 85.6 220 80 220C69 220 60 211 60 200C60 194.4 62.2 189.4 65.8 185.8L145.8 105.8C149.4 102.2 154.4 100 160 100S170.6 102.2 174.2 105.8L254.2 185.8C257.8 189.4 260 194.4 260 200C260 211 251 220 240 220z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")")}))});m6.defaultProps={size:py.IconSize.STANDARD},m6.displayName="Blueprint5.Icon.ChevronDown";var sO=h("gztBd"),v=h("8NFma"),py=h("leH9B"),m4=v.forwardRef(function(e,t){var n=e.size>=py.IconSize.LARGE,r=n?py.IconSize.LARGE:py.IconSize.STANDARD,i="".concat(-1*r/.05/2);return v.createElement(pS,(0,sO.__assign)({iconName:"chevron-up",ref:t},e),v.createElement("path",{d:n?"M334.2000000000001 154.2L214.2 274.2000000000001C210.6 277.8 205.6 280 200 280S189.4 277.8 185.8 274.2L65.8 154.2C62.2 150.6 60 145.6 60 140C60 129 69 120 80 120C85.6 120 90.6 122.2 94.2 125.8L200 231.8L305.8 126C309.4000000000001 122.2 314.4000000000001 120 320 120C331 120 340 129 340 140C340 145.6 337.8 150.6 334.2000000000001 154.2z":"M254.2 134.2L174.2 214.2C170.6 217.8 165.6 220 160 220S149.4 217.8 145.8 214.2L65.8 134.2C62.2 130.6 60 125.6 60 120C60 109 69 100 80 100C85.6 100 90.6 102.2 94.2 105.8L160 171.8L225.8 106C229.4 102.2 234.4 100 240 100C251 100 260 109 260 120C260 125.6 257.8 130.6 254.2 134.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")")}))});m4.defaultProps={size:py.IconSize.STANDARD},m4.displayName="Blueprint5.Icon.ChevronUp";var sO=h("gztBd"),v=h("8NFma"),m8=v.forwardRef(function(e,t){var n,r=e.children,i=e.className,o=e.fill,a=e.vertical,s=(0,sO.__rest)(e,["children","className","fill","vertical"]),u=l(sk)(sP.CONTROL_GROUP,((n={})[sP.FILL]=o,n[sP.VERTICAL]=a,n),i);return v.createElement("div",(0,sO.__assign)({},s,{ref:t,className:u}),r)});function m9(e){var t=1.9.toLocaleString(e),n=1..toLocaleString(e),r=9..toLocaleString(e),i=new RegExp("".concat(n,"(.+)").concat(r)).exec(t);return i&&i[1]||"."}function m7(e,t){return void 0===t&&(t="en-US"),vn(e.toLocaleString(t,{roundingPriority:"morePrecision"}),t)}function ve(e,t){var n=""+e;if(parseFloat(n).toString()===e.toString())return e.toString();if(void 0!==t){var r=m9(t);return vn(n,t).split("").map(function(e){var n;return -1!==(n=[0,1,2,3,4,5,6,7,8,9].map(function(e){return e.toLocaleString(t)}).indexOf(e))?n:e}).join("").replace(r,".")}return e.toString()}function vt(e,t){if(void 0===t)return/^[Ee0-9\+\-\.]$/.test(e);var n=m9(t).replace(".","\\.");return RegExp("^[Ee"+[0,1,2,3,4,5,6,7,8,9].map(function(e){return e.toLocaleString(t)}).join("")+"\\+\\-"+n+"]$").test(e)}function vn(e,t){return e.replace(/[\uFF10-\uFF19]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}).split("").filter(function(e){return vt(e,t)}).join("")}m8.displayName="".concat(pa,".ControlGroup"),(Pa=PI||(PI={}))[Pa.DOWN=-1]="DOWN",Pa[Pa.UP=1]="UP";var vr=["allowNumericCharactersOnly","buttonPosition","clampValueOnBlur","className","defaultValue","majorStepSize","minorStepSize","onButtonClick","onValueChange","selectAllOnFocus","selectAllOnIncrement","stepSize"],vi=function(e){function t(){var n,r,i=e.apply(this,arguments)||this;return i.numericInputId=fe.uniqueId("numericInput"),i.state={currentImeInputInvalid:!1,shouldSelectAfterUpdate:!1,stepMaxPrecision:t.getStepMaxPrecision(i.props),value:(void 0===(n=null!==(r=i.props.value)&&void 0!==r?r:i.props.defaultValue)&&(n=""),n.toString())},i.didPasteEventJustOccur=!1,i.delta=0,i.inputElement=null,i.inputRef=po(i,"inputElement",i.props.inputRef),i.incrementButtonHandlers=i.getButtonEventHandlers(PI.UP),i.decrementButtonHandlers=i.getButtonEventHandlers(PI.DOWN),i.getCurrentValueAsNumber=function(){return Number(ve(i.state.value,i.props.locale))},i.handleButtonClick=function(e,t){var n,r,o=i.updateDelta(t,e),a=i.incrementValue(o);null===(r=(n=i.props).onButtonClick)||void 0===r||r.call(n,Number(ve(a,i.props.locale)),a)},i.stopContinuousChange=function(){i.delta=0,i.clearTimeouts(),clearInterval(i.intervalId),document.removeEventListener("mouseup",i.stopContinuousChange)},i.handleContinuousChange=function(){if(void 0!==i.props.min||void 0!==i.props.max){var e,t,n,r,o=null!==(e=i.props.min)&&void 0!==e?e:-1/0,a=null!==(t=i.props.max)&&void 0!==t?t:1/0,l=i.getCurrentValueAsNumber();if(l<=o||l>=a){i.stopContinuousChange();return}}var s=i.incrementValue(i.delta);null===(r=(n=i.props).onButtonClick)||void 0===r||r.call(n,Number(ve(s,i.props.locale)),s)},i.handleInputFocus=function(e){var t,n;i.setState({shouldSelectAfterUpdate:i.props.selectAllOnFocus}),null===(n=(t=i.props).onFocus)||void 0===n||n.call(t,e)},i.handleInputBlur=function(e){var t,n;if(i.setState({shouldSelectAfterUpdate:!1}),i.props.clampValueOnBlur){var r=e.target.value;i.handleNextValue(i.roundAndClampValue(r))}null===(n=(t=i.props).onBlur)||void 0===n||n.call(t,e)},i.handleInputKeyDown=function(e){if(!i.props.disabled&&!i.props.readOnly){if("ArrowUp"===e.key?r=PI.UP:"ArrowDown"===e.key&&(r=PI.DOWN),void 0!==r){e.preventDefault();var t,n,r,o=i.updateDelta(r,e);i.incrementValue(o)}null===(n=(t=i.props).onKeyDown)||void 0===n||n.call(t,e)}},i.handleCompositionEnd=function(e){i.props.allowNumericCharactersOnly&&(i.handleNextValue(vn(e.data,i.props.locale)),i.setState({currentImeInputInvalid:!1}))},i.handleCompositionUpdate=function(e){if(i.props.allowNumericCharactersOnly){var t=e.data;0===vn(t,i.props.locale).length&&t.length>0?i.setState({currentImeInputInvalid:!0}):i.setState({currentImeInputInvalid:!1})}},i.handleInputKeyPress=function(e){var t,n,r;i.props.allowNumericCharactersOnly&&(r=i.props.locale,!(null==e.key||e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||vt(e.key,r)))&&e.preventDefault(),null===(n=(t=i.props).onKeyPress)||void 0===n||n.call(t,e)},i.handleInputPaste=function(e){var t,n;i.didPasteEventJustOccur=!0,null===(n=(t=i.props).onPaste)||void 0===n||n.call(t,e)},i.handleInputChange=function(e){var t=e;i.props.allowNumericCharactersOnly&&i.didPasteEventJustOccur&&(i.didPasteEventJustOccur=!1,t=vn(e,i.props.locale)),i.handleNextValue(t),i.setState({shouldSelectAfterUpdate:!1})},i}return(0,sO.__extends)(t,e),t.getDerivedStateFromProps=function(e,n){var r,i,o={prevMaxProp:e.max,prevMinProp:e.min},a=e.min!==n.prevMinProp,l=e.max!==n.prevMaxProp,s=null!==(i=null===(r=e.value)||void 0===r?void 0:r.toString())&&void 0!==i?i:n.value,u=t.getStepMaxPrecision(e),c=s!==t.VALUE_EMPTY?t.roundAndClampValue(s,u,e.min,e.max,0,e.locale):t.VALUE_EMPTY;return(a||l)&&c!==n.value?(0,sO.__assign)((0,sO.__assign)({},o),{stepMaxPrecision:u,value:c}):(0,sO.__assign)((0,sO.__assign)({},o),{stepMaxPrecision:u,value:s})},t.getStepMaxPrecision=function(e){return null!=e.minorStepSize?fe.countDecimalPlaces(e.minorStepSize):fe.countDecimalPlaces(e.stepSize)},t.roundAndClampValue=function(e,n,r,i,o,a){var l,s;return(void 0===o&&(o=0),l=ve(e,a),null!=e&&l-parseFloat(l)+1>=0)?m7(f0(Math.round((Number(ve(e,a))+o)*(s=Math.pow(10,n)))/s,null!=r?r:-1/0,null!=i?i:1/0),a):t.VALUE_EMPTY},t.prototype.render=function(){var e,t=this.props,n=t.buttonPosition,r=t.className,i=t.fill,o=t.large,a=t.small,s=l(sk)(sP.NUMERIC_INPUT,((e={})[sP.LARGE]=o,e[sP.SMALL]=a,e),r),u=this.renderButtons();return v.createElement(m8,{className:s,fill:i},n===sj.LEFT&&u,this.renderInput(),n===sj.RIGHT&&u)},t.prototype.componentDidUpdate=function(n,r){e.prototype.componentDidUpdate.call(this,n,r),n.inputRef!==this.props.inputRef&&(pn(n.inputRef,null),this.inputRef=po(this,"inputElement",this.props.inputRef),pn(this.props.inputRef,this.inputElement)),this.state.shouldSelectAfterUpdate&&(null===(i=this.inputElement)||void 0===i||i.setSelectionRange(0,this.state.value.length));var i,o,a,l=this.props.min!==n.min,s=this.props.max!==n.max,u=this.props.locale!==n.locale,c=this.state.value!==r.value;if((l||s)&&c||u&&r.value!==t.VALUE_EMPTY){var d=ve(u?r.value:this.state.value,n.locale),h=m7(+d,this.props.locale);null===(a=(o=this.props).onValueChange)||void 0===a||a.call(o,+d,h,this.inputElement)}},t.prototype.validateProps=function(e){var n=e.majorStepSize,r=e.max,i=e.min,o=e.minorStepSize,a=e.stepSize,l=e.value;if(null!=i&&null!=r&&i>r&&console.error(fE),a<=0&&console.error(fP),o&&o<=0&&console.error(fO),n&&n<=0&&console.error(fk),o&&o>a&&console.error(fS),n&&n<a&&console.error(fC),null!=l){var s=t.getStepMaxPrecision(e),u=t.roundAndClampValue(l.toString(),s,i,r,0,this.props.locale),c=u!==l.toString(),d=m7(Number(ve(l,this.props.locale)),this.props.locale);c&&u!==d&&console.warn(fT)}},t.prototype.renderButtons=function(){var e=this.props,t=e.intent,n=e.max,r=e.min,i=e.locale,o=ve(this.state.value,i),a=this.props.disabled||this.props.readOnly;return v.createElement(m1,{className:sP.FIXED,key:"button-group",vertical:!0},v.createElement(pA,(0,sO.__assign)({"aria-label":"increment","aria-controls":this.numericInputId,disabled:a||void 0!==n&&""!==o&&+o>=n,icon:v.createElement(m4,null),intent:t},this.incrementButtonHandlers)),v.createElement(pA,(0,sO.__assign)({"aria-label":"decrement","aria-controls":this.numericInputId,disabled:a||void 0!==r&&""!==o&&+o<=r,icon:v.createElement(m6,null),intent:t},this.decrementButtonHandlers)))},t.prototype.renderInput=function(){var e=ps(this.props,vr,!0),t=this.getCurrentValueAsNumber();return v.createElement(m5,(0,sO.__assign)({asyncControl:this.props.asyncControl,autoComplete:"off",id:this.numericInputId,role:this.props.allowNumericCharactersOnly?"spinbutton":void 0},e,{"aria-valuemax":this.props.max,"aria-valuemin":this.props.min,"aria-valuenow":t,intent:this.state.currentImeInputInvalid?sN.DANGER:this.props.intent,inputClassName:this.props.inputClassName,inputRef:this.inputRef,large:this.props.large,leftElement:this.props.leftElement,leftIcon:this.props.leftIcon,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onCompositionEnd:this.handleCompositionEnd,onCompositionUpdate:this.handleCompositionUpdate,onKeyDown:this.handleInputKeyDown,onKeyPress:this.handleInputKeyPress,onPaste:this.handleInputPaste,onValueChange:this.handleInputChange,rightElement:this.props.rightElement,small:this.props.small,value:this.state.value}))},t.prototype.getButtonEventHandlers=function(e){var t=this;return{onKeyDown:function(n){!t.props.disabled&&fe.isKeyboardClick(n)&&t.handleButtonClick(n,e)},onMouseDown:function(n){t.props.disabled||(t.handleButtonClick(n,e),t.startContinuousChange())}}},t.prototype.startContinuousChange=function(){var e=this;document.addEventListener("mouseup",this.stopContinuousChange),this.setTimeout(function(){e.intervalId=window.setInterval(e.handleContinuousChange,t.CONTINUOUS_CHANGE_INTERVAL)},t.CONTINUOUS_CHANGE_DELAY)},t.prototype.handleNextValue=function(e){var t,n;null==this.props.value&&this.setState({value:e}),null===(n=(t=this.props).onValueChange)||void 0===n||n.call(t,Number(ve(e,this.props.locale)),e,this.inputElement)},t.prototype.incrementValue=function(e){var n=this.state.value===t.VALUE_EMPTY?t.VALUE_ZERO:this.state.value,r=this.roundAndClampValue(n,e);return r!==this.state.value&&(this.handleNextValue(r),this.setState({shouldSelectAfterUpdate:this.props.selectAllOnIncrement})),r},t.prototype.getIncrementDelta=function(e,t,n){var r=this.props,i=r.majorStepSize,o=r.minorStepSize,a=r.stepSize;return t&&null!=i?e*i:n&&null!=o?e*o:e*a},t.prototype.roundAndClampValue=function(e,n){return void 0===n&&(n=0),t.roundAndClampValue(e,this.state.stepMaxPrecision,this.props.min,this.props.max,n,this.props.locale)},t.prototype.updateDelta=function(e,t){return this.delta=this.getIncrementDelta(e,t.shiftKey,t.altKey),this.delta},t.displayName="".concat(pa,".NumericInput"),t.VALUE_EMPTY="",t.VALUE_ZERO="0",t.defaultProps={allowNumericCharactersOnly:!0,buttonPosition:sj.RIGHT,clampValueOnBlur:!1,defaultValue:t.VALUE_EMPTY,large:!1,majorStepSize:10,minorStepSize:.1,selectAllOnFocus:!1,selectAllOnIncrement:!1,small:!1,stepSize:1},t.CONTINUOUS_CHANGE_DELAY=300,t.CONTINUOUS_CHANGE_INTERVAL=100,t}(pO),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma");function vo(e){return"".concat((100*e).toFixed(2),"%")}function va(e,t,n,r){for(var i=t<n?1:-1,o=t;o!==n+i;o+=i)e[o]=r}var vl=["max","min","stepSize","tickSize","value"],vs=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={isMoving:!1},t.handleElement=null,t.refHandlers={handle:function(e){return t.handleElement=e}},t.beginHandleMovement=function(e){document.addEventListener("mousemove",t.handleHandleMovement),document.addEventListener("mouseup",t.endHandleMovement),t.setState({isMoving:!0}),t.changeValue(t.clientToValue(t.mouseEventClientOffset(e)))},t.beginHandleTouchMovement=function(e){document.addEventListener("touchmove",t.handleHandleTouchMovement),document.addEventListener("touchend",t.endHandleTouchMovement),document.addEventListener("touchcancel",t.endHandleTouchMovement),t.setState({isMoving:!0}),t.changeValue(t.clientToValue(t.touchEventClientOffset(e)))},t.getStyleProperties=function(){if(null==t.handleElement)return{};var e=t.props,n=e.min,r=e.tickSizeRatio,i=e.value,o=e.vertical,a=t.getHandleMidpointAndOffset(t.handleElement,!0).handleMidpoint,l="calc(".concat(vo((i-(void 0===n?0:n))*r)," - ").concat(a,"px)");return o?{bottom:l}:{left:l}},t.endHandleMovement=function(e){t.handleMoveEndedAt(t.mouseEventClientOffset(e))},t.endHandleTouchMovement=function(e){t.handleMoveEndedAt(t.touchEventClientOffset(e))},t.handleMoveEndedAt=function(e){t.removeDocumentEventListeners(),t.setState({isMoving:!1});var n,r,i=t.changeValue(t.clientToValue(e));null===(r=(n=t.props).onRelease)||void 0===r||r.call(n,i)},t.handleHandleMovement=function(e){t.handleMovedTo(t.mouseEventClientOffset(e))},t.handleHandleTouchMovement=function(e){t.handleMovedTo(t.touchEventClientOffset(e))},t.handleMovedTo=function(e){t.state.isMoving&&!t.props.disabled&&t.changeValue(t.clientToValue(e))},t.handleKeyDown=function(e){var n=t.props,r=n.stepSize,i=n.value,o=e.key;"ArrowDown"===o||"ArrowLeft"===o?(t.changeValue(i-r),e.preventDefault()):("ArrowUp"===o||"ArrowRight"===o)&&(t.changeValue(i+r),e.preventDefault())},t.handleKeyUp=function(e){var n,r;fe.isArrowKey(e)&&(null===(r=(n=t.props).onRelease)||void 0===r||r.call(n,t.props.value))},t}return(0,sO.__extends)(t,e),t.prototype.componentDidMount=function(){this.forceUpdate()},t.prototype.render=function(){var e,t=this.props,n=t.className,r=t.disabled,i=t.label,o=t.min,a=t.max,s=t.value,u=t.vertical,c=t.htmlProps,d=this.state.isMoving;return v.createElement("span",(0,sO.__assign)({role:"slider",tabIndex:0},c,{className:l(sk)(sP.SLIDER_HANDLE,((e={})[sP.ACTIVE]=d,e),n),onKeyDown:r?void 0:this.handleKeyDown,onKeyUp:r?void 0:this.handleKeyUp,onMouseDown:r?void 0:this.beginHandleMovement,onTouchStart:r?void 0:this.beginHandleTouchMovement,ref:this.refHandlers.handle,style:this.getStyleProperties(),"aria-valuemin":o,"aria-valuemax":a,"aria-valuenow":s,"aria-disabled":r,"aria-orientation":u?"vertical":"horizontal"}),null==i?null:v.createElement("span",{className:sP.SLIDER_LABEL},i))},t.prototype.componentWillUnmount=function(){this.removeDocumentEventListeners()},t.prototype.clientToValue=function(e){var t=this.props,n=t.stepSize,r=t.tickSize,i=t.value,o=t.vertical;if(null==this.handleElement)return i;var a=(o?window.innerHeight-e:e)-this.getHandleElementCenterPixel(this.handleElement);return isNaN(a)?i:i+Math.round(a/(r*n))*n},t.prototype.mouseEventClientOffset=function(e){return this.props.vertical?e.clientY:e.clientX},t.prototype.touchEventClientOffset=function(e){var t=e.changedTouches[0];return this.props.vertical?t.clientY:t.clientX},t.prototype.validateProps=function(e){for(var t=0;t<vl.length;t++){var n=vl[t];if("number"!=typeof e[n])throw Error("[Blueprint] <Handle> requires number value for ".concat(n," prop"))}},t.prototype.changeValue=function(e,t){return void 0===t&&(t=this.props.onChange),isNaN(e=this.clamp(e))||this.props.value===e||null==t||t(e),e},t.prototype.clamp=function(e){return f0(e,this.props.min,this.props.max)},t.prototype.getHandleElementCenterPixel=function(e){var t=this.getHandleMidpointAndOffset(e),n=t.handleMidpoint;return t.handleOffset+n},t.prototype.getHandleMidpointAndOffset=function(e,t){if(void 0===t&&(t=!1),null==e)return{handleMidpoint:0,handleOffset:0};var n=this.props.vertical,r=e.getBoundingClientRect();r.width=e.offsetWidth,r.height=e.offsetHeight;var i=n?t?"width":"height":t?"height":"width",o=n?window.innerHeight-(r.top+r[i]):r.left;return{handleMidpoint:r[i]/2,handleOffset:o}},t.prototype.removeDocumentEventListeners=function(){document.removeEventListener("mousemove",this.handleHandleMovement),document.removeEventListener("mouseup",this.endHandleMovement),document.removeEventListener("touchmove",this.handleHandleTouchMovement),document.removeEventListener("touchend",this.endHandleTouchMovement),document.removeEventListener("touchcancel",this.endHandleTouchMovement)},t.displayName="".concat(pa,".SliderHandle"),t}(pO),vu={START:"start",END:"end"},vc={PUSH:"push",NONE:"none"},vd=function(){return null};vd.displayName="".concat(pa,".MultiSliderHandle");var vh=function(e){function t(){var t,n,r,i,o=null!==e&&e.apply(this,arguments)||this;return o.state={labelPrecision:(n=(t=o.props).labelPrecision,i=void 0===(r=t.stepSize)?vh.defaultSliderProps.stepSize:r,null==n?fe.countDecimalPlaces(i):n),tickSize:0,tickSizeRatio:0},o.handleElements=[],o.trackElement=null,o.addHandleRef=function(e){null!=e&&o.handleElements.push(e)},o.maybeHandleTrackClick=function(e){if(o.canHandleTrackEvent(e)){var t=o.nearestHandleForValue(o.handleElements,function(t){return t.mouseEventClientOffset(e)});t&&t.beginHandleMovement(e)}},o.maybeHandleTrackTouch=function(e){if(o.canHandleTrackEvent(e)){var t=o.nearestHandleForValue(o.handleElements,function(t){return t.touchEventClientOffset(e)});t&&t.beginHandleTouchMovement(e)}},o.canHandleTrackEvent=function(e){var t=e.target;return!o.props.disabled&&null==t.closest(".".concat(sP.SLIDER_HANDLE))},o.getHandlerForIndex=function(e,t){return function(n){null==t||t(o.getNewHandleValues(n,e))}},o.handleChange=function(e){var t,n,r=vf(o.props),i=r.map(function(e){return e.value});fe.arraysEqual(e,i)||(null===(n=(t=o.props).onChange)||void 0===n||n.call(t,e),r.forEach(function(t,n){var r;i[n]!==e[n]&&(null===(r=t.onChange)||void 0===r||r.call(t,e[n]))}))},o.handleRelease=function(e){var t,n,r=vf(o.props);null===(n=(t=o.props).onRelease)||void 0===n||n.call(t,e),r.forEach(function(t,n){var r;null===(r=t.onRelease)||void 0===r||r.call(t,e[n])})},o}return(0,sO.__extends)(t,e),t.getDerivedStateFromProps=function(e){return{labelPrecision:t.getLabelPrecision(e)}},t.getLabelPrecision=function(e){var t=e.labelPrecision,n=e.stepSize;return null==t?fe.countDecimalPlaces(n):t},t.prototype.getSnapshotBeforeUpdate=function(e){var t=vf(e);return vf(this.props).length!==t.length&&(this.handleElements=[]),null},t.prototype.render=function(){var e,t=this,n=l(sk)(sP.SLIDER,((e={})[sP.DISABLED]=this.props.disabled,e["".concat(sP.SLIDER,"-unlabeled")]=!1===this.props.labelRenderer,e[sP.VERTICAL]=this.props.vertical,e),this.props.className);return v.createElement("div",{className:n,onMouseDown:this.maybeHandleTrackClick,onTouchStart:this.maybeHandleTrackTouch},v.createElement("div",{className:sP.SLIDER_TRACK,ref:function(e){return t.trackElement=e}},this.renderTracks()),v.createElement("div",{className:sP.SLIDER_AXIS},this.renderLabels()),this.renderHandles())},t.prototype.componentDidMount=function(){this.updateTickSize()},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n),this.updateTickSize()},t.prototype.validateProps=function(e){if(e.stepSize<=0)throw Error(fH);if(void 0!==e.labelStepSize&&void 0!==e.labelValues)throw Error(f$);if(void 0!==e.labelStepSize&&e.labelStepSize<=0)throw Error(fV);if(void 0!==e.min&&!isFinite(e.min))throw Error(fq);if(void 0!==e.max&&!isFinite(e.max))throw Error(fG);var n=!1;if(v.Children.forEach(e.children,function(e){e&&!fe.isElementOfType(e,t.Handle)&&(n=!0)}),n)throw Error(fW)},t.prototype.formatLabel=function(e,t){void 0===t&&(t=!1);var n=this.props.labelRenderer;return!1===n?void 0:fe.isFunction(n)?n(e,{isHandleTooltip:t}):e.toFixed(this.state.labelPrecision)},t.prototype.renderLabels=function(){var e=this;if(!1===this.props.labelRenderer)return null;var t=this.getLabelValues(),n=this.props,r=n.max,i=n.min;return t.map(function(t,n){var o=vo((t-i)/(r-i)),a=e.props.vertical?{bottom:o}:{left:o};return v.createElement("div",{className:sP.SLIDER_LABEL,key:n,style:a},e.formatLabel(t))})},t.prototype.renderTracks=function(){var e=vp(this.props);e.push({value:this.props.max});for(var t={value:this.props.min},n=[],r=0;r<e.length;r++){var i=e[r];n.push(this.renderTrackFill(r,t,i)),t=i}return n},t.prototype.renderTrackFill=function(e,t,n){var r=[this.getOffsetRatio(t.value),this.getOffsetRatio(n.value)].sort(function(e,t){return e-t}),i=r[0],o=r[1],a=vo(i),s=vo(1-o),u=this.props.vertical?{bottom:a,top:s,left:0}:{left:a,right:s,top:0},c=(0,sO.__assign)((0,sO.__assign)({},u),t.trackStyleAfter||n.trackStyleBefore||{}),d=l(sk)(sP.SLIDER_PROGRESS,sP.intentClass(this.getTrackIntent(t,n)));return v.createElement("div",{key:"track-".concat(e),className:d,style:c})},t.prototype.renderHandles=function(){var e=this,t=this.props,n=t.disabled,r=t.max,i=t.min,o=t.stepSize,a=t.vertical,s=vf(this.props);return 0===s.length?null:s.map(function(t,u){var c,d=t.value,h=t.type,f=t.className,p=t.htmlProps;return v.createElement(vs,{htmlProps:p,className:l(sk)(((c={})[sP.START]=h===vu.START,c[sP.END]=h===vu.END,c),f),disabled:n,key:"".concat(u,"-").concat(s.length),label:e.formatLabel(d,!0),max:r,min:i,onChange:e.getHandlerForIndex(u,e.handleChange),onRelease:e.getHandlerForIndex(u,e.handleRelease),ref:e.addHandleRef,stepSize:o,tickSize:e.state.tickSize,tickSizeRatio:e.state.tickSizeRatio,value:d,vertical:a})})},t.prototype.nearestHandleForValue=function(e,t){return function(e,t){if(0!==e.length){for(var n=e[0],r=t(n),i=1;i<e.length;i++){var o=e[i],a=t(o);a<r&&(n=o,r=a)}return n}}(e,function(e){var n=t(e);return Math.abs(e.clientToValue(n)-e.props.value)})},t.prototype.getNewHandleValues=function(e,t){var n=vf(this.props).map(function(e){return e.value}),r=n.slice();r[t]=e,r.sort(function(e,t){return e-t});var i=r.indexOf(e),o=this.findFirstLockedHandleIndex(t,i);if(-1===o)va(r,t,i,e);else{var a=n[o];return va(n,t,o,a),n}return r},t.prototype.findFirstLockedHandleIndex=function(e,t){for(var n=e<t?1:-1,r=vf(this.props),i=e+n;i!==t+n;i+=n)if(r[i].interactionKind!==vc.PUSH)return i;return -1},t.prototype.getLabelValues=function(){var e=this.props,t=e.labelStepSize,n=e.labelValues,r=e.min,i=e.max,o=[];if(void 0!==n)o=n.slice();else for(var a=r;a<i||fe.approxEqual(a,i);a+=null!=t?t:1)o.push(a);return o},t.prototype.getOffsetRatio=function(e){return fe.clamp((e-this.props.min)*this.state.tickSizeRatio,0,1)},t.prototype.getTrackIntent=function(e,t){return this.props.showTrackFill?void 0!==e.intentAfter?e.intentAfter:void 0!==t&&void 0!==t.intentBefore?t.intentBefore:this.props.defaultTrackIntent:sN.NONE},t.prototype.updateTickSize=function(){if(null!=this.trackElement){var e=this.props.vertical?this.trackElement.clientHeight:this.trackElement.clientWidth,t=1/(this.props.max-this.props.min);this.setState({tickSize:e*t,tickSizeRatio:t})}},t.defaultSliderProps={disabled:!1,max:10,min:0,showTrackFill:!0,stepSize:1,vertical:!1},t.defaultProps=(0,sO.__assign)((0,sO.__assign)({},t.defaultSliderProps),{defaultTrackIntent:sN.NONE}),t.displayName="".concat(pa,".MultiSlider"),t.Handle=vd,t}(pO);function vf(e){return vp(e,function(e){return e.interactionKind!==vc.NONE})}function vp(e,t){var n=e.children;void 0===t&&(t=function(){return!0});var r=v.Children.map(n,function(e){return fe.isElementOfType(e,vh.Handle)&&t(e.props)?e.props:null}),i=null!=r?r:[];return(i=i.filter(function(e){return null!==e})).sort(function(e,t){return e.value-t.value}),i}var vg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.initialValue,n=e.intent,r=e.value,i=e.onChange,o=e.onRelease,a=e.handleHtmlProps,l=(0,sO.__rest)(e,["initialValue","intent","value","onChange","onRelease","handleHtmlProps"]);return v.createElement(vh,(0,sO.__assign)({},l),v.createElement(vh.Handle,{value:r,intentAfter:r<t?n:void 0,intentBefore:r>=t?n:void 0,onChange:i,onRelease:o,htmlProps:a}),v.createElement(vh.Handle,{value:t,interactionKind:"none"}))},t.defaultProps=(0,sO.__assign)((0,sO.__assign)({},vh.defaultSliderProps),{initialValue:0,intent:sN.PRIMARY,value:0}),t.displayName="".concat(pa,".Slider"),t}(pO),vm=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function vv(e,t){if(e.length!==t.length)return!1;for(var n,r,i=0;i<e.length;i++)if(!((n=e[i])===(r=t[i])||vm(n)&&vm(r)))return!1;return!0}var vy=function(e,t){void 0===t&&(t=vv);var n,r,i=[],o=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return o&&n===this&&t(a,i)||(r=e.apply(this,a),o=!0,n=this,i=a),r}},v=h("8NFma"),vb="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function vw(e){cancelAnimationFrame(e.id)}var vx=-1;function v_(e){if(void 0===e&&(e=!1),-1===vx||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),vx=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return vx}var vE=null;function vS(e){if(void 0===e&&(e=!1),null===vE||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?vE="positive-descending":(t.scrollLeft=1,vE=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t)}return vE}var vC=function(e,t,n,r){var i,o,a;if("column"===e?(i=r.columnMetadataMap,o=t.columnWidth,a=r.lastMeasuredColumnIndex):(i=r.rowMetadataMap,o=t.rowHeight,a=r.lastMeasuredRowIndex),n>a){var l=0;if(a>=0){var s=i[a];l=s.offset+s.size}for(var u=a+1;u<=n;u++){var c=o(u);i[u]={offset:l,size:c},l+=c}"column"===e?r.lastMeasuredColumnIndex=n:r.lastMeasuredRowIndex=n}return i[n]},vO=function(e,t){return e},vk=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},vP=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,o=n.lastMeasuredIndex;if(t>o){var a=0;if(o>=0){var l=i[o];a=l.offset+l.size}for(var s=o+1;s<=t;s++){var u=r(s);i[s]={offset:a,size:u},a+=u}n.lastMeasuredIndex=t}return i[t]},vT=(Pu=(Pl={getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var a=e.direction,l=e.height,s=e.itemCount,u=e.itemSize,c=e.layout,d=e.width,h="horizontal"===a||"horizontal"===c?d:l,f=Math.max(0,s*u-h),p=Math.min(f,t*u),g=Math.max(0,t*u-h+u+o);switch("smart"===n&&(n=r>=g-h&&r<=p+h?"auto":"center"),n){case"start":return p;case"end":return g;case"center":var m=Math.round(g+(p-g)/2);if(m<Math.ceil(h/2))return 0;if(m>f+Math.floor(h/2))return f;return m;default:if(r>=g&&r<=p)return r;if(r<g)return g;return p}},getStartIndexForOffset:function(e,t){return Math.max(0,Math.min(e.itemCount-1,Math.floor(t/e.itemSize)))},getStopIndexForStartIndex:function(e,t,n){var r=e.direction,i=e.height,o=e.itemCount,a=e.itemSize,l=e.layout,s=e.width,u=Math.ceil((("horizontal"===r||"horizontal"===l?s:i)+n-t*a)/a);return Math.max(0,Math.min(o-1,t+u-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}}).getItemOffset,Pc=Pl.getEstimatedTotalSize,Pd=Pl.getItemSize,Ph=Pl.getOffsetForIndexAndAlignment,Pf=Pl.getStartIndexForOffset,Pp=Pl.getStopIndexForStartIndex,Pg=Pl.initInstanceProps,Pm=Pl.shouldResetStyleCacheOnItemSizeChange,Pv=Pl.validateProps,(Ps=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=Pg(n.props,g7(n)),n._outerRef=void 0,n._resetIsScrollingTimeoutId=null,n.state={instance:g7(n),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof n.props.initialScrollOffset?n.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},n._callOnItemsRendered=void 0,n._callOnItemsRendered=vy(function(e,t,r,i){return n.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:r,visibleStopIndex:i})}),n._callOnScroll=void 0,n._callOnScroll=vy(function(e,t,r){return n.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:r})}),n._getItemStyle=void 0,n._getItemStyle=function(e){var t,r=n.props,i=r.direction,o=r.itemSize,a=r.layout,l=n._getItemStyleCache(Pm&&o,Pm&&a,Pm&&i);if(l.hasOwnProperty(e))t=l[e];else{var s=Pu(n.props,e,n._instanceProps),u=Pd(n.props,e,n._instanceProps),c="horizontal"===i||"horizontal"===a,d="rtl"===i,h=c?s:0;l[e]=t={position:"absolute",left:d?void 0:h,right:d?h:void 0,top:c?0:s,height:c?"100%":u,width:c?u:"100%"}}return t},n._getItemStyleCache=void 0,n._getItemStyleCache=vy(function(e,t,n){return{}}),n._onScrollHorizontal=function(e){var t=e.currentTarget,r=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;n.setState(function(e){if(e.scrollOffset===i)return null;var t=n.props.direction,a=i;if("rtl"===t)switch(vS()){case"negative":a=-i;break;case"positive-descending":a=o-r-i}return a=Math.max(0,Math.min(a,o-r)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._onScrollVertical=function(e){var t=e.currentTarget,r=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;n.setState(function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-r));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){var e,t,r;null!==n._resetIsScrollingTimeoutId&&vw(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=(e=n._resetIsScrolling,t=vb(),r={id:requestAnimationFrame(function n(){vb()-t>=150?e.call(null):r.id=requestAnimationFrame(n)})})},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},function(){n._getItemStyleCache(-1,null)})},n}gY(t,e),t.getDerivedStateFromProps=function(e,t){return vk(e,t),Pv(e),null};var n=t.prototype;return n.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},n.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var a=0;if(this._outerRef){var l=this._outerRef;a="vertical"===i?l.scrollWidth>l.clientWidth?v_():0:l.scrollHeight>l.clientHeight?v_():0}this.scrollTo(Ph(this.props,e,t,o,this._instanceProps,a))},n.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},n.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n){if("rtl"===t)switch(vS()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var a=o.clientWidth,l=o.scrollWidth;o.scrollLeft=l-a-i}else o.scrollLeft=i}else o.scrollTop=i}this._callPropsCallbacks()},n.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&vw(this._resetIsScrollingTimeoutId)},n.render=function(){var e=this.props,t=e.children,n=e.className,r=e.direction,i=e.height,o=e.innerRef,a=e.innerElementType,l=e.innerTagName,s=e.itemCount,u=e.itemData,c=e.itemKey,d=void 0===c?vO:c,h=e.layout,f=e.outerElementType,p=e.outerTagName,g=e.style,m=e.useIsScrolling,y=e.width,b=this.state.isScrolling,w="horizontal"===r||"horizontal"===h,x=w?this._onScrollHorizontal:this._onScrollVertical,_=this._getRangeToRender(),E=_[0],S=_[1],C=[];if(s>0)for(var O=E;O<=S;O++)C.push((0,v.createElement)(t,{data:u,key:d(O,u),index:O,isScrolling:m?b:void 0,style:this._getItemStyle(O)}));var k=Pc(this.props,this._instanceProps);return(0,v.createElement)(f||p||"div",{className:n,onScroll:x,ref:this._outerRefSetter,style:gW({position:"relative",height:i,width:y,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:r},g)},(0,v.createElement)(a||l||"div",{children:C,ref:o,style:{height:w?"100%":k,pointerEvents:b?"none":void 0,width:w?k:"100%"}}))},n._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,a=o.scrollDirection,l=o.scrollOffset,s=o.scrollUpdateWasRequested;this._callOnScroll(a,l,s)}},n._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,a=r.scrollOffset;if(0===t)return[0,0,0,0];var l=Pf(this.props,a,this._instanceProps),s=Pp(this.props,l,a,this._instanceProps);return[Math.max(0,l-(i&&"backward"!==o?1:Math.max(1,n))),Math.max(0,Math.min(t-1,s+(i&&"forward"!==o?1:Math.max(1,n)))),l,s]},t}(v.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},Ps),v=(h("8NFma"),h("8NFma"));let vA=()=>{},vN=vA(),vj=Object,vR=e=>e===vN,vI=e=>"function"==typeof e,vL=(e,t)=>({...e,...t}),vM=e=>vI(e.then),vD=new WeakMap,vF=0,vz=e=>{let t,n;let r=typeof e,i=e&&e.constructor,o=i==Date;if(vj(e)!==e||o||i==RegExp)t=o?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=vD.get(e))return t;if(t=++vF+"~",vD.set(e,t),i==Array){for(n=0,t="@";n<e.length;n++)t+=vz(e[n])+",";vD.set(e,t)}if(i==vj){t="#";let r=vj.keys(e).sort();for(;!vR(n=r.pop());)vR(e[n])||(t+=n+":"+vz(e[n])+",");vD.set(e,t)}}return t},vB=new WeakMap,vU={},vH={},vV="undefined",vq=typeof window!=vV,vG=typeof document!=vV,vW=()=>vq&&typeof window.requestAnimationFrame!=vV,v$=(e,t)=>{let n=vB.get(e);return[()=>!vR(t)&&e.get(t)||vU,r=>{if(!vR(t)){let i=e.get(t);t in vH||(vH[t]=i),n[5](t,vL(i,r),i||vU)}},n[6],()=>!vR(t)&&t in vH?vH[t]:!vR(t)&&e.get(t)||vU]},vK=!0,[vY,vX]=vq&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[vA,vA],vZ={initFocus:e=>(vG&&document.addEventListener("visibilitychange",e),vY("focus",e),()=>{vG&&document.removeEventListener("visibilitychange",e),vX("focus",e)}),initReconnect:e=>{let t=()=>{vK=!0,e()},n=()=>{vK=!1};return vY("online",t),vY("offline",n),()=>{vX("online",t),vX("offline",n)}}},vQ=!l(v).useId,vJ=!vq||"Deno"in window,v0=e=>vW()?window.requestAnimationFrame(e):setTimeout(e,1),v1=vJ?v.useEffect:v.useLayoutEffect,v2="undefined"!=typeof navigator&&navigator.connection,v3=!vJ&&v2&&(["slow-2g","2g"].includes(v2.effectiveType)||v2.saveData),v5=e=>{if(vI(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?vz(e):"",t]},v6=0,v4=()=>++v6;var v8={ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:0,MUTATE_EVENT:2,RECONNECT_EVENT:1};async function v9(...e){let[t,n,r,i]=e,o=vL({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{}),a=o.populateCache,l=o.rollbackOnError,s=o.optimisticData,u=!1!==o.revalidate,c=e=>"function"==typeof l?l(e):!1!==l,d=o.throwOnError;if(vI(n)){let e=[];for(let r of t.keys())!/^\$(inf|sub)\$/.test(r)&&n(t.get(r)._k)&&e.push(r);return Promise.all(e.map(h))}return h(n);async function h(n){let i;let[o]=v5(n);if(!o)return;let[l,h]=v$(t,o),[f,p,g,m]=vB.get(t),v=()=>{let e=f[o];return u&&(delete g[o],delete m[o],e&&e[0])?e[0](2).then(()=>l().data):l().data};if(e.length<3)return v();let y=r,b=v4();p[o]=[b,0];let w=!vR(s),x=l(),_=x.data,E=x._c,S=vR(E)?_:E;if(w&&h({data:s=vI(s)?s(S,_):s,_c:S}),vI(y))try{y=y(S)}catch(e){i=e}if(y&&vM(y)){if(y=await y.catch(e=>{i=e}),b!==p[o][0]){if(i)throw i;return y}i&&w&&c(i)&&(a=!0,h({data:S,_c:vN}))}if(a&&!i&&(vI(a)?h({data:a(y,S),error:vN,_c:vN}):h({data:y,error:vN,_c:vN})),p[o][1]=v4(),Promise.resolve(v()).then(()=>{h({_c:vN})}),i){if(d)throw i;return}return y}}let v7=(e,t)=>{for(let n in e)e[n][0]&&e[n][0](t)},ye=(e,t)=>{if(!vB.has(e)){let n=vL(vZ,t),r={},i=v9.bind(vN,e),o=vA,a={},l=(e,t)=>{let n=a[e]||[];return a[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},s=(t,n,r)=>{e.set(t,n);let i=a[t];if(i)for(let e of i)e(n,r)},u=()=>{if(!vB.has(e)&&(vB.set(e,[r,{},{},{},i,s,l]),!vJ)){let t=n.initFocus(setTimeout.bind(vN,v7.bind(vN,r,0))),i=n.initReconnect(setTimeout.bind(vN,v7.bind(vN,r,1)));o=()=>{t&&t(),i&&i(),vB.delete(e)}}};return u(),[e,i,u,o]}return[e,vB.get(e)[4]]},[yt,yn]=ye(new Map),yr=vL({onLoadingSlow:vA,onSuccess:vA,onError:vA,onErrorRetry:(e,t,n,r,i)=>{let o=n.errorRetryCount,a=i.retryCount,l=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;(vR(o)||!(a>o))&&setTimeout(r,l,i)},onDiscarded:vA,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:v3?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:v3?5e3:3e3,compare:(e,t)=>vz(e)==vz(t),isPaused:()=>!1,cache:yt,mutate:yn,fallback:{}},{isOnline:()=>vK,isVisible:()=>{let e=vG&&document.visibilityState;return vR(e)||"hidden"!==e}}),yi=(e,t)=>{let n=vL(e,t);if(t){let{use:r,fallback:i}=e,{use:o,fallback:a}=t;r&&o&&(n.use=r.concat(o)),i&&a&&(n.fallback=vL(i,a))}return n},yo=(0,v.createContext)({}),ya="$inf$",yl=vq&&window.__SWR_DEVTOOLS_USE__,ys=yl?window.__SWR_DEVTOOLS_USE__:[],yu=e=>vI(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],yc=()=>vL(yr,(0,v.useContext)(yo)),yd=ys.concat(e=>(t,n,r)=>{let i=n&&((...e)=>{let[r]=v5(t),[,,,i]=vB.get(yt);if(r.startsWith(ya))return n(...e);let o=i[r];return vR(o)?n(...e):(delete i[r],o)});return e(t,i,r)}),yh=(e,t,n)=>{let r=t[e]||(t[e]=[]);return r.push(n),()=>{let e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}};yl&&(window.__SWR_DEVTOOLS_REACT__=l(v));let yf=l(v).use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;if("rejected"===e.status)throw e.reason;throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}),yp={dedupe:!0};vj.defineProperty(e=>{let{value:t}=e,n=(0,v.useContext)(yo),r=vI(t),i=(0,v.useMemo)(()=>r?t(n):t,[r,n,t]),o=(0,v.useMemo)(()=>r?i:yi(n,i),[r,n,i]),a=i&&i.provider,l=(0,v.useRef)(vN);a&&!l.current&&(l.current=ye(a(o.cache||yt),i));let s=l.current;return s&&(o.cache=s[0],o.mutate=s[1]),v1(()=>{if(s)return s[2]&&s[2](),s[3]},[]),(0,v.createElement)(yo.Provider,vL(e,{value:o}))},"defaultValue",{value:yr});let yg=(Py=(e,t,n)=>{let{cache:r,compare:i,suspense:o,fallbackData:a,revalidateOnMount:l,revalidateIfStale:s,refreshInterval:u,refreshWhenHidden:c,refreshWhenOffline:d,keepPreviousData:h}=n,[f,p,g,m]=vB.get(r),[y,b]=v5(e),w=(0,v.useRef)(!1),x=(0,v.useRef)(!1),E=(0,v.useRef)(y),S=(0,v.useRef)(t),C=(0,v.useRef)(n),O=()=>C.current,k=()=>O().isVisible()&&O().isOnline(),[P,T,A,N]=v$(r,y),j=(0,v.useRef)({}).current,R=vR(a)?n.fallback[y]:a,I=(e,t)=>{for(let n in j)if("data"===n){if(!i(e[n],t[n])&&(!vR(e[n])||!i(V,t[n])))return!1}else if(t[n]!==e[n])return!1;return!0},L=(0,v.useMemo)(()=>{let e=!!y&&!!t&&(vR(l)?!O().isPaused()&&!o&&(!!vR(s)||s):l),n=t=>{let n=vL(t);return(delete n._k,e)?{isValidating:!0,isLoading:!0,...n}:n},r=P(),i=N(),a=n(r),u=r===i?a:n(i),c=a;return[()=>{let e=n(P());return I(e,c)?(c.data=e.data,c.isLoading=e.isLoading,c.isValidating=e.isValidating,c.error=e.error,c):(c=e,e)},()=>u]},[r,y]),M=(0,_.useSyncExternalStore)((0,v.useCallback)(e=>A(y,(t,n)=>{I(n,t)||e()}),[r,y]),L[0],L[1]),D=!w.current,F=f[y]&&f[y].length>0,z=M.data,B=vR(z)?R:z,U=M.error,H=(0,v.useRef)(B),V=h?vR(z)?H.current:z:B,q=(!F||!!vR(U))&&(D&&!vR(l)?l:!O().isPaused()&&(o?!vR(B)&&s:vR(B)||s)),G=!!(y&&t&&D&&q),W=vR(M.isValidating)?G:M.isValidating,$=vR(M.isLoading)?G:M.isLoading,K=(0,v.useCallback)(async e=>{let t,r;let o=S.current;if(!y||!o||x.current||O().isPaused())return!1;let a=!0,l=e||{},s=!g[y]||!l.dedupe,u=()=>vQ?!x.current&&y===E.current&&w.current:y===E.current,c={isValidating:!1,isLoading:!1},d=()=>{T(c)},h=()=>{let e=g[y];e&&e[1]===r&&delete g[y]},m={isValidating:!0};vR(P().data)&&(m.isLoading=!0);try{if(s&&(T(m),n.loadingTimeout&&vR(P().data)&&setTimeout(()=>{a&&u()&&O().onLoadingSlow(y,n)},n.loadingTimeout),g[y]=[o(b),v4()]),[t,r]=g[y],t=await t,s&&setTimeout(h,n.dedupingInterval),!g[y]||g[y][1]!==r)return s&&u()&&O().onDiscarded(y),!1;c.error=vN;let e=p[y];if(!vR(e)&&(r<=e[0]||r<=e[1]||0===e[1]))return d(),s&&u()&&O().onDiscarded(y),!1;let l=P().data;c.data=i(l,t)?l:t,s&&u()&&O().onSuccess(t,y,n)}catch(n){h();let e=O(),{shouldRetryOnError:t}=e;!e.isPaused()&&(c.error=n,s&&u()&&(e.onError(n,y,e),(!0===t||vI(t)&&t(n))&&k()&&e.onErrorRetry(n,y,e,e=>{let t=f[y];t&&t[0]&&t[0](v8.ERROR_REVALIDATE_EVENT,e)},{retryCount:(l.retryCount||0)+1,dedupe:!0})))}return a=!1,d(),!0},[y,r]),Y=(0,v.useCallback)((...e)=>v9(r,E.current,...e),[]);if(v1(()=>{S.current=t,C.current=n,vR(z)||(H.current=z)}),v1(()=>{if(!y)return;let e=K.bind(vN,yp),t=0,n=yh(y,f,(n,r={})=>{if(n==v8.FOCUS_EVENT){let n=Date.now();O().revalidateOnFocus&&n>t&&k()&&(t=n+O().focusThrottleInterval,e())}else if(n==v8.RECONNECT_EVENT)O().revalidateOnReconnect&&k()&&e();else if(n==v8.MUTATE_EVENT)return K();else if(n==v8.ERROR_REVALIDATE_EVENT)return K(r)});return x.current=!1,E.current=y,w.current=!0,T({_k:b}),q&&(vR(B)||vJ?e():v0(e)),()=>{x.current=!0,n()}},[y]),v1(()=>{let e;function t(){let t=vI(u)?u(P().data):u;t&&-1!==e&&(e=setTimeout(n,t))}function n(){!P().error&&(c||O().isVisible())&&(d||O().isOnline())?K(yp).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[u,c,d,y]),(0,v.useDebugValue)(V),o&&vR(B)&&y){if(!vQ&&vJ)throw Error("Fallback data is required when using suspense in SSR.");S.current=t,C.current=n,x.current=!1;let e=m[y];if(vR(e)||yf(Y(e)),vR(U)){let e=K(yp);vR(V)||(e.status="fulfilled",e.value=!0),yf(e)}else throw U}return{mutate:Y,get data(){return j.data=!0,V},get error(){return j.error=!0,U},get isValidating(){return j.isValidating=!0,W},get isLoading(){return j.isLoading=!0,$}}},function(...e){let t=yc(),[n,r,i]=yu(e),o=yi(t,i),a=Py,{use:l}=o,s=(l||[]).concat(yd);for(let e=s.length;e--;)a=s[e](a);return a(n,r||o.fetcher||null,o)});var v=(h("8NFma"),h("8NFma"));let ym=e=>v5(e?e(0,null):null)[0],yv=Promise.resolve(),yy=(Pb=e=>(t,n,r)=>{let i;let o=(0,v.useRef)(!1),{cache:a,initialSize:l=1,revalidateAll:s=!1,persistSize:u=!1,revalidateFirstPage:c=!0,revalidateOnMount:d=!1,parallel:h=!1}=r,[,,,f]=vB.get(yt);try{(i=ym(t))&&(i=ya+i)}catch(e){}let[p,g,m]=v$(a,i),y=(0,v.useCallback)(()=>vR(p()._l)?l:p()._l,[a,i,l]);(0,_.useSyncExternalStore)((0,v.useCallback)(e=>i?m(i,()=>{e()}):()=>{},[a,i]),y,y);let b=(0,v.useCallback)(()=>{let e=p()._l;return vR(e)?l:e},[i,l]),w=(0,v.useRef)(b());v1(()=>{if(!o.current){o.current=!0;return}i&&g({_l:u?w.current:b()})},[i,a]);let x=d&&!o.current,E=e(i,async e=>{let i=p()._i,o=[],l=b(),[u]=v$(a,e),d=u().data,m=[],v=null;for(let e=0;e<l;++e){let[l,u]=v5(t(e,h?null:v));if(!l)break;let[p,g]=v$(a,l),y=p().data,b=s||i||vR(y)||c&&!e&&!vR(d)||x||d&&!vR(d[e])&&!r.compare(d[e],y);if(n&&b){let t=async()=>{if(l in f){let e=f[l];delete f[l],y=await e}else y=await n(u);g({data:y,_k:u}),o[e]=y};h?m.push(t):await t()}else o[e]=y;h||(v=y)}return h&&await Promise.all(m.map(e=>e())),g({_i:vN}),o},r),S=(0,v.useCallback)(function(e,t){let n="boolean"==typeof t?{revalidate:t}:t||{},r=!1!==n.revalidate;return i?(r&&(vR(e)?g({_i:!0}):g({_i:!1})),arguments.length?E.mutate(e,{...n,revalidate:r}):E.mutate()):yv},[i,a]),C=(0,v.useCallback)(e=>{let n;if(!i)return yv;let[,r]=v$(a,i);if(vI(e)?n=e(b()):"number"==typeof e&&(n=e),"number"!=typeof n)return yv;r({_l:n}),w.current=n;let o=[],[l]=v$(a,i),s=null;for(let e=0;e<n;++e){let[n]=v5(t(e,s)),[r]=v$(a,n),i=n?r().data:vN;if(vR(i))return S(l().data);o.push(i),s=i}return S(o)},[i,a,S,b]);return{size:b(),setSize:C,mutate:S,get data(){return E.data},get error(){return E.error},get isValidating(){return E.isValidating},get isLoading(){return E.isLoading}}},(...e)=>{let[t,n,r]=yu(e),i=(r.use||[]).concat(Pb);return yg(t,n,{...r,use:i})}),yb=e=>fetch(e).then(e=>e.json()),yw=({defaultQuery:e="",timeout:t=100,getAPI:n,getSize:r=e=>e.total_pages,fetchFunc:i=yb})=>{let o=l(v).useRef(e),a=l(v).useRef(),{data:s,error:u,size:c,setSize:d,mutate:h}=yy(e=>n({query:o.current,page:e+1}),i,{revalidateAll:!1}),f=!s&&!u||!!(c>0&&s&&void 0===s[c-1]),p=s?.[0]?.length===0,g=s?.[s.length-1],m=p||g&&r(g)===c;return{setQuery:l(v).useCallback(e=>{o.current=e,clearTimeout(a.current),a.current=setTimeout(()=>{h()},t)},[t]),isLoading:f,loadMore:()=>{m||d(c+1)},isReachingEnd:m,data:s?.filter(e=>e),items:s?.reduce((e,t)=>e.concat(t),[]),hasMore:!m,reset:h,error:u}};var v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),yx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.panel;return v.createElement("div",{className:l(sk)(sP.TAB_PANEL,t),role:"tablist"},n)},t.defaultProps={disabled:!1},t.displayName="".concat(pa,".Tab"),t}(pO),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),py=h("leH9B"),sO=h("gztBd"),v=h("8NFma"),py=h("leH9B"),y_=v.forwardRef(function(e,t){var n=e.size>=py.IconSize.LARGE,r=n?py.IconSize.LARGE:py.IconSize.STANDARD,i="".concat(-1*r/.05/2);return v.createElement(pS,(0,sO.__assign)({iconName:"small-cross",ref:t},e),v.createElement("path",{d:n?"M228.2 200L294 265.8C297.8 269.4 300 274.4 300 280C300 291 291 300 280 300C274.4000000000001 300 269.4000000000001 297.8 265.8 294.2L200 228.2L134.2 294.2C130.6 297.8 125.6 300 120 300C109 300 100 291 100 280C100 274.4 102.2 269.4 105.8 265.8L171.8 200L106 134.2000000000001C102.2 130.6 100 125.6 100 120C100 109 109 100 120 100C125.6 100 130.6 102.2 134.2 105.8L200 171.8L265.8 106C269.4000000000001 102.2 274.4000000000001 100 280 100C291 100 300 109 300 120C300 125.6 297.8 130.6 294.2000000000001 134.2000000000001L228.2 200z":"M188.2 160L234 205.8C237.8 209.4 240 214.4 240 220C240 231 231 240 220 240C214.4 240 209.4 237.8 205.8 234.2L160 188.2L114.2 234.2C110.6 237.8 105.6 240 100 240C89 240 80 231 80 220C80 214.4 82.2 209.4 85.8 205.8L131.8 160L86 114.2C82.2 110.6 80 105.6 80 100C80 89 89 80 100 80C105.6 80 110.6 82.2 114.2 85.8L160 131.8L205.8 86C209.4 82.2 214.4 80 220 80C231 80 240 89 240 100C240 105.6 237.8 110.6 234.2 114.2L188.2 160z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")")}))});y_.defaultProps={size:py.IconSize.STANDARD},y_.displayName="Blueprint5.Icon.SmallCross";var yE=v.forwardRef(function(e,t){var n,r=e.active,i=e.children,o=e.className,a=e.fill,s=e.icon,u=e.intent,c=e.interactive,d=e.large,h=e.minimal,f=e.multiline,p=e.onRemove,g=e.rightIcon,m=e.round,y=e.tabIndex,b=void 0===y?0:y,w=e.htmlTitle,x=(0,sO.__rest)(e,["active","children","className","fill","icon","intent","interactive","large","minimal","multiline","onRemove","rightIcon","round","tabIndex","htmlTitle"]),_=fe.isFunction(p),E=l(sk)(sP.TAG,sP.intentClass(u),((n={})[sP.ACTIVE]=r,n[sP.FILL]=a,n[sP.INTERACTIVE]=c,n[sP.LARGE]=d,n[sP.MINIMAL]=h,n[sP.ROUND]=m,n),o),S=d||E.indexOf(sP.LARGE)>=0,C=_?v.createElement("button",{"aria-label":"Remove tag",type:"button",className:sP.TAG_REMOVE,onClick:function(t){var n;null===(n=e.onRemove)||void 0===n||n.call(e,t,e)},tabIndex:b},v.createElement(y_,{size:S?py.IconSize.LARGE:py.IconSize.STANDARD})):null;return v.createElement("span",(0,sO.__assign)({},x,{className:E,tabIndex:c?b:void 0,ref:t}),v.createElement(pC,{icon:s}),!f6(i)&&v.createElement(pT,{className:sP.FILL,ellipsize:!f,tagName:"span",title:w},i),v.createElement(pC,{icon:g}),C)});yE.displayName="".concat(pa,".Tag");var yS=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleClick=function(e){return t.props.onClick(t.props.id,e)},t}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.children,r=e.disabled,i=e.id,o=e.parentId,a=e.selected,s=e.title,u=e.icon,c=e.tagContent,d=e.tagProps,h=(0,sO.__rest)(e,["className","children","disabled","id","parentId","selected","title","icon","tagContent","tagProps"]),f=a?sN.PRIMARY:sN.NONE;return v.createElement("div",(0,sO.__assign)({},ps(h),{"aria-controls":yC(o,i),"aria-disabled":r,"aria-expanded":a,"aria-selected":a,className:l(sk)(sP.TAB,t),"data-tab-id":i,id:yO(o,i),onClick:r?void 0:this.handleClick,role:"tab",tabIndex:r?void 0:a?0:-1}),null!=u&&v.createElement(pC,{icon:u,intent:f,className:sP.TAB_ICON}),s,n,null!=c&&v.createElement(yE,(0,sO.__assign)({minimal:!0,intent:f},d,{className:l(sk)(sP.TAB_TAG,null==d?void 0:d.className)}),c))},t.displayName="".concat(pa,".TabTitle"),t}(pO);function yC(e,t){return"".concat(sP.TAB_PANEL,"_").concat(e,"_").concat(t)}function yO(e,t){return"".concat(sP.TAB,"-title_").concat(e,"_").concat(t)}var yk=function(){return v.createElement("div",{className:sP.FLEX_EXPANDER})},yP=".".concat(sP.TAB),yT=function(e){function t(t){var n=e.call(this,t)||this;n.tablistElement=null,n.refHandlers={tablist:function(e){return n.tablistElement=e}},n.handleKeyDown=function(e){var t,r=null===(t=fe.getActiveElement(n.tablistElement))||void 0===t?void 0:t.closest(yP);if(null!=r){var i=n.getTabElements().filter(function(e){return"false"===e.getAttribute("aria-disabled")}),o=i.indexOf(r),a=n.getKeyCodeDirection(e);if(o>=0&&void 0!==a){e.preventDefault();var l=i.length;i[(o+a+l)%l].focus()}}},n.handleKeyPress=function(e){var t=e.target.closest(yP);null!=t&&fe.isKeyboardClick(e)&&(e.preventDefault(),t.click())},n.handleTabClick=function(e,t){var r,i;null===(i=(r=n.props).onChange)||void 0===i||i.call(r,e,n.state.selectedTabId,t),void 0===n.props.selectedTabId&&n.setState({selectedTabId:e})},n.renderTabPanel=function(e){var t=e.props,r=t.className,i=t.panel,o=t.id,a=t.panelClassName;if(void 0!==i)return v.createElement("div",{"aria-labelledby":yO(n.props.id,o),"aria-hidden":o!==n.state.selectedTabId,className:l(sk)(sP.TAB_PANEL,r,a),id:yC(n.props.id,o),key:o,role:"tabpanel"},i)},n.renderTabTitle=function(e){if(yA(e)){var t=e.props.id;return v.createElement(yS,(0,sO.__assign)({},e.props,{parentId:n.props.id,onClick:n.handleTabClick,selected:t===n.state.selectedTabId}))}return e};var r=n.getInitialSelectedTabId();return n.state={selectedTabId:r},n}return(0,sO.__extends)(t,e),t.getDerivedStateFromProps=function(e){var t=e.selectedTabId;return void 0!==t?{selectedTabId:t}:null},t.prototype.render=function(){var e,t,n=this.state,r=n.indicatorWrapperStyle,i=n.selectedTabId,o=v.Children.map(this.props.children,this.renderTabTitle),a=this.getTabChildren().filter(this.props.renderActiveTabPanelOnly?function(e){return e.props.id===i}:function(){return!0}).map(this.renderTabPanel),s=this.props.animate?v.createElement("div",{className:sP.TAB_INDICATOR_WRAPPER,style:r},v.createElement("div",{className:sP.TAB_INDICATOR})):null,u=l(sk)(sP.TABS,this.props.className,((e={})[sP.VERTICAL]=this.props.vertical,e[sP.FILL]=this.props.fill,e)),c=l(sk)(sP.TAB_LIST,((t={})[sP.LARGE]=this.props.large,t));return v.createElement("div",{className:u},v.createElement("div",{className:c,onKeyDown:this.handleKeyDown,onKeyPress:this.handleKeyPress,ref:this.refHandlers.tablist,role:"tablist"},s,o),a)},t.prototype.componentDidMount=function(){this.moveSelectionIndicator(!1)},t.prototype.componentDidUpdate=function(e,t){this.state.selectedTabId!==t.selectedTabId?this.moveSelectionIndicator():null==t.selectedTabId||fe.arraysEqual(this.getTabChildrenProps(e),this.getTabChildrenProps(),fe.shallowCompareKeys)||this.moveSelectionIndicator()},t.prototype.getInitialSelectedTabId=function(){var e=this.props,t=e.defaultSelectedTabId,n=e.selectedTabId;if(void 0!==n)return n;if(void 0!==t)return t;var r=this.getTabChildren();return 0===r.length?void 0:r[0].props.id},t.prototype.getKeyCodeDirection=function(e){return"ArrowLeft"===e.key||"ArrowUp"===e.key?-1:"ArrowRight"===e.key||"ArrowDown"===e.key?1:void 0},t.prototype.getTabChildrenProps=function(e){return void 0===e&&(e=this.props),this.getTabChildren(e).map(function(e){return e.props})},t.prototype.getTabChildren=function(e){return void 0===e&&(e=this.props),v.Children.toArray(e.children).filter(yA)},t.prototype.getTabElements=function(e){return(void 0===e&&(e=""),null==this.tablistElement)?[]:Array.from(this.tablistElement.querySelectorAll(yP+e))},t.prototype.moveSelectionIndicator=function(e){if(void 0===e&&(e=!0),null!=this.tablistElement&&this.props.animate){var t="".concat(yP,'[data-tab-id="').concat(this.state.selectedTabId,'"]'),n=this.tablistElement.querySelector(t),r={display:"none"};if(null!=n){var i=n.clientHeight,o=n.clientWidth,a=n.offsetLeft,l=n.offsetTop;r={height:i,transform:"translateX(".concat(Math.floor(a),"px) translateY(").concat(Math.floor(l),"px)"),width:o},e||(r.transition="none")}this.setState({indicatorWrapperStyle:r})}},t.Expander=yk,t.Tab=yx,t.defaultProps={animate:!0,fill:!1,large:!1,renderActiveTabPanelOnly:!1,vertical:!1},t.displayName="".concat(pa,".Tabs"),t}(pO);function yA(e){return fe.isElementOfType(e,yx)}var v=h("8NFma"),yN={};yN=h("6DzO8")();var yj={};Object.defineProperty(yj,"__esModule",{value:!0}),yj.ReactCSS=yj.loop=yj.handleActive=yj.handleHover=yj.hover=void 0;var yR={};Object.defineProperty(yR,"__esModule",{value:!0}),yR.flattenNames=void 0;var yI=h("h1l7t"),yL=h("5V8oz"),yM=h("hcK5n"),yD=xe(function(e){return"string"==typeof e||!yL(e)&&yM(e)&&"[object String]"==yI(e)}),yF={},yz=h("4V1MN"),yB=h("4hKXW"),yU=xe(yF=function(e,t){return e&&yz(e,yB(t))}),yH={},yI=h("h1l7t"),yV={};yV=h("blfKu")(Object.getPrototypeOf,Object);var yM=h("hcK5n"),yq=Object.prototype,yG=Function.prototype.toString,yW=yq.hasOwnProperty,y$=yG.call(Object),yK=xe(yH=function(e){if(!yM(e)||"[object Object]"!=yI(e))return!1;var t=yV(e);if(null===t)return!0;var n=yW.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&yG.call(n)==y$}),yY={};yY=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i};var yX={},yZ={},yQ={},yJ={},y0={},y1={};y1=function(){this.__data__=[],this.size=0};var y2={},y3={},y5={};y5=function(e,t){return e===t||e!=e&&t!=t},y3=function(e,t){for(var n=e.length;n--;)if(y5(e[n][0],t))return n;return -1};var y6=Array.prototype.splice;y2=function(e){var t=this.__data__,n=y3(t,e);return!(n<0)&&(n==t.length-1?t.pop():y6.call(t,n,1),--this.size,!0)};var y4={};y4=function(e){var t=this.__data__,n=y3(t,e);return n<0?void 0:t[n][1]};var y8={};y8=function(e){return y3(this.__data__,e)>-1};var y9={};function y7(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}y9=function(e,t){var n=this.__data__,r=y3(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},y7.prototype.clear=y1,y7.prototype.delete=y2,y7.prototype.get=y4,y7.prototype.has=y8,y7.prototype.set=y9,y0=y7;var be={};be=function(){this.__data__=new y0,this.size=0};var bt={};bt=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var bn={};bn=function(e){return this.__data__.get(e)};var br={};br=function(e){return this.__data__.has(e)};var bi={},bo={},ba={},bl={},bs=h("1F4Th"),bu={},bc={},bd=h("eeOBM");bc=bd["__core-js_shared__"];var bh=(Pw=/[^.]+$/.exec(bc&&bc.keys&&bc.keys.IE_PROTO||""))?"Symbol(src)_1."+Pw:"";bu=function(e){return!!bh&&bh in e};var bf=h("kNSK3"),bp={},bg=Function.prototype.toString;bp=function(e){if(null!=e){try{return bg.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var bm=/^\[object .+?Constructor\]$/,bv=Object.prototype,by=Function.prototype.toString,bb=bv.hasOwnProperty,bw=RegExp("^"+by.call(bb).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");bl=function(e){return!(!bf(e)||bu(e))&&(bs(e)?bw:bm).test(bp(e))};var bx={};bx=function(e,t){return null==e?void 0:e[t]},ba=function(e,t){var n=bx(e,t);return bl(n)?n:void 0};var bd=h("eeOBM");bo=ba(bd,"Map");var b_={},bE={},bS={},bC={},bO={};bO=ba(Object,"create"),bC=function(){this.__data__=bO?bO(null):{},this.size=0};var bk={};bk=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var bP={},bT=Object.prototype.hasOwnProperty;bP=function(e){var t=this.__data__;if(bO){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return bT.call(t,e)?t[e]:void 0};var bA={},bN=Object.prototype.hasOwnProperty;bA=function(e){var t=this.__data__;return bO?void 0!==t[e]:bN.call(t,e)};var bj={};function bR(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bj=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=bO&&void 0===t?"__lodash_hash_undefined__":t,this},bR.prototype.clear=bC,bR.prototype.delete=bk,bR.prototype.get=bP,bR.prototype.has=bA,bR.prototype.set=bj,bS=bR,bE=function(){this.size=0,this.__data__={hash:new bS,map:new(bo||y0),string:new bS}};var bI={},bL={},bM={};bM=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},bL=function(e,t){var n=e.__data__;return bM(t)?n["string"==typeof t?"string":"hash"]:n.map},bI=function(e){var t=bL(this,e).delete(e);return this.size-=t?1:0,t};var bD={};bD=function(e){return bL(this,e).get(e)};var bF={};bF=function(e){return bL(this,e).has(e)};var bz={};function bB(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function bU(e){var t=this.__data__=new y0(e);this.size=t.size}bz=function(e,t){var n=bL(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},bB.prototype.clear=bE,bB.prototype.delete=bI,bB.prototype.get=bD,bB.prototype.has=bF,bB.prototype.set=bz,b_=bB,bi=function(e,t){var n=this.__data__;if(n instanceof y0){var r=n.__data__;if(!bo||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new b_(r)}return n.set(e,t),this.size=n.size,this},bU.prototype.clear=be,bU.prototype.delete=bt,bU.prototype.get=bn,bU.prototype.has=br,bU.prototype.set=bi,yJ=bU;var bH={},bV={},bq={},bG={},bW={};bW=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var b$={};function bK(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new b_;++t<n;)this.add(e[t])}b$=function(e){return this.__data__.has(e)},bK.prototype.add=bK.prototype.push=bW,bK.prototype.has=b$,bG=bK;var bY={};bY=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};var bX={};bX=function(e,t){return e.has(t)},bq=function(e,t,n,r,i,o){var a=1&n,l=e.length,s=t.length;if(l!=s&&!(a&&s>l))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,h=!0,f=2&n?new bG:void 0;for(o.set(e,t),o.set(t,e);++d<l;){var p=e[d],g=t[d];if(r)var m=a?r(g,p,d,t,e,o):r(p,g,d,e,t,o);if(void 0!==m){if(m)continue;h=!1;break}if(f){if(!bY(t,function(e,t){if(!bX(f,t)&&(p===e||i(p,e,n,r,o)))return f.push(t)})){h=!1;break}}else if(!(p===g||i(p,g,n,r,o))){h=!1;break}}return o.delete(e),o.delete(t),h};var bZ={},bQ=h("4Cb5x"),bJ={},bd=h("eeOBM");bJ=bd.Uint8Array;var b0={};b0=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n};var b1={};b1=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n};var b2=bQ?bQ.prototype:void 0,b3=b2?b2.valueOf:void 0;bZ=function(e,t,n,r,i,o,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!o(new bJ(e),new bJ(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return y5(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var l=b0;case"[object Set]":var s=1&r;if(l||(l=b1),e.size!=t.size&&!s)break;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var c=bq(l(e),l(t),r,i,o,a);return a.delete(e),c;case"[object Symbol]":if(b3)return b3.call(e)==b3.call(t)}return!1};var b5={},b6={},b4={},b8={};b8=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e};var yL=h("5V8oz");b4=function(e,t,n){var r=t(e);return yL(e)?r:b8(r,n(e))};var b9={},b7={};b7=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o};var we={};we=function(){return[]};var wt=Object.prototype.propertyIsEnumerable,wn=Object.getOwnPropertySymbols;b9=wn?function(e){return null==e?[]:(e=Object(e),b7(wn(e),function(t){return wt.call(e,t)}))}:we;var wr=h("8R54q");b6=function(e){return b4(e,wr,b9)};var wi=Object.prototype.hasOwnProperty;b5=function(e,t,n,r,i,o){var a=1&n,l=b6(e),s=l.length;if(s!=b6(t).length&&!a)return!1;for(var u=s;u--;){var c=l[u];if(!(a?c in t:wi.call(t,c)))return!1}var d=o.get(e),h=o.get(t);if(d&&h)return d==t&&h==e;var f=!0;o.set(e,t),o.set(t,e);for(var p=a;++u<s;){var g=e[c=l[u]],m=t[c];if(r)var v=a?r(m,g,c,t,e,o):r(g,m,c,e,t,o);if(!(void 0===v?g===m||i(g,m,n,r,o):v)){f=!1;break}p||(p="constructor"==c)}if(f&&!p){var y=e.constructor,b=t.constructor;y!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b)&&(f=!1)}return o.delete(e),o.delete(t),f};var wo={},wa={},bd=h("eeOBM");wa=ba(bd,"DataView");var wl={},bd=h("eeOBM");wl=ba(bd,"Promise");var ws={},bd=h("eeOBM");ws=ba(bd,"Set");var wu={},bd=h("eeOBM");wu=ba(bd,"WeakMap");var yI=h("h1l7t"),wc="[object Map]",wd="[object Promise]",wh="[object Set]",wf="[object WeakMap]",wp="[object DataView]",wg=bp(wa),wm=bp(bo),wv=bp(wl),wy=bp(ws),wb=bp(wu),ww=yI;(wa&&ww(new wa(new ArrayBuffer(1)))!=wp||bo&&ww(new bo)!=wc||wl&&ww(wl.resolve())!=wd||ws&&ww(new ws)!=wh||wu&&ww(new wu)!=wf)&&(ww=function(e){var t=yI(e),n="[object Object]"==t?e.constructor:void 0,r=n?bp(n):"";if(r)switch(r){case wg:return wp;case wm:return wc;case wv:return wd;case wy:return wh;case wb:return wf}return t}),wo=ww;var yL=h("5V8oz"),wx=h("9e2tS"),w_=h("fAXjB"),wE="[object Arguments]",wS="[object Array]",wC="[object Object]",wO=Object.prototype.hasOwnProperty;bV=function(e,t,n,r,i,o){var a=yL(e),l=yL(t),s=a?wS:wo(e),u=l?wS:wo(t);s=s==wE?wC:s,u=u==wE?wC:u;var c=s==wC,d=u==wC,h=s==u;if(h&&wx(e)){if(!wx(t))return!1;a=!0,c=!1}if(h&&!c)return o||(o=new yJ),a||w_(e)?bq(e,t,n,r,i,o):bZ(e,t,s,n,r,i,o);if(!(1&n)){var f=c&&wO.call(e,"__wrapped__"),p=d&&wO.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,m=p?t.value():t;return o||(o=new yJ),i(g,m,n,r,o)}}return!!h&&(o||(o=new yJ),b5(e,t,n,r,i,o))};var yM=h("hcK5n");bH=function e(t,n,r,i,o){return t===n||(null!=t&&null!=n&&(yM(t)||yM(n))?bV(t,n,r,i,e,o):t!=t&&n!=n)},yQ=function(e,t,n,r){var i=n.length,o=i,a=!r;if(null==e)return!o;for(e=Object(e);i--;){var l=n[i];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<o;){var s=(l=n[i])[0],u=e[s],c=l[1];if(a&&l[2]){if(void 0===u&&!(s in e))return!1}else{var d=new yJ;if(r)var h=r(u,c,s,e,t,d);if(!(void 0===h?bH(c,u,3,r,d):h))return!1}}return!0};var wk={},wP={},bf=h("kNSK3");wP=function(e){return e==e&&!bf(e)};var wr=h("8R54q");wk=function(e){for(var t=wr(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,wP(i)]}return t};var wT={};wT=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}},yZ=function(e){var t=wk(e);return 1==t.length&&t[0][2]?wT(t[0][0],t[0][1]):function(n){return n===e||yQ(n,e,t)}};var wA={},wN={},wj={},wR={},yL=h("5V8oz"),wI={},yL=h("5V8oz"),wL={},yI=h("h1l7t"),yM=h("hcK5n");wL=function(e){return"symbol"==typeof e||yM(e)&&"[object Symbol]"==yI(e)};var wM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wD=/^\w*$/;wI=function(e,t){if(yL(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||wL(e))||wD.test(e)||!wM.test(e)||null!=t&&e in Object(t)};var wF={},wz={};function wB(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(wB.Cache||b_),n}wB.Cache=b_;var wU=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wH=/\\(\\)?/g;kX=(kY=(wz=wB)(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(wU,function(e,n,r,i){t.push(r?i.replace(wH,"$1"):n||e)}),t},function(e){return 500===kX.size&&kX.clear(),e})).cache,wF=kY;var wV={},wq={},bQ=h("4Cb5x"),yL=h("5V8oz"),wG=1/0,wW=bQ?bQ.prototype:void 0,w$=wW?wW.toString:void 0;wq=function e(t){if("string"==typeof t)return t;if(yL(t))return yY(t,e)+"";if(wL(t))return w$?w$.call(t):"";var n=t+"";return"0"==n&&1/t==-wG?"-0":n},wV=function(e){return null==e?"":wq(e)},wR=function(e,t){return yL(e)?e:wI(e,t)?[e]:wF(wV(e))};var wK={},wY=1/0;wK=function(e){if("string"==typeof e||wL(e))return e;var t=e+"";return"0"==t&&1/e==-wY?"-0":t},wj=function(e,t){t=wR(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[wK(t[n++])];return n&&n==r?e:void 0},wN=function(e,t,n){var r=null==e?void 0:wj(e,t);return void 0===r?n:r};var wX={},wZ={};wZ=function(e,t){return null!=e&&t in Object(e)};var wQ={},wJ=h("4rbI4"),yL=h("5V8oz"),w0=h("74Ail"),w1=h("2zEBJ");wQ=function(e,t,n){t=wR(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var a=wK(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&w1(i)&&w0(a,i)&&(yL(e)||wJ(e))},wX=function(e,t){return null!=e&&wQ(e,t,wZ)},wA=function(e,t){return wI(e)&&wP(t)?wT(wK(e),t):function(n){var r=wN(n,e);return void 0===r&&r===t?wX(n,e):bH(t,r,3)}};var w2=h("38wdc"),yL=h("5V8oz"),w3={},w5={};w5=function(e){return function(t){return null==t?void 0:t[e]}};var w6={};w6=function(e){return function(t){return wj(t,e)}},w3=function(e){return wI(e)?w5(wK(e)):w6(e)},yX=function(e){return"function"==typeof e?e:null==e?w2:"object"==typeof e?yL(e)?wA(e[0],e[1]):yZ(e):w3(e)};var w4={},w8=h("gl8yj"),w9=h("iiJxK");w4=function(e,t){var n=-1,r=w9(e)?Array(e.length):[];return w8(e,function(e,i,o){r[++n]=t(e,i,o)}),r};var yL=h("5V8oz"),w7=xe(function(e,t){return(yL(e)?yY:w4)(e,yX(t,3))});function xe(e){return e&&e.__esModule?e:{default:e}}var xt=yR.flattenNames=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[];return(0,w7.default)(t,function(t){Array.isArray(t)?e(t).map(function(e){return n.push(e)}):(0,yK.default)(t)?(0,yU.default)(t,function(e,t){!0===e&&n.push(t),n.push(t+"-"+e)}):(0,yD.default)(t)&&n.push(t)}),n};yR.default=xt;var xn=_f(yR),xr={};Object.defineProperty(xr,"__esModule",{value:!0}),xr.mergeClasses=void 0;var xi=x0(yF),xo={},xa=h("eQpse"),xl={},xs={},xu={};xu=function(){try{var e=ba(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),xs=function(e,t,n){"__proto__"==t&&xu?xu(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var xc=Object.prototype.hasOwnProperty;xl=function(e,t,n){var r=e[t];xc.call(e,t)&&y5(r,n)&&(void 0!==n||t in e)||xs(e,t,n)};var xd={},xh={};xh=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var l=t[o],s=r?r(n[l],e[l],l,n,e):void 0;void 0===s&&(s=e[l]),i?xs(n,l,s):xl(n,l,s)}return n};var wr=h("8R54q");xd=function(e,t){return e&&xh(t,wr(t),e)};var xf={},xp={},xg=h("hopFG"),xm={},bf=h("kNSK3"),xv=h("dWAd9"),xy={};xy=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var xb=Object.prototype.hasOwnProperty;xm=function(e){if(!bf(e))return xy(e);var t=xv(e),n=[];for(var r in e)"constructor"==r&&(t||!xb.call(e,r))||n.push(r);return n};var w9=h("iiJxK");xp=function(e){return w9(e)?xg(e,!0):xm(e)},xf=function(e,t){return e&&xh(t,xp(t),e)};var xw=h("lJ72B"),xx={};xx=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var x_={};x_=function(e,t){return xh(e,b9(e),t)};var xE={},xS={};xS=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)b8(t,b9(e)),e=yV(e);return t}:we,xE=function(e,t){return xh(e,xS(e),t)};var xC={};xC=function(e){return b4(e,xp,xS)};var xO={},xk=Object.prototype.hasOwnProperty;xO=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&xk.call(e,"index")&&(n.index=e.index,n.input=e.input),n};var xP={},xT={};xT=function(e){var t=new e.constructor(e.byteLength);return new bJ(t).set(new bJ(e)),t};var xA={};xA=function(e,t){var n=t?xT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var xN={},xj=/\w*$/;xN=function(e){var t=new e.constructor(e.source,xj.exec(e));return t.lastIndex=e.lastIndex,t};var xR={},bQ=h("4Cb5x"),xI=bQ?bQ.prototype:void 0,xL=xI?xI.valueOf:void 0;xR=function(e){return xL?Object(xL.call(e)):{}};var xM={};xM=function(e,t){var n=t?xT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},xP=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return xT(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return xA(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return xM(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return xN(e);case"[object Symbol]":return xR(e)}};var xD={},xF={},bf=h("kNSK3"),xz=Object.create;xF=function(){function e(){}return function(t){if(!bf(t))return{};if(xz)return xz(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var xv=h("dWAd9");xD=function(e){return"function"!=typeof e.constructor||xv(e)?{}:xF(yV(e))};var yL=h("5V8oz"),wx=h("9e2tS"),xB={},xU={},yM=h("hcK5n");xU=function(e){return yM(e)&&"[object Map]"==wo(e)};var xH=h("cLhdb"),xV=h("fwpsA"),xq=xV&&xV.isMap;xB=xq?xH(xq):xU;var bf=h("kNSK3"),xG={},xW={},yM=h("hcK5n");xW=function(e){return yM(e)&&"[object Set]"==wo(e)};var xH=h("cLhdb"),xV=h("fwpsA"),x$=xV&&xV.isSet;xG=x$?xH(x$):xW;var wr=h("8R54q"),xK="[object Arguments]",xY="[object Function]",xX="[object Object]",xZ={};xZ[xK]=xZ["[object Array]"]=xZ["[object ArrayBuffer]"]=xZ["[object DataView]"]=xZ["[object Boolean]"]=xZ["[object Date]"]=xZ["[object Float32Array]"]=xZ["[object Float64Array]"]=xZ["[object Int8Array]"]=xZ["[object Int16Array]"]=xZ["[object Int32Array]"]=xZ["[object Map]"]=xZ["[object Number]"]=xZ[xX]=xZ["[object RegExp]"]=xZ["[object Set]"]=xZ["[object String]"]=xZ["[object Symbol]"]=xZ["[object Uint8Array]"]=xZ["[object Uint8ClampedArray]"]=xZ["[object Uint16Array]"]=xZ["[object Uint32Array]"]=!0,xZ["[object Error]"]=xZ[xY]=xZ["[object WeakMap]"]=!1,xo=function e(t,n,r,i,o,a){var l,s=1&n,u=2&n,c=4&n;if(r&&(l=o?r(t,i,o,a):r(t)),void 0!==l)return l;if(!bf(t))return t;var d=yL(t);if(d){if(l=xO(t),!s)return xx(t,l)}else{var h=wo(t),f=h==xY||"[object GeneratorFunction]"==h;if(wx(t))return xw(t,s);if(h==xX||h==xK||f&&!o){if(l=u||f?{}:xD(t),!s)return u?xE(t,xf(l,t)):x_(t,xd(l,t))}else{if(!xZ[h])return o?t:{};l=xP(t,h,s)}}a||(a=new yJ);var p=a.get(t);if(p)return p;a.set(t,l),xG(t)?t.forEach(function(i){l.add(e(i,n,r,i,t,a))}):xB(t)&&t.forEach(function(i,o){l.set(o,e(i,n,r,o,t,a))});var g=c?u?xC:b6:u?xp:wr,m=d?void 0:g(t);return xa(m||t,function(i,o){m&&(i=t[o=i]),xl(l,o,e(i,n,r,o,t,a))}),l};var xQ=x0(function(e){return xo(e,5)}),xJ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function x0(e){return e&&e.__esModule?e:{default:e}}var x1=xr.mergeClasses=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.default&&(0,xQ.default)(e.default)||{};return t.map(function(t){var r=e[t];return r&&(0,xi.default)(r,function(e,t){n[t]||(n[t]={}),n[t]=xJ({},n[t],r[t])}),t}),n};xr.default=x1;var x2=_f(xr),x3={};Object.defineProperty(x3,"__esModule",{value:!0}),x3.autoprefix=void 0;var x5=(k1=yF)&&k1.__esModule?k1:{default:k1},x6=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x4={borderRadius:function(e){return{msBorderRadius:e,MozBorderRadius:e,OBorderRadius:e,WebkitBorderRadius:e,borderRadius:e}},boxShadow:function(e){return{msBoxShadow:e,MozBoxShadow:e,OBoxShadow:e,WebkitBoxShadow:e,boxShadow:e}},userSelect:function(e){return{WebkitTouchCallout:e,KhtmlUserSelect:e,MozUserSelect:e,msUserSelect:e,WebkitUserSelect:e,userSelect:e}},flex:function(e){return{WebkitBoxFlex:e,MozBoxFlex:e,WebkitFlex:e,msFlex:e,flex:e}},flexBasis:function(e){return{WebkitFlexBasis:e,flexBasis:e}},justifyContent:function(e){return{WebkitJustifyContent:e,justifyContent:e}},transition:function(e){return{msTransition:e,MozTransition:e,OTransition:e,WebkitTransition:e,transition:e}},transform:function(e){return{msTransform:e,MozTransform:e,OTransform:e,WebkitTransform:e,transform:e}},absolute:function(e){var t=e&&e.split(" ");return{position:"absolute",top:t&&t[0],right:t&&t[1],bottom:t&&t[2],left:t&&t[3]}},extend:function(e,t){return t[e]||{extend:e}}},x8=x3.autoprefix=function(e){var t={};return(0,x5.default)(e,function(e,n){var r={};(0,x5.default)(e,function(e,t){var n=x4[t];n?r=x6({},r,n(e)):r[t]=e}),t[n]=r}),t};x3.default=x8;var x9=_f(x3),x7={};Object.defineProperty(x7,"__esModule",{value:!0}),x7.hover=void 0;var _e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=h("8NFma"),_t=(k2=v)&&k2.__esModule?k2:{default:k2};function _n(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var _r=x7.hover=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r);for(var n,i,o,a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return i=o=_n(this,(n=r.__proto__||Object.getPrototypeOf(r)).call.apply(n,[this].concat(l))),o.state={hover:!1},o.handleMouseOver=function(){return o.setState({hover:!0})},o.handleMouseOut=function(){return o.setState({hover:!1})},o.render=function(){return _t.default.createElement(t,{onMouseOver:o.handleMouseOver,onMouseOut:o.handleMouseOut},_t.default.createElement(e,_e({},o.props,o.state)))},_n(o,i)}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,n),r}(_t.default.Component)};x7.default=_r;var _i=_f(x7),_o={};Object.defineProperty(_o,"__esModule",{value:!0}),_o.active=void 0;var _a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=h("8NFma"),_l=(k3=v)&&k3.__esModule?k3:{default:k3};function _s(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var _u=_o.active=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r);for(var n,i,o,a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return i=o=_s(this,(n=r.__proto__||Object.getPrototypeOf(r)).call.apply(n,[this].concat(l))),o.state={active:!1},o.handleMouseDown=function(){return o.setState({active:!0})},o.handleMouseUp=function(){return o.setState({active:!1})},o.render=function(){return _l.default.createElement(t,{onMouseDown:o.handleMouseDown,onMouseUp:o.handleMouseUp},_l.default.createElement(e,_a({},o.props,o.state)))},_s(o,i)}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,n),r}(_l.default.Component)};_o.default=_u;var _c=_f(_o),_d={};Object.defineProperty(_d,"__esModule",{value:!0}),_d.default=function(e,t){var n={},r=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];n[e]=t};return 0===e&&r("first-child"),e===t-1&&r("last-child"),(0===e||e%2==0)&&r("even"),1===Math.abs(e%2)&&r("odd"),r("nth-child",e),n};var _h=_f(_d);function _f(e){return e&&e.__esModule?e:{default:e}}yj.hover=_i.default,yj.handleHover=_i.default,yj.handleActive=_c.default,yj.loop=_h.default;var _p=yj.ReactCSS=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=(0,xn.default)(n),o=(0,x2.default)(e,i);return(0,x9.default)(o)};yj.default=_p;var _g={},_m={},_v={};_v=function(e,t,n){(void 0===n||y5(e[t],n))&&(void 0!==n||t in e)||xs(e,t,n)};var _y=h("e3j3J"),_b={},xw=h("lJ72B"),wJ=h("4rbI4"),yL=h("5V8oz"),_w={},w9=h("iiJxK"),yM=h("hcK5n");_w=function(e){return yM(e)&&w9(e)};var wx=h("9e2tS"),bs=h("1F4Th"),bf=h("kNSK3"),w_=h("fAXjB"),_x={};_x=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var __={};__=function(e){return xh(e,xp(e))},_b=function(e,t,n,r,i,o,a){var l=_x(e,n),s=_x(t,n),u=a.get(s);if(u){_v(e,n,u);return}var c=o?o(l,s,n+"",e,t,a):void 0,d=void 0===c;if(d){var h=yL(s),f=!h&&wx(s),p=!h&&!f&&w_(s);c=s,h||f||p?yL(l)?c=l:_w(l)?c=xx(l):f?(d=!1,c=xw(s,!0)):p?(d=!1,c=xM(s,!0)):c=[]:yH(s)||wJ(s)?(c=l,wJ(l)?c=__(l):(!bf(l)||bs(l))&&(c=xD(s))):d=!1}d&&(a.set(s,c),i(c,s,r,o,a),a.delete(s)),_v(e,n,c)};var bf=h("kNSK3");_m=function e(t,n,r,i,o){t!==n&&_y(n,function(a,l){if(o||(o=new yJ),bf(a))_b(t,n,l,r,e,i,o);else{var s=i?i(_x(t,l),a,l+"",t,n,o):void 0;void 0===s&&(s=a),_v(t,l,s)}},xp)};var _E={},w2=h("38wdc"),_S={},_C={};_C=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var _O=Math.max;_S=function(e,t,n){return t=_O(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=_O(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=r[i];return l[t]=n(a),_C(e,this,l)}};var _k={},_P={},_T={};_T=function(e){return function(){return e}};var w2=h("38wdc"),_A=Date.now;kZ=xu?function(e,t){return xu(e,"toString",{configurable:!0,enumerable:!1,value:_T(t),writable:!0})}:w2,kQ=0,kJ=0,_k=function(){var e=_A(),t=16-(e-kJ);if(kJ=e,t>0){if(++kQ>=800)return arguments[0]}else kQ=0;return kZ.apply(void 0,arguments)},_E=function(e,t){return _k(_S(e,t,w2),e+"")};var _N={},w9=h("iiJxK"),w0=h("74Ail"),bf=h("kNSK3");_N=function(e,t,n){if(!bf(n))return!1;var r=typeof t;return("number"==r?!!(w9(n)&&w0(t,n.length)):"string"==r&&t in n)&&y5(n[t],e)},k0=function(e,t,n){_m(e,t,n)},_g=_E(function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=k0.length>3&&"function"==typeof i?(r--,i):void 0,o&&_N(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var a=t[n];a&&k0(e,a,n,i)}return e});var _j={},v=(h("8NFma"),h("8NFma")),_R={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},_I=v.createContext&&v.createContext(_R),_L=function(){return(_L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},_M=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function _D(e){return function(t){return v.createElement(_F,_L({attr:_L({},e.attr)},t,{hasStrokes:function e(t){for(var n in t)if("_"!==n[0]){if("stroke"===n)return!0;if("object"==typeof t[n]){var r=e(t[n]);if(r)return r}else if("content"===n&&"style"===t.tag&&t[n].includes("stroke:"))return!0}return!1}(e)}),function e(t){return t&&t.map(function(t,n){return v.createElement(t.tag,_L({key:n},t.attr),e(t.child))})}(e.child))}}function _F(e){var t=function(t){var n,r=e.size||t.size||"1em";t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className);var i=e.attr,o=e.fill,a=e.title,l=e.hasStrokes,s=_M(e,["attr","fill","title","hasStrokes"]);return v.createElement("svg",_L({stroke:"currentColor",fill:o},l?null:{strokeWidth:0},t.attr,i,s,{className:n,style:_L(_L({color:e.color||t.color},t.style),e.style),height:r,width:r,xmlns:"http://www.w3.org/2000/svg"}),a&&v.createElement("title",null,a),e.children)};return void 0!==_I?v.createElement(_I.Consumer,null,function(e){return t(e)}):t(_R)}_j=function(e){return _D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M20.3847 2.87868C19.2132 1.70711 17.3137 1.70711 16.1421 2.87868L14.0202 5.00052L13.313 4.29332C12.9225 3.9028 12.2894 3.9028 11.8988 4.29332C11.5083 4.68385 11.5083 5.31701 11.8988 5.70754L17.5557 11.3644C17.9462 11.7549 18.5794 11.7549 18.9699 11.3644C19.3604 10.9739 19.3604 10.3407 18.9699 9.95018L18.2629 9.24316L20.3847 7.12132C21.5563 5.94975 21.5563 4.05025 20.3847 2.87868Z",fill:"currentColor"}},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9297 7.09116L4.1515 14.8693C3.22786 15.793 3.03239 17.169 3.5651 18.2842L1.99994 19.8493L3.41415 21.2635L4.97931 19.6984C6.09444 20.2311 7.4705 20.0356 8.39414 19.112L16.1723 11.3338L11.9297 7.09116ZM13.3439 11.3338L11.9297 9.91959L5.56571 16.2835C5.17518 16.6741 5.17518 17.3072 5.56571 17.6978C5.95623 18.0883 6.5894 18.0883 6.97992 17.6978L13.3439 11.3338Z",fill:"currentColor"}}],content:"\n"})(e)};var _z={};Object.defineProperty(_z,"__esModule",{value:!0});var _B={};Object.defineProperty(_B,"__esModule",{value:!0}),_B.Alpha=void 0;var _U=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_H=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),v=h("8NFma"),_V=_5(v),_q=_5(yj),_G={};Object.defineProperty(_G,"__esModule",{value:!0}),_G.calculateChange=function(e,t,n,r,i){var o=i.clientWidth,a=i.clientHeight,l="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,s="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,u=l-(i.getBoundingClientRect().left+window.pageXOffset),c=s-(i.getBoundingClientRect().top+window.pageYOffset);if("vertical"===n){var d=void 0;if(d=c<0?0:c>a?1:Math.round(100*c/a)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:"rgb"}}else{var h=void 0;if(r!==(h=u<0?0:u>o?1:Math.round(100*u/o)/100))return{h:t.h,s:t.s,l:t.l,a:h,source:"rgb"}}return null};var _W=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(_G),_$={};Object.defineProperty(_$,"__esModule",{value:!0}),_$.Checkboard=void 0;var _K=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=h("8NFma"),_Y=_1(v),_X=_1(yj),_Z={};Object.defineProperty(_Z,"__esModule",{value:!0});var _Q={},_J=_Z.render=function(e,t,n,r){if("undefined"==typeof document&&!r)return null;var i=r?new r:document.createElement("canvas");i.width=2*n,i.height=2*n;var o=i.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,i.width,i.height),o.fillStyle=t,o.fillRect(0,0,n,n),o.translate(n,n),o.fillRect(0,0,n,n),i.toDataURL()):null};_Z.get=function(e,t,n,r){var i=e+"-"+t+"-"+n+(r?"-server":"");if(_Q[i])return _Q[i];var o=_J(e,t,n,r);return _Q[i]=o,o};var _0=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(_Z);function _1(e){return e&&e.__esModule?e:{default:e}}var _2=_$.Checkboard=function(e){var t=e.white,n=e.grey,r=e.size,i=e.renderers,o=e.borderRadius,a=e.boxShadow,l=e.children,s=(0,_X.default)({default:{grid:{borderRadius:o,boxShadow:a,absolute:"0px 0px 0px 0px",background:"url("+_0.get(t,n,r,i.canvas)+") center left"}}});return(0,v.isValidElement)(l)?_Y.default.cloneElement(l,_K({},l.props,{style:_K({},l.props.style,s.grid)})):_Y.default.createElement("div",{style:s.grid})};_2.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}},_$.default=_2;var _3=_5(_$);function _5(e){return e&&e.__esModule?e:{default:e}}function _6(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var _4=_B.Alpha=function(e){function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);for(var e,n,r,i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=_6(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.handleChange=function(e){var t=_W.calculateChange(e,r.props.hsl,r.props.direction,r.props.a,r.container);t&&"function"==typeof r.props.onChange&&r.props.onChange(t,e)},r.handleMouseDown=function(e){r.handleChange(e),window.addEventListener("mousemove",r.handleChange),window.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleChange),window.removeEventListener("mouseup",r.handleMouseUp)},_6(r,n)}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),_H(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var e=this,t=this.props.rgb,n=(0,_q.default)({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:100*t.a+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)"},pointer:{left:0,top:100*t.a+"%"}},overwrite:_U({},this.props.style)},{vertical:"vertical"===this.props.direction,overwrite:!0});return _V.default.createElement("div",{style:n.alpha},_V.default.createElement("div",{style:n.checkboard},_V.default.createElement(_3.default,{renderers:this.props.renderers})),_V.default.createElement("div",{style:n.gradient}),_V.default.createElement("div",{style:n.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},_V.default.createElement("div",{style:n.pointer},this.props.pointer?_V.default.createElement(this.props.pointer,this.props):_V.default.createElement("div",{style:n.slider}))))}}]),t}(v.PureComponent||v.Component);_B.default=_4,Object.defineProperty(_z,"Alpha",{enumerable:!0,get:function(){return St(_B).default}}),Object.defineProperty(_z,"Checkboard",{enumerable:!0,get:function(){return St(_$).default}});var _8={};Object.defineProperty(_8,"__esModule",{value:!0}),_8.EditableInput=void 0;var _9=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),v=h("8NFma"),_7=Et(v),Ee=Et(yj);function Et(e){return e&&e.__esModule?e:{default:e}}var En=[38,40],Er=1,Ei=_8.EditableInput=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.handleBlur=function(){n.state.blurValue&&n.setState({value:n.state.blurValue,blurValue:null})},n.handleChange=function(e){n.setUpdatedValue(e.target.value,e)},n.handleKeyDown=function(e){var t,r=Number(String(e.target.value).replace(/%/g,""));if(!isNaN(r)&&(t=e.keyCode,En.indexOf(t)>-1)){var i=n.getArrowOffset(),o=38===e.keyCode?r+i:r-i;n.setUpdatedValue(o,e)}},n.handleDrag=function(e){if(n.props.dragLabel){var t=Math.round(n.props.value+e.movementX);t>=0&&t<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(t),e)}},n.handleMouseDown=function(e){n.props.dragLabel&&(e.preventDefault(),n.handleDrag(e),window.addEventListener("mousemove",n.handleDrag),window.addEventListener("mouseup",n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleDrag),window.removeEventListener("mouseup",n.handleMouseUp)},n.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},n.inputId="rc-editable-input-"+Er++,n}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),_9(t,[{key:"componentDidUpdate",value:function(e,t){this.props.value!==this.state.value&&(e.value!==this.props.value||t.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(e){var t,n;return t={},(n=this.props.label)in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(e,t){var n=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(n,t),this.setState({value:e})}},{key:"render",value:function(){var e=this,t=(0,Ee.default)({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return _7.default.createElement("div",{style:t.wrap},_7.default.createElement("input",{id:this.inputId,style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?_7.default.createElement("label",{htmlFor:this.inputId,style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(v.PureComponent||v.Component);_8.default=Ei,Object.defineProperty(_z,"EditableInput",{enumerable:!0,get:function(){return St(_8).default}});var Eo={};Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.Hue=void 0;var Ea=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),v=h("8NFma"),El=Ed(v),Es=Ed(yj),Eu={};Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.calculateChange=function(e,t,n,r){var i=r.clientWidth,o=r.clientHeight,a="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,l="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,s=a-(r.getBoundingClientRect().left+window.pageXOffset),u=l-(r.getBoundingClientRect().top+window.pageYOffset);if("vertical"===t){var c=void 0;if(c=u<0?359:u>o?0:360*(-(100*u/o)+100)/100,n.h!==c)return{h:c,s:n.s,l:n.l,a:n.a,source:"hsl"}}else{var d=void 0;if(d=s<0?0:s>i?359:100*s/i*360/100,n.h!==d)return{h:d,s:n.s,l:n.l,a:n.a,source:"hsl"}}return null};var Ec=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(Eu);function Ed(e){return e&&e.__esModule?e:{default:e}}function Eh(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var Ef=Eo.Hue=function(e){function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);for(var e,n,r,i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=Eh(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.handleChange=function(e){var t=Ec.calculateChange(e,r.props.direction,r.props.hsl,r.container);t&&"function"==typeof r.props.onChange&&r.props.onChange(t,e)},r.handleMouseDown=function(e){r.handleChange(e),window.addEventListener("mousemove",r.handleChange),window.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},Eh(r,n)}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),Ea(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.direction,n=void 0===t?"horizontal":t,r=(0,Es.default)({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:100*this.props.hsl.h/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(100*this.props.hsl.h/360)+100+"%"}}},{vertical:"vertical"===n});return El.default.createElement("div",{style:r.hue},El.default.createElement("div",{className:"hue-"+n,style:r.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},El.default.createElement("style",null,"\n .hue-horizontal {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0\n 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to right, #f00 0%, #ff0\n 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n\n .hue-vertical {\n background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,\n #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,\n #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n "),El.default.createElement("div",{style:r.pointer},this.props.pointer?El.default.createElement(this.props.pointer,this.props):El.default.createElement("div",{style:r.slider}))))}}]),t}(v.PureComponent||v.Component);Eo.default=Ef,Object.defineProperty(_z,"Hue",{enumerable:!0,get:function(){return St(Eo).default}});var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0}),Ep.Raised=void 0;var v=h("8NFma"),Eg=Eb(v),Em=Eb(yN),Ev=Eb(yj),Ey=Eb(_g);function Eb(e){return e&&e.__esModule?e:{default:e}}var Ew=Ep.Raised=function(e){var t=e.zDepth,n=e.radius,r=e.background,i=e.children,o=e.styles,a=(0,Ev.default)((0,Ey.default)({default:{wrap:{position:"relative",display:"inline-block"},content:{position:"relative"},bg:{absolute:"0px 0px 0px 0px",boxShadow:"0 "+t+"px "+4*t+"px rgba(0,0,0,.24)",borderRadius:n,background:r}},"zDepth-0":{bg:{boxShadow:"none"}},"zDepth-1":{bg:{boxShadow:"0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)"}},"zDepth-2":{bg:{boxShadow:"0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)"}},"zDepth-3":{bg:{boxShadow:"0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)"}},"zDepth-4":{bg:{boxShadow:"0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)"}},"zDepth-5":{bg:{boxShadow:"0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)"}},square:{bg:{borderRadius:"0"}},circle:{bg:{borderRadius:"50%"}}},void 0===o?{}:o),{"zDepth-1":1===t});return Eg.default.createElement("div",{style:a.wrap},Eg.default.createElement("div",{style:a.bg}),Eg.default.createElement("div",{style:a.content},i))};Ew.propTypes={background:Em.default.string,zDepth:Em.default.oneOf([0,1,2,3,4,5]),radius:Em.default.number,styles:Em.default.object},Ew.defaultProps={background:"#fff",zDepth:1,radius:2,styles:{}},Ep.default=Ew,Object.defineProperty(_z,"Raised",{enumerable:!0,get:function(){return St(Ep).default}});var Ex={};Object.defineProperty(Ex,"__esModule",{value:!0}),Ex.Saturation=void 0;var E_=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),v=h("8NFma"),EE=EH(v),ES=EH(yj),EC={},bf=h("kNSK3"),EO={},bd=h("eeOBM");EO=function(){return bd.Date.now()};var Ek={},EP={},ET={},EA=/\s/;ET=function(e){for(var t=e.length;t--&&EA.test(e.charAt(t)););return t};var EN=/^\s+/;EP=function(e){return e?e.slice(0,ET(e)+1).replace(EN,""):e};var bf=h("kNSK3"),Ej=0/0,ER=/^[-+]0x[0-9a-f]+$/i,EI=/^0b[01]+$/i,EL=/^0o[0-7]+$/i,EM=parseInt;Ek=function(e){if("number"==typeof e)return e;if(wL(e))return Ej;if(bf(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=bf(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=EP(e);var n=EI.test(e);return n||EL.test(e)?EM(e.slice(2),n?2:8):ER.test(e)?Ej:+e};var ED=Math.max,EF=Math.min;EC=function(e,t,n){var r,i,o,a,l,s,u=0,c=!1,d=!1,h=!0;if("function"!=typeof e)throw TypeError("Expected a function");function f(t){var n=r,o=i;return r=i=void 0,u=t,a=e.apply(o,n)}function p(e){var n=e-s,r=e-u;return void 0===s||n>=t||n<0||d&&r>=o}function g(){var e,n,r,i=EO();if(p(i))return m(i);l=setTimeout(g,(e=i-s,n=i-u,r=t-e,d?EF(r,o-n):r))}function m(e){return(l=void 0,h&&r)?f(e):(r=i=void 0,a)}function v(){var e,n=EO(),o=p(n);if(r=arguments,i=this,s=n,o){if(void 0===l)return u=e=s,l=setTimeout(g,t),c?f(e):a;if(d)return clearTimeout(l),l=setTimeout(g,t),f(s)}return void 0===l&&(l=setTimeout(g,t)),a}return t=Ek(t)||0,bf(n)&&(c=!!n.leading,o=(d="maxWait"in n)?ED(Ek(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),v.cancel=function(){void 0!==l&&clearTimeout(l),u=0,r=s=i=l=void 0},v.flush=function(){return void 0===l?a:m(EO())},v};var bf=h("kNSK3"),Ez=EH(function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw TypeError("Expected a function");return bf(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),EC(e,t,{leading:r,maxWait:t,trailing:i})}),EB={};Object.defineProperty(EB,"__esModule",{value:!0}),EB.calculateChange=function(e,t,n){var r=n.getBoundingClientRect(),i=r.width,o=r.height,a="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,l="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,s=a-(n.getBoundingClientRect().left+window.pageXOffset),u=l-(n.getBoundingClientRect().top+window.pageYOffset);s<0?s=0:s>i&&(s=i),u<0?u=0:u>o&&(u=o);var c=s/i,d=1-u/o;return{h:t.h,s:c,v:d,a:t.a,source:"hsv"}};var EU=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(EB);function EH(e){return e&&e.__esModule?e:{default:e}}var EV=Ex.Saturation=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleChange=function(e){"function"==typeof n.props.onChange&&n.throttle(n.props.onChange,EU.calculateChange(e,n.props.hsl,n.container),e)},n.handleMouseDown=function(e){n.handleChange(e);var t=n.getContainerRenderWindow();t.addEventListener("mousemove",n.handleChange),t.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.throttle=(0,Ez.default)(function(e,t,n){e(t,n)},50),n}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),E_(t,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var e=this.container,t=window;!t.document.contains(e)&&t.parent!==t;)t=t.parent;return t}},{key:"unbindEventListeners",value:function(){var e=this.getContainerRenderWindow();e.removeEventListener("mousemove",this.handleChange),e.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.style||{},n=t.color,r=t.white,i=t.black,o=t.pointer,a=t.circle,l=(0,ES.default)({default:{color:{absolute:"0px 0px 0px 0px",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},black:{absolute:"0px 0px 0px 0px",boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:"absolute",top:-(100*this.props.hsv.v)+100+"%",left:100*this.props.hsv.s+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:"0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)",borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:n,white:r,black:i,pointer:o,circle:a}},{custom:!!this.props.style});return EE.default.createElement("div",{style:l.color,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},EE.default.createElement("style",null,"\n .saturation-white {\n background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n }\n .saturation-black {\n background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n }\n "),EE.default.createElement("div",{style:l.white,className:"saturation-white"},EE.default.createElement("div",{style:l.black,className:"saturation-black"}),EE.default.createElement("div",{style:l.pointer},this.props.pointer?EE.default.createElement(this.props.pointer,this.props):EE.default.createElement("div",{style:l.circle}))))}}]),t}(v.PureComponent||v.Component);Ex.default=EV,Object.defineProperty(_z,"Saturation",{enumerable:!0,get:function(){return St(Ex).default}});var Eq={};Object.defineProperty(Eq,"__esModule",{value:!0}),Eq.ColorWrap=void 0;var EG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EW=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),v=h("8NFma"),E$=E1(v),EK=E1(EC),EY={};Object.defineProperty(EY,"__esModule",{value:!0}),EY.isvalidColorString=EY.red=EY.getContrastingColor=EY.isValidHex=EY.toState=EY.simpleCheckForValidColor=void 0;var EX=EQ(h("2MeUa")),EZ=EQ(function(){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}var t,n,r,i=/^\s+/,o=/\s+$/;function a(t,n){if(n=n||{},(t=t||"")instanceof a)return t;if(!(this instanceof a))return new a(t,n);var r,l,s,u,c,d,h,f,p,g,m,v,y,b,w,x,_,S,k,T,N=(l={r:0,g:0,b:0},s=1,u=null,c=null,d=null,h=!1,f=!1,"string"==typeof(r=t)&&(r=function(e){e=e.replace(i,"").replace(o,"").toLowerCase();var t,n=!1;if(E[e])e=E[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=j.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=j.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=j.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=j.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=j.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=j.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=j.hex8.exec(e))?{r:P(t[1]),g:P(t[2]),b:P(t[3]),a:P(t[4])/255,format:n?"name":"hex8"}:(t=j.hex6.exec(e))?{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:n?"name":"hex"}:(t=j.hex4.exec(e))?{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:P(t[4]+""+t[4])/255,format:n?"name":"hex8"}:!!(t=j.hex3.exec(e))&&{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:n?"name":"hex"}}(r)),"object"==e(r)&&(R(r.r)&&R(r.g)&&R(r.b)?(p=r.r,g=r.g,m=r.b,l={r:255*O(p,255),g:255*O(g,255),b:255*O(m,255)},h=!0,f="%"===String(r.r).substr(-1)?"prgb":"rgb"):R(r.h)&&R(r.s)&&R(r.v)?(u=A(r.s),c=A(r.v),v=r.h,y=u,b=c,v=6*O(v,360),y=O(y,100),b=O(b,100),w=Math.floor(v),x=v-w,_=b*(1-y),S=b*(1-x*y),k=b*(1-(1-x)*y),l={r:255*[b,S,_,_,k,b][T=w%6],g:255*[k,b,b,S,_,_][T],b:255*[_,_,k,b,b,S][T]},h=!0,f="hsv"):R(r.h)&&R(r.s)&&R(r.l)&&(u=A(r.s),d=A(r.l),l=function(e,t,n){var r,i,o;function a(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=O(e,360),t=O(t,100),n=O(n,100),0===t)r=i=o=n;else{var l=n<.5?n*(1+t):n+t-n*t,s=2*n-l;r=a(s,l,e+1/3),i=a(s,l,e),o=a(s,l,e-1/3)}return{r:255*r,g:255*i,b:255*o}}(r.h,u,d),h=!0,f="hsl"),r.hasOwnProperty("a")&&(s=r.a)),s=C(s),{ok:h,format:r.format||f,r:Math.min(255,Math.max(l.r,0)),g:Math.min(255,Math.max(l.g,0)),b:Math.min(255,Math.max(l.b,0)),a:s});this._originalInput=t,this._r=N.r,this._g=N.g,this._b=N.b,this._a=N.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||N.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=N.ok}function l(e,t,n){var r,i,o=Math.max(e=O(e,255),t=O(t,255),n=O(n,255)),a=Math.min(e,t,n),l=(o+a)/2;if(o==a)r=i=0;else{var s=o-a;switch(i=l>.5?s/(2-o-a):s/(o+a),o){case e:r=(t-n)/s+(t<n?6:0);break;case t:r=(n-e)/s+2;break;case n:r=(e-t)/s+4}r/=6}return{h:r,s:i,l:l}}function s(e,t,n){var r,i=Math.max(e=O(e,255),t=O(t,255),n=O(n,255)),o=Math.min(e,t,n),a=i-o;if(i==o)r=0;else{switch(i){case e:r=(t-n)/a+(t<n?6:0);break;case t:r=(n-e)/a+2;break;case n:r=(e-t)/a+4}r/=6}return{h:r,s:0===i?0:a/i,v:i}}function u(e,t,n,r){var i=[T(Math.round(e).toString(16)),T(Math.round(t).toString(16)),T(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function c(e,t,n,r){return[T(N(r)),T(Math.round(e).toString(16)),T(Math.round(t).toString(16)),T(Math.round(n).toString(16))].join("")}function d(e,t){t=0===t?0:t||10;var n=a(e).toHsl();return n.s-=t/100,n.s=k(n.s),a(n)}function h(e,t){t=0===t?0:t||10;var n=a(e).toHsl();return n.s+=t/100,n.s=k(n.s),a(n)}function f(e){return a(e).desaturate(100)}function p(e,t){t=0===t?0:t||10;var n=a(e).toHsl();return n.l+=t/100,n.l=k(n.l),a(n)}function g(e,t){t=0===t?0:t||10;var n=a(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-(t/100*255)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-(t/100*255)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-(t/100*255)))),a(n)}function m(e,t){t=0===t?0:t||10;var n=a(e).toHsl();return n.l-=t/100,n.l=k(n.l),a(n)}function v(e,t){var n=a(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,a(n)}function y(e){var t=a(e).toHsl();return t.h=(t.h+180)%360,a(t)}function b(e,t){if(isNaN(t)||t<=0)throw Error("Argument to polyad must be a positive number");for(var n=a(e).toHsl(),r=[a(e)],i=360/t,o=1;o<t;o++)r.push(a({h:(n.h+o*i)%360,s:n.s,l:n.l}));return r}function w(e){var t=a(e).toHsl(),n=t.h;return[a(e),a({h:(n+72)%360,s:t.s,l:t.l}),a({h:(n+216)%360,s:t.s,l:t.l})]}function x(e,t,n){t=t||6,n=n||30;var r=a(e).toHsl(),i=360/n,o=[a(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(a(r));return o}function _(e,t){t=t||6;for(var n=a(e).toHsv(),r=n.h,i=n.s,o=n.v,l=[],s=1/t;t--;)l.push(a({h:r,s:i,v:o})),o=(o+s)%1;return l}a.prototype={isDark:function(){return 128>this.getBrightness()},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*((t=r.g/255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*((n=r.b/255)<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=s(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=s(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=l(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=l(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return u(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){var t,n,r,i,o;return t=this._r,n=this._g,r=this._b,i=this._a,o=[T(Math.round(t).toString(16)),T(Math.round(n).toString(16)),T(Math.round(r).toString(16)),T(N(i))],e&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*O(this._r,255))+"%",g:Math.round(100*O(this._g,255))+"%",b:Math.round(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*O(this._r,255))+"%, "+Math.round(100*O(this._g,255))+"%, "+Math.round(100*O(this._b,255))+"%)":"rgba("+Math.round(100*O(this._r,255))+"%, "+Math.round(100*O(this._g,255))+"%, "+Math.round(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[u(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+c(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=a(e);n="#"+c(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return!t&&r&&("hex"===e||"hex6"===e||"hex3"===e||"hex4"===e||"hex8"===e||"name"===e)?"name"===e&&0===this._a?this.toName():this.toRgbString():("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(p,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(h,arguments)},greyscale:function(){return this._applyModification(f,arguments)},spin:function(){return this._applyModification(v,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(x,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(_,arguments)},splitcomplement:function(){return this._applyCombination(w,arguments)},triad:function(){return this._applyCombination(b,[3])},tetrad:function(){return this._applyCombination(b,[4])}},a.fromRatio=function(t,n){if("object"==e(t)){var r={};for(var i in t)t.hasOwnProperty(i)&&("a"===i?r[i]=t[i]:r[i]=A(t[i]));t=r}return a(t,n)},a.equals=function(e,t){return!!e&&!!t&&a(e).toRgbString()==a(t).toRgbString()},a.random=function(){return a.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},a.mix=function(e,t,n){n=0===n?0:n||50;var r=a(e).toRgb(),i=a(t).toRgb(),o=n/100;return a({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},a.readability=function(e,t){var n=a(e),r=a(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},a.isReadable=function(e,t,n){var r,i,o,l,s,u=a.readability(e,t);switch(s=!1,(i=((r=(r=n)||{level:"AA",size:"small"}).level||"AA").toUpperCase(),o=(r.size||"small").toLowerCase(),"AA"!==i&&"AAA"!==i&&(i="AA"),"small"!==o&&"large"!==o&&(o="small"),l={level:i,size:o}).level+l.size){case"AAsmall":case"AAAlarge":s=u>=4.5;break;case"AAlarge":s=u>=3;break;case"AAAsmall":s=u>=7}return s},a.mostReadable=function(e,t,n){var r,i,o,l,s=null,u=0;i=(n=n||{}).includeFallbackColors,o=n.level,l=n.size;for(var c=0;c<t.length;c++)(r=a.readability(e,t[c]))>u&&(u=r,s=a(t[c]));return a.isReadable(e,s,{level:o,size:l})||!i?s:(n.includeFallbackColors=!1,a.mostReadable(e,["#fff","#000"],n))};var E=a.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=a.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(E);function C(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function O(e,t){"string"==typeof(n=e)&&-1!=n.indexOf(".")&&1===parseFloat(n)&&(e="100%");var n,r,i="string"==typeof(r=e)&&-1!=r.indexOf("%");return(e=Math.min(t,Math.max(0,parseFloat(e))),i&&(e=parseInt(e*t,10)/100),1e-6>Math.abs(e-t))?1:e%t/parseFloat(t)}function k(e){return Math.min(1,Math.max(0,e))}function P(e){return parseInt(e,16)}function T(e){return 1==e.length?"0"+e:""+e}function A(e){return e<=1&&(e=100*e+"%"),e}function N(e){return Math.round(255*parseFloat(e)).toString(16)}var j=(n="[\\s|\\(]+("+(t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",{CSS_UNIT:new RegExp(t),rgb:RegExp("rgb"+n),rgba:RegExp("rgba"+r),hsl:RegExp("hsl"+n),hsla:RegExp("hsla"+r),hsv:RegExp("hsv"+n),hsva:RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function R(e){return!!j.CSS_UNIT.exec(e)}return a}());function EQ(e){return e&&e.__esModule?e:{default:e}}EY.simpleCheckForValidColor=function(e){var t=0,n=0;return(0,EX.default)(["r","g","b","a","h","s","l","v"],function(r){e[r]&&(t+=1,isNaN(e[r])||(n+=1),("s"===r||"l"===r)&&/^\d+%$/.test(e[r])&&(n+=1))}),t===n&&e};var EJ=EY.toState=function(e,t){var n=e.hex?(0,EZ.default)(e.hex):(0,EZ.default)(e),r=n.toHsl(),i=n.toHsv(),o=n.toRgb(),a=n.toHex();return 0===r.s&&(r.h=t||0,i.h=t||0),{hsl:r,hex:"000000"===a&&0===o.a?"transparent":"#"+a,rgb:o,hsv:i,oldHue:e.h||t||r.h,source:e.source}};EY.isValidHex=function(e){if("transparent"===e)return!0;var t="#"===String(e).charAt(0)?1:0;return e.length!==4+t&&e.length<7+t&&(0,EZ.default)(e).isValid()},EY.getContrastingColor=function(e){if(!e)return"#fff";var t=EJ(e);return"transparent"===t.hex?"rgba(0,0,0,0.4)":(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=128?"#000":"#fff"},EY.red={hsl:{a:1,h:0,l:.5,s:1},hex:"#ff0000",rgb:{r:255,g:0,b:0,a:1},hsv:{h:0,s:1,v:1,a:1}},EY.isvalidColorString=function(e,t){var n=e.replace("°","");return(0,EZ.default)(t+" ("+n+")")._ok};var E0=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(EY);function E1(e){return e&&e.__esModule?e:{default:e}}var E2=Eq.ColorWrap=function(e){var t=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return t.handleChange=function(e,n){if(E0.simpleCheckForValidColor(e)){var r=E0.toState(e,e.h||t.state.oldHue);t.setState(r),t.props.onChangeComplete&&t.debounce(t.props.onChangeComplete,r,n),t.props.onChange&&t.props.onChange(r,n)}},t.handleSwatchHover=function(e,n){if(E0.simpleCheckForValidColor(e)){var r=E0.toState(e,e.h||t.state.oldHue);t.props.onSwatchHover&&t.props.onSwatchHover(r,n)}},t.state=EG({},E0.toState(e.color,0)),t.debounce=(0,EK.default)(function(e,t,n){e(t,n)},100),t}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,t),EW(n,[{key:"render",value:function(){var t={};return this.props.onSwatchHover&&(t.onSwatchHover=this.handleSwatchHover),E$.default.createElement(e,EG({},this.props,this.state,{onChange:this.handleChange},t))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return EG({},E0.toState(e.color,t.oldHue))}}]),n}(v.PureComponent||v.Component);return t.propTypes=EG({},e.propTypes),t.defaultProps=EG({},e.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),t};Eq.default=E2,Object.defineProperty(_z,"ColorWrap",{enumerable:!0,get:function(){return St(Eq).default}});var E3={};Object.defineProperty(E3,"__esModule",{value:!0}),E3.Swatch=void 0;var E5=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=h("8NFma"),E6=E7(v),E4=E7(yj),E8=h("gxGlt"),E9=E7(_$);function E7(e){return e&&e.__esModule?e:{default:e}}var Se=E3.Swatch=function(e){var t=e.color,n=e.style,r=e.onClick,i=void 0===r?function(){}:r,o=e.onHover,a=e.title,l=void 0===a?t:a,s=e.children,u=e.focus,c=e.focusStyle,d="transparent"===t,h=(0,E4.default)({default:{swatch:E5({background:t,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},n,u?void 0===c?{}:c:{})}}),f={};return o&&(f.onMouseOver=function(e){return o(t,e)}),E6.default.createElement("div",E5({style:h.swatch,onClick:function(e){return i(t,e)},title:l,tabIndex:0,onKeyDown:function(e){return 13===e.keyCode&&i(t,e)}},f),s,d&&E6.default.createElement(E9.default,{borderRadius:h.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))};function St(e){return e&&e.__esModule?e:{default:e}}E3.default=(0,E8.handleFocus)(Se),Object.defineProperty(_z,"Swatch",{enumerable:!0,get:function(){return St(E3).default}});var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.SketchFields=void 0;var v=h("8NFma"),Sr=Sa(v),Si=Sa(yj),So=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(EY);function Sa(e){return e&&e.__esModule?e:{default:e}}var Sl=Sn.SketchFields=function(e){var t=e.onChange,n=e.rgb,r=e.hsl,i=e.hex,o=e.disableAlpha,a=(0,Si.default)({default:{fields:{display:"flex",paddingTop:"4px"},single:{flex:"1",paddingLeft:"6px"},alpha:{flex:"1",paddingLeft:"6px"},double:{flex:"2"},input:{width:"80%",padding:"4px 10% 3px",border:"none",boxShadow:"inset 0 0 0 1px #ccc",fontSize:"11px"},label:{display:"block",textAlign:"center",fontSize:"11px",color:"#222",paddingTop:"3px",paddingBottom:"4px",textTransform:"capitalize"}},disableAlpha:{alpha:{display:"none"}}},{disableAlpha:o}),l=function(e,i){e.hex?So.isValidHex(e.hex)&&t({hex:e.hex,source:"hex"},i):e.r||e.g||e.b?t({r:e.r||n.r,g:e.g||n.g,b:e.b||n.b,a:n.a,source:"rgb"},i):e.a&&(e.a<0?e.a=0:e.a>100&&(e.a=100),e.a/=100,t({h:r.h,s:r.s,l:r.l,a:e.a,source:"rgb"},i))};return Sr.default.createElement("div",{style:a.fields,className:"flexbox-fix"},Sr.default.createElement("div",{style:a.double},Sr.default.createElement(_z.EditableInput,{style:{input:a.input,label:a.label},label:"hex",value:i.replace("#",""),onChange:l})),Sr.default.createElement("div",{style:a.single},Sr.default.createElement(_z.EditableInput,{style:{input:a.input,label:a.label},label:"r",value:n.r,onChange:l,dragLabel:"true",dragMax:"255"})),Sr.default.createElement("div",{style:a.single},Sr.default.createElement(_z.EditableInput,{style:{input:a.input,label:a.label},label:"g",value:n.g,onChange:l,dragLabel:"true",dragMax:"255"})),Sr.default.createElement("div",{style:a.single},Sr.default.createElement(_z.EditableInput,{style:{input:a.input,label:a.label},label:"b",value:n.b,onChange:l,dragLabel:"true",dragMax:"255"})),Sr.default.createElement("div",{style:a.alpha},Sr.default.createElement(_z.EditableInput,{style:{input:a.input,label:a.label},label:"a",value:Math.round(100*n.a),onChange:l,dragLabel:"true",dragMax:"100"})))};Sn.default=Sl;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.SketchPresetColors=void 0;var Su=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=h("8NFma"),Sc=Sf(v),Sd=Sf(yN),Sh=Sf(yj);function Sf(e){return e&&e.__esModule?e:{default:e}}var Sp=Ss.SketchPresetColors=function(e){var t=e.colors,n=e.onClick,r=void 0===n?function(){}:n,i=e.onSwatchHover,o=(0,Sh.default)({default:{colors:{margin:"0 -10px",padding:"10px 0 0 10px",borderTop:"1px solid #eee",display:"flex",flexWrap:"wrap",position:"relative"},swatchWrap:{width:"16px",height:"16px",margin:"0 10px 10px 0"},swatch:{borderRadius:"3px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15)"}},"no-presets":{colors:{display:"none"}}},{"no-presets":!t||!t.length}),a=function(e,t){r({hex:e,source:"hex"},t)};return Sc.default.createElement("div",{style:o.colors,className:"flexbox-fix"},t.map(function(e){var t="string"==typeof e?{color:e}:e,n=""+t.color+(t.title||"");return Sc.default.createElement("div",{key:n,style:o.swatchWrap},Sc.default.createElement(_z.Swatch,Su({},t,{style:o.swatch,onClick:a,onHover:i,focusStyle:{boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px "+t.color}})))}))};Sp.propTypes={colors:Sd.default.arrayOf(Sd.default.oneOfType([Sd.default.string,Sd.default.shape({color:Sd.default.string,title:Sd.default.string})])).isRequired},Ss.default=Sp;let Sg=e=>{let t=l(v).useRef(e);return t.current=e,l(v).useCallback((...e)=>t.current(...e),[])},Sm=({width:e,rgb:t,hex:n,hsv:r,hsl:i,onChange:o,onSwatchHover:a,disableAlpha:s,presetColors:u,renderers:c,styles:d={},className:h=""})=>{let f=l(yj)(l(_g)({default:{picker:{width:e,padding:"10px 10px 0",boxSizing:"initial",background:"#fff",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)"},saturation:{width:"100%",paddingBottom:"75%",position:"relative",overflow:"hidden"},Saturation:{radius:"3px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},controls:{display:"flex"},sliders:{padding:"4px 0",flex:"1"},color:{width:"24px",height:"24px",position:"relative",marginTop:"4px",marginLeft:"4px",borderRadius:"3px"},activeColor:{absolute:"0px 0px 0px 0px",borderRadius:"2px",background:`rgba(${t.r},${t.g},${t.b},${t.a})`,boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hue:{position:"relative",height:"10px",overflow:"hidden"},Hue:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},alpha:{position:"relative",height:"10px",marginTop:"4px",overflow:"hidden"},Alpha:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},...d},disableAlpha:{color:{height:"10px"},hue:{height:"10px"},alpha:{display:"none"}}},d),{disableAlpha:s}),[g,m]=l(v).useState(!1),y=l(v).useRef(null),b=Sg(e=>{if(g){let t=y.current?.fill();t&&o(l(A).Util.colorToRGBA(t)),x(),!function(e,t){let n=e.target;for(;n;){if(n.classList.contains(t))return!0;n=n.parentElement}return!1}(e,"color-picker-button")&&m(!1),e.stopPropagation(),e.stopImmediatePropagation()}}),w=Sg(e=>{if(!g)return;let t=l(A).stages.find(t=>{let n=t.getContent().getBoundingClientRect();return n.left<e.clientX&&n.left+n.width>e.clientX&&n.top<e.clientY&&n.top+n.height>e.clientY});if(!t){x();return}let n=t.getContent().getBoundingClientRect(),r={x:e.clientX-n.left,y:e.clientY-n.top},i=t.children[0],o=i.getNativeCanvasElement(),a=i.getCanvas().getPixelRatio(),{data:s}=o.getContext("2d").getImageData(r.x*a,r.y*a,1,1),u=t.findOne(".line-guides");u.findOne(".picker")||(y.current&&y.current.destroy(),y.current=new(l(A)).Circle({name:"picker",radius:14,stroke:"black",strokeWidth:1}),u.add(y.current)),y.current.setAbsolutePosition({x:r.x-15,y:r.y-15}),y.current.fill("rgb("+s[0]+","+s[1]+","+s[2]+")")});l(v).useEffect(()=>(window.addEventListener("mousemove",w),window.addEventListener("mousedown",b,!0),window.addEventListener("touchstart",b,!0),()=>{window.removeEventListener("mousemove",w),window.removeEventListener("mousedown",b,!0),window.removeEventListener("touchstart",b,!0),x()}),[]),l(v).useEffect(()=>{g||x()},[g]),l(v).useEffect(()=>(g&&(document.body.style.cursor="crosshair"),()=>{document.body.style.cursor="default"}),[g]);let x=Sg(()=>{y.current&&(y.current.destroy(),y.current=null)});return(0,p.jsxs)("div",{style:f.picker,className:`sketch-picker ${h}`,children:[(0,p.jsx)("div",{style:f.saturation,children:(0,p.jsx)(_z.Saturation,{style:f.Saturation,hsl:i,hsv:r,onChange:o})}),(0,p.jsxs)("div",{style:f.controls,className:"flexbox-fix",children:[(0,p.jsxs)("div",{style:f.sliders,children:[(0,p.jsx)("div",{style:f.hue,children:(0,p.jsx)(_z.Hue,{style:f.Hue,hsl:i,onChange:o})}),(0,p.jsx)("div",{style:f.alpha,children:(0,p.jsx)(_z.Alpha,{style:f.Alpha,rgb:t,hsl:i,renderers:c,onChange:o})})]}),(0,p.jsxs)("div",{style:f.color,children:[(0,p.jsx)(_z.Checkboard,{}),(0,p.jsx)("div",{style:f.activeColor})]}),(0,p.jsx)("div",{style:f.color,children:(0,p.jsx)(pA,{icon:(0,p.jsx)(l(_j),{}),className:"color-picker-button",minimal:!0,style:{width:"24px",height:"24px",minWidth:"24px",minHeight:"24px",padding:0,margin:0},active:g,onClickCapture:e=>{m(e=>!e),e.stopPropagation()}})})]}),(0,p.jsx)(l(Sn),{rgb:t,hsl:i,hex:n,onChange:o,disableAlpha:s}),(0,p.jsx)(l(Ss),{colors:u,onClick:o,onSwatchHover:a})]})};Sm.propTypes={disableAlpha:l(yN).bool,width:l(yN).oneOfType([l(yN).string,l(yN).number]),styles:l(yN).object},Sm.defaultProps={disableAlpha:!1,width:200,styles:{},presetColors:["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"]};var Sv=(0,_z.ColorWrap)(Sm);let Sy=["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"].reverse(),Sb=e=>{let t=[];e.pages.forEach(e=>{e.children.forEach(e=>{"text"===e.type&&t.push(e.fill),"svg"===e.type&&t.push(...e.colorsReplace.values())})});let n=[];return t.forEach(e=>{if(ir(e)){let{stops:t}=io(e);n.push(...t.map(e=>e.color))}else n.push(e)}),[...new Set(n)]},Sw=at("div")`
|
|
134
|
+
`,mM=({type:e,usedItems:t,components:n})=>{let r=[];return Object.keys(n).forEach(n=>{0!==n.toLowerCase().indexOf(e)||t.includes(n)||r.push(n)}),t.filter(e=>!!e).concat(r)},mD=({items:e,itemRender:t})=>{let[n,r]=l(v).useState(0),i=l(v).useRef(null),o=()=>{if(null===i.current)return;let e=i.current.parentElement,t=0;[...i.current.parentElement.children].forEach(e=>{e!==i.current&&(t+=e.offsetWidth)}),r(Math.max(20,e.offsetWidth-t-10))};return l(v).useLayoutEffect(()=>{o()}),l(v).useLayoutEffect(()=>{let e=i.current.parentElement.parentElement;if(window.ResizeObserver){let t=new ResizeObserver(o);return t.observe(e),()=>t.unobserve(e)}{let e=setInterval(o,100);return()=>clearInterval(e)}},[]),(0,p.jsx)(mL,{style:{width:n+"px"},ref:i,className:"bp5-navbar-group bp5-align-left",children:(0,p.jsx)(mj,{items:e,style:{width:"100%"},visibleItemRenderer:t,collapseFrom:mN.END,overflowRenderer:e=>(0,p.jsx)(mw,{content:(0,p.jsx)("div",{style:{padding:"10px",display:"flex"},children:e.map(t)}),position:sj.BOTTOM,children:(0,p.jsx)(pA,{icon:"more",minimal:!0,style:{marginLeft:"10px"}})})})})};h("8NFma");let mF=P(({store:e})=>{let t=e.selectedElements.length>0;return(0,p.jsx)(mC,{content:sy("toolbar.duplicateElements"),disabled:!t,position:"bottom",children:(0,p.jsx)(pA,{icon:"duplicate",minimal:!0,onClick:()=>{let t=[];e.selectedElements.forEach(e=>{let n=e.clone();"group"===e.type?n.children.forEach(e=>{e.set({x:e.x+50,y:e.y+50})}):n.set({x:e.x+50,y:e.y+50}),t.push(n.id)}),e.selectElements(t)},disabled:!t})})});h("8NFma");let mz=P(({store:e})=>{let t=e.selectedElements.filter(e=>e.removable);return(0,p.jsx)(mC,{content:sy("toolbar.removeElements"),disabled:!t.length,position:"bottom",children:(0,p.jsx)(pA,{icon:"trash",minimal:!0,onClick:()=>{e.deleteElements(t.map(e=>e.id))},disabled:!t.length,style:{marginLeft:"auto"}})})});h("8NFma");var sO=h("gztBd"),v=h("8NFma"),mB=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e,t=this.props,n=t.className,r=t.children,i=t.large,o=t.small,a=t.ulRef,s=(0,sO.__rest)(t,["className","children","large","small","ulRef"]),u=l(sk)(n,sP.MENU,((e={})[sP.LARGE]=i,e[sP.SMALL]=o,e));return v.createElement("ul",(0,sO.__assign)({role:"menu"},s,{className:u,ref:a}),r)},t.displayName="".concat(pa,".Menu"),t}(pO),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma");function mU(e,t){return v.forwardRef(function(n,r){var i=n.className,o=n.children,a=(0,sO.__rest)(n,["className","children"]);return v.createElement(e,(0,sO.__assign)((0,sO.__assign)({},a),{className:l(sk)(t,i),ref:r}),o)})}mU("h1",uy),mU("h2",uy),mU("h3",uy),mU("h4",uy),mU("h5",uy);var mH=mU("h6",uy);mU("blockquote",ug),mU("code",um),mU("pre",uv),mU("label",c1),mU("ol",ub),mU("ul",ub);var mV=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.title,r=e.titleId;return null==n?v.createElement("li",{className:l(sk)(sP.MENU_DIVIDER,t),role:"separator"}):v.createElement("li",{className:l(sk)(sP.MENU_HEADER,t),role:"separator"},v.createElement(mH,{id:r},n))},t.displayName="".concat(pa,".MenuDivider"),t}(v.Component),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),py=h("leH9B"),mq=v.forwardRef(function(e,t){var n=e.size>=py.IconSize.LARGE,r=n?py.IconSize.LARGE:py.IconSize.STANDARD,i="".concat(-1*r/.05/2);return v.createElement(pS,(0,sO.__assign)({iconName:"caret-right",ref:t},e),v.createElement("path",{d:n?"M280 200C280 206.2 277 211.4 272.6 215.2L272.8 215.4L152.8 315.4L152.6 315.2C149.2 318 144.8 320 140 320C129 320 120 311 120 300V100C120 89 129 80 140 80C144.8 80 149.2 82 152.6 84.8L152.8 84.6L272.8 184.6L272.6 184.8C277 188.6 280 193.8 280 200z":"M220 160C220 163 218.6 165.6 216.6 167.4L216.6 167.4L136.6 237.4L136.6 237.4C134.8 239 132.6 240 130 240C124.4 240 120 235.6 120 230V90C120 84.4 124.4 80 130 80C132.6 80 134.8 81 136.6 82.6C136.6 82.6 136.6 82.6 136.6 82.6L216.6 152.6L216.6 152.6C218.6 154.4 220 157 220 160z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")")}))});mq.defaultProps={size:py.IconSize.STANDARD},mq.displayName="Blueprint5.Icon.CaretRight";var sO=h("gztBd"),v=h("8NFma"),py=h("leH9B"),mG=v.forwardRef(function(e,t){var n=e.size>=py.IconSize.LARGE,r=n?py.IconSize.LARGE:py.IconSize.STANDARD,i="".concat(-1*r/.05/2);return v.createElement(pS,(0,sO.__assign)({iconName:"small-tick",ref:t},e),v.createElement("path",{d:n?"M300 300C294.4000000000001 300 289.4000000000001 297.8 285.8 294.2L160 168.2L114.2 214.2C110.6 217.8 105.6 220 100 220C89 220 80 211 80 200C80 194.4 82.2 189.4 85.8 185.8L145.8 125.8C149.4 122.2 154.4 120 160 120S170.6 122.2 174.2 125.8L314.2000000000001 265.8C317.8 269.4 320 274.4 320 280C320 291 311 300 300 300z":"M240 220C234.4 220 229.4 217.8 225.8 214.2L140 128.2L94.2 174.2C90.6 177.8 85.6 180 80 180C69 180 60 171 60 160C60 154.4 62.2 149.4 65.8 145.8L125.8 85.8C129.4 82.2 134.4 80 140 80S150.6 82.2 154.2 85.8L254.2 185.8C257.8 189.4 260 194.4 260 200C260 211 251 220 240 220z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")")}))});mG.defaultProps={size:py.IconSize.STANDARD},mG.displayName="Blueprint5.Icon.SmallTick";var mW=v.forwardRef(function(e,t){var n,r,i=e.active,o=e.className,a=e.children,s=e.disabled,u=e.icon,c=e.intent,d=e.labelClassName,h=e.labelElement,f=e.multiline,p=e.popoverProps,g=e.roleStructure,m=void 0===g?"menuitem":g,y=e.selected,b=e.shouldDismissPopover,w=e.submenuProps,x=e.text,_=e.textClassName,E=e.tagName,S=e.htmlTitle,C=(0,sO.__rest)(e,["active","className","children","disabled","icon","intent","labelClassName","labelElement","multiline","popoverProps","roleStructure","selected","shouldDismissPopover","submenuProps","text","textClassName","tagName","htmlTitle"]),O="listoption"===m?["option",void 0,!!y]:"menuitem"===m?["none","menuitem",void 0]:"none"===m?["none",void 0,void 0]:[void 0,void 0,void 0],k=O[0],P=O[1],T=O[2],A="listoption"===m,N=A&&y,j=null!=u,R=null!=a,I=sP.intentClass(c),L=l(sk)(sP.MENU_ITEM,I,((n={})[sP.ACTIVE]=i,n[sP.DISABLED]=s,n[sP.POPOVER_DISMISS]=b&&!s&&!R,n[sP.MENU_ITEM_IS_SELECTABLE]=A,n[sP.SELECTED]=N,n),o),M=null==e.label&&null==h?null:v.createElement("span",{className:l(sk)(sP.MENU_ITEM_LABEL,d)},e.label,h),D=v.createElement(void 0===E?"a":E,(0,sO.__assign)((0,sO.__assign)((0,sO.__assign)({onKeyDown:fv(["Enter"," "]),role:R?"none":P,tabIndex:R?-1:0},ps(C)),s?mK:{}),{className:L}),N?v.createElement(mG,{className:sP.MENU_ITEM_SELECTED_ICON}):void 0,j?v.createElement("span",{className:sP.MENU_ITEM_ICON},v.createElement(pC,{icon:u,"aria-hidden":!0,tabIndex:-1})):void 0,v.createElement(pT,{className:l(sk)(sP.FILL,_),ellipsize:!f,title:S},x),M,R?v.createElement(mq,{className:sP.MENU_SUBMENU_ICON,title:"Open sub menu"}):void 0),F=l(sk)(((r={})[sP.MENU_SUBMENU]=R,r));return v.createElement("li",{className:F,ref:t,role:k,"aria-selected":T},null==a?D:v.createElement(mw,(0,sO.__assign)({autoFocus:!1,captureDismiss:!1,disabled:s,enforceFocus:!1,hoverCloseDelay:0,interactionKind:"hover",modifiers:m$,targetProps:{role:P,tabIndex:0},placement:"right-start",usePortal:!1},p,{content:v.createElement(mB,(0,sO.__assign)({},w),a),minimal:!0,popoverClassName:l(sk)(sP.MENU_SUBMENU,null==p?void 0:p.popoverClassName)}),D))});mW.defaultProps={active:!1,disabled:!1,multiline:!1,popoverProps:{},selected:void 0,shouldDismissPopover:!0,text:""},mW.displayName="".concat(pa,".MenuItem");var m$={flip:{options:{rootBoundary:"viewport",padding:20},enabled:!0},offset:{options:{offset:[-5,0]},enabled:!0},preventOverflow:{options:{rootBoundary:"viewport",padding:20},enabled:!0}},mK={"aria-disabled":!0,href:void 0,onClick:void 0,onMouseDown:void 0,onMouseEnter:void 0,onMouseLeave:void 0,tabIndex:-1};let mY=P(({store:e})=>{let t=e.selectedElements.length>0,n=e.selectedElementsIds,r=e.selectedElements.every(e=>e.draggable),i=!e.selectedElements.some(e=>"group"===e.type)&&r;i&&e.selectedElements.length;let o=i&&e.selectedElements.length>1;return(0,p.jsx)(mw,{disabled:!t,content:(0,p.jsxs)(mB,{style:{width:"280px"},children:[(0,p.jsx)(mV,{title:sy("toolbar.layering")}),(0,p.jsxs)("div",{style:{display:"flex"},children:[(0,p.jsxs)("div",{style:{width:"50%"},children:[(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"chevron-up",text:sy("toolbar.up"),disabled:!e.activePage?.canMoveElementsUp(n),onClick:()=>{e.activePage?.moveElementsUp(n)}}),(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"double-chevron-up",text:sy("toolbar.toForward"),disabled:!e.activePage?.canMoveElementsTop(n),onClick:()=>{e.activePage?.moveElementsTop(n)}})]}),(0,p.jsxs)("div",{style:{width:"50%"},children:[(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"chevron-down",text:sy("toolbar.down"),disabled:!e.activePage?.canMoveElementsDown(n),onClick:()=>{e.activePage?.moveElementsDown(n)}}),(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"double-chevron-down",text:sy("toolbar.toBottom"),disabled:!e.activePage?.canMoveElementsBottom(n),onClick:()=>{e.activePage?.moveElementsBottom(n)}})]})]}),i&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(mV,{title:sy("toolbar.position")}),(0,p.jsxs)("div",{style:{display:"flex"},children:[(0,p.jsxs)("div",{style:{width:"50%"},children:[(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"alignment-left",text:sy("toolbar.alignLeft"),onClick:()=>{let t=e.activePage?.computedWidth;e.selectedElements.forEach(e=>{t=Math.min(t,ac(e).x)}),1===e.selectedElements.length&&(t=0),e.selectedElements.forEach(e=>{let n=ac(e);e.set({x:e.x-n.x+t})})}}),(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"alignment-vertical-center",text:sy("toolbar.alignCenter"),onClick:()=>{let t=e.activePage?.computedWidth,n=0;e.selectedElements.forEach(e=>{let r=ac(e);t=Math.min(t,r.x),n=Math.max(n,r.x+r.width)});let r=(n+t)/2;1===e.selectedElements.length&&(r=e.activePage?.computedWidth/2),e.selectedElements.forEach(e=>{let t=ac(e),n=e.x-t.x;e.set({x:r+n-t.width/2})})}}),(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"alignment-right",text:sy("toolbar.alignRight"),onClick:()=>{let t=0;e.selectedElements.forEach(e=>{let n=ac(e);t=Math.max(t,n.x+n.width)}),1===e.selectedElements.length&&(t=e.activePage?.computedWidth),e.selectedElements.forEach(e=>{let n=ac(e);e.set({x:e.x-n.x+t-n.width})})}})]}),(0,p.jsxs)("div",{style:{width:"50%"},children:[(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"alignment-top",text:sy("toolbar.alignTop"),onClick:()=>{let t=e.activePage?.computedHeight;e.selectedElements.forEach(e=>{t=Math.min(t,ac(e).y)}),1===e.selectedElements.length&&(t=0),e.selectedElements.forEach(e=>{let n=ac(e);e.set({y:e.y-n.y+t})})}}),(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"alignment-horizontal-center",text:sy("toolbar.alignMiddle"),onClick:()=>{let t=e.activePage?.computedHeight,n=0;e.selectedElements.forEach(e=>{let r=ac(e);t=Math.min(t,r.y),n=Math.max(n,r.y+r.height)});let r=(n+t)/2;1===e.selectedElements.length&&(r=e.activePage?.computedHeight/2),e.selectedElements.forEach(e=>{let t=ac(e),n=e.y-t.y;e.set({y:r+n-t.height/2})})}}),(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"alignment-bottom",text:sy("toolbar.alignBottom"),onClick:()=>{let t=0;e.selectedElements.forEach(e=>{let n=ac(e);t=Math.max(t,n.y+n.height)}),1===e.selectedElements.length&&(t=e.activePage?.computedHeight),e.selectedElements.forEach(e=>{let n=ac(e);e.set({y:e.y-n.y+t-n.height})})}})]})]})]}),o&&(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(mV,{title:sy("toolbar.spaceEvenly")}),(0,p.jsxs)("div",{style:{display:"flex"},children:[(0,p.jsxs)("div",{style:{width:"50%"},children:[" ",(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"vertical-distribution",text:sy("toolbar.verticalDistribution"),onClick:()=>{let t=e.activePage?.computedHeight,n=0,r=0;e.selectedElements.forEach(e=>{let i=ac(e);t=Math.min(t,i.y),n=Math.max(n,i.y+i.height),r+=i.height});let i=(n-t-r)/(e.selectedElements.length-1),o=e.selectedElements.slice().sort((e,t)=>{let n=ac(e),r=ac(t);return n.y-r.y}),a=0;o.forEach(e=>{let n=ac(e);e.set({y:e.y-n.y+t+a}),a+=n.height+i})}})]}),(0,p.jsx)("div",{style:{width:"50%"},children:(0,p.jsx)(mW,{shouldDismissPopover:!1,icon:"horizontal-distribution",text:sy("toolbar.horizontalDistribution"),onClick:()=>{let t=e.activePage?.computedWidth,n=0,r=0;e.selectedElements.forEach(e=>{let i=ac(e);t=Math.min(t,i.x),n=Math.max(n,i.x+i.width),r+=i.width});let i=(n-t-r)/(e.selectedElements.length-1),o=e.selectedElements.slice().sort((e,t)=>{let n=ac(e),r=ac(t);return n.x-r.x}),a=0;o.forEach(e=>{let n=ac(e);e.set({x:e.x-n.x+t+a}),a+=n.width+i})}})})]})]})]}),children:(0,p.jsx)(pA,{icon:"layers",minimal:!0,text:sy("toolbar.position"),disabled:!t})})});function mX(e,t){return e.classList.contains(t)?e:e.parentElement?mX(e.parentElement,t):null}let mZ=P(({store:e,page:t,components:n,stageRef:r})=>{let i=ad(e.selectedShapes),o=e.selectedShapes.every(e=>e.page===t),a=l(v).useRef(null),[s,u]=l(v).useState(!1),c=e._hasCroppedImages;l(v).useEffect(()=>{let e=()=>{u(!0)},t=()=>{u(!1)};r?.current?.on("dragstart",e),r?.current?.on("dragend",t);let n=r?.current?.findOne("Transformer");return n?.on("transformstart",e),n?.on("transformend",t),()=>{r?.current?.off("dragstart",e),r?.current?.off("dragend",t),n?.off("transformstart",e),n?.off("transformend",t)}},[]);let[d,h]=l(v).useState({fit:!0,needCalculate:!1,token:Math.random()});if(l(v).useEffect(()=>{0!==e.selectedElements.length&&h({fit:!0,needCalculate:!0,token:Math.random()})},[e.selectedElements,s]),l(v).useEffect(()=>{setTimeout(()=>{if(!a.current||!d.needCalculate)return;let e=mX(a.current,"polotno-workspace-container");if(!e)return;let t=e.getBoundingClientRect(),n=a.current.getBoundingClientRect();n.right,t.left;let r=n.top-t.top;n.left,t.left;let i=n.bottom-t.top;r<20&&d.fit&&h({fit:!1,needCalculate:!1,token:d.token}),i-t.height>-20&&!d.fit&&h({fit:!0,needCalculate:!1,token:d.token})},10)},[d.needCalculate,a.current,d.token]),l(v).useEffect(()=>{let t=mX(r.current.content,"polotno-workspace-inner"),n=()=>{e.selectedElements.length&&h({fit:!0,needCalculate:!0,token:Math.random()})};return t?.addEventListener("scroll",n),()=>{t?.removeEventListener("scroll",n)}},[]),0===e.selectedShapes.length||s||!o||e.activePage!==t||c)return null;let f=n?.Position||mY,g=n?.Duplicate||mF,m=n?.Remove||mz,y=mM({components:n,type:e.selectedElements[0].type,usedItems:[]}),b=r?.current?.findOne("Transformer")?.rotation()||0,w=30;return 5>Math.abs(b)&&d.fit&&(w=80),Math.abs(b)>160&&!d.fit&&(w=80),(0,p.jsx)(r3,{transformFunc:e=>{let t=i.x+i.width/2,n=d.fit?i.y*e.scaleY-w:i.y*e.scaleY+i.height*e.scaleY+w;return{...e,x:e.x+t*e.scaleX,y:e.y+n,scaleX:1,scaleY:1}},divProps:{style:{pointerEvents:"none"}},children:(0,p.jsx)("div",{ref:a,style:{pointerEvents:"none"},children:(0,p.jsx)(mA,{style:{padding:"2px",borderRadius:"5px",height:"34px",transform:"translate(-50%, -50%)",pointerEvents:"auto"},children:(0,p.jsxs)(mP,{style:{height:"30px"},children:[y.map(t=>{let r=n[t];return(0,p.jsx)(r,{elements:e.selectedElements,element:e.selectedElements[0],store:e},t)}),(0,p.jsx)(g,{store:e}),(0,p.jsx)(m,{store:e}),(0,p.jsx)(f,{store:e})]})})})})});var mQ=({components:e,...t})=>((e=e||{}).PageControls=e.PageControls??mO,e.Tooltip=e.Tooltip??mZ,(0,p.jsx)(sC,{...t,components:e})),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),mJ=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.tagName,r=(0,sO.__rest)(e,["className","tagName"]),i=l(sk)(cr,t);return v.createElement(void 0===n?"div":n,(0,sO.__assign)((0,sO.__assign)({},r),{className:i}))},t.displayName="".concat(pa,".Divider"),t}(pO);h("8NFma");let m0=P(({store:e})=>(0,p.jsxs)(mA.Group,{align:sT.LEFT,children:[(0,p.jsx)(pA,{icon:"undo",minimal:!0,onClick:()=>{e.history.undo()},disabled:!e.history.canUndo}),(0,p.jsx)(pA,{icon:"redo",minimal:!0,onClick:()=>{e.history.redo()},disabled:!e.history.canRedo})]}));var v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),m1=v.forwardRef(function(e,t){var n,r=e.alignText,i=e.className,o=e.fill,a=e.minimal,s=e.large,u=e.vertical,c=(0,sO.__rest)(e,["alignText","className","fill","minimal","large","vertical"]),d=l(sk)(sP.BUTTON_GROUP,((n={})[sP.FILL]=o,n[sP.LARGE]=s,n[sP.MINIMAL]=a,n[sP.VERTICAL]=u,n),sP.alignmentClass(r),i);return v.createElement("div",(0,sO.__assign)({},c,{ref:t,className:d}),e.children)});m1.displayName="".concat(pa,".ButtonGroup");var sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),m2=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.state={hasPendingUpdate:!1,isComposing:!1,nextValue:n.props.value,value:n.props.value},n.cancelPendingCompositionEnd=null,n.handleCompositionStart=function(e){var t,r,i;null===(t=n.cancelPendingCompositionEnd)||void 0===t||t.call(n),n.setState({isComposing:!0}),null===(i=(r=n.props).onCompositionStart)||void 0===i||i.call(r,e)},n.handleCompositionEnd=function(e){var r,i;n.cancelPendingCompositionEnd=n.setTimeout(function(){return n.setState({isComposing:!1})},t.COMPOSITION_END_DELAY),null===(i=(r=n.props).onCompositionEnd)||void 0===i||i.call(r,e)},n.handleChange=function(e){var t,r,i=e.target.value;n.setState({nextValue:i}),null===(r=(t=n.props).onChange)||void 0===r||r.call(t,e)},n}return(0,sO.__extends)(t,e),t.getDerivedStateFromProps=function(e,t){return t.isComposing||void 0===e.value?null:t.nextValue!==t.value?e.value===t.nextValue?t.hasPendingUpdate?{value:e.value,hasPendingUpdate:!1}:{value:t.nextValue}:e.value===t.value?{hasPendingUpdate:!0}:{value:e.value,nextValue:e.value,hasPendingUpdate:!1}:{value:e.value,nextValue:e.value,hasPendingUpdate:!1}},t.prototype.render=function(){var e=this.state,t=e.isComposing,n=e.hasPendingUpdate,r=e.value,i=e.nextValue,o=this.props,a=o.inputRef,l=(0,sO.__rest)(o,["inputRef"]);return v.createElement("input",(0,sO.__assign)({},l,{ref:a,value:t||n?i:r,onCompositionStart:this.handleCompositionStart,onCompositionEnd:this.handleCompositionEnd,onChange:this.handleChange}))},t.displayName="".concat(pa,".AsyncControllableInput"),t.COMPOSITION_END_DELAY=10,t}(pO),m3=["onValueChange"],m5=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={},t.leftElement=null,t.rightElement=null,t.refHandlers={leftElement:function(e){return t.leftElement=e},rightElement:function(e){return t.rightElement=e}},t.handleInputChange=function(e){var n,r,i,o,a=e.target.value;null===(r=(n=t.props).onChange)||void 0===r||r.call(n,e),null===(o=(i=t.props).onValueChange)||void 0===o||o.call(i,a,e.target)},t}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e,t=this.props,n=t.asyncControl,r=t.className,i=t.disabled,o=t.fill,a=t.inputClassName,s=t.inputRef,u=t.intent,c=t.large,d=t.readOnly,h=t.round,f=t.small,p=t.tagName,g=l(sk)(sP.INPUT_GROUP,sP.intentClass(u),((e={})[sP.DISABLED]=i,e[sP.READ_ONLY]=d,e[sP.FILL]=o,e[sP.LARGE]=c,e[sP.SMALL]=f,e[sP.ROUND]=h,e),r),m=(0,sO.__assign)((0,sO.__assign)({},this.props.style),{paddingLeft:this.state.leftElementWidth,paddingRight:this.state.rightElementWidth}),y=(0,sO.__assign)((0,sO.__assign)({type:"text"},ps(this.props,m3,!0)),{"aria-disabled":i,className:l(sk)(sP.INPUT,a),onChange:this.handleInputChange,style:m}),b=void 0!==n&&n?v.createElement(m2,(0,sO.__assign)({},y,{inputRef:s})):v.createElement("input",(0,sO.__assign)({},y,{ref:s}));return v.createElement(void 0===p?"div":p,{className:g},this.maybeRenderLeftElement(),b,this.maybeRenderRightElement())},t.prototype.componentDidMount=function(){this.updateInputWidth()},t.prototype.componentDidUpdate=function(e){var t=this.props,n=t.leftElement,r=t.rightElement;(e.leftElement!==n||e.rightElement!==r)&&this.updateInputWidth()},t.prototype.validateProps=function(e){null!=e.leftElement&&null!=e.leftIcon&&console.warn(f_)},t.prototype.maybeRenderLeftElement=function(){var e=this.props,t=e.leftElement,n=e.leftIcon;return null!=t?v.createElement("span",{className:sP.INPUT_LEFT_CONTAINER,ref:this.refHandlers.leftElement},t):null!=n?v.createElement(pC,{icon:n,"aria-hidden":!0,tabIndex:-1}):void 0},t.prototype.maybeRenderRightElement=function(){var e=this.props.rightElement;if(null!=e)return v.createElement("span",{className:sP.INPUT_ACTION,ref:this.refHandlers.rightElement},e)},t.prototype.updateInputWidth=function(){var e=this.state,t=e.leftElementWidth,n=e.rightElementWidth;if(null!=this.leftElement){var r=this.leftElement.clientWidth;(void 0===t||Math.abs(r-t)>2)&&this.setState({leftElementWidth:r})}else this.setState({leftElementWidth:void 0});if(null!=this.rightElement){var r=this.rightElement.clientWidth;(void 0===n||Math.abs(r-n)>2)&&this.setState({rightElementWidth:r})}else this.setState({rightElementWidth:void 0})},t.displayName="".concat(pa,".InputGroup"),t}(pO),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),py=h("leH9B"),m6=v.forwardRef(function(e,t){var n=e.size>=py.IconSize.LARGE,r=n?py.IconSize.LARGE:py.IconSize.STANDARD,i="".concat(-1*r/.05/2);return v.createElement(pS,(0,sO.__assign)({iconName:"chevron-down",ref:t},e),v.createElement("path",{d:n?"M320 280C314.4000000000001 280 309.4000000000001 277.8 305.8 274.2L200 168.2L94.2 274.2C90.6 277.8 85.6 280 80 280C69 280 60 271 60 260C60 254.4 62.2 249.4 65.8 245.8L185.8 125.8C189.4 122.2 194.4 120 200 120S210.6 122.2 214.2 125.8L334.2000000000001 245.8C337.8 249.4 340 254.4 340 260C340 271 331 280 320 280z":"M240 220C234.4 220 229.4 217.8 225.8 214.2L160 148.2L94.2 214.2C90.6 217.8 85.6 220 80 220C69 220 60 211 60 200C60 194.4 62.2 189.4 65.8 185.8L145.8 105.8C149.4 102.2 154.4 100 160 100S170.6 102.2 174.2 105.8L254.2 185.8C257.8 189.4 260 194.4 260 200C260 211 251 220 240 220z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")")}))});m6.defaultProps={size:py.IconSize.STANDARD},m6.displayName="Blueprint5.Icon.ChevronDown";var sO=h("gztBd"),v=h("8NFma"),py=h("leH9B"),m4=v.forwardRef(function(e,t){var n=e.size>=py.IconSize.LARGE,r=n?py.IconSize.LARGE:py.IconSize.STANDARD,i="".concat(-1*r/.05/2);return v.createElement(pS,(0,sO.__assign)({iconName:"chevron-up",ref:t},e),v.createElement("path",{d:n?"M334.2000000000001 154.2L214.2 274.2000000000001C210.6 277.8 205.6 280 200 280S189.4 277.8 185.8 274.2L65.8 154.2C62.2 150.6 60 145.6 60 140C60 129 69 120 80 120C85.6 120 90.6 122.2 94.2 125.8L200 231.8L305.8 126C309.4000000000001 122.2 314.4000000000001 120 320 120C331 120 340 129 340 140C340 145.6 337.8 150.6 334.2000000000001 154.2z":"M254.2 134.2L174.2 214.2C170.6 217.8 165.6 220 160 220S149.4 217.8 145.8 214.2L65.8 134.2C62.2 130.6 60 125.6 60 120C60 109 69 100 80 100C85.6 100 90.6 102.2 94.2 105.8L160 171.8L225.8 106C229.4 102.2 234.4 100 240 100C251 100 260 109 260 120C260 125.6 257.8 130.6 254.2 134.2z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")")}))});m4.defaultProps={size:py.IconSize.STANDARD},m4.displayName="Blueprint5.Icon.ChevronUp";var sO=h("gztBd"),v=h("8NFma"),m8=v.forwardRef(function(e,t){var n,r=e.children,i=e.className,o=e.fill,a=e.vertical,s=(0,sO.__rest)(e,["children","className","fill","vertical"]),u=l(sk)(sP.CONTROL_GROUP,((n={})[sP.FILL]=o,n[sP.VERTICAL]=a,n),i);return v.createElement("div",(0,sO.__assign)({},s,{ref:t,className:u}),r)});function m9(e){var t=1.9.toLocaleString(e),n=1..toLocaleString(e),r=9..toLocaleString(e),i=new RegExp("".concat(n,"(.+)").concat(r)).exec(t);return i&&i[1]||"."}function m7(e,t){return void 0===t&&(t="en-US"),vn(e.toLocaleString(t,{roundingPriority:"morePrecision"}),t)}function ve(e,t){var n=""+e;if(parseFloat(n).toString()===e.toString())return e.toString();if(void 0!==t){var r=m9(t);return vn(n,t).split("").map(function(e){var n;return -1!==(n=[0,1,2,3,4,5,6,7,8,9].map(function(e){return e.toLocaleString(t)}).indexOf(e))?n:e}).join("").replace(r,".")}return e.toString()}function vt(e,t){if(void 0===t)return/^[Ee0-9\+\-\.]$/.test(e);var n=m9(t).replace(".","\\.");return RegExp("^[Ee"+[0,1,2,3,4,5,6,7,8,9].map(function(e){return e.toLocaleString(t)}).join("")+"\\+\\-"+n+"]$").test(e)}function vn(e,t){return e.replace(/[\uFF10-\uFF19]/g,function(e){return String.fromCharCode(e.charCodeAt(0)-65248)}).split("").filter(function(e){return vt(e,t)}).join("")}m8.displayName="".concat(pa,".ControlGroup"),(Pa=PI||(PI={}))[Pa.DOWN=-1]="DOWN",Pa[Pa.UP=1]="UP";var vr=["allowNumericCharactersOnly","buttonPosition","clampValueOnBlur","className","defaultValue","majorStepSize","minorStepSize","onButtonClick","onValueChange","selectAllOnFocus","selectAllOnIncrement","stepSize"],vi=function(e){function t(){var n,r,i=e.apply(this,arguments)||this;return i.numericInputId=fe.uniqueId("numericInput"),i.state={currentImeInputInvalid:!1,shouldSelectAfterUpdate:!1,stepMaxPrecision:t.getStepMaxPrecision(i.props),value:(void 0===(n=null!==(r=i.props.value)&&void 0!==r?r:i.props.defaultValue)&&(n=""),n.toString())},i.didPasteEventJustOccur=!1,i.delta=0,i.inputElement=null,i.inputRef=po(i,"inputElement",i.props.inputRef),i.incrementButtonHandlers=i.getButtonEventHandlers(PI.UP),i.decrementButtonHandlers=i.getButtonEventHandlers(PI.DOWN),i.getCurrentValueAsNumber=function(){return Number(ve(i.state.value,i.props.locale))},i.handleButtonClick=function(e,t){var n,r,o=i.updateDelta(t,e),a=i.incrementValue(o);null===(r=(n=i.props).onButtonClick)||void 0===r||r.call(n,Number(ve(a,i.props.locale)),a)},i.stopContinuousChange=function(){i.delta=0,i.clearTimeouts(),clearInterval(i.intervalId),document.removeEventListener("mouseup",i.stopContinuousChange)},i.handleContinuousChange=function(){if(void 0!==i.props.min||void 0!==i.props.max){var e,t,n,r,o=null!==(e=i.props.min)&&void 0!==e?e:-1/0,a=null!==(t=i.props.max)&&void 0!==t?t:1/0,l=i.getCurrentValueAsNumber();if(l<=o||l>=a){i.stopContinuousChange();return}}var s=i.incrementValue(i.delta);null===(r=(n=i.props).onButtonClick)||void 0===r||r.call(n,Number(ve(s,i.props.locale)),s)},i.handleInputFocus=function(e){var t,n;i.setState({shouldSelectAfterUpdate:i.props.selectAllOnFocus}),null===(n=(t=i.props).onFocus)||void 0===n||n.call(t,e)},i.handleInputBlur=function(e){var t,n;if(i.setState({shouldSelectAfterUpdate:!1}),i.props.clampValueOnBlur){var r=e.target.value;i.handleNextValue(i.roundAndClampValue(r))}null===(n=(t=i.props).onBlur)||void 0===n||n.call(t,e)},i.handleInputKeyDown=function(e){if(!i.props.disabled&&!i.props.readOnly){if("ArrowUp"===e.key?r=PI.UP:"ArrowDown"===e.key&&(r=PI.DOWN),void 0!==r){e.preventDefault();var t,n,r,o=i.updateDelta(r,e);i.incrementValue(o)}null===(n=(t=i.props).onKeyDown)||void 0===n||n.call(t,e)}},i.handleCompositionEnd=function(e){i.props.allowNumericCharactersOnly&&(i.handleNextValue(vn(e.data,i.props.locale)),i.setState({currentImeInputInvalid:!1}))},i.handleCompositionUpdate=function(e){if(i.props.allowNumericCharactersOnly){var t=e.data;0===vn(t,i.props.locale).length&&t.length>0?i.setState({currentImeInputInvalid:!0}):i.setState({currentImeInputInvalid:!1})}},i.handleInputKeyPress=function(e){var t,n,r;i.props.allowNumericCharactersOnly&&(r=i.props.locale,!(null==e.key||e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||vt(e.key,r)))&&e.preventDefault(),null===(n=(t=i.props).onKeyPress)||void 0===n||n.call(t,e)},i.handleInputPaste=function(e){var t,n;i.didPasteEventJustOccur=!0,null===(n=(t=i.props).onPaste)||void 0===n||n.call(t,e)},i.handleInputChange=function(e){var t=e;i.props.allowNumericCharactersOnly&&i.didPasteEventJustOccur&&(i.didPasteEventJustOccur=!1,t=vn(e,i.props.locale)),i.handleNextValue(t),i.setState({shouldSelectAfterUpdate:!1})},i}return(0,sO.__extends)(t,e),t.getDerivedStateFromProps=function(e,n){var r,i,o={prevMaxProp:e.max,prevMinProp:e.min},a=e.min!==n.prevMinProp,l=e.max!==n.prevMaxProp,s=null!==(i=null===(r=e.value)||void 0===r?void 0:r.toString())&&void 0!==i?i:n.value,u=t.getStepMaxPrecision(e),c=s!==t.VALUE_EMPTY?t.roundAndClampValue(s,u,e.min,e.max,0,e.locale):t.VALUE_EMPTY;return(a||l)&&c!==n.value?(0,sO.__assign)((0,sO.__assign)({},o),{stepMaxPrecision:u,value:c}):(0,sO.__assign)((0,sO.__assign)({},o),{stepMaxPrecision:u,value:s})},t.getStepMaxPrecision=function(e){return null!=e.minorStepSize?fe.countDecimalPlaces(e.minorStepSize):fe.countDecimalPlaces(e.stepSize)},t.roundAndClampValue=function(e,n,r,i,o,a){var l,s;return(void 0===o&&(o=0),l=ve(e,a),null!=e&&l-parseFloat(l)+1>=0)?m7(f0(Math.round((Number(ve(e,a))+o)*(s=Math.pow(10,n)))/s,null!=r?r:-1/0,null!=i?i:1/0),a):t.VALUE_EMPTY},t.prototype.render=function(){var e,t=this.props,n=t.buttonPosition,r=t.className,i=t.fill,o=t.large,a=t.small,s=l(sk)(sP.NUMERIC_INPUT,((e={})[sP.LARGE]=o,e[sP.SMALL]=a,e),r),u=this.renderButtons();return v.createElement(m8,{className:s,fill:i},n===sj.LEFT&&u,this.renderInput(),n===sj.RIGHT&&u)},t.prototype.componentDidUpdate=function(n,r){e.prototype.componentDidUpdate.call(this,n,r),n.inputRef!==this.props.inputRef&&(pn(n.inputRef,null),this.inputRef=po(this,"inputElement",this.props.inputRef),pn(this.props.inputRef,this.inputElement)),this.state.shouldSelectAfterUpdate&&(null===(i=this.inputElement)||void 0===i||i.setSelectionRange(0,this.state.value.length));var i,o,a,l=this.props.min!==n.min,s=this.props.max!==n.max,u=this.props.locale!==n.locale,c=this.state.value!==r.value;if((l||s)&&c||u&&r.value!==t.VALUE_EMPTY){var d=ve(u?r.value:this.state.value,n.locale),h=m7(+d,this.props.locale);null===(a=(o=this.props).onValueChange)||void 0===a||a.call(o,+d,h,this.inputElement)}},t.prototype.validateProps=function(e){var n=e.majorStepSize,r=e.max,i=e.min,o=e.minorStepSize,a=e.stepSize,l=e.value;if(null!=i&&null!=r&&i>r&&console.error(fE),a<=0&&console.error(fP),o&&o<=0&&console.error(fO),n&&n<=0&&console.error(fk),o&&o>a&&console.error(fS),n&&n<a&&console.error(fC),null!=l){var s=t.getStepMaxPrecision(e),u=t.roundAndClampValue(l.toString(),s,i,r,0,this.props.locale),c=u!==l.toString(),d=m7(Number(ve(l,this.props.locale)),this.props.locale);c&&u!==d&&console.warn(fT)}},t.prototype.renderButtons=function(){var e=this.props,t=e.intent,n=e.max,r=e.min,i=e.locale,o=ve(this.state.value,i),a=this.props.disabled||this.props.readOnly;return v.createElement(m1,{className:sP.FIXED,key:"button-group",vertical:!0},v.createElement(pA,(0,sO.__assign)({"aria-label":"increment","aria-controls":this.numericInputId,disabled:a||void 0!==n&&""!==o&&+o>=n,icon:v.createElement(m4,null),intent:t},this.incrementButtonHandlers)),v.createElement(pA,(0,sO.__assign)({"aria-label":"decrement","aria-controls":this.numericInputId,disabled:a||void 0!==r&&""!==o&&+o<=r,icon:v.createElement(m6,null),intent:t},this.decrementButtonHandlers)))},t.prototype.renderInput=function(){var e=ps(this.props,vr,!0),t=this.getCurrentValueAsNumber();return v.createElement(m5,(0,sO.__assign)({asyncControl:this.props.asyncControl,autoComplete:"off",id:this.numericInputId,role:this.props.allowNumericCharactersOnly?"spinbutton":void 0},e,{"aria-valuemax":this.props.max,"aria-valuemin":this.props.min,"aria-valuenow":t,intent:this.state.currentImeInputInvalid?sN.DANGER:this.props.intent,inputClassName:this.props.inputClassName,inputRef:this.inputRef,large:this.props.large,leftElement:this.props.leftElement,leftIcon:this.props.leftIcon,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,onCompositionEnd:this.handleCompositionEnd,onCompositionUpdate:this.handleCompositionUpdate,onKeyDown:this.handleInputKeyDown,onKeyPress:this.handleInputKeyPress,onPaste:this.handleInputPaste,onValueChange:this.handleInputChange,rightElement:this.props.rightElement,small:this.props.small,value:this.state.value}))},t.prototype.getButtonEventHandlers=function(e){var t=this;return{onKeyDown:function(n){!t.props.disabled&&fe.isKeyboardClick(n)&&t.handleButtonClick(n,e)},onMouseDown:function(n){t.props.disabled||(t.handleButtonClick(n,e),t.startContinuousChange())}}},t.prototype.startContinuousChange=function(){var e=this;document.addEventListener("mouseup",this.stopContinuousChange),this.setTimeout(function(){e.intervalId=window.setInterval(e.handleContinuousChange,t.CONTINUOUS_CHANGE_INTERVAL)},t.CONTINUOUS_CHANGE_DELAY)},t.prototype.handleNextValue=function(e){var t,n;null==this.props.value&&this.setState({value:e}),null===(n=(t=this.props).onValueChange)||void 0===n||n.call(t,Number(ve(e,this.props.locale)),e,this.inputElement)},t.prototype.incrementValue=function(e){var n=this.state.value===t.VALUE_EMPTY?t.VALUE_ZERO:this.state.value,r=this.roundAndClampValue(n,e);return r!==this.state.value&&(this.handleNextValue(r),this.setState({shouldSelectAfterUpdate:this.props.selectAllOnIncrement})),r},t.prototype.getIncrementDelta=function(e,t,n){var r=this.props,i=r.majorStepSize,o=r.minorStepSize,a=r.stepSize;return t&&null!=i?e*i:n&&null!=o?e*o:e*a},t.prototype.roundAndClampValue=function(e,n){return void 0===n&&(n=0),t.roundAndClampValue(e,this.state.stepMaxPrecision,this.props.min,this.props.max,n,this.props.locale)},t.prototype.updateDelta=function(e,t){return this.delta=this.getIncrementDelta(e,t.shiftKey,t.altKey),this.delta},t.displayName="".concat(pa,".NumericInput"),t.VALUE_EMPTY="",t.VALUE_ZERO="0",t.defaultProps={allowNumericCharactersOnly:!0,buttonPosition:sj.RIGHT,clampValueOnBlur:!1,defaultValue:t.VALUE_EMPTY,large:!1,majorStepSize:10,minorStepSize:.1,selectAllOnFocus:!1,selectAllOnIncrement:!1,small:!1,stepSize:1},t.CONTINUOUS_CHANGE_DELAY=300,t.CONTINUOUS_CHANGE_INTERVAL=100,t}(pO),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma");function vo(e){return"".concat((100*e).toFixed(2),"%")}function va(e,t,n,r){for(var i=t<n?1:-1,o=t;o!==n+i;o+=i)e[o]=r}var vl=["max","min","stepSize","tickSize","value"],vs=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={isMoving:!1},t.handleElement=null,t.refHandlers={handle:function(e){return t.handleElement=e}},t.beginHandleMovement=function(e){document.addEventListener("mousemove",t.handleHandleMovement),document.addEventListener("mouseup",t.endHandleMovement),t.setState({isMoving:!0}),t.changeValue(t.clientToValue(t.mouseEventClientOffset(e)))},t.beginHandleTouchMovement=function(e){document.addEventListener("touchmove",t.handleHandleTouchMovement),document.addEventListener("touchend",t.endHandleTouchMovement),document.addEventListener("touchcancel",t.endHandleTouchMovement),t.setState({isMoving:!0}),t.changeValue(t.clientToValue(t.touchEventClientOffset(e)))},t.getStyleProperties=function(){if(null==t.handleElement)return{};var e=t.props,n=e.min,r=e.tickSizeRatio,i=e.value,o=e.vertical,a=t.getHandleMidpointAndOffset(t.handleElement,!0).handleMidpoint,l="calc(".concat(vo((i-(void 0===n?0:n))*r)," - ").concat(a,"px)");return o?{bottom:l}:{left:l}},t.endHandleMovement=function(e){t.handleMoveEndedAt(t.mouseEventClientOffset(e))},t.endHandleTouchMovement=function(e){t.handleMoveEndedAt(t.touchEventClientOffset(e))},t.handleMoveEndedAt=function(e){t.removeDocumentEventListeners(),t.setState({isMoving:!1});var n,r,i=t.changeValue(t.clientToValue(e));null===(r=(n=t.props).onRelease)||void 0===r||r.call(n,i)},t.handleHandleMovement=function(e){t.handleMovedTo(t.mouseEventClientOffset(e))},t.handleHandleTouchMovement=function(e){t.handleMovedTo(t.touchEventClientOffset(e))},t.handleMovedTo=function(e){t.state.isMoving&&!t.props.disabled&&t.changeValue(t.clientToValue(e))},t.handleKeyDown=function(e){var n=t.props,r=n.stepSize,i=n.value,o=e.key;"ArrowDown"===o||"ArrowLeft"===o?(t.changeValue(i-r),e.preventDefault()):("ArrowUp"===o||"ArrowRight"===o)&&(t.changeValue(i+r),e.preventDefault())},t.handleKeyUp=function(e){var n,r;fe.isArrowKey(e)&&(null===(r=(n=t.props).onRelease)||void 0===r||r.call(n,t.props.value))},t}return(0,sO.__extends)(t,e),t.prototype.componentDidMount=function(){this.forceUpdate()},t.prototype.render=function(){var e,t=this.props,n=t.className,r=t.disabled,i=t.label,o=t.min,a=t.max,s=t.value,u=t.vertical,c=t.htmlProps,d=this.state.isMoving;return v.createElement("span",(0,sO.__assign)({role:"slider",tabIndex:0},c,{className:l(sk)(sP.SLIDER_HANDLE,((e={})[sP.ACTIVE]=d,e),n),onKeyDown:r?void 0:this.handleKeyDown,onKeyUp:r?void 0:this.handleKeyUp,onMouseDown:r?void 0:this.beginHandleMovement,onTouchStart:r?void 0:this.beginHandleTouchMovement,ref:this.refHandlers.handle,style:this.getStyleProperties(),"aria-valuemin":o,"aria-valuemax":a,"aria-valuenow":s,"aria-disabled":r,"aria-orientation":u?"vertical":"horizontal"}),null==i?null:v.createElement("span",{className:sP.SLIDER_LABEL},i))},t.prototype.componentWillUnmount=function(){this.removeDocumentEventListeners()},t.prototype.clientToValue=function(e){var t=this.props,n=t.stepSize,r=t.tickSize,i=t.value,o=t.vertical;if(null==this.handleElement)return i;var a=(o?window.innerHeight-e:e)-this.getHandleElementCenterPixel(this.handleElement);return isNaN(a)?i:i+Math.round(a/(r*n))*n},t.prototype.mouseEventClientOffset=function(e){return this.props.vertical?e.clientY:e.clientX},t.prototype.touchEventClientOffset=function(e){var t=e.changedTouches[0];return this.props.vertical?t.clientY:t.clientX},t.prototype.validateProps=function(e){for(var t=0;t<vl.length;t++){var n=vl[t];if("number"!=typeof e[n])throw Error("[Blueprint] <Handle> requires number value for ".concat(n," prop"))}},t.prototype.changeValue=function(e,t){return void 0===t&&(t=this.props.onChange),isNaN(e=this.clamp(e))||this.props.value===e||null==t||t(e),e},t.prototype.clamp=function(e){return f0(e,this.props.min,this.props.max)},t.prototype.getHandleElementCenterPixel=function(e){var t=this.getHandleMidpointAndOffset(e),n=t.handleMidpoint;return t.handleOffset+n},t.prototype.getHandleMidpointAndOffset=function(e,t){if(void 0===t&&(t=!1),null==e)return{handleMidpoint:0,handleOffset:0};var n=this.props.vertical,r=e.getBoundingClientRect();r.width=e.offsetWidth,r.height=e.offsetHeight;var i=n?t?"width":"height":t?"height":"width",o=n?window.innerHeight-(r.top+r[i]):r.left;return{handleMidpoint:r[i]/2,handleOffset:o}},t.prototype.removeDocumentEventListeners=function(){document.removeEventListener("mousemove",this.handleHandleMovement),document.removeEventListener("mouseup",this.endHandleMovement),document.removeEventListener("touchmove",this.handleHandleTouchMovement),document.removeEventListener("touchend",this.endHandleTouchMovement),document.removeEventListener("touchcancel",this.endHandleTouchMovement)},t.displayName="".concat(pa,".SliderHandle"),t}(pO),vu={START:"start",END:"end"},vc={PUSH:"push",NONE:"none"},vd=function(){return null};vd.displayName="".concat(pa,".MultiSliderHandle");var vh=function(e){function t(){var t,n,r,i,o=null!==e&&e.apply(this,arguments)||this;return o.state={labelPrecision:(n=(t=o.props).labelPrecision,i=void 0===(r=t.stepSize)?vh.defaultSliderProps.stepSize:r,null==n?fe.countDecimalPlaces(i):n),tickSize:0,tickSizeRatio:0},o.handleElements=[],o.trackElement=null,o.addHandleRef=function(e){null!=e&&o.handleElements.push(e)},o.maybeHandleTrackClick=function(e){if(o.canHandleTrackEvent(e)){var t=o.nearestHandleForValue(o.handleElements,function(t){return t.mouseEventClientOffset(e)});t&&t.beginHandleMovement(e)}},o.maybeHandleTrackTouch=function(e){if(o.canHandleTrackEvent(e)){var t=o.nearestHandleForValue(o.handleElements,function(t){return t.touchEventClientOffset(e)});t&&t.beginHandleTouchMovement(e)}},o.canHandleTrackEvent=function(e){var t=e.target;return!o.props.disabled&&null==t.closest(".".concat(sP.SLIDER_HANDLE))},o.getHandlerForIndex=function(e,t){return function(n){null==t||t(o.getNewHandleValues(n,e))}},o.handleChange=function(e){var t,n,r=vf(o.props),i=r.map(function(e){return e.value});fe.arraysEqual(e,i)||(null===(n=(t=o.props).onChange)||void 0===n||n.call(t,e),r.forEach(function(t,n){var r;i[n]!==e[n]&&(null===(r=t.onChange)||void 0===r||r.call(t,e[n]))}))},o.handleRelease=function(e){var t,n,r=vf(o.props);null===(n=(t=o.props).onRelease)||void 0===n||n.call(t,e),r.forEach(function(t,n){var r;null===(r=t.onRelease)||void 0===r||r.call(t,e[n])})},o}return(0,sO.__extends)(t,e),t.getDerivedStateFromProps=function(e){return{labelPrecision:t.getLabelPrecision(e)}},t.getLabelPrecision=function(e){var t=e.labelPrecision,n=e.stepSize;return null==t?fe.countDecimalPlaces(n):t},t.prototype.getSnapshotBeforeUpdate=function(e){var t=vf(e);return vf(this.props).length!==t.length&&(this.handleElements=[]),null},t.prototype.render=function(){var e,t=this,n=l(sk)(sP.SLIDER,((e={})[sP.DISABLED]=this.props.disabled,e["".concat(sP.SLIDER,"-unlabeled")]=!1===this.props.labelRenderer,e[sP.VERTICAL]=this.props.vertical,e),this.props.className);return v.createElement("div",{className:n,onMouseDown:this.maybeHandleTrackClick,onTouchStart:this.maybeHandleTrackTouch},v.createElement("div",{className:sP.SLIDER_TRACK,ref:function(e){return t.trackElement=e}},this.renderTracks()),v.createElement("div",{className:sP.SLIDER_AXIS},this.renderLabels()),this.renderHandles())},t.prototype.componentDidMount=function(){this.updateTickSize()},t.prototype.componentDidUpdate=function(t,n){e.prototype.componentDidUpdate.call(this,t,n),this.updateTickSize()},t.prototype.validateProps=function(e){if(e.stepSize<=0)throw Error(fH);if(void 0!==e.labelStepSize&&void 0!==e.labelValues)throw Error(f$);if(void 0!==e.labelStepSize&&e.labelStepSize<=0)throw Error(fV);if(void 0!==e.min&&!isFinite(e.min))throw Error(fq);if(void 0!==e.max&&!isFinite(e.max))throw Error(fG);var n=!1;if(v.Children.forEach(e.children,function(e){e&&!fe.isElementOfType(e,t.Handle)&&(n=!0)}),n)throw Error(fW)},t.prototype.formatLabel=function(e,t){void 0===t&&(t=!1);var n=this.props.labelRenderer;return!1===n?void 0:fe.isFunction(n)?n(e,{isHandleTooltip:t}):e.toFixed(this.state.labelPrecision)},t.prototype.renderLabels=function(){var e=this;if(!1===this.props.labelRenderer)return null;var t=this.getLabelValues(),n=this.props,r=n.max,i=n.min;return t.map(function(t,n){var o=vo((t-i)/(r-i)),a=e.props.vertical?{bottom:o}:{left:o};return v.createElement("div",{className:sP.SLIDER_LABEL,key:n,style:a},e.formatLabel(t))})},t.prototype.renderTracks=function(){var e=vp(this.props);e.push({value:this.props.max});for(var t={value:this.props.min},n=[],r=0;r<e.length;r++){var i=e[r];n.push(this.renderTrackFill(r,t,i)),t=i}return n},t.prototype.renderTrackFill=function(e,t,n){var r=[this.getOffsetRatio(t.value),this.getOffsetRatio(n.value)].sort(function(e,t){return e-t}),i=r[0],o=r[1],a=vo(i),s=vo(1-o),u=this.props.vertical?{bottom:a,top:s,left:0}:{left:a,right:s,top:0},c=(0,sO.__assign)((0,sO.__assign)({},u),t.trackStyleAfter||n.trackStyleBefore||{}),d=l(sk)(sP.SLIDER_PROGRESS,sP.intentClass(this.getTrackIntent(t,n)));return v.createElement("div",{key:"track-".concat(e),className:d,style:c})},t.prototype.renderHandles=function(){var e=this,t=this.props,n=t.disabled,r=t.max,i=t.min,o=t.stepSize,a=t.vertical,s=vf(this.props);return 0===s.length?null:s.map(function(t,u){var c,d=t.value,h=t.type,f=t.className,p=t.htmlProps;return v.createElement(vs,{htmlProps:p,className:l(sk)(((c={})[sP.START]=h===vu.START,c[sP.END]=h===vu.END,c),f),disabled:n,key:"".concat(u,"-").concat(s.length),label:e.formatLabel(d,!0),max:r,min:i,onChange:e.getHandlerForIndex(u,e.handleChange),onRelease:e.getHandlerForIndex(u,e.handleRelease),ref:e.addHandleRef,stepSize:o,tickSize:e.state.tickSize,tickSizeRatio:e.state.tickSizeRatio,value:d,vertical:a})})},t.prototype.nearestHandleForValue=function(e,t){return function(e,t){if(0!==e.length){for(var n=e[0],r=t(n),i=1;i<e.length;i++){var o=e[i],a=t(o);a<r&&(n=o,r=a)}return n}}(e,function(e){var n=t(e);return Math.abs(e.clientToValue(n)-e.props.value)})},t.prototype.getNewHandleValues=function(e,t){var n=vf(this.props).map(function(e){return e.value}),r=n.slice();r[t]=e,r.sort(function(e,t){return e-t});var i=r.indexOf(e),o=this.findFirstLockedHandleIndex(t,i);if(-1===o)va(r,t,i,e);else{var a=n[o];return va(n,t,o,a),n}return r},t.prototype.findFirstLockedHandleIndex=function(e,t){for(var n=e<t?1:-1,r=vf(this.props),i=e+n;i!==t+n;i+=n)if(r[i].interactionKind!==vc.PUSH)return i;return -1},t.prototype.getLabelValues=function(){var e=this.props,t=e.labelStepSize,n=e.labelValues,r=e.min,i=e.max,o=[];if(void 0!==n)o=n.slice();else for(var a=r;a<i||fe.approxEqual(a,i);a+=null!=t?t:1)o.push(a);return o},t.prototype.getOffsetRatio=function(e){return fe.clamp((e-this.props.min)*this.state.tickSizeRatio,0,1)},t.prototype.getTrackIntent=function(e,t){return this.props.showTrackFill?void 0!==e.intentAfter?e.intentAfter:void 0!==t&&void 0!==t.intentBefore?t.intentBefore:this.props.defaultTrackIntent:sN.NONE},t.prototype.updateTickSize=function(){if(null!=this.trackElement){var e=this.props.vertical?this.trackElement.clientHeight:this.trackElement.clientWidth,t=1/(this.props.max-this.props.min);this.setState({tickSize:e*t,tickSizeRatio:t})}},t.defaultSliderProps={disabled:!1,max:10,min:0,showTrackFill:!0,stepSize:1,vertical:!1},t.defaultProps=(0,sO.__assign)((0,sO.__assign)({},t.defaultSliderProps),{defaultTrackIntent:sN.NONE}),t.displayName="".concat(pa,".MultiSlider"),t.Handle=vd,t}(pO);function vf(e){return vp(e,function(e){return e.interactionKind!==vc.NONE})}function vp(e,t){var n=e.children;void 0===t&&(t=function(){return!0});var r=v.Children.map(n,function(e){return fe.isElementOfType(e,vh.Handle)&&t(e.props)?e.props:null}),i=null!=r?r:[];return(i=i.filter(function(e){return null!==e})).sort(function(e,t){return e.value-t.value}),i}var vg=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.initialValue,n=e.intent,r=e.value,i=e.onChange,o=e.onRelease,a=e.handleHtmlProps,l=(0,sO.__rest)(e,["initialValue","intent","value","onChange","onRelease","handleHtmlProps"]);return v.createElement(vh,(0,sO.__assign)({},l),v.createElement(vh.Handle,{value:r,intentAfter:r<t?n:void 0,intentBefore:r>=t?n:void 0,onChange:i,onRelease:o,htmlProps:a}),v.createElement(vh.Handle,{value:t,interactionKind:"none"}))},t.defaultProps=(0,sO.__assign)((0,sO.__assign)({},vh.defaultSliderProps),{initialValue:0,intent:sN.PRIMARY,value:0}),t.displayName="".concat(pa,".Slider"),t}(pO),vm=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function vv(e,t){if(e.length!==t.length)return!1;for(var n,r,i=0;i<e.length;i++)if(!((n=e[i])===(r=t[i])||vm(n)&&vm(r)))return!1;return!0}var vy=function(e,t){void 0===t&&(t=vv);var n,r,i=[],o=!1;return function(){for(var a=[],l=0;l<arguments.length;l++)a[l]=arguments[l];return o&&n===this&&t(a,i)||(r=e.apply(this,a),o=!0,n=this,i=a),r}},v=h("8NFma"),vb="object"==typeof performance&&"function"==typeof performance.now?function(){return performance.now()}:function(){return Date.now()};function vw(e){cancelAnimationFrame(e.id)}var vx=-1;function v_(e){if(void 0===e&&(e=!1),-1===vx||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(t),vx=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return vx}var vE=null;function vS(e){if(void 0===e&&(e=!1),null===vE||e){var t=document.createElement("div"),n=t.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;i.width="100px",i.height="100px",t.appendChild(r),document.body.appendChild(t),t.scrollLeft>0?vE="positive-descending":(t.scrollLeft=1,vE=0===t.scrollLeft?"negative":"positive-ascending"),document.body.removeChild(t)}return vE}var vC=function(e,t,n,r){var i,o,a;if("column"===e?(i=r.columnMetadataMap,o=t.columnWidth,a=r.lastMeasuredColumnIndex):(i=r.rowMetadataMap,o=t.rowHeight,a=r.lastMeasuredRowIndex),n>a){var l=0;if(a>=0){var s=i[a];l=s.offset+s.size}for(var u=a+1;u<=n;u++){var c=o(u);i[u]={offset:l,size:c},l+=c}"column"===e?r.lastMeasuredColumnIndex=n:r.lastMeasuredRowIndex=n}return i[n]},vO=function(e,t){return e},vk=function(e,t){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,t.instance},vP=function(e,t,n){var r=e.itemSize,i=n.itemMetadataMap,o=n.lastMeasuredIndex;if(t>o){var a=0;if(o>=0){var l=i[o];a=l.offset+l.size}for(var s=o+1;s<=t;s++){var u=r(s);i[s]={offset:a,size:u},a+=u}n.lastMeasuredIndex=t}return i[t]},vT=(Pu=(Pl={getItemOffset:function(e,t){return t*e.itemSize},getItemSize:function(e,t){return e.itemSize},getEstimatedTotalSize:function(e){var t=e.itemCount;return e.itemSize*t},getOffsetForIndexAndAlignment:function(e,t,n,r,i,o){var a=e.direction,l=e.height,s=e.itemCount,u=e.itemSize,c=e.layout,d=e.width,h="horizontal"===a||"horizontal"===c?d:l,f=Math.max(0,s*u-h),p=Math.min(f,t*u),g=Math.max(0,t*u-h+u+o);switch("smart"===n&&(n=r>=g-h&&r<=p+h?"auto":"center"),n){case"start":return p;case"end":return g;case"center":var m=Math.round(g+(p-g)/2);if(m<Math.ceil(h/2))return 0;if(m>f+Math.floor(h/2))return f;return m;default:if(r>=g&&r<=p)return r;if(r<g)return g;return p}},getStartIndexForOffset:function(e,t){return Math.max(0,Math.min(e.itemCount-1,Math.floor(t/e.itemSize)))},getStopIndexForStartIndex:function(e,t,n){var r=e.direction,i=e.height,o=e.itemCount,a=e.itemSize,l=e.layout,s=e.width,u=Math.ceil((("horizontal"===r||"horizontal"===l?s:i)+n-t*a)/a);return Math.max(0,Math.min(o-1,t+u-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}}).getItemOffset,Pc=Pl.getEstimatedTotalSize,Pd=Pl.getItemSize,Ph=Pl.getOffsetForIndexAndAlignment,Pf=Pl.getStartIndexForOffset,Pp=Pl.getStopIndexForStartIndex,Pg=Pl.initInstanceProps,Pm=Pl.shouldResetStyleCacheOnItemSizeChange,Pv=Pl.validateProps,(Ps=function(e){function t(t){var n;return(n=e.call(this,t)||this)._instanceProps=Pg(n.props,g7(n)),n._outerRef=void 0,n._resetIsScrollingTimeoutId=null,n.state={instance:g7(n),isScrolling:!1,scrollDirection:"forward",scrollOffset:"number"==typeof n.props.initialScrollOffset?n.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},n._callOnItemsRendered=void 0,n._callOnItemsRendered=vy(function(e,t,r,i){return n.props.onItemsRendered({overscanStartIndex:e,overscanStopIndex:t,visibleStartIndex:r,visibleStopIndex:i})}),n._callOnScroll=void 0,n._callOnScroll=vy(function(e,t,r){return n.props.onScroll({scrollDirection:e,scrollOffset:t,scrollUpdateWasRequested:r})}),n._getItemStyle=void 0,n._getItemStyle=function(e){var t,r=n.props,i=r.direction,o=r.itemSize,a=r.layout,l=n._getItemStyleCache(Pm&&o,Pm&&a,Pm&&i);if(l.hasOwnProperty(e))t=l[e];else{var s=Pu(n.props,e,n._instanceProps),u=Pd(n.props,e,n._instanceProps),c="horizontal"===i||"horizontal"===a,d="rtl"===i,h=c?s:0;l[e]=t={position:"absolute",left:d?void 0:h,right:d?h:void 0,top:c?0:s,height:c?"100%":u,width:c?u:"100%"}}return t},n._getItemStyleCache=void 0,n._getItemStyleCache=vy(function(e,t,n){return{}}),n._onScrollHorizontal=function(e){var t=e.currentTarget,r=t.clientWidth,i=t.scrollLeft,o=t.scrollWidth;n.setState(function(e){if(e.scrollOffset===i)return null;var t=n.props.direction,a=i;if("rtl"===t)switch(vS()){case"negative":a=-i;break;case"positive-descending":a=o-r-i}return a=Math.max(0,Math.min(a,o-r)),{isScrolling:!0,scrollDirection:e.scrollOffset<a?"forward":"backward",scrollOffset:a,scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._onScrollVertical=function(e){var t=e.currentTarget,r=t.clientHeight,i=t.scrollHeight,o=t.scrollTop;n.setState(function(e){if(e.scrollOffset===o)return null;var t=Math.max(0,Math.min(o,i-r));return{isScrolling:!0,scrollDirection:e.scrollOffset<t?"forward":"backward",scrollOffset:t,scrollUpdateWasRequested:!1}},n._resetIsScrollingDebounced)},n._outerRefSetter=function(e){var t=n.props.outerRef;n._outerRef=e,"function"==typeof t?t(e):null!=t&&"object"==typeof t&&t.hasOwnProperty("current")&&(t.current=e)},n._resetIsScrollingDebounced=function(){var e,t,r;null!==n._resetIsScrollingTimeoutId&&vw(n._resetIsScrollingTimeoutId),n._resetIsScrollingTimeoutId=(e=n._resetIsScrolling,t=vb(),r={id:requestAnimationFrame(function n(){vb()-t>=150?e.call(null):r.id=requestAnimationFrame(n)})})},n._resetIsScrolling=function(){n._resetIsScrollingTimeoutId=null,n.setState({isScrolling:!1},function(){n._getItemStyleCache(-1,null)})},n}gY(t,e),t.getDerivedStateFromProps=function(e,t){return vk(e,t),Pv(e),null};var n=t.prototype;return n.scrollTo=function(e){e=Math.max(0,e),this.setState(function(t){return t.scrollOffset===e?null:{scrollDirection:t.scrollOffset<e?"forward":"backward",scrollOffset:e,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},n.scrollToItem=function(e,t){void 0===t&&(t="auto");var n=this.props,r=n.itemCount,i=n.layout,o=this.state.scrollOffset;e=Math.max(0,Math.min(e,r-1));var a=0;if(this._outerRef){var l=this._outerRef;a="vertical"===i?l.scrollWidth>l.clientWidth?v_():0:l.scrollHeight>l.clientHeight?v_():0}this.scrollTo(Ph(this.props,e,t,o,this._instanceProps,a))},n.componentDidMount=function(){var e=this.props,t=e.direction,n=e.initialScrollOffset,r=e.layout;if("number"==typeof n&&null!=this._outerRef){var i=this._outerRef;"horizontal"===t||"horizontal"===r?i.scrollLeft=n:i.scrollTop=n}this._callPropsCallbacks()},n.componentDidUpdate=function(){var e=this.props,t=e.direction,n=e.layout,r=this.state,i=r.scrollOffset;if(r.scrollUpdateWasRequested&&null!=this._outerRef){var o=this._outerRef;if("horizontal"===t||"horizontal"===n){if("rtl"===t)switch(vS()){case"negative":o.scrollLeft=-i;break;case"positive-ascending":o.scrollLeft=i;break;default:var a=o.clientWidth,l=o.scrollWidth;o.scrollLeft=l-a-i}else o.scrollLeft=i}else o.scrollTop=i}this._callPropsCallbacks()},n.componentWillUnmount=function(){null!==this._resetIsScrollingTimeoutId&&vw(this._resetIsScrollingTimeoutId)},n.render=function(){var e=this.props,t=e.children,n=e.className,r=e.direction,i=e.height,o=e.innerRef,a=e.innerElementType,l=e.innerTagName,s=e.itemCount,u=e.itemData,c=e.itemKey,d=void 0===c?vO:c,h=e.layout,f=e.outerElementType,p=e.outerTagName,g=e.style,m=e.useIsScrolling,y=e.width,b=this.state.isScrolling,w="horizontal"===r||"horizontal"===h,x=w?this._onScrollHorizontal:this._onScrollVertical,_=this._getRangeToRender(),E=_[0],S=_[1],C=[];if(s>0)for(var O=E;O<=S;O++)C.push((0,v.createElement)(t,{data:u,key:d(O,u),index:O,isScrolling:m?b:void 0,style:this._getItemStyle(O)}));var k=Pc(this.props,this._instanceProps);return(0,v.createElement)(f||p||"div",{className:n,onScroll:x,ref:this._outerRefSetter,style:gW({position:"relative",height:i,width:y,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:r},g)},(0,v.createElement)(a||l||"div",{children:C,ref:o,style:{height:w?"100%":k,pointerEvents:b?"none":void 0,width:w?k:"100%"}}))},n._callPropsCallbacks=function(){if("function"==typeof this.props.onItemsRendered&&this.props.itemCount>0){var e=this._getRangeToRender(),t=e[0],n=e[1],r=e[2],i=e[3];this._callOnItemsRendered(t,n,r,i)}if("function"==typeof this.props.onScroll){var o=this.state,a=o.scrollDirection,l=o.scrollOffset,s=o.scrollUpdateWasRequested;this._callOnScroll(a,l,s)}},n._getRangeToRender=function(){var e=this.props,t=e.itemCount,n=e.overscanCount,r=this.state,i=r.isScrolling,o=r.scrollDirection,a=r.scrollOffset;if(0===t)return[0,0,0,0];var l=Pf(this.props,a,this._instanceProps),s=Pp(this.props,l,a,this._instanceProps);return[Math.max(0,l-(i&&"backward"!==o?1:Math.max(1,n))),Math.max(0,Math.min(t-1,s+(i&&"forward"!==o?1:Math.max(1,n)))),l,s]},t}(v.PureComponent)).defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},Ps),v=(h("8NFma"),h("8NFma"));let vA=()=>{},vN=vA(),vj=Object,vR=e=>e===vN,vI=e=>"function"==typeof e,vL=(e,t)=>({...e,...t}),vM=e=>vI(e.then),vD=new WeakMap,vF=0,vz=e=>{let t,n;let r=typeof e,i=e&&e.constructor,o=i==Date;if(vj(e)!==e||o||i==RegExp)t=o?e.toJSON():"symbol"==r?e.toString():"string"==r?JSON.stringify(e):""+e;else{if(t=vD.get(e))return t;if(t=++vF+"~",vD.set(e,t),i==Array){for(n=0,t="@";n<e.length;n++)t+=vz(e[n])+",";vD.set(e,t)}if(i==vj){t="#";let r=vj.keys(e).sort();for(;!vR(n=r.pop());)vR(e[n])||(t+=n+":"+vz(e[n])+",");vD.set(e,t)}}return t},vB=new WeakMap,vU={},vH={},vV="undefined",vq=typeof window!=vV,vG=typeof document!=vV,vW=()=>vq&&typeof window.requestAnimationFrame!=vV,v$=(e,t)=>{let n=vB.get(e);return[()=>!vR(t)&&e.get(t)||vU,r=>{if(!vR(t)){let i=e.get(t);t in vH||(vH[t]=i),n[5](t,vL(i,r),i||vU)}},n[6],()=>!vR(t)&&t in vH?vH[t]:!vR(t)&&e.get(t)||vU]},vK=!0,[vY,vX]=vq&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[vA,vA],vZ={initFocus:e=>(vG&&document.addEventListener("visibilitychange",e),vY("focus",e),()=>{vG&&document.removeEventListener("visibilitychange",e),vX("focus",e)}),initReconnect:e=>{let t=()=>{vK=!0,e()},n=()=>{vK=!1};return vY("online",t),vY("offline",n),()=>{vX("online",t),vX("offline",n)}}},vQ=!l(v).useId,vJ=!vq||"Deno"in window,v0=e=>vW()?window.requestAnimationFrame(e):setTimeout(e,1),v1=vJ?v.useEffect:v.useLayoutEffect,v2="undefined"!=typeof navigator&&navigator.connection,v3=!vJ&&v2&&(["slow-2g","2g"].includes(v2.effectiveType)||v2.saveData),v5=e=>{if(vI(e))try{e=e()}catch(t){e=""}let t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?vz(e):"",t]},v6=0,v4=()=>++v6;var v8={ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:0,MUTATE_EVENT:2,RECONNECT_EVENT:1};async function v9(...e){let[t,n,r,i]=e,o=vL({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{}),a=o.populateCache,l=o.rollbackOnError,s=o.optimisticData,u=!1!==o.revalidate,c=e=>"function"==typeof l?l(e):!1!==l,d=o.throwOnError;if(vI(n)){let e=[];for(let r of t.keys())!/^\$(inf|sub)\$/.test(r)&&n(t.get(r)._k)&&e.push(r);return Promise.all(e.map(h))}return h(n);async function h(n){let i;let[o]=v5(n);if(!o)return;let[l,h]=v$(t,o),[f,p,g,m]=vB.get(t),v=()=>{let e=f[o];return u&&(delete g[o],delete m[o],e&&e[0])?e[0](2).then(()=>l().data):l().data};if(e.length<3)return v();let y=r,b=v4();p[o]=[b,0];let w=!vR(s),x=l(),_=x.data,E=x._c,S=vR(E)?_:E;if(w&&h({data:s=vI(s)?s(S,_):s,_c:S}),vI(y))try{y=y(S)}catch(e){i=e}if(y&&vM(y)){if(y=await y.catch(e=>{i=e}),b!==p[o][0]){if(i)throw i;return y}i&&w&&c(i)&&(a=!0,h({data:S,_c:vN}))}if(a&&!i&&(vI(a)?h({data:a(y,S),error:vN,_c:vN}):h({data:y,error:vN,_c:vN})),p[o][1]=v4(),Promise.resolve(v()).then(()=>{h({_c:vN})}),i){if(d)throw i;return}return y}}let v7=(e,t)=>{for(let n in e)e[n][0]&&e[n][0](t)},ye=(e,t)=>{if(!vB.has(e)){let n=vL(vZ,t),r={},i=v9.bind(vN,e),o=vA,a={},l=(e,t)=>{let n=a[e]||[];return a[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},s=(t,n,r)=>{e.set(t,n);let i=a[t];if(i)for(let e of i)e(n,r)},u=()=>{if(!vB.has(e)&&(vB.set(e,[r,{},{},{},i,s,l]),!vJ)){let t=n.initFocus(setTimeout.bind(vN,v7.bind(vN,r,0))),i=n.initReconnect(setTimeout.bind(vN,v7.bind(vN,r,1)));o=()=>{t&&t(),i&&i(),vB.delete(e)}}};return u(),[e,i,u,o]}return[e,vB.get(e)[4]]},[yt,yn]=ye(new Map),yr=vL({onLoadingSlow:vA,onSuccess:vA,onError:vA,onErrorRetry:(e,t,n,r,i)=>{let o=n.errorRetryCount,a=i.retryCount,l=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;(vR(o)||!(a>o))&&setTimeout(r,l,i)},onDiscarded:vA,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:v3?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:v3?5e3:3e3,compare:(e,t)=>vz(e)==vz(t),isPaused:()=>!1,cache:yt,mutate:yn,fallback:{}},{isOnline:()=>vK,isVisible:()=>{let e=vG&&document.visibilityState;return vR(e)||"hidden"!==e}}),yi=(e,t)=>{let n=vL(e,t);if(t){let{use:r,fallback:i}=e,{use:o,fallback:a}=t;r&&o&&(n.use=r.concat(o)),i&&a&&(n.fallback=vL(i,a))}return n},yo=(0,v.createContext)({}),ya="$inf$",yl=vq&&window.__SWR_DEVTOOLS_USE__,ys=yl?window.__SWR_DEVTOOLS_USE__:[],yu=e=>vI(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],yc=()=>vL(yr,(0,v.useContext)(yo)),yd=ys.concat(e=>(t,n,r)=>{let i=n&&((...e)=>{let[r]=v5(t),[,,,i]=vB.get(yt);if(r.startsWith(ya))return n(...e);let o=i[r];return vR(o)?n(...e):(delete i[r],o)});return e(t,i,r)}),yh=(e,t,n)=>{let r=t[e]||(t[e]=[]);return r.push(n),()=>{let e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}};yl&&(window.__SWR_DEVTOOLS_REACT__=l(v));let yf=l(v).use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;if("rejected"===e.status)throw e.reason;throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}),yp={dedupe:!0};vj.defineProperty(e=>{let{value:t}=e,n=(0,v.useContext)(yo),r=vI(t),i=(0,v.useMemo)(()=>r?t(n):t,[r,n,t]),o=(0,v.useMemo)(()=>r?i:yi(n,i),[r,n,i]),a=i&&i.provider,l=(0,v.useRef)(vN);a&&!l.current&&(l.current=ye(a(o.cache||yt),i));let s=l.current;return s&&(o.cache=s[0],o.mutate=s[1]),v1(()=>{if(s)return s[2]&&s[2](),s[3]},[]),(0,v.createElement)(yo.Provider,vL(e,{value:o}))},"defaultValue",{value:yr});let yg=(Py=(e,t,n)=>{let{cache:r,compare:i,suspense:o,fallbackData:a,revalidateOnMount:l,revalidateIfStale:s,refreshInterval:u,refreshWhenHidden:c,refreshWhenOffline:d,keepPreviousData:h}=n,[f,p,g,m]=vB.get(r),[y,b]=v5(e),w=(0,v.useRef)(!1),x=(0,v.useRef)(!1),E=(0,v.useRef)(y),S=(0,v.useRef)(t),C=(0,v.useRef)(n),O=()=>C.current,k=()=>O().isVisible()&&O().isOnline(),[P,T,A,N]=v$(r,y),j=(0,v.useRef)({}).current,R=vR(a)?n.fallback[y]:a,I=(e,t)=>{for(let n in j)if("data"===n){if(!i(e[n],t[n])&&(!vR(e[n])||!i(V,t[n])))return!1}else if(t[n]!==e[n])return!1;return!0},L=(0,v.useMemo)(()=>{let e=!!y&&!!t&&(vR(l)?!O().isPaused()&&!o&&(!!vR(s)||s):l),n=t=>{let n=vL(t);return(delete n._k,e)?{isValidating:!0,isLoading:!0,...n}:n},r=P(),i=N(),a=n(r),u=r===i?a:n(i),c=a;return[()=>{let e=n(P());return I(e,c)?(c.data=e.data,c.isLoading=e.isLoading,c.isValidating=e.isValidating,c.error=e.error,c):(c=e,e)},()=>u]},[r,y]),M=(0,_.useSyncExternalStore)((0,v.useCallback)(e=>A(y,(t,n)=>{I(n,t)||e()}),[r,y]),L[0],L[1]),D=!w.current,F=f[y]&&f[y].length>0,z=M.data,B=vR(z)?R:z,U=M.error,H=(0,v.useRef)(B),V=h?vR(z)?H.current:z:B,q=(!F||!!vR(U))&&(D&&!vR(l)?l:!O().isPaused()&&(o?!vR(B)&&s:vR(B)||s)),G=!!(y&&t&&D&&q),W=vR(M.isValidating)?G:M.isValidating,$=vR(M.isLoading)?G:M.isLoading,K=(0,v.useCallback)(async e=>{let t,r;let o=S.current;if(!y||!o||x.current||O().isPaused())return!1;let a=!0,l=e||{},s=!g[y]||!l.dedupe,u=()=>vQ?!x.current&&y===E.current&&w.current:y===E.current,c={isValidating:!1,isLoading:!1},d=()=>{T(c)},h=()=>{let e=g[y];e&&e[1]===r&&delete g[y]},m={isValidating:!0};vR(P().data)&&(m.isLoading=!0);try{if(s&&(T(m),n.loadingTimeout&&vR(P().data)&&setTimeout(()=>{a&&u()&&O().onLoadingSlow(y,n)},n.loadingTimeout),g[y]=[o(b),v4()]),[t,r]=g[y],t=await t,s&&setTimeout(h,n.dedupingInterval),!g[y]||g[y][1]!==r)return s&&u()&&O().onDiscarded(y),!1;c.error=vN;let e=p[y];if(!vR(e)&&(r<=e[0]||r<=e[1]||0===e[1]))return d(),s&&u()&&O().onDiscarded(y),!1;let l=P().data;c.data=i(l,t)?l:t,s&&u()&&O().onSuccess(t,y,n)}catch(n){h();let e=O(),{shouldRetryOnError:t}=e;!e.isPaused()&&(c.error=n,s&&u()&&(e.onError(n,y,e),(!0===t||vI(t)&&t(n))&&k()&&e.onErrorRetry(n,y,e,e=>{let t=f[y];t&&t[0]&&t[0](v8.ERROR_REVALIDATE_EVENT,e)},{retryCount:(l.retryCount||0)+1,dedupe:!0})))}return a=!1,d(),!0},[y,r]),Y=(0,v.useCallback)((...e)=>v9(r,E.current,...e),[]);if(v1(()=>{S.current=t,C.current=n,vR(z)||(H.current=z)}),v1(()=>{if(!y)return;let e=K.bind(vN,yp),t=0,n=yh(y,f,(n,r={})=>{if(n==v8.FOCUS_EVENT){let n=Date.now();O().revalidateOnFocus&&n>t&&k()&&(t=n+O().focusThrottleInterval,e())}else if(n==v8.RECONNECT_EVENT)O().revalidateOnReconnect&&k()&&e();else if(n==v8.MUTATE_EVENT)return K();else if(n==v8.ERROR_REVALIDATE_EVENT)return K(r)});return x.current=!1,E.current=y,w.current=!0,T({_k:b}),q&&(vR(B)||vJ?e():v0(e)),()=>{x.current=!0,n()}},[y]),v1(()=>{let e;function t(){let t=vI(u)?u(P().data):u;t&&-1!==e&&(e=setTimeout(n,t))}function n(){!P().error&&(c||O().isVisible())&&(d||O().isOnline())?K(yp).then(t):t()}return t(),()=>{e&&(clearTimeout(e),e=-1)}},[u,c,d,y]),(0,v.useDebugValue)(V),o&&vR(B)&&y){if(!vQ&&vJ)throw Error("Fallback data is required when using suspense in SSR.");S.current=t,C.current=n,x.current=!1;let e=m[y];if(vR(e)||yf(Y(e)),vR(U)){let e=K(yp);vR(V)||(e.status="fulfilled",e.value=!0),yf(e)}else throw U}return{mutate:Y,get data(){return j.data=!0,V},get error(){return j.error=!0,U},get isValidating(){return j.isValidating=!0,W},get isLoading(){return j.isLoading=!0,$}}},function(...e){let t=yc(),[n,r,i]=yu(e),o=yi(t,i),a=Py,{use:l}=o,s=(l||[]).concat(yd);for(let e=s.length;e--;)a=s[e](a);return a(n,r||o.fetcher||null,o)});var v=(h("8NFma"),h("8NFma"));let ym=e=>v5(e?e(0,null):null)[0],yv=Promise.resolve(),yy=(Pb=e=>(t,n,r)=>{let i;let o=(0,v.useRef)(!1),{cache:a,initialSize:l=1,revalidateAll:s=!1,persistSize:u=!1,revalidateFirstPage:c=!0,revalidateOnMount:d=!1,parallel:h=!1}=r,[,,,f]=vB.get(yt);try{(i=ym(t))&&(i=ya+i)}catch(e){}let[p,g,m]=v$(a,i),y=(0,v.useCallback)(()=>vR(p()._l)?l:p()._l,[a,i,l]);(0,_.useSyncExternalStore)((0,v.useCallback)(e=>i?m(i,()=>{e()}):()=>{},[a,i]),y,y);let b=(0,v.useCallback)(()=>{let e=p()._l;return vR(e)?l:e},[i,l]),w=(0,v.useRef)(b());v1(()=>{if(!o.current){o.current=!0;return}i&&g({_l:u?w.current:b()})},[i,a]);let x=d&&!o.current,E=e(i,async e=>{let i=p()._i,o=[],l=b(),[u]=v$(a,e),d=u().data,m=[],v=null;for(let e=0;e<l;++e){let[l,u]=v5(t(e,h?null:v));if(!l)break;let[p,g]=v$(a,l),y=p().data,b=s||i||vR(y)||c&&!e&&!vR(d)||x||d&&!vR(d[e])&&!r.compare(d[e],y);if(n&&b){let t=async()=>{if(l in f){let e=f[l];delete f[l],y=await e}else y=await n(u);g({data:y,_k:u}),o[e]=y};h?m.push(t):await t()}else o[e]=y;h||(v=y)}return h&&await Promise.all(m.map(e=>e())),g({_i:vN}),o},r),S=(0,v.useCallback)(function(e,t){let n="boolean"==typeof t?{revalidate:t}:t||{},r=!1!==n.revalidate;return i?(r&&(vR(e)?g({_i:!0}):g({_i:!1})),arguments.length?E.mutate(e,{...n,revalidate:r}):E.mutate()):yv},[i,a]),C=(0,v.useCallback)(e=>{let n;if(!i)return yv;let[,r]=v$(a,i);if(vI(e)?n=e(b()):"number"==typeof e&&(n=e),"number"!=typeof n)return yv;r({_l:n}),w.current=n;let o=[],[l]=v$(a,i),s=null;for(let e=0;e<n;++e){let[n]=v5(t(e,s)),[r]=v$(a,n),i=n?r().data:vN;if(vR(i))return S(l().data);o.push(i),s=i}return S(o)},[i,a,S,b]);return{size:b(),setSize:C,mutate:S,get data(){return E.data},get error(){return E.error},get isValidating(){return E.isValidating},get isLoading(){return E.isLoading}}},(...e)=>{let[t,n,r]=yu(e),i=(r.use||[]).concat(Pb);return yg(t,n,{...r,use:i})}),yb=e=>fetch(e).then(e=>e.json()),yw=({defaultQuery:e="",timeout:t=100,getAPI:n,getSize:r=e=>e.total_pages,fetchFunc:i=yb})=>{let o=l(v).useRef(e),a=l(v).useRef(),{data:s,error:u,size:c,setSize:d,mutate:h}=yy(e=>n({query:o.current,page:e+1}),i,{revalidateAll:!1}),f=!s&&!u||!!(c>0&&s&&void 0===s[c-1]),p=s?.[0]?.length===0,g=s?.[s.length-1],m=p||g&&r(g)===c;return{setQuery:l(v).useCallback(e=>{o.current=e,clearTimeout(a.current),a.current=setTimeout(()=>{h()},t)},[t]),isLoading:f,loadMore:()=>{m||d(c+1)},isReachingEnd:m,data:s?.filter(e=>e),items:s?.reduce((e,t)=>e.concat(t),[]),hasMore:!m,reset:h,error:u}};var v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),yx=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.panel;return v.createElement("div",{className:l(sk)(sP.TAB_PANEL,t),role:"tablist"},n)},t.defaultProps={disabled:!1},t.displayName="".concat(pa,".Tab"),t}(pO),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),sO=h("gztBd"),v=h("8NFma"),py=h("leH9B"),sO=h("gztBd"),v=h("8NFma"),py=h("leH9B"),y_=v.forwardRef(function(e,t){var n=e.size>=py.IconSize.LARGE,r=n?py.IconSize.LARGE:py.IconSize.STANDARD,i="".concat(-1*r/.05/2);return v.createElement(pS,(0,sO.__assign)({iconName:"small-cross",ref:t},e),v.createElement("path",{d:n?"M228.2 200L294 265.8C297.8 269.4 300 274.4 300 280C300 291 291 300 280 300C274.4000000000001 300 269.4000000000001 297.8 265.8 294.2L200 228.2L134.2 294.2C130.6 297.8 125.6 300 120 300C109 300 100 291 100 280C100 274.4 102.2 269.4 105.8 265.8L171.8 200L106 134.2000000000001C102.2 130.6 100 125.6 100 120C100 109 109 100 120 100C125.6 100 130.6 102.2 134.2 105.8L200 171.8L265.8 106C269.4000000000001 102.2 274.4000000000001 100 280 100C291 100 300 109 300 120C300 125.6 297.8 130.6 294.2000000000001 134.2000000000001L228.2 200z":"M188.2 160L234 205.8C237.8 209.4 240 214.4 240 220C240 231 231 240 220 240C214.4 240 209.4 237.8 205.8 234.2L160 188.2L114.2 234.2C110.6 237.8 105.6 240 100 240C89 240 80 231 80 220C80 214.4 82.2 209.4 85.8 205.8L131.8 160L86 114.2C82.2 110.6 80 105.6 80 100C80 89 89 80 100 80C105.6 80 110.6 82.2 114.2 85.8L160 131.8L205.8 86C209.4 82.2 214.4 80 220 80C231 80 240 89 240 100C240 105.6 237.8 110.6 234.2 114.2L188.2 160z",fillRule:"evenodd",transform:"scale(0.05, -0.05) translate(".concat(i,", ").concat(i,")")}))});y_.defaultProps={size:py.IconSize.STANDARD},y_.displayName="Blueprint5.Icon.SmallCross";var yE=v.forwardRef(function(e,t){var n,r=e.active,i=e.children,o=e.className,a=e.fill,s=e.icon,u=e.intent,c=e.interactive,d=e.large,h=e.minimal,f=e.multiline,p=e.onRemove,g=e.rightIcon,m=e.round,y=e.tabIndex,b=void 0===y?0:y,w=e.htmlTitle,x=(0,sO.__rest)(e,["active","children","className","fill","icon","intent","interactive","large","minimal","multiline","onRemove","rightIcon","round","tabIndex","htmlTitle"]),_=fe.isFunction(p),E=l(sk)(sP.TAG,sP.intentClass(u),((n={})[sP.ACTIVE]=r,n[sP.FILL]=a,n[sP.INTERACTIVE]=c,n[sP.LARGE]=d,n[sP.MINIMAL]=h,n[sP.ROUND]=m,n),o),S=d||E.indexOf(sP.LARGE)>=0,C=_?v.createElement("button",{"aria-label":"Remove tag",type:"button",className:sP.TAG_REMOVE,onClick:function(t){var n;null===(n=e.onRemove)||void 0===n||n.call(e,t,e)},tabIndex:b},v.createElement(y_,{size:S?py.IconSize.LARGE:py.IconSize.STANDARD})):null;return v.createElement("span",(0,sO.__assign)({},x,{className:E,tabIndex:c?b:void 0,ref:t}),v.createElement(pC,{icon:s}),!f6(i)&&v.createElement(pT,{className:sP.FILL,ellipsize:!f,tagName:"span",title:w},i),v.createElement(pC,{icon:g}),C)});yE.displayName="".concat(pa,".Tag");var yS=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleClick=function(e){return t.props.onClick(t.props.id,e)},t}return(0,sO.__extends)(t,e),t.prototype.render=function(){var e=this.props,t=e.className,n=e.children,r=e.disabled,i=e.id,o=e.parentId,a=e.selected,s=e.title,u=e.icon,c=e.tagContent,d=e.tagProps,h=(0,sO.__rest)(e,["className","children","disabled","id","parentId","selected","title","icon","tagContent","tagProps"]),f=a?sN.PRIMARY:sN.NONE;return v.createElement("div",(0,sO.__assign)({},ps(h),{"aria-controls":yC(o,i),"aria-disabled":r,"aria-expanded":a,"aria-selected":a,className:l(sk)(sP.TAB,t),"data-tab-id":i,id:yO(o,i),onClick:r?void 0:this.handleClick,role:"tab",tabIndex:r?void 0:a?0:-1}),null!=u&&v.createElement(pC,{icon:u,intent:f,className:sP.TAB_ICON}),s,n,null!=c&&v.createElement(yE,(0,sO.__assign)({minimal:!0,intent:f},d,{className:l(sk)(sP.TAB_TAG,null==d?void 0:d.className)}),c))},t.displayName="".concat(pa,".TabTitle"),t}(pO);function yC(e,t){return"".concat(sP.TAB_PANEL,"_").concat(e,"_").concat(t)}function yO(e,t){return"".concat(sP.TAB,"-title_").concat(e,"_").concat(t)}var yk=function(){return v.createElement("div",{className:sP.FLEX_EXPANDER})},yP=".".concat(sP.TAB),yT=function(e){function t(t){var n=e.call(this,t)||this;n.tablistElement=null,n.refHandlers={tablist:function(e){return n.tablistElement=e}},n.handleKeyDown=function(e){var t,r=null===(t=fe.getActiveElement(n.tablistElement))||void 0===t?void 0:t.closest(yP);if(null!=r){var i=n.getTabElements().filter(function(e){return"false"===e.getAttribute("aria-disabled")}),o=i.indexOf(r),a=n.getKeyCodeDirection(e);if(o>=0&&void 0!==a){e.preventDefault();var l=i.length;i[(o+a+l)%l].focus()}}},n.handleKeyPress=function(e){var t=e.target.closest(yP);null!=t&&fe.isKeyboardClick(e)&&(e.preventDefault(),t.click())},n.handleTabClick=function(e,t){var r,i;null===(i=(r=n.props).onChange)||void 0===i||i.call(r,e,n.state.selectedTabId,t),void 0===n.props.selectedTabId&&n.setState({selectedTabId:e})},n.renderTabPanel=function(e){var t=e.props,r=t.className,i=t.panel,o=t.id,a=t.panelClassName;if(void 0!==i)return v.createElement("div",{"aria-labelledby":yO(n.props.id,o),"aria-hidden":o!==n.state.selectedTabId,className:l(sk)(sP.TAB_PANEL,r,a),id:yC(n.props.id,o),key:o,role:"tabpanel"},i)},n.renderTabTitle=function(e){if(yA(e)){var t=e.props.id;return v.createElement(yS,(0,sO.__assign)({},e.props,{parentId:n.props.id,onClick:n.handleTabClick,selected:t===n.state.selectedTabId}))}return e};var r=n.getInitialSelectedTabId();return n.state={selectedTabId:r},n}return(0,sO.__extends)(t,e),t.getDerivedStateFromProps=function(e){var t=e.selectedTabId;return void 0!==t?{selectedTabId:t}:null},t.prototype.render=function(){var e,t,n=this.state,r=n.indicatorWrapperStyle,i=n.selectedTabId,o=v.Children.map(this.props.children,this.renderTabTitle),a=this.getTabChildren().filter(this.props.renderActiveTabPanelOnly?function(e){return e.props.id===i}:function(){return!0}).map(this.renderTabPanel),s=this.props.animate?v.createElement("div",{className:sP.TAB_INDICATOR_WRAPPER,style:r},v.createElement("div",{className:sP.TAB_INDICATOR})):null,u=l(sk)(sP.TABS,this.props.className,((e={})[sP.VERTICAL]=this.props.vertical,e[sP.FILL]=this.props.fill,e)),c=l(sk)(sP.TAB_LIST,((t={})[sP.LARGE]=this.props.large,t));return v.createElement("div",{className:u},v.createElement("div",{className:c,onKeyDown:this.handleKeyDown,onKeyPress:this.handleKeyPress,ref:this.refHandlers.tablist,role:"tablist"},s,o),a)},t.prototype.componentDidMount=function(){this.moveSelectionIndicator(!1)},t.prototype.componentDidUpdate=function(e,t){this.state.selectedTabId!==t.selectedTabId?this.moveSelectionIndicator():null==t.selectedTabId||fe.arraysEqual(this.getTabChildrenProps(e),this.getTabChildrenProps(),fe.shallowCompareKeys)||this.moveSelectionIndicator()},t.prototype.getInitialSelectedTabId=function(){var e=this.props,t=e.defaultSelectedTabId,n=e.selectedTabId;if(void 0!==n)return n;if(void 0!==t)return t;var r=this.getTabChildren();return 0===r.length?void 0:r[0].props.id},t.prototype.getKeyCodeDirection=function(e){return"ArrowLeft"===e.key||"ArrowUp"===e.key?-1:"ArrowRight"===e.key||"ArrowDown"===e.key?1:void 0},t.prototype.getTabChildrenProps=function(e){return void 0===e&&(e=this.props),this.getTabChildren(e).map(function(e){return e.props})},t.prototype.getTabChildren=function(e){return void 0===e&&(e=this.props),v.Children.toArray(e.children).filter(yA)},t.prototype.getTabElements=function(e){return(void 0===e&&(e=""),null==this.tablistElement)?[]:Array.from(this.tablistElement.querySelectorAll(yP+e))},t.prototype.moveSelectionIndicator=function(e){if(void 0===e&&(e=!0),null!=this.tablistElement&&this.props.animate){var t="".concat(yP,'[data-tab-id="').concat(this.state.selectedTabId,'"]'),n=this.tablistElement.querySelector(t),r={display:"none"};if(null!=n){var i=n.clientHeight,o=n.clientWidth,a=n.offsetLeft,l=n.offsetTop;r={height:i,transform:"translateX(".concat(Math.floor(a),"px) translateY(").concat(Math.floor(l),"px)"),width:o},e||(r.transition="none")}this.setState({indicatorWrapperStyle:r})}},t.Expander=yk,t.Tab=yx,t.defaultProps={animate:!0,fill:!1,large:!1,renderActiveTabPanelOnly:!1,vertical:!1},t.displayName="".concat(pa,".Tabs"),t}(pO);function yA(e){return fe.isElementOfType(e,yx)}var v=h("8NFma"),yN={};yN=h("6DzO8")();var yj={};Object.defineProperty(yj,"__esModule",{value:!0}),yj.ReactCSS=yj.loop=yj.handleActive=yj.handleHover=yj.hover=void 0;var yR={};Object.defineProperty(yR,"__esModule",{value:!0}),yR.flattenNames=void 0;var yI=h("h1l7t"),yL=h("5V8oz"),yM=h("hcK5n"),yD=xe(function(e){return"string"==typeof e||!yL(e)&&yM(e)&&"[object String]"==yI(e)}),yF={},yz=h("4V1MN"),yB=h("4hKXW"),yU=xe(yF=function(e,t){return e&&yz(e,yB(t))}),yH={},yI=h("h1l7t"),yV={};yV=h("blfKu")(Object.getPrototypeOf,Object);var yM=h("hcK5n"),yq=Object.prototype,yG=Function.prototype.toString,yW=yq.hasOwnProperty,y$=yG.call(Object),yK=xe(yH=function(e){if(!yM(e)||"[object Object]"!=yI(e))return!1;var t=yV(e);if(null===t)return!0;var n=yW.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&yG.call(n)==y$}),yY={};yY=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i};var yX={},yZ={},yQ={},yJ={},y0={},y1={};y1=function(){this.__data__=[],this.size=0};var y2={},y3={},y5={};y5=function(e,t){return e===t||e!=e&&t!=t},y3=function(e,t){for(var n=e.length;n--;)if(y5(e[n][0],t))return n;return -1};var y6=Array.prototype.splice;y2=function(e){var t=this.__data__,n=y3(t,e);return!(n<0)&&(n==t.length-1?t.pop():y6.call(t,n,1),--this.size,!0)};var y4={};y4=function(e){var t=this.__data__,n=y3(t,e);return n<0?void 0:t[n][1]};var y8={};y8=function(e){return y3(this.__data__,e)>-1};var y9={};function y7(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}y9=function(e,t){var n=this.__data__,r=y3(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},y7.prototype.clear=y1,y7.prototype.delete=y2,y7.prototype.get=y4,y7.prototype.has=y8,y7.prototype.set=y9,y0=y7;var be={};be=function(){this.__data__=new y0,this.size=0};var bt={};bt=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var bn={};bn=function(e){return this.__data__.get(e)};var br={};br=function(e){return this.__data__.has(e)};var bi={},bo={},ba={},bl={},bs=h("1F4Th"),bu={},bc={},bd=h("eeOBM");bc=bd["__core-js_shared__"];var bh=(Pw=/[^.]+$/.exec(bc&&bc.keys&&bc.keys.IE_PROTO||""))?"Symbol(src)_1."+Pw:"";bu=function(e){return!!bh&&bh in e};var bf=h("kNSK3"),bp={},bg=Function.prototype.toString;bp=function(e){if(null!=e){try{return bg.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var bm=/^\[object .+?Constructor\]$/,bv=Object.prototype,by=Function.prototype.toString,bb=bv.hasOwnProperty,bw=RegExp("^"+by.call(bb).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");bl=function(e){return!(!bf(e)||bu(e))&&(bs(e)?bw:bm).test(bp(e))};var bx={};bx=function(e,t){return null==e?void 0:e[t]},ba=function(e,t){var n=bx(e,t);return bl(n)?n:void 0};var bd=h("eeOBM");bo=ba(bd,"Map");var b_={},bE={},bS={},bC={},bO={};bO=ba(Object,"create"),bC=function(){this.__data__=bO?bO(null):{},this.size=0};var bk={};bk=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t};var bP={},bT=Object.prototype.hasOwnProperty;bP=function(e){var t=this.__data__;if(bO){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return bT.call(t,e)?t[e]:void 0};var bA={},bN=Object.prototype.hasOwnProperty;bA=function(e){var t=this.__data__;return bO?void 0!==t[e]:bN.call(t,e)};var bj={};function bR(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}bj=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=bO&&void 0===t?"__lodash_hash_undefined__":t,this},bR.prototype.clear=bC,bR.prototype.delete=bk,bR.prototype.get=bP,bR.prototype.has=bA,bR.prototype.set=bj,bS=bR,bE=function(){this.size=0,this.__data__={hash:new bS,map:new(bo||y0),string:new bS}};var bI={},bL={},bM={};bM=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},bL=function(e,t){var n=e.__data__;return bM(t)?n["string"==typeof t?"string":"hash"]:n.map},bI=function(e){var t=bL(this,e).delete(e);return this.size-=t?1:0,t};var bD={};bD=function(e){return bL(this,e).get(e)};var bF={};bF=function(e){return bL(this,e).has(e)};var bz={};function bB(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function bU(e){var t=this.__data__=new y0(e);this.size=t.size}bz=function(e,t){var n=bL(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},bB.prototype.clear=bE,bB.prototype.delete=bI,bB.prototype.get=bD,bB.prototype.has=bF,bB.prototype.set=bz,b_=bB,bi=function(e,t){var n=this.__data__;if(n instanceof y0){var r=n.__data__;if(!bo||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new b_(r)}return n.set(e,t),this.size=n.size,this},bU.prototype.clear=be,bU.prototype.delete=bt,bU.prototype.get=bn,bU.prototype.has=br,bU.prototype.set=bi,yJ=bU;var bH={},bV={},bq={},bG={},bW={};bW=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var b$={};function bK(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new b_;++t<n;)this.add(e[t])}b$=function(e){return this.__data__.has(e)},bK.prototype.add=bK.prototype.push=bW,bK.prototype.has=b$,bG=bK;var bY={};bY=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};var bX={};bX=function(e,t){return e.has(t)},bq=function(e,t,n,r,i,o){var a=1&n,l=e.length,s=t.length;if(l!=s&&!(a&&s>l))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,h=!0,f=2&n?new bG:void 0;for(o.set(e,t),o.set(t,e);++d<l;){var p=e[d],g=t[d];if(r)var m=a?r(g,p,d,t,e,o):r(p,g,d,e,t,o);if(void 0!==m){if(m)continue;h=!1;break}if(f){if(!bY(t,function(e,t){if(!bX(f,t)&&(p===e||i(p,e,n,r,o)))return f.push(t)})){h=!1;break}}else if(!(p===g||i(p,g,n,r,o))){h=!1;break}}return o.delete(e),o.delete(t),h};var bZ={},bQ=h("4Cb5x"),bJ={},bd=h("eeOBM");bJ=bd.Uint8Array;var b0={};b0=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n};var b1={};b1=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n};var b2=bQ?bQ.prototype:void 0,b3=b2?b2.valueOf:void 0;bZ=function(e,t,n,r,i,o,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!o(new bJ(e),new bJ(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return y5(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var l=b0;case"[object Set]":var s=1&r;if(l||(l=b1),e.size!=t.size&&!s)break;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var c=bq(l(e),l(t),r,i,o,a);return a.delete(e),c;case"[object Symbol]":if(b3)return b3.call(e)==b3.call(t)}return!1};var b5={},b6={},b4={},b8={};b8=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e};var yL=h("5V8oz");b4=function(e,t,n){var r=t(e);return yL(e)?r:b8(r,n(e))};var b9={},b7={};b7=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o};var we={};we=function(){return[]};var wt=Object.prototype.propertyIsEnumerable,wn=Object.getOwnPropertySymbols;b9=wn?function(e){return null==e?[]:(e=Object(e),b7(wn(e),function(t){return wt.call(e,t)}))}:we;var wr=h("8R54q");b6=function(e){return b4(e,wr,b9)};var wi=Object.prototype.hasOwnProperty;b5=function(e,t,n,r,i,o){var a=1&n,l=b6(e),s=l.length;if(s!=b6(t).length&&!a)return!1;for(var u=s;u--;){var c=l[u];if(!(a?c in t:wi.call(t,c)))return!1}var d=o.get(e),h=o.get(t);if(d&&h)return d==t&&h==e;var f=!0;o.set(e,t),o.set(t,e);for(var p=a;++u<s;){var g=e[c=l[u]],m=t[c];if(r)var v=a?r(m,g,c,t,e,o):r(g,m,c,e,t,o);if(!(void 0===v?g===m||i(g,m,n,r,o):v)){f=!1;break}p||(p="constructor"==c)}if(f&&!p){var y=e.constructor,b=t.constructor;y!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof y&&y instanceof y&&"function"==typeof b&&b instanceof b)&&(f=!1)}return o.delete(e),o.delete(t),f};var wo={},wa={},bd=h("eeOBM");wa=ba(bd,"DataView");var wl={},bd=h("eeOBM");wl=ba(bd,"Promise");var ws={},bd=h("eeOBM");ws=ba(bd,"Set");var wu={},bd=h("eeOBM");wu=ba(bd,"WeakMap");var yI=h("h1l7t"),wc="[object Map]",wd="[object Promise]",wh="[object Set]",wf="[object WeakMap]",wp="[object DataView]",wg=bp(wa),wm=bp(bo),wv=bp(wl),wy=bp(ws),wb=bp(wu),ww=yI;(wa&&ww(new wa(new ArrayBuffer(1)))!=wp||bo&&ww(new bo)!=wc||wl&&ww(wl.resolve())!=wd||ws&&ww(new ws)!=wh||wu&&ww(new wu)!=wf)&&(ww=function(e){var t=yI(e),n="[object Object]"==t?e.constructor:void 0,r=n?bp(n):"";if(r)switch(r){case wg:return wp;case wm:return wc;case wv:return wd;case wy:return wh;case wb:return wf}return t}),wo=ww;var yL=h("5V8oz"),wx=h("9e2tS"),w_=h("fAXjB"),wE="[object Arguments]",wS="[object Array]",wC="[object Object]",wO=Object.prototype.hasOwnProperty;bV=function(e,t,n,r,i,o){var a=yL(e),l=yL(t),s=a?wS:wo(e),u=l?wS:wo(t);s=s==wE?wC:s,u=u==wE?wC:u;var c=s==wC,d=u==wC,h=s==u;if(h&&wx(e)){if(!wx(t))return!1;a=!0,c=!1}if(h&&!c)return o||(o=new yJ),a||w_(e)?bq(e,t,n,r,i,o):bZ(e,t,s,n,r,i,o);if(!(1&n)){var f=c&&wO.call(e,"__wrapped__"),p=d&&wO.call(t,"__wrapped__");if(f||p){var g=f?e.value():e,m=p?t.value():t;return o||(o=new yJ),i(g,m,n,r,o)}}return!!h&&(o||(o=new yJ),b5(e,t,n,r,i,o))};var yM=h("hcK5n");bH=function e(t,n,r,i,o){return t===n||(null!=t&&null!=n&&(yM(t)||yM(n))?bV(t,n,r,i,e,o):t!=t&&n!=n)},yQ=function(e,t,n,r){var i=n.length,o=i,a=!r;if(null==e)return!o;for(e=Object(e);i--;){var l=n[i];if(a&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++i<o;){var s=(l=n[i])[0],u=e[s],c=l[1];if(a&&l[2]){if(void 0===u&&!(s in e))return!1}else{var d=new yJ;if(r)var h=r(u,c,s,e,t,d);if(!(void 0===h?bH(c,u,3,r,d):h))return!1}}return!0};var wk={},wP={},bf=h("kNSK3");wP=function(e){return e==e&&!bf(e)};var wr=h("8R54q");wk=function(e){for(var t=wr(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,wP(i)]}return t};var wT={};wT=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}},yZ=function(e){var t=wk(e);return 1==t.length&&t[0][2]?wT(t[0][0],t[0][1]):function(n){return n===e||yQ(n,e,t)}};var wA={},wN={},wj={},wR={},yL=h("5V8oz"),wI={},yL=h("5V8oz"),wL={},yI=h("h1l7t"),yM=h("hcK5n");wL=function(e){return"symbol"==typeof e||yM(e)&&"[object Symbol]"==yI(e)};var wM=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,wD=/^\w*$/;wI=function(e,t){if(yL(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||wL(e))||wD.test(e)||!wM.test(e)||null!=t&&e in Object(t)};var wF={},wz={};function wB(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(wB.Cache||b_),n}wB.Cache=b_;var wU=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wH=/\\(\\)?/g;kX=(kY=(wz=wB)(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(wU,function(e,n,r,i){t.push(r?i.replace(wH,"$1"):n||e)}),t},function(e){return 500===kX.size&&kX.clear(),e})).cache,wF=kY;var wV={},wq={},bQ=h("4Cb5x"),yL=h("5V8oz"),wG=1/0,wW=bQ?bQ.prototype:void 0,w$=wW?wW.toString:void 0;wq=function e(t){if("string"==typeof t)return t;if(yL(t))return yY(t,e)+"";if(wL(t))return w$?w$.call(t):"";var n=t+"";return"0"==n&&1/t==-wG?"-0":n},wV=function(e){return null==e?"":wq(e)},wR=function(e,t){return yL(e)?e:wI(e,t)?[e]:wF(wV(e))};var wK={},wY=1/0;wK=function(e){if("string"==typeof e||wL(e))return e;var t=e+"";return"0"==t&&1/e==-wY?"-0":t},wj=function(e,t){t=wR(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[wK(t[n++])];return n&&n==r?e:void 0},wN=function(e,t,n){var r=null==e?void 0:wj(e,t);return void 0===r?n:r};var wX={},wZ={};wZ=function(e,t){return null!=e&&t in Object(e)};var wQ={},wJ=h("4rbI4"),yL=h("5V8oz"),w0=h("74Ail"),w1=h("2zEBJ");wQ=function(e,t,n){t=wR(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var a=wK(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&w1(i)&&w0(a,i)&&(yL(e)||wJ(e))},wX=function(e,t){return null!=e&&wQ(e,t,wZ)},wA=function(e,t){return wI(e)&&wP(t)?wT(wK(e),t):function(n){var r=wN(n,e);return void 0===r&&r===t?wX(n,e):bH(t,r,3)}};var w2=h("38wdc"),yL=h("5V8oz"),w3={},w5={};w5=function(e){return function(t){return null==t?void 0:t[e]}};var w6={};w6=function(e){return function(t){return wj(t,e)}},w3=function(e){return wI(e)?w5(wK(e)):w6(e)},yX=function(e){return"function"==typeof e?e:null==e?w2:"object"==typeof e?yL(e)?wA(e[0],e[1]):yZ(e):w3(e)};var w4={},w8=h("gl8yj"),w9=h("iiJxK");w4=function(e,t){var n=-1,r=w9(e)?Array(e.length):[];return w8(e,function(e,i,o){r[++n]=t(e,i,o)}),r};var yL=h("5V8oz"),w7=xe(function(e,t){return(yL(e)?yY:w4)(e,yX(t,3))});function xe(e){return e&&e.__esModule?e:{default:e}}var xt=yR.flattenNames=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=[];return(0,w7.default)(t,function(t){Array.isArray(t)?e(t).map(function(e){return n.push(e)}):(0,yK.default)(t)?(0,yU.default)(t,function(e,t){!0===e&&n.push(t),n.push(t+"-"+e)}):(0,yD.default)(t)&&n.push(t)}),n};yR.default=xt;var xn=_f(yR),xr={};Object.defineProperty(xr,"__esModule",{value:!0}),xr.mergeClasses=void 0;var xi=x0(yF),xo={},xa=h("eQpse"),xl={},xs={},xu={};xu=function(){try{var e=ba(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),xs=function(e,t,n){"__proto__"==t&&xu?xu(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n};var xc=Object.prototype.hasOwnProperty;xl=function(e,t,n){var r=e[t];xc.call(e,t)&&y5(r,n)&&(void 0!==n||t in e)||xs(e,t,n)};var xd={},xh={};xh=function(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var l=t[o],s=r?r(n[l],e[l],l,n,e):void 0;void 0===s&&(s=e[l]),i?xs(n,l,s):xl(n,l,s)}return n};var wr=h("8R54q");xd=function(e,t){return e&&xh(t,wr(t),e)};var xf={},xp={},xg=h("hopFG"),xm={},bf=h("kNSK3"),xv=h("dWAd9"),xy={};xy=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t};var xb=Object.prototype.hasOwnProperty;xm=function(e){if(!bf(e))return xy(e);var t=xv(e),n=[];for(var r in e)"constructor"==r&&(t||!xb.call(e,r))||n.push(r);return n};var w9=h("iiJxK");xp=function(e){return w9(e)?xg(e,!0):xm(e)},xf=function(e,t){return e&&xh(t,xp(t),e)};var xw=h("lJ72B"),xx={};xx=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t};var x_={};x_=function(e,t){return xh(e,b9(e),t)};var xE={},xS={};xS=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)b8(t,b9(e)),e=yV(e);return t}:we,xE=function(e,t){return xh(e,xS(e),t)};var xC={};xC=function(e){return b4(e,xp,xS)};var xO={},xk=Object.prototype.hasOwnProperty;xO=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&xk.call(e,"index")&&(n.index=e.index,n.input=e.input),n};var xP={},xT={};xT=function(e){var t=new e.constructor(e.byteLength);return new bJ(t).set(new bJ(e)),t};var xA={};xA=function(e,t){var n=t?xT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)};var xN={},xj=/\w*$/;xN=function(e){var t=new e.constructor(e.source,xj.exec(e));return t.lastIndex=e.lastIndex,t};var xR={},bQ=h("4Cb5x"),xI=bQ?bQ.prototype:void 0,xL=xI?xI.valueOf:void 0;xR=function(e){return xL?Object(xL.call(e)):{}};var xM={};xM=function(e,t){var n=t?xT(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)},xP=function(e,t,n){var r=e.constructor;switch(t){case"[object ArrayBuffer]":return xT(e);case"[object Boolean]":case"[object Date]":return new r(+e);case"[object DataView]":return xA(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return xM(e,n);case"[object Map]":case"[object Set]":return new r;case"[object Number]":case"[object String]":return new r(e);case"[object RegExp]":return xN(e);case"[object Symbol]":return xR(e)}};var xD={},xF={},bf=h("kNSK3"),xz=Object.create;xF=function(){function e(){}return function(t){if(!bf(t))return{};if(xz)return xz(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();var xv=h("dWAd9");xD=function(e){return"function"!=typeof e.constructor||xv(e)?{}:xF(yV(e))};var yL=h("5V8oz"),wx=h("9e2tS"),xB={},xU={},yM=h("hcK5n");xU=function(e){return yM(e)&&"[object Map]"==wo(e)};var xH=h("cLhdb"),xV=h("fwpsA"),xq=xV&&xV.isMap;xB=xq?xH(xq):xU;var bf=h("kNSK3"),xG={},xW={},yM=h("hcK5n");xW=function(e){return yM(e)&&"[object Set]"==wo(e)};var xH=h("cLhdb"),xV=h("fwpsA"),x$=xV&&xV.isSet;xG=x$?xH(x$):xW;var wr=h("8R54q"),xK="[object Arguments]",xY="[object Function]",xX="[object Object]",xZ={};xZ[xK]=xZ["[object Array]"]=xZ["[object ArrayBuffer]"]=xZ["[object DataView]"]=xZ["[object Boolean]"]=xZ["[object Date]"]=xZ["[object Float32Array]"]=xZ["[object Float64Array]"]=xZ["[object Int8Array]"]=xZ["[object Int16Array]"]=xZ["[object Int32Array]"]=xZ["[object Map]"]=xZ["[object Number]"]=xZ[xX]=xZ["[object RegExp]"]=xZ["[object Set]"]=xZ["[object String]"]=xZ["[object Symbol]"]=xZ["[object Uint8Array]"]=xZ["[object Uint8ClampedArray]"]=xZ["[object Uint16Array]"]=xZ["[object Uint32Array]"]=!0,xZ["[object Error]"]=xZ[xY]=xZ["[object WeakMap]"]=!1,xo=function e(t,n,r,i,o,a){var l,s=1&n,u=2&n,c=4&n;if(r&&(l=o?r(t,i,o,a):r(t)),void 0!==l)return l;if(!bf(t))return t;var d=yL(t);if(d){if(l=xO(t),!s)return xx(t,l)}else{var h=wo(t),f=h==xY||"[object GeneratorFunction]"==h;if(wx(t))return xw(t,s);if(h==xX||h==xK||f&&!o){if(l=u||f?{}:xD(t),!s)return u?xE(t,xf(l,t)):x_(t,xd(l,t))}else{if(!xZ[h])return o?t:{};l=xP(t,h,s)}}a||(a=new yJ);var p=a.get(t);if(p)return p;a.set(t,l),xG(t)?t.forEach(function(i){l.add(e(i,n,r,i,t,a))}):xB(t)&&t.forEach(function(i,o){l.set(o,e(i,n,r,o,t,a))});var g=c?u?xC:b6:u?xp:wr,m=d?void 0:g(t);return xa(m||t,function(i,o){m&&(i=t[o=i]),xl(l,o,e(i,n,r,o,t,a))}),l};var xQ=x0(function(e){return xo(e,5)}),xJ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function x0(e){return e&&e.__esModule?e:{default:e}}var x1=xr.mergeClasses=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=e.default&&(0,xQ.default)(e.default)||{};return t.map(function(t){var r=e[t];return r&&(0,xi.default)(r,function(e,t){n[t]||(n[t]={}),n[t]=xJ({},n[t],r[t])}),t}),n};xr.default=x1;var x2=_f(xr),x3={};Object.defineProperty(x3,"__esModule",{value:!0}),x3.autoprefix=void 0;var x5=(k1=yF)&&k1.__esModule?k1:{default:k1},x6=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},x4={borderRadius:function(e){return{msBorderRadius:e,MozBorderRadius:e,OBorderRadius:e,WebkitBorderRadius:e,borderRadius:e}},boxShadow:function(e){return{msBoxShadow:e,MozBoxShadow:e,OBoxShadow:e,WebkitBoxShadow:e,boxShadow:e}},userSelect:function(e){return{WebkitTouchCallout:e,KhtmlUserSelect:e,MozUserSelect:e,msUserSelect:e,WebkitUserSelect:e,userSelect:e}},flex:function(e){return{WebkitBoxFlex:e,MozBoxFlex:e,WebkitFlex:e,msFlex:e,flex:e}},flexBasis:function(e){return{WebkitFlexBasis:e,flexBasis:e}},justifyContent:function(e){return{WebkitJustifyContent:e,justifyContent:e}},transition:function(e){return{msTransition:e,MozTransition:e,OTransition:e,WebkitTransition:e,transition:e}},transform:function(e){return{msTransform:e,MozTransform:e,OTransform:e,WebkitTransform:e,transform:e}},absolute:function(e){var t=e&&e.split(" ");return{position:"absolute",top:t&&t[0],right:t&&t[1],bottom:t&&t[2],left:t&&t[3]}},extend:function(e,t){return t[e]||{extend:e}}},x8=x3.autoprefix=function(e){var t={};return(0,x5.default)(e,function(e,n){var r={};(0,x5.default)(e,function(e,t){var n=x4[t];n?r=x6({},r,n(e)):r[t]=e}),t[n]=r}),t};x3.default=x8;var x9=_f(x3),x7={};Object.defineProperty(x7,"__esModule",{value:!0}),x7.hover=void 0;var _e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=h("8NFma"),_t=(k2=v)&&k2.__esModule?k2:{default:k2};function _n(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var _r=x7.hover=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r);for(var n,i,o,a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return i=o=_n(this,(n=r.__proto__||Object.getPrototypeOf(r)).call.apply(n,[this].concat(l))),o.state={hover:!1},o.handleMouseOver=function(){return o.setState({hover:!0})},o.handleMouseOut=function(){return o.setState({hover:!1})},o.render=function(){return _t.default.createElement(t,{onMouseOver:o.handleMouseOver,onMouseOut:o.handleMouseOut},_t.default.createElement(e,_e({},o.props,o.state)))},_n(o,i)}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,n),r}(_t.default.Component)};x7.default=_r;var _i=_f(x7),_o={};Object.defineProperty(_o,"__esModule",{value:!0}),_o.active=void 0;var _a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=h("8NFma"),_l=(k3=v)&&k3.__esModule?k3:{default:k3};function _s(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var _u=_o.active=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"span";return function(n){function r(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,r);for(var n,i,o,a=arguments.length,l=Array(a),s=0;s<a;s++)l[s]=arguments[s];return i=o=_s(this,(n=r.__proto__||Object.getPrototypeOf(r)).call.apply(n,[this].concat(l))),o.state={active:!1},o.handleMouseDown=function(){return o.setState({active:!0})},o.handleMouseUp=function(){return o.setState({active:!1})},o.render=function(){return _l.default.createElement(t,{onMouseDown:o.handleMouseDown,onMouseUp:o.handleMouseUp},_l.default.createElement(e,_a({},o.props,o.state)))},_s(o,i)}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(r,n),r}(_l.default.Component)};_o.default=_u;var _c=_f(_o),_d={};Object.defineProperty(_d,"__esModule",{value:!0}),_d.default=function(e,t){var n={},r=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];n[e]=t};return 0===e&&r("first-child"),e===t-1&&r("last-child"),(0===e||e%2==0)&&r("even"),1===Math.abs(e%2)&&r("odd"),r("nth-child",e),n};var _h=_f(_d);function _f(e){return e&&e.__esModule?e:{default:e}}yj.hover=_i.default,yj.handleHover=_i.default,yj.handleActive=_c.default,yj.loop=_h.default;var _p=yj.ReactCSS=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var i=(0,xn.default)(n),o=(0,x2.default)(e,i);return(0,x9.default)(o)};yj.default=_p;var _g={},_m={},_v={};_v=function(e,t,n){(void 0===n||y5(e[t],n))&&(void 0!==n||t in e)||xs(e,t,n)};var _y=h("e3j3J"),_b={},xw=h("lJ72B"),wJ=h("4rbI4"),yL=h("5V8oz"),_w={},w9=h("iiJxK"),yM=h("hcK5n");_w=function(e){return yM(e)&&w9(e)};var wx=h("9e2tS"),bs=h("1F4Th"),bf=h("kNSK3"),w_=h("fAXjB"),_x={};_x=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]};var __={};__=function(e){return xh(e,xp(e))},_b=function(e,t,n,r,i,o,a){var l=_x(e,n),s=_x(t,n),u=a.get(s);if(u){_v(e,n,u);return}var c=o?o(l,s,n+"",e,t,a):void 0,d=void 0===c;if(d){var h=yL(s),f=!h&&wx(s),p=!h&&!f&&w_(s);c=s,h||f||p?yL(l)?c=l:_w(l)?c=xx(l):f?(d=!1,c=xw(s,!0)):p?(d=!1,c=xM(s,!0)):c=[]:yH(s)||wJ(s)?(c=l,wJ(l)?c=__(l):(!bf(l)||bs(l))&&(c=xD(s))):d=!1}d&&(a.set(s,c),i(c,s,r,o,a),a.delete(s)),_v(e,n,c)};var bf=h("kNSK3");_m=function e(t,n,r,i,o){t!==n&&_y(n,function(a,l){if(o||(o=new yJ),bf(a))_b(t,n,l,r,e,i,o);else{var s=i?i(_x(t,l),a,l+"",t,n,o):void 0;void 0===s&&(s=a),_v(t,l,s)}},xp)};var _E={},w2=h("38wdc"),_S={},_C={};_C=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)};var _O=Math.max;_S=function(e,t,n){return t=_O(void 0===t?e.length-1:t,0),function(){for(var r=arguments,i=-1,o=_O(r.length-t,0),a=Array(o);++i<o;)a[i]=r[t+i];i=-1;for(var l=Array(t+1);++i<t;)l[i]=r[i];return l[t]=n(a),_C(e,this,l)}};var _k={},_P={},_T={};_T=function(e){return function(){return e}};var w2=h("38wdc"),_A=Date.now;kZ=xu?function(e,t){return xu(e,"toString",{configurable:!0,enumerable:!1,value:_T(t),writable:!0})}:w2,kQ=0,kJ=0,_k=function(){var e=_A(),t=16-(e-kJ);if(kJ=e,t>0){if(++kQ>=800)return arguments[0]}else kQ=0;return kZ.apply(void 0,arguments)},_E=function(e,t){return _k(_S(e,t,w2),e+"")};var _N={},w9=h("iiJxK"),w0=h("74Ail"),bf=h("kNSK3");_N=function(e,t,n){if(!bf(n))return!1;var r=typeof t;return("number"==r?!!(w9(n)&&w0(t,n.length)):"string"==r&&t in n)&&y5(n[t],e)},k0=function(e,t,n){_m(e,t,n)},_g=_E(function(e,t){var n=-1,r=t.length,i=r>1?t[r-1]:void 0,o=r>2?t[2]:void 0;for(i=k0.length>3&&"function"==typeof i?(r--,i):void 0,o&&_N(t[0],t[1],o)&&(i=r<3?void 0:i,r=1),e=Object(e);++n<r;){var a=t[n];a&&k0(e,a,n,i)}return e});var _j={},v=(h("8NFma"),h("8NFma")),_R={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},_I=v.createContext&&v.createContext(_R),_L=function(){return(_L=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},_M=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)0>t.indexOf(r[i])&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function _D(e){return function(t){return v.createElement(_F,_L({attr:_L({},e.attr)},t,{hasStrokes:function e(t){for(var n in t)if("_"!==n[0]){if("stroke"===n)return!0;if("object"==typeof t[n]){var r=e(t[n]);if(r)return r}else if("content"===n&&"style"===t.tag&&t[n].includes("stroke:"))return!0}return!1}(e)}),function e(t){return t&&t.map(function(t,n){return v.createElement(t.tag,_L({key:n},t.attr),e(t.child))})}(e.child))}}function _F(e){var t=function(t){var n,r=e.size||t.size||"1em";t.className&&(n=t.className),e.className&&(n=(n?n+" ":"")+e.className);var i=e.attr,o=e.fill,a=e.title,l=e.hasStrokes,s=_M(e,["attr","fill","title","hasStrokes"]);return v.createElement("svg",_L({stroke:"currentColor",fill:o},l?null:{strokeWidth:0},t.attr,i,s,{className:n,style:_L(_L({color:e.color||t.color},t.style),e.style),height:r,width:r,xmlns:"http://www.w3.org/2000/svg"}),a&&v.createElement("title",null,a),e.children)};return void 0!==_I?v.createElement(_I.Consumer,null,function(e){return t(e)}):t(_R)}_j=function(e){return _D({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M20.3847 2.87868C19.2132 1.70711 17.3137 1.70711 16.1421 2.87868L14.0202 5.00052L13.313 4.29332C12.9225 3.9028 12.2894 3.9028 11.8988 4.29332C11.5083 4.68385 11.5083 5.31701 11.8988 5.70754L17.5557 11.3644C17.9462 11.7549 18.5794 11.7549 18.9699 11.3644C19.3604 10.9739 19.3604 10.3407 18.9699 9.95018L18.2629 9.24316L20.3847 7.12132C21.5563 5.94975 21.5563 4.05025 20.3847 2.87868Z",fill:"currentColor"}},{tag:"path",attr:{fillRule:"evenodd",clipRule:"evenodd",d:"M11.9297 7.09116L4.1515 14.8693C3.22786 15.793 3.03239 17.169 3.5651 18.2842L1.99994 19.8493L3.41415 21.2635L4.97931 19.6984C6.09444 20.2311 7.4705 20.0356 8.39414 19.112L16.1723 11.3338L11.9297 7.09116ZM13.3439 11.3338L11.9297 9.91959L5.56571 16.2835C5.17518 16.6741 5.17518 17.3072 5.56571 17.6978C5.95623 18.0883 6.5894 18.0883 6.97992 17.6978L13.3439 11.3338Z",fill:"currentColor"}}],content:"\n"})(e)};var _z={};Object.defineProperty(_z,"__esModule",{value:!0});var _B={};Object.defineProperty(_B,"__esModule",{value:!0}),_B.Alpha=void 0;var _U=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_H=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),v=h("8NFma"),_V=_5(v),_q=_5(yj),_G={};Object.defineProperty(_G,"__esModule",{value:!0}),_G.calculateChange=function(e,t,n,r,i){var o=i.clientWidth,a=i.clientHeight,l="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,s="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,u=l-(i.getBoundingClientRect().left+window.pageXOffset),c=s-(i.getBoundingClientRect().top+window.pageYOffset);if("vertical"===n){var d=void 0;if(d=c<0?0:c>a?1:Math.round(100*c/a)/100,t.a!==d)return{h:t.h,s:t.s,l:t.l,a:d,source:"rgb"}}else{var h=void 0;if(r!==(h=u<0?0:u>o?1:Math.round(100*u/o)/100))return{h:t.h,s:t.s,l:t.l,a:h,source:"rgb"}}return null};var _W=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(_G),_$={};Object.defineProperty(_$,"__esModule",{value:!0}),_$.Checkboard=void 0;var _K=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=h("8NFma"),_Y=_1(v),_X=_1(yj),_Z={};Object.defineProperty(_Z,"__esModule",{value:!0});var _Q={},_J=_Z.render=function(e,t,n,r){if("undefined"==typeof document&&!r)return null;var i=r?new r:document.createElement("canvas");i.width=2*n,i.height=2*n;var o=i.getContext("2d");return o?(o.fillStyle=e,o.fillRect(0,0,i.width,i.height),o.fillStyle=t,o.fillRect(0,0,n,n),o.translate(n,n),o.fillRect(0,0,n,n),i.toDataURL()):null};_Z.get=function(e,t,n,r){var i=e+"-"+t+"-"+n+(r?"-server":"");if(_Q[i])return _Q[i];var o=_J(e,t,n,r);return _Q[i]=o,o};var _0=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(_Z);function _1(e){return e&&e.__esModule?e:{default:e}}var _2=_$.Checkboard=function(e){var t=e.white,n=e.grey,r=e.size,i=e.renderers,o=e.borderRadius,a=e.boxShadow,l=e.children,s=(0,_X.default)({default:{grid:{borderRadius:o,boxShadow:a,absolute:"0px 0px 0px 0px",background:"url("+_0.get(t,n,r,i.canvas)+") center left"}}});return(0,v.isValidElement)(l)?_Y.default.cloneElement(l,_K({},l.props,{style:_K({},l.props.style,s.grid)})):_Y.default.createElement("div",{style:s.grid})};_2.defaultProps={size:8,white:"transparent",grey:"rgba(0,0,0,.08)",renderers:{}},_$.default=_2;var _3=_5(_$);function _5(e){return e&&e.__esModule?e:{default:e}}function _6(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var _4=_B.Alpha=function(e){function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);for(var e,n,r,i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=_6(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.handleChange=function(e){var t=_W.calculateChange(e,r.props.hsl,r.props.direction,r.props.a,r.container);t&&"function"==typeof r.props.onChange&&r.props.onChange(t,e)},r.handleMouseDown=function(e){r.handleChange(e),window.addEventListener("mousemove",r.handleChange),window.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},r.unbindEventListeners=function(){window.removeEventListener("mousemove",r.handleChange),window.removeEventListener("mouseup",r.handleMouseUp)},_6(r,n)}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),_H(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"render",value:function(){var e=this,t=this.props.rgb,n=(0,_q.default)({default:{alpha:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},checkboard:{absolute:"0px 0px 0px 0px",overflow:"hidden",borderRadius:this.props.radius},gradient:{absolute:"0px 0px 0px 0px",background:"linear-gradient(to right, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)",boxShadow:this.props.shadow,borderRadius:this.props.radius},container:{position:"relative",height:"100%",margin:"0 3px"},pointer:{position:"absolute",left:100*t.a+"%"},slider:{width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",marginTop:"1px",transform:"translateX(-2px)"}},vertical:{gradient:{background:"linear-gradient(to bottom, rgba("+t.r+","+t.g+","+t.b+", 0) 0%,\n rgba("+t.r+","+t.g+","+t.b+", 1) 100%)"},pointer:{left:0,top:100*t.a+"%"}},overwrite:_U({},this.props.style)},{vertical:"vertical"===this.props.direction,overwrite:!0});return _V.default.createElement("div",{style:n.alpha},_V.default.createElement("div",{style:n.checkboard},_V.default.createElement(_3.default,{renderers:this.props.renderers})),_V.default.createElement("div",{style:n.gradient}),_V.default.createElement("div",{style:n.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},_V.default.createElement("div",{style:n.pointer},this.props.pointer?_V.default.createElement(this.props.pointer,this.props):_V.default.createElement("div",{style:n.slider}))))}}]),t}(v.PureComponent||v.Component);_B.default=_4,Object.defineProperty(_z,"Alpha",{enumerable:!0,get:function(){return St(_B).default}}),Object.defineProperty(_z,"Checkboard",{enumerable:!0,get:function(){return St(_$).default}});var _8={};Object.defineProperty(_8,"__esModule",{value:!0}),_8.EditableInput=void 0;var _9=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),v=h("8NFma"),_7=Et(v),Ee=Et(yj);function Et(e){return e&&e.__esModule?e:{default:e}}var En=[38,40],Er=1,Ei=_8.EditableInput=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.handleBlur=function(){n.state.blurValue&&n.setState({value:n.state.blurValue,blurValue:null})},n.handleChange=function(e){n.setUpdatedValue(e.target.value,e)},n.handleKeyDown=function(e){var t,r=Number(String(e.target.value).replace(/%/g,""));if(!isNaN(r)&&(t=e.keyCode,En.indexOf(t)>-1)){var i=n.getArrowOffset(),o=38===e.keyCode?r+i:r-i;n.setUpdatedValue(o,e)}},n.handleDrag=function(e){if(n.props.dragLabel){var t=Math.round(n.props.value+e.movementX);t>=0&&t<=n.props.dragMax&&n.props.onChange&&n.props.onChange(n.getValueObjectWithLabel(t),e)}},n.handleMouseDown=function(e){n.props.dragLabel&&(e.preventDefault(),n.handleDrag(e),window.addEventListener("mousemove",n.handleDrag),window.addEventListener("mouseup",n.handleMouseUp))},n.handleMouseUp=function(){n.unbindEventListeners()},n.unbindEventListeners=function(){window.removeEventListener("mousemove",n.handleDrag),window.removeEventListener("mouseup",n.handleMouseUp)},n.state={value:String(e.value).toUpperCase(),blurValue:String(e.value).toUpperCase()},n.inputId="rc-editable-input-"+Er++,n}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),_9(t,[{key:"componentDidUpdate",value:function(e,t){this.props.value!==this.state.value&&(e.value!==this.props.value||t.value!==this.state.value)&&(this.input===document.activeElement?this.setState({blurValue:String(this.props.value).toUpperCase()}):this.setState({value:String(this.props.value).toUpperCase(),blurValue:!this.state.blurValue&&String(this.props.value).toUpperCase()}))}},{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"getValueObjectWithLabel",value:function(e){var t,n;return t={},(n=this.props.label)in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}},{key:"getArrowOffset",value:function(){return this.props.arrowOffset||1}},{key:"setUpdatedValue",value:function(e,t){var n=this.props.label?this.getValueObjectWithLabel(e):e;this.props.onChange&&this.props.onChange(n,t),this.setState({value:e})}},{key:"render",value:function(){var e=this,t=(0,Ee.default)({default:{wrap:{position:"relative"}},"user-override":{wrap:this.props.style&&this.props.style.wrap?this.props.style.wrap:{},input:this.props.style&&this.props.style.input?this.props.style.input:{},label:this.props.style&&this.props.style.label?this.props.style.label:{}},"dragLabel-true":{label:{cursor:"ew-resize"}}},{"user-override":!0},this.props);return _7.default.createElement("div",{style:t.wrap},_7.default.createElement("input",{id:this.inputId,style:t.input,ref:function(t){return e.input=t},value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,onBlur:this.handleBlur,placeholder:this.props.placeholder,spellCheck:"false"}),this.props.label&&!this.props.hideLabel?_7.default.createElement("label",{htmlFor:this.inputId,style:t.label,onMouseDown:this.handleMouseDown},this.props.label):null)}}]),t}(v.PureComponent||v.Component);_8.default=Ei,Object.defineProperty(_z,"EditableInput",{enumerable:!0,get:function(){return St(_8).default}});var Eo={};Object.defineProperty(Eo,"__esModule",{value:!0}),Eo.Hue=void 0;var Ea=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),v=h("8NFma"),El=Ed(v),Es=Ed(yj),Eu={};Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.calculateChange=function(e,t,n,r){var i=r.clientWidth,o=r.clientHeight,a="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,l="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,s=a-(r.getBoundingClientRect().left+window.pageXOffset),u=l-(r.getBoundingClientRect().top+window.pageYOffset);if("vertical"===t){var c=void 0;if(c=u<0?359:u>o?0:360*(-(100*u/o)+100)/100,n.h!==c)return{h:c,s:n.s,l:n.l,a:n.a,source:"hsl"}}else{var d=void 0;if(d=s<0?0:s>i?359:100*s/i*360/100,n.h!==d)return{h:d,s:n.s,l:n.l,a:n.a,source:"hsl"}}return null};var Ec=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(Eu);function Ed(e){return e&&e.__esModule?e:{default:e}}function Eh(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}var Ef=Eo.Hue=function(e){function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);for(var e,n,r,i=arguments.length,o=Array(i),a=0;a<i;a++)o[a]=arguments[a];return n=r=Eh(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(o))),r.handleChange=function(e){var t=Ec.calculateChange(e,r.props.direction,r.props.hsl,r.container);t&&"function"==typeof r.props.onChange&&r.props.onChange(t,e)},r.handleMouseDown=function(e){r.handleChange(e),window.addEventListener("mousemove",r.handleChange),window.addEventListener("mouseup",r.handleMouseUp)},r.handleMouseUp=function(){r.unbindEventListeners()},Eh(r,n)}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),Ea(t,[{key:"componentWillUnmount",value:function(){this.unbindEventListeners()}},{key:"unbindEventListeners",value:function(){window.removeEventListener("mousemove",this.handleChange),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.direction,n=void 0===t?"horizontal":t,r=(0,Es.default)({default:{hue:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius,boxShadow:this.props.shadow},container:{padding:"0 2px",position:"relative",height:"100%",borderRadius:this.props.radius},pointer:{position:"absolute",left:100*this.props.hsl.h/360+"%"},slider:{marginTop:"1px",width:"4px",borderRadius:"1px",height:"8px",boxShadow:"0 0 2px rgba(0, 0, 0, .6)",background:"#fff",transform:"translateX(-2px)"}},vertical:{pointer:{left:"0px",top:-(100*this.props.hsl.h/360)+100+"%"}}},{vertical:"vertical"===n});return El.default.createElement("div",{style:r.hue},El.default.createElement("div",{className:"hue-"+n,style:r.container,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},El.default.createElement("style",null,"\n .hue-horizontal {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0\n 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to right, #f00 0%, #ff0\n 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n\n .hue-vertical {\n background: linear-gradient(to top, #f00 0%, #ff0 17%, #0f0 33%,\n #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n background: -webkit-linear-gradient(to top, #f00 0%, #ff0 17%,\n #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n }\n "),El.default.createElement("div",{style:r.pointer},this.props.pointer?El.default.createElement(this.props.pointer,this.props):El.default.createElement("div",{style:r.slider}))))}}]),t}(v.PureComponent||v.Component);Eo.default=Ef,Object.defineProperty(_z,"Hue",{enumerable:!0,get:function(){return St(Eo).default}});var Ep={};Object.defineProperty(Ep,"__esModule",{value:!0}),Ep.Raised=void 0;var v=h("8NFma"),Eg=Eb(v),Em=Eb(yN),Ev=Eb(yj),Ey=Eb(_g);function Eb(e){return e&&e.__esModule?e:{default:e}}var Ew=Ep.Raised=function(e){var t=e.zDepth,n=e.radius,r=e.background,i=e.children,o=e.styles,a=(0,Ev.default)((0,Ey.default)({default:{wrap:{position:"relative",display:"inline-block"},content:{position:"relative"},bg:{absolute:"0px 0px 0px 0px",boxShadow:"0 "+t+"px "+4*t+"px rgba(0,0,0,.24)",borderRadius:n,background:r}},"zDepth-0":{bg:{boxShadow:"none"}},"zDepth-1":{bg:{boxShadow:"0 2px 10px rgba(0,0,0,.12), 0 2px 5px rgba(0,0,0,.16)"}},"zDepth-2":{bg:{boxShadow:"0 6px 20px rgba(0,0,0,.19), 0 8px 17px rgba(0,0,0,.2)"}},"zDepth-3":{bg:{boxShadow:"0 17px 50px rgba(0,0,0,.19), 0 12px 15px rgba(0,0,0,.24)"}},"zDepth-4":{bg:{boxShadow:"0 25px 55px rgba(0,0,0,.21), 0 16px 28px rgba(0,0,0,.22)"}},"zDepth-5":{bg:{boxShadow:"0 40px 77px rgba(0,0,0,.22), 0 27px 24px rgba(0,0,0,.2)"}},square:{bg:{borderRadius:"0"}},circle:{bg:{borderRadius:"50%"}}},void 0===o?{}:o),{"zDepth-1":1===t});return Eg.default.createElement("div",{style:a.wrap},Eg.default.createElement("div",{style:a.bg}),Eg.default.createElement("div",{style:a.content},i))};Ew.propTypes={background:Em.default.string,zDepth:Em.default.oneOf([0,1,2,3,4,5]),radius:Em.default.number,styles:Em.default.object},Ew.defaultProps={background:"#fff",zDepth:1,radius:2,styles:{}},Ep.default=Ew,Object.defineProperty(_z,"Raised",{enumerable:!0,get:function(){return St(Ep).default}});var Ex={};Object.defineProperty(Ex,"__esModule",{value:!0}),Ex.Saturation=void 0;var E_=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),v=h("8NFma"),EE=EH(v),ES=EH(yj),EC={},bf=h("kNSK3"),EO={},bd=h("eeOBM");EO=function(){return bd.Date.now()};var Ek={},EP={},ET={},EA=/\s/;ET=function(e){for(var t=e.length;t--&&EA.test(e.charAt(t)););return t};var EN=/^\s+/;EP=function(e){return e?e.slice(0,ET(e)+1).replace(EN,""):e};var bf=h("kNSK3"),Ej=0/0,ER=/^[-+]0x[0-9a-f]+$/i,EI=/^0b[01]+$/i,EL=/^0o[0-7]+$/i,EM=parseInt;Ek=function(e){if("number"==typeof e)return e;if(wL(e))return Ej;if(bf(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=bf(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=EP(e);var n=EI.test(e);return n||EL.test(e)?EM(e.slice(2),n?2:8):ER.test(e)?Ej:+e};var ED=Math.max,EF=Math.min;EC=function(e,t,n){var r,i,o,a,l,s,u=0,c=!1,d=!1,h=!0;if("function"!=typeof e)throw TypeError("Expected a function");function f(t){var n=r,o=i;return r=i=void 0,u=t,a=e.apply(o,n)}function p(e){var n=e-s,r=e-u;return void 0===s||n>=t||n<0||d&&r>=o}function g(){var e,n,r,i=EO();if(p(i))return m(i);l=setTimeout(g,(e=i-s,n=i-u,r=t-e,d?EF(r,o-n):r))}function m(e){return(l=void 0,h&&r)?f(e):(r=i=void 0,a)}function v(){var e,n=EO(),o=p(n);if(r=arguments,i=this,s=n,o){if(void 0===l)return u=e=s,l=setTimeout(g,t),c?f(e):a;if(d)return clearTimeout(l),l=setTimeout(g,t),f(s)}return void 0===l&&(l=setTimeout(g,t)),a}return t=Ek(t)||0,bf(n)&&(c=!!n.leading,o=(d="maxWait"in n)?ED(Ek(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h),v.cancel=function(){void 0!==l&&clearTimeout(l),u=0,r=s=i=l=void 0},v.flush=function(){return void 0===l?a:m(EO())},v};var bf=h("kNSK3"),Ez=EH(function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw TypeError("Expected a function");return bf(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),EC(e,t,{leading:r,maxWait:t,trailing:i})}),EB={};Object.defineProperty(EB,"__esModule",{value:!0}),EB.calculateChange=function(e,t,n){var r=n.getBoundingClientRect(),i=r.width,o=r.height,a="number"==typeof e.pageX?e.pageX:e.touches[0].pageX,l="number"==typeof e.pageY?e.pageY:e.touches[0].pageY,s=a-(n.getBoundingClientRect().left+window.pageXOffset),u=l-(n.getBoundingClientRect().top+window.pageYOffset);s<0?s=0:s>i&&(s=i),u<0?u=0:u>o&&(u=o);var c=s/i,d=1-u/o;return{h:t.h,s:c,v:d,a:t.a,source:"hsv"}};var EU=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(EB);function EH(e){return e&&e.__esModule?e:{default:e}}var EV=Ex.Saturation=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.handleChange=function(e){"function"==typeof n.props.onChange&&n.throttle(n.props.onChange,EU.calculateChange(e,n.props.hsl,n.container),e)},n.handleMouseDown=function(e){n.handleChange(e);var t=n.getContainerRenderWindow();t.addEventListener("mousemove",n.handleChange),t.addEventListener("mouseup",n.handleMouseUp)},n.handleMouseUp=function(){n.unbindEventListeners()},n.throttle=(0,Ez.default)(function(e,t,n){e(t,n)},50),n}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),E_(t,[{key:"componentWillUnmount",value:function(){this.throttle.cancel(),this.unbindEventListeners()}},{key:"getContainerRenderWindow",value:function(){for(var e=this.container,t=window;!t.document.contains(e)&&t.parent!==t;)t=t.parent;return t}},{key:"unbindEventListeners",value:function(){var e=this.getContainerRenderWindow();e.removeEventListener("mousemove",this.handleChange),e.removeEventListener("mouseup",this.handleMouseUp)}},{key:"render",value:function(){var e=this,t=this.props.style||{},n=t.color,r=t.white,i=t.black,o=t.pointer,a=t.circle,l=(0,ES.default)({default:{color:{absolute:"0px 0px 0px 0px",background:"hsl("+this.props.hsl.h+",100%, 50%)",borderRadius:this.props.radius},white:{absolute:"0px 0px 0px 0px",borderRadius:this.props.radius},black:{absolute:"0px 0px 0px 0px",boxShadow:this.props.shadow,borderRadius:this.props.radius},pointer:{position:"absolute",top:-(100*this.props.hsv.v)+100+"%",left:100*this.props.hsv.s+"%",cursor:"default"},circle:{width:"4px",height:"4px",boxShadow:"0 0 0 1.5px #fff, inset 0 0 1px 1px rgba(0,0,0,.3),\n 0 0 1px 2px rgba(0,0,0,.4)",borderRadius:"50%",cursor:"hand",transform:"translate(-2px, -2px)"}},custom:{color:n,white:r,black:i,pointer:o,circle:a}},{custom:!!this.props.style});return EE.default.createElement("div",{style:l.color,ref:function(t){return e.container=t},onMouseDown:this.handleMouseDown,onTouchMove:this.handleChange,onTouchStart:this.handleChange},EE.default.createElement("style",null,"\n .saturation-white {\n background: -webkit-linear-gradient(to right, #fff, rgba(255,255,255,0));\n background: linear-gradient(to right, #fff, rgba(255,255,255,0));\n }\n .saturation-black {\n background: -webkit-linear-gradient(to top, #000, rgba(0,0,0,0));\n background: linear-gradient(to top, #000, rgba(0,0,0,0));\n }\n "),EE.default.createElement("div",{style:l.white,className:"saturation-white"},EE.default.createElement("div",{style:l.black,className:"saturation-black"}),EE.default.createElement("div",{style:l.pointer},this.props.pointer?EE.default.createElement(this.props.pointer,this.props):EE.default.createElement("div",{style:l.circle}))))}}]),t}(v.PureComponent||v.Component);Ex.default=EV,Object.defineProperty(_z,"Saturation",{enumerable:!0,get:function(){return St(Ex).default}});var Eq={};Object.defineProperty(Eq,"__esModule",{value:!0}),Eq.ColorWrap=void 0;var EG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},EW=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),v=h("8NFma"),E$=E1(v),EK=E1(EC),EY={};Object.defineProperty(EY,"__esModule",{value:!0}),EY.isvalidColorString=EY.red=EY.getContrastingColor=EY.isValidHex=EY.toState=EY.simpleCheckForValidColor=void 0;var EX=EQ(h("2MeUa")),EZ=EQ(function(){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}var t,n,r,i=/^\s+/,o=/\s+$/;function a(t,n){if(n=n||{},(t=t||"")instanceof a)return t;if(!(this instanceof a))return new a(t,n);var r,l,s,u,c,d,h,f,p,g,m,v,y,b,w,x,_,S,k,T,N=(l={r:0,g:0,b:0},s=1,u=null,c=null,d=null,h=!1,f=!1,"string"==typeof(r=t)&&(r=function(e){e=e.replace(i,"").replace(o,"").toLowerCase();var t,n=!1;if(E[e])e=E[e],n=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=j.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=j.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=j.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=j.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=j.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=j.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=j.hex8.exec(e))?{r:P(t[1]),g:P(t[2]),b:P(t[3]),a:P(t[4])/255,format:n?"name":"hex8"}:(t=j.hex6.exec(e))?{r:P(t[1]),g:P(t[2]),b:P(t[3]),format:n?"name":"hex"}:(t=j.hex4.exec(e))?{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),a:P(t[4]+""+t[4])/255,format:n?"name":"hex8"}:!!(t=j.hex3.exec(e))&&{r:P(t[1]+""+t[1]),g:P(t[2]+""+t[2]),b:P(t[3]+""+t[3]),format:n?"name":"hex"}}(r)),"object"==e(r)&&(R(r.r)&&R(r.g)&&R(r.b)?(p=r.r,g=r.g,m=r.b,l={r:255*O(p,255),g:255*O(g,255),b:255*O(m,255)},h=!0,f="%"===String(r.r).substr(-1)?"prgb":"rgb"):R(r.h)&&R(r.s)&&R(r.v)?(u=A(r.s),c=A(r.v),v=r.h,y=u,b=c,v=6*O(v,360),y=O(y,100),b=O(b,100),w=Math.floor(v),x=v-w,_=b*(1-y),S=b*(1-x*y),k=b*(1-(1-x)*y),l={r:255*[b,S,_,_,k,b][T=w%6],g:255*[k,b,b,S,_,_][T],b:255*[_,_,k,b,b,S][T]},h=!0,f="hsv"):R(r.h)&&R(r.s)&&R(r.l)&&(u=A(r.s),d=A(r.l),l=function(e,t,n){var r,i,o;function a(e,t,n){return(n<0&&(n+=1),n>1&&(n-=1),n<1/6)?e+(t-e)*6*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}if(e=O(e,360),t=O(t,100),n=O(n,100),0===t)r=i=o=n;else{var l=n<.5?n*(1+t):n+t-n*t,s=2*n-l;r=a(s,l,e+1/3),i=a(s,l,e),o=a(s,l,e-1/3)}return{r:255*r,g:255*i,b:255*o}}(r.h,u,d),h=!0,f="hsl"),r.hasOwnProperty("a")&&(s=r.a)),s=C(s),{ok:h,format:r.format||f,r:Math.min(255,Math.max(l.r,0)),g:Math.min(255,Math.max(l.g,0)),b:Math.min(255,Math.max(l.b,0)),a:s});this._originalInput=t,this._r=N.r,this._g=N.g,this._b=N.b,this._a=N.a,this._roundA=Math.round(100*this._a)/100,this._format=n.format||N.format,this._gradientType=n.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=N.ok}function l(e,t,n){var r,i,o=Math.max(e=O(e,255),t=O(t,255),n=O(n,255)),a=Math.min(e,t,n),l=(o+a)/2;if(o==a)r=i=0;else{var s=o-a;switch(i=l>.5?s/(2-o-a):s/(o+a),o){case e:r=(t-n)/s+(t<n?6:0);break;case t:r=(n-e)/s+2;break;case n:r=(e-t)/s+4}r/=6}return{h:r,s:i,l:l}}function s(e,t,n){var r,i=Math.max(e=O(e,255),t=O(t,255),n=O(n,255)),o=Math.min(e,t,n),a=i-o;if(i==o)r=0;else{switch(i){case e:r=(t-n)/a+(t<n?6:0);break;case t:r=(n-e)/a+2;break;case n:r=(e-t)/a+4}r/=6}return{h:r,s:0===i?0:a/i,v:i}}function u(e,t,n,r){var i=[T(Math.round(e).toString(16)),T(Math.round(t).toString(16)),T(Math.round(n).toString(16))];return r&&i[0].charAt(0)==i[0].charAt(1)&&i[1].charAt(0)==i[1].charAt(1)&&i[2].charAt(0)==i[2].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0):i.join("")}function c(e,t,n,r){return[T(N(r)),T(Math.round(e).toString(16)),T(Math.round(t).toString(16)),T(Math.round(n).toString(16))].join("")}function d(e,t){t=0===t?0:t||10;var n=a(e).toHsl();return n.s-=t/100,n.s=k(n.s),a(n)}function h(e,t){t=0===t?0:t||10;var n=a(e).toHsl();return n.s+=t/100,n.s=k(n.s),a(n)}function f(e){return a(e).desaturate(100)}function p(e,t){t=0===t?0:t||10;var n=a(e).toHsl();return n.l+=t/100,n.l=k(n.l),a(n)}function g(e,t){t=0===t?0:t||10;var n=a(e).toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-(t/100*255)))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-(t/100*255)))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-(t/100*255)))),a(n)}function m(e,t){t=0===t?0:t||10;var n=a(e).toHsl();return n.l-=t/100,n.l=k(n.l),a(n)}function v(e,t){var n=a(e).toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,a(n)}function y(e){var t=a(e).toHsl();return t.h=(t.h+180)%360,a(t)}function b(e,t){if(isNaN(t)||t<=0)throw Error("Argument to polyad must be a positive number");for(var n=a(e).toHsl(),r=[a(e)],i=360/t,o=1;o<t;o++)r.push(a({h:(n.h+o*i)%360,s:n.s,l:n.l}));return r}function w(e){var t=a(e).toHsl(),n=t.h;return[a(e),a({h:(n+72)%360,s:t.s,l:t.l}),a({h:(n+216)%360,s:t.s,l:t.l})]}function x(e,t,n){t=t||6,n=n||30;var r=a(e).toHsl(),i=360/n,o=[a(e)];for(r.h=(r.h-(i*t>>1)+720)%360;--t;)r.h=(r.h+i)%360,o.push(a(r));return o}function _(e,t){t=t||6;for(var n=a(e).toHsv(),r=n.h,i=n.s,o=n.v,l=[],s=1/t;t--;)l.push(a({h:r,s:i,v:o})),o=(o+s)%1;return l}a.prototype={isDark:function(){return 128>this.getBrightness()},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,n,r=this.toRgb();return e=r.r/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*((t=r.g/255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*((n=r.b/255)<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=s(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=s(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHsl:function(){var e=l(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=l(this._r,this._g,this._b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this._roundA+")"},toHex:function(e){return u(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){var t,n,r,i,o;return t=this._r,n=this._g,r=this._b,i=this._a,o=[T(Math.round(t).toString(16)),T(Math.round(n).toString(16)),T(Math.round(r).toString(16)),T(N(i))],e&&o[0].charAt(0)==o[0].charAt(1)&&o[1].charAt(0)==o[1].charAt(1)&&o[2].charAt(0)==o[2].charAt(1)&&o[3].charAt(0)==o[3].charAt(1)?o[0].charAt(0)+o[1].charAt(0)+o[2].charAt(0)+o[3].charAt(0):o.join("")},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*O(this._r,255))+"%",g:Math.round(100*O(this._g,255))+"%",b:Math.round(100*O(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*O(this._r,255))+"%, "+Math.round(100*O(this._g,255))+"%, "+Math.round(100*O(this._b,255))+"%)":"rgba("+Math.round(100*O(this._r,255))+"%, "+Math.round(100*O(this._g,255))+"%, "+Math.round(100*O(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(S[u(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+c(this._r,this._g,this._b,this._a),n=t,r=this._gradientType?"GradientType = 1, ":"";if(e){var i=a(e);n="#"+c(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+r+"startColorstr="+t+",endColorstr="+n+")"},toString:function(e){var t=!!e;e=e||this._format;var n=!1,r=this._a<1&&this._a>=0;return!t&&r&&("hex"===e||"hex6"===e||"hex3"===e||"hex4"===e||"hex8"===e||"name"===e)?"name"===e&&0===this._a?this.toName():this.toRgbString():("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return a(this.toString())},_applyModification:function(e,t){var n=e.apply(null,[this].concat([].slice.call(t)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(p,arguments)},brighten:function(){return this._applyModification(g,arguments)},darken:function(){return this._applyModification(m,arguments)},desaturate:function(){return this._applyModification(d,arguments)},saturate:function(){return this._applyModification(h,arguments)},greyscale:function(){return this._applyModification(f,arguments)},spin:function(){return this._applyModification(v,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(x,arguments)},complement:function(){return this._applyCombination(y,arguments)},monochromatic:function(){return this._applyCombination(_,arguments)},splitcomplement:function(){return this._applyCombination(w,arguments)},triad:function(){return this._applyCombination(b,[3])},tetrad:function(){return this._applyCombination(b,[4])}},a.fromRatio=function(t,n){if("object"==e(t)){var r={};for(var i in t)t.hasOwnProperty(i)&&("a"===i?r[i]=t[i]:r[i]=A(t[i]));t=r}return a(t,n)},a.equals=function(e,t){return!!e&&!!t&&a(e).toRgbString()==a(t).toRgbString()},a.random=function(){return a.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},a.mix=function(e,t,n){n=0===n?0:n||50;var r=a(e).toRgb(),i=a(t).toRgb(),o=n/100;return a({r:(i.r-r.r)*o+r.r,g:(i.g-r.g)*o+r.g,b:(i.b-r.b)*o+r.b,a:(i.a-r.a)*o+r.a})},a.readability=function(e,t){var n=a(e),r=a(t);return(Math.max(n.getLuminance(),r.getLuminance())+.05)/(Math.min(n.getLuminance(),r.getLuminance())+.05)},a.isReadable=function(e,t,n){var r,i,o,l,s,u=a.readability(e,t);switch(s=!1,(i=((r=(r=n)||{level:"AA",size:"small"}).level||"AA").toUpperCase(),o=(r.size||"small").toLowerCase(),"AA"!==i&&"AAA"!==i&&(i="AA"),"small"!==o&&"large"!==o&&(o="small"),l={level:i,size:o}).level+l.size){case"AAsmall":case"AAAlarge":s=u>=4.5;break;case"AAlarge":s=u>=3;break;case"AAAsmall":s=u>=7}return s},a.mostReadable=function(e,t,n){var r,i,o,l,s=null,u=0;i=(n=n||{}).includeFallbackColors,o=n.level,l=n.size;for(var c=0;c<t.length;c++)(r=a.readability(e,t[c]))>u&&(u=r,s=a(t[c]));return a.isReadable(e,s,{level:o,size:l})||!i?s:(n.includeFallbackColors=!1,a.mostReadable(e,["#fff","#000"],n))};var E=a.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},S=a.hexNames=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[e[n]]=n);return t}(E);function C(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function O(e,t){"string"==typeof(n=e)&&-1!=n.indexOf(".")&&1===parseFloat(n)&&(e="100%");var n,r,i="string"==typeof(r=e)&&-1!=r.indexOf("%");return(e=Math.min(t,Math.max(0,parseFloat(e))),i&&(e=parseInt(e*t,10)/100),1e-6>Math.abs(e-t))?1:e%t/parseFloat(t)}function k(e){return Math.min(1,Math.max(0,e))}function P(e){return parseInt(e,16)}function T(e){return 1==e.length?"0"+e:""+e}function A(e){return e<=1&&(e=100*e+"%"),e}function N(e){return Math.round(255*parseFloat(e)).toString(16)}var j=(n="[\\s|\\(]+("+(t="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",r="[\\s|\\(]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")[,|\\s]+("+t+")\\s*\\)?",{CSS_UNIT:new RegExp(t),rgb:RegExp("rgb"+n),rgba:RegExp("rgba"+r),hsl:RegExp("hsl"+n),hsla:RegExp("hsla"+r),hsv:RegExp("hsv"+n),hsva:RegExp("hsva"+r),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function R(e){return!!j.CSS_UNIT.exec(e)}return a}());function EQ(e){return e&&e.__esModule?e:{default:e}}EY.simpleCheckForValidColor=function(e){var t=0,n=0;return(0,EX.default)(["r","g","b","a","h","s","l","v"],function(r){e[r]&&(t+=1,isNaN(e[r])||(n+=1),("s"===r||"l"===r)&&/^\d+%$/.test(e[r])&&(n+=1))}),t===n&&e};var EJ=EY.toState=function(e,t){var n=e.hex?(0,EZ.default)(e.hex):(0,EZ.default)(e),r=n.toHsl(),i=n.toHsv(),o=n.toRgb(),a=n.toHex();return 0===r.s&&(r.h=t||0,i.h=t||0),{hsl:r,hex:"000000"===a&&0===o.a?"transparent":"#"+a,rgb:o,hsv:i,oldHue:e.h||t||r.h,source:e.source}};EY.isValidHex=function(e){if("transparent"===e)return!0;var t="#"===String(e).charAt(0)?1:0;return e.length!==4+t&&e.length<7+t&&(0,EZ.default)(e).isValid()},EY.getContrastingColor=function(e){if(!e)return"#fff";var t=EJ(e);return"transparent"===t.hex?"rgba(0,0,0,0.4)":(299*t.rgb.r+587*t.rgb.g+114*t.rgb.b)/1e3>=128?"#000":"#fff"},EY.red={hsl:{a:1,h:0,l:.5,s:1},hex:"#ff0000",rgb:{r:255,g:0,b:0,a:1},hsv:{h:0,s:1,v:1,a:1}},EY.isvalidColorString=function(e,t){var n=e.replace("°","");return(0,EZ.default)(t+" ("+n+")")._ok};var E0=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(EY);function E1(e){return e&&e.__esModule?e:{default:e}}var E2=Eq.ColorWrap=function(e){var t=function(t){function n(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n);var t=function(e,t){if(!e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&("object"==typeof t||"function"==typeof t)?t:e}(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return t.handleChange=function(e,n){if(E0.simpleCheckForValidColor(e)){var r=E0.toState(e,e.h||t.state.oldHue);t.setState(r),t.props.onChangeComplete&&t.debounce(t.props.onChangeComplete,r,n),t.props.onChange&&t.props.onChange(r,n)}},t.handleSwatchHover=function(e,n){if(E0.simpleCheckForValidColor(e)){var r=E0.toState(e,e.h||t.state.oldHue);t.props.onSwatchHover&&t.props.onSwatchHover(r,n)}},t.state=EG({},E0.toState(e.color,0)),t.debounce=(0,EK.default)(function(e,t,n){e(t,n)},100),t}return!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(n,t),EW(n,[{key:"render",value:function(){var t={};return this.props.onSwatchHover&&(t.onSwatchHover=this.handleSwatchHover),E$.default.createElement(e,EG({},this.props,this.state,{onChange:this.handleChange},t))}}],[{key:"getDerivedStateFromProps",value:function(e,t){return EG({},E0.toState(e.color,t.oldHue))}}]),n}(v.PureComponent||v.Component);return t.propTypes=EG({},e.propTypes),t.defaultProps=EG({},e.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),t};Eq.default=E2,Object.defineProperty(_z,"ColorWrap",{enumerable:!0,get:function(){return St(Eq).default}});var E3={};Object.defineProperty(E3,"__esModule",{value:!0}),E3.Swatch=void 0;var E5=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=h("8NFma"),E6=E7(v),E4=E7(yj),E8=h("gxGlt"),E9=E7(_$);function E7(e){return e&&e.__esModule?e:{default:e}}var Se=E3.Swatch=function(e){var t=e.color,n=e.style,r=e.onClick,i=void 0===r?function(){}:r,o=e.onHover,a=e.title,l=void 0===a?t:a,s=e.children,u=e.focus,c=e.focusStyle,d="transparent"===t,h=(0,E4.default)({default:{swatch:E5({background:t,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},n,u?void 0===c?{}:c:{})}}),f={};return o&&(f.onMouseOver=function(e){return o(t,e)}),E6.default.createElement("div",E5({style:h.swatch,onClick:function(e){return i(t,e)},title:l,tabIndex:0,onKeyDown:function(e){return 13===e.keyCode&&i(t,e)}},f),s,d&&E6.default.createElement(E9.default,{borderRadius:h.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))};function St(e){return e&&e.__esModule?e:{default:e}}E3.default=(0,E8.handleFocus)(Se),Object.defineProperty(_z,"Swatch",{enumerable:!0,get:function(){return St(E3).default}});var Sn={};Object.defineProperty(Sn,"__esModule",{value:!0}),Sn.SketchFields=void 0;var v=h("8NFma"),Sr=Sa(v),Si=Sa(yj),So=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}(EY);function Sa(e){return e&&e.__esModule?e:{default:e}}var Sl=Sn.SketchFields=function(e){var t=e.onChange,n=e.rgb,r=e.hsl,i=e.hex,o=e.disableAlpha,a=(0,Si.default)({default:{fields:{display:"flex",paddingTop:"4px"},single:{flex:"1",paddingLeft:"6px"},alpha:{flex:"1",paddingLeft:"6px"},double:{flex:"2"},input:{width:"80%",padding:"4px 10% 3px",border:"none",boxShadow:"inset 0 0 0 1px #ccc",fontSize:"11px"},label:{display:"block",textAlign:"center",fontSize:"11px",color:"#222",paddingTop:"3px",paddingBottom:"4px",textTransform:"capitalize"}},disableAlpha:{alpha:{display:"none"}}},{disableAlpha:o}),l=function(e,i){e.hex?So.isValidHex(e.hex)&&t({hex:e.hex,source:"hex"},i):e.r||e.g||e.b?t({r:e.r||n.r,g:e.g||n.g,b:e.b||n.b,a:n.a,source:"rgb"},i):e.a&&(e.a<0?e.a=0:e.a>100&&(e.a=100),e.a/=100,t({h:r.h,s:r.s,l:r.l,a:e.a,source:"rgb"},i))};return Sr.default.createElement("div",{style:a.fields,className:"flexbox-fix"},Sr.default.createElement("div",{style:a.double},Sr.default.createElement(_z.EditableInput,{style:{input:a.input,label:a.label},label:"hex",value:i.replace("#",""),onChange:l})),Sr.default.createElement("div",{style:a.single},Sr.default.createElement(_z.EditableInput,{style:{input:a.input,label:a.label},label:"r",value:n.r,onChange:l,dragLabel:"true",dragMax:"255"})),Sr.default.createElement("div",{style:a.single},Sr.default.createElement(_z.EditableInput,{style:{input:a.input,label:a.label},label:"g",value:n.g,onChange:l,dragLabel:"true",dragMax:"255"})),Sr.default.createElement("div",{style:a.single},Sr.default.createElement(_z.EditableInput,{style:{input:a.input,label:a.label},label:"b",value:n.b,onChange:l,dragLabel:"true",dragMax:"255"})),Sr.default.createElement("div",{style:a.alpha},Sr.default.createElement(_z.EditableInput,{style:{input:a.input,label:a.label},label:"a",value:Math.round(100*n.a),onChange:l,dragLabel:"true",dragMax:"100"})))};Sn.default=Sl;var Ss={};Object.defineProperty(Ss,"__esModule",{value:!0}),Ss.SketchPresetColors=void 0;var Su=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},v=h("8NFma"),Sc=Sf(v),Sd=Sf(yN),Sh=Sf(yj);function Sf(e){return e&&e.__esModule?e:{default:e}}var Sp=Ss.SketchPresetColors=function(e){var t=e.colors,n=e.onClick,r=void 0===n?function(){}:n,i=e.onSwatchHover,o=(0,Sh.default)({default:{colors:{margin:"0 -10px",padding:"10px 0 0 10px",borderTop:"1px solid #eee",display:"flex",flexWrap:"wrap",position:"relative"},swatchWrap:{width:"16px",height:"16px",margin:"0 10px 10px 0"},swatch:{borderRadius:"3px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15)"}},"no-presets":{colors:{display:"none"}}},{"no-presets":!t||!t.length}),a=function(e,t){r({hex:e,source:"hex"},t)};return Sc.default.createElement("div",{style:o.colors,className:"flexbox-fix"},t.map(function(e){var t="string"==typeof e?{color:e}:e,n=""+t.color+(t.title||"");return Sc.default.createElement("div",{key:n,style:o.swatchWrap},Sc.default.createElement(_z.Swatch,Su({},t,{style:o.swatch,onClick:a,onHover:i,focusStyle:{boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px "+t.color}})))}))};Sp.propTypes={colors:Sd.default.arrayOf(Sd.default.oneOfType([Sd.default.string,Sd.default.shape({color:Sd.default.string,title:Sd.default.string})])).isRequired},Ss.default=Sp;let Sg=e=>{let t=l(v).useRef(e);return t.current=e,l(v).useCallback((...e)=>t.current(...e),[])},Sm=({width:e,rgb:t,hex:n,hsv:r,hsl:i,onChange:o,onSwatchHover:a,disableAlpha:s,presetColors:u,renderers:c,styles:d={},className:h=""})=>{let f=l(yj)(l(_g)({default:{picker:{width:e,padding:"10px 10px 0",boxSizing:"initial",background:"#fff",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.15), 0 8px 16px rgba(0,0,0,.15)"},saturation:{width:"100%",paddingBottom:"75%",position:"relative",overflow:"hidden"},Saturation:{radius:"3px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},controls:{display:"flex"},sliders:{padding:"4px 0",flex:"1"},color:{width:"24px",height:"24px",position:"relative",marginTop:"4px",marginLeft:"4px",borderRadius:"3px"},activeColor:{absolute:"0px 0px 0px 0px",borderRadius:"2px",background:`rgba(${t.r},${t.g},${t.b},${t.a})`,boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},hue:{position:"relative",height:"10px",overflow:"hidden"},Hue:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},alpha:{position:"relative",height:"10px",marginTop:"4px",overflow:"hidden"},Alpha:{radius:"2px",shadow:"inset 0 0 0 1px rgba(0,0,0,.15), inset 0 0 4px rgba(0,0,0,.25)"},...d},disableAlpha:{color:{height:"10px"},hue:{height:"10px"},alpha:{display:"none"}}},d),{disableAlpha:s}),[g,m]=l(v).useState(!1),y=l(v).useRef(null),b=Sg(e=>{if(g){let t=y.current?.fill();t&&o(l(A).Util.colorToRGBA(t)),x(),!function(e,t){let n=e.target;for(;n;){if(n.classList.contains(t))return!0;n=n.parentElement}return!1}(e,"color-picker-button")&&m(!1),e.stopPropagation(),e.stopImmediatePropagation()}}),w=Sg(e=>{if(!g)return;let t=l(A).stages.find(t=>{let n=t.getContent().getBoundingClientRect();return n.left<e.clientX&&n.left+n.width>e.clientX&&n.top<e.clientY&&n.top+n.height>e.clientY});if(!t){x();return}let n=t.getContent().getBoundingClientRect(),r={x:e.clientX-n.left,y:e.clientY-n.top},i=t.children[0],o=i.getNativeCanvasElement(),a=i.getCanvas().getPixelRatio(),{data:s}=o.getContext("2d").getImageData(r.x*a,r.y*a,1,1),u=t.findOne(".line-guides");u.findOne(".picker")||(y.current&&y.current.destroy(),y.current=new(l(A)).Circle({name:"picker",radius:14,stroke:"black",strokeWidth:1}),u.add(y.current)),y.current.setAbsolutePosition({x:r.x-15,y:r.y-15}),y.current.fill("rgb("+s[0]+","+s[1]+","+s[2]+")")});l(v).useEffect(()=>(window.addEventListener("mousemove",w),window.addEventListener("mousedown",b,!0),window.addEventListener("touchstart",b,!0),()=>{window.removeEventListener("mousemove",w),window.removeEventListener("mousedown",b,!0),window.removeEventListener("touchstart",b,!0),x()}),[]),l(v).useEffect(()=>{g||x()},[g]),l(v).useEffect(()=>(g&&(document.body.style.cursor="crosshair"),()=>{document.body.style.cursor="default"}),[g]);let x=Sg(()=>{y.current&&(y.current.destroy(),y.current=null)});return(0,p.jsxs)("div",{style:f.picker,className:`sketch-picker ${h}`,children:[(0,p.jsx)("div",{style:f.saturation,children:(0,p.jsx)(_z.Saturation,{style:f.Saturation,hsl:i,hsv:r,onChange:o})}),(0,p.jsxs)("div",{style:f.controls,className:"flexbox-fix",children:[(0,p.jsxs)("div",{style:f.sliders,children:[(0,p.jsx)("div",{style:f.hue,children:(0,p.jsx)(_z.Hue,{style:f.Hue,hsl:i,onChange:o})}),(0,p.jsx)("div",{style:f.alpha,children:(0,p.jsx)(_z.Alpha,{style:f.Alpha,rgb:t,hsl:i,renderers:c,onChange:o})})]}),(0,p.jsxs)("div",{style:f.color,children:[(0,p.jsx)(_z.Checkboard,{}),(0,p.jsx)("div",{style:f.activeColor})]}),(0,p.jsx)("div",{style:f.color,children:(0,p.jsx)(pA,{icon:(0,p.jsx)(l(_j),{}),className:"color-picker-button",minimal:!0,style:{width:"24px",height:"24px",minWidth:"24px",minHeight:"24px",padding:0,margin:0},active:g,onClickCapture:e=>{m(e=>!e),e.stopPropagation()}})})]}),(0,p.jsx)(l(Sn),{rgb:t,hsl:i,hex:n,onChange:o,disableAlpha:s}),(0,p.jsx)(l(Ss),{colors:u,onClick:o,onSwatchHover:a})]})};Sm.propTypes={disableAlpha:l(yN).bool,width:l(yN).oneOfType([l(yN).string,l(yN).number]),styles:l(yN).object},Sm.defaultProps={disableAlpha:!1,width:200,styles:{},presetColors:["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"]};var Sv=(0,_z.ColorWrap)(Sm);let Sy=["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"].reverse(),Sb=e=>{let t=[];e.pages.forEach(e=>{e.children.forEach(e=>{"text"===e.type&&t.push(e.fill),"svg"===e.type&&t.push(...e.colorsReplace.values())})});let n=[];return t.forEach(e=>{if(ir(e)){let{stops:t}=io(e);n.push(...t.map(e=>e.color))}else n.push(e)}),[...new Set(n)]},Sw=at("div")`
|
|
135
135
|
& .sketch-picker {
|
|
136
136
|
padding: 0px !important;
|
|
137
137
|
box-shadow: none !important;
|
|
@@ -484,7 +484,7 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
|
|
|
484
484
|
${iR(`
|
|
485
485
|
display: none;
|
|
486
486
|
`)}
|
|
487
|
-
`,Ax=({onClick:e})=>(0,p.jsxs)(Aw,{onClick:e,children:[(0,p.jsx)("svg",{width:"15",height:"96",viewBox:"0 0 16 96",xmlns:"http://www.w3.org/2000/svg",children:(0,p.jsx)("path",{className:"fill stroke",d:"M 1 7 C 2 9 4 10 7.2 13.28 C 7.45 13.4625 7.6 13.6 7.7 13.8048 L 7.8 13.8 C 9.8 15.8 11.6 17.6 12.9 19.7 C 14 21.6 14.7 23.9 14.9 27 H 15 V 68 C 15 71.7 14.3 74.3 13 76.6 C 11.7 78.8 9.9 80.5 7.8 82.6344 L 7.79 82.6 C 7.6 82.8 7.4507 83 7.2729 83.2127 C 3.9102 86.5228 2 87 1 90"})}),(0,p.jsx)("div",{className:"pointer",children:"<"})]}),A_=P(({store:e,sections:t,defaultSection:n})=>{
|
|
487
|
+
`,Ax=({onClick:e})=>(0,p.jsxs)(Aw,{onClick:e,children:[(0,p.jsx)("svg",{width:"15",height:"96",viewBox:"0 0 16 96",xmlns:"http://www.w3.org/2000/svg",children:(0,p.jsx)("path",{className:"fill stroke",d:"M 1 7 C 2 9 4 10 7.2 13.28 C 7.45 13.4625 7.6 13.6 7.7 13.8048 L 7.8 13.8 C 9.8 15.8 11.6 17.6 12.9 19.7 C 14 21.6 14.7 23.9 14.9 27 H 15 V 68 C 15 71.7 14.3 74.3 13 76.6 C 11.7 78.8 9.9 80.5 7.8 82.6344 L 7.79 82.6 C 7.6 82.8 7.4507 83 7.2729 83.2127 C 3.9102 86.5228 2 87 1 90"})}),(0,p.jsx)("div",{className:"pointer",children:"<"})]}),A_=e=>{let t=l(v).useRef(!0);t.current&&(t.current=!1,e())},AE=P(({store:e,sections:t,defaultSection:n})=>{A_(()=>{e.openSidePanel(n||"photos")});let r=t||Ap,i=r.filter(e=>e.visibleInList??!0),o=r.find(t=>t.name===e.openedSidePanel)?.Panel,a=iI();l(v).useLayoutEffect(()=>{a?e.openSidePanel(""):e.openSidePanel(n||"photos")},[a]);let s=l(v).useRef(null);return(0,p.jsxs)(Ag,{className:"bp5-navbar polotno-side-panel"+(e.openedSidePanel?"":" collapsed"),children:[(0,p.jsx)(Am,{ref:s,className:"polotno-side-tabs-container",children:(0,p.jsx)(Av,{className:"polotno-side-tabs-inner",children:i.map(({name:t,Tab:n})=>(0,p.jsx)(n,{active:t===e.openedSidePanel,onClick:()=>{e.openSidePanel(t)}},t))})}),o&&(0,p.jsx)(Ay,{className:"bp5-navbar polotno-panel-container",onClick:t=>{let n=t.target.closest(".polotno-close-panel"),r=t.target.closest(".polotno-mobile"),i=a||r;n&&i&&e.openSidePanel("")},children:(0,p.jsx)(o,{store:e})}),e.openedSidePanel&&(0,p.jsx)(Ab,{onClick:()=>e.openSidePanel("")}),e.openedSidePanel&&(0,p.jsx)(Ax,{onClick:()=>e.openSidePanel("")})]})});h("8NFma");let AS=at("div")`
|
|
488
488
|
position: absolute;
|
|
489
489
|
bottom: 5px;
|
|
490
490
|
width: auto;
|
|
@@ -502,7 +502,7 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
|
|
|
502
502
|
${iR(`
|
|
503
503
|
display: none;
|
|
504
504
|
`)}
|
|
505
|
-
`,
|
|
505
|
+
`,AC=[.1,.25,.5,.75,1,1.5,2,3],AO=AC[AC.length-1],Ak=AC[0],AP=P(({store:e})=>{let t=Math.max(AO,e.scaleToFit),n=Math.min(Ak,e.scaleToFit),r=e.scale<t,i=e.scale>n;return(0,p.jsxs)(mA.Group,{align:sT.LEFT,style:{height:"35px"},children:[(0,p.jsx)(pA,{icon:"zoom-out",minimal:!0,onClick:()=>{e.setScale(e.scale/1.2)},disabled:!i}),(0,p.jsx)(mw,{content:(0,p.jsxs)(mB,{style:{minWidth:"80px"},children:[AC.map(t=>(0,p.jsx)(mW,{text:Math.round(100*t)+"%",onClick:async()=>{e.setScale(t)}},t)),(0,p.jsx)(mW,{text:sy("scale.reset"),onClick:async()=>{e.setScale(e.scaleToFit)}})]}),children:(0,p.jsx)(pA,{minimal:!0,children:Math.round(100*e.scale)+"%"})}),(0,p.jsx)(pA,{icon:"zoom-in",minimal:!0,onClick:()=>{e.setScale(1.2*e.scale)},disabled:!r})]})}),AT=P(({store:e})=>(0,p.jsx)(AS,{children:(0,p.jsx)(mA,{style:{height:"35px",padding:"0 5px"},children:(0,p.jsx)(AP,{store:e})})})),AA=at("div")`
|
|
506
506
|
display: flex;
|
|
507
507
|
height: 100%;
|
|
508
508
|
width: 100%;
|
|
@@ -511,7 +511,7 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
|
|
|
511
511
|
${iR(`
|
|
512
512
|
flex-direction: column-reverse;
|
|
513
513
|
`)}
|
|
514
|
-
`,
|
|
514
|
+
`,AN=at("div")`
|
|
515
515
|
height: 100%;
|
|
516
516
|
width: auto;
|
|
517
517
|
max-height: 100vh;
|
|
@@ -520,12 +520,12 @@ Please read the updated README.md at https://github.com/SortableJS/react-sortabl
|
|
|
520
520
|
height: auto;
|
|
521
521
|
width: 100vw;
|
|
522
522
|
`)}
|
|
523
|
-
`,
|
|
523
|
+
`,Aj=at("div")`
|
|
524
524
|
display: flex;
|
|
525
525
|
height: 100%;
|
|
526
526
|
width: 100%;
|
|
527
527
|
flex: 1;
|
|
528
528
|
flex-direction: column;
|
|
529
529
|
position: relative;
|
|
530
|
-
`,
|
|
530
|
+
`,AR=({store:e,style:t,sections:n})=>{let r=Ap;return n&&(r=n.map(e=>{let t=Ap.find(t=>t.name===e);return t||console.error(`Section ${e} not found`),t}).filter(Boolean)),(0,p.jsxs)(AA,{className:"polotno-app-container",style:t,children:[(0,p.jsx)(AN,{children:(0,p.jsx)(AE,{store:e,sections:r})}),(0,p.jsxs)(Aj,{children:[(0,p.jsx)(Ol,{store:e,components:{ActionControls:()=>(0,p.jsx)(C9,{store:e})}}),(0,p.jsx)(mQ,{store:e}),(0,p.jsx)(AT,{store:e})]})]})};window.createPolotnoApp=function({container:e,key:t,showCredit:n,sections:r}){let i=function({key:e,showCredit:t}={key:"",showCredit:!1}){let n=l1.create();return a7(e,t),n}({key:t,showCredit:n}),o=l(g).createRoot(e);return o.render((0,p.jsx)(AR,{store:i,sections:r})),i.addPage(),i.history.clear(),{store:i,root:o}}})();
|
|
531
531
|
//# sourceMappingURL=polotno.bundle.js.map
|