react-base-data-table 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -43,7 +43,7 @@ Valid keys: `+JSON.stringify(Object.keys(g),null," "));var O=le(L,V,I,N,z+"."+V
|
|
|
43
43
|
${e.isInExpandedSelection?"bg-blue-100/50":""}
|
|
44
44
|
${e.isSelected?"outline-2 outline-radius outline-blue-500! bg-transparent ":"outline-none"}
|
|
45
45
|
${e.isInLinkedGroup||!b&&((te=e.header.editOptions)!=null&&te.greyedOutIfNotEditable)?"bg-gray-200/50! ":""}
|
|
46
|
-
`,onKeyDown:u,onMouseDown:l,onMouseEnter:R,onContextMenu:e.onContextMenu?_=>{e.onContextMenu(e.rowIndex,e.columnIndex,e.item,_)}:void 0,children:[e.comments&&e.comments.length>0&&y.jsx("div",{onClick:()=>i(d?void 0:{rowIndex:e.rowIndex,columnIndex:e.columnIndex}),className:"absolute top-0 right-0 ",style:{width:0,height:0,borderTop:"10px solid var(--comment-color)",borderLeft:"10px solid transparent"}}),x(),d&&y.jsx("div",{className:"absolute z-2000 w-[220px] mr-[-220px] bg-white border-2 border-[var(--comment-color)] rounded shadow-lg p-2 px-3 top-0 right-0",children:y.jsx(cl,{comment:((ce=e.comments)==null?void 0:ce[0])||{text:"",propertyId:e.header.id,value:e.item[e.header.id],date:new Date},columnId:e.header.id,isNewComment:((ue=e.comments)==null?void 0:ue.length)===0,saveComment:_=>{var T;(T=e.onSaveComment)==null||T.call(e,_,e.item)},deleteComment:_=>w(_),setIsEditing:E,isEditing:S||((P=e.comments)==null?void 0:P.length)===0})})]},`item-${e.columnIndex}-${e.rowIndex}`)}function dl(e,t){c.useEffect(()=>{function r(n){e.current&&n.target&&!e.current.contains(n.target)&&t()}return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[e,t])}function hl(e){var m;const[t,r]=c.useState(""),[n,a]=c.useState(!1),i=c.useRef(null),o=c.useRef(null),[s,l]=c.useState([]);c.useEffect(()=>{var b;l(((b=e.currentFilter)==null?void 0:b.itemsToHide)??[])},[(m=e.currentFilter)==null?void 0:m.itemsToHide,e.show]),c.useEffect(()=>{var b,x;if(e.show&&o.current){const S=o.current.getBoundingClientRect(),E=(x=(b=e.tableRef)==null?void 0:b.current)==null?void 0:x.getBoundingClientRect(),R=(E==null?void 0:E.width)??0,w=S.width+S.x>R;a(w)}else a(!1)},[e.show]),dl(i,()=>{e.show&&e.onShowOrHide(!1)});const u=()=>t?[...e.items].filter(b=>b==null?void 0:b.toString().toLocaleLowerCase().includes(t==null?void 0:t.toString().toLocaleLowerCase())):[...e.items],f=b=>{b.preventDefault(),t&&e.onSetFilter(e.headerId,[t])},d=()=>{l([...e.items])},p=()=>{l([])},v=b=>{const x=s.findIndex(E=>E===b);let S=[...s];x===-1?S=[...S,b]:S.splice(x,1),l(S)},h=()=>{const x=u().filter(E=>!s.includes(E)),S=[...e.items].filter(E=>!x.includes(E));e.onSetFilter(e.headerId,S.map(E=>E))};return y.jsxs("div",{ref:i,className:"relative",children:[y.jsx("button",{onClick:()=>e.onShowOrHide(!e.show),className:`border-solid border hover:!border-primary cursor-pointer border-gray-300 rounded focus:outline-hidden! ${e.currentFilter?"bg-purple-800":"bg-white"} `,children:y.jsx(Ie,{path:qs,color:e.currentFilter?"white":"grey",size:.6})}),e.show?y.jsxs("div",{ref:o,className:`absolute mt-1 bg-white shadow-xs p-3 w-60 z- rounded-md font-normal border border-border-color-light ${n?"right-0":""}`,children:[y.jsx("div",{className:"font-semibold mb-1",children:"Filter by value:"}),y.jsxs("form",{onSubmit:f,children:[y.jsx("input",{type:"text",value:t,onChange:b=>r(b==null?void 0:b.target.value),placeholder:"Search...",className:"input input-bordered input-xs w-full max-w-xs"}),y.jsx("input",{type:"submit",value:""})]}),y.jsxs("div",{className:"flex text-xs mt-1 font-semibold text-primary",children:[y.jsx("button",{onClick:p,onFocus:()=>{},className:"mr-4 cursor-pointer hover:border-none! border-none! focus:outline-hidden! bg-transparent btn-sm",children:"Select All"}),y.jsx("button",{onClick:d,onFocus:()=>{},className:"cursor-pointer hover:border-none! border-none! focus:outline-hidden! bg-transparent btn-sm",children:"Clear"})]}),y.jsx("div",{className:"overflow-auto max-h-44 mt-2",style:{scrollbarWidth:"thin"},children:u().map((b,x)=>y.jsxs("div",{className:"flex mt-2",children:[y.jsx("input",{type:"checkbox",onClick:()=>v(b),readOnly:!0,checked:!s.includes(b),className:"checkbox checkbox-primary checkbox-xs mr-2"}),y.jsx("p",{className:"text-xs",children:(b==null?void 0:b.toString())||y.jsx("span",{className:"italic",children:"(Blanks)"})})]},`filter-item-${b}-${x}`))}),y.jsxs("div",{className:"flex float-end mt-2",children:[y.jsx(Re,{onClick:()=>{h(),e.onShowOrHide(!1)},text:"OK",iconColor:"#6161bb",small:!0}),y.jsx(Re,{className:"ml-1",onClick:()=>e.onShowOrHide(!1),text:"Cancel",iconColor:"#6161bb",small:!0})]})]}):""]})}var io=(e=>(e.STRING="string",e.NUMBER="number",e))(io||{});function pl(e){const[t,r]=c.useState(""),n=(d,p)=>{if(!d){r("");return}r(p)},a=d=>{if(e.activeFilters)return e.activeFilters.find(p=>p.headerId===d)};function i(d,p,v=0){const h=u(d,p,v),m=d.filter(b=>b.children&&b.children.length>0).map(b=>b.children).flat();return m.length>0?[h,...i(m,p,v+1)]:[h]}const o=d=>e.filterItemsCache[d]??[];function s(d){return d.reduce((p,v)=>v.children&&v.children.length>0?Math.max(p,1+s(v.children)):Math.max(p,1),0)}function l(d){return d.children&&d.children.length>0?d.children.reduce((p,v)=>p+l(v),0):1}function u(d,p,v=0){return d.length===0?null:y.jsx("tr",{className:"z-100",children:d.map((h,m)=>{var E,R;const b=l(h),S=h.children&&h.children.length>0?1:p-v;return y.jsx("th",{colSpan:b,rowSpan:S,className:`${e.noBorder?"":"border-solid border border-gray-300! bg-slate-100"}`,children:y.jsxs("div",{style:{width:h.width?`${h.width}px`:"auto"},className:"flex justify-between",children:[y.jsxs("div",{className:"flex",children:[h.customHeader?h.customHeader(h):y.jsx("button",{onClick:()=>{var w;return(w=e.onSortByColumn)==null?void 0:w.call(e,h)},className:`font-semibold bg-transparent text-left text-slate-600 text-xs border-none outline-hidden! whitespace-pre ${h.sortable?"cursor-pointer hover:underline":"cursor-default"}`,children:h.text}),e.currentSortId===h.id&&y.jsxs(y.Fragment,{children:[y.jsx(Ie,{path:e.ascendingOrder?Ds:Fs,color:"grey",size:.6}),y.jsx("button",{onClick:e.onResetSort,className:`border-solid border bg-slate-300 hover:bg-slate-400! hover:border-transparent cursor-pointer rounded-lg h-min focus:outline-hidden!
|
|
46
|
+
`,onKeyDown:u,onMouseDown:l,onMouseEnter:R,onContextMenu:e.onContextMenu?_=>{e.onContextMenu(e.rowIndex,e.columnIndex,e.item,_)}:void 0,children:[e.comments&&e.comments.length>0&&y.jsx("div",{onClick:()=>i(d?void 0:{rowIndex:e.rowIndex,columnIndex:e.columnIndex}),className:"absolute top-0 right-0 ",style:{width:0,height:0,borderTop:"10px solid var(--comment-color)",borderLeft:"10px solid transparent"}}),x(),d&&y.jsx("div",{className:"absolute z-2000 w-[220px] mr-[-220px] bg-white border-2 border-[var(--comment-color)] rounded shadow-lg p-2 px-3 top-0 right-0",children:y.jsx(cl,{comment:((ce=e.comments)==null?void 0:ce[0])||{text:"",propertyId:e.header.id,value:e.item[e.header.id],date:new Date},columnId:e.header.id,isNewComment:((ue=e.comments)==null?void 0:ue.length)===0,saveComment:_=>{var T;(T=e.onSaveComment)==null||T.call(e,_,e.item)},deleteComment:_=>w(_),setIsEditing:E,isEditing:S||((P=e.comments)==null?void 0:P.length)===0})})]},`item-${e.columnIndex}-${e.rowIndex}`)}function dl(e,t){c.useEffect(()=>{function r(n){e.current&&n.target&&!e.current.contains(n.target)&&t()}return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[e,t])}function hl(e){var m;const[t,r]=c.useState(""),[n,a]=c.useState(!1),i=c.useRef(null),o=c.useRef(null),[s,l]=c.useState([]);c.useEffect(()=>{var b;l(((b=e.currentFilter)==null?void 0:b.itemsToHide)??[])},[(m=e.currentFilter)==null?void 0:m.itemsToHide,e.show]),c.useEffect(()=>{var b,x;if(e.show&&o.current){const S=o.current.getBoundingClientRect(),E=(x=(b=e.tableRef)==null?void 0:b.current)==null?void 0:x.getBoundingClientRect(),R=(E==null?void 0:E.width)??0,w=S.width+S.x>R;a(w)}else a(!1)},[e.show]),dl(i,()=>{e.show&&e.onShowOrHide(!1)});const u=()=>t?[...e.items].filter(b=>b==null?void 0:b.toString().toLocaleLowerCase().includes(t==null?void 0:t.toString().toLocaleLowerCase())):[...e.items],f=b=>{b.preventDefault(),t&&e.onSetFilter(e.headerId,[t])},d=()=>{l([...e.items])},p=()=>{l([])},v=b=>{const x=s.findIndex(E=>E===b);let S=[...s];x===-1?S=[...S,b]:S.splice(x,1),l(S)},h=()=>{const x=u().filter(E=>!s.includes(E)),S=[...e.items].filter(E=>!x.includes(E));e.onSetFilter(e.headerId,S.map(E=>E))};return y.jsxs("div",{ref:i,className:"relative",children:[y.jsx("button",{onClick:()=>e.onShowOrHide(!e.show),className:`border-solid border hover:!border-primary cursor-pointer border-gray-300 rounded focus:outline-hidden! ${e.currentFilter?"bg-purple-800":"bg-white"} `,children:y.jsx(Ie,{path:qs,color:e.currentFilter?"white":"grey",size:.6})}),e.show?y.jsxs("div",{ref:o,className:`absolute mt-1 bg-white shadow-xs p-3 w-60 z-200 rounded-md font-normal border border-border-color-light ${n?"right-0":""}`,children:[y.jsx("div",{className:"font-semibold mb-1",children:"Filter by value:"}),y.jsxs("form",{onSubmit:f,children:[y.jsx("input",{type:"text",value:t,onChange:b=>r(b==null?void 0:b.target.value),placeholder:"Search...",className:"input input-bordered input-xs w-full max-w-xs"}),y.jsx("input",{type:"submit",value:""})]}),y.jsxs("div",{className:"flex text-xs mt-1 font-semibold text-primary",children:[y.jsx("button",{onClick:p,onFocus:()=>{},className:"mr-4 cursor-pointer hover:border-none! border-none! focus:outline-hidden! bg-transparent btn-sm",children:"Select All"}),y.jsx("button",{onClick:d,onFocus:()=>{},className:"cursor-pointer hover:border-none! border-none! focus:outline-hidden! bg-transparent btn-sm",children:"Clear"})]}),y.jsx("div",{className:"overflow-auto max-h-44 mt-2",style:{scrollbarWidth:"thin"},children:u().map((b,x)=>y.jsxs("div",{className:"flex mt-2",children:[y.jsx("input",{type:"checkbox",onClick:()=>v(b),readOnly:!0,checked:!s.includes(b),className:"checkbox checkbox-primary checkbox-xs mr-2"}),y.jsx("p",{className:"text-xs",children:(b==null?void 0:b.toString())||y.jsx("span",{className:"italic",children:"(Blanks)"})})]},`filter-item-${b}-${x}`))}),y.jsxs("div",{className:"flex float-end mt-2",children:[y.jsx(Re,{onClick:()=>{h(),e.onShowOrHide(!1)},text:"OK",iconColor:"#6161bb",small:!0}),y.jsx(Re,{className:"ml-1",onClick:()=>e.onShowOrHide(!1),text:"Cancel",iconColor:"#6161bb",small:!0})]})]}):""]})}var io=(e=>(e.STRING="string",e.NUMBER="number",e))(io||{});function pl(e){const[t,r]=c.useState(""),n=(d,p)=>{if(!d){r("");return}r(p)},a=d=>{if(e.activeFilters)return e.activeFilters.find(p=>p.headerId===d)};function i(d,p,v=0){const h=u(d,p,v),m=d.filter(b=>b.children&&b.children.length>0).map(b=>b.children).flat();return m.length>0?[h,...i(m,p,v+1)]:[h]}const o=d=>e.filterItemsCache[d]??[];function s(d){return d.reduce((p,v)=>v.children&&v.children.length>0?Math.max(p,1+s(v.children)):Math.max(p,1),0)}function l(d){return d.children&&d.children.length>0?d.children.reduce((p,v)=>p+l(v),0):1}function u(d,p,v=0){return d.length===0?null:y.jsx("tr",{className:"z-100",children:d.map((h,m)=>{var E,R;const b=l(h),S=h.children&&h.children.length>0?1:p-v;return y.jsx("th",{colSpan:b,rowSpan:S,className:`${e.noBorder?"":"border-solid border border-gray-300! bg-slate-100"}`,children:y.jsxs("div",{style:{width:h.width?`${h.width}px`:"auto"},className:"flex justify-between",children:[y.jsxs("div",{className:"flex",children:[h.customHeader?h.customHeader(h):y.jsx("button",{onClick:()=>{var w;return(w=e.onSortByColumn)==null?void 0:w.call(e,h)},className:`font-semibold bg-transparent text-left text-slate-600 text-xs border-none outline-hidden! whitespace-pre ${h.sortable?"cursor-pointer hover:underline":"cursor-default"}`,children:h.text}),e.currentSortId===h.id&&y.jsxs(y.Fragment,{children:[y.jsx(Ie,{path:e.ascendingOrder?Ds:Fs,color:"grey",size:.6}),y.jsx("button",{onClick:e.onResetSort,className:`border-solid border bg-slate-300 hover:bg-slate-400! hover:border-transparent cursor-pointer rounded-lg h-min focus:outline-hidden!
|
|
47
47
|
`,children:y.jsx(Ie,{path:Gs,color:"grey",size:.6})})]})]}),h.hasFilter?y.jsx("div",{className:"ml-2",children:y.jsx(hl,{show:t===h.id,tableRef:e.tableRef,currentFilter:a(h.id),filterName:h.text,headerId:h.id,filterType:io.STRING,items:o(h.id),itemsToHide:((R=(E=e.activeFilters)==null?void 0:E.find(w=>w.headerId===h.id))==null?void 0:R.itemsToHide)??[],onShowOrHide:w=>n(w,h.id),onSetFilter:e.onSetFilter??(()=>{})})}):y.jsx(y.Fragment,{})]})},h.id+`-${m}`)})},`header-row-${v}`)}const f=s(e.headers);return y.jsx("thead",{children:i(e.headers,f)})}const gl=e=>e.every(t=>typeof t=="number"),vl=(e,t)=>e<t?-1:e>t?1:0,bl=(e,t)=>e>t?-1:e<t?1:0,oo=" ",ml=(e,t)=>e.length===0?[]:t.length===0?[...e]:[...e].filter(r=>{for(const n of t){let a=r[n.headerId],i=!1;if(gl(n.itemsToHide)?(a=typeof a=="string"?a.split(oo).join(""):a,i=n.itemsToHide.includes(Number(a))):n.itemsToHide.includes(a)&&(i=!0),i)return!1}return!0}),yl=(e,t,r,n)=>{let a=[...e];if(!n)return a;const i=t.find(s=>s.id===n);if(i!=null&&i.customSort)return a.sort((s,l)=>i.customSort(s,l,r==="asc")),a;let o=!0;return a.forEach(s=>{var d;const l=(d=s[n])==null?void 0:d.toString();if(!l)return;const u=Dr(l),f=["NaN"];isNaN(u)&&!f.includes(l)&&(o=!1)}),o?(a.sort((s,l)=>{const u=Dr(s[n]),f=Dr(l[n]),d=typeof u=="number"&&!isNaN(u),p=typeof f=="number"&&!isNaN(f);return d&&!p?-1:!d&&p?1:r==="desc"?f-u:u-f}),a):(r==="desc"?a.sort((s,l)=>vl(l[n],s[n])):a.sort((s,l)=>bl(l[n],s[n])),a)},Dr=e=>typeof e=="number"?e:typeof e=="string"?Number(e.split(oo).join("")):e;function xl(e,t,r=[],n){const[a,i]=c.useState(r),o=()=>{i([])},s=(v,h)=>{const m=[...a],b=m.findIndex(x=>x.headerId===v);b!==-1?h.length>0?m[b]={headerId:v,itemsToHide:h}:m.splice(b,1):h.length>0&&m.push({headerId:v,itemsToHide:h}),i(m)},l=n||e,u=c.useMemo(()=>ml(l,a),[l,a]);function f(v){return v.flatMap(h=>h.children&&h.children.length>0?f(h.children):[h])}const d=c.useMemo(()=>f(t),[t]),p=c.useMemo(()=>{const v={};return d.forEach(h=>{let m=u.map(x=>x[h.id]);const b=a.find(x=>x.headerId===h.id);b&&(m=m.concat(b.itemsToHide)),v[h.id]=[...new Set(m)].filter(x=>typeof x=="string"||typeof x=="number")}),v},[u,a,d]);return{activeFilters:a,setActiveFilters:i,clearActiveFilters:o,setActiveTableFilter:s,filteredItems:u,filterItemsCache:p}}function wl(e,t,r,n){const[a,i]=c.useState(r),[o,s]=c.useState(!0);c.useEffect(()=>{i(r)},[r]);const l=()=>{i(void 0),s(!0)},u=d=>{if(!(d!=null&&d.sortable))return;let p;a===d.id?p=!o:p=!0,i(d.id),s(p),n&&n(d.id)},f=c.useMemo(()=>yl(e,t,o?"asc":"desc",a),[e,t,o,a]);return{currentSortId:a,setCurrentSortId:i,ascendingOrder:o,setAscendingOrder:s,onResetSort:l,onSortByColumn:u,sortedItems:f}}function Cl(e,t,r=[],n,a){const{currentSortId:i,setCurrentSortId:o,ascendingOrder:s,setAscendingOrder:l,onResetSort:u,onSortByColumn:f,sortedItems:d}=wl(e,t,n,a),{activeFilters:p,setActiveFilters:v,clearActiveFilters:h,setActiveTableFilter:m,filteredItems:b,filterItemsCache:x}=xl(e,t,r,d),S=c.useMemo(()=>b,[b]);return{activeFilters:p,setActiveFilters:v,clearActiveFilters:h,setActiveTableFilter:m,filterItemsCache:x,currentSortId:i,setCurrentSortId:o,ascendingOrder:s,setAscendingOrder:l,onResetSort:u,onSortByColumn:f,processedItems:S}}function Sl(e,t,r){const[n,a]=c.useState([]),i=c.useCallback(d=>{a(p=>p.includes(d)?p.filter(m=>m!==d):[...p,d])},[]),o=c.useMemo(()=>{if(!t)return{"":e.map((m,b)=>({rowIndex:b,item:m}))};const d=e.reduce((h,m)=>{const b=m[t];return h[b]||(h[b]=[]),h[b].push({rowIndex:0,item:m}),h},{});let p=0;const v={};return Object.keys(d).forEach(h=>{v[h]=d[h].map(({item:m})=>({rowIndex:p++,item:m}))}),v},[e,t]),s=c.useMemo(()=>{const d=Object.entries(o);if(!r||r.length===0)return d;const p=new Set(r.map(E=>E.master)),v=new Set(r.flatMap(E=>E.linked)),h=new Map(r.map(E=>[E.master,E.linked])),m=new Set,b=[],x=new Map(d.map(E=>[E[0],E]));for(const[E,R]of d)if(!m.has(E))if(p.has(E)){b.push([E,R]),m.add(E);const w=h.get(E)||[];for(const B of w){const J=x.get(B);J&&!m.has(B)&&(b.push(J),m.add(B))}}else{if(v.has(E))continue;b.push([E,R]),m.add(E)}let S=0;return b.map(([E,R])=>{const w=R.map(({item:B})=>({rowIndex:S++,item:B}));return[E,w]})},[o,r]),l=c.useMemo(()=>d=>{var p;return(p=r==null?void 0:r.find(v=>v.linked.includes(d)))==null?void 0:p.master},[r]),u=c.useMemo(()=>{const d=[];return s.forEach(([p,v])=>{var m;const h=(n==null?void 0:n.includes(p))??!1;d.push({isGroup:!0,groupName:p,isCollapsed:h,masterGroupName:l(p),linkedGroupNames:(m=r==null?void 0:r.find(b=>b.master===p))==null?void 0:m.linked}),h||v.forEach(({rowIndex:b,item:x})=>{d.push({isGroup:!1,rowIndex:b,groupName:p,isCollapsed:h,item:x})})}),d},[s,n]),f=c.useMemo(()=>d=>!!(r!=null&&r.some(p=>p.linked.includes(d))),[r]);return{groupedItems:o,groupedItemsEntries:s,collapsedGroups:n,flatGroupedItemsToDisplay:u,onCollapseGroup:i,setCollapsedGroup:a,isGroupLinked:f,getMasterGroupNameLinked:l}}const El=(e,t,r,n,a)=>{e.stopPropagation();let i=t,o=[...r];if(e.key==="Tab"){let s=(t==null?void 0:t.rowIndex)??0,l=(t==null?void 0:t.columnIndex)??0;if(r.length>1){const u=Math.min(...r.map(v=>v.rowIndex)),f=Math.max(...r.map(v=>v.rowIndex)),d=Math.min(...r.map(v=>v.columnIndex)),p=Math.max(...r.map(v=>v.columnIndex));e.shiftKey?(l--,l<d&&(l=p,s--,s<u&&(s=f))):(l++,l>p&&(l=d,s++,s>f&&(s=u)))}else l=((t==null?void 0:t.columnIndex)??0)+(e.shiftKey?-1:1),l>=n?(l=0,s++):l<0&&(l=n-1,s--),s>=a&&(s=0),s<0&&(s=a-1),o=[];i={rowIndex:s,columnIndex:l}}if(e.shiftKey&&["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.key)&&(o=$l(t,r,e.key)),!e.shiftKey&&["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(e.key)){let s=(t==null?void 0:t.rowIndex)??0,l=(t==null?void 0:t.columnIndex)??0;switch(e.key){case"ArrowDown":s=Math.min(a-1,s+1);break;case"ArrowUp":s=Math.max(0,s-1);break;case"ArrowRight":l=Math.min(n-1,l+1);break;case"ArrowLeft":l=Math.max(0,l-1);break}i={rowIndex:s,columnIndex:l},o=[]}return{newSelectedCell:i,newExpandedSelection:o}};function $l(e,t,r){if(!e)return t;let n,a,i,o;if(t.length===0)return[{...e}];n=Math.min(...t.map(h=>h.rowIndex)),a=Math.max(...t.map(h=>h.rowIndex)),i=Math.min(...t.map(h=>h.columnIndex)),o=Math.max(...t.map(h=>h.columnIndex));let s=0,l=0;switch(e.rowIndex===n?s=a:s=n,e.columnIndex===i?l=o:l=i,r){case"ArrowUp":s=s-1;break;case"ArrowDown":s=s+1;break;case"ArrowLeft":l=l-1;break;case"ArrowRight":l=l+1;break;default:return t}const u=Math.min(e.rowIndex,s),f=Math.max(e.rowIndex,s),d=Math.min(e.columnIndex,l),p=Math.max(e.columnIndex,l),v=[];for(let h=u;h<=f;h++)for(let m=d;m<=p;m++)v.push({rowIndex:h,columnIndex:m});return v}function _l({headers:e,items:t,groupedItemsEntries:r,onChange:n,onBulkChange:a,onRowDoubleClick:i}){const[o,s]=c.useState(),[l,u]=c.useState([]),f=c.useCallback(P=>{if(P)if(r){const _=r.flatMap(([T,H])=>H.filter(X=>X.rowIndex===P.rowIndex))[0];if(_)return _.item}else return t[P.rowIndex]},[r,t]),d=c.useCallback((P,_,T,H)=>{const X=t.findIndex(q=>q===_);let Z;if(H){const q=_[T.fromArray];q[H.index]={...q[H.index],[T.id]:P},Z={..._,[T.fromArray]:q}}else Z={..._,[T.id]:P};return{itemUpdated:Z,originalIndex:X}},[t]),p=c.useCallback((P,_,T,H)=>{var q;const{itemUpdated:X,originalIndex:Z}=d(P,_,T,H.fromArrayData);if(n){const re=(q=H.fromArrayData)==null?void 0:q.index;(re===void 0?_[T.id]!==P:_[T.fromArray][re]!==P)&&n(X,Z,re)}},[n,d]),v=c.useCallback((P,_,T)=>{T.preventDefault(),l.some(X=>X.rowIndex===P&&X.columnIndex===_)||(s({rowIndex:P,columnIndex:_}),u([]))},[l]),h=c.useCallback((P,_,T,H)=>{var Z;let X=[...l];if(o&&!l.some(q=>q.rowIndex===o.rowIndex&&q.columnIndex===o.columnIndex)&&(X=[...l,o]),(l==null?void 0:l.length)>1){const q=X.map(re=>{const ne=f(re);return ne?(console.log("Edit value",P),{itemUpdated:{...ne,[T.id]:P},originalIndex:t.findIndex(g=>g===ne)}):null}).filter(Boolean);a&&q.length>0&&a(q,T.id)}else{const{itemUpdated:q,originalIndex:re}=d(P,_,T);if(n){const ne=(Z=H.fromArrayData)==null?void 0:Z.index;(ne===void 0?_[T.id]!==P:_[T.fromArray][ne]!==P)&&n(q,re,ne)}}},[l,o,f,t,a,n,d]),m=c.useCallback(P=>{var _,T;((o==null?void 0:o.rowIndex)!==P.rowIndex||(o==null?void 0:o.columnIndex)!==P.columnIndex||((_=o==null?void 0:o.fromArrayData)==null?void 0:_.index)!==((T=P.fromArrayData)==null?void 0:T.index))&&(s(P),u([]))},[o]),b=c.useCallback(P=>{const{newSelectedCell:_,newExpandedSelection:T}=El(P,o,l,e.length,t.length);s(_),u(T)},[o,l,e.length,t.length]),x=c.useCallback(P=>{i&&i(P)},[i]),S=c.useRef(!1),[E,R]=c.useState(!1),[w,B]=c.useState(),J=c.useCallback((P,_,T)=>{S.current=!0,B({rowIndex:_,columnIndex:T})},[]),te=c.useCallback((P,_,T)=>{if(P.stopPropagation(),!E||!w)return;const H=Math.min(w.rowIndex,_),X=Math.max(w.rowIndex,_),Z=Math.min(w.columnIndex,T),q=Math.max(w.columnIndex,T),re=[];for(let ne=H;ne<=X;ne++)for(let g=Z;g<=q;g++)re.push({rowIndex:ne,columnIndex:g});u(re)},[E,w]),ce=c.useCallback(P=>{P.preventDefault(),S.current&&!E&&R(!0),E&&w!==o&&s(w)},[E,w,o]),ue=c.useCallback(()=>{S.current=!1,R(!1)},[]);return c.useEffect(()=>(window.addEventListener("mouseup",ue),()=>{window.removeEventListener("mouseup",ue)}),[ue]),{selectedCell:o,expandedSelection:l,isDragging:E,setSelectedCell:s,setExpandedSelection:u,onCellBlur:p,onCellEnter:h,onCellClick:m,handleCellKeyDown:b,handleRowDoubleClick:x,onCellMouseDown:J,onCellMouseEnter:te,onMouseMove:ce,onRightClick:v,getItemFromCellCoordinates:f}}function Je(e,t,r){let n=r.initialDeps??[],a;function i(){var o,s,l,u;let f;r.key&&((o=r.debug)!=null&&o.call(r))&&(f=Date.now());const d=e();if(!(d.length!==n.length||d.some((h,m)=>n[m]!==h)))return a;n=d;let v;if(r.key&&((s=r.debug)!=null&&s.call(r))&&(v=Date.now()),a=t(...d),r.key&&((l=r.debug)!=null&&l.call(r))){const h=Math.round((Date.now()-f)*100)/100,m=Math.round((Date.now()-v)*100)/100,b=m/16,x=(S,E)=>{for(S=String(S);S.length<E;)S=" "+S;return S};console.info(`%c⏱ ${x(m,5)} /${x(h,5)} ms`,`
|
|
48
48
|
font-size: .6rem;
|
|
49
49
|
font-weight: bold;
|
|
@@ -75,5 +75,5 @@ Valid keys: `+JSON.stringify(Object.keys(g),null," "));var O=le(L,V,I,N,z+"."+V
|
|
|
75
75
|
}
|
|
76
76
|
`),c.createElement("div",{style:f.white,className:"saturation-white"},c.createElement("div",{style:f.black,className:"saturation-black"}),c.createElement("div",{style:f.pointer},this.props.pointer?c.createElement(this.props.pointer,this.props):c.createElement("div",{style:f.circle}))))}}]),t}(c.PureComponent||c.Component);function lC(e,t){for(var r=-1,n=e==null?0:e.length;++r<n&&t(e[r],r,e)!==!1;);return e}var cC=Zo(Object.keys,Object),uC=Object.prototype,fC=uC.hasOwnProperty;function dC(e){if(!In(e))return cC(e);var t=[];for(var r in Object(e))fC.call(e,r)&&r!="constructor"&&t.push(r);return t}function Dn(e){return $t(e)?ns(e):dC(e)}function hC(e,t){return e&&Yo(e,t,Dn)}function pC(e,t){return function(r,n){if(r==null)return r;if(!$t(r))return e(r,n);for(var a=r.length,i=-1,o=Object(r);++i<a&&n(o[i],i,o)!==!1;);return r}}var ss=pC(hC);function gC(e){return typeof e=="function"?e:$r}function vC(e,t){var r=we(e)?lC:ss;return r(e,gC(t))}function dr(e){"@babel/helpers - typeof";return dr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},dr(e)}var bC=/^\s+/,mC=/\s+$/;function F(e,t){if(e=e||"",t=t||{},e instanceof F)return e;if(!(this instanceof F))return new F(e,t);var r=yC(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.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=r.ok}F.prototype={isDark:function(){return this.getBrightness()<128},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 t=this.toRgb();return(t.r*299+t.g*587+t.b*114)/1e3},getLuminance:function(){var t=this.toRgb(),r,n,a,i,o,s;return r=t.r/255,n=t.g/255,a=t.b/255,r<=.03928?i=r/12.92:i=Math.pow((r+.055)/1.055,2.4),n<=.03928?o=n/12.92:o=Math.pow((n+.055)/1.055,2.4),a<=.03928?s=a/12.92:s=Math.pow((a+.055)/1.055,2.4),.2126*i+.7152*o+.0722*s},setAlpha:function(t){return this._a=ls(t),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var t=_i(this._r,this._g,this._b);return{h:t.h*360,s:t.s,v:t.v,a:this._a}},toHsvString:function(){var t=_i(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),a=Math.round(t.v*100);return this._a==1?"hsv("+r+", "+n+"%, "+a+"%)":"hsva("+r+", "+n+"%, "+a+"%, "+this._roundA+")"},toHsl:function(){var t=$i(this._r,this._g,this._b);return{h:t.h*360,s:t.s,l:t.l,a:this._a}},toHslString:function(){var t=$i(this._r,this._g,this._b),r=Math.round(t.h*360),n=Math.round(t.s*100),a=Math.round(t.l*100);return this._a==1?"hsl("+r+", "+n+"%, "+a+"%)":"hsla("+r+", "+n+"%, "+a+"%, "+this._roundA+")"},toHex:function(t){return Oi(this._r,this._g,this._b,t)},toHexString:function(t){return"#"+this.toHex(t)},toHex8:function(t){return SC(this._r,this._g,this._b,this._a,t)},toHex8String:function(t){return"#"+this.toHex8(t)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return this._a==1?"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(se(this._r,255)*100)+"%",g:Math.round(se(this._g,255)*100)+"%",b:Math.round(se(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+Math.round(se(this._r,255)*100)+"%, "+Math.round(se(this._g,255)*100)+"%, "+Math.round(se(this._b,255)*100)+"%)":"rgba("+Math.round(se(this._r,255)*100)+"%, "+Math.round(se(this._g,255)*100)+"%, "+Math.round(se(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:kC[Oi(this._r,this._g,this._b,!0)]||!1},toFilter:function(t){var r="#"+Ti(this._r,this._g,this._b,this._a),n=r,a=this._gradientType?"GradientType = 1, ":"";if(t){var i=F(t);n="#"+Ti(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+a+"startColorstr="+r+",endColorstr="+n+")"},toString:function(t){var r=!!t;t=t||this._format;var n=!1,a=this._a<1&&this._a>=0,i=!r&&a&&(t==="hex"||t==="hex6"||t==="hex3"||t==="hex4"||t==="hex8"||t==="name");return i?t==="name"&&this._a===0?this.toName():this.toRgbString():(t==="rgb"&&(n=this.toRgbString()),t==="prgb"&&(n=this.toPercentageRgbString()),(t==="hex"||t==="hex6")&&(n=this.toHexString()),t==="hex3"&&(n=this.toHexString(!0)),t==="hex4"&&(n=this.toHex8String(!0)),t==="hex8"&&(n=this.toHex8String()),t==="name"&&(n=this.toName()),t==="hsl"&&(n=this.toHslString()),t==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},clone:function(){return F(this.toString())},_applyModification:function(t,r){var n=t.apply(null,[this].concat([].slice.call(r)));return this._r=n._r,this._g=n._g,this._b=n._b,this.setAlpha(n._a),this},lighten:function(){return this._applyModification(OC,arguments)},brighten:function(){return this._applyModification(TC,arguments)},darken:function(){return this._applyModification(AC,arguments)},desaturate:function(){return this._applyModification(EC,arguments)},saturate:function(){return this._applyModification($C,arguments)},greyscale:function(){return this._applyModification(_C,arguments)},spin:function(){return this._applyModification(RC,arguments)},_applyCombination:function(t,r){return t.apply(null,[this].concat([].slice.call(r)))},analogous:function(){return this._applyCombination(jC,arguments)},complement:function(){return this._applyCombination(MC,arguments)},monochromatic:function(){return this._applyCombination(IC,arguments)},splitcomplement:function(){return this._applyCombination(PC,arguments)},triad:function(){return this._applyCombination(Ai,[3])},tetrad:function(){return this._applyCombination(Ai,[4])}};F.fromRatio=function(e,t){if(dr(e)=="object"){var r={};for(var n in e)e.hasOwnProperty(n)&&(n==="a"?r[n]=e[n]:r[n]=Pt(e[n]));e=r}return F(e,t)};function yC(e){var t={r:0,g:0,b:0},r=1,n=null,a=null,i=null,o=!1,s=!1;return typeof e=="string"&&(e=NC(e)),dr(e)=="object"&&(je(e.r)&&je(e.g)&&je(e.b)?(t=xC(e.r,e.g,e.b),o=!0,s=String(e.r).substr(-1)==="%"?"prgb":"rgb"):je(e.h)&&je(e.s)&&je(e.v)?(n=Pt(e.s),a=Pt(e.v),t=CC(e.h,n,a),o=!0,s="hsv"):je(e.h)&&je(e.s)&&je(e.l)&&(n=Pt(e.s),i=Pt(e.l),t=wC(e.h,n,i),o=!0,s="hsl"),e.hasOwnProperty("a")&&(r=e.a)),r=ls(r),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}function xC(e,t,r){return{r:se(e,255)*255,g:se(t,255)*255,b:se(r,255)*255}}function $i(e,t,r){e=se(e,255),t=se(t,255),r=se(r,255);var n=Math.max(e,t,r),a=Math.min(e,t,r),i,o,s=(n+a)/2;if(n==a)i=o=0;else{var l=n-a;switch(o=s>.5?l/(2-n-a):l/(n+a),n){case e:i=(t-r)/l+(t<r?6:0);break;case t:i=(r-e)/l+2;break;case r:i=(e-t)/l+4;break}i/=6}return{h:i,s:o,l:s}}function wC(e,t,r){var n,a,i;e=se(e,360),t=se(t,100),r=se(r,100);function o(u,f,d){return d<0&&(d+=1),d>1&&(d-=1),d<1/6?u+(f-u)*6*d:d<1/2?f:d<2/3?u+(f-u)*(2/3-d)*6:u}if(t===0)n=a=i=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=o(l,s,e+1/3),a=o(l,s,e),i=o(l,s,e-1/3)}return{r:n*255,g:a*255,b:i*255}}function _i(e,t,r){e=se(e,255),t=se(t,255),r=se(r,255);var n=Math.max(e,t,r),a=Math.min(e,t,r),i,o,s=n,l=n-a;if(o=n===0?0:l/n,n==a)i=0;else{switch(n){case e:i=(t-r)/l+(t<r?6:0);break;case t:i=(r-e)/l+2;break;case r:i=(e-t)/l+4;break}i/=6}return{h:i,s:o,v:s}}function CC(e,t,r){e=se(e,360)*6,t=se(t,100),r=se(r,100);var n=Math.floor(e),a=e-n,i=r*(1-t),o=r*(1-a*t),s=r*(1-(1-a)*t),l=n%6,u=[r,o,i,i,s,r][l],f=[s,r,r,o,i,i][l],d=[i,i,s,r,r,o][l];return{r:u*255,g:f*255,b:d*255}}function Oi(e,t,r,n){var a=[_e(Math.round(e).toString(16)),_e(Math.round(t).toString(16)),_e(Math.round(r).toString(16))];return n&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function SC(e,t,r,n,a){var i=[_e(Math.round(e).toString(16)),_e(Math.round(t).toString(16)),_e(Math.round(r).toString(16)),_e(cs(n))];return a&&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[3].charAt(0)==i[3].charAt(1)?i[0].charAt(0)+i[1].charAt(0)+i[2].charAt(0)+i[3].charAt(0):i.join("")}function Ti(e,t,r,n){var a=[_e(cs(n)),_e(Math.round(e).toString(16)),_e(Math.round(t).toString(16)),_e(Math.round(r).toString(16))];return a.join("")}F.equals=function(e,t){return!e||!t?!1:F(e).toRgbString()==F(t).toRgbString()};F.random=function(){return F.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})};function EC(e,t){t=t===0?0:t||10;var r=F(e).toHsl();return r.s-=t/100,r.s=Tr(r.s),F(r)}function $C(e,t){t=t===0?0:t||10;var r=F(e).toHsl();return r.s+=t/100,r.s=Tr(r.s),F(r)}function _C(e){return F(e).desaturate(100)}function OC(e,t){t=t===0?0:t||10;var r=F(e).toHsl();return r.l+=t/100,r.l=Tr(r.l),F(r)}function TC(e,t){t=t===0?0:t||10;var r=F(e).toRgb();return r.r=Math.max(0,Math.min(255,r.r-Math.round(255*-(t/100)))),r.g=Math.max(0,Math.min(255,r.g-Math.round(255*-(t/100)))),r.b=Math.max(0,Math.min(255,r.b-Math.round(255*-(t/100)))),F(r)}function AC(e,t){t=t===0?0:t||10;var r=F(e).toHsl();return r.l-=t/100,r.l=Tr(r.l),F(r)}function RC(e,t){var r=F(e).toHsl(),n=(r.h+t)%360;return r.h=n<0?360+n:n,F(r)}function MC(e){var t=F(e).toHsl();return t.h=(t.h+180)%360,F(t)}function Ai(e,t){if(isNaN(t)||t<=0)throw new Error("Argument to polyad must be a positive number");for(var r=F(e).toHsl(),n=[F(e)],a=360/t,i=1;i<t;i++)n.push(F({h:(r.h+i*a)%360,s:r.s,l:r.l}));return n}function PC(e){var t=F(e).toHsl(),r=t.h;return[F(e),F({h:(r+72)%360,s:t.s,l:t.l}),F({h:(r+216)%360,s:t.s,l:t.l})]}function jC(e,t,r){t=t||6,r=r||30;var n=F(e).toHsl(),a=360/r,i=[F(e)];for(n.h=(n.h-(a*t>>1)+720)%360;--t;)n.h=(n.h+a)%360,i.push(F(n));return i}function IC(e,t){t=t||6;for(var r=F(e).toHsv(),n=r.h,a=r.s,i=r.v,o=[],s=1/t;t--;)o.push(F({h:n,s:a,v:i})),i=(i+s)%1;return o}F.mix=function(e,t,r){r=r===0?0:r||50;var n=F(e).toRgb(),a=F(t).toRgb(),i=r/100,o={r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a};return F(o)};F.readability=function(e,t){var r=F(e),n=F(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)};F.isReadable=function(e,t,r){var n=F.readability(e,t),a,i;switch(i=!1,a=HC(r),a.level+a.size){case"AAsmall":case"AAAlarge":i=n>=4.5;break;case"AAlarge":i=n>=3;break;case"AAAsmall":i=n>=7;break}return i};F.mostReadable=function(e,t,r){var n=null,a=0,i,o,s,l;r=r||{},o=r.includeFallbackColors,s=r.level,l=r.size;for(var u=0;u<t.length;u++)i=F.readability(e,t[u]),i>a&&(a=i,n=F(t[u]));return F.isReadable(e,n,{level:s,size:l})||!o?n:(r.includeFallbackColors=!1,F.mostReadable(e,["#fff","#000"],r))};var an=F.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"},kC=F.hexNames=FC(an);function FC(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}function ls(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function se(e,t){LC(e)&&(e="100%");var r=DC(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function Tr(e){return Math.min(1,Math.max(0,e))}function xe(e){return parseInt(e,16)}function LC(e){return typeof e=="string"&&e.indexOf(".")!=-1&&parseFloat(e)===1}function DC(e){return typeof e=="string"&&e.indexOf("%")!=-1}function _e(e){return e.length==1?"0"+e:""+e}function Pt(e){return e<=1&&(e=e*100+"%"),e}function cs(e){return Math.round(parseFloat(e)*255).toString(16)}function Ri(e){return xe(e)/255}var $e=function(){var e="[-\\+]?\\d+%?",t="[-\\+]?\\d*\\.\\d+%?",r="(?:"+t+")|(?:"+e+")",n="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?",a="[\\s|\\(]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")[,|\\s]+("+r+")\\s*\\)?";return{CSS_UNIT:new RegExp(r),rgb:new RegExp("rgb"+n),rgba:new RegExp("rgba"+a),hsl:new RegExp("hsl"+n),hsla:new RegExp("hsla"+a),hsv:new RegExp("hsv"+n),hsva:new RegExp("hsva"+a),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 je(e){return!!$e.CSS_UNIT.exec(e)}function NC(e){e=e.replace(bC,"").replace(mC,"").toLowerCase();var t=!1;if(an[e])e=an[e],t=!0;else if(e=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var r;return(r=$e.rgb.exec(e))?{r:r[1],g:r[2],b:r[3]}:(r=$e.rgba.exec(e))?{r:r[1],g:r[2],b:r[3],a:r[4]}:(r=$e.hsl.exec(e))?{h:r[1],s:r[2],l:r[3]}:(r=$e.hsla.exec(e))?{h:r[1],s:r[2],l:r[3],a:r[4]}:(r=$e.hsv.exec(e))?{h:r[1],s:r[2],v:r[3]}:(r=$e.hsva.exec(e))?{h:r[1],s:r[2],v:r[3],a:r[4]}:(r=$e.hex8.exec(e))?{r:xe(r[1]),g:xe(r[2]),b:xe(r[3]),a:Ri(r[4]),format:t?"name":"hex8"}:(r=$e.hex6.exec(e))?{r:xe(r[1]),g:xe(r[2]),b:xe(r[3]),format:t?"name":"hex"}:(r=$e.hex4.exec(e))?{r:xe(r[1]+""+r[1]),g:xe(r[2]+""+r[2]),b:xe(r[3]+""+r[3]),a:Ri(r[4]+""+r[4]),format:t?"name":"hex8"}:(r=$e.hex3.exec(e))?{r:xe(r[1]+""+r[1]),g:xe(r[2]+""+r[2]),b:xe(r[3]+""+r[3]),format:t?"name":"hex"}:!1}function HC(e){var t,r;return e=e||{level:"AA",size:"small"},t=(e.level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),t!=="AA"&&t!=="AAA"&&(t="AA"),r!=="small"&&r!=="large"&&(r="small"),{level:t,size:r}}var Mi=function(t){var r=["r","g","b","a","h","s","l","v"],n=0,a=0;return vC(r,function(i){if(t[i]&&(n+=1,isNaN(t[i])||(a+=1),i==="s"||i==="l")){var o=/^\d+%$/;o.test(t[i])&&(a+=1)}}),n===a?t:!1},jt=function(t,r){var n=t.hex?F(t.hex):F(t),a=n.toHsl(),i=n.toHsv(),o=n.toRgb(),s=n.toHex();a.s===0&&(a.h=r||0,i.h=r||0);var l=s==="000000"&&o.a===0;return{hsl:a,hex:l?"transparent":"#"+s,rgb:o,hsv:i,oldHue:t.h||r||a.h,source:t.source}},ze=function(t){if(t==="transparent")return!0;var r=String(t).charAt(0)==="#"?1:0;return t.length!==4+r&&t.length<7+r&&F(t).isValid()},Nn=function(t){if(!t)return"#fff";var r=jt(t);if(r.hex==="transparent")return"rgba(0,0,0,0.4)";var n=(r.rgb.r*299+r.rgb.g*587+r.rgb.b*114)/1e3;return n>=128?"#000":"#fff"},Kr=function(t,r){var n=t.replace("°","");return F(r+" ("+n+")")._ok},Rt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BC=function(){function e(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function zC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function GC(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function UC(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var me=function(t){var r=function(n){UC(a,n);function a(i){zC(this,a);var o=GC(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));return o.handleChange=function(s,l){var u=Mi(s);if(u){var f=jt(s,s.h||o.state.oldHue);o.setState(f),o.props.onChangeComplete&&o.debounce(o.props.onChangeComplete,f,l),o.props.onChange&&o.props.onChange(f,l)}},o.handleSwatchHover=function(s,l){var u=Mi(s);if(u){var f=jt(s,s.h||o.state.oldHue);o.props.onSwatchHover&&o.props.onSwatchHover(f,l)}},o.state=Rt({},jt(i.color,0)),o.debounce=os(function(s,l,u){s(l,u)},100),o}return BC(a,[{key:"render",value:function(){var o={};return this.props.onSwatchHover&&(o.onSwatchHover=this.handleSwatchHover),c.createElement(t,Rt({},this.props,this.state,{onChange:this.handleChange},o))}}],[{key:"getDerivedStateFromProps",value:function(o,s){return Rt({},jt(o.color,s.oldHue))}}]),a}(c.PureComponent||c.Component);return r.propTypes=Rt({},t.propTypes),r.defaultProps=Rt({},t.defaultProps,{color:{h:250,s:.5,l:.2,a:1}}),r},VC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WC=function(){function e(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function qC(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pi(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function KC(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var YC=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"span";return function(n){KC(a,n);function a(){var i,o,s,l;qC(this,a);for(var u=arguments.length,f=Array(u),d=0;d<u;d++)f[d]=arguments[d];return l=(o=(s=Pi(this,(i=a.__proto__||Object.getPrototypeOf(a)).call.apply(i,[this].concat(f))),s),s.state={focus:!1},s.handleFocus=function(){return s.setState({focus:!0})},s.handleBlur=function(){return s.setState({focus:!1})},o),Pi(s,l)}return WC(a,[{key:"render",value:function(){return c.createElement(r,{onFocus:this.handleFocus,onBlur:this.handleBlur},c.createElement(t,VC({},this.props,this.state)))}}]),a}(c.Component)},ji=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XC=13,ZC=function(t){var r=t.color,n=t.style,a=t.onClick,i=a===void 0?function(){}:a,o=t.onHover,s=t.title,l=s===void 0?r:s,u=t.children,f=t.focus,d=t.focusStyle,p=d===void 0?{}:d,v=r==="transparent",h=G({default:{swatch:ji({background:r,height:"100%",width:"100%",cursor:"pointer",position:"relative",outline:"none"},n,f?p:{})}}),m=function(R){return i(r,R)},b=function(R){return R.keyCode===XC&&i(r,R)},x=function(R){return o(r,R)},S={};return o&&(S.onMouseOver=x),c.createElement("div",ji({style:h.swatch,onClick:m,title:l,tabIndex:0,onKeyDown:b},S),u,v&&c.createElement(St,{borderRadius:h.swatch.borderRadius,boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"}))};const Xe=YC(ZC);var JC=function(t){var r=t.direction,n=G({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:r==="vertical"});return c.createElement("div",{style:n.picker})},QC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},us=function(t){var r=t.rgb,n=t.hsl,a=t.width,i=t.height,o=t.onChange,s=t.direction,l=t.style,u=t.renderers,f=t.pointer,d=t.className,p=d===void 0?"":d,v=G({default:{picker:{position:"relative",width:a,height:i},alpha:{radius:"2px",style:l}}});return c.createElement("div",{style:v.picker,className:"alpha-picker "+p},c.createElement(Mn,QC({},v.alpha,{rgb:r,hsl:n,pointer:f,renderers:u,onChange:o,direction:s})))};us.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:JC};me(us);function fs(e,t){for(var r=-1,n=e==null?0:e.length,a=Array(n);++r<n;)a[r]=t(e[r],r,e);return a}var eS="__lodash_hash_undefined__";function tS(e){return this.__data__.set(e,eS),this}function rS(e){return this.__data__.has(e)}function hr(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new Le;++t<r;)this.add(e[t])}hr.prototype.add=hr.prototype.push=tS;hr.prototype.has=rS;function nS(e,t){for(var r=-1,n=e==null?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}function aS(e,t){return e.has(t)}var iS=1,oS=2;function ds(e,t,r,n,a,i){var o=r&iS,s=e.length,l=t.length;if(s!=l&&!(o&&l>s))return!1;var u=i.get(e),f=i.get(t);if(u&&f)return u==t&&f==e;var d=-1,p=!0,v=r&oS?new hr:void 0;for(i.set(e,t),i.set(t,e);++d<s;){var h=e[d],m=t[d];if(n)var b=o?n(m,h,d,t,e,i):n(h,m,d,e,t,i);if(b!==void 0){if(b)continue;p=!1;break}if(v){if(!nS(t,function(x,S){if(!aS(v,S)&&(h===x||a(h,x,r,n,i)))return v.push(S)})){p=!1;break}}else if(!(h===m||a(h,m,r,n,i))){p=!1;break}}return i.delete(e),i.delete(t),p}function sS(e){var t=-1,r=Array(e.size);return e.forEach(function(n,a){r[++t]=[a,n]}),r}function lS(e){var t=-1,r=Array(e.size);return e.forEach(function(n){r[++t]=n}),r}var cS=1,uS=2,fS="[object Boolean]",dS="[object Date]",hS="[object Error]",pS="[object Map]",gS="[object Number]",vS="[object RegExp]",bS="[object Set]",mS="[object String]",yS="[object Symbol]",xS="[object ArrayBuffer]",wS="[object DataView]",Ii=He?He.prototype:void 0,Yr=Ii?Ii.valueOf:void 0;function CS(e,t,r,n,a,i,o){switch(r){case wS:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case xS:return!(e.byteLength!=t.byteLength||!i(new cr(e),new cr(t)));case fS:case dS:case gS:return Vt(+e,+t);case hS:return e.name==t.name&&e.message==t.message;case vS:case mS:return e==t+"";case pS:var s=sS;case bS:var l=n&cS;if(s||(s=lS),e.size!=t.size&&!l)return!1;var u=o.get(e);if(u)return u==t;n|=uS,o.set(e,t);var f=ds(s(e),s(t),n,a,i,o);return o.delete(e),f;case yS:if(Yr)return Yr.call(e)==Yr.call(t)}return!1}function SS(e,t){for(var r=-1,n=t.length,a=e.length;++r<n;)e[a+r]=t[r];return e}function ES(e,t,r){var n=t(e);return we(e)?n:SS(n,r(e))}function $S(e,t){for(var r=-1,n=e==null?0:e.length,a=0,i=[];++r<n;){var o=e[r];t(o,r,e)&&(i[a++]=o)}return i}function _S(){return[]}var OS=Object.prototype,TS=OS.propertyIsEnumerable,ki=Object.getOwnPropertySymbols,AS=ki?function(e){return e==null?[]:(e=Object(e),$S(ki(e),function(t){return TS.call(e,t)}))}:_S;function Fi(e){return ES(e,Dn,AS)}var RS=1,MS=Object.prototype,PS=MS.hasOwnProperty;function jS(e,t,r,n,a,i){var o=r&RS,s=Fi(e),l=s.length,u=Fi(t),f=u.length;if(l!=f&&!o)return!1;for(var d=l;d--;){var p=s[d];if(!(o?p in t:PS.call(t,p)))return!1}var v=i.get(e),h=i.get(t);if(v&&h)return v==t&&h==e;var m=!0;i.set(e,t),i.set(t,e);for(var b=o;++d<l;){p=s[d];var x=e[p],S=t[p];if(n)var E=o?n(S,x,p,t,e,i):n(x,S,p,e,t,i);if(!(E===void 0?x===S||a(x,S,r,n,i):E)){m=!1;break}b||(b=p=="constructor")}if(m&&!b){var R=e.constructor,w=t.constructor;R!=w&&"constructor"in e&&"constructor"in t&&!(typeof R=="function"&&R instanceof R&&typeof w=="function"&&w instanceof w)&&(m=!1)}return i.delete(e),i.delete(t),m}var on=Ye(Te,"DataView"),sn=Ye(Te,"Promise"),ln=Ye(Te,"Set"),cn=Ye(Te,"WeakMap"),Li="[object Map]",IS="[object Object]",Di="[object Promise]",Ni="[object Set]",Hi="[object WeakMap]",Bi="[object DataView]",kS=Ke(on),FS=Ke(Ft),LS=Ke(sn),DS=Ke(ln),NS=Ke(cn),Ne=qe;(on&&Ne(new on(new ArrayBuffer(1)))!=Bi||Ft&&Ne(new Ft)!=Li||sn&&Ne(sn.resolve())!=Di||ln&&Ne(new ln)!=Ni||cn&&Ne(new cn)!=Hi)&&(Ne=function(e){var t=qe(e),r=t==IS?e.constructor:void 0,n=r?Ke(r):"";if(n)switch(n){case kS:return Bi;case FS:return Li;case LS:return Di;case DS:return Ni;case NS:return Hi}return t});var HS=1,zi="[object Arguments]",Gi="[object Array]",Jt="[object Object]",BS=Object.prototype,Ui=BS.hasOwnProperty;function zS(e,t,r,n,a,i){var o=we(e),s=we(t),l=o?Gi:Ne(e),u=s?Gi:Ne(t);l=l==zi?Jt:l,u=u==zi?Jt:u;var f=l==Jt,d=u==Jt,p=l==u;if(p&&fr(e)){if(!fr(t))return!1;o=!0,f=!1}if(p&&!f)return i||(i=new Me),o||Fn(e)?ds(e,t,r,n,a,i):CS(e,t,l,r,n,a,i);if(!(r&HS)){var v=f&&Ui.call(e,"__wrapped__"),h=d&&Ui.call(t,"__wrapped__");if(v||h){var m=v?e.value():e,b=h?t.value():t;return i||(i=new Me),a(m,b,r,n,i)}}return p?(i||(i=new Me),jS(e,t,r,n,a,i)):!1}function Hn(e,t,r,n,a){return e===t?!0:e==null||t==null||!Be(e)&&!Be(t)?e!==e&&t!==t:zS(e,t,r,n,Hn,a)}var GS=1,US=2;function VS(e,t,r,n){var a=r.length,i=a;if(e==null)return!i;for(e=Object(e);a--;){var o=r[a];if(o[2]?o[1]!==e[o[0]]:!(o[0]in e))return!1}for(;++a<i;){o=r[a];var s=o[0],l=e[s],u=o[1];if(o[2]){if(l===void 0&&!(s in e))return!1}else{var f=new Me,d;if(!(d===void 0?Hn(u,l,GS|US,n,f):d))return!1}}return!0}function hs(e){return e===e&&!Ee(e)}function WS(e){for(var t=Dn(e),r=t.length;r--;){var n=t[r],a=e[n];t[r]=[n,a,hs(a)]}return t}function ps(e,t){return function(r){return r==null?!1:r[e]===t&&(t!==void 0||e in Object(r))}}function qS(e){var t=WS(e);return t.length==1&&t[0][2]?ps(t[0][0],t[0][1]):function(r){return r===e||VS(r,e,t)}}var KS=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,YS=/^\w*$/;function Bn(e,t){if(we(e))return!1;var r=typeof e;return r=="number"||r=="symbol"||r=="boolean"||e==null||_r(e)?!0:YS.test(e)||!KS.test(e)||t!=null&&e in Object(t)}var XS="Expected a function";function zn(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(XS);var r=function(){var n=arguments,a=t?t.apply(this,n):n[0],i=r.cache;if(i.has(a))return i.get(a);var o=e.apply(this,n);return r.cache=i.set(a,o)||i,o};return r.cache=new(zn.Cache||Le),r}zn.Cache=Le;var ZS=500;function JS(e){var t=zn(e,function(n){return r.size===ZS&&r.clear(),n}),r=t.cache;return t}var QS=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,eE=/\\(\\)?/g,tE=JS(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(QS,function(r,n,a,i){t.push(a?i.replace(eE,"$1"):n||r)}),t}),Vi=He?He.prototype:void 0,Wi=Vi?Vi.toString:void 0;function gs(e){if(typeof e=="string")return e;if(we(e))return fs(e,gs)+"";if(_r(e))return Wi?Wi.call(e):"";var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function rE(e){return e==null?"":gs(e)}function vs(e,t){return we(e)?e:Bn(e,t)?[e]:tE(rE(e))}function Ar(e){if(typeof e=="string"||_r(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function bs(e,t){t=vs(t,e);for(var r=0,n=t.length;e!=null&&r<n;)e=e[Ar(t[r++])];return r&&r==n?e:void 0}function nE(e,t,r){var n=e==null?void 0:bs(e,t);return n===void 0?r:n}function aE(e,t){return e!=null&&t in Object(e)}function iE(e,t,r){t=vs(t,e);for(var n=-1,a=t.length,i=!1;++n<a;){var o=Ar(t[n]);if(!(i=e!=null&&r(e,o)))break;e=e[o]}return i||++n!=a?i:(a=e==null?0:e.length,!!a&&kn(a)&&Ln(o,a)&&(we(e)||ur(e)))}function oE(e,t){return e!=null&&iE(e,t,aE)}var sE=1,lE=2;function cE(e,t){return Bn(e)&&hs(t)?ps(Ar(e),t):function(r){var n=nE(r,e);return n===void 0&&n===t?oE(r,e):Hn(t,n,sE|lE)}}function uE(e){return function(t){return t==null?void 0:t[e]}}function fE(e){return function(t){return bs(t,e)}}function dE(e){return Bn(e)?uE(Ar(e)):fE(e)}function hE(e){return typeof e=="function"?e:e==null?$r:typeof e=="object"?we(e)?cE(e[0],e[1]):qS(e):dE(e)}function pE(e,t){var r=-1,n=$t(e)?Array(e.length):[];return ss(e,function(a,i,o){n[++r]=t(a,i,o)}),n}function Ze(e,t){var r=we(e)?fs:pE;return r(e,hE(t))}var gE=function(t){var r=t.colors,n=t.onClick,a=t.onSwatchHover,i=G({default:{swatches:{marginRight:"-10px"},swatch:{width:"22px",height:"22px",float:"left",marginRight:"10px",marginBottom:"10px",borderRadius:"4px"},clear:{clear:"both"}}});return c.createElement("div",{style:i.swatches},Ze(r,function(o){return c.createElement(Xe,{key:o,color:o,style:i.swatch,onClick:n,onHover:a,focusStyle:{boxShadow:"0 0 4px "+o}})}),c.createElement("div",{style:i.clear}))},Gn=function(t){var r=t.onChange,n=t.onSwatchHover,a=t.hex,i=t.colors,o=t.width,s=t.triangle,l=t.styles,u=l===void 0?{}:l,f=t.className,d=f===void 0?"":f,p=a==="transparent",v=function(b,x){ze(b)&&r({hex:b,source:"hex"},x)},h=G(be({default:{card:{width:o,background:"#fff",boxShadow:"0 1px rgba(0,0,0,.1)",borderRadius:"6px",position:"relative"},head:{height:"110px",background:a,borderRadius:"6px 6px 0 0",display:"flex",alignItems:"center",justifyContent:"center",position:"relative"},body:{padding:"10px"},label:{fontSize:"18px",color:Nn(a),position:"relative"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 10px 10px 10px",borderColor:"transparent transparent "+a+" transparent",position:"absolute",top:"-10px",left:"50%",marginLeft:"-10px"},input:{width:"100%",fontSize:"12px",color:"#666",border:"0px",outline:"none",height:"22px",boxShadow:"inset 0 0 0 1px #ddd",borderRadius:"4px",padding:"0 7px",boxSizing:"border-box"}},"hide-triangle":{triangle:{display:"none"}}},u),{"hide-triangle":s==="hide"});return c.createElement("div",{style:h.card,className:"block-picker "+d},c.createElement("div",{style:h.triangle}),c.createElement("div",{style:h.head},p&&c.createElement(St,{borderRadius:"6px 6px 0 0"}),c.createElement("div",{style:h.label},a)),c.createElement("div",{style:h.body},c.createElement(gE,{colors:i,onClick:v,onSwatchHover:n}),c.createElement(Y,{style:{input:h.input},value:a,onChange:v})))};Gn.propTypes={width:$.oneOfType([$.string,$.number]),colors:$.arrayOf($.string),triangle:$.oneOf(["top","hide"]),styles:$.object};Gn.defaultProps={width:170,colors:["#D9E3F0","#F47373","#697689","#37D67A","#2CCCE4","#555555","#dce775","#ff8a65","#ba68c8"],triangle:"top",styles:{}};me(Gn);var Qe={100:"#ffcdd2",300:"#e57373",500:"#f44336",700:"#d32f2f",900:"#b71c1c"},et={100:"#f8bbd0",300:"#f06292",500:"#e91e63",700:"#c2185b",900:"#880e4f"},tt={100:"#e1bee7",300:"#ba68c8",500:"#9c27b0",700:"#7b1fa2",900:"#4a148c"},rt={100:"#d1c4e9",300:"#9575cd",500:"#673ab7",700:"#512da8",900:"#311b92"},nt={100:"#c5cae9",300:"#7986cb",500:"#3f51b5",700:"#303f9f",900:"#1a237e"},at={100:"#bbdefb",300:"#64b5f6",500:"#2196f3",700:"#1976d2",900:"#0d47a1"},it={100:"#b3e5fc",300:"#4fc3f7",500:"#03a9f4",700:"#0288d1",900:"#01579b"},ot={100:"#b2ebf2",300:"#4dd0e1",500:"#00bcd4",700:"#0097a7",900:"#006064"},st={100:"#b2dfdb",300:"#4db6ac",500:"#009688",700:"#00796b",900:"#004d40"},It={100:"#c8e6c9",300:"#81c784",500:"#4caf50",700:"#388e3c"},lt={100:"#dcedc8",300:"#aed581",500:"#8bc34a",700:"#689f38",900:"#33691e"},ct={100:"#f0f4c3",300:"#dce775",500:"#cddc39",700:"#afb42b",900:"#827717"},ut={100:"#fff9c4",300:"#fff176",500:"#ffeb3b",700:"#fbc02d",900:"#f57f17"},ft={100:"#ffecb3",300:"#ffd54f",500:"#ffc107",700:"#ffa000",900:"#ff6f00"},dt={100:"#ffe0b2",300:"#ffb74d",500:"#ff9800",700:"#f57c00",900:"#e65100"},ht={100:"#ffccbc",300:"#ff8a65",500:"#ff5722",700:"#e64a19",900:"#bf360c"},pt={100:"#d7ccc8",300:"#a1887f",500:"#795548",700:"#5d4037",900:"#3e2723"},gt={100:"#cfd8dc",300:"#90a4ae",500:"#607d8b",700:"#455a64",900:"#263238"},ms=function(t){var r=t.color,n=t.onClick,a=t.onSwatchHover,i=t.hover,o=t.active,s=t.circleSize,l=t.circleSpacing,u=G({default:{swatch:{width:s,height:s,marginRight:l,marginBottom:l,transform:"scale(1)",transition:"100ms transform ease"},Swatch:{borderRadius:"50%",background:"transparent",boxShadow:"inset 0 0 0 "+(s/2+1)+"px "+r,transition:"100ms box-shadow ease"}},hover:{swatch:{transform:"scale(1.2)"}},active:{Swatch:{boxShadow:"inset 0 0 0 3px "+r}}},{hover:i,active:o});return c.createElement("div",{style:u.swatch},c.createElement(Xe,{style:u.Swatch,color:r,onClick:n,onHover:a,focusStyle:{boxShadow:u.Swatch.boxShadow+", 0 0 5px "+r}}))};ms.defaultProps={circleSize:28,circleSpacing:14};const vE=Rn(ms);var Un=function(t){var r=t.width,n=t.onChange,a=t.onSwatchHover,i=t.colors,o=t.hex,s=t.circleSize,l=t.styles,u=l===void 0?{}:l,f=t.circleSpacing,d=t.className,p=d===void 0?"":d,v=G(be({default:{card:{width:r,display:"flex",flexWrap:"wrap",marginRight:-f,marginBottom:-f}}},u)),h=function(b,x){return n({hex:b,source:"hex"},x)};return c.createElement("div",{style:v.card,className:"circle-picker "+p},Ze(i,function(m){return c.createElement(vE,{key:m,color:m,onClick:h,onSwatchHover:a,active:o===m.toLowerCase(),circleSize:s,circleSpacing:f})}))};Un.propTypes={width:$.oneOfType([$.string,$.number]),circleSize:$.number,circleSpacing:$.number,styles:$.object};Un.defaultProps={width:252,circleSize:28,circleSpacing:14,colors:[Qe[500],et[500],tt[500],rt[500],nt[500],at[500],it[500],ot[500],st[500],It[500],lt[500],ct[500],ut[500],ft[500],dt[500],ht[500],pt[500],gt[500]],styles:{}};me(Un);function qi(e){return e===void 0}var ys={};Object.defineProperty(ys,"__esModule",{value:!0});var Ki=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bE=c,Yi=mE(bE);function mE(e){return e&&e.__esModule?e:{default:e}}function yE(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var Qt=24,xE=ys.default=function(e){var t=e.fill,r=t===void 0?"currentColor":t,n=e.width,a=n===void 0?Qt:n,i=e.height,o=i===void 0?Qt:i,s=e.style,l=s===void 0?{}:s,u=yE(e,["fill","width","height","style"]);return Yi.default.createElement("svg",Ki({viewBox:"0 0 "+Qt+" "+Qt,style:Ki({fill:r,width:a,height:o},l)},u),Yi.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))},wE=function(){function e(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function CE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function SE(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function EE(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var xs=function(e){EE(t,e);function t(r){CE(this,t);var n=SE(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.toggleViews=function(){n.state.view==="hex"?n.setState({view:"rgb"}):n.state.view==="rgb"?n.setState({view:"hsl"}):n.state.view==="hsl"&&(n.props.hsl.a===1?n.setState({view:"hex"}):n.setState({view:"rgb"}))},n.handleChange=function(a,i){a.hex?ze(a.hex)&&n.props.onChange({hex:a.hex,source:"hex"},i):a.r||a.g||a.b?n.props.onChange({r:a.r||n.props.rgb.r,g:a.g||n.props.rgb.g,b:a.b||n.props.rgb.b,source:"rgb"},i):a.a?(a.a<0?a.a=0:a.a>1&&(a.a=1),n.props.onChange({h:n.props.hsl.h,s:n.props.hsl.s,l:n.props.hsl.l,a:Math.round(a.a*100)/100,source:"rgb"},i)):(a.h||a.s||a.l)&&(typeof a.s=="string"&&a.s.includes("%")&&(a.s=a.s.replace("%","")),typeof a.l=="string"&&a.l.includes("%")&&(a.l=a.l.replace("%","")),a.s==1?a.s=.01:a.l==1&&(a.l=.01),n.props.onChange({h:a.h||n.props.hsl.h,s:Number(qi(a.s)?n.props.hsl.s:a.s),l:Number(qi(a.l)?n.props.hsl.l:a.l),source:"hsl"},i))},n.showHighlight=function(a){a.currentTarget.style.background="#eee"},n.hideHighlight=function(a){a.currentTarget.style.background="transparent"},r.hsl.a!==1&&r.view==="hex"?n.state={view:"rgb"}:n.state={view:r.view},n}return wE(t,[{key:"render",value:function(){var n=this,a=G({default:{wrap:{paddingTop:"16px",display:"flex"},fields:{flex:"1",display:"flex",marginLeft:"-6px"},field:{paddingLeft:"6px",width:"100%"},alpha:{paddingLeft:"6px",width:"100%"},toggle:{width:"32px",textAlign:"right",position:"relative"},icon:{marginRight:"-4px",marginTop:"12px",cursor:"pointer",position:"relative"},iconHighlight:{position:"absolute",width:"24px",height:"28px",background:"#eee",borderRadius:"4px",top:"10px",left:"12px",display:"none"},input:{fontSize:"11px",color:"#333",width:"100%",borderRadius:"2px",border:"none",boxShadow:"inset 0 0 0 1px #dadada",height:"21px",textAlign:"center"},label:{textTransform:"uppercase",fontSize:"11px",lineHeight:"11px",color:"#969696",textAlign:"center",display:"block",marginTop:"12px"},svg:{fill:"#333",width:"24px",height:"24px",border:"1px transparent solid",borderRadius:"5px"}},disableAlpha:{alpha:{display:"none"}}},this.props,this.state),i=void 0;return this.state.view==="hex"?i=c.createElement("div",{style:a.fields,className:"flexbox-fix"},c.createElement("div",{style:a.field},c.createElement(Y,{style:{input:a.input,label:a.label},label:"hex",value:this.props.hex,onChange:this.handleChange}))):this.state.view==="rgb"?i=c.createElement("div",{style:a.fields,className:"flexbox-fix"},c.createElement("div",{style:a.field},c.createElement(Y,{style:{input:a.input,label:a.label},label:"r",value:this.props.rgb.r,onChange:this.handleChange})),c.createElement("div",{style:a.field},c.createElement(Y,{style:{input:a.input,label:a.label},label:"g",value:this.props.rgb.g,onChange:this.handleChange})),c.createElement("div",{style:a.field},c.createElement(Y,{style:{input:a.input,label:a.label},label:"b",value:this.props.rgb.b,onChange:this.handleChange})),c.createElement("div",{style:a.alpha},c.createElement(Y,{style:{input:a.input,label:a.label},label:"a",value:this.props.rgb.a,arrowOffset:.01,onChange:this.handleChange}))):this.state.view==="hsl"&&(i=c.createElement("div",{style:a.fields,className:"flexbox-fix"},c.createElement("div",{style:a.field},c.createElement(Y,{style:{input:a.input,label:a.label},label:"h",value:Math.round(this.props.hsl.h),onChange:this.handleChange})),c.createElement("div",{style:a.field},c.createElement(Y,{style:{input:a.input,label:a.label},label:"s",value:Math.round(this.props.hsl.s*100)+"%",onChange:this.handleChange})),c.createElement("div",{style:a.field},c.createElement(Y,{style:{input:a.input,label:a.label},label:"l",value:Math.round(this.props.hsl.l*100)+"%",onChange:this.handleChange})),c.createElement("div",{style:a.alpha},c.createElement(Y,{style:{input:a.input,label:a.label},label:"a",value:this.props.hsl.a,arrowOffset:.01,onChange:this.handleChange})))),c.createElement("div",{style:a.wrap,className:"flexbox-fix"},i,c.createElement("div",{style:a.toggle},c.createElement("div",{style:a.icon,onClick:this.toggleViews,ref:function(s){return n.icon=s}},c.createElement(xE,{style:a.svg,onMouseOver:this.showHighlight,onMouseEnter:this.showHighlight,onMouseOut:this.hideHighlight}))))}}],[{key:"getDerivedStateFromProps",value:function(n,a){return n.hsl.a!==1&&a.view==="hex"?{view:"rgb"}:null}}]),t}(c.Component);xs.defaultProps={view:"hex"};var Xi=function(){var t=G({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",transform:"translate(-6px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return c.createElement("div",{style:t.picker})},$E=function(){var t=G({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}}});return c.createElement("div",{style:t.picker})},Vn=function(t){var r=t.width,n=t.onChange,a=t.disableAlpha,i=t.rgb,o=t.hsl,s=t.hsv,l=t.hex,u=t.renderers,f=t.styles,d=f===void 0?{}:f,p=t.className,v=p===void 0?"":p,h=t.defaultView,m=G(be({default:{picker:{width:r,background:"#fff",borderRadius:"2px",boxShadow:"0 0 2px rgba(0,0,0,.3), 0 4px 8px rgba(0,0,0,.3)",boxSizing:"initial",fontFamily:"Menlo"},saturation:{width:"100%",paddingBottom:"55%",position:"relative",borderRadius:"2px 2px 0 0",overflow:"hidden"},Saturation:{radius:"2px 2px 0 0"},body:{padding:"16px 16px 12px"},controls:{display:"flex"},color:{width:"32px"},swatch:{marginTop:"6px",width:"16px",height:"16px",borderRadius:"8px",position:"relative",overflow:"hidden"},active:{absolute:"0px 0px 0px 0px",borderRadius:"8px",boxShadow:"inset 0 0 0 1px rgba(0,0,0,.1)",background:"rgba("+i.r+", "+i.g+", "+i.b+", "+i.a+")",zIndex:"2"},toggles:{flex:"1"},hue:{height:"10px",position:"relative",marginBottom:"8px"},Hue:{radius:"2px"},alpha:{height:"10px",position:"relative"},Alpha:{radius:"2px"}},disableAlpha:{color:{width:"22px"},alpha:{display:"none"},hue:{marginBottom:"0px"},swatch:{width:"10px",height:"10px",marginTop:"0px"}}},d),{disableAlpha:a});return c.createElement("div",{style:m.picker,className:"chrome-picker "+v},c.createElement("div",{style:m.saturation},c.createElement(Or,{style:m.Saturation,hsl:o,hsv:s,pointer:$E,onChange:n})),c.createElement("div",{style:m.body},c.createElement("div",{style:m.controls,className:"flexbox-fix"},c.createElement("div",{style:m.color},c.createElement("div",{style:m.swatch},c.createElement("div",{style:m.active}),c.createElement(St,{renderers:u}))),c.createElement("div",{style:m.toggles},c.createElement("div",{style:m.hue},c.createElement(Et,{style:m.Hue,hsl:o,pointer:Xi,onChange:n})),c.createElement("div",{style:m.alpha},c.createElement(Mn,{style:m.Alpha,rgb:i,hsl:o,pointer:Xi,renderers:u,onChange:n})))),c.createElement(xs,{rgb:i,hsl:o,hex:l,view:h,onChange:n,disableAlpha:a})))};Vn.propTypes={width:$.oneOfType([$.string,$.number]),disableAlpha:$.bool,styles:$.object,defaultView:$.oneOf(["hex","rgb","hsl"])};Vn.defaultProps={width:225,disableAlpha:!1,styles:{}};me(Vn);var _E=function(t){var r=t.color,n=t.onClick,a=n===void 0?function(){}:n,i=t.onSwatchHover,o=t.active,s=G({default:{color:{background:r,width:"15px",height:"15px",float:"left",marginRight:"5px",marginBottom:"5px",position:"relative",cursor:"pointer"},dot:{absolute:"5px 5px 5px 5px",background:Nn(r),borderRadius:"50%",opacity:"0"}},active:{dot:{opacity:"1"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},dot:{background:"#000"}},transparent:{dot:{background:"#000"}}},{active:o,"color-#FFFFFF":r==="#FFFFFF",transparent:r==="transparent"});return c.createElement(Xe,{style:s.color,color:r,onClick:a,onHover:i,focusStyle:{boxShadow:"0 0 4px "+r}},c.createElement("div",{style:s.dot}))},OE=function(t){var r=t.hex,n=t.rgb,a=t.onChange,i=G({default:{fields:{display:"flex",paddingBottom:"6px",paddingRight:"5px",position:"relative"},active:{position:"absolute",top:"6px",left:"5px",height:"9px",width:"9px",background:r},HEXwrap:{flex:"6",position:"relative"},HEXinput:{width:"80%",padding:"0px",paddingLeft:"20%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},HEXlabel:{display:"none"},RGBwrap:{flex:"3",position:"relative"},RGBinput:{width:"70%",padding:"0px",paddingLeft:"30%",border:"none",outline:"none",background:"none",fontSize:"12px",color:"#333",height:"16px"},RGBlabel:{position:"absolute",top:"3px",left:"0px",lineHeight:"16px",textTransform:"uppercase",fontSize:"12px",color:"#999"}}}),o=function(l,u){l.r||l.g||l.b?a({r:l.r||n.r,g:l.g||n.g,b:l.b||n.b,source:"rgb"},u):a({hex:l.hex,source:"hex"},u)};return c.createElement("div",{style:i.fields,className:"flexbox-fix"},c.createElement("div",{style:i.active}),c.createElement(Y,{style:{wrap:i.HEXwrap,input:i.HEXinput,label:i.HEXlabel},label:"hex",value:r,onChange:o}),c.createElement(Y,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"r",value:n.r,onChange:o}),c.createElement(Y,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"g",value:n.g,onChange:o}),c.createElement(Y,{style:{wrap:i.RGBwrap,input:i.RGBinput,label:i.RGBlabel},label:"b",value:n.b,onChange:o}))},Wn=function(t){var r=t.onChange,n=t.onSwatchHover,a=t.colors,i=t.hex,o=t.rgb,s=t.styles,l=s===void 0?{}:s,u=t.className,f=u===void 0?"":u,d=G(be({default:{Compact:{background:"#f6f6f6",radius:"4px"},compact:{paddingTop:"5px",paddingLeft:"5px",boxSizing:"initial",width:"240px"},clear:{clear:"both"}}},l)),p=function(h,m){h.hex?ze(h.hex)&&r({hex:h.hex,source:"hex"},m):r(h,m)};return c.createElement(Wt,{style:d.Compact,styles:l},c.createElement("div",{style:d.compact,className:"compact-picker "+f},c.createElement("div",null,Ze(a,function(v){return c.createElement(_E,{key:v,color:v,active:v.toLowerCase()===i,onClick:p,onSwatchHover:n})}),c.createElement("div",{style:d.clear})),c.createElement(OE,{hex:i,rgb:o,onChange:p})))};Wn.propTypes={colors:$.arrayOf($.string),styles:$.object};Wn.defaultProps={colors:["#4D4D4D","#999999","#FFFFFF","#F44E3B","#FE9200","#FCDC00","#DBDF00","#A4DD00","#68CCCA","#73D8FF","#AEA1FF","#FDA1FF","#333333","#808080","#cccccc","#D33115","#E27300","#FCC400","#B0BC00","#68BC00","#16A5A5","#009CE0","#7B64FF","#FA28FF","#000000","#666666","#B3B3B3","#9F0500","#C45100","#FB9E00","#808900","#194D33","#0C797D","#0062B1","#653294","#AB149E"],styles:{}};me(Wn);var TE=function(t){var r=t.hover,n=t.color,a=t.onClick,i=t.onSwatchHover,o={position:"relative",zIndex:"2",outline:"2px solid #fff",boxShadow:"0 0 5px 2px rgba(0,0,0,0.25)"},s=G({default:{swatch:{width:"25px",height:"25px",fontSize:"0"}},hover:{swatch:o}},{hover:r});return c.createElement("div",{style:s.swatch},c.createElement(Xe,{color:n,onClick:a,onHover:i,focusStyle:o}))};const AE=Rn(TE);var qn=function(t){var r=t.width,n=t.colors,a=t.onChange,i=t.onSwatchHover,o=t.triangle,s=t.styles,l=s===void 0?{}:s,u=t.className,f=u===void 0?"":u,d=G(be({default:{card:{width:r,background:"#fff",border:"1px solid rgba(0,0,0,0.2)",boxShadow:"0 3px 12px rgba(0,0,0,0.15)",borderRadius:"4px",position:"relative",padding:"5px",display:"flex",flexWrap:"wrap"},triangle:{position:"absolute",border:"7px solid transparent",borderBottomColor:"#fff"},triangleShadow:{position:"absolute",border:"8px solid transparent",borderBottomColor:"rgba(0,0,0,0.15)"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-14px",left:"10px"},triangleShadow:{top:"-16px",left:"9px"}},"top-right-triangle":{triangle:{top:"-14px",right:"10px"},triangleShadow:{top:"-16px",right:"9px"}},"bottom-left-triangle":{triangle:{top:"35px",left:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",left:"9px",transform:"rotate(180deg)"}},"bottom-right-triangle":{triangle:{top:"35px",right:"10px",transform:"rotate(180deg)"},triangleShadow:{top:"37px",right:"9px",transform:"rotate(180deg)"}}},l),{"hide-triangle":o==="hide","top-left-triangle":o==="top-left","top-right-triangle":o==="top-right","bottom-left-triangle":o==="bottom-left","bottom-right-triangle":o==="bottom-right"}),p=function(h,m){return a({hex:h,source:"hex"},m)};return c.createElement("div",{style:d.card,className:"github-picker "+f},c.createElement("div",{style:d.triangleShadow}),c.createElement("div",{style:d.triangle}),Ze(n,function(v){return c.createElement(AE,{color:v,key:v,onClick:p,onSwatchHover:i})}))};qn.propTypes={width:$.oneOfType([$.string,$.number]),colors:$.arrayOf($.string),triangle:$.oneOf(["hide","top-left","top-right","bottom-left","bottom-right"]),styles:$.object};qn.defaultProps={width:200,colors:["#B80000","#DB3E00","#FCCB00","#008B02","#006B76","#1273DE","#004DCF","#5300EB","#EB9694","#FAD0C3","#FEF3BD","#C1E1C5","#BEDADC","#C4DEF6","#BED3F3","#D4C4FB"],triangle:"top-left",styles:{}};me(qn);var RE=function(t){var r=t.direction,n=G({default:{picker:{width:"18px",height:"18px",borderRadius:"50%",transform:"translate(-9px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}},vertical:{picker:{transform:"translate(-3px, -9px)"}}},{vertical:r==="vertical"});return c.createElement("div",{style:n.picker})},ME=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kn=function(t){var r=t.width,n=t.height,a=t.onChange,i=t.hsl,o=t.direction,s=t.pointer,l=t.styles,u=l===void 0?{}:l,f=t.className,d=f===void 0?"":f,p=G(be({default:{picker:{position:"relative",width:r,height:n},hue:{radius:"2px"}}},u)),v=function(m){return a({a:1,h:m.h,l:.5,s:1})};return c.createElement("div",{style:p.picker,className:"hue-picker "+d},c.createElement(Et,ME({},p.hue,{hsl:i,pointer:s,onChange:v,direction:o})))};Kn.propTypes={styles:$.object};Kn.defaultProps={width:"316px",height:"16px",direction:"horizontal",pointer:RE,styles:{}};me(Kn);var PE=function(t){var r=t.onChange,n=t.hex,a=t.rgb,i=t.styles,o=i===void 0?{}:i,s=t.className,l=s===void 0?"":s,u=G(be({default:{material:{width:"98px",height:"98px",padding:"16px",fontFamily:"Roboto"},HEXwrap:{position:"relative"},HEXinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"2px solid "+n,outline:"none",height:"30px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},Hex:{style:{}},RGBwrap:{position:"relative"},RGBinput:{width:"100%",marginTop:"12px",fontSize:"15px",color:"#333",padding:"0px",border:"0px",borderBottom:"1px solid #eee",outline:"none",height:"30px"},RGBlabel:{position:"absolute",top:"0px",left:"0px",fontSize:"11px",color:"#999999",textTransform:"capitalize"},split:{display:"flex",marginRight:"-10px",paddingTop:"11px"},third:{flex:"1",paddingRight:"10px"}}},o)),f=function(p,v){p.hex?ze(p.hex)&&r({hex:p.hex,source:"hex"},v):(p.r||p.g||p.b)&&r({r:p.r||a.r,g:p.g||a.g,b:p.b||a.b,source:"rgb"},v)};return c.createElement(Wt,{styles:o},c.createElement("div",{style:u.material,className:"material-picker "+l},c.createElement(Y,{style:{wrap:u.HEXwrap,input:u.HEXinput,label:u.HEXlabel},label:"hex",value:n,onChange:f}),c.createElement("div",{style:u.split,className:"flexbox-fix"},c.createElement("div",{style:u.third},c.createElement(Y,{style:{wrap:u.RGBwrap,input:u.RGBinput,label:u.RGBlabel},label:"r",value:a.r,onChange:f})),c.createElement("div",{style:u.third},c.createElement(Y,{style:{wrap:u.RGBwrap,input:u.RGBinput,label:u.RGBlabel},label:"g",value:a.g,onChange:f})),c.createElement("div",{style:u.third},c.createElement(Y,{style:{wrap:u.RGBwrap,input:u.RGBinput,label:u.RGBlabel},label:"b",value:a.b,onChange:f})))))};me(PE);var jE=function(t){var r=t.onChange,n=t.rgb,a=t.hsv,i=t.hex,o=G({default:{fields:{paddingTop:"5px",paddingBottom:"9px",width:"80px",position:"relative"},divider:{height:"5px"},RGBwrap:{position:"relative"},RGBinput:{marginLeft:"40%",width:"40%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"5px",fontSize:"13px",paddingLeft:"3px",marginRight:"10px"},RGBlabel:{left:"0px",top:"0px",width:"34px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px",position:"absolute"},HEXwrap:{position:"relative"},HEXinput:{marginLeft:"20%",width:"80%",height:"18px",border:"1px solid #888888",boxShadow:"inset 0 1px 1px rgba(0,0,0,.1), 0 1px 0 0 #ECECEC",marginBottom:"6px",fontSize:"13px",paddingLeft:"3px"},HEXlabel:{position:"absolute",top:"0px",left:"0px",width:"14px",textTransform:"uppercase",fontSize:"13px",height:"18px",lineHeight:"22px"},fieldSymbols:{position:"absolute",top:"5px",right:"-7px",fontSize:"13px"},symbol:{height:"20px",lineHeight:"22px",paddingBottom:"7px"}}}),s=function(u,f){u["#"]?ze(u["#"])&&r({hex:u["#"],source:"hex"},f):u.r||u.g||u.b?r({r:u.r||n.r,g:u.g||n.g,b:u.b||n.b,source:"rgb"},f):(u.h||u.s||u.v)&&r({h:u.h||a.h,s:u.s||a.s,v:u.v||a.v,source:"hsv"},f)};return c.createElement("div",{style:o.fields},c.createElement(Y,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"h",value:Math.round(a.h),onChange:s}),c.createElement(Y,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"s",value:Math.round(a.s*100),onChange:s}),c.createElement(Y,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"v",value:Math.round(a.v*100),onChange:s}),c.createElement("div",{style:o.divider}),c.createElement(Y,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"r",value:n.r,onChange:s}),c.createElement(Y,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"g",value:n.g,onChange:s}),c.createElement(Y,{style:{wrap:o.RGBwrap,input:o.RGBinput,label:o.RGBlabel},label:"b",value:n.b,onChange:s}),c.createElement("div",{style:o.divider}),c.createElement(Y,{style:{wrap:o.HEXwrap,input:o.HEXinput,label:o.HEXlabel},label:"#",value:i.replace("#",""),onChange:s}),c.createElement("div",{style:o.fieldSymbols},c.createElement("div",{style:o.symbol},"°"),c.createElement("div",{style:o.symbol},"%"),c.createElement("div",{style:o.symbol},"%")))},IE=function(t){var r=t.hsl,n=G({default:{picker:{width:"12px",height:"12px",borderRadius:"6px",boxShadow:"inset 0 0 0 1px #fff",transform:"translate(-6px, -6px)"}},"black-outline":{picker:{boxShadow:"inset 0 0 0 1px #000"}}},{"black-outline":r.l>.5});return c.createElement("div",{style:n.picker})},kE=function(){var t=G({default:{triangle:{width:0,height:0,borderStyle:"solid",borderWidth:"4px 0 4px 6px",borderColor:"transparent transparent transparent #fff",position:"absolute",top:"1px",left:"1px"},triangleBorder:{width:0,height:0,borderStyle:"solid",borderWidth:"5px 0 5px 8px",borderColor:"transparent transparent transparent #555"},left:{Extend:"triangleBorder",transform:"translate(-13px, -4px)"},leftInside:{Extend:"triangle",transform:"translate(-8px, -5px)"},right:{Extend:"triangleBorder",transform:"translate(20px, -14px) rotate(180deg)"},rightInside:{Extend:"triangle",transform:"translate(-8px, -5px)"}}});return c.createElement("div",{style:t.pointer},c.createElement("div",{style:t.left},c.createElement("div",{style:t.leftInside})),c.createElement("div",{style:t.right},c.createElement("div",{style:t.rightInside})))},Zi=function(t){var r=t.onClick,n=t.label,a=t.children,i=t.active,o=G({default:{button:{backgroundImage:"linear-gradient(-180deg, #FFFFFF 0%, #E6E6E6 100%)",border:"1px solid #878787",borderRadius:"2px",height:"20px",boxShadow:"0 1px 0 0 #EAEAEA",fontSize:"14px",color:"#000",lineHeight:"20px",textAlign:"center",marginBottom:"10px",cursor:"pointer"}},active:{button:{boxShadow:"0 0 0 1px #878787"}}},{active:i});return c.createElement("div",{style:o.button,onClick:r},n||a)},FE=function(t){var r=t.rgb,n=t.currentColor,a=G({default:{swatches:{border:"1px solid #B3B3B3",borderBottom:"1px solid #F0F0F0",marginBottom:"2px",marginTop:"1px"},new:{height:"34px",background:"rgb("+r.r+","+r.g+", "+r.b+")",boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 1px 0 #000"},current:{height:"34px",background:n,boxShadow:"inset 1px 0 0 #000, inset -1px 0 0 #000, inset 0 -1px 0 #000"},label:{fontSize:"14px",color:"#000",textAlign:"center"}}});return c.createElement("div",null,c.createElement("div",{style:a.label},"new"),c.createElement("div",{style:a.swatches},c.createElement("div",{style:a.new}),c.createElement("div",{style:a.current})),c.createElement("div",{style:a.label},"current"))},LE=function(){function e(t,r){for(var n=0;n<r.length;n++){var a=r[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function DE(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function NE(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e}function HE(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Yn=function(e){HE(t,e);function t(r){DE(this,t);var n=NE(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.state={currentColor:r.hex},n}return LE(t,[{key:"render",value:function(){var n=this.props,a=n.styles,i=a===void 0?{}:a,o=n.className,s=o===void 0?"":o,l=G(be({default:{picker:{background:"#DCDCDC",borderRadius:"4px",boxShadow:"0 0 0 1px rgba(0,0,0,.25), 0 8px 16px rgba(0,0,0,.15)",boxSizing:"initial",width:"513px"},head:{backgroundImage:"linear-gradient(-180deg, #F0F0F0 0%, #D4D4D4 100%)",borderBottom:"1px solid #B1B1B1",boxShadow:"inset 0 1px 0 0 rgba(255,255,255,.2), inset 0 -1px 0 0 rgba(0,0,0,.02)",height:"23px",lineHeight:"24px",borderRadius:"4px 4px 0 0",fontSize:"13px",color:"#4D4D4D",textAlign:"center"},body:{padding:"15px 15px 0",display:"flex"},saturation:{width:"256px",height:"256px",position:"relative",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0",overflow:"hidden"},hue:{position:"relative",height:"256px",width:"19px",marginLeft:"10px",border:"2px solid #B3B3B3",borderBottom:"2px solid #F0F0F0"},controls:{width:"180px",marginLeft:"10px"},top:{display:"flex"},previews:{width:"60px"},actions:{flex:"1",marginLeft:"20px"}}},i));return c.createElement("div",{style:l.picker,className:"photoshop-picker "+s},c.createElement("div",{style:l.head},this.props.header),c.createElement("div",{style:l.body,className:"flexbox-fix"},c.createElement("div",{style:l.saturation},c.createElement(Or,{hsl:this.props.hsl,hsv:this.props.hsv,pointer:IE,onChange:this.props.onChange})),c.createElement("div",{style:l.hue},c.createElement(Et,{direction:"vertical",hsl:this.props.hsl,pointer:kE,onChange:this.props.onChange})),c.createElement("div",{style:l.controls},c.createElement("div",{style:l.top,className:"flexbox-fix"},c.createElement("div",{style:l.previews},c.createElement(FE,{rgb:this.props.rgb,currentColor:this.state.currentColor})),c.createElement("div",{style:l.actions},c.createElement(Zi,{label:"OK",onClick:this.props.onAccept,active:!0}),c.createElement(Zi,{label:"Cancel",onClick:this.props.onCancel}),c.createElement(jE,{onChange:this.props.onChange,rgb:this.props.rgb,hsv:this.props.hsv,hex:this.props.hex}))))))}}]),t}(c.Component);Yn.propTypes={header:$.string,styles:$.object};Yn.defaultProps={header:"Color Picker",styles:{}};me(Yn);var BE=function(t){var r=t.onChange,n=t.rgb,a=t.hsl,i=t.hex,o=t.disableAlpha,s=G({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(f,d){f.hex?ze(f.hex)&&r({hex:f.hex,source:"hex"},d):f.r||f.g||f.b?r({r:f.r||n.r,g:f.g||n.g,b:f.b||n.b,a:n.a,source:"rgb"},d):f.a&&(f.a<0?f.a=0:f.a>100&&(f.a=100),f.a/=100,r({h:a.h,s:a.s,l:a.l,a:f.a,source:"rgb"},d))};return c.createElement("div",{style:s.fields,className:"flexbox-fix"},c.createElement("div",{style:s.double},c.createElement(Y,{style:{input:s.input,label:s.label},label:"hex",value:i.replace("#",""),onChange:l})),c.createElement("div",{style:s.single},c.createElement(Y,{style:{input:s.input,label:s.label},label:"r",value:n.r,onChange:l,dragLabel:"true",dragMax:"255"})),c.createElement("div",{style:s.single},c.createElement(Y,{style:{input:s.input,label:s.label},label:"g",value:n.g,onChange:l,dragLabel:"true",dragMax:"255"})),c.createElement("div",{style:s.single},c.createElement(Y,{style:{input:s.input,label:s.label},label:"b",value:n.b,onChange:l,dragLabel:"true",dragMax:"255"})),c.createElement("div",{style:s.alpha},c.createElement(Y,{style:{input:s.input,label:s.label},label:"a",value:Math.round(n.a*100),onChange:l,dragLabel:"true",dragMax:"100"})))},zE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ws=function(t){var r=t.colors,n=t.onClick,a=n===void 0?function(){}:n,i=t.onSwatchHover,o=G({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":!r||!r.length}),s=function(u,f){a({hex:u,source:"hex"},f)};return c.createElement("div",{style:o.colors,className:"flexbox-fix"},r.map(function(l){var u=typeof l=="string"?{color:l}:l,f=""+u.color+(u.title||"");return c.createElement("div",{key:f,style:o.swatchWrap},c.createElement(Xe,zE({},u,{style:o.swatch,onClick:s,onHover:i,focusStyle:{boxShadow:"inset 0 0 0 1px rgba(0,0,0,.15), 0 0 4px "+u.color}})))}))};ws.propTypes={colors:$.arrayOf($.oneOfType([$.string,$.shape({color:$.string,title:$.string})])).isRequired};var GE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xn=function(t){var r=t.width,n=t.rgb,a=t.hex,i=t.hsv,o=t.hsl,s=t.onChange,l=t.onSwatchHover,u=t.disableAlpha,f=t.presetColors,d=t.renderers,p=t.styles,v=p===void 0?{}:p,h=t.className,m=h===void 0?"":h,b=G(be({default:GE({picker:{width:r,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("+n.r+","+n.g+","+n.b+","+n.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)"}},v),disableAlpha:{color:{height:"10px"},hue:{height:"10px"},alpha:{display:"none"}}},v),{disableAlpha:u});return c.createElement("div",{style:b.picker,className:"sketch-picker "+m},c.createElement("div",{style:b.saturation},c.createElement(Or,{style:b.Saturation,hsl:o,hsv:i,onChange:s})),c.createElement("div",{style:b.controls,className:"flexbox-fix"},c.createElement("div",{style:b.sliders},c.createElement("div",{style:b.hue},c.createElement(Et,{style:b.Hue,hsl:o,onChange:s})),c.createElement("div",{style:b.alpha},c.createElement(Mn,{style:b.Alpha,rgb:n,hsl:o,renderers:d,onChange:s}))),c.createElement("div",{style:b.color},c.createElement(St,null),c.createElement("div",{style:b.activeColor}))),c.createElement(BE,{rgb:n,hsl:o,hex:a,onChange:s,disableAlpha:u}),c.createElement(ws,{colors:f,onClick:s,onSwatchHover:l}))};Xn.propTypes={disableAlpha:$.bool,width:$.oneOfType([$.string,$.number]),styles:$.object};Xn.defaultProps={disableAlpha:!1,width:200,styles:{},presetColors:["#D0021B","#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"]};me(Xn);var Mt=function(t){var r=t.hsl,n=t.offset,a=t.onClick,i=a===void 0?function(){}:a,o=t.active,s=t.first,l=t.last,u=G({default:{swatch:{height:"12px",background:"hsl("+r.h+", 50%, "+n*100+"%)",cursor:"pointer"}},first:{swatch:{borderRadius:"2px 0 0 2px"}},last:{swatch:{borderRadius:"0 2px 2px 0"}},active:{swatch:{transform:"scaleY(1.8)",borderRadius:"3.6px/2px"}}},{active:o,first:s,last:l}),f=function(p){return i({h:r.h,s:.5,l:n,source:"hsl"},p)};return c.createElement("div",{style:u.swatch,onClick:f})},UE=function(t){var r=t.onClick,n=t.hsl,a=G({default:{swatches:{marginTop:"20px"},swatch:{boxSizing:"border-box",width:"20%",paddingRight:"1px",float:"left"},clear:{clear:"both"}}}),i=.1;return c.createElement("div",{style:a.swatches},c.createElement("div",{style:a.swatch},c.createElement(Mt,{hsl:n,offset:".80",active:Math.abs(n.l-.8)<i&&Math.abs(n.s-.5)<i,onClick:r,first:!0})),c.createElement("div",{style:a.swatch},c.createElement(Mt,{hsl:n,offset:".65",active:Math.abs(n.l-.65)<i&&Math.abs(n.s-.5)<i,onClick:r})),c.createElement("div",{style:a.swatch},c.createElement(Mt,{hsl:n,offset:".50",active:Math.abs(n.l-.5)<i&&Math.abs(n.s-.5)<i,onClick:r})),c.createElement("div",{style:a.swatch},c.createElement(Mt,{hsl:n,offset:".35",active:Math.abs(n.l-.35)<i&&Math.abs(n.s-.5)<i,onClick:r})),c.createElement("div",{style:a.swatch},c.createElement(Mt,{hsl:n,offset:".20",active:Math.abs(n.l-.2)<i&&Math.abs(n.s-.5)<i,onClick:r,last:!0})),c.createElement("div",{style:a.clear}))},VE=function(){var t=G({default:{picker:{width:"14px",height:"14px",borderRadius:"6px",transform:"translate(-7px, -1px)",backgroundColor:"rgb(248, 248, 248)",boxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.37)"}}});return c.createElement("div",{style:t.picker})},Zn=function(t){var r=t.hsl,n=t.onChange,a=t.pointer,i=t.styles,o=i===void 0?{}:i,s=t.className,l=s===void 0?"":s,u=G(be({default:{hue:{height:"12px",position:"relative"},Hue:{radius:"2px"}}},o));return c.createElement("div",{style:u.wrap||{},className:"slider-picker "+l},c.createElement("div",{style:u.hue},c.createElement(Et,{style:u.Hue,hsl:r,pointer:a,onChange:n})),c.createElement("div",{style:u.swatches},c.createElement(UE,{hsl:r,onClick:n})))};Zn.propTypes={styles:$.object};Zn.defaultProps={pointer:VE,styles:{}};me(Zn);var Cs={};Object.defineProperty(Cs,"__esModule",{value:!0});var Ji=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WE=c,Qi=qE(WE);function qE(e){return e&&e.__esModule?e:{default:e}}function KE(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}var er=24,YE=Cs.default=function(e){var t=e.fill,r=t===void 0?"currentColor":t,n=e.width,a=n===void 0?er:n,i=e.height,o=i===void 0?er:i,s=e.style,l=s===void 0?{}:s,u=KE(e,["fill","width","height","style"]);return Qi.default.createElement("svg",Ji({viewBox:"0 0 "+er+" "+er,style:Ji({fill:r,width:a,height:o},l)},u),Qi.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))},XE=function(t){var r=t.color,n=t.onClick,a=n===void 0?function(){}:n,i=t.onSwatchHover,o=t.first,s=t.last,l=t.active,u=G({default:{color:{width:"40px",height:"24px",cursor:"pointer",background:r,marginBottom:"1px"},check:{color:Nn(r),marginLeft:"8px",display:"none"}},first:{color:{overflow:"hidden",borderRadius:"2px 2px 0 0"}},last:{color:{overflow:"hidden",borderRadius:"0 0 2px 2px"}},active:{check:{display:"block"}},"color-#FFFFFF":{color:{boxShadow:"inset 0 0 0 1px #ddd"},check:{color:"#333"}},transparent:{check:{color:"#333"}}},{first:o,last:s,active:l,"color-#FFFFFF":r==="#FFFFFF",transparent:r==="transparent"});return c.createElement(Xe,{color:r,style:u.color,onClick:a,onHover:i,focusStyle:{boxShadow:"0 0 4px "+r}},c.createElement("div",{style:u.check},c.createElement(YE,null)))},ZE=function(t){var r=t.onClick,n=t.onSwatchHover,a=t.group,i=t.active,o=G({default:{group:{paddingBottom:"10px",width:"40px",float:"left",marginRight:"10px"}}});return c.createElement("div",{style:o.group},Ze(a,function(s,l){return c.createElement(XE,{key:s,color:s,active:s.toLowerCase()===i,first:l===0,last:l===a.length-1,onClick:r,onSwatchHover:n})}))},Jn=function(t){var r=t.width,n=t.height,a=t.onChange,i=t.onSwatchHover,o=t.colors,s=t.hex,l=t.styles,u=l===void 0?{}:l,f=t.className,d=f===void 0?"":f,p=G(be({default:{picker:{width:r,height:n},overflow:{height:n,overflowY:"scroll"},body:{padding:"16px 0 6px 16px"},clear:{clear:"both"}}},u)),v=function(m,b){return a({hex:m,source:"hex"},b)};return c.createElement("div",{style:p.picker,className:"swatches-picker "+d},c.createElement(Wt,null,c.createElement("div",{style:p.overflow},c.createElement("div",{style:p.body},Ze(o,function(h){return c.createElement(ZE,{key:h.toString(),group:h,active:s,onClick:v,onSwatchHover:i})}),c.createElement("div",{style:p.clear})))))};Jn.propTypes={width:$.oneOfType([$.string,$.number]),height:$.oneOfType([$.string,$.number]),colors:$.arrayOf($.arrayOf($.string)),styles:$.object};Jn.defaultProps={width:320,height:240,colors:[[Qe[900],Qe[700],Qe[500],Qe[300],Qe[100]],[et[900],et[700],et[500],et[300],et[100]],[tt[900],tt[700],tt[500],tt[300],tt[100]],[rt[900],rt[700],rt[500],rt[300],rt[100]],[nt[900],nt[700],nt[500],nt[300],nt[100]],[at[900],at[700],at[500],at[300],at[100]],[it[900],it[700],it[500],it[300],it[100]],[ot[900],ot[700],ot[500],ot[300],ot[100]],[st[900],st[700],st[500],st[300],st[100]],["#194D33",It[700],It[500],It[300],It[100]],[lt[900],lt[700],lt[500],lt[300],lt[100]],[ct[900],ct[700],ct[500],ct[300],ct[100]],[ut[900],ut[700],ut[500],ut[300],ut[100]],[ft[900],ft[700],ft[500],ft[300],ft[100]],[dt[900],dt[700],dt[500],dt[300],dt[100]],[ht[900],ht[700],ht[500],ht[300],ht[100]],[pt[900],pt[700],pt[500],pt[300],pt[100]],[gt[900],gt[700],gt[500],gt[300],gt[100]],["#000000","#525252","#969696","#D9D9D9","#FFFFFF"]],styles:{}};me(Jn);var Qn=function(t){var r=t.onChange,n=t.onSwatchHover,a=t.hex,i=t.colors,o=t.width,s=t.triangle,l=t.styles,u=l===void 0?{}:l,f=t.className,d=f===void 0?"":f,p=G(be({default:{card:{width:o,background:"#fff",border:"0 solid rgba(0,0,0,0.25)",boxShadow:"0 1px 4px rgba(0,0,0,0.25)",borderRadius:"4px",position:"relative"},body:{padding:"15px 9px 9px 15px"},label:{fontSize:"18px",color:"#fff"},triangle:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent #fff transparent",position:"absolute"},triangleShadow:{width:"0px",height:"0px",borderStyle:"solid",borderWidth:"0 9px 10px 9px",borderColor:"transparent transparent rgba(0,0,0,.1) transparent",position:"absolute"},hash:{background:"#F0F0F0",height:"30px",width:"30px",borderRadius:"4px 0 0 4px",float:"left",color:"#98A1A4",display:"flex",alignItems:"center",justifyContent:"center"},input:{width:"100px",fontSize:"14px",color:"#666",border:"0px",outline:"none",height:"28px",boxShadow:"inset 0 0 0 1px #F0F0F0",boxSizing:"content-box",borderRadius:"0 4px 4px 0",float:"left",paddingLeft:"8px"},swatch:{width:"30px",height:"30px",float:"left",borderRadius:"4px",margin:"0 6px 6px 0"},clear:{clear:"both"}},"hide-triangle":{triangle:{display:"none"},triangleShadow:{display:"none"}},"top-left-triangle":{triangle:{top:"-10px",left:"12px"},triangleShadow:{top:"-11px",left:"12px"}},"top-right-triangle":{triangle:{top:"-10px",right:"12px"},triangleShadow:{top:"-11px",right:"12px"}}},u),{"hide-triangle":s==="hide","top-left-triangle":s==="top-left","top-right-triangle":s==="top-right"}),v=function(m,b){ze(m)&&r({hex:m,source:"hex"},b)};return c.createElement("div",{style:p.card,className:"twitter-picker "+d},c.createElement("div",{style:p.triangleShadow}),c.createElement("div",{style:p.triangle}),c.createElement("div",{style:p.body},Ze(i,function(h,m){return c.createElement(Xe,{key:m,color:h,hex:h,style:p.swatch,onClick:v,onHover:n,focusStyle:{boxShadow:"0 0 4px "+h}})}),c.createElement("div",{style:p.hash},"#"),c.createElement(Y,{label:null,style:{input:p.input},value:a.replace("#",""),onChange:v}),c.createElement("div",{style:p.clear})))};Qn.propTypes={width:$.oneOfType([$.string,$.number]),triangle:$.oneOf(["hide","top-left","top-right"]),colors:$.arrayOf($.string),styles:$.object};Qn.defaultProps={width:276,colors:["#FF6900","#FCB900","#7BDCB5","#00D084","#8ED1FC","#0693E3","#ABB8C3","#EB144C","#F78DA7","#9900EF"],triangle:"top-left",styles:{}};const JE=me(Qn);var ea=function(t){var r=G({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",border:"2px #fff solid",transform:"translate(-12px, -13px)",background:"hsl("+Math.round(t.hsl.h)+", "+Math.round(t.hsl.s*100)+"%, "+Math.round(t.hsl.l*100)+"%)"}}});return c.createElement("div",{style:r.picker})};ea.propTypes={hsl:$.shape({h:$.number,s:$.number,l:$.number,a:$.number})};ea.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var ta=function(t){var r=G({default:{picker:{width:"20px",height:"20px",borderRadius:"22px",transform:"translate(-10px, -7px)",background:"hsl("+Math.round(t.hsl.h)+", 100%, 50%)",border:"2px white solid"}}});return c.createElement("div",{style:r.picker})};ta.propTypes={hsl:$.shape({h:$.number,s:$.number,l:$.number,a:$.number})};ta.defaultProps={hsl:{a:1,h:249.94,l:.2,s:.5}};var QE=function(t){var r=t.onChange,n=t.rgb,a=t.hsl,i=t.hex,o=t.hsv,s=function(v,h){if(v.hex)ze(v.hex)&&r({hex:v.hex,source:"hex"},h);else if(v.rgb){var m=v.rgb.split(",");Kr(v.rgb,"rgb")&&r({r:m[0],g:m[1],b:m[2],a:1,source:"rgb"},h)}else if(v.hsv){var b=v.hsv.split(",");Kr(v.hsv,"hsv")&&(b[2]=b[2].replace("%",""),b[1]=b[1].replace("%",""),b[0]=b[0].replace("°",""),b[1]==1?b[1]=.01:b[2]==1&&(b[2]=.01),r({h:Number(b[0]),s:Number(b[1]),v:Number(b[2]),source:"hsv"},h))}else if(v.hsl){var x=v.hsl.split(",");Kr(v.hsl,"hsl")&&(x[2]=x[2].replace("%",""),x[1]=x[1].replace("%",""),x[0]=x[0].replace("°",""),d[1]==1?d[1]=.01:d[2]==1&&(d[2]=.01),r({h:Number(x[0]),s:Number(x[1]),v:Number(x[2]),source:"hsl"},h))}},l=G({default:{wrap:{display:"flex",height:"100px",marginTop:"4px"},fields:{width:"100%"},column:{paddingTop:"10px",display:"flex",justifyContent:"space-between"},double:{padding:"0px 4.4px",boxSizing:"border-box"},input:{width:"100%",height:"38px",boxSizing:"border-box",padding:"4px 10% 3px",textAlign:"center",border:"1px solid #dadce0",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",fontFamily:"Roboto,Arial,sans-serif"},input2:{height:"38px",width:"100%",border:"1px solid #dadce0",boxSizing:"border-box",fontSize:"11px",textTransform:"lowercase",borderRadius:"5px",outline:"none",paddingLeft:"10px",fontFamily:"Roboto,Arial,sans-serif"},label:{textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"35px",top:"-6px",left:"0",right:"0",marginLeft:"auto",marginRight:"auto",fontFamily:"Roboto,Arial,sans-serif"},label2:{left:"10px",textAlign:"center",fontSize:"12px",background:"#fff",position:"absolute",textTransform:"uppercase",color:"#3c4043",width:"32px",top:"-6px",fontFamily:"Roboto,Arial,sans-serif"},single:{flexGrow:"1",margin:"0px 4.4px"}}}),u=n.r+", "+n.g+", "+n.b,f=Math.round(a.h)+"°, "+Math.round(a.s*100)+"%, "+Math.round(a.l*100)+"%",d=Math.round(o.h)+"°, "+Math.round(o.s*100)+"%, "+Math.round(o.v*100)+"%";return c.createElement("div",{style:l.wrap,className:"flexbox-fix"},c.createElement("div",{style:l.fields},c.createElement("div",{style:l.double},c.createElement(Y,{style:{input:l.input,label:l.label},label:"hex",value:i,onChange:s})),c.createElement("div",{style:l.column},c.createElement("div",{style:l.single},c.createElement(Y,{style:{input:l.input2,label:l.label2},label:"rgb",value:u,onChange:s})),c.createElement("div",{style:l.single},c.createElement(Y,{style:{input:l.input2,label:l.label2},label:"hsv",value:d,onChange:s})),c.createElement("div",{style:l.single},c.createElement(Y,{style:{input:l.input2,label:l.label2},label:"hsl",value:f,onChange:s})))))},ra=function(t){var r=t.width,n=t.onChange,a=t.rgb,i=t.hsl,o=t.hsv,s=t.hex,l=t.header,u=t.styles,f=u===void 0?{}:u,d=t.className,p=d===void 0?"":d,v=G(be({default:{picker:{width:r,background:"#fff",border:"1px solid #dfe1e5",boxSizing:"initial",display:"flex",flexWrap:"wrap",borderRadius:"8px 8px 0px 0px"},head:{height:"57px",width:"100%",paddingTop:"16px",paddingBottom:"16px",paddingLeft:"16px",fontSize:"20px",boxSizing:"border-box",fontFamily:"Roboto-Regular,HelveticaNeue,Arial,sans-serif"},saturation:{width:"70%",padding:"0px",position:"relative",overflow:"hidden"},swatch:{width:"30%",height:"228px",padding:"0px",background:"rgba("+a.r+", "+a.g+", "+a.b+", 1)",position:"relative",overflow:"hidden"},body:{margin:"auto",width:"95%"},controls:{display:"flex",boxSizing:"border-box",height:"52px",paddingTop:"22px"},color:{width:"32px"},hue:{height:"8px",position:"relative",margin:"0px 16px 0px 16px",width:"100%"},Hue:{radius:"2px"}}},f));return c.createElement("div",{style:v.picker,className:"google-picker "+p},c.createElement("div",{style:v.head},l),c.createElement("div",{style:v.swatch}),c.createElement("div",{style:v.saturation},c.createElement(Or,{hsl:i,hsv:o,pointer:ea,onChange:n})),c.createElement("div",{style:v.body},c.createElement("div",{style:v.controls,className:"flexbox-fix"},c.createElement("div",{style:v.hue},c.createElement(Et,{style:v.Hue,hsl:i,radius:"4px",pointer:ta,onChange:n}))),c.createElement(QE,{rgb:a,hsl:i,hex:s,hsv:o,onChange:n})))};ra.propTypes={width:$.oneOfType([$.string,$.number]),styles:$.object,header:$.string};ra.defaultProps={width:652,styles:{},header:"Color picker"};me(ra);const e$=({initialColor:e,applyOpacity:t,onColorChange:r,onClose:n})=>{const[a,i]=c.useState(!1),[o,s]=c.useState({r:255,g:255,b:255,a:1}),l=h=>`rgba(${h.r}, ${h.g}, ${h.b}, ${t??h.a})`;function u(h,m=1){let b=h.replace("#","");b.length===3&&(b=b[0]+b[0]+b[1]+b[1]+b[2]+b[2]);const x=parseInt(b,16),S=x>>16&255,E=x>>8&255,R=x&255;return{r:S,g:E,b:R,a:m}}c.useEffect(()=>{if(e){if(typeof e=="string"&&/^#([A-Fa-f0-9]{3}){1,2}$/.test(e)){const h=u(e,1);s(h)}else if(typeof e=="string"&&/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)$/.test(e)){const h=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([0-9.]+))?\)$/);if(h){const[,m,b,x,S]=h;s({r:Number(m),g:Number(b),b:Number(x),a:S!==void 0?Number(S):1})}}}},[e]);const f=h=>{h.stopPropagation(),i(!a)},d=()=>{i(!1),n==null||n()},p=h=>{t!==void 0&&(h.rgb.a=t),console.log("Color changed:",h),s(h.rgb),r(l(h.rgb))},v={background:l(o)};return y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"inline-block cursor-pointer bg-slate-50 rounded border border-neutral-100 shadow",onClick:f,children:y.jsx("div",{className:"w-8 h-4 rounded",style:v})}),a&&y.jsxs("div",{className:"absolute z-20 mt-2",onClick:h=>{h.stopPropagation(),h.preventDefault()},children:[y.jsx("div",{className:"fixed inset-0",onClick:d}),y.jsx(JE,{color:o,colors:["#ffc094","#fee7a8","#b5f1db","#d0ecfe","#9ed5f4","#d2d9df","#f8b2c4","#F78DA7","#d89ef9"],onChange:p})]})]})},t$=({items:e,onRowsReordered:t,groupBy:r})=>{const[n,a]=c.useState(null),[i,o]=c.useState(null),[s,l]=c.useState(null),[u,f]=c.useState(!1),d=c.useCallback(()=>{console.log(e),a(null),l(null),f(!1),o(null)},[]),p=c.useCallback((m,b)=>{a(m),f(!0),o(b)},[]),v=c.useCallback(m=>{if(n!==null&&s!==null&&n!==s){if(r&&m[r]!==(i==null?void 0:i[r])){console.warn("Cannot reorder items across different groups");return}t==null||t(n,s,i,m)}a(null),l(null),f(!1),o(null)},[n,s,t]),h=c.useCallback(m=>{n!==null&&n!==m&&l(m)},[n]);return{draggedRowIndex:n,dropTargetIndex:s,isDraggingRow:u,handleRowDragStart:p,handleDrop:v,handleDragEnd:d,handleRowDragOver:h}};function r$(e){const t=c.useRef(null),[r,n]=c.useState(null),{setOpenCommentCell:a,setUsername:i}=fn();c.useEffect(()=>{i==null||i(e.currentUsername??"Anonymous")},[e.currentUsername]);const o=c.useMemo(()=>{const k=new Map;return e.items.forEach((M,W)=>{k.set(M,W+1)}),k},[e.items]),s=c.useMemo(()=>e.showIndex?[{id:"_index",text:"",sortable:!1,align:"right",children:[],width:e.enableRowDragDrop?55:40},...e.headers]:e.headers,[e.headers,e.showIndex,e.enableRowDragDrop]);function l(k){return k.flatMap(M=>M.children&&M.children.length>0?l(M.children):[M])}const u=c.useMemo(()=>l(e.headers),[e.headers]),f=k=>{e.onRowDoubleClick&&e.onRowDoubleClick(k)},d=c.useCallback((k,M)=>{e.onDeleteComment&&e.onDeleteComment(k,M)},[e.onSaveComment,e.items]),p=c.useCallback((k,M)=>{e.onSaveComment&&e.onSaveComment(k,M)},[e.onSaveComment,e.items]),{activeFilters:v,clearActiveFilters:h,setActiveTableFilter:m,filterItemsCache:b,currentSortId:x,ascendingOrder:S,onResetSort:E,onSortByColumn:R,processedItems:w}=Cl(e.items,e.headers,e.activeFilters??[],e.currentSortId,e.onSortByColumn),{groupedItemsEntries:B,collapsedGroups:J,flatGroupedItemsToDisplay:te,onCollapseGroup:ce,isGroupLinked:ue}=Sl(w,e.groupBy,e.linkedGroups),{selectedCell:P,expandedSelection:_,setExpandedSelection:T,setSelectedCell:H,isDragging:X,onCellBlur:Z,onCellEnter:q,onCellClick:re,handleCellKeyDown:ne,onCellMouseDown:g,onCellMouseEnter:C,onMouseMove:A,onRightClick:j}=_l({headers:u,items:e.items,groupedItemsEntries:e.groupBy?B:void 0,onChange:e.onChange,onBulkChange:e.onBulkChange,onRowDoubleClick:e.onRowDoubleClick}),{draggedRowIndex:I,dropTargetIndex:N,handleDragEnd:z,handleRowDragStart:L,handleDrop:D,handleRowDragOver:U}=t$({items:w,onRowsReordered:e.onRowsReordered,groupBy:e.groupBy}),V=c.useRef(null);c.useEffect(()=>{n(null),h(),H(void 0),T([])},[e.headers]);const le=c.useMemo(()=>{if(e.groupBy){let k=0;return B.forEach(([M,W])=>{k+=1,J.includes(M)||(k+=W.length)}),k}else return w.length},[w,B,J,e.groupBy]),{virtualRows:O,before:pe,after:Ae}=Bl({scrollRef:V,rowsCount:le}),qt=(k,M,W,K)=>{j(k,M,K),n({x:K.clientX,y:K.clientY,rowIndex:k,columnIndex:M,item:W,header:u[M]})},Ss=c.useCallback(k=>{var W;return((W=e.highlightCondition)==null?void 0:W.filter(K=>k[K.propertyId]===K.value))||[]},[e.highlightCondition]),Es=c.useCallback((k,M)=>k.filter(K=>K.columnId===M).reduce((K,de)=>({...K,...de.style||{}}),{}),[e.highlightCondition]),$s=(k,M,W)=>{const K=N===k,de=I!==null&&I<k;return y.jsxs("td",{rowSpan:W,style:{alignContent:"start"},className:`text-right pr-2 bg-gray-100 font-medium relative ${e.enableRowDragDrop?"cursor-grab":""}`,draggable:e.enableRowDragDrop,onDragEnd:e.enableRowDragDrop?z:void 0,onDragStart:e.enableRowDragDrop?()=>L(k,M):void 0,onDrop:e.enableRowDragDrop?()=>D(M):void 0,onDragOver:e.enableRowDragDrop?ye=>{ye.preventDefault(),U(k)}:void 0,onDragEnter:e.enableRowDragDrop?ye=>{ye.preventDefault(),U(k)}:void 0,children:[K&&y.jsx("div",{style:{position:"absolute",top:de?"100%":0,left:0,width:"100vw",height:"2px",backgroundColor:"rgb(59, 130, 246)",zIndex:10}}),y.jsxs("div",{className:"flex grow items-center justify-between",children:[e.enableRowDragDrop&&y.jsx(Ie,{path:Ws,color:"grey",size:.8}),e.groupBy?e.indexUseOriginalOrder?o.get(w[k]):k+1:o.get(M)]})]})},_s=c.useCallback((k,M,W)=>{g(k,M,W)},[g]),Os=(k,M,W)=>{C(k,M,W)};function na(k,M,W,K,de,ye,Ce,he,ge){var fe;return y.jsx(fl,{style:Ce,isSelected:(P==null?void 0:P.rowIndex)===W&&(P==null?void 0:P.columnIndex)===K&&((fe=P==null?void 0:P.fromArrayData)==null?void 0:fe.index)===(ge==null?void 0:ge.index),isInLinkedGroup:ye,isInExpandedSelection:(_==null?void 0:_.some(ve=>{var De;return ve.rowIndex===W&&ve.columnIndex===K&&((De=ve.fromArrayData)==null?void 0:De.index)===(ge==null?void 0:ge.index)}))||!1,header:M,item:k,rowIndex:W,columnIndex:K,noBorder:e.noBorder,contrastRow:e.contrastRow,comments:he,onSaveComment:p,onDeleteComment:d,onClick:re,onEnter:q,onBlur:Z,onKeyDown:ne,onMouseDown:ve=>_s(ve,W,K),onMouseEnter:ve=>Os(ve,W,K),onContextMenu:qt,onAddOption:e.onAddListOption,rowSpan:de,fromArrayData:ge},`item-${W}-${K}`)}function aa(k,M,W){var ge;const K=Ss(k),de=((ge=e.comments)==null?void 0:ge.filter(fe=>k[fe.propertyId]===fe.value))||[],ye={...K.filter(fe=>!fe.columnId).reduce((fe,ve)=>({...fe,...ve.style||{}}),{}),opacity:I===M?.5:1,backgroundColor:N===M?"rgba(59, 130, 246, 0.1)":void 0,position:"relative"};let Ce=0;const he=u.filter(fe=>fe.fromArray);return he.length>0&&(u.forEach(fe=>{fe.fromArray&&Array.isArray(k[fe.fromArray])&&(Ce=Math.max(Ce,k[fe.fromArray].length))}),Ce++),y.jsxs(y.Fragment,{children:[y.jsxs("tr",{style:ye,className:`${e.onRowDoubleClick?"cursor-pointer":""}`,onDoubleClick:()=>f(k),children:[e.showIndex&&$s(M,k,Math.max(Ce,1)),u.map((fe,ve)=>{const De=Es(K,fe.id),Rr=de.filter(Ms=>Ms.columnId===fe.id);return na(k,fe,M,ve,fe.fromArray?1:Math.max(Ce,1),W?ue(W):void 0,De,Rr)})]},`item-${M}`),he.length>0&&Array.from({length:Ce-1}).map((fe,ve)=>y.jsx("tr",{children:he.map((De,Rr)=>na(k,De,M,Rr,De.fromArray?1:Ce,W?ue(W):void 0,{},[],{fromArray:De.fromArray,index:ve}))},`item-array-${M}-${ve}`))]})}const Ts=(k,M,W)=>{var de;const K={propertyId:M,value:k[M],columnId:M,style:W};(de=e.onSetHighlightCondition)==null||de.call(e,K,k)},As=(k,M,W)=>{var de;const K={propertyId:M,value:k[M],columnId:M,style:{}};(de=e.onRemoveHighlightCondition)==null||de.call(e,K,W,k)},Rs=(k,M)=>{var ye,Ce;const W=((ye=e.comments)==null?void 0:ye.filter(he=>k[he.propertyId]===he.value&&he.columnId===M))||[],K=(Ce=e.highlightCondition)==null?void 0:Ce.find(he=>k[he.propertyId]===he.value&&he.columnId===M&&he.style.backgroundColor),de=K==null?void 0:K.style.backgroundColor;return[{icon:Vs,iconColor:"var(--comment-color)",text:`${W.length>0?"Edit":"Add"} a comment`,onClick:(he,ge)=>{a({rowIndex:ge.rowIndex,columnIndex:ge.columnIndex})}},{icon:Ys,iconColor:"#299b42",text:"Set cell color",customRender:()=>y.jsxs(y.Fragment,{children:[y.jsx(e$,{initialColor:de,onColorChange:he=>Ts(k,M,{backgroundColor:he}),onClose:()=>n(null)}),de&&y.jsx(Re,{circle:!0,small:!0,icon:Us,iconSize:.6,iconColor:"var(--error-color)",className:"h-5 min-h-5 ",onClick:()=>As(k,M,"backgroundColor")})]}),onClick:(he,ge)=>{}}]};return y.jsxs(y.Fragment,{children:[r&&y.jsx(Ul,{x:r.x,y:r.y,item:r.item,itemCoordinate:{rowIndex:r.rowIndex,columnIndex:r.columnIndex},onClose:()=>n(null),actions:Rs(r.item,r.header.id)}),v.length>0&&y.jsx("div",{style:{width:"100%",display:"flex"},children:y.jsx(Re,{onClick:h,className:"mb-1 h-5 min-h-5 w-36 flex",small:!0,text:"Clear all filters",iconSize:.6,icon:Ks})}),y.jsx("div",{ref:V,className:"overflow-auto h-min",style:{overflow:"auto",height:e.height??`calc(100vh - ${e.marginTop?e.marginTop:"6rem"})`},children:y.jsxs("table",{ref:t,onMouseMove:A,style:{width:"100%",position:"unset",userSelect:X?"none":"auto",WebkitUserSelect:X?"none":"auto"},className:`table table-xs table-pin-rows
|
|
77
77
|
|
|
78
|
-
${e.pinColumns?" table-pin-cols":""} border border-gray-300!`,children:[y.jsx(pl,{headers:s,noBorder:e.noBorder,alignCenterInLine:e.alignCenterInLine,currentSortId:x,activeFilters:v,tableRef:t,ascendingOrder:S,filterItemsCache:b,onResetSort:E,onSortByColumn:R,onSetFilter:m}),y.jsxs("tbody",{children:[pe>0&&y.jsx("tr",{children:y.jsx("td",{colSpan:u.length,style:{height:pe}})}),e.groupBy?y.jsx(y.Fragment,{children:O.map(k=>{const M=te[k.index];if(M.isGroup===!0){const W=te.filter(K=>M.groupName===K.groupName&&!K.isGroup);return y.jsx(c.Fragment,{children:y.jsx(zl,{colSpan:u.length+(e.showIndex?1:0),groupBy:e.groupBy,groupName:M.groupName,isCollapsed:J.includes(M.groupName),masterGroupName:M.masterGroupName,linkedGroupNames:M.linkedGroupNames,onCollapseGroup:ce,groupByCustomRender:(K,de)=>{var ye;return(ye=e.groupByCustomRender)==null?void 0:ye.call(e,K,de,u.length+(e.showIndex?1:0),M.isCollapsed||!1,ce,W,M.masterGroupName,M.linkedGroupNames)}})},`group-${M.groupName}`)}else{const W=M;return aa(W.item,W.rowIndex,W.groupName)}})}):y.jsx(y.Fragment,{children:O.map(k=>{const M=w[k.index];return aa(M,k.index)})}),Ae>0&&y.jsx("tr",{children:y.jsx("td",{colSpan:u.length,style:{height:Ae}})})]})]})})]})}function n$(e){return y.jsx(
|
|
78
|
+
${e.pinColumns?" table-pin-cols":""} border border-gray-300!`,children:[y.jsx(pl,{headers:s,noBorder:e.noBorder,alignCenterInLine:e.alignCenterInLine,currentSortId:x,activeFilters:v,tableRef:t,ascendingOrder:S,filterItemsCache:b,onResetSort:E,onSortByColumn:R,onSetFilter:m}),y.jsxs("tbody",{children:[pe>0&&y.jsx("tr",{children:y.jsx("td",{colSpan:u.length,style:{height:pe}})}),e.groupBy?y.jsx(y.Fragment,{children:O.map(k=>{const M=te[k.index];if(M.isGroup===!0){const W=te.filter(K=>M.groupName===K.groupName&&!K.isGroup);return y.jsx(c.Fragment,{children:y.jsx(zl,{colSpan:u.length+(e.showIndex?1:0),groupBy:e.groupBy,groupName:M.groupName,isCollapsed:J.includes(M.groupName),masterGroupName:M.masterGroupName,linkedGroupNames:M.linkedGroupNames,onCollapseGroup:ce,groupByCustomRender:(K,de)=>{var ye;return(ye=e.groupByCustomRender)==null?void 0:ye.call(e,K,de,u.length+(e.showIndex?1:0),M.isCollapsed||!1,ce,W,M.masterGroupName,M.linkedGroupNames)}})},`group-${M.groupName}`)}else{const W=M;return aa(W.item,W.rowIndex,W.groupName)}})}):y.jsx(y.Fragment,{children:O.map(k=>{const M=w[k.index];return aa(M,k.index)})}),Ae>0&&y.jsx("tr",{children:y.jsx("td",{colSpan:u.length,style:{height:Ae}})})]})]})})]})}function n$(e){return y.jsx("div",{className:"react-base-table",children:y.jsx(ll,{children:y.jsx(r$,{...e})})})}exports.BaseTable=n$;
|
|
79
79
|
//# sourceMappingURL=index.cjs.js.map
|