@salesforce/ui-design-mode 13.0.0 → 13.1.0
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/authoring/core/editors/ColorEditor.d.ts.map +1 -1
- package/dist/authoring/react/index.js +3 -3
- package/dist/authoring/react/styles.css +1 -1
- package/dist/authoring/web-component/index.js +62 -26
- package/dist/protocol/version.cjs +1 -1
- package/dist/protocol/version.js +1 -1
- package/dist/runtime/design-mode-interactions.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var Q5=Object.create;var ha=Object.defineProperty;var Y5=Object.getOwnPropertyDescriptor;var J5=Object.getOwnPropertyNames;var es=Object.getPrototypeOf,ts=Object.prototype.hasOwnProperty;var os=(e,t,o)=>t in e?ha(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var uo=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}};var rs=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of J5(t))!ts.call(e,a)&&a!==o&&ha(e,a,{get:()=>t[a],enumerable:!(r=Y5(t,a))||r.enumerable});return e};var s2=(e,t,o)=>(o=e!=null?Q5(es(e)):{},rs(t||!e||!e.__esModule?ha(o,"default",{value:e,enumerable:!0}):o,e));var Ht=(e,t,o)=>os(e,typeof t!="symbol"?t+"":t,o);var A0=uo((Ow,B0)=>{"use strict";var h7="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";B0.exports=h7});var N0=uo((_w,$0)=>{"use strict";var v7=A0();function Z0(){}function F0(){}F0.resetWarningCache=Z0;$0.exports=function(){function e(r,a,n,l,i,s){if(s!==v7){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:F0,resetWarningCache:Z0};return o.PropTypes=o,o}});var q0=uo((Zw,U0)=>{U0.exports=N0()();var Bw,Aw});var j0=uo(ve=>{"use strict";var An=Symbol.for("react.element"),Zn=Symbol.for("react.portal"),Tr=Symbol.for("react.fragment"),Vr=Symbol.for("react.strict_mode"),Er=Symbol.for("react.profiler"),Dr=Symbol.for("react.provider"),Or=Symbol.for("react.context"),x7=Symbol.for("react.server_context"),_r=Symbol.for("react.forward_ref"),Br=Symbol.for("react.suspense"),Ar=Symbol.for("react.suspense_list"),Zr=Symbol.for("react.memo"),Fr=Symbol.for("react.lazy"),L7=Symbol.for("react.offscreen"),z0;z0=Symbol.for("react.module.reference");function L1(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case An:switch(e=e.type,e){case Tr:case Er:case Vr:case Br:case Ar:return e;default:switch(e=e&&e.$$typeof,e){case x7:case Or:case _r:case Fr:case Zr:case Dr:return e;default:return t}}case Zn:return t}}}ve.ContextConsumer=Or;ve.ContextProvider=Dr;ve.Element=An;ve.ForwardRef=_r;ve.Fragment=Tr;ve.Lazy=Fr;ve.Memo=Zr;ve.Portal=Zn;ve.Profiler=Er;ve.StrictMode=Vr;ve.Suspense=Br;ve.SuspenseList=Ar;ve.isAsyncMode=function(){return!1};ve.isConcurrentMode=function(){return!1};ve.isContextConsumer=function(e){return L1(e)===Or};ve.isContextProvider=function(e){return L1(e)===Dr};ve.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===An};ve.isForwardRef=function(e){return L1(e)===_r};ve.isFragment=function(e){return L1(e)===Tr};ve.isLazy=function(e){return L1(e)===Fr};ve.isMemo=function(e){return L1(e)===Zr};ve.isPortal=function(e){return L1(e)===Zn};ve.isProfiler=function(e){return L1(e)===Er};ve.isStrictMode=function(e){return L1(e)===Vr};ve.isSuspense=function(e){return L1(e)===Br};ve.isSuspenseList=function(e){return L1(e)===Ar};ve.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Tr||e===Er||e===Vr||e===Br||e===Ar||e===L7||typeof e=="object"&&e!==null&&(e.$$typeof===Fr||e.$$typeof===Zr||e.$$typeof===Dr||e.$$typeof===Or||e.$$typeof===_r||e.$$typeof===z0||e.getModuleId!==void 0)};ve.typeOf=L1});var G0=uo(($w,K0)=>{"use strict";K0.exports=j0()});import{forwardRef as rt,createElement as Qe}from"react";function at(e,t){if(e==null)return{};var o={},r=Object.keys(e),a,n;for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&(o[a]=e[a]);return o}var as=["color"],Zo=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,as);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ns=["color"],u2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,ns);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ls=["color"],d2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,ls);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var is=["color"],c2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,is);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M2 2.5C2 2.22386 2.22386 2 2.5 2H5.5C5.77614 2 6 2.22386 6 2.5C6 2.77614 5.77614 3 5.5 3H3V5.5C3 5.77614 2.77614 6 2.5 6C2.22386 6 2 5.77614 2 5.5V2.5ZM9 2.5C9 2.22386 9.22386 2 9.5 2H12.5C12.7761 2 13 2.22386 13 2.5V5.5C13 5.77614 12.7761 6 12.5 6C12.2239 6 12 5.77614 12 5.5V3H9.5C9.22386 3 9 2.77614 9 2.5ZM2.5 9C2.77614 9 3 9.22386 3 9.5V12H5.5C5.77614 12 6 12.2239 6 12.5C6 12.7761 5.77614 13 5.5 13H2.5C2.22386 13 2 12.7761 2 12.5V9.5C2 9.22386 2.22386 9 2.5 9ZM12.5 9C12.7761 9 13 9.22386 13 9.5V12.5C13 12.7761 12.7761 13 12.5 13H9.5C9.22386 13 9 12.7761 9 12.5C9 12.2239 9.22386 12 9.5 12H12V9.5C12 9.22386 12.2239 9 12.5 9Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ss=["color"],f2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,ss);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M2.78233 2.21707C2.70732 2.14206 2.60557 2.09991 2.49949 2.09991C2.3934 2.09991 2.29166 2.14206 2.21664 2.21707L0.216645 4.21707C0.0604351 4.37328 0.0604351 4.62655 0.216645 4.78276C0.372855 4.93897 0.626121 4.93897 0.78233 4.78276L2.09949 3.4656L2.09949 11.5342L0.78233 10.2171C0.62612 10.0609 0.372854 10.0609 0.216645 10.2171C0.0604349 10.3733 0.0604349 10.6265 0.216645 10.7828L2.21664 12.7828C2.29166 12.8578 2.3934 12.8999 2.49949 12.8999C2.60557 12.8999 2.70731 12.8578 2.78233 12.7828L4.78233 10.7828C4.93854 10.6265 4.93854 10.3733 4.78233 10.2171C4.62612 10.0609 4.37285 10.0609 4.21664 10.2171L2.89949 11.5342L2.89949 3.4656L4.21664 4.78276C4.37285 4.93897 4.62612 4.93897 4.78233 4.78276C4.93854 4.62655 4.93854 4.37328 4.78233 4.21707L2.78233 2.21707ZM10.5 2.74997C10.7107 2.74997 10.8988 2.88211 10.9703 3.08036L13.9703 11.3999C14.064 11.6597 13.9293 11.9462 13.6696 12.0399C13.4098 12.1336 13.1233 11.9989 13.0296 11.7392L12.0477 9.016H8.95228L7.97033 11.7392C7.87666 11.9989 7.59013 12.1336 7.33036 12.0399C7.07059 11.9462 6.93595 11.6597 7.02962 11.3999L10.0296 3.08036C10.1011 2.88211 10.2892 2.74997 10.5 2.74997ZM10.5 4.72396L11.7412 8.166H9.25879L10.5 4.72396Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var us=["color"],p2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,us);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M6.5 1C6.22386 1 6 1.22386 6 1.5C6 1.77614 6.22386 2 6.5 2C7.12671 2 7.45718 2.20028 7.65563 2.47812C7.8781 2.78957 8 3.28837 8 4V11C8 11.7116 7.8781 12.2104 7.65563 12.5219C7.45718 12.7997 7.12671 13 6.5 13C6.22386 13 6 13.2239 6 13.5C6 13.7761 6.22386 14 6.5 14C7.37329 14 8.04282 13.7003 8.46937 13.1031C8.47976 13.0886 8.48997 13.0739 8.5 13.0591C8.51003 13.0739 8.52024 13.0886 8.53063 13.1031C8.95718 13.7003 9.62671 14 10.5 14C10.7761 14 11 13.7761 11 13.5C11 13.2239 10.7761 13 10.5 13C9.87329 13 9.54282 12.7997 9.34437 12.5219C9.1219 12.2104 9 11.7116 9 11V4C9 3.28837 9.1219 2.78957 9.34437 2.47812C9.54282 2.20028 9.87329 2 10.5 2C10.7761 2 11 1.77614 11 1.5C11 1.22386 10.7761 1 10.5 1C9.62671 1 8.95718 1.29972 8.53063 1.89688C8.52024 1.91143 8.51003 1.92611 8.5 1.9409C8.48997 1.92611 8.47976 1.91143 8.46937 1.89688C8.04282 1.29972 7.37329 1 6.5 1ZM14 5H11V4H14C14.5523 4 15 4.44772 15 5V10C15 10.5523 14.5523 11 14 11H11V10H14V5ZM6 4V5H1L1 10H6V11H1C0.447715 11 0 10.5523 0 10V5C0 4.44772 0.447715 4 1 4H6Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ds=["color"],C2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,ds);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M4.55293 0.999969C4.75295 0.999969 4.93372 1.11917 5.0125 1.30301L8.01106 8.29982C8.11984 8.55363 8.00226 8.84757 7.74844 8.95635C7.49463 9.06512 7.20069 8.94754 7.09191 8.69373L6.11613 6.41685H2.98973L2.01395 8.69373C1.90517 8.94754 1.61123 9.06512 1.35742 8.95635C1.1036 8.84757 0.986023 8.55363 1.0948 8.29982L4.09336 1.30301C4.17214 1.11917 4.35291 0.999969 4.55293 0.999969ZM4.55293 2.76929L5.75186 5.56685H3.354L4.55293 2.76929ZM11.0562 9.00214C11.2617 9.00214 11.4463 8.87633 11.5215 8.68502L14.2733 1.68299C14.3743 1.42598 14.2478 1.13575 13.9908 1.03475C13.7338 0.933747 13.4436 1.06021 13.3426 1.31722L11.0562 7.13514L8.76973 1.31722C8.66873 1.06021 8.3785 0.933747 8.1215 1.03475C7.86449 1.13575 7.73802 1.42598 7.83902 1.68299L10.5908 8.68502C10.666 8.87633 10.8506 9.00214 11.0562 9.00214ZM14.9537 12.4999C14.9537 12.606 14.9115 12.7077 14.8365 12.7828L12.8365 14.7828C12.6803 14.939 12.4271 14.939 12.2708 14.7828C12.1146 14.6265 12.1146 14.3733 12.2708 14.2171L13.588 12.8999H1.51937L2.83653 14.2171C2.99274 14.3733 2.99274 14.6265 2.83653 14.7828C2.68032 14.939 2.42705 14.939 2.27084 14.7828L0.270843 12.7828C0.195828 12.7077 0.153687 12.606 0.153687 12.4999C0.153687 12.3938 0.195828 12.2921 0.270843 12.2171L2.27084 10.2171C2.42705 10.0609 2.68032 10.0609 2.83653 10.2171C2.99274 10.3733 2.99274 10.6265 2.83653 10.7828L1.51937 12.0999L13.588 12.0999L12.2708 10.7828C12.1146 10.6265 12.1146 10.3733 12.2708 10.2171C12.4271 10.0609 12.6803 10.0609 12.8365 10.2171L14.8365 12.2171C14.9115 12.2921 14.9537 12.3938 14.9537 12.4999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var cs=["color"],m2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,cs);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M3.78233 2.21713C3.70732 2.14212 3.60557 2.09998 3.49949 2.09998C3.3934 2.09998 3.29166 2.14212 3.21664 2.21713L1.21664 4.21713C1.06044 4.37334 1.06044 4.62661 1.21664 4.78282C1.37285 4.93903 1.62612 4.93903 1.78233 4.78282L3.09949 3.46566L3.09949 11.5343L1.78233 10.2171C1.62612 10.0609 1.37285 10.0609 1.21664 10.2171C1.06043 10.3733 1.06043 10.6266 1.21664 10.7828L3.21664 12.7828C3.29166 12.8578 3.3934 12.9 3.49949 12.9C3.60557 12.9 3.70731 12.8578 3.78233 12.7828L5.78233 10.7828C5.93854 10.6266 5.93854 10.3733 5.78233 10.2171C5.62612 10.0609 5.37285 10.0609 5.21664 10.2171L3.89949 11.5343L3.89949 3.46566L5.21664 4.78282C5.37285 4.93903 5.62612 4.93903 5.78233 4.78282C5.93854 4.62661 5.93854 4.37334 5.78233 4.21713L3.78233 2.21713ZM8.49998 3.99997C8.22383 3.99997 7.99998 4.22382 7.99998 4.49997C7.99998 4.77611 8.22383 4.99997 8.49998 4.99997H14.5C14.7761 4.99997 15 4.77611 15 4.49997C15 4.22382 14.7761 3.99997 14.5 3.99997H8.49998ZM7.99998 7.49997C7.99998 7.22382 8.22383 6.99997 8.49998 6.99997H14.5C14.7761 6.99997 15 7.22382 15 7.49997C15 7.77611 14.7761 7.99997 14.5 7.99997H8.49998C8.22383 7.99997 7.99998 7.77611 7.99998 7.49997ZM8.49998 9.99997C8.22383 9.99997 7.99998 10.2238 7.99998 10.5C7.99998 10.7761 8.22383 11 8.49998 11H14.5C14.7761 11 15 10.7761 15 10.5C15 10.2238 14.7761 9.99997 14.5 9.99997H8.49998Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});import Ce from"react";import{createRoot as u8}from"react-dom/client";import g2 from"react";import{jsx as va,jsxs as h2}from"react/jsx-runtime";function nt({title:e,defaultOpen:t=!0,children:o}){let[r,a]=g2.useState(t),n=g2.useCallback(l=>{a(l.currentTarget.open)},[]);return h2("details",{className:"property-panel-section",open:r,onToggle:n,children:[h2("summary",{className:"property-panel-section-trigger",children:[va("span",{children:e}),va(u2,{className:"property-panel-section-chevron",width:12,height:12,"aria-hidden":"true"})]}),va("div",{className:"property-panel-section-content",children:o})]})}var v2=["H1","H2","H3","H4","H5","H6","P","SPAN","A","BUTTON","LABEL","DIV","LI","TD","TH","CAPTION","FIGCAPTION","BLOCKQUOTE","LEGEND","SUMMARY","DT","DD","EM","STRONG"];var x2=new Set(["fontFamily","fontWeight","fontSize","lineHeight","letterSpacing"]),$1={padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"],margin:["marginTop","marginRight","marginBottom","marginLeft"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"]},L2=new Set([...Object.keys($1),...Object.values($1).flat()]);import S1 from"react";import{jsx as Cs,jsxs as ms}from"react/jsx-runtime";var fs={border:"none",margin:0,padding:0,minWidth:0},ps={color:"var(--dmp-color-foreground)",fontSize:"var(--dmp-font-size-label)",display:"block",marginBottom:"5px",padding:0};function m1({label:e,id:t,className:o,children:r}){let a=`${t}-legend`;return ms("fieldset",{style:fs,className:o,"aria-labelledby":a,children:[Cs("legend",{id:a,style:ps,children:e}),r]})}function Re(e,t){return e.replace(/\{(\d+)\}/g,(o,r)=>{let a=t[Number(r)];return a===void 0?o:String(a)})}function M1(e,t){if(t==null||typeof t!="object"||typeof e!="object")return e;let o={...e},r=t;for(let a of Object.keys(o)){let n=o[a],l=r[a];n!==null&&typeof n=="object"&&!Array.isArray(n)?o[a]=M1(n,l):typeof l=="string"&&(o[a]=l)}return o}var w2=[{path:"general.headerTitle"},{path:"general.emptyPlaceholder"},{path:"general.inlineEditEditable"},{path:"general.inlineEditNonEditable"},{path:"general.addToChatContext"},{path:"general.ariaPropertyPanel"},{path:"general.ariaSelectedComponent"},{path:"general.ariaElementStyling"},{path:"general.closePanel"},{path:"sections.imageSource"},{path:"sections.background"},{path:"sections.spacing"},{path:"sections.border"},{path:"sections.typography"},{path:"instances.imageSource"},{path:"instances.backgroundColor"},{path:"instances.padding"},{path:"instances.margin"},{path:"instances.borderRadius"},{path:"instances.fontFamily"},{path:"instances.fontSize"},{path:"instances.fontWeight"},{path:"instances.textStyling"},{path:"instances.textColor"},{path:"instances.textAlignment"},{path:"instances.lineHeight"},{path:"instances.letterSpacing"},{path:"editors.image.tabCms"},{path:"editors.image.tabLocal"},{path:"editors.image.tabUrl"},{path:"editors.image.ariaTablist"},{path:"editors.image.clearImage"},{path:"editors.image.chooseFile"},{path:"editors.image.ariaChooseFile"},{path:"editors.image.ariaImageUrl"},{path:"editors.image.urlPlaceholder"},{path:"editors.image.previewAlt"},{path:"editors.image.altText"},{path:"editors.image.altPlaceholder"},{path:"editors.image.sourceFromData"},{path:"editors.image.sourceNotEditable"},{path:"editors.image.altFromData"},{path:"editors.image.altNotEditable"},{path:"editors.image.sourceShared",placeholders:[0]},{path:"editors.image.altShared",placeholders:[0]},{path:"editors.image.workspace"},{path:"editors.image.selectWorkspace"},{path:"editors.image.selectImage"},{path:"editors.image.loadingWorkspaces"},{path:"editors.image.noWorkspaces"},{path:"editors.image.loadingImages"},{path:"editors.image.noImages"},{path:"editors.image.loadingMore"},{path:"editors.image.untitled"},{path:"editors.image.downloadingImage"},{path:"editors.image.downloadFailed"},{path:"editors.image.closePicker"},{path:"editors.image.cancel"},{path:"editors.image.done"},{path:"editors.image.pickerTitle",placeholders:[0]},{path:"editors.image.pickerError",placeholders:[0]},{path:"editors.boxDimension.sides.top"},{path:"editors.boxDimension.sides.right"},{path:"editors.boxDimension.sides.bottom"},{path:"editors.boxDimension.sides.left"},{path:"editors.boxDimension.corners.topLeft"},{path:"editors.boxDimension.corners.topRight"},{path:"editors.boxDimension.corners.bottomRight"},{path:"editors.boxDimension.corners.bottomLeft"},{path:"editors.boxDimension.allCorners"},{path:"editors.boxDimension.expandCorners"},{path:"editors.boxDimension.collapseCorners"},{path:"editors.boxDimension.matchCornersAndCollapse"},{path:"editors.boxDimension.vertical"},{path:"editors.boxDimension.horizontal"},{path:"editors.boxDimension.expand"},{path:"editors.boxDimension.collapse"},{path:"editors.boxDimension.matchAndCollapse"},{path:"editors.boxDimension.collapseUnavailable"},{path:"editors.boxDimension.measurementUnavailable"},{path:"editors.boxDimension.invalidNumber"},{path:"editors.boxDimension.invalidNonNegative"},{path:"editors.boxDimension.ariaSide",placeholders:[0,1]},{path:"editors.dimension.ariaValue",placeholders:[0]},{path:"editors.dimension.ariaActions",placeholders:[0]},{path:"editors.dimension.useNormalLineHeight"},{path:"editors.dimension.useNormalSpacing"},{path:"editors.dimension.useInherit"},{path:"editors.dimension.invalidRange",placeholders:[0,1]},{path:"editors.color.placeholder"},{path:"editors.color.ariaValue",placeholders:[0]},{path:"editors.color.ariaOpenPicker",placeholders:[0,1]},{path:"editors.color.ariaPicker",placeholders:[0]},{path:"editors.color.ariaSaturation",placeholders:[0,1]},{path:"editors.color.ariaEyedropper"},{path:"editors.color.ariaHue"},{path:"editors.color.ariaAlphaSlider"},{path:"editors.color.ariaHex"},{path:"editors.color.ariaChannel",placeholders:[0,1,2,3]},{path:"editors.color.ariaAlphaInput"},{path:"editors.color.ariaOpacity",placeholders:[0]},{path:"editors.color.invalidHex"},{path:"editors.color.invalidOpacity"},{path:"editors.color.invalidChannel"},{path:"editors.color.gradientValue"},{path:"editors.color.imageValue"},{path:"editors.color.ariaRecentColors"},{path:"editors.color.ariaApplyRecentColor",placeholders:[0,1]},{path:"editors.fontWeight.options.thin"},{path:"editors.fontWeight.options.extraLight"},{path:"editors.fontWeight.options.light"},{path:"editors.fontWeight.options.regular"},{path:"editors.fontWeight.options.medium"},{path:"editors.fontWeight.options.semiBold"},{path:"editors.fontWeight.options.bold"},{path:"editors.fontWeight.options.extraBold"},{path:"editors.fontWeight.options.black"},{path:"editors.textStyle.options.italic"},{path:"editors.textStyle.options.underline"},{path:"editors.textStyle.options.uppercase"},{path:"editors.textAlignment.options.left"},{path:"editors.textAlignment.options.center"},{path:"editors.textAlignment.options.right"},{path:"editors.textAlignment.options.justify"},{path:"history.changeLimitTitle"},{path:"history.changeLimitBody"}];function gs(e,t){return t.split(".").reduce((o,r)=>{if(o&&typeof o=="object")return o[r]},e)}function hs(e){let t=new Set;for(let o of e.matchAll(/\{(\d+)\}/g))t.add(Number(o[1]));return Array.from(t).sort((o,r)=>o-r)}function vs(e){let t=[];if(!e||typeof e!="object")return["labels is not an object"];for(let o of w2){let{path:r,placeholders:a}=o,n=gs(e,r);if(typeof n!="string"){t.push(`missing or non-string label: ${r}`);continue}if(a){let l=hs(n),i=[...a].sort((u,d)=>u-d);(l.length!==i.length||l.some((u,d)=>u!==i[d]))&&t.push(`placeholder mismatch at ${r}: expected {${i.join(",")}}, got {${l.join(",")}}`)}}return t}var co={px:{min:0,max:1e4,step:1,decimals:1},em:{min:0,max:100,step:.1,decimals:3},rem:{min:0,max:100,step:.1,decimals:3},"%":{min:0,max:1e3,step:1,decimals:2},pt:{min:0,max:1e4,step:1,decimals:1},vw:{min:0,max:100,step:.1,decimals:1},vh:{min:0,max:100,step:.1,decimals:1},vmin:{min:0,max:100,step:.1,decimals:1},vmax:{min:0,max:100,step:.1,decimals:1},ch:{min:0,max:100,step:.1,decimals:1},ex:{min:0,max:100,step:.1,decimals:1},cm:{min:0,max:100,step:.1,decimals:2},mm:{min:0,max:1e3,step:1,decimals:1},in:{min:0,max:50,step:.01,decimals:2},pc:{min:0,max:500,step:1,decimals:0}},xs=co.px??{min:0,max:1e4,step:1,decimals:0};function fo(e,t=co){return t[e]||xs}function Ls(e,t,o=co){let r=fo(t,o);return Math.min(r.max,Math.max(r.min,e))}function xa(e,t,o=co){if(e===""||e==null||isNaN(e))return"";let r=fo(t,o);return Number(Number(e).toFixed(r.decimals))}function I2(e,t,o,r,a=co){let n=parseFloat(e)||0,l=fo(r,a),i=o?10:1,s=(t==="ArrowUp"?1:-1)*l.step*i,u=Ls(n+s,r,a);return String(xa(u,r,a))}var b2=String.raw`[+-]?(?:\d+(?:\.\d*)?|\.\d+)`,ws=new RegExp(`^${b2}$`),y2=new RegExp(`^(${b2})([a-z%]*)$`);function a1(e){return ws.test(e)&&Number.isFinite(Number(e))}var Fo={fontSize:{unit:"px",icon:f2,constraints:{px:{min:1,max:200,step:1,decimals:2}},presets:[8,9,10,11,12,14,18,24,30,36,48,60,72,96]},lineHeight:{unit:"",icon:m2,constraints:{"":{min:.1,max:3,step:.1,decimals:2}},presets:[1,1.2,1.4,1.5,1.6,2],normalLabelKey:"useNormalLineHeight"},letterSpacing:{unit:"em",icon:C2,constraints:{em:{min:-.1,max:.5,step:.01,decimals:3}},presets:[-.05,-.025,0,.025,.05,.1],normalLabelKey:"useNormalSpacing"}};import{jsx as T1,jsxs as po}from"react/jsx-runtime";var R1=["top","right","bottom","left"],Is=["top","right","left","bottom"],No={top:"",right:"",bottom:"",left:""},bs={sides:{top:"Top",right:"Right",bottom:"Bottom",left:"Left"},corners:{topLeft:"Top Left",topRight:"Top Right",bottomRight:"Bottom Right",bottomLeft:"Bottom Left"},allCorners:"All corners",expandCorners:"Show all corners",collapseCorners:"Collapse",matchCornersAndCollapse:"Match all corners and collapse",vertical:"Vertical",horizontal:"Horizontal",expand:"Show all sides",collapse:"Collapse",matchAndCollapse:"Match opposite sides and collapse",collapseUnavailable:"Finish editing and resolve all measurements before collapsing.",measurementUnavailable:"Wait for all side measurements before editing this box.",invalidNumber:"Enter a finite number in pixels.",invalidNonNegative:"Enter a number greater than or equal to 0.",ariaSide:"{0} {1}"};function lt(e){let t=[],o=0,r=0,a=-1,n=e.trim();for(let d=0;d<=n.length;d++){let c=n[d];if(c==="("&&o++,c===")"&&o--,o<0)return{...No};if(c==="/"&&o===0){if(a!==-1)return{...No};a=d}(d===n.length||o===0&&/\s/.test(c??""))&&(d>r&&t.push(n.slice(r,d)),r=d+1)}if(a!==-1){let d=lt(n.slice(0,a)),c=lt(n.slice(a+1));return Object.fromEntries(R1.map(p=>[p,d[p]&&c[p]?d[p]===c[p]?d[p]:`${d[p]} ${c[p]}`:""]))}if(o!==0||t.length===0||t.length>4)return{...No};let[l="",i=l,s=l,u=i]=t;return{top:l,right:i,bottom:s,left:u}}function H2(e){return String(Number(e.toFixed(2)))}var ys=/^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)px$/i,M2=9999;function S2(e,t){let o=t??lt(e),r={top:null,right:null,bottom:null,left:null},a={...No};for(let n of R1){let l=(o[n]??"").trim(),i=ys.exec(l)?.[1]??(a1(l)&&Number(l)===0?l:void 0),s=Number(i);if(i!==void 0&&Number.isFinite(s)){let u=Math.max(-M2,Math.min(M2,s));r[n]=s,a[n]=H2(u)}else a[n]=l}return{raw:r,display:a}}function k2(e){return R1.every(t=>e[t]!==null)&&e.top===e.bottom&&e.right===e.left}function Ms(e){return k2(e)&&e.top===e.right}function La(e,t){return t?Ms(e):k2(e)}var R2={top:"top",right:"right",bottom:"top",left:"right"},$o={uniform:{compact:"M1 4V3a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V4",sides:{top:"M1 5V3a2 2 0 0 1 2-2h2",right:"M7 1h2a2 2 0 0 1 2 2v2",bottom:"M11 7v2a2 2 0 0 1-2 2H7",left:"M5 11H3a2 2 0 0 1-2-2V7"}},paired:{compact:{top:"M1 1h10M1 11h10",right:"M1 1v10M11 1v10"},sides:{top:"M1 1h10",right:"M11 1v10",bottom:"M1 11h10",left:"M1 1v10"}}};function Ss(e,t,o){return e?t?$o.uniform.compact:$o.uniform.sides[o]:t?$o.paired.compact[o==="top"?"top":"right"]:$o.paired.sides[o]}function Uo({label:e,displayValue:t,displaySides:o,measurement:r,resetVersion:a,paired:n=!1,uniform:l=!1,onSidesChange:i,id:s,allowNegative:u=!1,sideLabelKind:d="sides",aria:c}){let p=S1.useId(),g=s||p,f=M1(bs,c),x=l||!l&&n&&d==="sides",[w]=S1.useState(()=>S2(t,o)),[h,S]=S1.useState(()=>!La(w.raw,l)),H=S1.useRef(!0),k=x&&!h,[Z,V]=S1.useState(w.display),[L,y]=S1.useState({}),R=S1.useRef({}),_=S1.useRef({...w.display}),N=S1.useRef({...w.raw}),K=S1.useRef({displayValue:t,displaySides:o,measurement:r,resetVersion:a});S1.useEffect(()=>{let m=K.current,I=a!==m.resetVersion,C=(o===void 0?m.displaySides!==void 0||t!==m.displayValue:m.displaySides===void 0||R1.some(v=>o[v]!==m.displaySides?.[v]))||r!==m.measurement;if(K.current={displayValue:t,displaySides:o,measurement:r,resetVersion:a},!I&&!C)return;let $=S2(t,o);_.current=$.display,N.current=$.raw,I&&(R.current={},y({})),V(v=>{let b={...$.display};for(let G of R1)R.current[G]&&(b[G]=v[G]);return b}),La($.raw,l)?H.current&&Object.keys(R.current).length===0&&S(!1):S(!0)},[t,o,r,a,l]);let z=m=>k&&l?R1:k?m==="top"?["top","bottom"]:["right","left"]:[m],W=(m,I)=>{var P;H.current=!1,(P=R.current)[m]??(P[m]={baseline:_.current[m],sides:z(m)}),V(C=>({...C,[m]:I})),y(C=>({...C,[m]:void 0}))},F=m=>{delete R.current[m],y(I=>({...I,[m]:void 0})),V(I=>({...I,[m]:_.current[m]}))},D=(m,I)=>{let P=R.current[m]?.sides??z(m),C=I.trim(),$=R.current[m]?.baseline??_.current[m],v=a1(C);if(C===""||v&&a1($)&&Number(C)===Number($)){F(m);return}if(!v||!u&&Number(C)<0){y(oe=>({...oe,[m]:v?"negative":"number"}));return}let b=Number(C),G={};for(let oe of P)G[oe]=`${b}px`;if(i(G)===!1){y(oe=>({...oe,[m]:"measurement"}));return}H.current=k;let J=H2(b);for(let oe of P)_.current[oe]=J,N.current[oe]=b;delete R.current[m],y(oe=>({...oe,[m]:void 0})),V(oe=>{let ce={...oe};for(let he of P)R.current[he]||(ce[he]=J);return ce})},B=[f.corners.topLeft,f.corners.topRight,f.corners.bottomRight,f.corners.bottomLeft],U=(d==="corners"?Is:R1).filter(m=>!k||m==="top"||!l&&m==="right"),A=`${g}-sides`,q=`${g}-collapse-description`,T=R1.every(m=>N.current[m]!==null)&&Object.keys(R.current).length===0,j=h?La(N.current,l)?l?f.collapseCorners:f.collapse:l?f.matchCornersAndCollapse:f.matchAndCollapse:l?f.expandCorners:f.expand;return po(m1,{label:e,id:g,className:"boxDimensionEditor-fieldset",children:[po("div",{className:`boxDimensionEditor-layout${k?l?" boxDimensionEditor-layout--uniform-compact":" boxDimensionEditor-layout--paired-compact":""}`,children:[T1("div",{id:A,className:"boxDimensionEditor-grid",children:U.map(m=>{let I=R1.indexOf(m),P=k?l?f.allCorners:m==="top"?f.vertical:f.horizontal:d==="corners"?B[I]:f.sides[m],C=Re(f.ariaSide,[e,P??""]),$=`${g}-${m}-error`;return po("div",{className:"boxDimensionEditor-cell",children:[T1("label",{htmlFor:`${g}-${m}`,className:"boxDimensionEditor-label",children:P}),po("div",{className:"boxDimensionEditor-input-row",children:[x&&T1("span",{className:"boxDimensionEditor-input-icon","aria-hidden":"true",title:C,children:po("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",className:"boxDimensionEditor-pair-icon",children:[T1("rect",{x:1,y:1,width:10,height:10,rx:l?2:void 0}),T1("path",{d:Ss(l,k,m)})]})}),T1("input",{id:`${g}-${m}`,type:"text",inputMode:"decimal",className:`boxDimensionEditor-input${x?" boxDimensionEditor-input--with-icon":""}`,value:Z[m],onChange:v=>W(m,v.target.value),onPaste:v=>{v.preventDefault();let b=v.currentTarget;W(m,Z[m].slice(0,b.selectionStart??0)+v.clipboardData.getData("text")+Z[m].slice(b.selectionEnd??Z[m].length))},onBlur:()=>{R.current[m]&&D(m,Z[m])},onKeyDown:v=>{if(v.key==="Enter")R.current[m]&&D(m,Z[m]),v.currentTarget.blur();else if(v.key==="Escape")F(m);else if(v.key==="ArrowUp"||v.key==="ArrowDown"){v.preventDefault(),H.current=!1;let b=R.current[m]?v.currentTarget.value:_.current[m];if(!a1(b.trim()))return;if(!u&&Number(b)<0){D(m,b);return}let G=(v.key==="ArrowUp"?1:-1)*(v.shiftKey?10:1),J=Number(b)+G;D(m,String(u?J:Math.max(0,J)))}},"aria-label":C,"aria-invalid":L[m]?!0:void 0,"aria-describedby":L[m]?$:void 0,autoComplete:"off",spellCheck:"false"})]}),L[m]&&T1("span",{id:$,role:"alert",className:"boxDimensionEditor-error",children:L[m]==="measurement"?f.measurementUnavailable:L[m]==="negative"?f.invalidNonNegative:f.invalidNumber})]},m)})}),x&&T1("button",{type:"button",className:"boxDimensionEditor-expand","aria-label":j,"aria-expanded":h,"aria-controls":A,"aria-disabled":h&&!T?!0:void 0,"aria-describedby":h&&!T?q:void 0,title:h&&!T?f.collapseUnavailable:j,onPointerDown:m=>{h&&!T&&m.preventDefault()},onClick:()=>{if(h){if(!T)return;let m=N.current,I={};for(let P of R1){let C=l?"top":R2[P];m[P]!==m[C]&&(I[P]=`${m[C]}px`)}if(Object.keys(I).length>0&&i(I)===!1)return;for(let P of R1){let C=I[P];C!==void 0&&(m[P]=Number.parseFloat(C),_.current[P]=_.current[l?"top":R2[P]])}V({..._.current})}H.current=h,S(!h)},children:T1(c2,{width:12,height:12,"aria-hidden":"true"})})]}),x&&h&&!T&&T1("span",{id:q,className:"boxDimensionEditor-collapseDescription",children:f.collapseUnavailable})]})}import{forwardRef as Hs,createElement as ks}from"react";var qo=(...e)=>e.filter((t,o,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===o).join(" ").trim();var P2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var T2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,r)=>r?r.toUpperCase():o.toLowerCase());var wa=e=>{let t=T2(e);return t.charAt(0).toUpperCase()+t.slice(1)};import{forwardRef as Rs,createElement as D2}from"react";var V2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var E2=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var O2=Rs(({color:e="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:a="",children:n,iconNode:l,...i},s)=>D2("svg",{ref:s,...V2,width:t,height:t,stroke:e,strokeWidth:r?Number(o)*24/Number(t):o,className:qo("lucide",a),...!n&&!E2(i)&&{"aria-hidden":"true"},...i},[...l.map(([u,d])=>D2(u,d)),...Array.isArray(n)?n:[n]]));var _2=(e,t)=>{let o=Hs(({className:r,...a},n)=>ks(O2,{ref:n,iconNode:t,className:qo(`lucide-${P2(wa(e))}`,`lucide-${e}`,r),...a}));return o.displayName=wa(e),o};var Ps=[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]],Co=_2("pipette",Ps);import ye from"react";import{useRef as Go,useCallback as We,useEffect as ka,useMemo as Wo,useState as Pa,createContext as Ts,useContext as Vs}from"react";var B2={exports:{}},mo={};var A2;function Es(){if(A2)return mo;A2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(r,a,n){var l=null;if(n!==void 0&&(l=""+n),a.key!==void 0&&(l=""+a.key),"key"in a){n={};for(var i in a)i!=="key"&&(n[i]=a[i])}else n=a;return a=n.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:n}}return mo.Fragment=t,mo.jsx=o,mo.jsxs=o,mo}var Z2;function Ds(){return Z2||(Z2=1,B2.exports=Es()),B2.exports}var ke=Ds();function G2(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(o=G2(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function Os(){for(var e,t,o=0,r="",a=arguments.length;o<a;o++)(e=arguments[o])&&(t=G2(e))&&(r&&(r+=" "),r+=t);return r}var Ta="-",_s=e=>{let t=As(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{let n=a.split(Ta);return n[0]===""&&n.length!==1&&n.shift(),W2(n,t)||Bs(a)},getConflictingClassGroupIds:(a,n)=>{let l=o[a]||[];return n&&r[a]?[...l,...r[a]]:l}}},W2=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),a=r?W2(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;let n=e.join(Ta);return t.validators.find(({validator:l})=>l(n))?.classGroupId},F2=/^\[(.+)\]$/,Bs=e=>{if(F2.test(e)){let t=F2.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},As=e=>{let{theme:t,classGroups:o}=e,r={nextPart:new Map,validators:[]};for(let a in o)ya(o[a],r,a,t);return r},ya=(e,t,o,r)=>{e.forEach(a=>{if(typeof a=="string"){let n=a===""?t:$2(t,a);n.classGroupId=o;return}if(typeof a=="function"){if(Zs(a)){ya(a(r),t,o,r);return}t.validators.push({validator:a,classGroupId:o});return}Object.entries(a).forEach(([n,l])=>{ya(l,$2(t,n),o,r)})})},$2=(e,t)=>{let o=e;return t.split(Ta).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},Zs=e=>e.isThemeGetter,Fs=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,a=(n,l)=>{o.set(n,l),t++,t>e&&(t=0,r=o,o=new Map)};return{get(n){let l=o.get(n);if(l!==void 0)return l;if((l=r.get(n))!==void 0)return a(n,l),l},set(n,l){o.has(n)?o.set(n,l):a(n,l)}}},Ma="!",Sa=":",$s=Sa.length,Ns=e=>{let{prefix:t,experimentalParseClassName:o}=e,r=a=>{let n=[],l=0,i=0,s=0,u;for(let f=0;f<a.length;f++){let M=a[f];if(l===0&&i===0){if(M===Sa){n.push(a.slice(s,f)),s=f+$s;continue}if(M==="/"){u=f;continue}}M==="["?l++:M==="]"?l--:M==="("?i++:M===")"&&i--}let d=n.length===0?a:a.substring(s),c=Us(d),p=c!==d,g=u&&u>s?u-s:void 0;return{modifiers:n,hasImportantModifier:p,baseClassName:c,maybePostfixModifierPosition:g}};if(t){let a=t+Sa,n=r;r=l=>l.startsWith(a)?n(l.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(o){let a=r;r=n=>o({className:n,parseClassName:a})}return r},Us=e=>e.endsWith(Ma)?e.substring(0,e.length-1):e.startsWith(Ma)?e.substring(1):e,qs=e=>{let t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;let r=[],a=[];return o.forEach(n=>{n[0]==="["||t[n]?(r.push(...a.sort(),n),a=[]):a.push(n)}),r.push(...a.sort()),r}},zs=e=>({cache:Fs(e.cacheSize),parseClassName:Ns(e),sortModifiers:qs(e),..._s(e)}),js=/\s+/,Ks=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:n}=t,l=[],i=e.trim().split(js),s="";for(let u=i.length-1;u>=0;u-=1){let d=i[u],{isExternal:c,modifiers:p,hasImportantModifier:g,baseClassName:f,maybePostfixModifierPosition:M}=o(d);if(c){s=d+(s.length>0?" "+s:s);continue}let x=!!M,w=r(x?f.substring(0,M):f);if(!w){if(!x){s=d+(s.length>0?" "+s:s);continue}if(w=r(f),!w){s=d+(s.length>0?" "+s:s);continue}x=!1}let h=n(p).join(":"),S=g?h+Ma:h,H=S+w;if(l.includes(H))continue;l.push(H);let k=a(w,x);for(let Z=0;Z<k.length;++Z){let V=k[Z];l.push(S+V)}s=d+(s.length>0?" "+s:s)}return s};function Gs(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=X2(t))&&(r&&(r+=" "),r+=o);return r}var X2=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=X2(e[r]))&&(o&&(o+=" "),o+=t);return o};function Ws(e,...t){let o,r,a,n=l;function l(s){let u=t.reduce((d,c)=>c(d),e());return o=zs(u),r=o.cache.get,a=o.cache.set,n=i,i(s)}function i(s){let u=r(s);if(u)return u;let d=Ks(s,o);return a(s,d),d}return function(){return n(Gs.apply(null,arguments))}}var _e=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Q2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Y2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Xs=/^\d+\/\d+$/,Qs=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Ys=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Js=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,eu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,tu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$t=e=>Xs.test(e),de=e=>!!e&&!Number.isNaN(Number(e)),it=e=>!!e&&Number.isInteger(Number(e)),Ia=e=>e.endsWith("%")&&de(e.slice(0,-1)),N1=e=>Qs.test(e),ou=()=>!0,ru=e=>Ys.test(e)&&!Js.test(e),J2=()=>!1,au=e=>eu.test(e),nu=e=>tu.test(e),lu=e=>!X(e)&&!Q(e),iu=e=>Nt(e,o9,J2),X=e=>Q2.test(e),kt=e=>Nt(e,r9,ru),ba=e=>Nt(e,fu,de),N2=e=>Nt(e,e9,J2),su=e=>Nt(e,t9,nu),zo=e=>Nt(e,a9,au),Q=e=>Y2.test(e),go=e=>Ut(e,r9),uu=e=>Ut(e,pu),U2=e=>Ut(e,e9),du=e=>Ut(e,o9),cu=e=>Ut(e,t9),jo=e=>Ut(e,a9,!0),Nt=(e,t,o)=>{let r=Q2.exec(e);return r?r[1]?t(r[1]):o(r[2]):!1},Ut=(e,t,o=!1)=>{let r=Y2.exec(e);return r?r[1]?t(r[1]):o:!1},e9=e=>e==="position"||e==="percentage",t9=e=>e==="image"||e==="url",o9=e=>e==="length"||e==="size"||e==="bg-size",r9=e=>e==="length",fu=e=>e==="number",pu=e=>e==="family-name",a9=e=>e==="shadow",Cu=()=>{let e=_e("color"),t=_e("font"),o=_e("text"),r=_e("font-weight"),a=_e("tracking"),n=_e("leading"),l=_e("breakpoint"),i=_e("container"),s=_e("spacing"),u=_e("radius"),d=_e("shadow"),c=_e("inset-shadow"),p=_e("text-shadow"),g=_e("drop-shadow"),f=_e("blur"),M=_e("perspective"),x=_e("aspect"),w=_e("ease"),h=_e("animate"),S=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...H(),Q,X],Z=()=>["auto","hidden","clip","visible","scroll"],V=()=>["auto","contain","none"],L=()=>[Q,X,s],y=()=>[$t,"full","auto",...L()],R=()=>[it,"none","subgrid",Q,X],_=()=>["auto",{span:["full",it,Q,X]},it,Q,X],N=()=>[it,"auto",Q,X],K=()=>["auto","min","max","fr",Q,X],z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...L()],D=()=>[$t,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],B=()=>[e,Q,X],U=()=>[...H(),U2,N2,{position:[Q,X]}],A=()=>["no-repeat",{repeat:["","x","y","space","round"]}],q=()=>["auto","cover","contain",du,iu,{size:[Q,X]}],T=()=>[Ia,go,kt],j=()=>["","none","full",u,Q,X],m=()=>["",de,go,kt],I=()=>["solid","dashed","dotted","double"],P=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>[de,Ia,U2,N2],$=()=>["","none",f,Q,X],v=()=>["none",de,Q,X],b=()=>["none",de,Q,X],G=()=>[de,Q,X],J=()=>[$t,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[N1],breakpoint:[N1],color:[ou],container:[N1],"drop-shadow":[N1],ease:["in","out","in-out"],font:[lu],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[N1],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[N1],shadow:[N1],spacing:["px",de],text:[N1],"text-shadow":[N1],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$t,X,Q,x]}],container:["container"],columns:[{columns:[de,X,Q,i]}],"break-after":[{"break-after":S()}],"break-before":[{"break-before":S()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:Z()}],"overflow-x":[{"overflow-x":Z()}],"overflow-y":[{"overflow-y":Z()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:y()}],"inset-x":[{"inset-x":y()}],"inset-y":[{"inset-y":y()}],start:[{start:y()}],end:[{end:y()}],top:[{top:y()}],right:[{right:y()}],bottom:[{bottom:y()}],left:[{left:y()}],visibility:["visible","invisible","collapse"],z:[{z:[it,"auto",Q,X]}],basis:[{basis:[$t,"full","auto",i,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[de,$t,"auto","initial","none",X]}],grow:[{grow:["",de,Q,X]}],shrink:[{shrink:["",de,Q,X]}],order:[{order:[it,"first","last","none",Q,X]}],"grid-cols":[{"grid-cols":R()}],"col-start-end":[{col:_()}],"col-start":[{"col-start":N()}],"col-end":[{"col-end":N()}],"grid-rows":[{"grid-rows":R()}],"row-start-end":[{row:_()}],"row-start":[{"row-start":N()}],"row-end":[{"row-end":N()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...z(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...z()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":z()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:D()}],w:[{w:[i,"screen",...D()]}],"min-w":[{"min-w":[i,"screen","none",...D()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[l]},...D()]}],h:[{h:["screen","lh",...D()]}],"min-h":[{"min-h":["screen","lh","none",...D()]}],"max-h":[{"max-h":["screen","lh",...D()]}],"font-size":[{text:["base",o,go,kt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Q,ba]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ia,X]}],"font-family":[{font:[uu,X,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Q,X]}],"line-clamp":[{"line-clamp":[de,"none",Q,ba]}],leading:[{leading:[n,...L()]}],"list-image":[{"list-image":["none",Q,X]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Q,X]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:B()}],"text-color":[{text:B()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:[de,"from-font","auto",Q,kt]}],"text-decoration-color":[{decoration:B()}],"underline-offset":[{"underline-offset":[de,"auto",Q,X]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q,X]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Q,X]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:U()}],"bg-repeat":[{bg:A()}],"bg-size":[{bg:q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},it,Q,X],radial:["",Q,X],conic:[it,Q,X]},cu,su]}],"bg-color":[{bg:B()}],"gradient-from-pos":[{from:T()}],"gradient-via-pos":[{via:T()}],"gradient-to-pos":[{to:T()}],"gradient-from":[{from:B()}],"gradient-via":[{via:B()}],"gradient-to":[{to:B()}],rounded:[{rounded:j()}],"rounded-s":[{"rounded-s":j()}],"rounded-e":[{"rounded-e":j()}],"rounded-t":[{"rounded-t":j()}],"rounded-r":[{"rounded-r":j()}],"rounded-b":[{"rounded-b":j()}],"rounded-l":[{"rounded-l":j()}],"rounded-ss":[{"rounded-ss":j()}],"rounded-se":[{"rounded-se":j()}],"rounded-ee":[{"rounded-ee":j()}],"rounded-es":[{"rounded-es":j()}],"rounded-tl":[{"rounded-tl":j()}],"rounded-tr":[{"rounded-tr":j()}],"rounded-br":[{"rounded-br":j()}],"rounded-bl":[{"rounded-bl":j()}],"border-w":[{border:m()}],"border-w-x":[{"border-x":m()}],"border-w-y":[{"border-y":m()}],"border-w-s":[{"border-s":m()}],"border-w-e":[{"border-e":m()}],"border-w-t":[{"border-t":m()}],"border-w-r":[{"border-r":m()}],"border-w-b":[{"border-b":m()}],"border-w-l":[{"border-l":m()}],"divide-x":[{"divide-x":m()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":m()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...I(),"hidden","none"]}],"divide-style":[{divide:[...I(),"hidden","none"]}],"border-color":[{border:B()}],"border-color-x":[{"border-x":B()}],"border-color-y":[{"border-y":B()}],"border-color-s":[{"border-s":B()}],"border-color-e":[{"border-e":B()}],"border-color-t":[{"border-t":B()}],"border-color-r":[{"border-r":B()}],"border-color-b":[{"border-b":B()}],"border-color-l":[{"border-l":B()}],"divide-color":[{divide:B()}],"outline-style":[{outline:[...I(),"none","hidden"]}],"outline-offset":[{"outline-offset":[de,Q,X]}],"outline-w":[{outline:["",de,go,kt]}],"outline-color":[{outline:B()}],shadow:[{shadow:["","none",d,jo,zo]}],"shadow-color":[{shadow:B()}],"inset-shadow":[{"inset-shadow":["none",c,jo,zo]}],"inset-shadow-color":[{"inset-shadow":B()}],"ring-w":[{ring:m()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:B()}],"ring-offset-w":[{"ring-offset":[de,kt]}],"ring-offset-color":[{"ring-offset":B()}],"inset-ring-w":[{"inset-ring":m()}],"inset-ring-color":[{"inset-ring":B()}],"text-shadow":[{"text-shadow":["none",p,jo,zo]}],"text-shadow-color":[{"text-shadow":B()}],opacity:[{opacity:[de,Q,X]}],"mix-blend":[{"mix-blend":[...P(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":P()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[de]}],"mask-image-linear-from-pos":[{"mask-linear-from":C()}],"mask-image-linear-to-pos":[{"mask-linear-to":C()}],"mask-image-linear-from-color":[{"mask-linear-from":B()}],"mask-image-linear-to-color":[{"mask-linear-to":B()}],"mask-image-t-from-pos":[{"mask-t-from":C()}],"mask-image-t-to-pos":[{"mask-t-to":C()}],"mask-image-t-from-color":[{"mask-t-from":B()}],"mask-image-t-to-color":[{"mask-t-to":B()}],"mask-image-r-from-pos":[{"mask-r-from":C()}],"mask-image-r-to-pos":[{"mask-r-to":C()}],"mask-image-r-from-color":[{"mask-r-from":B()}],"mask-image-r-to-color":[{"mask-r-to":B()}],"mask-image-b-from-pos":[{"mask-b-from":C()}],"mask-image-b-to-pos":[{"mask-b-to":C()}],"mask-image-b-from-color":[{"mask-b-from":B()}],"mask-image-b-to-color":[{"mask-b-to":B()}],"mask-image-l-from-pos":[{"mask-l-from":C()}],"mask-image-l-to-pos":[{"mask-l-to":C()}],"mask-image-l-from-color":[{"mask-l-from":B()}],"mask-image-l-to-color":[{"mask-l-to":B()}],"mask-image-x-from-pos":[{"mask-x-from":C()}],"mask-image-x-to-pos":[{"mask-x-to":C()}],"mask-image-x-from-color":[{"mask-x-from":B()}],"mask-image-x-to-color":[{"mask-x-to":B()}],"mask-image-y-from-pos":[{"mask-y-from":C()}],"mask-image-y-to-pos":[{"mask-y-to":C()}],"mask-image-y-from-color":[{"mask-y-from":B()}],"mask-image-y-to-color":[{"mask-y-to":B()}],"mask-image-radial":[{"mask-radial":[Q,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":C()}],"mask-image-radial-to-pos":[{"mask-radial-to":C()}],"mask-image-radial-from-color":[{"mask-radial-from":B()}],"mask-image-radial-to-color":[{"mask-radial-to":B()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":H()}],"mask-image-conic-pos":[{"mask-conic":[de]}],"mask-image-conic-from-pos":[{"mask-conic-from":C()}],"mask-image-conic-to-pos":[{"mask-conic-to":C()}],"mask-image-conic-from-color":[{"mask-conic-from":B()}],"mask-image-conic-to-color":[{"mask-conic-to":B()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:U()}],"mask-repeat":[{mask:A()}],"mask-size":[{mask:q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Q,X]}],filter:[{filter:["","none",Q,X]}],blur:[{blur:$()}],brightness:[{brightness:[de,Q,X]}],contrast:[{contrast:[de,Q,X]}],"drop-shadow":[{"drop-shadow":["","none",g,jo,zo]}],"drop-shadow-color":[{"drop-shadow":B()}],grayscale:[{grayscale:["",de,Q,X]}],"hue-rotate":[{"hue-rotate":[de,Q,X]}],invert:[{invert:["",de,Q,X]}],saturate:[{saturate:[de,Q,X]}],sepia:[{sepia:["",de,Q,X]}],"backdrop-filter":[{"backdrop-filter":["","none",Q,X]}],"backdrop-blur":[{"backdrop-blur":$()}],"backdrop-brightness":[{"backdrop-brightness":[de,Q,X]}],"backdrop-contrast":[{"backdrop-contrast":[de,Q,X]}],"backdrop-grayscale":[{"backdrop-grayscale":["",de,Q,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[de,Q,X]}],"backdrop-invert":[{"backdrop-invert":["",de,Q,X]}],"backdrop-opacity":[{"backdrop-opacity":[de,Q,X]}],"backdrop-saturate":[{"backdrop-saturate":[de,Q,X]}],"backdrop-sepia":[{"backdrop-sepia":["",de,Q,X]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Q,X]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[de,"initial",Q,X]}],ease:[{ease:["linear","initial",w,Q,X]}],delay:[{delay:[de,Q,X]}],animate:[{animate:["none",h,Q,X]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[M,Q,X]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:v()}],"rotate-x":[{"rotate-x":v()}],"rotate-y":[{"rotate-y":v()}],"rotate-z":[{"rotate-z":v()}],scale:[{scale:b()}],"scale-x":[{"scale-x":b()}],"scale-y":[{"scale-y":b()}],"scale-z":[{"scale-z":b()}],"scale-3d":["scale-3d"],skew:[{skew:G()}],"skew-x":[{"skew-x":G()}],"skew-y":[{"skew-y":G()}],transform:[{transform:[Q,X,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:J()}],"translate-x":[{"translate-x":J()}],"translate-y":[{"translate-y":J()}],"translate-z":[{"translate-z":J()}],"translate-none":["translate-none"],accent:[{accent:B()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:B()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Q,X]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Q,X]}],fill:[{fill:["none",...B()]}],"stroke-w":[{stroke:[de,go,kt,ba]}],stroke:[{stroke:["none",...B()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},mu=Ws(Cu),gu=(e,t,o)=>Math.min(Math.max(e,t),o),Ko=e=>Math.round(gu(e,0,255)),n9=e=>{let t=e.replace("#",""),o=parseInt(t,16);return{r:o>>16&255,g:o>>8&255,b:o&255}},hu=({r:e,g:t,b:o})=>{let r=a=>Ko(a).toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(o)}`},Ra=({h:e,s:t,v:o})=>{e=e/360,t=t/100,o=o/100;let r=Math.floor(e*6),a=e*6-r,n=o*(1-t),l=o*(1-a*t),i=o*(1-(1-a)*t),s,u,d;switch(r%6){case 0:s=o,u=i,d=n;break;case 1:s=l,u=o,d=n;break;case 2:s=n,u=o,d=i;break;case 3:s=n,u=l,d=o;break;case 4:s=i,u=n,d=o;break;case 5:s=o,u=n,d=l;break;default:s=u=d=0}return{r:Ko(s*255),g:Ko(u*255),b:Ko(d*255)}},Ha=({r:e,g:t,b:o})=>{e/=255,t/=255,o/=255;let r=Math.max(e,t,o),a=Math.min(e,t,o),n=r-a,l=0,i=r===0?0:n/r,s=r;if(n!==0)switch(r){case e:l=((t-o)/n+(t<o?6:0))/6;break;case t:l=((o-e)/n+2)/6;break;case o:l=((e-t)/n+4)/6;break}return{h:Math.round(l*360),s:Math.round(i*100),v:Math.round(s*100)}},vu=e=>hu(Ra(e)),xu=e=>Ha(n9(e));var q2=({h:e,s:t,v:o})=>{let r=o*(2-t/100)/2,a=r!==0&&r!==100?(o-r)/Math.min(r,100-r)*100:0;return{h:e,s:Math.round(a),l:Math.round(r)}},z2=({h:e,s:t,l:o})=>{let r=o+t*Math.min(o,100-o)/100,a=r===0?0:2*(1-o/r)*100;return{h:e,s:Math.round(a),v:Math.round(r)}},Lu=e=>{let{r:t,g:o,b:r}=n9(e);return(.299*t+.587*o+.114*r)/255>.5?"#000000":"#ffffff"};var wu=(e,t="hex")=>{switch(t){case"hex":return e.getHex();case"rgb":let o=e.getRgb();return`rgb(${o.r}, ${o.g}, ${o.b})`;case"rgba":let r=e.getRgba();return`rgba(${r.r}, ${r.g}, ${r.b}, ${r.a})`;case"hsl":let a=e.getHsl();return`hsl(${a.h}, ${a.s}%, ${a.l}%)`;case"hsla":let n=e.getHsla();return`hsla(${n.h}, ${n.s}%, ${n.l}%, ${n.a})`;default:Xo()}};function Iu(e){switch(e.type){case"hex":return{...xu(e.value),a:1};case"rgb":return{...Ha(e),a:1};case"rgba":return{...Ha(e),a:e.a};case"hsl":return{...z2(e),a:1};case"hsla":return{...z2(e),a:1};case"hsv":return{...e,a:1};case"hsva":return{...e};default:Xo()}}function st(e,t){let o=Iu(e);switch(t){case"hex":return vu(o);case"rgb":return Ra(o);case"rgba":return{...Ra(o),a:o.a};case"hsl":return q2(o);case"hsla":return{...q2(o),a:o.a};case"hsv":return{h:o.h,s:o.s,v:o.v};case"hsva":return o;default:Xo()}}var Pt=(...e)=>mu(Os(e)),U1=(e,t,o)=>Math.min(Math.max(e,t),o),ut=e=>Math.round(e);function Xo(e){throw new Error("You should never get here.")}var dt=class e{constructor(t){this.colorInput=t,typeof t=="string"?this.color={type:"hex",value:t}:"type"in t?this.color=t:"r"in t?"a"in t?this.color={type:"rgba",...t}:this.color={type:"rgb",...t}:"v"in t?"a"in t?this.color={type:"hsva",...t}:this.color={type:"hsv",...t}:"a"in t?this.color={type:"hsla",...t}:this.color={type:"hsl",...t}}getRgb(){return st(this.color,"rgb")}getHsv(){return st(this.color,"hsv")}getHsla(){return st(this.color,"hsla")}getHsva(){return st(this.color,"hsva")}getHex(){return st(this.color,"hex")}getHsl(){return st(this.color,"hsl")}getRgba(){return st(this.color,"rgba")}format(t="hex"){return wu(this,t)}getContrastingColor(){return new e({type:"hex",value:Lu(this.getHex())})}},j2=(e,t)=>{let o=e.getBoundingClientRect(),r,a;if("touches"in t){let u=t.touches[0]||t.changedTouches[0];r=u.clientX,a=u.clientY}else r=t.clientX,a=t.clientY;let n=r-o.left,l=a-o.top,i=U1(n/o.width,0,1),s=U1(l/o.height,0,1);return{left:i,top:s}},Va=({onMove:e,onMoveEnd:t,onKey:o,children:r,className:a,...n})=>{let l=Go(null),i=Go(!1),s=We(p=>{!i.current||!l.current||(p.preventDefault(),e(j2(l.current,p)))},[e]),u=We(()=>{i.current=!1,t(),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",u)},[s,t]),d=We(p=>{let g=l.current;g&&(p.preventDefault(),i.current=!0,e(j2(g,p.nativeEvent)),document.addEventListener("mousemove",s),document.addEventListener("mouseup",u),document.addEventListener("touchmove",s,{passive:!1}),document.addEventListener("touchend",u))},[e,s,u]),c=We(p=>{if(!o)return;let g=p.which||p.keyCode;g<37||g>40||(p.preventDefault(),o({left:g===39?.05:g===37?-.05:0,top:g===40?.05:g===38?-.05:0}))},[o]);return ka(()=>()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",u)},[s,u]),ke.jsx("div",{ref:l,className:Pt("rounded-inherit absolute inset-0 touch-none outline-none","focus:[&_.react-colorful-pointer]:scale-110",a),onTouchStart:d,onMouseDown:d,onKeyDown:c,tabIndex:0,role:"slider",...n,children:r})},Ea=({className:e,top:t=.5,left:o,color:r})=>ke.jsx("div",{className:Pt("absolute z-[1] h-6 w-6 -translate-x-1/2 -translate-y-1/2 cursor-grab rounded-full border-2 border-white bg-white active:cursor-grabbing","react-colorful-pointer shadow-[0_2px_8px_rgba(0,0,0,0.15)] transition-transform",e),style:{top:`${t*100}%`,left:`${o*100}%`}}),bu=({hsva:e,onChange:t,className:o,onFinishedUpdates:r})=>{let a=We(s=>{t({a:s.left},!1)},[t]),n=We(s=>{t({a:U1(e.a+s.left,0,1)},!0)},[e.a,t]),l=Wo(()=>new dt({type:"hsva",h:e.h,s:e.s,v:e.v,a:0}).format("hsla"),[e.h,e.s,e.v]),i=Wo(()=>new dt({type:"hsva",h:e.h,s:e.s,v:e.v,a:1}).format("hsla"),[e.h,e.s,e.v]);return ke.jsx("div",{className:Pt("relative h-full w-full",o),children:ke.jsxs(Va,{onMove:a,onMoveEnd:r,onKey:n,"aria-label":"Alpha","aria-valuetext":`${ut(e.a*100)}%`,"aria-valuenow":ut(e.a*100),"aria-valuemin":0,"aria-valuemax":100,className:"h-full w-full rounded-lg",children:[ke.jsx("div",{className:"absolute inset-0 rounded-lg bg-white",style:{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><rect x="8" width="8" height="8"/><rect y="8" width="8" height="8"/></svg>')`}}),ke.jsx("div",{className:"absolute inset-0 rounded-lg",style:{backgroundImage:`linear-gradient(90deg, ${l}, ${i})`}}),ke.jsx(Ea,{className:"z-[1]",top:.5,left:e.a,color:""})]})})},yu=({hue:e,onChange:t,className:o,onFinishedUpdates:r})=>{let a=We(l=>{let i=ut(U1(360*l.left,0,360));t({h:i},!1)},[t]),n=We(l=>{t({h:U1(e+l.left*360,0,360)},!0)},[e,t]);return ke.jsx("div",{className:Pt("relative h-full w-full",o),children:ke.jsxs(Va,{onMove:a,onMoveEnd:r,onKey:n,"aria-label":"Hue","aria-valuenow":ut(e),"aria-valuemax":360,"aria-valuemin":0,className:"h-full w-full rounded-lg",children:[ke.jsx("div",{className:"absolute inset-0 rounded-lg",style:{background:"linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)"}}),ke.jsx(Ea,{className:"z-[2]",top:.5,left:e/360,color:""})]})})},Mu=({hsva:e,onChange:t,className:o,onFinishedUpdates:r})=>{let a=We(i=>{let s=ut(U1(i.left*100,0,100)),u=ut(U1(100-i.top*100,0,100));t({s,v:u},!1)},[t]),n=We(i=>{t({s:U1(e.s+i.left*100,0,100),v:U1(e.v-i.top*100,0,100)},!0)},[e.s,e.v,t]),l=`hsl(${e.h}, 100%, 50%)`;return ke.jsx("div",{className:Pt("relative h-full w-full rounded-xl",o),children:ke.jsxs(Va,{onMove:a,onMoveEnd:r,onKey:n,"aria-label":"Color","aria-valuetext":`Saturation ${ut(e.s)}%, Brightness ${ut(e.v)}%`,className:"rounded-inherit h-full w-full",children:[ke.jsx("div",{className:"rounded-inherit absolute inset-0 rounded-b-none",style:{backgroundColor:l,backgroundImage:"linear-gradient(to top, #000, rgba(0, 0, 0, 0)), linear-gradient(to right, #fff, rgba(255, 255, 255, 0))",boxShadow:"inset 0 0 0 1px rgba(0, 0, 0, 0.05)"}}),ke.jsx(Ea,{className:"z-[3]",top:1-e.v/100,left:e.s/100,color:""})]})})},l9=Ts(null),Qo=()=>{let e=Vs(l9);if(!e)throw new Error("ColorPicker compound components must be used within a ColorPicker");return e};function K2(e){return"type"in e?new dt(e):e}var Su=({color:e,onChange:t,className:o,children:r,defaultColor:a,...n})=>{let[l,i]=Pa(K2(e??a??{h:340,s:58,v:100,a:1,type:"hsva"})),s=Go(!1),u=Go(l);ka(()=>{!s.current&&e&&(u.current=K2(e),i(u.current))},[e]);let d=We((f,M)=>{let x=new dt({type:"hsva",...u.current.getHsva(),...f});u.current=x,i(x),s.current=!M,t?.(x)},[t]),c=We(()=>{s.current=!1},[]),p=We(async()=>{if(!("EyeDropper"in window)){console.log("EyeDropper API not supported");return}try{let f=await new window.EyeDropper().open();f.sRGBHex&&d(st({type:"hex",value:f.sRGBHex},"hsva"),!0)}catch(f){console.log("EyeDropper cancelled or failed:",f)}},[t]),g={hsva:l.getHsva(),updateHsva:d,handleEyeDropper:p,onFinishedUpdates:c};return ke.jsx(l9.Provider,{value:g,children:ke.jsx("div",{...n,className:Pt("relative flex h-[280px] w-[280px] cursor-default flex-col rounded-2xl bg-white shadow-lg select-none",o),children:r})})},Ru=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:r}=Qo(),a=We((n,l)=>{o(n,l)},[o]);return ke.jsx(Mu,{hsva:t,onChange:a,className:e,onFinishedUpdates:r})},Hu=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:r}=Qo(),a=We((n,l)=>{o(n,l)},[o]);return ke.jsx(yu,{hue:t.h,onChange:a,className:e,onFinishedUpdates:r})},ku=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:r}=Qo(),a=We((n,l)=>{o(n,l)},[o]);return ke.jsx(bu,{hsva:t,onChange:a,className:e,onFinishedUpdates:r})},Pu=({className:e,title:t="Pick color from screen",children:o})=>{let{handleEyeDropper:r}=Qo(),[a,n]=Pa(!1);return ka(()=>{typeof window<"u"&&"EyeDropper"in window&&n(!0)},[]),a?ke.jsx("button",{onClick:r,className:Pt("flex h-10 w-10 flex-shrink-0 cursor-pointer items-center justify-center rounded-lg transition-colors hover:bg-gray-100",e),title:t,children:o}):null},qt=Object.assign(Su,{Saturation:Ru,Hue:Hu,Alpha:ku,EyeDropper:Pu});function Tu(e,t){switch(t){case"hex":return{type:"hex",value:e.getHex()};case"rgb":return{type:"rgb",...e.getRgb()};case"rgba":return{type:"rgba",...e.getRgba()};case"hsl":return{type:"hsl",...e.getHsl()};case"hsla":return{type:"hsla",...e.getHsla()};case"hsv":return{type:"hsv",...e.getHsv()};case"hsva":return{type:"hsva",...e.getHsva()};default:Xo()}}var i9=(e={type:"hex",value:"#ff6b9d"})=>{let[t,o]=Pa(()=>{let l=typeof e=="function"?e():e;return{color:new dt(l),type:l.type}}),r=Wo(()=>Tu(t.color,t.type),[t.color,t.type]),a=Wo(()=>{let l=t.color.getHsva();return{hex:t.color.getHex(),rgb:t.color.getRgb(),rgba:t.color.getRgba(),hsl:t.color.getHsl(),hsla:t.color.getHsla(),hsv:t.color.getHsv(),hsva:l,alpha:l.a}},[t.color]),n=We(l=>{try{let i="type"in l?new dt(l):l;o(s=>({color:i,type:s.type}))}catch(i){console.warn("Invalid color input:",l,i)}},[]);return[{colorInput:r,colorState:a},n]};import{createPortal as u7}from"react-dom";import{useRef as H1,useMemo as Vu,useEffect as Eu,useState as kf,useCallback as Pf}from"react";function s9(e,t,o,r){var a=this,n=H1(null),l=H1(0),i=H1(0),s=H1(null),u=H1([]),d=H1(),c=H1(),p=H1(e),g=H1(!0),f=H1(),M=H1();p.current=e;var x=typeof window<"u",w=!t&&t!==0&&x;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var h=!!(o=o||{}).leading,S=!("trailing"in o)||!!o.trailing,H=!!o.flushOnExit&&S,k="maxWait"in o,Z="debounceOnServer"in o&&!!o.debounceOnServer,V=k?Math.max(+o.maxWait||0,t):null,L=Vu(function(){var y=function(F){var D=u.current,B=d.current;return u.current=d.current=null,l.current=F,i.current=i.current||F,c.current=p.current.apply(B,D)},R=function(F,D){w&&cancelAnimationFrame(s.current),s.current=w?requestAnimationFrame(F):setTimeout(F,D)},_=function(F){if(!g.current)return!1;var D=F-n.current;return!n.current||D>=t||D<0||k&&F-l.current>=V},N=function(F){return s.current=null,S&&u.current?y(F):(u.current=d.current=null,c.current)},K=function F(){var D=Date.now();if(h&&i.current===l.current&&z(),_(D))return N(D);if(g.current){var B=t-(D-n.current),U=k?Math.min(B,V-(D-l.current)):B;R(F,U)}},z=function(){r&&r({})},W=function(){if(x||Z){var F,D=Date.now(),B=_(D);if(u.current=[].slice.call(arguments),d.current=a,n.current=D,H&&!f.current&&(f.current=function(){var U;((U=globalThis.document)==null?void 0:U.visibilityState)==="hidden"&&M.current.flush()},(F=globalThis.document)==null||F.addEventListener==null||F.addEventListener("visibilitychange",f.current)),B){if(!s.current&&g.current)return l.current=n.current,R(K,t),h?y(n.current):c.current;if(k)return R(K,t),y(n.current)}return s.current||R(K,t),c.current}};return W.cancel=function(){var F=s.current;F&&(w?cancelAnimationFrame(s.current):clearTimeout(s.current)),l.current=0,u.current=n.current=d.current=s.current=null,F&&r&&r({})},W.isPending=function(){return!!s.current},W.flush=function(){return s.current?N(Date.now()):c.current},W},[h,k,t,V,S,H,w,x,Z,r]);return M.current=L,Eu(function(){return g.current=!0,function(){var y;H&&M.current.flush(),f.current&&((y=globalThis.document)==null||y.removeEventListener==null||y.removeEventListener("visibilitychange",f.current),f.current=null),g.current=!1}},[H]),L}import t1 from"react";function q1(e){let t=e?.parentNode;for(;t;){if(t instanceof ShadowRoot){t=t.host;continue}if(t instanceof HTMLElement){let{overflowY:o}=getComputedStyle(t);if(o==="auto"||o==="scroll")return t}t=t.parentNode}return null}var u9='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function Yo({computePosition:e,onClose:t,autoFocus:o=!0,trapFocus:r=!1,restoreFocusOnOutside:a=!0}={}){let[n,l]=t1.useState(!1),[i,s]=t1.useState({top:0,left:0}),u=t1.useRef(null),d=t1.useRef(null),c=t1.useRef(!1),p=t1.useRef(e);p.current=e;let g=t1.useRef(t);g.current=t;let f=t1.useRef(r);f.current=r;let M=t1.useCallback((...S)=>{!u.current||!p.current||s(p.current(u.current,...S))},[]),x=t1.useCallback(()=>{M(),c.current=!0,l(!0)},[M]),w=t1.useCallback((S=!0)=>{g.current&&g.current(),c.current=!1,l(!1),S&&u.current?.focus()},[]),h=t1.useCallback(()=>{c.current?w():x()},[x,w]);return t1.useEffect(()=>{if(!n)return;let S=k=>{if(k.key==="Escape"&&(k.preventDefault(),w()),f.current&&k.key==="Tab"){let Z=d.current;if(!Z)return;let V=Array.from(Z.querySelectorAll(u9)).filter(R=>!R.hasAttribute("disabled")),L=V[0],y=V.at(-1);if(!L||!y)return;k.shiftKey&&document.activeElement===L?(k.preventDefault(),y.focus()):!k.shiftKey&&document.activeElement===y&&(k.preventDefault(),L.focus())}},H=k=>{let Z=d.current,V=u.current;if(!Z||!V)return;let L=typeof k.composedPath=="function"?k.composedPath():[],y=L.includes(Z)||k.target instanceof Node&&Z.contains(k.target),R=L.includes(V)||k.target instanceof Node&&V.contains(k.target);!y&&!R&&w(a)};return document.addEventListener("keydown",S),document.addEventListener("mousedown",H),document.addEventListener("touchstart",H),()=>{document.removeEventListener("keydown",S),document.removeEventListener("mousedown",H),document.removeEventListener("touchstart",H)}},[n,w,a]),t1.useEffect(()=>{if(!n||!o||!d.current)return;let S=d.current.querySelector(u9);S&&S.focus()},[n,o]),t1.useEffect(()=>{if(!n||!u.current)return;let S=q1(u.current);if(!S)return;let H=()=>w();return S.addEventListener("scroll",H,{passive:!0}),()=>S.removeEventListener("scroll",H)},[n,w]),{isOpen:n,open:x,close:w,toggle:h,triggerRef:u,popoverRef:d,position:i,reposition:M}}var Du=(e,t)=>{if(typeof e=="number"){if(t===3)return{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(t===4)return{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(t===6)return{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(t===8)return{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}},Jo=Du;var Ou={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},d9=Ou;var _u=e=>Jo(d9[e.toLowerCase()],6),c9=_u;var Bu=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,Au=e=>{let t;return(t=e.match(Bu))?Jo(parseInt(t[1],16),t[1].length):void 0},f9=Au;var o1="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Uf=`(?:${o1}|none)`,Tt=`${o1}%`,qf=`(?:${o1}%|none)`,ho=`(?:${o1}%|${o1})`,Zu=`(?:${o1}%|${o1}|none)`,p9=`(?:${o1}(deg|grad|rad|turn)|${o1})`,zf=`(?:${o1}(deg|grad|rad|turn)|${o1}|none)`,ct="\\s*,\\s*";var jf=new RegExp("^"+Zu+"$");var Fu=new RegExp(`^rgba?\\(\\s*${o1}${ct}${o1}${ct}${o1}\\s*(?:,\\s*${ho}\\s*)?\\)$`),$u=new RegExp(`^rgba?\\(\\s*${Tt}${ct}${Tt}${ct}${Tt}\\s*(?:,\\s*${ho}\\s*)?\\)$`),Nu=e=>{let t={mode:"rgb"},o;if(o=e.match(Fu))o[1]!==void 0&&(t.r=o[1]/255),o[2]!==void 0&&(t.g=o[2]/255),o[3]!==void 0&&(t.b=o[3]/255);else if(o=e.match($u))o[1]!==void 0&&(t.r=o[1]/100),o[2]!==void 0&&(t.g=o[2]/100),o[3]!==void 0&&(t.b=o[3]/100);else return;return o[4]!==void 0?t.alpha=Math.max(0,Math.min(1,o[4]/100)):o[5]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+o[5]))),t},C9=Nu;var Uu=(e,t)=>e===void 0?void 0:typeof e!="object"?z1(e):e.mode!==void 0?e:t?{...e,mode:t}:void 0,er=Uu;var qu=(e="rgb")=>t=>(t=er(t,e))!==void 0?t.mode===e?t:k1[t.mode][e]?k1[t.mode][e](t):e==="rgb"?k1[t.mode].rgb(t):k1.rgb[e](k1[t.mode].rgb(t)):void 0,r1=qu;var k1={},m9={},vo=[],Da={},zu=e=>e,ge=e=>(k1[e.mode]={...k1[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{k1[t]||(k1[t]={}),k1[t][e.mode]=e.fromMode[t]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw new Error(`Missing interpolator for: ${t}`);typeof e.interpolate[t]=="function"&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=zu)}),m9[e.mode]=e,(e.parse||[]).forEach(t=>{ju(t,e.mode)}),r1(e.mode)),tr=e=>m9[e],ju=(e,t)=>{if(typeof e=="string"){if(!t)throw new Error("'mode' required when 'parser' is a string");Da[e]=t}else typeof e=="function"&&vo.indexOf(e)<0&&vo.push(e)};var Oa=/[^\x00-\x7F]|[a-zA-Z_]/,Ku=/[^\x00-\x7F]|[-\w]/,E={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},ae=0;function or(e){let t=e[ae],o=e[ae+1];return t==="-"||t==="+"?/\d/.test(o)||o==="."&&/\d/.test(e[ae+2]):t==="."?/\d/.test(o):/\d/.test(t)}function _a(e){if(ae>=e.length)return!1;let t=e[ae];if(Oa.test(t))return!0;if(t==="-"){if(e.length-ae<2)return!1;let o=e[ae+1];return!!(o==="-"||Oa.test(o))}return!1}var Gu={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function xo(e){let t="";if((e[ae]==="-"||e[ae]==="+")&&(t+=e[ae++]),t+=rr(e),e[ae]==="."&&/\d/.test(e[ae+1])&&(t+=e[ae++]+rr(e)),(e[ae]==="e"||e[ae]==="E")&&((e[ae+1]==="-"||e[ae+1]==="+")&&/\d/.test(e[ae+2])?t+=e[ae++]+e[ae++]+rr(e):/\d/.test(e[ae+1])&&(t+=e[ae++]+rr(e))),_a(e)){let o=ar(e);return o==="deg"||o==="rad"||o==="turn"||o==="grad"?{type:E.Hue,value:t*Gu[o]}:void 0}return e[ae]==="%"?(ae++,{type:E.Percentage,value:+t}):{type:E.Number,value:+t}}function rr(e){let t="";for(;/\d/.test(e[ae]);)t+=e[ae++];return t}function ar(e){let t="";for(;ae<e.length&&Ku.test(e[ae]);)t+=e[ae++];return t}function Wu(e){let t=ar(e);return e[ae]==="("?(ae++,{type:E.Function,value:t}):t==="none"?{type:E.None,value:void 0}:{type:E.Ident,value:t}}function Xu(e=""){let t=e.trim(),o=[],r;for(ae=0;ae<t.length;){if(r=t[ae++],r===`
|
|
1
|
+
var Y5=Object.create;var ha=Object.defineProperty;var J5=Object.getOwnPropertyDescriptor;var es=Object.getOwnPropertyNames;var ts=Object.getPrototypeOf,os=Object.prototype.hasOwnProperty;var rs=(e,t,o)=>t in e?ha(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var uo=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(o){throw t=0,o}};var as=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of es(t))!os.call(e,a)&&a!==o&&ha(e,a,{get:()=>t[a],enumerable:!(r=J5(t,a))||r.enumerable});return e};var s2=(e,t,o)=>(o=e!=null?Y5(ts(e)):{},as(t||!e||!e.__esModule?ha(o,"default",{value:e,enumerable:!0}):o,e));var Ht=(e,t,o)=>rs(e,typeof t!="symbol"?t+"":t,o);var Z0=uo((Ow,A0)=>{"use strict";var h7="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";A0.exports=h7});var U0=uo((_w,N0)=>{"use strict";var v7=Z0();function F0(){}function $0(){}$0.resetWarningCache=F0;N0.exports=function(){function e(r,a,n,l,i,s){if(s!==v7){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var o={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:$0,resetWarningCache:F0};return o.PropTypes=o,o}});var z0=uo((Zw,q0)=>{q0.exports=U0()();var Bw,Aw});var K0=uo(ve=>{"use strict";var An=Symbol.for("react.element"),Zn=Symbol.for("react.portal"),Tr=Symbol.for("react.fragment"),Vr=Symbol.for("react.strict_mode"),Er=Symbol.for("react.profiler"),Dr=Symbol.for("react.provider"),Or=Symbol.for("react.context"),x7=Symbol.for("react.server_context"),_r=Symbol.for("react.forward_ref"),Br=Symbol.for("react.suspense"),Ar=Symbol.for("react.suspense_list"),Zr=Symbol.for("react.memo"),Fr=Symbol.for("react.lazy"),L7=Symbol.for("react.offscreen"),j0;j0=Symbol.for("react.module.reference");function L1(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case An:switch(e=e.type,e){case Tr:case Er:case Vr:case Br:case Ar:return e;default:switch(e=e&&e.$$typeof,e){case x7:case Or:case _r:case Fr:case Zr:case Dr:return e;default:return t}}case Zn:return t}}}ve.ContextConsumer=Or;ve.ContextProvider=Dr;ve.Element=An;ve.ForwardRef=_r;ve.Fragment=Tr;ve.Lazy=Fr;ve.Memo=Zr;ve.Portal=Zn;ve.Profiler=Er;ve.StrictMode=Vr;ve.Suspense=Br;ve.SuspenseList=Ar;ve.isAsyncMode=function(){return!1};ve.isConcurrentMode=function(){return!1};ve.isContextConsumer=function(e){return L1(e)===Or};ve.isContextProvider=function(e){return L1(e)===Dr};ve.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===An};ve.isForwardRef=function(e){return L1(e)===_r};ve.isFragment=function(e){return L1(e)===Tr};ve.isLazy=function(e){return L1(e)===Fr};ve.isMemo=function(e){return L1(e)===Zr};ve.isPortal=function(e){return L1(e)===Zn};ve.isProfiler=function(e){return L1(e)===Er};ve.isStrictMode=function(e){return L1(e)===Vr};ve.isSuspense=function(e){return L1(e)===Br};ve.isSuspenseList=function(e){return L1(e)===Ar};ve.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Tr||e===Er||e===Vr||e===Br||e===Ar||e===L7||typeof e=="object"&&e!==null&&(e.$$typeof===Fr||e.$$typeof===Zr||e.$$typeof===Dr||e.$$typeof===Or||e.$$typeof===_r||e.$$typeof===j0||e.getModuleId!==void 0)};ve.typeOf=L1});var W0=uo(($w,G0)=>{"use strict";G0.exports=K0()});import{forwardRef as rt,createElement as Qe}from"react";function at(e,t){if(e==null)return{};var o={},r=Object.keys(e),a,n;for(n=0;n<r.length;n++)a=r[n],!(t.indexOf(a)>=0)&&(o[a]=e[a]);return o}var ns=["color"],Zo=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,ns);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ls=["color"],u2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,ls);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var is=["color"],d2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,is);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ss=["color"],c2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,ss);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M2 2.5C2 2.22386 2.22386 2 2.5 2H5.5C5.77614 2 6 2.22386 6 2.5C6 2.77614 5.77614 3 5.5 3H3V5.5C3 5.77614 2.77614 6 2.5 6C2.22386 6 2 5.77614 2 5.5V2.5ZM9 2.5C9 2.22386 9.22386 2 9.5 2H12.5C12.7761 2 13 2.22386 13 2.5V5.5C13 5.77614 12.7761 6 12.5 6C12.2239 6 12 5.77614 12 5.5V3H9.5C9.22386 3 9 2.77614 9 2.5ZM2.5 9C2.77614 9 3 9.22386 3 9.5V12H5.5C5.77614 12 6 12.2239 6 12.5C6 12.7761 5.77614 13 5.5 13H2.5C2.22386 13 2 12.7761 2 12.5V9.5C2 9.22386 2.22386 9 2.5 9ZM12.5 9C12.7761 9 13 9.22386 13 9.5V12.5C13 12.7761 12.7761 13 12.5 13H9.5C9.22386 13 9 12.7761 9 12.5C9 12.2239 9.22386 12 9.5 12H12V9.5C12 9.22386 12.2239 9 12.5 9Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var us=["color"],f2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,us);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M2.78233 2.21707C2.70732 2.14206 2.60557 2.09991 2.49949 2.09991C2.3934 2.09991 2.29166 2.14206 2.21664 2.21707L0.216645 4.21707C0.0604351 4.37328 0.0604351 4.62655 0.216645 4.78276C0.372855 4.93897 0.626121 4.93897 0.78233 4.78276L2.09949 3.4656L2.09949 11.5342L0.78233 10.2171C0.62612 10.0609 0.372854 10.0609 0.216645 10.2171C0.0604349 10.3733 0.0604349 10.6265 0.216645 10.7828L2.21664 12.7828C2.29166 12.8578 2.3934 12.8999 2.49949 12.8999C2.60557 12.8999 2.70731 12.8578 2.78233 12.7828L4.78233 10.7828C4.93854 10.6265 4.93854 10.3733 4.78233 10.2171C4.62612 10.0609 4.37285 10.0609 4.21664 10.2171L2.89949 11.5342L2.89949 3.4656L4.21664 4.78276C4.37285 4.93897 4.62612 4.93897 4.78233 4.78276C4.93854 4.62655 4.93854 4.37328 4.78233 4.21707L2.78233 2.21707ZM10.5 2.74997C10.7107 2.74997 10.8988 2.88211 10.9703 3.08036L13.9703 11.3999C14.064 11.6597 13.9293 11.9462 13.6696 12.0399C13.4098 12.1336 13.1233 11.9989 13.0296 11.7392L12.0477 9.016H8.95228L7.97033 11.7392C7.87666 11.9989 7.59013 12.1336 7.33036 12.0399C7.07059 11.9462 6.93595 11.6597 7.02962 11.3999L10.0296 3.08036C10.1011 2.88211 10.2892 2.74997 10.5 2.74997ZM10.5 4.72396L11.7412 8.166H9.25879L10.5 4.72396Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var ds=["color"],p2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,ds);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M6.5 1C6.22386 1 6 1.22386 6 1.5C6 1.77614 6.22386 2 6.5 2C7.12671 2 7.45718 2.20028 7.65563 2.47812C7.8781 2.78957 8 3.28837 8 4V11C8 11.7116 7.8781 12.2104 7.65563 12.5219C7.45718 12.7997 7.12671 13 6.5 13C6.22386 13 6 13.2239 6 13.5C6 13.7761 6.22386 14 6.5 14C7.37329 14 8.04282 13.7003 8.46937 13.1031C8.47976 13.0886 8.48997 13.0739 8.5 13.0591C8.51003 13.0739 8.52024 13.0886 8.53063 13.1031C8.95718 13.7003 9.62671 14 10.5 14C10.7761 14 11 13.7761 11 13.5C11 13.2239 10.7761 13 10.5 13C9.87329 13 9.54282 12.7997 9.34437 12.5219C9.1219 12.2104 9 11.7116 9 11V4C9 3.28837 9.1219 2.78957 9.34437 2.47812C9.54282 2.20028 9.87329 2 10.5 2C10.7761 2 11 1.77614 11 1.5C11 1.22386 10.7761 1 10.5 1C9.62671 1 8.95718 1.29972 8.53063 1.89688C8.52024 1.91143 8.51003 1.92611 8.5 1.9409C8.48997 1.92611 8.47976 1.91143 8.46937 1.89688C8.04282 1.29972 7.37329 1 6.5 1ZM14 5H11V4H14C14.5523 4 15 4.44772 15 5V10C15 10.5523 14.5523 11 14 11H11V10H14V5ZM6 4V5H1L1 10H6V11H1C0.447715 11 0 10.5523 0 10V5C0 4.44772 0.447715 4 1 4H6Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var cs=["color"],C2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,cs);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M4.55293 0.999969C4.75295 0.999969 4.93372 1.11917 5.0125 1.30301L8.01106 8.29982C8.11984 8.55363 8.00226 8.84757 7.74844 8.95635C7.49463 9.06512 7.20069 8.94754 7.09191 8.69373L6.11613 6.41685H2.98973L2.01395 8.69373C1.90517 8.94754 1.61123 9.06512 1.35742 8.95635C1.1036 8.84757 0.986023 8.55363 1.0948 8.29982L4.09336 1.30301C4.17214 1.11917 4.35291 0.999969 4.55293 0.999969ZM4.55293 2.76929L5.75186 5.56685H3.354L4.55293 2.76929ZM11.0562 9.00214C11.2617 9.00214 11.4463 8.87633 11.5215 8.68502L14.2733 1.68299C14.3743 1.42598 14.2478 1.13575 13.9908 1.03475C13.7338 0.933747 13.4436 1.06021 13.3426 1.31722L11.0562 7.13514L8.76973 1.31722C8.66873 1.06021 8.3785 0.933747 8.1215 1.03475C7.86449 1.13575 7.73802 1.42598 7.83902 1.68299L10.5908 8.68502C10.666 8.87633 10.8506 9.00214 11.0562 9.00214ZM14.9537 12.4999C14.9537 12.606 14.9115 12.7077 14.8365 12.7828L12.8365 14.7828C12.6803 14.939 12.4271 14.939 12.2708 14.7828C12.1146 14.6265 12.1146 14.3733 12.2708 14.2171L13.588 12.8999H1.51937L2.83653 14.2171C2.99274 14.3733 2.99274 14.6265 2.83653 14.7828C2.68032 14.939 2.42705 14.939 2.27084 14.7828L0.270843 12.7828C0.195828 12.7077 0.153687 12.606 0.153687 12.4999C0.153687 12.3938 0.195828 12.2921 0.270843 12.2171L2.27084 10.2171C2.42705 10.0609 2.68032 10.0609 2.83653 10.2171C2.99274 10.3733 2.99274 10.6265 2.83653 10.7828L1.51937 12.0999L13.588 12.0999L12.2708 10.7828C12.1146 10.6265 12.1146 10.3733 12.2708 10.2171C12.4271 10.0609 12.6803 10.0609 12.8365 10.2171L14.8365 12.2171C14.9115 12.2921 14.9537 12.3938 14.9537 12.4999Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});var fs=["color"],m2=rt(function(e,t){var o=e.color,r=o===void 0?"currentColor":o,a=at(e,fs);return Qe("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:t}),Qe("path",{d:"M3.78233 2.21713C3.70732 2.14212 3.60557 2.09998 3.49949 2.09998C3.3934 2.09998 3.29166 2.14212 3.21664 2.21713L1.21664 4.21713C1.06044 4.37334 1.06044 4.62661 1.21664 4.78282C1.37285 4.93903 1.62612 4.93903 1.78233 4.78282L3.09949 3.46566L3.09949 11.5343L1.78233 10.2171C1.62612 10.0609 1.37285 10.0609 1.21664 10.2171C1.06043 10.3733 1.06043 10.6266 1.21664 10.7828L3.21664 12.7828C3.29166 12.8578 3.3934 12.9 3.49949 12.9C3.60557 12.9 3.70731 12.8578 3.78233 12.7828L5.78233 10.7828C5.93854 10.6266 5.93854 10.3733 5.78233 10.2171C5.62612 10.0609 5.37285 10.0609 5.21664 10.2171L3.89949 11.5343L3.89949 3.46566L5.21664 4.78282C5.37285 4.93903 5.62612 4.93903 5.78233 4.78282C5.93854 4.62661 5.93854 4.37334 5.78233 4.21713L3.78233 2.21713ZM8.49998 3.99997C8.22383 3.99997 7.99998 4.22382 7.99998 4.49997C7.99998 4.77611 8.22383 4.99997 8.49998 4.99997H14.5C14.7761 4.99997 15 4.77611 15 4.49997C15 4.22382 14.7761 3.99997 14.5 3.99997H8.49998ZM7.99998 7.49997C7.99998 7.22382 8.22383 6.99997 8.49998 6.99997H14.5C14.7761 6.99997 15 7.22382 15 7.49997C15 7.77611 14.7761 7.99997 14.5 7.99997H8.49998C8.22383 7.99997 7.99998 7.77611 7.99998 7.49997ZM8.49998 9.99997C8.22383 9.99997 7.99998 10.2238 7.99998 10.5C7.99998 10.7761 8.22383 11 8.49998 11H14.5C14.7761 11 15 10.7761 15 10.5C15 10.2238 14.7761 9.99997 14.5 9.99997H8.49998Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});import me from"react";import{createRoot as u8}from"react-dom/client";import g2 from"react";import{jsx as va,jsxs as h2}from"react/jsx-runtime";function nt({title:e,defaultOpen:t=!0,children:o}){let[r,a]=g2.useState(t),n=g2.useCallback(l=>{a(l.currentTarget.open)},[]);return h2("details",{className:"property-panel-section",open:r,onToggle:n,children:[h2("summary",{className:"property-panel-section-trigger",children:[va("span",{children:e}),va(u2,{className:"property-panel-section-chevron",width:12,height:12,"aria-hidden":"true"})]}),va("div",{className:"property-panel-section-content",children:o})]})}var v2=["H1","H2","H3","H4","H5","H6","P","SPAN","A","BUTTON","LABEL","DIV","LI","TD","TH","CAPTION","FIGCAPTION","BLOCKQUOTE","LEGEND","SUMMARY","DT","DD","EM","STRONG"];var x2=new Set(["fontFamily","fontWeight","fontSize","lineHeight","letterSpacing"]),$1={padding:["paddingTop","paddingRight","paddingBottom","paddingLeft"],margin:["marginTop","marginRight","marginBottom","marginLeft"],borderRadius:["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"]},L2=new Set([...Object.keys($1),...Object.values($1).flat()]);import S1 from"react";import{jsx as ms,jsxs as gs}from"react/jsx-runtime";var ps={border:"none",margin:0,padding:0,minWidth:0},Cs={color:"var(--dmp-color-foreground)",fontSize:"var(--dmp-font-size-label)",display:"block",marginBottom:"5px",padding:0};function m1({label:e,id:t,className:o,children:r}){let a=`${t}-legend`;return gs("fieldset",{style:ps,className:o,"aria-labelledby":a,children:[ms("legend",{id:a,style:Cs,children:e}),r]})}function Re(e,t){return e.replace(/\{(\d+)\}/g,(o,r)=>{let a=t[Number(r)];return a===void 0?o:String(a)})}function M1(e,t){if(t==null||typeof t!="object"||typeof e!="object")return e;let o={...e},r=t;for(let a of Object.keys(o)){let n=o[a],l=r[a];n!==null&&typeof n=="object"&&!Array.isArray(n)?o[a]=M1(n,l):typeof l=="string"&&(o[a]=l)}return o}var w2=[{path:"general.headerTitle"},{path:"general.emptyPlaceholder"},{path:"general.inlineEditEditable"},{path:"general.inlineEditNonEditable"},{path:"general.addToChatContext"},{path:"general.ariaPropertyPanel"},{path:"general.ariaSelectedComponent"},{path:"general.ariaElementStyling"},{path:"general.closePanel"},{path:"sections.imageSource"},{path:"sections.background"},{path:"sections.spacing"},{path:"sections.border"},{path:"sections.typography"},{path:"instances.imageSource"},{path:"instances.backgroundColor"},{path:"instances.padding"},{path:"instances.margin"},{path:"instances.borderRadius"},{path:"instances.fontFamily"},{path:"instances.fontSize"},{path:"instances.fontWeight"},{path:"instances.textStyling"},{path:"instances.textColor"},{path:"instances.textAlignment"},{path:"instances.lineHeight"},{path:"instances.letterSpacing"},{path:"editors.image.tabCms"},{path:"editors.image.tabLocal"},{path:"editors.image.tabUrl"},{path:"editors.image.ariaTablist"},{path:"editors.image.clearImage"},{path:"editors.image.chooseFile"},{path:"editors.image.ariaChooseFile"},{path:"editors.image.ariaImageUrl"},{path:"editors.image.urlPlaceholder"},{path:"editors.image.previewAlt"},{path:"editors.image.altText"},{path:"editors.image.altPlaceholder"},{path:"editors.image.sourceFromData"},{path:"editors.image.sourceNotEditable"},{path:"editors.image.altFromData"},{path:"editors.image.altNotEditable"},{path:"editors.image.sourceShared",placeholders:[0]},{path:"editors.image.altShared",placeholders:[0]},{path:"editors.image.workspace"},{path:"editors.image.selectWorkspace"},{path:"editors.image.selectImage"},{path:"editors.image.loadingWorkspaces"},{path:"editors.image.noWorkspaces"},{path:"editors.image.loadingImages"},{path:"editors.image.noImages"},{path:"editors.image.loadingMore"},{path:"editors.image.untitled"},{path:"editors.image.downloadingImage"},{path:"editors.image.downloadFailed"},{path:"editors.image.closePicker"},{path:"editors.image.cancel"},{path:"editors.image.done"},{path:"editors.image.pickerTitle",placeholders:[0]},{path:"editors.image.pickerError",placeholders:[0]},{path:"editors.boxDimension.sides.top"},{path:"editors.boxDimension.sides.right"},{path:"editors.boxDimension.sides.bottom"},{path:"editors.boxDimension.sides.left"},{path:"editors.boxDimension.corners.topLeft"},{path:"editors.boxDimension.corners.topRight"},{path:"editors.boxDimension.corners.bottomRight"},{path:"editors.boxDimension.corners.bottomLeft"},{path:"editors.boxDimension.allCorners"},{path:"editors.boxDimension.expandCorners"},{path:"editors.boxDimension.collapseCorners"},{path:"editors.boxDimension.matchCornersAndCollapse"},{path:"editors.boxDimension.vertical"},{path:"editors.boxDimension.horizontal"},{path:"editors.boxDimension.expand"},{path:"editors.boxDimension.collapse"},{path:"editors.boxDimension.matchAndCollapse"},{path:"editors.boxDimension.collapseUnavailable"},{path:"editors.boxDimension.measurementUnavailable"},{path:"editors.boxDimension.invalidNumber"},{path:"editors.boxDimension.invalidNonNegative"},{path:"editors.boxDimension.ariaSide",placeholders:[0,1]},{path:"editors.dimension.ariaValue",placeholders:[0]},{path:"editors.dimension.ariaActions",placeholders:[0]},{path:"editors.dimension.useNormalLineHeight"},{path:"editors.dimension.useNormalSpacing"},{path:"editors.dimension.useInherit"},{path:"editors.dimension.invalidRange",placeholders:[0,1]},{path:"editors.color.placeholder"},{path:"editors.color.ariaValue",placeholders:[0]},{path:"editors.color.ariaOpenPicker",placeholders:[0,1]},{path:"editors.color.ariaPicker",placeholders:[0]},{path:"editors.color.ariaSaturation",placeholders:[0,1]},{path:"editors.color.ariaEyedropper"},{path:"editors.color.ariaHue"},{path:"editors.color.ariaAlphaSlider"},{path:"editors.color.ariaHex"},{path:"editors.color.ariaChannel",placeholders:[0,1,2,3]},{path:"editors.color.ariaAlphaInput"},{path:"editors.color.ariaOpacity",placeholders:[0]},{path:"editors.color.invalidHex"},{path:"editors.color.invalidOpacity"},{path:"editors.color.invalidChannel"},{path:"editors.color.gradientValue"},{path:"editors.color.imageValue"},{path:"editors.color.ariaRecentColors"},{path:"editors.color.ariaApplyRecentColor",placeholders:[0,1]},{path:"editors.fontWeight.options.thin"},{path:"editors.fontWeight.options.extraLight"},{path:"editors.fontWeight.options.light"},{path:"editors.fontWeight.options.regular"},{path:"editors.fontWeight.options.medium"},{path:"editors.fontWeight.options.semiBold"},{path:"editors.fontWeight.options.bold"},{path:"editors.fontWeight.options.extraBold"},{path:"editors.fontWeight.options.black"},{path:"editors.textStyle.options.italic"},{path:"editors.textStyle.options.underline"},{path:"editors.textStyle.options.uppercase"},{path:"editors.textAlignment.options.left"},{path:"editors.textAlignment.options.center"},{path:"editors.textAlignment.options.right"},{path:"editors.textAlignment.options.justify"},{path:"history.changeLimitTitle"},{path:"history.changeLimitBody"}];function hs(e,t){return t.split(".").reduce((o,r)=>{if(o&&typeof o=="object")return o[r]},e)}function vs(e){let t=new Set;for(let o of e.matchAll(/\{(\d+)\}/g))t.add(Number(o[1]));return Array.from(t).sort((o,r)=>o-r)}function xs(e){let t=[];if(!e||typeof e!="object")return["labels is not an object"];for(let o of w2){let{path:r,placeholders:a}=o,n=hs(e,r);if(typeof n!="string"){t.push(`missing or non-string label: ${r}`);continue}if(a){let l=vs(n),i=[...a].sort((u,d)=>u-d);(l.length!==i.length||l.some((u,d)=>u!==i[d]))&&t.push(`placeholder mismatch at ${r}: expected {${i.join(",")}}, got {${l.join(",")}}`)}}return t}var co={px:{min:0,max:1e4,step:1,decimals:1},em:{min:0,max:100,step:.1,decimals:3},rem:{min:0,max:100,step:.1,decimals:3},"%":{min:0,max:1e3,step:1,decimals:2},pt:{min:0,max:1e4,step:1,decimals:1},vw:{min:0,max:100,step:.1,decimals:1},vh:{min:0,max:100,step:.1,decimals:1},vmin:{min:0,max:100,step:.1,decimals:1},vmax:{min:0,max:100,step:.1,decimals:1},ch:{min:0,max:100,step:.1,decimals:1},ex:{min:0,max:100,step:.1,decimals:1},cm:{min:0,max:100,step:.1,decimals:2},mm:{min:0,max:1e3,step:1,decimals:1},in:{min:0,max:50,step:.01,decimals:2},pc:{min:0,max:500,step:1,decimals:0}},Ls=co.px??{min:0,max:1e4,step:1,decimals:0};function fo(e,t=co){return t[e]||Ls}function ws(e,t,o=co){let r=fo(t,o);return Math.min(r.max,Math.max(r.min,e))}function xa(e,t,o=co){if(e===""||e==null||isNaN(e))return"";let r=fo(t,o);return Number(Number(e).toFixed(r.decimals))}function I2(e,t,o,r,a=co){let n=parseFloat(e)||0,l=fo(r,a),i=o?10:1,s=(t==="ArrowUp"?1:-1)*l.step*i,u=ws(n+s,r,a);return String(xa(u,r,a))}var b2=String.raw`[+-]?(?:\d+(?:\.\d*)?|\.\d+)`,Is=new RegExp(`^${b2}$`),y2=new RegExp(`^(${b2})([a-z%]*)$`);function n1(e){return Is.test(e)&&Number.isFinite(Number(e))}var Fo={fontSize:{unit:"px",icon:f2,constraints:{px:{min:1,max:200,step:1,decimals:2}},presets:[8,9,10,11,12,14,18,24,30,36,48,60,72,96]},lineHeight:{unit:"",icon:m2,constraints:{"":{min:.1,max:3,step:.1,decimals:2}},presets:[1,1.2,1.4,1.5,1.6,2],normalLabelKey:"useNormalLineHeight"},letterSpacing:{unit:"em",icon:C2,constraints:{em:{min:-.1,max:.5,step:.01,decimals:3}},presets:[-.05,-.025,0,.025,.05,.1],normalLabelKey:"useNormalSpacing"}};import{jsx as T1,jsxs as po}from"react/jsx-runtime";var R1=["top","right","bottom","left"],bs=["top","right","left","bottom"],No={top:"",right:"",bottom:"",left:""},ys={sides:{top:"Top",right:"Right",bottom:"Bottom",left:"Left"},corners:{topLeft:"Top Left",topRight:"Top Right",bottomRight:"Bottom Right",bottomLeft:"Bottom Left"},allCorners:"All corners",expandCorners:"Show all corners",collapseCorners:"Collapse",matchCornersAndCollapse:"Match all corners and collapse",vertical:"Vertical",horizontal:"Horizontal",expand:"Show all sides",collapse:"Collapse",matchAndCollapse:"Match opposite sides and collapse",collapseUnavailable:"Finish editing and resolve all measurements before collapsing.",measurementUnavailable:"Wait for all side measurements before editing this box.",invalidNumber:"Enter a finite number in pixels.",invalidNonNegative:"Enter a number greater than or equal to 0.",ariaSide:"{0} {1}"};function lt(e){let t=[],o=0,r=0,a=-1,n=e.trim();for(let d=0;d<=n.length;d++){let c=n[d];if(c==="("&&o++,c===")"&&o--,o<0)return{...No};if(c==="/"&&o===0){if(a!==-1)return{...No};a=d}(d===n.length||o===0&&/\s/.test(c??""))&&(d>r&&t.push(n.slice(r,d)),r=d+1)}if(a!==-1){let d=lt(n.slice(0,a)),c=lt(n.slice(a+1));return Object.fromEntries(R1.map(f=>[f,d[f]&&c[f]?d[f]===c[f]?d[f]:`${d[f]} ${c[f]}`:""]))}if(o!==0||t.length===0||t.length>4)return{...No};let[l="",i=l,s=l,u=i]=t;return{top:l,right:i,bottom:s,left:u}}function H2(e){return String(Number(e.toFixed(2)))}var Ms=/^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)px$/i,M2=9999;function S2(e,t){let o=t??lt(e),r={top:null,right:null,bottom:null,left:null},a={...No};for(let n of R1){let l=(o[n]??"").trim(),i=Ms.exec(l)?.[1]??(n1(l)&&Number(l)===0?l:void 0),s=Number(i);if(i!==void 0&&Number.isFinite(s)){let u=Math.max(-M2,Math.min(M2,s));r[n]=s,a[n]=H2(u)}else a[n]=l}return{raw:r,display:a}}function k2(e){return R1.every(t=>e[t]!==null)&&e.top===e.bottom&&e.right===e.left}function Ss(e){return k2(e)&&e.top===e.right}function La(e,t){return t?Ss(e):k2(e)}var R2={top:"top",right:"right",bottom:"top",left:"right"},$o={uniform:{compact:"M1 4V3a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V4",sides:{top:"M1 5V3a2 2 0 0 1 2-2h2",right:"M7 1h2a2 2 0 0 1 2 2v2",bottom:"M11 7v2a2 2 0 0 1-2 2H7",left:"M5 11H3a2 2 0 0 1-2-2V7"}},paired:{compact:{top:"M1 1h10M1 11h10",right:"M1 1v10M11 1v10"},sides:{top:"M1 1h10",right:"M11 1v10",bottom:"M1 11h10",left:"M1 1v10"}}};function Rs(e,t,o){return e?t?$o.uniform.compact:$o.uniform.sides[o]:t?$o.paired.compact[o==="top"?"top":"right"]:$o.paired.sides[o]}function Uo({label:e,displayValue:t,displaySides:o,measurement:r,resetVersion:a,paired:n=!1,uniform:l=!1,onSidesChange:i,id:s,allowNegative:u=!1,sideLabelKind:d="sides",aria:c}){let f=S1.useId(),g=s||f,p=M1(ys,c),h=l||!l&&n&&d==="sides",[w]=S1.useState(()=>S2(t,o)),[v,R]=S1.useState(()=>!La(w.raw,l)),b=S1.useRef(!0),S=h&&!v,[Z,T]=S1.useState(w.display),[L,V]=S1.useState({}),y=S1.useRef({}),H=S1.useRef({...w.display}),q=S1.useRef({...w.raw}),K=S1.useRef({displayValue:t,displaySides:o,measurement:r,resetVersion:a});S1.useEffect(()=>{let m=K.current,x=a!==m.resetVersion,C=(o===void 0?m.displaySides!==void 0||t!==m.displayValue:m.displaySides===void 0||R1.some(N=>o[N]!==m.displaySides?.[N]))||r!==m.measurement;if(K.current={displayValue:t,displaySides:o,measurement:r,resetVersion:a},!x&&!C)return;let $=S2(t,o);H.current=$.display,q.current=$.raw,x&&(y.current={},V({})),T(N=>{let U={...$.display};for(let I of R1)y.current[I]&&(U[I]=N[I]);return U}),La($.raw,l)?b.current&&Object.keys(y.current).length===0&&R(!1):R(!0)},[t,o,r,a,l]);let G=m=>S&&l?R1:S?m==="top"?["top","bottom"]:["right","left"]:[m],J=(m,x)=>{var k;b.current=!1,(k=y.current)[m]??(k[m]={baseline:H.current[m],sides:G(m)}),T(C=>({...C,[m]:x})),V(C=>({...C,[m]:void 0}))},F=m=>{delete y.current[m],V(x=>({...x,[m]:void 0})),T(x=>({...x,[m]:H.current[m]}))},O=(m,x)=>{let k=y.current[m]?.sides??G(m),C=x.trim(),$=y.current[m]?.baseline??H.current[m],N=n1(C);if(C===""||N&&n1($)&&Number(C)===Number($)){F(m);return}if(!N||!u&&Number(C)<0){V(ee=>({...ee,[m]:N?"negative":"number"}));return}let U=Number(C),I={};for(let ee of k)I[ee]=`${U}px`;if(i(I)===!1){V(ee=>({...ee,[m]:"measurement"}));return}b.current=S;let E=H2(U);for(let ee of k)H.current[ee]=E,q.current[ee]=U;delete y.current[m],V(ee=>({...ee,[m]:void 0})),T(ee=>{let ce={...ee};for(let Ce of k)y.current[Ce]||(ce[Ce]=E);return ce})},A=[p.corners.topLeft,p.corners.topRight,p.corners.bottomRight,p.corners.bottomLeft],z=(d==="corners"?bs:R1).filter(m=>!S||m==="top"||!l&&m==="right"),B=`${g}-sides`,j=`${g}-collapse-description`,P=R1.every(m=>q.current[m]!==null)&&Object.keys(y.current).length===0,W=v?La(q.current,l)?l?p.collapseCorners:p.collapse:l?p.matchCornersAndCollapse:p.matchAndCollapse:l?p.expandCorners:p.expand;return po(m1,{label:e,id:g,className:"boxDimensionEditor-fieldset",children:[po("div",{className:`boxDimensionEditor-layout${S?l?" boxDimensionEditor-layout--uniform-compact":" boxDimensionEditor-layout--paired-compact":""}`,children:[T1("div",{id:B,className:"boxDimensionEditor-grid",children:z.map(m=>{let x=R1.indexOf(m),k=S?l?p.allCorners:m==="top"?p.vertical:p.horizontal:d==="corners"?A[x]:p.sides[m],C=Re(p.ariaSide,[e,k??""]),$=`${g}-${m}-error`;return po("div",{className:"boxDimensionEditor-cell",children:[T1("label",{htmlFor:`${g}-${m}`,className:"boxDimensionEditor-label",children:k}),po("div",{className:"boxDimensionEditor-input-row",children:[h&&T1("span",{className:"boxDimensionEditor-input-icon","aria-hidden":"true",title:C,children:po("svg",{width:12,height:12,viewBox:"0 0 12 12",fill:"none",className:"boxDimensionEditor-pair-icon",children:[T1("rect",{x:1,y:1,width:10,height:10,rx:l?2:void 0}),T1("path",{d:Rs(l,S,m)})]})}),T1("input",{id:`${g}-${m}`,type:"text",inputMode:"decimal",className:`boxDimensionEditor-input${h?" boxDimensionEditor-input--with-icon":""}`,value:Z[m],onChange:N=>J(m,N.target.value),onPaste:N=>{N.preventDefault();let U=N.currentTarget;J(m,Z[m].slice(0,U.selectionStart??0)+N.clipboardData.getData("text")+Z[m].slice(U.selectionEnd??Z[m].length))},onBlur:()=>{y.current[m]&&O(m,Z[m])},onKeyDown:N=>{if(N.key==="Enter")y.current[m]&&O(m,Z[m]),N.currentTarget.blur();else if(N.key==="Escape")F(m);else if(N.key==="ArrowUp"||N.key==="ArrowDown"){N.preventDefault(),b.current=!1;let U=y.current[m]?N.currentTarget.value:H.current[m];if(!n1(U.trim()))return;if(!u&&Number(U)<0){O(m,U);return}let I=(N.key==="ArrowUp"?1:-1)*(N.shiftKey?10:1),E=Number(U)+I;O(m,String(u?E:Math.max(0,E)))}},"aria-label":C,"aria-invalid":L[m]?!0:void 0,"aria-describedby":L[m]?$:void 0,autoComplete:"off",spellCheck:"false"})]}),L[m]&&T1("span",{id:$,role:"alert",className:"boxDimensionEditor-error",children:L[m]==="measurement"?p.measurementUnavailable:L[m]==="negative"?p.invalidNonNegative:p.invalidNumber})]},m)})}),h&&T1("button",{type:"button",className:"boxDimensionEditor-expand","aria-label":W,"aria-expanded":v,"aria-controls":B,"aria-disabled":v&&!P?!0:void 0,"aria-describedby":v&&!P?j:void 0,title:v&&!P?p.collapseUnavailable:W,onPointerDown:m=>{v&&!P&&m.preventDefault()},onClick:()=>{if(v){if(!P)return;let m=q.current,x={};for(let k of R1){let C=l?"top":R2[k];m[k]!==m[C]&&(x[k]=`${m[C]}px`)}if(Object.keys(x).length>0&&i(x)===!1)return;for(let k of R1){let C=x[k];C!==void 0&&(m[k]=Number.parseFloat(C),H.current[k]=H.current[l?"top":R2[k]])}T({...H.current})}b.current=v,R(!v)},children:T1(c2,{width:12,height:12,"aria-hidden":"true"})})]}),h&&v&&!P&&T1("span",{id:j,className:"boxDimensionEditor-collapseDescription",children:p.collapseUnavailable})]})}import{forwardRef as ks,createElement as Ps}from"react";var qo=(...e)=>e.filter((t,o,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===o).join(" ").trim();var P2=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();var T2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,r)=>r?r.toUpperCase():o.toLowerCase());var wa=e=>{let t=T2(e);return t.charAt(0).toUpperCase()+t.slice(1)};import{forwardRef as Hs,createElement as D2}from"react";var V2={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var E2=e=>{for(let t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var O2=Hs(({color:e="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:a="",children:n,iconNode:l,...i},s)=>D2("svg",{ref:s,...V2,width:t,height:t,stroke:e,strokeWidth:r?Number(o)*24/Number(t):o,className:qo("lucide",a),...!n&&!E2(i)&&{"aria-hidden":"true"},...i},[...l.map(([u,d])=>D2(u,d)),...Array.isArray(n)?n:[n]]));var _2=(e,t)=>{let o=ks(({className:r,...a},n)=>Ps(O2,{ref:n,iconNode:t,className:qo(`lucide-${P2(wa(e))}`,`lucide-${e}`,r),...a}));return o.displayName=wa(e),o};var Ts=[["path",{d:"m12 9-8.414 8.414A2 2 0 0 0 3 18.828v1.344a2 2 0 0 1-.586 1.414A2 2 0 0 1 3.828 21h1.344a2 2 0 0 0 1.414-.586L15 12",key:"1y3wsu"}],["path",{d:"m18 9 .4.4a1 1 0 1 1-3 3l-3.8-3.8a1 1 0 1 1 3-3l.4.4 3.4-3.4a1 1 0 1 1 3 3z",key:"110lr1"}],["path",{d:"m2 22 .414-.414",key:"jhxm08"}]],Co=_2("pipette",Ts);import be from"react";import{useRef as Go,useCallback as We,useEffect as ka,useMemo as Wo,useState as Pa,createContext as Vs,useContext as Es}from"react";var B2={exports:{}},mo={};var A2;function Ds(){if(A2)return mo;A2=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(r,a,n){var l=null;if(n!==void 0&&(l=""+n),a.key!==void 0&&(l=""+a.key),"key"in a){n={};for(var i in a)i!=="key"&&(n[i]=a[i])}else n=a;return a=n.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:n}}return mo.Fragment=t,mo.jsx=o,mo.jsxs=o,mo}var Z2;function Os(){return Z2||(Z2=1,B2.exports=Ds()),B2.exports}var ke=Os();function G2(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(o=G2(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function _s(){for(var e,t,o=0,r="",a=arguments.length;o<a;o++)(e=arguments[o])&&(t=G2(e))&&(r&&(r+=" "),r+=t);return r}var Ta="-",Bs=e=>{let t=Zs(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{let n=a.split(Ta);return n[0]===""&&n.length!==1&&n.shift(),W2(n,t)||As(a)},getConflictingClassGroupIds:(a,n)=>{let l=o[a]||[];return n&&r[a]?[...l,...r[a]]:l}}},W2=(e,t)=>{if(e.length===0)return t.classGroupId;let o=e[0],r=t.nextPart.get(o),a=r?W2(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;let n=e.join(Ta);return t.validators.find(({validator:l})=>l(n))?.classGroupId},F2=/^\[(.+)\]$/,As=e=>{if(F2.test(e)){let t=F2.exec(e)[1],o=t?.substring(0,t.indexOf(":"));if(o)return"arbitrary.."+o}},Zs=e=>{let{theme:t,classGroups:o}=e,r={nextPart:new Map,validators:[]};for(let a in o)ya(o[a],r,a,t);return r},ya=(e,t,o,r)=>{e.forEach(a=>{if(typeof a=="string"){let n=a===""?t:$2(t,a);n.classGroupId=o;return}if(typeof a=="function"){if(Fs(a)){ya(a(r),t,o,r);return}t.validators.push({validator:a,classGroupId:o});return}Object.entries(a).forEach(([n,l])=>{ya(l,$2(t,n),o,r)})})},$2=(e,t)=>{let o=e;return t.split(Ta).forEach(r=>{o.nextPart.has(r)||o.nextPart.set(r,{nextPart:new Map,validators:[]}),o=o.nextPart.get(r)}),o},Fs=e=>e.isThemeGetter,$s=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=new Map,r=new Map,a=(n,l)=>{o.set(n,l),t++,t>e&&(t=0,r=o,o=new Map)};return{get(n){let l=o.get(n);if(l!==void 0)return l;if((l=r.get(n))!==void 0)return a(n,l),l},set(n,l){o.has(n)?o.set(n,l):a(n,l)}}},Ma="!",Sa=":",Ns=Sa.length,Us=e=>{let{prefix:t,experimentalParseClassName:o}=e,r=a=>{let n=[],l=0,i=0,s=0,u;for(let p=0;p<a.length;p++){let M=a[p];if(l===0&&i===0){if(M===Sa){n.push(a.slice(s,p)),s=p+Ns;continue}if(M==="/"){u=p;continue}}M==="["?l++:M==="]"?l--:M==="("?i++:M===")"&&i--}let d=n.length===0?a:a.substring(s),c=qs(d),f=c!==d,g=u&&u>s?u-s:void 0;return{modifiers:n,hasImportantModifier:f,baseClassName:c,maybePostfixModifierPosition:g}};if(t){let a=t+Sa,n=r;r=l=>l.startsWith(a)?n(l.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(o){let a=r;r=n=>o({className:n,parseClassName:a})}return r},qs=e=>e.endsWith(Ma)?e.substring(0,e.length-1):e.startsWith(Ma)?e.substring(1):e,zs=e=>{let t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;let r=[],a=[];return o.forEach(n=>{n[0]==="["||t[n]?(r.push(...a.sort(),n),a=[]):a.push(n)}),r.push(...a.sort()),r}},js=e=>({cache:$s(e.cacheSize),parseClassName:Us(e),sortModifiers:zs(e),...Bs(e)}),Ks=/\s+/,Gs=(e,t)=>{let{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:n}=t,l=[],i=e.trim().split(Ks),s="";for(let u=i.length-1;u>=0;u-=1){let d=i[u],{isExternal:c,modifiers:f,hasImportantModifier:g,baseClassName:p,maybePostfixModifierPosition:M}=o(d);if(c){s=d+(s.length>0?" "+s:s);continue}let h=!!M,w=r(h?p.substring(0,M):p);if(!w){if(!h){s=d+(s.length>0?" "+s:s);continue}if(w=r(p),!w){s=d+(s.length>0?" "+s:s);continue}h=!1}let v=n(f).join(":"),R=g?v+Ma:v,b=R+w;if(l.includes(b))continue;l.push(b);let S=a(w,h);for(let Z=0;Z<S.length;++Z){let T=S[Z];l.push(R+T)}s=d+(s.length>0?" "+s:s)}return s};function Ws(){let e=0,t,o,r="";for(;e<arguments.length;)(t=arguments[e++])&&(o=X2(t))&&(r&&(r+=" "),r+=o);return r}var X2=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=X2(e[r]))&&(o&&(o+=" "),o+=t);return o};function Xs(e,...t){let o,r,a,n=l;function l(s){let u=t.reduce((d,c)=>c(d),e());return o=js(u),r=o.cache.get,a=o.cache.set,n=i,i(s)}function i(s){let u=r(s);if(u)return u;let d=Gs(s,o);return a(s,d),d}return function(){return n(Ws.apply(null,arguments))}}var Be=e=>{let t=o=>o[e]||[];return t.isThemeGetter=!0,t},Q2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Y2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Qs=/^\d+\/\d+$/,Ys=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Js=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eu=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,tu=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ou=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,$t=e=>Qs.test(e),de=e=>!!e&&!Number.isNaN(Number(e)),it=e=>!!e&&Number.isInteger(Number(e)),Ia=e=>e.endsWith("%")&&de(e.slice(0,-1)),N1=e=>Ys.test(e),ru=()=>!0,au=e=>Js.test(e)&&!eu.test(e),J2=()=>!1,nu=e=>tu.test(e),lu=e=>ou.test(e),iu=e=>!X(e)&&!Q(e),su=e=>Nt(e,o9,J2),X=e=>Q2.test(e),kt=e=>Nt(e,r9,au),ba=e=>Nt(e,pu,de),N2=e=>Nt(e,e9,J2),uu=e=>Nt(e,t9,lu),zo=e=>Nt(e,a9,nu),Q=e=>Y2.test(e),go=e=>Ut(e,r9),du=e=>Ut(e,Cu),U2=e=>Ut(e,e9),cu=e=>Ut(e,o9),fu=e=>Ut(e,t9),jo=e=>Ut(e,a9,!0),Nt=(e,t,o)=>{let r=Q2.exec(e);return r?r[1]?t(r[1]):o(r[2]):!1},Ut=(e,t,o=!1)=>{let r=Y2.exec(e);return r?r[1]?t(r[1]):o:!1},e9=e=>e==="position"||e==="percentage",t9=e=>e==="image"||e==="url",o9=e=>e==="length"||e==="size"||e==="bg-size",r9=e=>e==="length",pu=e=>e==="number",Cu=e=>e==="family-name",a9=e=>e==="shadow",mu=()=>{let e=Be("color"),t=Be("font"),o=Be("text"),r=Be("font-weight"),a=Be("tracking"),n=Be("leading"),l=Be("breakpoint"),i=Be("container"),s=Be("spacing"),u=Be("radius"),d=Be("shadow"),c=Be("inset-shadow"),f=Be("text-shadow"),g=Be("drop-shadow"),p=Be("blur"),M=Be("perspective"),h=Be("aspect"),w=Be("ease"),v=Be("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],S=()=>[...b(),Q,X],Z=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto","contain","none"],L=()=>[Q,X,s],V=()=>[$t,"full","auto",...L()],y=()=>[it,"none","subgrid",Q,X],H=()=>["auto",{span:["full",it,Q,X]},it,Q,X],q=()=>[it,"auto",Q,X],K=()=>["auto","min","max","fr",Q,X],G=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],J=()=>["start","end","center","stretch","center-safe","end-safe"],F=()=>["auto",...L()],O=()=>[$t,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],A=()=>[e,Q,X],z=()=>[...b(),U2,N2,{position:[Q,X]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],j=()=>["auto","cover","contain",cu,su,{size:[Q,X]}],P=()=>[Ia,go,kt],W=()=>["","none","full",u,Q,X],m=()=>["",de,go,kt],x=()=>["solid","dashed","dotted","double"],k=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>[de,Ia,U2,N2],$=()=>["","none",p,Q,X],N=()=>["none",de,Q,X],U=()=>["none",de,Q,X],I=()=>[de,Q,X],E=()=>[$t,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[N1],breakpoint:[N1],color:[ru],container:[N1],"drop-shadow":[N1],ease:["in","out","in-out"],font:[iu],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[N1],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[N1],shadow:[N1],spacing:["px",de],text:[N1],"text-shadow":[N1],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",$t,X,Q,h]}],container:["container"],columns:[{columns:[de,X,Q,i]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:S()}],overflow:[{overflow:Z()}],"overflow-x":[{"overflow-x":Z()}],"overflow-y":[{"overflow-y":Z()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{start:V()}],end:[{end:V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[it,"auto",Q,X]}],basis:[{basis:[$t,"full","auto",i,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[de,$t,"auto","initial","none",X]}],grow:[{grow:["",de,Q,X]}],shrink:[{shrink:["",de,Q,X]}],order:[{order:[it,"first","last","none",Q,X]}],"grid-cols":[{"grid-cols":y()}],"col-start-end":[{col:H()}],"col-start":[{"col-start":q()}],"col-end":[{"col-end":q()}],"grid-rows":[{"grid-rows":y()}],"row-start-end":[{row:H()}],"row-start":[{"row-start":q()}],"row-end":[{"row-end":q()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":K()}],"auto-rows":[{"auto-rows":K()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...G(),"normal"]}],"justify-items":[{"justify-items":[...J(),"normal"]}],"justify-self":[{"justify-self":["auto",...J()]}],"align-content":[{content:["normal",...G()]}],"align-items":[{items:[...J(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...J(),{baseline:["","last"]}]}],"place-content":[{"place-content":G()}],"place-items":[{"place-items":[...J(),"baseline"]}],"place-self":[{"place-self":["auto",...J()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:F()}],mx:[{mx:F()}],my:[{my:F()}],ms:[{ms:F()}],me:[{me:F()}],mt:[{mt:F()}],mr:[{mr:F()}],mb:[{mb:F()}],ml:[{ml:F()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:O()}],w:[{w:[i,"screen",...O()]}],"min-w":[{"min-w":[i,"screen","none",...O()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[l]},...O()]}],h:[{h:["screen","lh",...O()]}],"min-h":[{"min-h":["screen","lh","none",...O()]}],"max-h":[{"max-h":["screen","lh",...O()]}],"font-size":[{text:["base",o,go,kt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Q,ba]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ia,X]}],"font-family":[{font:[du,X,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Q,X]}],"line-clamp":[{"line-clamp":[de,"none",Q,ba]}],leading:[{leading:[n,...L()]}],"list-image":[{"list-image":["none",Q,X]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Q,X]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:A()}],"text-color":[{text:A()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...x(),"wavy"]}],"text-decoration-thickness":[{decoration:[de,"from-font","auto",Q,kt]}],"text-decoration-color":[{decoration:A()}],"underline-offset":[{"underline-offset":[de,"auto",Q,X]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q,X]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Q,X]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:z()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:j()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},it,Q,X],radial:["",Q,X],conic:[it,Q,X]},fu,uu]}],"bg-color":[{bg:A()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:A()}],"gradient-via":[{via:A()}],"gradient-to":[{to:A()}],rounded:[{rounded:W()}],"rounded-s":[{"rounded-s":W()}],"rounded-e":[{"rounded-e":W()}],"rounded-t":[{"rounded-t":W()}],"rounded-r":[{"rounded-r":W()}],"rounded-b":[{"rounded-b":W()}],"rounded-l":[{"rounded-l":W()}],"rounded-ss":[{"rounded-ss":W()}],"rounded-se":[{"rounded-se":W()}],"rounded-ee":[{"rounded-ee":W()}],"rounded-es":[{"rounded-es":W()}],"rounded-tl":[{"rounded-tl":W()}],"rounded-tr":[{"rounded-tr":W()}],"rounded-br":[{"rounded-br":W()}],"rounded-bl":[{"rounded-bl":W()}],"border-w":[{border:m()}],"border-w-x":[{"border-x":m()}],"border-w-y":[{"border-y":m()}],"border-w-s":[{"border-s":m()}],"border-w-e":[{"border-e":m()}],"border-w-t":[{"border-t":m()}],"border-w-r":[{"border-r":m()}],"border-w-b":[{"border-b":m()}],"border-w-l":[{"border-l":m()}],"divide-x":[{"divide-x":m()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":m()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...x(),"hidden","none"]}],"divide-style":[{divide:[...x(),"hidden","none"]}],"border-color":[{border:A()}],"border-color-x":[{"border-x":A()}],"border-color-y":[{"border-y":A()}],"border-color-s":[{"border-s":A()}],"border-color-e":[{"border-e":A()}],"border-color-t":[{"border-t":A()}],"border-color-r":[{"border-r":A()}],"border-color-b":[{"border-b":A()}],"border-color-l":[{"border-l":A()}],"divide-color":[{divide:A()}],"outline-style":[{outline:[...x(),"none","hidden"]}],"outline-offset":[{"outline-offset":[de,Q,X]}],"outline-w":[{outline:["",de,go,kt]}],"outline-color":[{outline:A()}],shadow:[{shadow:["","none",d,jo,zo]}],"shadow-color":[{shadow:A()}],"inset-shadow":[{"inset-shadow":["none",c,jo,zo]}],"inset-shadow-color":[{"inset-shadow":A()}],"ring-w":[{ring:m()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:A()}],"ring-offset-w":[{"ring-offset":[de,kt]}],"ring-offset-color":[{"ring-offset":A()}],"inset-ring-w":[{"inset-ring":m()}],"inset-ring-color":[{"inset-ring":A()}],"text-shadow":[{"text-shadow":["none",f,jo,zo]}],"text-shadow-color":[{"text-shadow":A()}],opacity:[{opacity:[de,Q,X]}],"mix-blend":[{"mix-blend":[...k(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":k()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[de]}],"mask-image-linear-from-pos":[{"mask-linear-from":C()}],"mask-image-linear-to-pos":[{"mask-linear-to":C()}],"mask-image-linear-from-color":[{"mask-linear-from":A()}],"mask-image-linear-to-color":[{"mask-linear-to":A()}],"mask-image-t-from-pos":[{"mask-t-from":C()}],"mask-image-t-to-pos":[{"mask-t-to":C()}],"mask-image-t-from-color":[{"mask-t-from":A()}],"mask-image-t-to-color":[{"mask-t-to":A()}],"mask-image-r-from-pos":[{"mask-r-from":C()}],"mask-image-r-to-pos":[{"mask-r-to":C()}],"mask-image-r-from-color":[{"mask-r-from":A()}],"mask-image-r-to-color":[{"mask-r-to":A()}],"mask-image-b-from-pos":[{"mask-b-from":C()}],"mask-image-b-to-pos":[{"mask-b-to":C()}],"mask-image-b-from-color":[{"mask-b-from":A()}],"mask-image-b-to-color":[{"mask-b-to":A()}],"mask-image-l-from-pos":[{"mask-l-from":C()}],"mask-image-l-to-pos":[{"mask-l-to":C()}],"mask-image-l-from-color":[{"mask-l-from":A()}],"mask-image-l-to-color":[{"mask-l-to":A()}],"mask-image-x-from-pos":[{"mask-x-from":C()}],"mask-image-x-to-pos":[{"mask-x-to":C()}],"mask-image-x-from-color":[{"mask-x-from":A()}],"mask-image-x-to-color":[{"mask-x-to":A()}],"mask-image-y-from-pos":[{"mask-y-from":C()}],"mask-image-y-to-pos":[{"mask-y-to":C()}],"mask-image-y-from-color":[{"mask-y-from":A()}],"mask-image-y-to-color":[{"mask-y-to":A()}],"mask-image-radial":[{"mask-radial":[Q,X]}],"mask-image-radial-from-pos":[{"mask-radial-from":C()}],"mask-image-radial-to-pos":[{"mask-radial-to":C()}],"mask-image-radial-from-color":[{"mask-radial-from":A()}],"mask-image-radial-to-color":[{"mask-radial-to":A()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[de]}],"mask-image-conic-from-pos":[{"mask-conic-from":C()}],"mask-image-conic-to-pos":[{"mask-conic-to":C()}],"mask-image-conic-from-color":[{"mask-conic-from":A()}],"mask-image-conic-to-color":[{"mask-conic-to":A()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:z()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:j()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Q,X]}],filter:[{filter:["","none",Q,X]}],blur:[{blur:$()}],brightness:[{brightness:[de,Q,X]}],contrast:[{contrast:[de,Q,X]}],"drop-shadow":[{"drop-shadow":["","none",g,jo,zo]}],"drop-shadow-color":[{"drop-shadow":A()}],grayscale:[{grayscale:["",de,Q,X]}],"hue-rotate":[{"hue-rotate":[de,Q,X]}],invert:[{invert:["",de,Q,X]}],saturate:[{saturate:[de,Q,X]}],sepia:[{sepia:["",de,Q,X]}],"backdrop-filter":[{"backdrop-filter":["","none",Q,X]}],"backdrop-blur":[{"backdrop-blur":$()}],"backdrop-brightness":[{"backdrop-brightness":[de,Q,X]}],"backdrop-contrast":[{"backdrop-contrast":[de,Q,X]}],"backdrop-grayscale":[{"backdrop-grayscale":["",de,Q,X]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[de,Q,X]}],"backdrop-invert":[{"backdrop-invert":["",de,Q,X]}],"backdrop-opacity":[{"backdrop-opacity":[de,Q,X]}],"backdrop-saturate":[{"backdrop-saturate":[de,Q,X]}],"backdrop-sepia":[{"backdrop-sepia":["",de,Q,X]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Q,X]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[de,"initial",Q,X]}],ease:[{ease:["linear","initial",w,Q,X]}],delay:[{delay:[de,Q,X]}],animate:[{animate:["none",v,Q,X]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[M,Q,X]}],"perspective-origin":[{"perspective-origin":S()}],rotate:[{rotate:N()}],"rotate-x":[{"rotate-x":N()}],"rotate-y":[{"rotate-y":N()}],"rotate-z":[{"rotate-z":N()}],scale:[{scale:U()}],"scale-x":[{"scale-x":U()}],"scale-y":[{"scale-y":U()}],"scale-z":[{"scale-z":U()}],"scale-3d":["scale-3d"],skew:[{skew:I()}],"skew-x":[{"skew-x":I()}],"skew-y":[{"skew-y":I()}],transform:[{transform:[Q,X,"","none","gpu","cpu"]}],"transform-origin":[{origin:S()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:E()}],"translate-x":[{"translate-x":E()}],"translate-y":[{"translate-y":E()}],"translate-z":[{"translate-z":E()}],"translate-none":["translate-none"],accent:[{accent:A()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:A()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Q,X]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Q,X]}],fill:[{fill:["none",...A()]}],"stroke-w":[{stroke:[de,go,kt,ba]}],stroke:[{stroke:["none",...A()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},gu=Xs(mu),hu=(e,t,o)=>Math.min(Math.max(e,t),o),Ko=e=>Math.round(hu(e,0,255)),n9=e=>{let t=e.replace("#",""),o=parseInt(t,16);return{r:o>>16&255,g:o>>8&255,b:o&255}},vu=({r:e,g:t,b:o})=>{let r=a=>Ko(a).toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(o)}`},Ra=({h:e,s:t,v:o})=>{e=e/360,t=t/100,o=o/100;let r=Math.floor(e*6),a=e*6-r,n=o*(1-t),l=o*(1-a*t),i=o*(1-(1-a)*t),s,u,d;switch(r%6){case 0:s=o,u=i,d=n;break;case 1:s=l,u=o,d=n;break;case 2:s=n,u=o,d=i;break;case 3:s=n,u=l,d=o;break;case 4:s=i,u=n,d=o;break;case 5:s=o,u=n,d=l;break;default:s=u=d=0}return{r:Ko(s*255),g:Ko(u*255),b:Ko(d*255)}},Ha=({r:e,g:t,b:o})=>{e/=255,t/=255,o/=255;let r=Math.max(e,t,o),a=Math.min(e,t,o),n=r-a,l=0,i=r===0?0:n/r,s=r;if(n!==0)switch(r){case e:l=((t-o)/n+(t<o?6:0))/6;break;case t:l=((o-e)/n+2)/6;break;case o:l=((e-t)/n+4)/6;break}return{h:Math.round(l*360),s:Math.round(i*100),v:Math.round(s*100)}},xu=e=>vu(Ra(e)),Lu=e=>Ha(n9(e));var q2=({h:e,s:t,v:o})=>{let r=o*(2-t/100)/2,a=r!==0&&r!==100?(o-r)/Math.min(r,100-r)*100:0;return{h:e,s:Math.round(a),l:Math.round(r)}},z2=({h:e,s:t,l:o})=>{let r=o+t*Math.min(o,100-o)/100,a=r===0?0:2*(1-o/r)*100;return{h:e,s:Math.round(a),v:Math.round(r)}},wu=e=>{let{r:t,g:o,b:r}=n9(e);return(.299*t+.587*o+.114*r)/255>.5?"#000000":"#ffffff"};var Iu=(e,t="hex")=>{switch(t){case"hex":return e.getHex();case"rgb":let o=e.getRgb();return`rgb(${o.r}, ${o.g}, ${o.b})`;case"rgba":let r=e.getRgba();return`rgba(${r.r}, ${r.g}, ${r.b}, ${r.a})`;case"hsl":let a=e.getHsl();return`hsl(${a.h}, ${a.s}%, ${a.l}%)`;case"hsla":let n=e.getHsla();return`hsla(${n.h}, ${n.s}%, ${n.l}%, ${n.a})`;default:Xo()}};function bu(e){switch(e.type){case"hex":return{...Lu(e.value),a:1};case"rgb":return{...Ha(e),a:1};case"rgba":return{...Ha(e),a:e.a};case"hsl":return{...z2(e),a:1};case"hsla":return{...z2(e),a:1};case"hsv":return{...e,a:1};case"hsva":return{...e};default:Xo()}}function st(e,t){let o=bu(e);switch(t){case"hex":return xu(o);case"rgb":return Ra(o);case"rgba":return{...Ra(o),a:o.a};case"hsl":return q2(o);case"hsla":return{...q2(o),a:o.a};case"hsv":return{h:o.h,s:o.s,v:o.v};case"hsva":return o;default:Xo()}}var Pt=(...e)=>gu(_s(e)),U1=(e,t,o)=>Math.min(Math.max(e,t),o),ut=e=>Math.round(e);function Xo(e){throw new Error("You should never get here.")}var dt=class e{constructor(t){this.colorInput=t,typeof t=="string"?this.color={type:"hex",value:t}:"type"in t?this.color=t:"r"in t?"a"in t?this.color={type:"rgba",...t}:this.color={type:"rgb",...t}:"v"in t?"a"in t?this.color={type:"hsva",...t}:this.color={type:"hsv",...t}:"a"in t?this.color={type:"hsla",...t}:this.color={type:"hsl",...t}}getRgb(){return st(this.color,"rgb")}getHsv(){return st(this.color,"hsv")}getHsla(){return st(this.color,"hsla")}getHsva(){return st(this.color,"hsva")}getHex(){return st(this.color,"hex")}getHsl(){return st(this.color,"hsl")}getRgba(){return st(this.color,"rgba")}format(t="hex"){return Iu(this,t)}getContrastingColor(){return new e({type:"hex",value:wu(this.getHex())})}},j2=(e,t)=>{let o=e.getBoundingClientRect(),r,a;if("touches"in t){let u=t.touches[0]||t.changedTouches[0];r=u.clientX,a=u.clientY}else r=t.clientX,a=t.clientY;let n=r-o.left,l=a-o.top,i=U1(n/o.width,0,1),s=U1(l/o.height,0,1);return{left:i,top:s}},Va=({onMove:e,onMoveEnd:t,onKey:o,children:r,className:a,...n})=>{let l=Go(null),i=Go(!1),s=We(f=>{!i.current||!l.current||(f.preventDefault(),e(j2(l.current,f)))},[e]),u=We(()=>{i.current=!1,t(),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",u)},[s,t]),d=We(f=>{let g=l.current;g&&(f.preventDefault(),i.current=!0,e(j2(g,f.nativeEvent)),document.addEventListener("mousemove",s),document.addEventListener("mouseup",u),document.addEventListener("touchmove",s,{passive:!1}),document.addEventListener("touchend",u))},[e,s,u]),c=We(f=>{if(!o)return;let g=f.which||f.keyCode;g<37||g>40||(f.preventDefault(),o({left:g===39?.05:g===37?-.05:0,top:g===40?.05:g===38?-.05:0}))},[o]);return ka(()=>()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.removeEventListener("touchmove",s),document.removeEventListener("touchend",u)},[s,u]),ke.jsx("div",{ref:l,className:Pt("rounded-inherit absolute inset-0 touch-none outline-none","focus:[&_.react-colorful-pointer]:scale-110",a),onTouchStart:d,onMouseDown:d,onKeyDown:c,tabIndex:0,role:"slider",...n,children:r})},Ea=({className:e,top:t=.5,left:o,color:r})=>ke.jsx("div",{className:Pt("absolute z-[1] h-6 w-6 -translate-x-1/2 -translate-y-1/2 cursor-grab rounded-full border-2 border-white bg-white active:cursor-grabbing","react-colorful-pointer shadow-[0_2px_8px_rgba(0,0,0,0.15)] transition-transform",e),style:{top:`${t*100}%`,left:`${o*100}%`}}),yu=({hsva:e,onChange:t,className:o,onFinishedUpdates:r})=>{let a=We(s=>{t({a:s.left},!1)},[t]),n=We(s=>{t({a:U1(e.a+s.left,0,1)},!0)},[e.a,t]),l=Wo(()=>new dt({type:"hsva",h:e.h,s:e.s,v:e.v,a:0}).format("hsla"),[e.h,e.s,e.v]),i=Wo(()=>new dt({type:"hsva",h:e.h,s:e.s,v:e.v,a:1}).format("hsla"),[e.h,e.s,e.v]);return ke.jsx("div",{className:Pt("relative h-full w-full",o),children:ke.jsxs(Va,{onMove:a,onMoveEnd:r,onKey:n,"aria-label":"Alpha","aria-valuetext":`${ut(e.a*100)}%`,"aria-valuenow":ut(e.a*100),"aria-valuemin":0,"aria-valuemax":100,className:"h-full w-full rounded-lg",children:[ke.jsx("div",{className:"absolute inset-0 rounded-lg bg-white",style:{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><rect x="8" width="8" height="8"/><rect y="8" width="8" height="8"/></svg>')`}}),ke.jsx("div",{className:"absolute inset-0 rounded-lg",style:{backgroundImage:`linear-gradient(90deg, ${l}, ${i})`}}),ke.jsx(Ea,{className:"z-[1]",top:.5,left:e.a,color:""})]})})},Mu=({hue:e,onChange:t,className:o,onFinishedUpdates:r})=>{let a=We(l=>{let i=ut(U1(360*l.left,0,360));t({h:i},!1)},[t]),n=We(l=>{t({h:U1(e+l.left*360,0,360)},!0)},[e,t]);return ke.jsx("div",{className:Pt("relative h-full w-full",o),children:ke.jsxs(Va,{onMove:a,onMoveEnd:r,onKey:n,"aria-label":"Hue","aria-valuenow":ut(e),"aria-valuemax":360,"aria-valuemin":0,className:"h-full w-full rounded-lg",children:[ke.jsx("div",{className:"absolute inset-0 rounded-lg",style:{background:"linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%)"}}),ke.jsx(Ea,{className:"z-[2]",top:.5,left:e/360,color:""})]})})},Su=({hsva:e,onChange:t,className:o,onFinishedUpdates:r})=>{let a=We(i=>{let s=ut(U1(i.left*100,0,100)),u=ut(U1(100-i.top*100,0,100));t({s,v:u},!1)},[t]),n=We(i=>{t({s:U1(e.s+i.left*100,0,100),v:U1(e.v-i.top*100,0,100)},!0)},[e.s,e.v,t]),l=`hsl(${e.h}, 100%, 50%)`;return ke.jsx("div",{className:Pt("relative h-full w-full rounded-xl",o),children:ke.jsxs(Va,{onMove:a,onMoveEnd:r,onKey:n,"aria-label":"Color","aria-valuetext":`Saturation ${ut(e.s)}%, Brightness ${ut(e.v)}%`,className:"rounded-inherit h-full w-full",children:[ke.jsx("div",{className:"rounded-inherit absolute inset-0 rounded-b-none",style:{backgroundColor:l,backgroundImage:"linear-gradient(to top, #000, rgba(0, 0, 0, 0)), linear-gradient(to right, #fff, rgba(255, 255, 255, 0))",boxShadow:"inset 0 0 0 1px rgba(0, 0, 0, 0.05)"}}),ke.jsx(Ea,{className:"z-[3]",top:1-e.v/100,left:e.s/100,color:""})]})})},l9=Vs(null),Qo=()=>{let e=Es(l9);if(!e)throw new Error("ColorPicker compound components must be used within a ColorPicker");return e};function K2(e){return"type"in e?new dt(e):e}var Ru=({color:e,onChange:t,className:o,children:r,defaultColor:a,...n})=>{let[l,i]=Pa(K2(e??a??{h:340,s:58,v:100,a:1,type:"hsva"})),s=Go(!1),u=Go(l);ka(()=>{!s.current&&e&&(u.current=K2(e),i(u.current))},[e]);let d=We((p,M)=>{let h=new dt({type:"hsva",...u.current.getHsva(),...p});u.current=h,i(h),s.current=!M,t?.(h)},[t]),c=We(()=>{s.current=!1},[]),f=We(async()=>{if(!("EyeDropper"in window)){console.log("EyeDropper API not supported");return}try{let p=await new window.EyeDropper().open();p.sRGBHex&&d(st({type:"hex",value:p.sRGBHex},"hsva"),!0)}catch(p){console.log("EyeDropper cancelled or failed:",p)}},[t]),g={hsva:l.getHsva(),updateHsva:d,handleEyeDropper:f,onFinishedUpdates:c};return ke.jsx(l9.Provider,{value:g,children:ke.jsx("div",{...n,className:Pt("relative flex h-[280px] w-[280px] cursor-default flex-col rounded-2xl bg-white shadow-lg select-none",o),children:r})})},Hu=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:r}=Qo(),a=We((n,l)=>{o(n,l)},[o]);return ke.jsx(Su,{hsva:t,onChange:a,className:e,onFinishedUpdates:r})},ku=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:r}=Qo(),a=We((n,l)=>{o(n,l)},[o]);return ke.jsx(Mu,{hue:t.h,onChange:a,className:e,onFinishedUpdates:r})},Pu=({className:e})=>{let{hsva:t,updateHsva:o,onFinishedUpdates:r}=Qo(),a=We((n,l)=>{o(n,l)},[o]);return ke.jsx(yu,{hsva:t,onChange:a,className:e,onFinishedUpdates:r})},Tu=({className:e,title:t="Pick color from screen",children:o})=>{let{handleEyeDropper:r}=Qo(),[a,n]=Pa(!1);return ka(()=>{typeof window<"u"&&"EyeDropper"in window&&n(!0)},[]),a?ke.jsx("button",{onClick:r,className:Pt("flex h-10 w-10 flex-shrink-0 cursor-pointer items-center justify-center rounded-lg transition-colors hover:bg-gray-100",e),title:t,children:o}):null},qt=Object.assign(Ru,{Saturation:Hu,Hue:ku,Alpha:Pu,EyeDropper:Tu});function Vu(e,t){switch(t){case"hex":return{type:"hex",value:e.getHex()};case"rgb":return{type:"rgb",...e.getRgb()};case"rgba":return{type:"rgba",...e.getRgba()};case"hsl":return{type:"hsl",...e.getHsl()};case"hsla":return{type:"hsla",...e.getHsla()};case"hsv":return{type:"hsv",...e.getHsv()};case"hsva":return{type:"hsva",...e.getHsva()};default:Xo()}}var i9=(e={type:"hex",value:"#ff6b9d"})=>{let[t,o]=Pa(()=>{let l=typeof e=="function"?e():e;return{color:new dt(l),type:l.type}}),r=Wo(()=>Vu(t.color,t.type),[t.color,t.type]),a=Wo(()=>{let l=t.color.getHsva();return{hex:t.color.getHex(),rgb:t.color.getRgb(),rgba:t.color.getRgba(),hsl:t.color.getHsl(),hsla:t.color.getHsla(),hsv:t.color.getHsv(),hsva:l,alpha:l.a}},[t.color]),n=We(l=>{try{let i="type"in l?new dt(l):l;o(s=>({color:i,type:s.type}))}catch(i){console.warn("Invalid color input:",l,i)}},[]);return[{colorInput:r,colorState:a},n]};import{createPortal as _0}from"react-dom";import{useRef as H1,useMemo as Eu,useEffect as Du,useState as kf,useCallback as Pf}from"react";function s9(e,t,o,r){var a=this,n=H1(null),l=H1(0),i=H1(0),s=H1(null),u=H1([]),d=H1(),c=H1(),f=H1(e),g=H1(!0),p=H1(),M=H1();f.current=e;var h=typeof window<"u",w=!t&&t!==0&&h;if(typeof e!="function")throw new TypeError("Expected a function");t=+t||0;var v=!!(o=o||{}).leading,R=!("trailing"in o)||!!o.trailing,b=!!o.flushOnExit&&R,S="maxWait"in o,Z="debounceOnServer"in o&&!!o.debounceOnServer,T=S?Math.max(+o.maxWait||0,t):null,L=Eu(function(){var V=function(F){var O=u.current,A=d.current;return u.current=d.current=null,l.current=F,i.current=i.current||F,c.current=f.current.apply(A,O)},y=function(F,O){w&&cancelAnimationFrame(s.current),s.current=w?requestAnimationFrame(F):setTimeout(F,O)},H=function(F){if(!g.current)return!1;var O=F-n.current;return!n.current||O>=t||O<0||S&&F-l.current>=T},q=function(F){return s.current=null,R&&u.current?V(F):(u.current=d.current=null,c.current)},K=function F(){var O=Date.now();if(v&&i.current===l.current&&G(),H(O))return q(O);if(g.current){var A=t-(O-n.current),z=S?Math.min(A,T-(O-l.current)):A;y(F,z)}},G=function(){r&&r({})},J=function(){if(h||Z){var F,O=Date.now(),A=H(O);if(u.current=[].slice.call(arguments),d.current=a,n.current=O,b&&!p.current&&(p.current=function(){var z;((z=globalThis.document)==null?void 0:z.visibilityState)==="hidden"&&M.current.flush()},(F=globalThis.document)==null||F.addEventListener==null||F.addEventListener("visibilitychange",p.current)),A){if(!s.current&&g.current)return l.current=n.current,y(K,t),v?V(n.current):c.current;if(S)return y(K,t),V(n.current)}return s.current||y(K,t),c.current}};return J.cancel=function(){var F=s.current;F&&(w?cancelAnimationFrame(s.current):clearTimeout(s.current)),l.current=0,u.current=n.current=d.current=s.current=null,F&&r&&r({})},J.isPending=function(){return!!s.current},J.flush=function(){return s.current?q(Date.now()):c.current},J},[v,S,t,T,R,b,w,h,Z,r]);return M.current=L,Du(function(){return g.current=!0,function(){var V;b&&M.current.flush(),p.current&&((V=globalThis.document)==null||V.removeEventListener==null||V.removeEventListener("visibilitychange",p.current),p.current=null),g.current=!1}},[b]),L}import o1 from"react";function q1(e){let t=e?.parentNode;for(;t;){if(t instanceof ShadowRoot){t=t.host;continue}if(t instanceof HTMLElement){let{overflowY:o}=getComputedStyle(t);if(o==="auto"||o==="scroll")return t}t=t.parentNode}return null}var u9='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function Yo({computePosition:e,onClose:t,autoFocus:o=!0,trapFocus:r=!1,restoreFocusOnOutside:a=!0}={}){let[n,l]=o1.useState(!1),[i,s]=o1.useState({top:0,left:0}),u=o1.useRef(null),d=o1.useRef(null),c=o1.useRef(!1),f=o1.useRef(e);f.current=e;let g=o1.useRef(t);g.current=t;let p=o1.useRef(r);p.current=r;let M=o1.useCallback((...R)=>{!u.current||!f.current||s(f.current(u.current,...R))},[]),h=o1.useCallback(()=>{M(),c.current=!0,l(!0)},[M]),w=o1.useCallback((R=!0)=>{g.current&&g.current(),c.current=!1,l(!1),R&&u.current?.focus()},[]),v=o1.useCallback(()=>{c.current?w():h()},[h,w]);return o1.useEffect(()=>{if(!n)return;let R=S=>{if(S.key==="Escape"&&(S.preventDefault(),w()),p.current&&S.key==="Tab"){let Z=d.current;if(!Z)return;let T=Array.from(Z.querySelectorAll(u9)).filter(y=>!y.hasAttribute("disabled")),L=T[0],V=T.at(-1);if(!L||!V)return;S.shiftKey&&document.activeElement===L?(S.preventDefault(),V.focus()):!S.shiftKey&&document.activeElement===V&&(S.preventDefault(),L.focus())}},b=S=>{let Z=d.current,T=u.current;if(!Z||!T)return;let L=typeof S.composedPath=="function"?S.composedPath():[],V=L.includes(Z)||S.target instanceof Node&&Z.contains(S.target),y=L.includes(T)||S.target instanceof Node&&T.contains(S.target);!V&&!y&&w(a)};return document.addEventListener("keydown",R),document.addEventListener("mousedown",b),document.addEventListener("touchstart",b),()=>{document.removeEventListener("keydown",R),document.removeEventListener("mousedown",b),document.removeEventListener("touchstart",b)}},[n,w,a]),o1.useEffect(()=>{if(!n||!o||!d.current)return;let R=d.current.querySelector(u9);R&&R.focus()},[n,o]),o1.useEffect(()=>{if(!n||!u.current)return;let R=q1(u.current);if(!R)return;let b=()=>w();return R.addEventListener("scroll",b,{passive:!0}),()=>R.removeEventListener("scroll",b)},[n,w]),{isOpen:n,open:h,close:w,toggle:v,triggerRef:u,popoverRef:d,position:i,reposition:M}}var Ou=(e,t)=>{if(typeof e=="number"){if(t===3)return{mode:"rgb",r:(e>>8&15|e>>4&240)/255,g:(e>>4&15|e&240)/255,b:(e&15|e<<4&240)/255};if(t===4)return{mode:"rgb",r:(e>>12&15|e>>8&240)/255,g:(e>>8&15|e>>4&240)/255,b:(e>>4&15|e&240)/255,alpha:(e&15|e<<4&240)/255};if(t===6)return{mode:"rgb",r:(e>>16&255)/255,g:(e>>8&255)/255,b:(e&255)/255};if(t===8)return{mode:"rgb",r:(e>>24&255)/255,g:(e>>16&255)/255,b:(e>>8&255)/255,alpha:(e&255)/255}}},Jo=Ou;var _u={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},d9=_u;var Bu=e=>Jo(d9[e.toLowerCase()],6),c9=Bu;var Au=/^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i,Zu=e=>{let t;return(t=e.match(Au))?Jo(parseInt(t[1],16),t[1].length):void 0},f9=Zu;var r1="([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)",Uf=`(?:${r1}|none)`,Tt=`${r1}%`,qf=`(?:${r1}%|none)`,ho=`(?:${r1}%|${r1})`,Fu=`(?:${r1}%|${r1}|none)`,p9=`(?:${r1}(deg|grad|rad|turn)|${r1})`,zf=`(?:${r1}(deg|grad|rad|turn)|${r1}|none)`,ct="\\s*,\\s*";var jf=new RegExp("^"+Fu+"$");var $u=new RegExp(`^rgba?\\(\\s*${r1}${ct}${r1}${ct}${r1}\\s*(?:,\\s*${ho}\\s*)?\\)$`),Nu=new RegExp(`^rgba?\\(\\s*${Tt}${ct}${Tt}${ct}${Tt}\\s*(?:,\\s*${ho}\\s*)?\\)$`),Uu=e=>{let t={mode:"rgb"},o;if(o=e.match($u))o[1]!==void 0&&(t.r=o[1]/255),o[2]!==void 0&&(t.g=o[2]/255),o[3]!==void 0&&(t.b=o[3]/255);else if(o=e.match(Nu))o[1]!==void 0&&(t.r=o[1]/100),o[2]!==void 0&&(t.g=o[2]/100),o[3]!==void 0&&(t.b=o[3]/100);else return;return o[4]!==void 0?t.alpha=Math.max(0,Math.min(1,o[4]/100)):o[5]!==void 0&&(t.alpha=Math.max(0,Math.min(1,+o[5]))),t},C9=Uu;var qu=(e,t)=>e===void 0?void 0:typeof e!="object"?z1(e):e.mode!==void 0?e:t?{...e,mode:t}:void 0,er=qu;var zu=(e="rgb")=>t=>(t=er(t,e))!==void 0?t.mode===e?t:k1[t.mode][e]?k1[t.mode][e](t):e==="rgb"?k1[t.mode].rgb(t):k1.rgb[e](k1[t.mode].rgb(t)):void 0,a1=zu;var k1={},m9={},vo=[],Da={},ju=e=>e,he=e=>(k1[e.mode]={...k1[e.mode],...e.toMode},Object.keys(e.fromMode||{}).forEach(t=>{k1[t]||(k1[t]={}),k1[t][e.mode]=e.fromMode[t]}),e.ranges||(e.ranges={}),e.difference||(e.difference={}),e.channels.forEach(t=>{if(e.ranges[t]===void 0&&(e.ranges[t]=[0,1]),!e.interpolate[t])throw new Error(`Missing interpolator for: ${t}`);typeof e.interpolate[t]=="function"&&(e.interpolate[t]={use:e.interpolate[t]}),e.interpolate[t].fixup||(e.interpolate[t].fixup=ju)}),m9[e.mode]=e,(e.parse||[]).forEach(t=>{Ku(t,e.mode)}),a1(e.mode)),tr=e=>m9[e],Ku=(e,t)=>{if(typeof e=="string"){if(!t)throw new Error("'mode' required when 'parser' is a string");Da[e]=t}else typeof e=="function"&&vo.indexOf(e)<0&&vo.push(e)};var Oa=/[^\x00-\x7F]|[a-zA-Z_]/,Gu=/[^\x00-\x7F]|[-\w]/,D={Function:"function",Ident:"ident",Number:"number",Percentage:"percentage",ParenClose:")",None:"none",Hue:"hue",Alpha:"alpha"},ae=0;function or(e){let t=e[ae],o=e[ae+1];return t==="-"||t==="+"?/\d/.test(o)||o==="."&&/\d/.test(e[ae+2]):t==="."?/\d/.test(o):/\d/.test(t)}function _a(e){if(ae>=e.length)return!1;let t=e[ae];if(Oa.test(t))return!0;if(t==="-"){if(e.length-ae<2)return!1;let o=e[ae+1];return!!(o==="-"||Oa.test(o))}return!1}var Wu={deg:1,rad:180/Math.PI,grad:9/10,turn:360};function xo(e){let t="";if((e[ae]==="-"||e[ae]==="+")&&(t+=e[ae++]),t+=rr(e),e[ae]==="."&&/\d/.test(e[ae+1])&&(t+=e[ae++]+rr(e)),(e[ae]==="e"||e[ae]==="E")&&((e[ae+1]==="-"||e[ae+1]==="+")&&/\d/.test(e[ae+2])?t+=e[ae++]+e[ae++]+rr(e):/\d/.test(e[ae+1])&&(t+=e[ae++]+rr(e))),_a(e)){let o=ar(e);return o==="deg"||o==="rad"||o==="turn"||o==="grad"?{type:D.Hue,value:t*Wu[o]}:void 0}return e[ae]==="%"?(ae++,{type:D.Percentage,value:+t}):{type:D.Number,value:+t}}function rr(e){let t="";for(;/\d/.test(e[ae]);)t+=e[ae++];return t}function ar(e){let t="";for(;ae<e.length&&Gu.test(e[ae]);)t+=e[ae++];return t}function Xu(e){let t=ar(e);return e[ae]==="("?(ae++,{type:D.Function,value:t}):t==="none"?{type:D.None,value:void 0}:{type:D.Ident,value:t}}function Qu(e=""){let t=e.trim(),o=[],r;for(ae=0;ae<t.length;){if(r=t[ae++],r===`
|
|
2
2
|
`||r===" "||r===" "){for(;ae<t.length&&(t[ae]===`
|
|
3
|
-
`||t[ae]===" "||t[ae]===" ");)ae++;continue}if(r===",")return;if(r===")"){o.push({type:
|
|
4
|
-
`||t[ae]===" "||t[ae]===" ");)ae++;let a;if(or(t)&&(a=xo(t),a.type!==E.Hue)){o.push({type:E.Alpha,value:a});continue}if(_a(t)&&ar(t)==="none"){o.push({type:E.Alpha,value:{type:E.None,value:void 0}});continue}return}if(/\d/.test(r)){ae--,o.push(xo(t));continue}if(Oa.test(r)){ae--,o.push(Wu(t));continue}return}return o}function Qu(e){e._i=0;let t=e[e._i++];if(!t||t.type!==E.Function||t.value!=="color"||(t=e[e._i++],t.type!==E.Ident))return;let o=Da[t.value];if(!o)return;let r={mode:o},a=g9(e,!1);if(!a)return;let n=tr(o).channels;for(let l=0,i,s;l<n.length;l++)i=a[l],s=n[l],i.type!==E.None&&(r[s]=i.type===E.Number?i.value:i.value/100,s==="alpha"&&(r[s]=Math.max(0,Math.min(1,r[s]))));return r}function g9(e,t){let o=[],r;for(;e._i<e.length;){if(r=e[e._i++],r.type===E.None||r.type===E.Number||r.type===E.Alpha||r.type===E.Percentage||t&&r.type===E.Hue){o.push(r);continue}if(r.type===E.ParenClose){if(e._i<e.length)return;continue}return}if(!(o.length<3||o.length>4)){if(o.length===4){if(o[3].type!==E.Alpha)return;o[3]=o[3].value}return o.length===3&&o.push({type:E.None,value:void 0}),o.every(a=>a.type!==E.Alpha)?o:void 0}}function Yu(e,t){e._i=0;let o=e[e._i++];if(!o||o.type!==E.Function)return;let r=g9(e,t);if(r)return r.unshift(o.value),r}var Ju=e=>{if(typeof e!="string")return;let t=Xu(e),o=t?Yu(t,!0):void 0,r,a=0,n=vo.length;for(;a<n;)if((r=vo[a++](e,o))!==void 0)return r;return t?Qu(t):void 0},z1=Ju;function ed(e,t){if(!t||t[0]!=="rgb"&&t[0]!=="rgba")return;let o={mode:"rgb"},[,r,a,n,l]=t;if(!(r.type===E.Hue||a.type===E.Hue||n.type===E.Hue))return r.type!==E.None&&(o.r=r.type===E.Number?r.value/255:r.value/100),a.type!==E.None&&(o.g=a.type===E.Number?a.value/255:a.value/100),n.type!==E.None&&(o.b=n.type===E.Number?n.value/255:n.value/100),l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var h9=ed;var td=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,v9=td;var x9=(e,t,o)=>e+o*(t-e);var od=e=>{let t=[];for(let o=0;o<e.length-1;o++){let r=e[o],a=e[o+1];r===void 0&&a===void 0?t.push(void 0):r!==void 0&&a!==void 0?t.push([r,a]):t.push(r!==void 0?[r,r]:[a,a])}return t},L9=e=>t=>{let o=od(t);return r=>{let a=r*o.length,n=r>=1?o.length-1:Math.max(Math.floor(a),0),l=o[n];return l===void 0?void 0:e(l[0],l[1],a-n)}};var O=L9(x9);var fe=e=>{let t=!1,o=e.map(r=>r!==void 0?(t=!0,r):1);return t?o:e};var rd={mode:"rgb",channels:["r","g","b","alpha"],parse:[h9,f9,C9,c9,v9,"srgb"],serialize:"srgb",interpolate:{r:O,g:O,b:O,alpha:{use:O,fixup:fe}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},g1=rd;var Ba=(e=0)=>Math.pow(Math.abs(e),2.19921875)*Math.sign(e),ad=e=>{let t=Ba(e.r),o=Ba(e.g),r=Ba(e.b),a={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*o+.1882286462349947*r,y:.297344975250536*t+.6273635662554661*o+.0752914584939979*r,z:.0270313613864123*t+.0706888525358272*o+.9913375368376386*r};return e.alpha!==void 0&&(a.alpha=e.alpha),a},Aa=ad;var Za=e=>Math.pow(Math.abs(e),.4547069271758437)*Math.sign(e),nd=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"a98",r:Za(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*o),g:Za(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*o),b:Za(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*o)};return r!==void 0&&(a.alpha=r),a},Fa=nd;var $a=(e=0)=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},ld=({r:e,g:t,b:o,alpha:r})=>{let a={mode:"lrgb",r:$a(e),g:$a(t),b:$a(o)};return r!==void 0&&(a.alpha=r),a},h1=ld;var id=e=>{let{r:t,g:o,b:r,alpha:a}=h1(e),n={mode:"xyz65",x:.4123907992659593*t+.357584339383878*o+.1804807884018343*r,y:.2126390058715102*t+.715168678767756*o+.0721923153607337*r,z:.0193308187155918*t+.119194779794626*o+.9505321522496607*r};return a!==void 0&&(n.alpha=a),n},n1=id;var Na=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,.4166666666666667)-.055):e*12.92},sd=({r:e,g:t,b:o,alpha:r},a="rgb")=>{let n={mode:a,r:Na(e),g:Na(t),b:Na(o)};return r!==void 0&&(n.alpha=r),n},v1=sd;var ud=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=v1({r:e*3.2409699419045226-t*1.537383177570094-.4986107602930034*o,g:e*-.9692436362808796+t*1.8759675015077204+.0415550574071756*o,b:e*.0556300796969936-t*.2039769588889765+1.0569715142428784*o});return r!==void 0&&(a.alpha=r),a},l1=ud;var dd={...g1,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>Fa(n1(e)),xyz65:Fa},toMode:{rgb:e=>l1(Aa(e)),xyz65:Aa}},w9=dd;var cd=e=>(e=e%360)<0?e+360:e,xe=cd;var fd=(e,t)=>e.map((o,r,a)=>{if(o===void 0)return o;let n=xe(o);return r===0||e[r-1]===void 0?n:t(n-xe(a[r-1]))}).reduce((o,r)=>!o.length||r===void 0||o[o.length-1]===void 0?(o.push(r),o):(o.push(r+o[o.length-1]),o),[]),qe=e=>fd(e,t=>Math.abs(t)<=180?t:t-360*Math.sign(t));var Ee=[-.14861,1.78277,-.29227,-.90649,1.97294,0],I9=Math.PI/180,b9=180/Math.PI;var y9=Ee[3]*Ee[4],M9=Ee[1]*Ee[4],S9=Ee[1]*Ee[2]-Ee[0]*Ee[3],pd=({r:e,g:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(S9*o+e*y9-t*M9)/(S9+y9-M9),n=o-a,l=(Ee[4]*(t-a)-Ee[2]*n)/Ee[3],i={mode:"cubehelix",l:a,s:a===0||a===1?void 0:Math.sqrt(n*n+l*l)/(Ee[4]*a*(1-a))};return i.s&&(i.h=Math.atan2(l,n)*b9-120),r!==void 0&&(i.alpha=r),i},R9=pd;var Cd=({h:e,s:t,l:o,alpha:r})=>{let a={mode:"rgb"};e=(e===void 0?0:e+120)*I9,o===void 0&&(o=0);let n=t===void 0?0:t*o*(1-o),l=Math.cos(e),i=Math.sin(e);return a.r=o+n*(Ee[0]*l+Ee[1]*i),a.g=o+n*(Ee[2]*l+Ee[3]*i),a.b=o+n*(Ee[4]*l+Ee[5]*i),r!==void 0&&(a.alpha=r),a},H9=Cd;var ft=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let o=xe(e.h),r=xe(t.h),a=Math.sin((r-o+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*a},k9=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let o=xe(e.h),r=xe(t.h);return Math.abs(r-o)>180?o-(r-360*Math.sign(r-o)):r-o},pt=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let o=xe(e.h),r=xe(t.h),a=Math.sin((r-o+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*a};var ze=e=>{let t=e.reduce((r,a)=>{if(a!==void 0){let n=a*Math.PI/180;r.sin+=Math.sin(n),r.cos+=Math.cos(n)}return r},{sin:0,cos:0}),o=Math.atan2(t.sin,t.cos)*180/Math.PI;return o<0?360+o:o};var md={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:R9},toMode:{rgb:H9},interpolate:{h:{use:O,fixup:qe},s:O,l:O,alpha:{use:O,fixup:fe}},difference:{h:ft},average:{h:ze}},P9=md;var gd=({l:e,a:t,b:o,alpha:r},a="lch")=>{t===void 0&&(t=0),o===void 0&&(o=0);let n=Math.sqrt(t*t+o*o),l={mode:a,l:e,c:n};return n&&(l.h=xe(Math.atan2(o,t)*180/Math.PI)),r!==void 0&&(l.alpha=r),l},c1=gd;var hd=({l:e,c:t,h:o,alpha:r},a="lab")=>{o===void 0&&(o=0);let n={mode:a,l:e,a:t?t*Math.cos(o/180*Math.PI):0,b:t?t*Math.sin(o/180*Math.PI):0};return r!==void 0&&(n.alpha=r),n},f1=hd;var nr=Math.pow(29,3)/Math.pow(3,3),lr=Math.pow(6,3)/Math.pow(29,3);var be={X:.9642956764295677,Y:1,Z:.8251046025104602},Ct={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329},np=Math.pow(29,3)/Math.pow(3,3),lp=Math.pow(6,3)/Math.pow(29,3);var Ua=e=>Math.pow(e,3)>lr?Math.pow(e,3):(116*e-16)/nr,vd=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(e+16)/116,n=t/500+a,l=a-o/200,i={mode:"xyz65",x:Ua(n)*Ct.X,y:Ua(a)*Ct.Y,z:Ua(l)*Ct.Z};return r!==void 0&&(i.alpha=r),i},ir=vd;var xd=e=>l1(ir(e)),mt=xd;var qa=e=>e>lr?Math.cbrt(e):(nr*e+16)/116,Ld=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=qa(e/Ct.X),n=qa(t/Ct.Y),l=qa(o/Ct.Z),i={mode:"lab65",l:116*n-16,a:500*(a-n),b:200*(n-l)};return r!==void 0&&(i.alpha=r),i},sr=Ld;var wd=e=>{let t=sr(n1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},gt=wd;var Vt=.14444444444444443*Math.PI,zt=Math.cos(Vt),jt=Math.sin(Vt),ur=100/Math.log(139/100);var Id=({l:e,c:t,h:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"lab65",l:(Math.exp(e*1/ur)-1)/.0039},n=(Math.exp(.0435*t*1*1)-1)/.075,l=n*Math.cos(o/180*Math.PI-Vt),i=n*Math.sin(o/180*Math.PI-Vt);return a.a=l*zt-i/.83*jt,a.b=l*jt+i/.83*zt,r!==void 0&&(a.alpha=r),a},wo=Id;var bd=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=t*zt+o*jt,n=.83*(o*zt-t*jt),l=Math.sqrt(a*a+n*n),i={mode:"dlch",l:ur/1*Math.log(1+.0039*e),c:Math.log(1+.075*l)/(.0435*1*1)};return i.c&&(i.h=xe((Math.atan2(n,a)+Vt)/Math.PI*180)),r!==void 0&&(i.alpha=r),i},Io=bd;var T9=e=>wo(c1(e,"dlch")),V9=e=>f1(Io(e),"dlab"),yd={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:T9,rgb:e=>mt(T9(e))},fromMode:{lab65:V9,rgb:e=>V9(gt(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:O,a:O,b:O,alpha:{use:O,fixup:fe}}},E9=yd;var Md={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:wo,dlab:e=>f1(e,"dlab"),rgb:e=>mt(wo(e))},fromMode:{lab65:Io,dlab:e=>c1(e,"dlch"),rgb:e=>Io(gt(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:O,c:O,h:{use:O,fixup:qe},alpha:{use:O,fixup:fe}},difference:{h:pt},average:{h:ze}},D9=Md;function ja({h:e,s:t,i:o,alpha:r}){e=xe(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.abs(e/60%2-1),n;switch(Math.floor(e/60)){case 0:n={r:o*(1+t*(3/(2-a)-1)),g:o*(1+t*(3*(1-a)/(2-a)-1)),b:o*(1-t)};break;case 1:n={r:o*(1+t*(3*(1-a)/(2-a)-1)),g:o*(1+t*(3/(2-a)-1)),b:o*(1-t)};break;case 2:n={r:o*(1-t),g:o*(1+t*(3/(2-a)-1)),b:o*(1+t*(3*(1-a)/(2-a)-1))};break;case 3:n={r:o*(1-t),g:o*(1+t*(3*(1-a)/(2-a)-1)),b:o*(1+t*(3/(2-a)-1))};break;case 4:n={r:o*(1+t*(3*(1-a)/(2-a)-1)),g:o*(1-t),b:o*(1+t*(3/(2-a)-1))};break;case 5:n={r:o*(1+t*(3/(2-a)-1)),g:o*(1-t),b:o*(1+t*(3*(1-a)/(2-a)-1))};break;default:n={r:o*(1-t),g:o*(1-t),b:o*(1-t)}}return n.mode="rgb",r!==void 0&&(n.alpha=r),n}function Ka({r:e,g:t,b:o,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.max(e,t,o),n=Math.min(e,t,o),l={mode:"hsi",s:e+t+o===0?0:1-3*n/(e+t+o),i:(e+t+o)/3};return a-n!==0&&(l.h=(a===e?(t-o)/(a-n)+(t<o)*6:a===t?(o-e)/(a-n)+2:(e-t)/(a-n)+4)*60),r!==void 0&&(l.alpha=r),l}var Sd={mode:"hsi",toMode:{rgb:ja},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:Ka},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:O,fixup:qe},s:O,i:O,alpha:{use:O,fixup:fe}},difference:{h:ft},average:{h:ze}},O9=Sd;function Ga({h:e,s:t,l:o,alpha:r}){e=xe(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let a=o+t*(o<.5?o:1-o),n=a-(a-o)*2*Math.abs(e/60%2-1),l;switch(Math.floor(e/60)){case 0:l={r:a,g:n,b:2*o-a};break;case 1:l={r:n,g:a,b:2*o-a};break;case 2:l={r:2*o-a,g:a,b:n};break;case 3:l={r:2*o-a,g:n,b:a};break;case 4:l={r:n,g:2*o-a,b:a};break;case 5:l={r:a,g:2*o-a,b:n};break;default:l={r:2*o-a,g:2*o-a,b:2*o-a}}return l.mode="rgb",r!==void 0&&(l.alpha=r),l}function Wa({r:e,g:t,b:o,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.max(e,t,o),n=Math.min(e,t,o),l={mode:"hsl",s:a===n?0:(a-n)/(1-Math.abs(a+n-1)),l:.5*(a+n)};return a-n!==0&&(l.h=(a===e?(t-o)/(a-n)+(t<o)*6:a===t?(o-e)/(a-n)+2:(e-t)/(a-n)+4)*60),r!==void 0&&(l.alpha=r),l}var Rd=(e,t)=>{switch(t){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return e*360}},_9=Rd;var Hd=new RegExp(`^hsla?\\(\\s*${p9}${ct}${Tt}${ct}${Tt}\\s*(?:,\\s*${ho}\\s*)?\\)$`),kd=e=>{let t=e.match(Hd);if(!t)return;let o={mode:"hsl"};return t[3]!==void 0?o.h=+t[3]:t[1]!==void 0&&t[2]!==void 0&&(o.h=_9(t[1],t[2])),t[4]!==void 0&&(o.s=Math.min(Math.max(0,t[4]/100),1)),t[5]!==void 0&&(o.l=Math.min(Math.max(0,t[5]/100),1)),t[6]!==void 0?o.alpha=Math.max(0,Math.min(1,t[6]/100)):t[7]!==void 0&&(o.alpha=Math.max(0,Math.min(1,+t[7]))),o},B9=kd;function Pd(e,t){if(!t||t[0]!=="hsl"&&t[0]!=="hsla")return;let o={mode:"hsl"},[,r,a,n,l]=t;if(r.type!==E.None){if(r.type===E.Percentage)return;o.h=r.value}if(a.type!==E.None){if(a.type===E.Hue)return;o.s=a.value/100}if(n.type!==E.None){if(n.type===E.Hue)return;o.l=n.value/100}return l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var A9=Pd;var Td={mode:"hsl",toMode:{rgb:Ga},fromMode:{rgb:Wa},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[A9,B9],serialize:e=>`hsl(${e.h!==void 0?e.h:"none"} ${e.s!==void 0?e.s*100+"%":"none"} ${e.l!==void 0?e.l*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:O,fixup:qe},s:O,l:O,alpha:{use:O,fixup:fe}},difference:{h:ft},average:{h:ze}},dr=Td;function bo({h:e,s:t,v:o,alpha:r}){e=xe(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.abs(e/60%2-1),n;switch(Math.floor(e/60)){case 0:n={r:o,g:o*(1-t*a),b:o*(1-t)};break;case 1:n={r:o*(1-t*a),g:o,b:o*(1-t)};break;case 2:n={r:o*(1-t),g:o,b:o*(1-t*a)};break;case 3:n={r:o*(1-t),g:o*(1-t*a),b:o};break;case 4:n={r:o*(1-t*a),g:o*(1-t),b:o};break;case 5:n={r:o,g:o*(1-t),b:o*(1-t*a)};break;default:n={r:o*(1-t),g:o*(1-t),b:o*(1-t)}}return n.mode="rgb",r!==void 0&&(n.alpha=r),n}function yo({r:e,g:t,b:o,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.max(e,t,o),n=Math.min(e,t,o),l={mode:"hsv",s:a===0?0:1-n/a,v:a};return a-n!==0&&(l.h=(a===e?(t-o)/(a-n)+(t<o)*6:a===t?(o-e)/(a-n)+2:(e-t)/(a-n)+4)*60),r!==void 0&&(l.alpha=r),l}var Vd={mode:"hsv",toMode:{rgb:bo},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:yo},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:O,fixup:qe},s:O,v:O,alpha:{use:O,fixup:fe}},difference:{h:ft},average:{h:ze}},cr=Vd;function Xa({h:e,w:t,b:o,alpha:r}){if(t===void 0&&(t=0),o===void 0&&(o=0),t+o>1){let a=t+o;t/=a,o/=a}return bo({h:e,s:o===1?1:1-t/(1-o),v:1-o,alpha:r})}function Qa(e){let t=yo(e);if(t===void 0)return;let o=t.s!==void 0?t.s:0,r=t.v!==void 0?t.v:0,a={mode:"hwb",w:(1-o)*r,b:1-r};return t.h!==void 0&&(a.h=t.h),t.alpha!==void 0&&(a.alpha=t.alpha),a}function Ed(e,t){if(!t||t[0]!=="hwb")return;let o={mode:"hwb"},[,r,a,n,l]=t;if(r.type!==E.None){if(r.type===E.Percentage)return;o.h=r.value}if(a.type!==E.None){if(a.type===E.Hue)return;o.w=a.value/100}if(n.type!==E.None){if(n.type===E.Hue)return;o.b=n.value/100}return l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var Z9=Ed;var Dd={mode:"hwb",toMode:{rgb:Xa},fromMode:{rgb:Qa},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[Z9],serialize:e=>`hwb(${e.h!==void 0?e.h:"none"} ${e.w!==void 0?e.w*100+"%":"none"} ${e.b!==void 0?e.b*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:O,fixup:qe},w:O,b:O,alpha:{use:O,fixup:fe}},difference:{h:k9},average:{h:ze}},F9=Dd;var Kt=.1593017578125,$9=78.84375,Gt=.8359375,Wt=18.8515625,Xt=18.6875;function fr(e){if(e<0)return 0;let t=Math.pow(e,1/$9);return 1e4*Math.pow(Math.max(0,t-Gt)/(Wt-Xt*t),1/Kt)}function pr(e){if(e<0)return 0;let t=Math.pow(e/1e4,Kt);return Math.pow((Gt+Wt*t)/(1+Xt*t),$9)}var Ya=e=>Math.max(e/203,0),_d=({i:e,t,p:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=fr(e+.008609037037932761*t+.11102962500302593*o),n=fr(e-.00860903703793275*t-.11102962500302599*o),l=fr(e+.5600313357106791*t-.32062717498731885*o),i={mode:"xyz65",x:Ya(2.070152218389422*a-1.3263473389671556*n+.2066510476294051*l),y:Ya(.3647385209748074*a+.680566024947227*n-.0453045459220346*l),z:Ya(-.049747207535812*a-.0492609666966138*n+1.1880659249923042*l)};return r!==void 0&&(i.alpha=r),i},Ja=_d;var en=(e=0)=>Math.max(e*203,0),Bd=({x:e,y:t,z:o,alpha:r})=>{let a=en(e),n=en(t),l=en(o),i=pr(.3592832590121217*a+.6976051147779502*n-.0358915932320289*l),s=pr(-.1920808463704995*a+1.1004767970374323*n+.0753748658519118*l),u=pr(.0070797844607477*a+.0748396662186366*n+.8433265453898765*l),d=.5*i+.5*s,c=1.61376953125*i-3.323486328125*s+1.709716796875*u,p=4.378173828125*i-4.24560546875*s-.132568359375*u,g={mode:"itp",i:d,t:c,p};return r!==void 0&&(g.alpha=r),g},tn=Bd;var Ad={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:Ja,rgb:e=>l1(Ja(e))},fromMode:{xyz65:tn,rgb:e=>tn(n1(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:O,t:O,p:O,alpha:{use:O,fixup:fe}}},N9=Ad;var Zd=134.03437499999998,Fd=16295499532821565e-27,on=e=>{if(e<0)return 0;let t=Math.pow(e/1e4,Kt);return Math.pow((Gt+Wt*t)/(1+Xt*t),Zd)},rn=(e=0)=>Math.max(e*203,0),$d=({x:e,y:t,z:o,alpha:r})=>{e=rn(e),t=rn(t),o=rn(o);let a=1.15*e-.15*o,n=.66*t+.34*e,l=on(.41478972*a+.579999*n+.014648*o),i=on(-.20151*a+1.120649*n+.0531008*o),s=on(-.0166008*a+.2648*n+.6684799*o),u=(l+i)/2,d={mode:"jab",j:.44*u/(1-.56*u)-Fd,a:3.524*l-4.066708*i+.542708*s,b:.199076*l+1.096799*i-1.295875*s};return r!==void 0&&(d.alpha=r),d},Cr=$d;var Nd=134.03437499999998,U9=16295499532821565e-27,an=e=>{if(e<0)return 0;let t=Math.pow(e,1/Nd);return 1e4*Math.pow((Gt-t)/(Xt*t-Wt),1/Kt)},nn=e=>e/203,Ud=({j:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(e+U9)/(.44+.56*(e+U9)),n=an(a+.13860504*t+.058047316*o),l=an(a-.13860504*t-.058047316*o),i=an(a-.096019242*t-.8118919*o),s={mode:"xyz65",x:nn(1.661373024652174*n-.914523081304348*l+.23136208173913045*i),y:nn(-.3250758611844533*n+1.571847026732543*l-.21825383453227928*i),z:nn(-.090982811*n-.31272829*l+1.5227666*i)};return r!==void 0&&(s.alpha=r),s},mr=Ud;var qd=e=>{let t=Cr(n1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},gr=qd;var zd=e=>l1(mr(e)),hr=zd;var jd={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:gr,xyz65:Cr},toMode:{rgb:hr,xyz65:mr},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:O,a:O,b:O,alpha:{use:O,fixup:fe}}},q9=jd;var Kd=({j:e,a:t,b:o,alpha:r})=>{t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.sqrt(t*t+o*o),n={mode:"jch",j:e,c:a};return a&&(n.h=xe(Math.atan2(o,t)*180/Math.PI)),r!==void 0&&(n.alpha=r),n},ln=Kd;var Gd=({j:e,c:t,h:o,alpha:r})=>{o===void 0&&(o=0);let a={mode:"jab",j:e,a:t?t*Math.cos(o/180*Math.PI):0,b:t?t*Math.sin(o/180*Math.PI):0};return r!==void 0&&(a.alpha=r),a},sn=Gd;var Wd={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:sn,rgb:e=>hr(sn(e))},fromMode:{rgb:e=>ln(gr(e)),jab:ln},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:O,fixup:qe},c:O,j:O,alpha:{use:O,fixup:fe}},difference:{h:pt},average:{h:ze}},z9=Wd;var ht=Math.pow(29,3)/Math.pow(3,3),Qt=Math.pow(6,3)/Math.pow(29,3);var un=e=>Math.pow(e,3)>Qt?Math.pow(e,3):(116*e-16)/ht,Xd=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(e+16)/116,n=t/500+a,l=a-o/200,i={mode:"xyz50",x:un(n)*be.X,y:un(a)*be.Y,z:un(l)*be.Z};return r!==void 0&&(i.alpha=r),i},Yt=Xd;var Qd=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=v1({r:e*3.1341359569958707-t*1.6173863321612538-.4906619460083532*o,g:e*-.978795502912089+t*1.916254567259524+.03344273116131949*o,b:e*.07195537988411677-t*.2289768264158322+1.405386058324125*o});return r!==void 0&&(a.alpha=r),a},V1=Qd;var Yd=e=>V1(Yt(e)),vr=Yd;var Jd=e=>{let{r:t,g:o,b:r,alpha:a}=h1(e),n={mode:"xyz50",x:.436065742824811*t+.3851514688337912*o+.14307845442264197*r,y:.22249319175623702*t+.7168870538238823*o+.06061979053616537*r,z:.013923904500943465*t+.09708128566574634*o+.7140993584005155*r};return a!==void 0&&(n.alpha=a),n},E1=Jd;var dn=e=>e>Qt?Math.cbrt(e):(ht*e+16)/116,e3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=dn(e/be.X),n=dn(t/be.Y),l=dn(o/be.Z),i={mode:"lab",l:116*n-16,a:500*(a-n),b:200*(n-l)};return r!==void 0&&(i.alpha=r),i},Jt=e3;var t3=e=>{let t=Jt(E1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},xr=t3;function o3(e,t){if(!t||t[0]!=="lab")return;let o={mode:"lab"},[,r,a,n,l]=t;if(!(r.type===E.Hue||a.type===E.Hue||n.type===E.Hue))return r.type!==E.None&&(o.l=Math.min(Math.max(0,r.value),100)),a.type!==E.None&&(o.a=a.type===E.Number?a.value:a.value*125/100),n.type!==E.None&&(o.b=n.type===E.Number?n.value:n.value*125/100),l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var j9=o3;var r3={mode:"lab",toMode:{xyz50:Yt,rgb:vr},fromMode:{xyz50:Jt,rgb:xr},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[j9],serialize:e=>`lab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:O,a:O,b:O,alpha:{use:O,fixup:fe}}},eo=r3;var a3={...eo,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:ir,rgb:mt},fromMode:{xyz65:sr,rgb:gt},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},K9=a3;function n3(e,t){if(!t||t[0]!=="lch")return;let o={mode:"lch"},[,r,a,n,l]=t;if(r.type!==E.None){if(r.type===E.Hue)return;o.l=Math.min(Math.max(0,r.value),100)}if(a.type!==E.None&&(o.c=Math.max(0,a.type===E.Number?a.value:a.value*150/100)),n.type!==E.None){if(n.type===E.Percentage)return;o.h=n.value}return l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var G9=n3;var l3={mode:"lch",toMode:{lab:f1,rgb:e=>vr(f1(e))},fromMode:{rgb:e=>c1(xr(e)),lab:c1},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[G9],serialize:e=>`lch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:O,fixup:qe},c:O,l:O,alpha:{use:O,fixup:fe}},difference:{h:pt},average:{h:ze}},to=l3;var i3={...to,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>f1(e,"lab65"),rgb:e=>mt(f1(e,"lab65"))},fromMode:{rgb:e=>c1(gt(e),"lch65"),lab65:e=>c1(e,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},W9=i3;var s3=({l:e,u:t,v:o,alpha:r})=>{t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.sqrt(t*t+o*o),n={mode:"lchuv",l:e,c:a};return a&&(n.h=xe(Math.atan2(o,t)*180/Math.PI)),r!==void 0&&(n.alpha=r),n},cn=s3;var u3=({l:e,c:t,h:o,alpha:r})=>{o===void 0&&(o=0);let a={mode:"luv",l:e,u:t?t*Math.cos(o/180*Math.PI):0,v:t?t*Math.sin(o/180*Math.PI):0};return r!==void 0&&(a.alpha=r),a},fn=u3;var X9=(e,t,o)=>4*e/(e+15*t+3*o),Q9=(e,t,o)=>9*t/(e+15*t+3*o),d3=X9(be.X,be.Y,be.Z),c3=Q9(be.X,be.Y,be.Z),f3=e=>e<=Qt?ht*e:116*Math.cbrt(e)-16,p3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=f3(t/be.Y),n=X9(e,t,o),l=Q9(e,t,o);!isFinite(n)||!isFinite(l)?a=n=l=0:(n=13*a*(n-d3),l=13*a*(l-c3));let i={mode:"luv",l:a,u:n,v:l};return r!==void 0&&(i.alpha=r),i},Mo=p3;var C3=(e,t,o)=>4*e/(e+15*t+3*o),m3=(e,t,o)=>9*t/(e+15*t+3*o),g3=C3(be.X,be.Y,be.Z),h3=m3(be.X,be.Y,be.Z),v3=({l:e,u:t,v:o,alpha:r})=>{if(e===void 0&&(e=0),e===0)return{mode:"xyz50",x:0,y:0,z:0};t===void 0&&(t=0),o===void 0&&(o=0);let a=t/(13*e)+g3,n=o/(13*e)+h3,l=be.Y*(e<=8?e/ht:Math.pow((e+16)/116,3)),i=l*(9*a)/(4*n),s=l*(12-3*a-20*n)/(4*n),u={mode:"xyz50",x:i,y:l,z:s};return r!==void 0&&(u.alpha=r),u},So=v3;var x3=e=>cn(Mo(E1(e))),L3=e=>V1(So(fn(e))),w3={mode:"lchuv",toMode:{luv:fn,rgb:L3},fromMode:{rgb:x3,luv:cn},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:O,fixup:qe},c:O,l:O,alpha:{use:O,fixup:fe}},difference:{h:pt},average:{h:ze}},Y9=w3;var I3={...g1,mode:"lrgb",toMode:{rgb:v1},fromMode:{rgb:h1},parse:["srgb-linear"],serialize:"srgb-linear"},J9=I3;var b3={mode:"luv",toMode:{xyz50:So,rgb:e=>V1(So(e))},fromMode:{xyz50:Mo,rgb:e=>Mo(E1(e))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:O,u:O,v:O,alpha:{use:O,fixup:fe}}},e0=b3;var y3=({r:e,g:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.cbrt(.412221469470763*e+.5363325372617348*t+.0514459932675022*o),n=Math.cbrt(.2119034958178252*e+.6806995506452344*t+.1073969535369406*o),l=Math.cbrt(.0883024591900564*e+.2817188391361215*t+.6299787016738222*o),i={mode:"oklab",l:.210454268309314*a+.7936177747023054*n-.0040720430116193*l,a:1.9779985324311684*a-2.42859224204858*n+.450593709617411*l,b:.0259040424655478*a+.7827717124575296*n-.8086757549230774*l};return r!==void 0&&(i.alpha=r),i},Lr=y3;var M3=e=>{let t=Lr(h1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},vt=M3;var S3=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.pow(e+.3963377773761749*t+.2158037573099136*o,3),n=Math.pow(e-.1055613458156586*t-.0638541728258133*o,3),l=Math.pow(e-.0894841775298119*t-1.2914855480194092*o,3),i={mode:"lrgb",r:4.076741636075957*a-3.3077115392580616*n+.2309699031821044*l,g:-1.2684379732850317*a+2.6097573492876887*n-.3413193760026573*l,b:-.0041960761386756*a-.7034186179359362*n+1.7076146940746117*l};return r!==void 0&&(i.alpha=r),i},D1=S3;var R3=e=>v1(D1(e)),xt=R3;function Ro(e){let r=1.170873786407767;return .5*(r*e-.206+Math.sqrt((r*e-.206)*(r*e-.206)+4*.03*r*e))}function Et(e){return(e*e+.206*e)/(1.170873786407767*(e+.03))}function H3(e,t){let o,r,a,n,l,i,s,u;-1.88170328*e-.80936493*t>1?(o=1.19086277,r=1.76576728,a=.59662641,n=.75515197,l=.56771245,i=4.0767416621,s=-3.3077115913,u=.2309699292):1.81444104*e-1.19445276*t>1?(o=.73956515,r=-.45954404,a=.08285427,n=.1254107,l=.14503204,i=-1.2684380046,s=2.6097574011,u=-.3413193965):(o=1.35733652,r=-.00915799,a=-1.1513021,n=-.50559606,l=.00692167,i=-.0041960863,s=-.7034186147,u=1.707614701);let d=o+r*e+a*t+n*e*e+l*e*t,c=.3963377774*e+.2158037573*t,p=-.1055613458*e-.0638541728*t,g=-.0894841775*e-1.291485548*t;{let f=1+d*c,M=1+d*p,x=1+d*g,w=f*f*f,h=M*M*M,S=x*x*x,H=3*c*f*f,k=3*p*M*M,Z=3*g*x*x,V=6*c*c*f,L=6*p*p*M,y=6*g*g*x,R=i*w+s*h+u*S,_=i*H+s*k+u*Z,N=i*V+s*L+u*y;d=d-R*_/(_*_-.5*R*N)}return d}function pn(e,t){let o=H3(e,t),r=D1({l:1,a:o*e,b:o*t}),a=Math.cbrt(1/Math.max(r.r,r.g,r.b)),n=a*o;return[a,n]}function k3(e,t,o,r,a,n=null){n||(n=pn(e,t));let l;if((o-a)*n[1]-(n[0]-a)*r<=0)l=n[1]*a/(r*n[0]+n[1]*(a-o));else{l=n[1]*(a-1)/(r*(n[0]-1)+n[1]*(a-o));{let i=o-a,s=r,u=.3963377774*e+.2158037573*t,d=-.1055613458*e-.0638541728*t,c=-.0894841775*e-1.291485548*t,p=i+s*u,g=i+s*d,f=i+s*c;{let M=a*(1-l)+l*o,x=l*r,w=M+x*u,h=M+x*d,S=M+x*c,H=w*w*w,k=h*h*h,Z=S*S*S,V=3*p*w*w,L=3*g*h*h,y=3*f*S*S,R=6*p*p*w,_=6*g*g*h,N=6*f*f*S,K=4.0767416621*H-3.3077115913*k+.2309699292*Z-1,z=4.0767416621*V-3.3077115913*L+.2309699292*y,W=4.0767416621*R-3.3077115913*_+.2309699292*N,F=z/(z*z-.5*K*W),D=-K*F,B=-1.2684380046*H+2.6097574011*k-.3413193965*Z-1,U=-1.2684380046*V+2.6097574011*L-.3413193965*y,A=-1.2684380046*R+2.6097574011*_-.3413193965*N,q=U/(U*U-.5*B*A),T=-B*q,j=-.0041960863*H-.7034186147*k+1.707614701*Z-1,m=-.0041960863*V-.7034186147*L+1.707614701*y,I=-.0041960863*R-.7034186147*_+1.707614701*N,P=m/(m*m-.5*j*I),C=-j*P;D=F>=0?D:1e6,T=q>=0?T:1e6,C=P>=0?C:1e6,l+=Math.min(D,Math.min(T,C))}}}return l}function Ho(e,t,o=null){o||(o=pn(e,t));let r=o[0],a=o[1];return[a/r,a/(1-r)]}function wr(e,t,o){let r=pn(t,o),a=k3(t,o,e,1,e,r),n=Ho(t,o,r),l=.11516993+1/(7.4477897+4.1590124*o+t*(-2.19557347+1.75198401*o+t*(-2.13704948-10.02301043*o+t*(-4.24894561+5.38770819*o+4.69891013*t)))),i=.11239642+1/(1.6132032-.68124379*o+t*(.40370612+.90148123*o+t*(-.27087943+.6122399*o+t*(.00299215-.45399568*o-.14661872*t)))),s=a/Math.min(e*n[0],(1-e)*n[1]),u=e*l,d=(1-e)*i,c=.9*s*Math.sqrt(Math.sqrt(1/(1/(u*u*u*u)+1/(d*d*d*d))));return u=e*.4,d=(1-e)*.8,[Math.sqrt(1/(1/(u*u)+1/(d*d))),c,a]}function Ir(e){let t=e.l!==void 0?e.l:0,o=e.a!==void 0?e.a:0,r=e.b!==void 0?e.b:0,a={mode:"okhsl",l:Ro(t)};e.alpha!==void 0&&(a.alpha=e.alpha);let n=Math.sqrt(o*o+r*r);if(!n)return a.s=0,a;let[l,i,s]=wr(t,o/n,r/n),u;if(n<i){let d=0,c=.8*l,p=1-c/i;u=(n-d)/(c+p*(n-d))*.8}else{let d=i,c=.2*i*i*1.25*1.25/l,p=1-c/(s-i);u=.8+.2*((n-d)/(c+p*(n-d)))}return u&&(a.s=u,a.h=xe(Math.atan2(r,o)*180/Math.PI)),a}function br(e){let t=e.h!==void 0?e.h:0,o=e.s!==void 0?e.s:0,r=e.l!==void 0?e.l:0,a={mode:"oklab",l:Et(r)};if(e.alpha!==void 0&&(a.alpha=e.alpha),!o||r===1)return a.a=a.b=0,a;let n=Math.cos(t/180*Math.PI),l=Math.sin(t/180*Math.PI),[i,s,u]=wr(a.l,n,l),d,c,p,g;o<.8?(d=1.25*o,c=0,p=.8*i,g=1-p/s):(d=5*(o-.8),c=s,p=.2*s*s*1.25*1.25/i,g=1-p/(u-s));let f=c+d*p/(1-g*d);return a.a=f*n,a.b=f*l,a}var P3={...dr,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:Ir,rgb:e=>Ir(vt(e))},toMode:{oklab:br,rgb:e=>xt(br(e))}},t0=P3;function yr(e){let t=e.l!==void 0?e.l:0,o=e.a!==void 0?e.a:0,r=e.b!==void 0?e.b:0,a=Math.sqrt(o*o+r*r),n=a?o/a:1,l=a?r/a:1,[i,s]=Ho(n,l),u=.5,d=1-u/i,c=s/(a+t*s),p=c*t,g=c*a,f=Et(p),M=g*f/p,x=D1({l:f,a:n*M,b:l*M}),w=Math.cbrt(1/Math.max(x.r,x.g,x.b,0));t=t/w,a=a/w*Ro(t)/t,t=Ro(t);let h={mode:"okhsv",s:a?(u+s)*g/(s*u+s*d*g):0,v:t?t/p:0};return h.s&&(h.h=xe(Math.atan2(r,o)*180/Math.PI)),e.alpha!==void 0&&(h.alpha=e.alpha),h}function Mr(e){let t={mode:"oklab"};e.alpha!==void 0&&(t.alpha=e.alpha);let o=e.h!==void 0?e.h:0,r=e.s!==void 0?e.s:0,a=e.v!==void 0?e.v:0,n=Math.cos(o/180*Math.PI),l=Math.sin(o/180*Math.PI),[i,s]=Ho(n,l),u=.5,d=1-u/i,c=1-r*u/(u+s-s*d*r),p=r*s*u/(u+s-s*d*r),g=Et(c),f=p*g/c,M=D1({l:g,a:n*f,b:l*f}),x=Math.cbrt(1/Math.max(M.r,M.g,M.b,0)),w=Et(a*c),h=p*w/c;return t.l=w*x,t.a=h*n*x,t.b=h*l*x,t}var T3={...cr,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:yr,rgb:e=>yr(vt(e))},toMode:{oklab:Mr,rgb:e=>xt(Mr(e))}},o0=T3;function V3(e,t){if(!t||t[0]!=="oklab")return;let o={mode:"oklab"},[,r,a,n,l]=t;if(!(r.type===E.Hue||a.type===E.Hue||n.type===E.Hue))return r.type!==E.None&&(o.l=Math.min(Math.max(0,r.type===E.Number?r.value:r.value/100),1)),a.type!==E.None&&(o.a=a.type===E.Number?a.value:a.value*.4/100),n.type!==E.None&&(o.b=n.type===E.Number?n.value:n.value*.4/100),l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var r0=V3;var E3={...eo,mode:"oklab",toMode:{lrgb:D1,rgb:xt},fromMode:{lrgb:Lr,rgb:vt},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[r0],serialize:e=>`oklab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`},a0=E3;function D3(e,t){if(!t||t[0]!=="oklch")return;let o={mode:"oklch"},[,r,a,n,l]=t;if(r.type!==E.None){if(r.type===E.Hue)return;o.l=Math.min(Math.max(0,r.type===E.Number?r.value:r.value/100),1)}if(a.type!==E.None&&(o.c=Math.max(0,a.type===E.Number?a.value:a.value*.4/100)),n.type!==E.None){if(n.type===E.Percentage)return;o.h=n.value}return l.type!==E.None&&(o.alpha=Math.min(1,Math.max(0,l.type===E.Number?l.value:l.value/100))),o}var n0=D3;var O3={...to,mode:"oklch",toMode:{oklab:e=>f1(e,"oklab"),rgb:e=>xt(f1(e,"oklab"))},fromMode:{rgb:e=>c1(vt(e),"oklch"),oklab:e=>c1(e,"oklch")},parse:[n0],serialize:e=>`oklch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},l0=O3;var _3=e=>{let{r:t,g:o,b:r,alpha:a}=h1(e),n={mode:"xyz65",x:.486570948648216*t+.265667693169093*o+.1982172852343625*r,y:.2289745640697487*t+.6917385218365062*o+.079286914093745*r,z:0*t+.0451133818589026*o+1.043944368900976*r};return a!==void 0&&(n.alpha=a),n},Cn=_3;var B3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=v1({r:e*2.4934969119414263-t*.9313836179191242-.402710784450717*o,g:e*-.8294889695615749+t*1.7626640603183465+.0236246858419436*o,b:e*.0358458302437845-t*.0761723892680418+.9568845240076871*o},"p3");return r!==void 0&&(a.alpha=r),a},mn=B3;var A3={...g1,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>mn(n1(e)),xyz65:mn},toMode:{rgb:e=>l1(Cn(e)),xyz65:Cn}},i0=A3;var gn=e=>{let t=Math.abs(e);return t>=.001953125?Math.sign(e)*Math.pow(t,.5555555555555556):16*e},Z3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"prophoto",r:gn(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*o),g:gn(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*o),b:gn(e*0+t*0+1.2119675456389452*o)};return r!==void 0&&(a.alpha=r),a},hn=Z3;var vn=(e=0)=>{let t=Math.abs(e);return t>=.03125?Math.sign(e)*Math.pow(t,1.8):e/16},F3=e=>{let t=vn(e.r),o=vn(e.g),r=vn(e.b),a={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*o+.0313477341283922*r,y:.2880748288194013*t+.7118352342418731*o+899369387256e-16*r,z:0*t+0*o+.8251046025104602*r};return e.alpha!==void 0&&(a.alpha=e.alpha),a},xn=F3;var $3={...g1,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:hn,rgb:e=>hn(E1(e))},toMode:{xyz50:xn,rgb:e=>V1(xn(e))}},s0=$3;var u0=1.09929682680944,N3=.018053968510807,Ln=e=>{let t=Math.abs(e);return t>N3?(Math.sign(e)||1)*(u0*Math.pow(t,.45)-(u0-1)):4.5*e},U3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"rec2020",r:Ln(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*o),g:Ln(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*o),b:Ln(e*.0176398574453108-t*.0427706132578085+.9421031212354739*o)};return r!==void 0&&(a.alpha=r),a},wn=U3;var d0=1.09929682680944,q3=.018053968510807,In=(e=0)=>{let t=Math.abs(e);return t<q3*4.5?e/4.5:(Math.sign(e)||1)*Math.pow((t+d0-1)/d0,1/.45)},z3=e=>{let t=In(e.r),o=In(e.g),r=In(e.b),a={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*o+.1688809751641721*r,y:.262700212011267*t+.6779980715188708*o+.059301716469862*r,z:0*t+.0280726930490874*o+1.0609850577107909*r};return e.alpha!==void 0&&(a.alpha=e.alpha),a},bn=z3;var j3={...g1,mode:"rec2020",fromMode:{xyz65:wn,rgb:e=>wn(n1(e))},toMode:{xyz65:bn,rgb:e=>l1(bn(e))},parse:["rec2020"],serialize:"rec2020"},c0=j3;var j1=.0037930732552754493,Sr=Math.cbrt(j1);var yn=e=>Math.cbrt(e)-Sr,K3=e=>{let{r:t,g:o,b:r,alpha:a}=h1(e),n=yn(.3*t+.622*o+.078*r+j1),l=yn(.23*t+.692*o+.078*r+j1),i=yn(.2434226892454782*t+.2047674442449682*o+.5518098665095535*r+j1),s={mode:"xyb",x:(n-l)/2,y:(n+l)/2,b:i-(n+l)/2};return a!==void 0&&(s.alpha=a),s},f0=K3;var Mn=e=>Math.pow(e+Sr,3),G3=({x:e,y:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Mn(e+t)-j1,n=Mn(t-e)-j1,l=Mn(o+t)-j1,i=v1({r:11.031566904639861*a-9.866943908131562*n-.16462299650829934*l,g:-3.2541473810744237*a+4.418770377582723*n-.16462299650829934*l,b:-3.6588512867136815*a+2.7129230459360922*n+1.9459282407775895*l});return r!==void 0&&(i.alpha=r),i},p0=G3;var W3={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:p0},fromMode:{rgb:f0},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:O,y:O,b:O,alpha:{use:O,fixup:fe}}},C0=W3;var X3={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:V1,lab:Jt},fromMode:{rgb:E1,lab:Yt},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:O,y:O,z:O,alpha:{use:O,fixup:fe}}},m0=X3;var Q3=e=>{let{x:t,y:o,z:r,alpha:a}=e;t===void 0&&(t=0),o===void 0&&(o=0),r===void 0&&(r=0);let n={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*o-.0501922295431356*r,y:.0296278156881593*t+.990434484573249*o-.0170738250293851*r,z:-.0092430581525912*t+.0150551448965779*o+.7518742899580008*r};return a!==void 0&&(n.alpha=a),n},g0=Q3;var Y3=e=>{let{x:t,y:o,z:r,alpha:a}=e;t===void 0&&(t=0),o===void 0&&(o=0),r===void 0&&(r=0);let n={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*o+.0632593086610217*r,y:-.0283697069632081*t+1.0099954580058226*o+.021041398966943*r,z:.0123140016883199*t-.0205076964334779*o+1.3303659366080753*r};return a!==void 0&&(n.alpha=a),n},h0=Y3;var J3={mode:"xyz65",toMode:{rgb:l1,xyz50:g0},fromMode:{rgb:n1,xyz50:h0},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:O,y:O,z:O,alpha:{use:O,fixup:fe}}},v0=J3;var e7=({r:e,g:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*o,i:.59597799*e-.2741761*t-.32180189*o,q:.21147017*e-.52261711*t+.31114694*o};return r!==void 0&&(a.alpha=r),a},x0=e7;var t7=({y:e,i:t,q:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"rgb",r:e+.95608445*t+.6208885*o,g:e-.27137664*t-.6486059*o,b:e-1.10561724*t+1.70250126*o};return r!==void 0&&(a.alpha=r),a},L0=t7;var o7={mode:"yiq",toMode:{rgb:L0},fromMode:{rgb:x0},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:O,i:O,q:O,alpha:{use:O,fixup:fe}}},w0=o7;var r7=(e,t)=>Math.round(e*(t=Math.pow(10,t)))/t,a7=(e=4)=>t=>typeof t=="number"?r7(t,e):t,ko=a7;var bx=ko(2);var yx=r1("rgb"),Mx=r1("hsl");var Rr=e=>{let t=er(e);if(!t)return;let o=tr(t.mode);if(!o.serialize||typeof o.serialize=="string"){let r=`color(${o.serialize||`--${t.mode}`} `;return o.channels.forEach((a,n)=>{a!=="alpha"&&(r+=(n?" ":"")+(t[a]!==void 0?t[a]:"none"))}),t.alpha!==void 0&&t.alpha<1&&(r+=` / ${t.alpha}`),r+")"}if(typeof o.serialize=="function")return o.serialize(t)};var fL=ge(w9),pL=ge(P9),CL=ge(E9),mL=ge(D9),gL=ge(O9),hL=ge(dr),vL=ge(cr),xL=ge(F9),LL=ge(N9),wL=ge(q9),IL=ge(z9),bL=ge(eo),yL=ge(K9),ML=ge(to),SL=ge(W9),RL=ge(Y9),HL=ge(J9),kL=ge(e0),PL=ge(t0),TL=ge(o0),VL=ge(a0),EL=ge(l0),DL=ge(i0),OL=ge(s0),_L=ge(c0),BL=ge(g1),AL=ge(C0),ZL=ge(m0),FL=ge(v0),$L=ge(w0);var n7=r1("rgb"),GL=r1("hsl"),WL=r1("oklch"),XL=r1("oklab"),QL=r1("lch"),YL=r1("lab"),JL=ko(3),Sn=null;function l7(){return Sn??(Sn=document.createElement("canvas").getContext("2d")),Sn}function i7(e){try{let t=l7();if(!t)return null;t.fillStyle="#000000",t.fillStyle=e;let o=t.fillStyle;t.fillStyle="#ffffff",t.fillStyle=e;let r=t.fillStyle;return o===r?o:null}catch{return null}}function Rn(e){let t={r:255,g:255,b:255,a:1};if(!e||typeof e!="string")return t;let o=e.trim(),r=z1(o);if(r){let n=n7(r);if(n)return{r:Math.round(Math.min(255,Math.max(0,(n.r??0)*255))),g:Math.round(Math.min(255,Math.max(0,(n.g??0)*255))),b:Math.round(Math.min(255,Math.max(0,(n.b??0)*255))),a:n.alpha??1}}let a=i7(o);if(a){if(a.startsWith("#")){let l=a.slice(1);return{r:parseInt(l.slice(0,2),16),g:parseInt(l.slice(2,4),16),b:parseInt(l.slice(4,6),16),a:1}}let n=a.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(n&&n[1]!=null&&n[2]!=null&&n[3]!=null)return{r:+n[1],g:+n[2],b:+n[3],a:n[4]!=null?+n[4]:1}}return t}var s7=new Set(["initial","inherit","unset","revert","revert-layer"]);function Hr(e){return s7.has((e??"").trim().toLowerCase())}function I0(e){let t=(e??"").trim();if(t===""||Hr(t))return!1;let o=t.toLowerCase();return o!=="currentcolor"&&!o.includes("var(")}function b0(e){let t=e.startsWith("#")?e.slice(1):e;return/^[0-9a-fA-F]+$/.test(t)&&[3,4,6,8].includes(t.length)}function y0(e){let t=Math.round(Math.min(255,Math.max(0,e.r))),o=Math.round(Math.min(255,Math.max(0,e.g))),r=Math.round(Math.min(255,Math.max(0,e.b))),a=Math.min(1,Math.max(0,e.a)),n=`#${[t,o,r].map(l=>l.toString(16).padStart(2,"0")).join("")}`;return a<1?n+Math.round(a*255).toString(16).padStart(2,"0"):n}function Lt(e="#ffffff"){let t=Rn(e);return{declaration:e,native:z1(e)??{mode:"rgb",r:t.r/255,g:t.g/255,b:t.b/255,alpha:t.a},rgba:t,hex:y0({...t,a:1}).slice(1).toUpperCase()}}function Hn(e){return String(Math.round(e*1e4)/100)}function kn(e){let t=e.trim();if(!/^(?:\d+(?:\.\d{1,2})?|\.\d{1,2})$/.test(t))return;let o=Number(t);return Number.isFinite(o)&&o>=0&&o<=100?o:void 0}function M0(e,t,o){return Math.min(100,Math.max(0,Math.round((Number(e)+t*(o?10:1))*100)/100))}function Po({r:e,g:t,b:o,a:r}){let a=[e,t,o].map(Math.round).join(", ");return r===1?`rgb(${a})`:`rgba(${a}, ${r})`}function Pn(e,t){let o=t/100;return o===e.rgba.a?e:Lt(Rr({...e.native,alpha:o}))}function S0(e,t){let o=t.trim().replace(/^#/,""),r=Rn(`#${o}`);return(o.length===3||o.length===6)&&(r.a=e.rgba.a),Lt(Po(r))}function Tn(e){let t=(e??"").trim();return t===""||t.toLowerCase()==="none"||Hr(t)?"":t}function K1(e){return Tn(e)!==""}function kr(e){return(e??"").trim().toLowerCase()==="text"}function O1(e){let t=[],o=0,r="";for(let a of e)a==="("?o++:a===")"&&o--,a===","&&o===0?(t.push(r.trim()),r=""):r+=a;return r.trim()!==""&&t.push(r.trim()),t}function R0(e,t,o){let r=O1(e),a=O1(t.toLowerCase());if(r.length===0||a.length===0)return"";let n=o.toLowerCase();return r.filter((l,i)=>a[i%a.length]===n&&K1(l)).join(", ")}function H0(e,t){let o=O1(e);if(o.length===0)return"";let r=O1(t.toLowerCase());return o.filter((a,n)=>(r.length===0||!kr(r[n%r.length]))&&K1(a)).join(", ")}function Vn(e,t){let o=O1(t.toLowerCase());if(o.length===0)return!1;let r=O1(e).length||1;return kr(o[(r-1)%o.length])}function k0(e,t,o,r){let a=O1(e);if(a.length===0)return"";let n=O1(t.toLowerCase());return n.length===0?r==="unchanged"?e:a.map(()=>"none").join(", "):a.map((l,i)=>o(n[i%n.length])?"none":l).join(", ")}function P0(e,t){return k0(e,t,kr,"unchanged")}function T0(e,t){return k0(e,t,o=>!kr(o),"clearAll")}function V0(e,t){let o=O1(t.toLowerCase());if(o.length===0)return t;let a=((O1(e).length||1)-1)%o.length;return o.map((n,l)=>l===a?"border-box":n).join(", ")}function En(e,t,o=!1){let r=(e??"").trim();return r===""||Hr(r)||r.toLowerCase()==="currentcolor"?!1:o||t==null?!0:r.toLowerCase()!==t.trim().toLowerCase()}function E0(e,t,o,r,a=K1,n="none"){if(e.trim()==="")return[];let l=(r??"").trim();if(l.toLowerCase()===n.toLowerCase())return[];let i=l||(o??"");return a(i)?[{property:t,oldValue:i,newValue:n}]:[]}import{jsx as Be,jsxs as x1}from"react/jsx-runtime";var Dn=16,oo=4,d7=280,D0=284,c7=200,f7="linear-gradient(45deg, #e0e0e0 25%, transparent 25%), linear-gradient(-45deg, #e0e0e0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e0e0e0 75%), linear-gradient(-45deg, transparent 75%, #e0e0e0 75%)";function p7(e){let t=q1(e);return t?t.getBoundingClientRect():{top:0,bottom:window.innerHeight,left:0,right:window.innerWidth}}function C7(e,t=d7){let o=e.getBoundingClientRect(),r=p7(e),a=r.bottom-o.bottom-oo,n=o.top-r.top-oo,i=a<t&&n>=t?o.top-t-oo:o.bottom+oo;i=Math.max(r.top+oo,Math.min(i,r.bottom-t-oo));let s=o.left;return s+D0>r.right&&(s=r.right-D0-Dn),s<r.left+Dn&&(s=r.left+Dn),{top:i,left:s}}function O0(e,t){let o=e||Po(t);return t.a>=1?{backgroundColor:o}:{backgroundColor:o,backgroundImage:`linear-gradient(0deg, ${o}, ${o}), ${f7}`,backgroundSize:"100% 100%, 8px 8px, 8px 8px, 8px 8px, 8px 8px",backgroundPosition:"0 0, 0 0, 0 4px, 4px -4px, -4px 0"}}var m7={placeholder:"Enter six-digit HEX",ariaValue:"{0} HEX color value",ariaOpenPicker:"{0}, open color picker. Current color: {1}",ariaPicker:"{0} picker",ariaSaturation:"Saturation {0}%, brightness {1}%",ariaEyedropper:"Pick color from screen",ariaHue:"Hue, 0 to 360 degrees",ariaAlphaSlider:"Alpha transparency, 0 to 100 percent",ariaHex:"Hexadecimal color value",ariaChannel:"{0} ({1}), {2} to {3}",ariaAlphaInput:"Alpha, 0 to 100 percent",ariaOpacity:"{0} opacity, 0 to 100 percent",invalidHex:"Enter a HEX color with 3, 4, 6, or 8 digits, with or without #.",invalidOpacity:"Enter an opacity from 0 to 100 with up to two decimal places.",invalidChannel:"Enter a whole number from 0 to 255.",gradientValue:"Gradient",imageValue:"Image",ariaRecentColors:"Recently applied colors",ariaApplyRecentColor:"Apply color {0}, opacity {1}%"};function On({value:e,label:t,className:o,validate:r,error:a,onCommit:n,opacity:l=!1,resetVersion:i,readOnly:s=!1,placeholder:u}){let[d,c]=ye.useState(e),[p,g]=ye.useState(!1),f=ye.useRef(!1),M=ye.useId();ye.useEffect(()=>{f.current||c(e)},[e]),ye.useEffect(()=>{f.current=!1,c(e),g(!1)},[i]);let x=()=>{if(!f.current)return;if(d.trim()===""){f.current=!1,c(e),g(!1);return}if(!r(d)){g(!0);return}f.current=!1,c(e),g(!1),(l?Number(d)!==Number(e):d.trim().replace(/^#/,"").toUpperCase()!==e.toUpperCase())&&n(d.trim())};return x1("div",{className:`colorEditor-control ${l?"colorEditor-opacity":""}`,children:[x1("div",{className:"colorEditor-input-suffix",children:[Be("input",{type:"text",inputMode:l?"decimal":void 0,className:o,value:s?e:d,readOnly:s,placeholder:u,"aria-label":t,"aria-invalid":p||void 0,"aria-describedby":p?M:void 0,onChange:w=>{let h=w.target.value;f.current=!0,c(h),g(h.trim()!==""&&!r(h))},onBlur:x,onKeyDown:w=>{if(w.key==="Enter"&&(x(),w.currentTarget.blur()),w.key==="Escape"&&(f.current=!1,c(e),g(!1)),l&&(w.key==="ArrowUp"||w.key==="ArrowDown")){w.preventDefault();let h=kn(d)===void 0?e:d,S=String(M0(h,w.key==="ArrowUp"?1:-1,w.shiftKey));f.current=!1,c(S),g(!1),S!==e&&n(S)}},spellCheck:!1,autoComplete:"off"}),l&&Be("span",{className:"colorEditor-percent","aria-hidden":"true",children:"%"})]}),p&&Be("span",{id:M,className:"colorEditor-error",role:"alert",children:a})]})}function _n({label:e,value:t,onChange:o,id:r="color",aria:a,backgroundImage:n,resetVersion:l,recentColors:i=[],onColorApplied:s}){let u=M1(m7,a),d=`${r}-trigger`,c=`${r}-popover`,[p,g]=ye.useState(()=>Lt(t)),f=ye.useRef(p);f.current=p;let[{colorInput:M,colorState:x},w]=i9(()=>({type:"rgba",...p.rgba})),h=ye.useRef(o);h.current=o;let S=ye.useRef(s);S.current=s;let H=ye.useRef(void 0),k=ye.useRef(null),Z=ye.useCallback(()=>{let v=H.current;H.current=void 0,v!==void 0&&S.current?.(v)},[]),V=ye.useCallback(v=>{h.current(v),H.current=v},[]),L=s9(V,c7),y=Yo({computePosition:C7,onClose:()=>{L.flush(),Z()},trapFocus:!0}),R=ye.useRef(t);ye.useEffect(()=>{if(R.current===t||(R.current=t,t===f.current.declaration))return;H.current=void 0,L.cancel();let v=Lt(t);f.current=v,g(v),w({type:"rgba",...v.rgba})},[t,w,L]),ye.useEffect(()=>()=>{L.cancel(),Z()},[L,Z]),ye.useEffect(()=>{if(!y.isOpen)return;let v=()=>{L.flush()};return document.addEventListener("mouseup",v),document.addEventListener("touchend",v),()=>{document.removeEventListener("mouseup",v),document.removeEventListener("touchend",v)}},[y.isOpen,L]);let _=(v,b=!1,G=!1)=>{!G&&v.declaration===f.current.declaration||(L.cancel(),f.current=v,g(v),w({type:"rgba",...v.rgba}),b?L(v.declaration):V(v.declaration))},N=ye.useRef(_);N.current=_;let K=ye.useCallback(v=>{let b=v.getRgba(),G=f.current;z.current?N.current(Pn(G,b.a*100),!0):N.current(Lt(Po({...b,a:G.rgba.a})),!0)},[]),z=ye.useRef(!1),W=v=>{let b=v.target;z.current=!!b.closest(".colorEditor-picker-alpha"),b.closest('[role="slider"]')?.focus({preventScroll:!0})},F=(v,b=!1)=>{let G=v.relatedTarget;G instanceof Node&&(k.current?.contains(G)||y.popoverRef.current?.contains(G))||y.isOpen&&(b||G===null)||(L.flush(),Z())},D=v=>{let b=v.target.closest('[role="slider"]');b instanceof HTMLElement&&b.focus(),L.flush()};ye.useLayoutEffect(()=>{if(!y.isOpen||!y.popoverRef.current)return;let v=y.popoverRef.current.offsetHeight;v<=0||y.reposition(v)},[y.isOpen,y.reposition,i.length]);let B=x?.hsva??{h:0,s:0,v:100,a:1},U=Math.round(B.s),A=Math.round(B.v);ye.useEffect(()=>{let v=y.popoverRef.current;if(!y.isOpen||!v)return;let b=(oe,ce,he)=>{oe&&oe.getAttribute(ce)!==he&&oe.setAttribute(ce,he)},G=()=>{let oe=v.querySelector(".colorEditor-picker-saturation [role=slider]");b(oe,"aria-label",e),b(oe,"aria-valuetext",Re(u.ariaSaturation,[U,A])),b(oe,"aria-valuenow",String(U)),b(oe,"aria-valuemin","0"),b(oe,"aria-valuemax","100"),b(v.querySelector(".colorEditor-picker-hue [role=slider]"),"aria-label",u.ariaHue),b(v.querySelector(".colorEditor-picker-alpha [role=slider]"),"aria-label",u.ariaAlphaSlider)};G();let J=new MutationObserver(G);return J.observe(v,{subtree:!0,attributes:!0,attributeFilter:["aria-valuetext"]}),()=>J.disconnect()});let q=p.rgba,T=Tn(n),j=T!==""&&q.a===0,m=j?/url\(/i.test(T)?u.imageValue:u.gradientValue:p.hex,I=j?{backgroundImage:T,backgroundSize:"cover",backgroundPosition:"center"}:O0(p.declaration,q),P=v=>Be(On,{value:v?m:p.hex,label:v?Re(u.ariaValue,[e]):u.ariaHex,className:v?"colorEditor-value-input":"colorEditor-input-hex",placeholder:v?u.placeholder:void 0,validate:b=>b0(b.trim()),error:u.invalidHex,onCommit:b=>_(S0(f.current,b)),resetVersion:l,readOnly:v&&j}),C=v=>Be(On,{value:Hn(q.a),label:v?Re(u.ariaOpacity,[e]):u.ariaAlphaInput,className:v?"colorEditor-value-input":"colorEditor-input-rgba",validate:b=>kn(b)!==void 0,error:u.invalidOpacity,onCommit:b=>_(Pn(f.current,Number(b))),resetVersion:l,opacity:!0}),$=ye.useMemo(()=>{let v=y.triggerRef.current;if(!v)return document.body;let b=v.getRootNode();return b instanceof ShadowRoot?b:document.body},[y.isOpen,y.triggerRef]);return x1(m1,{label:e,id:r,className:"colorEditor-fieldset",children:[x1("div",{ref:k,className:"colorEditor-wrapper",onBlur:v=>F(v,!0),children:[Be("button",{ref:y.triggerRef,id:d,type:"button",className:"colorEditor-swatch-only",onClick:y.toggle,"aria-expanded":y.isOpen,"aria-haspopup":"dialog","aria-controls":c,"aria-label":Re(u.ariaOpenPicker,[e,m]),children:Be("span",{style:I,"aria-hidden":"true",className:"colorEditor-swatch"})}),P(!0),!j&&C(!0)]}),y.isOpen&&u7(x1("div",{ref:y.popoverRef,id:c,role:"dialog","aria-modal":"true","aria-label":Re(u.ariaPicker,[e]),style:{top:y.position.top,left:y.position.left},onDragStart:v=>v.preventDefault(),onMouseUp:D,onMouseDownCapture:W,onTouchStartCapture:W,onPointerDownCapture:W,onKeyDownCapture:v=>{z.current=!!v.target.closest(".colorEditor-picker-alpha")},className:"colorEditor-popover",onBlur:F,children:[x1(qt,{color:M,onChange:K,className:"colorEditor-picker",children:[Be(qt.Saturation,{className:"colorEditor-picker-saturation"}),x1("div",{className:"colorEditor-picker-toolbar",children:[Be(qt.EyeDropper,{title:u.ariaEyedropper,children:Be(Co,{size:18,"aria-hidden":"true"})}),x1("div",{className:"colorEditor-picker-sliders",children:[Be(qt.Hue,{className:"colorEditor-picker-hue"}),Be(qt.Alpha,{className:"colorEditor-picker-alpha"})]})]})]}),x1("div",{className:"colorEditor-input-wrapper",children:[x1("div",{className:"colorEditor-input-group",children:[P(!1),Be("span",{className:"colorEditor-input-label",children:"HEX"})]}),["r","g","b"].map(v=>x1("div",{className:"colorEditor-input-group",children:[Be(On,{value:String(q[v]),className:"colorEditor-input-rgba",label:Re(u.ariaChannel,[v.toUpperCase(),"RGB",0,255]),validate:b=>/^\d+$/.test(b.trim())&&Number(b)<=255,error:u.invalidChannel,resetVersion:l,onCommit:b=>_(Lt(Po({...f.current.rgba,[v]:Number(b)})))}),Be("span",{className:"colorEditor-input-label",children:v.toUpperCase()})]},v)),x1("div",{className:"colorEditor-input-group",children:[C(!1),Be("span",{className:"colorEditor-input-label",children:"A"})]})]}),i.length>0&&Be("div",{className:"colorEditor-recent-colors",role:"group","aria-label":u.ariaRecentColors,children:i.slice(0,20).map(v=>{let b=Lt(v),G=Re(u.ariaApplyRecentColor,[`#${b.hex}`,Hn(b.rgba.a)]);return Be("button",{type:"button",className:"colorEditor-recent-color","aria-label":G,title:`#${b.hex}`,onClick:()=>_(b,!1,!0),children:Be("span",{className:"colorEditor-swatch",style:O0(v,b.rgba),"aria-hidden":"true"})},v)})})]}),$)]})}import Ye from"react";import{jsx as G1,jsxs as Bn}from"react/jsx-runtime";var g7={ariaValue:"{0} value",ariaActions:"{0} options",useNormalLineHeight:"Normal",useNormalSpacing:"Normal",useInherit:"Inherited",invalidRange:"Set a value between {0} and {1}."};function _0(e){let t=q1(e)?.getBoundingClientRect();return{top:Math.max(0,t?.top??0),left:Math.max(0,t?.left??0),bottom:Math.min(window.innerHeight,t?.bottom??window.innerHeight),right:Math.min(window.innerWidth,t?.right??window.innerWidth)}}function Pr({label:e,value:t,onChange:o,id:r="dimension",aria:a,unit:n,icon:l,constraints:i,presets:s,normalLabelKey:u,displayValue:d,measurement:c,resetVersion:p}){let g=M1(g7,a),f=u!==void 0,M=fo(n,i),[x,w]=Ye.useState({}),h=Yo({restoreFocusOnOutside:!1,computePosition:(C,$=200,v=76)=>{let b=C.getBoundingClientRect(),G=_0(C);v=Math.min(v,Math.max(0,G.bottom-G.top-8)),$=Math.min($,Math.max(0,G.right-G.left-8));let J=b.bottom+v+4>G.bottom?b.top-v-4:b.bottom+4;return{top:Math.max(G.top+4,Math.min(J,G.bottom-v-4)),left:Math.max(G.left+4,Math.min(b.right-$,G.right-$-4))}}});Ye.useLayoutEffect(()=>{if(!h.isOpen||!h.popoverRef.current||!h.triggerRef.current)return;let C=_0(h.triggerRef.current);w({maxHeight:Math.max(0,C.bottom-C.top-8),maxWidth:Math.max(0,C.right-C.left-8)})},[h.isOpen]),Ye.useLayoutEffect(()=>{if(!h.isOpen||!h.popoverRef.current)return;let{width:C,height:$}=h.popoverRef.current.getBoundingClientRect();h.reposition(C,$)},[h.isOpen,h.reposition,x]);let[S,H]=Ye.useState(d),k=Ye.useRef(o);k.current=o;let Z=Ye.useRef(t),V=Ye.useRef(!1),L=Ye.useRef(d),y=Ye.useRef(d),R=Ye.useRef(c),_=Ye.useRef(!1),N=Ye.useRef(p),[K,z]=Ye.useState(!1),W=Ye.useRef(void 0),F=()=>{clearTimeout(W.current),W.current=void 0};Ye.useEffect(()=>()=>clearTimeout(W.current),[]),Ye.useEffect(()=>{let C=p!==N.current;N.current=p;let $=t!==Z.current,v=d!==y.current&&L.current===y.current||c!==R.current;y.current=d,R.current=c,Z.current=t,C||($||v)&&!V.current?(F(),H(d),L.current=d,V.current=!1,_.current=!1,z(!1)):v&&(_.current=!0)},[t,d,c,p]);let D=C=>a1(C)&&a1(L.current)&&Number(C)===Number(L.current),B=C=>{let $=C.trim().toLowerCase();return!a1($)||D($)?!0:Number($)>=M.min&&Number($)<=M.max},U=C=>{F(),z(!1),W.current=setTimeout(()=>{W.current=void 0,z(!B(C))},300)},A=(C,$=!1)=>{F();let v=_.current,b=C.trim().toLowerCase(),G=b==="inherit"||f&&b==="normal";if(!G&&!a1(b)){z(!1),(v||Z.current?.trim().toLowerCase()==="inherit")&&(L.current=d),_.current=!1,H(L.current),V.current=!1;return}if(!B(C)){z(!0);return}if(z(!1),_.current=!1,!$&&(b===L.current||D(b))){v&&(L.current=d),H(L.current),V.current=!1;return}let J=b==="inherit"?d:G?b:String(xa(Number(b),n,i)),oe=J===L.current;if(V.current=!1,H(J),oe&&!$&&b!=="inherit")return;L.current=J;let ce=G?b:`${J}${n}`;ce!==Z.current&&(Z.current=ce,k.current(ce))},q=C=>{if(C.key==="Enter"){V.current&&A(S),C.currentTarget.blur();return}if(C.key==="ArrowUp"||C.key==="ArrowDown"){C.preventDefault();let $=S.trim().toLowerCase();if(!V.current&&t?.trim().toLowerCase()==="inherit"||$==="inherit"||f&&$==="normal")return;if(V.current&&!B(S)){F(),z(!0);return}if(!a1(S.trim()))return;A(I2(S,C.key,C.shiftKey,n,i))}},T=`${r}-input`,j=C=>{let $=t?.trim().toLowerCase()??"";if(!a1(C))return $===C;let v=$.match(y2);if(!v)return!1;let b=Number(v[1]);return Number.isFinite(b)&&b===Number(C)&&(v[2]===n||b===0)},m=[...u?[{label:g[u],value:"normal"}]:[],{label:g.useInherit,value:"inherit"}],I=s.map(C=>({label:String(C),value:String(C)})),P=C=>G1("button",{type:"button",role:"menuitemcheckbox","aria-checked":j(C.value),tabIndex:-1,onClick:()=>{A(C.value,!0),h.close()},children:C.label},C.value);return G1(m1,{label:e,id:r,className:"dimensionEditor-fieldset",children:Bn("div",{onBlur:C=>{C.relatedTarget instanceof Node&&C.currentTarget.contains(C.relatedTarget)||h.isOpen&&h.close(!1)},children:[Bn("div",{className:`dimensionEditor-row${K?" dimensionEditor-row--invalid":""}`,children:[G1("span",{className:"dimensionEditor-icon","aria-hidden":"true",children:G1(l,{size:14,width:14,height:14})}),G1("input",{id:T,type:"text",className:"dimensionEditor-input dimensionEditor-input--with-icon",value:S,onChange:C=>{H(C.target.value),V.current=!0,U(C.target.value)},onPaste:C=>{C.preventDefault();let $=C.currentTarget,v=S.slice(0,$.selectionStart??0)+C.clipboardData.getData("text")+S.slice($.selectionEnd??S.length);H(v),V.current=!0,U(v)},onBlur:()=>{V.current&&A(S)},onKeyDown:q,"aria-label":Re(g.ariaValue,[e]),"aria-invalid":K||void 0,"aria-describedby":K?`${r}-error`:void 0,autoComplete:"off",spellCheck:"false"}),G1("button",{type:"button",className:"dimensionEditor-actions",ref:h.triggerRef,"aria-label":Re(g.ariaActions,[e]),"aria-haspopup":"menu","aria-expanded":h.isOpen,"aria-controls":h.isOpen?`${r}-actions`:void 0,onClick:h.toggle,onKeyDown:C=>{(C.key==="ArrowDown"||C.key==="ArrowUp")&&(C.preventDefault(),h.open())},children:G1(Zo,{width:12,height:12,"aria-hidden":"true"})})]}),h.isOpen&&Bn("div",{id:`${r}-actions`,role:"menu","aria-label":Re(g.ariaActions,[e]),className:"dimensionEditor-menu",ref:h.popoverRef,style:{...x,top:h.position.top,left:h.position.left},onKeyDown:C=>{if(C.key==="Tab"){h.close();return}let $=Array.from(C.currentTarget.querySelectorAll("button")),v=$.indexOf(C.target),b;if(C.key==="Home")b=0;else if(C.key==="End")b=$.length-1;else if(C.key==="ArrowDown")b=(v+1)%$.length;else if(C.key==="ArrowUp")b=(v+$.length-1)%$.length;else return;C.preventDefault(),$[b]?.focus()},children:[m.map(P),G1("div",{role:"separator"}),I.map(P)]}),K&&G1("span",{id:`${r}-error`,role:"alert",className:"dimensionEditor-error",children:Re(g.invalidRange,[String(M.min),String(M.max)])})]})})}function i1(e,t){if(e==null)return{};var o={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;o[r]=e[r]}return o}function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)({}).hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},ne.apply(null,arguments)}var ee=s2(q0(),1),I7=s2(G0(),1);import*as me from"react";import{cloneElement as Gw,Component as Ww,useRef as w1,useCallback as pe,useEffect as _1,useMemo as ro}from"react";var W0=e=>typeof e=="object"&&e!=null&&e.nodeType===1,X0=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",$r=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let o=getComputedStyle(e,null);return X0(o.overflowY,t)||X0(o.overflowX,t)||(r=>{let a=(n=>{if(!n.ownerDocument||!n.ownerDocument.defaultView)return null;try{return n.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!a&&(a.clientHeight<r.scrollHeight||a.clientWidth<r.scrollWidth)})(e)}return!1},Nr=(e,t,o,r,a,n,l,i)=>n<e&&l>t||n>e&&l<t?0:n<=e&&i<=o||l>=t&&i>=o?n-e-r:l>t&&i<o||n<e&&i>o?l-t+a:0,w7=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)},Q0=(e,t)=>{var o,r,a,n;if(typeof document>"u")return[];let{scrollMode:l,block:i,inline:s,boundary:u,skipOverflowHiddenElements:d}=t,c=typeof u=="function"?u:F=>F!==u;if(!W0(e))throw new TypeError("Invalid target");let p=document.scrollingElement||document.documentElement,g=[],f=e;for(;W0(f)&&c(f);){if(f=w7(f),f===p){g.push(f);break}f!=null&&f===document.body&&$r(f)&&!$r(document.documentElement)||f!=null&&$r(f,d)&&g.push(f)}let M=(r=(o=window.visualViewport)==null?void 0:o.width)!=null?r:innerWidth,x=(n=(a=window.visualViewport)==null?void 0:a.height)!=null?n:innerHeight,{scrollX:w,scrollY:h}=window,{height:S,width:H,top:k,right:Z,bottom:V,left:L}=e.getBoundingClientRect(),{top:y,right:R,bottom:_,left:N}=(F=>{let D=window.getComputedStyle(F);return{top:parseFloat(D.scrollMarginTop)||0,right:parseFloat(D.scrollMarginRight)||0,bottom:parseFloat(D.scrollMarginBottom)||0,left:parseFloat(D.scrollMarginLeft)||0}})(e),K=i==="start"||i==="nearest"?k-y:i==="end"?V+_:k+S/2-y+_,z=s==="center"?L+H/2-N+R:s==="end"?Z+R:L-N,W=[];for(let F=0;F<g.length;F++){let D=g[F],{height:B,width:U,top:A,right:q,bottom:T,left:j}=D.getBoundingClientRect();if(l==="if-needed"&&k>=0&&L>=0&&V<=x&&Z<=M&&(D===p&&!$r(D)||k>=A&&V<=T&&L>=j&&Z<=q))return W;let m=getComputedStyle(D),I=parseInt(m.borderLeftWidth,10),P=parseInt(m.borderTopWidth,10),C=parseInt(m.borderRightWidth,10),$=parseInt(m.borderBottomWidth,10),v=0,b=0,G="offsetWidth"in D?D.offsetWidth-D.clientWidth-I-C:0,J="offsetHeight"in D?D.offsetHeight-D.clientHeight-P-$:0,oe="offsetWidth"in D?D.offsetWidth===0?0:U/D.offsetWidth:0,ce="offsetHeight"in D?D.offsetHeight===0?0:B/D.offsetHeight:0;if(p===D)v=i==="start"?K:i==="end"?K-x:i==="nearest"?Nr(h,h+x,x,P,$,h+K,h+K+S,S):K-x/2,b=s==="start"?z:s==="center"?z-M/2:s==="end"?z-M:Nr(w,w+M,M,I,C,w+z,w+z+H,H),v=Math.max(0,v+h),b=Math.max(0,b+w);else{v=i==="start"?K-A-P:i==="end"?K-T+$+J:i==="nearest"?Nr(A,T,B,P,$+J,K,K+S,S):K-(A+B/2)+J/2,b=s==="start"?z-j-I:s==="center"?z-(j+U/2)+G/2:s==="end"?z-q+C+G:Nr(j,q,U,I,C+G,z,z+H,H);let{scrollLeft:he,scrollTop:Me}=D;v=ce===0?0:Math.max(0,Math.min(Me+v/ce,D.scrollHeight-B/ce+J)),b=oe===0?0:Math.max(0,Math.min(he+b/oe,D.scrollWidth-U/oe+G)),K+=Me-v,z+=he-b}W.push({el:D,top:v,left:b})}return W};var b7=0;function ai(){return String(b7++)}function Eo(e){var t=me.useRef(e);return t.current=e,t}function y7(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){t.forEach(function(a){typeof a=="function"?a(r):a&&(a.current=r)})}}function Fn(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){for(var a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];return t.some(function(i){return i&&i.apply(void 0,[r].concat(n)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function ni(e,t){var o;function r(){o&&clearTimeout(o)}function a(){for(var n=arguments.length,l=new Array(n),i=0;i<n;i++)l[i]=arguments[i];r(),o=setTimeout(function(){o=null,e.apply(void 0,l)},t)}return a.cancel=r,a}var M7=ni(function(e){li(e).textContent=""},500);function li(e){var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function S7(e,t){if(!(!e||!t)){var o=li(t);o.textContent=e,M7(t)}}function R7(e){var t=e?.getElementById("a11y-status-message");t&&t.remove()}function Do(){}var Nn=Do;function qr(e,t){if(!t)return e;var o=Object.keys(e);return o.reduce(function(r,a){return t[a]!==void 0&&(r[a]=t[a]),r},ne({},e))}function H7(e,t){if(e){var o=Q0(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});o.forEach(function(r){var a=r.el,n=r.top,l=r.left;a.scrollTop=n,a.scrollLeft=l})}}function Y0(e,t,o){var r=e===t||t instanceof o.Node&&e.contains&&e.contains(t);return r}function k7(e,t){var o;function r(){o&&clearTimeout(o)}function a(){for(var n=arguments.length,l=new Array(n),i=0;i<n;i++)l[i]=arguments[i];r(),o=setTimeout(function(){o=null,e.apply(void 0,l)},t)}return a.cancel=r,a}function Pe(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){for(var a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];return t.some(function(i){return i&&i.apply(void 0,[r].concat(n)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function W1(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){t.forEach(function(a){typeof a=="function"?a(r):a&&(a.current=r)})}}function P7(e,t){return e[t]!==void 0}function zr(e){var t=e.key,o=e.keyCode;return o>=37&&o<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function wt(e,t,o,r,a){a===void 0&&(a=!1);var n=o.length;if(n===0)return-1;var l=n-1;(typeof e!="number"||e<0||e>l)&&(e=t>0?-1:l+1);var i=e+t;i<0?i=a?l:0:i>l&&(i=a?0:l);var s=ao(i,t<0,o,r,a);return s===-1?e>=n?-1:e:s}function ao(e,t,o,r,a){a===void 0&&(a=!1);var n=o.length;if(t){for(var l=e;l>=0;l--)if(!r(o[l],l))return l}else for(var i=e;i<n;i++)if(!r(o[i],i))return i;return a?ao(t?n-1:0,t,o,r):-1}function J0(e,t,o,r){return r===void 0&&(r=!0),o&&t.some(function(a){return a&&(Y0(a,e,o)||r&&Y0(a,o.document.activeElement,o))})}function Un(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function T7(e,t,o,r){for(var a=e.type,n={},l=Object.keys(o),i=0,s=l;i<s.length;i++){var u=s[i];V7(u,e,t,o,r),r[u]!==o[u]&&(n[u]=r[u])}t.onStateChange&&Object.keys(n).length&&t.onStateChange(ne({type:a},n))}function V7(e,t,o,r,a){if(a[e]!==r[e]){var n="on"+Un(e)+"Change",l=o[n];if(typeof l=="function"){var i=t.type;l(ne({type:i},a))}}}function ii(e,t,o,r){var a=me.useRef(null),n=me.useRef(void 0),l=Eo(t),i=me.useCallback(function(p,g){n.current=g,p=qr(p,l.current);var f=e(p,l.current,g),M=l.current.stateReducer(p,ne({},g,{changes:f}));return ne({},p,M)},[l,e]),s=me.useReducer(i,t,o),u=s[0],d=s[1],c=n.current;return me.useEffect(function(){var p,g=qr((p=a.current)!=null?p:{},l.current),f=c&&a.current&&!r(g,u);f&&T7(c,l.current,g,u),a.current=u},[u,c,r,l]),[u,d]}function qn(e,t,o,r){var a=ii(e,t,o,r),n=a[0],l=a[1];return[qr(n,t),l]}function zn(e,t,o,r){if(e!==void 0&&t!==void 0)return[e,t];if(e!==void 0){var a=o.indexOf(e);if(a<0)throw new Error(r);return[e,o.indexOf(e)]}if(t!==void 0){var n=o[t];if(n===void 0)throw new Error(r);return[n,t]}throw new Error(r)}function Qr(){var e=me.useRef(!0);return me.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function E7(e,t){return t.changes}var D7={environment:ee.default.shape({addEventListener:ee.default.func.isRequired,removeEventListener:ee.default.func.isRequired,document:ee.default.shape({createElement:ee.default.func.isRequired,getElementById:ee.default.func.isRequired,activeElement:ee.default.any.isRequired,body:ee.default.any.isRequired}).isRequired,Node:ee.default.func.isRequired}),itemToKey:ee.default.func,stateReducer:ee.default.func};function B1(e,t,o){var r=e["default"+Un(t)];return r!==void 0?r:o[t]}function Dt(e,t,o){var r=e[t];if(r!==void 0)return r;var a=e["initial"+Un(t)];return a!==void 0?a:B1(e,t,o)}var ei=ni(function(e,t){S7(e,t)},200);function jn(e,t,o,r){var a=r?.document,n=Qr();me.useEffect(function(){if(!(!e||n||!a)){var l=e(t);ei(l,a)}},o),me.useEffect(function(){return function(){ei.cancel(),R7(a)}},[a])}var To=ne({},D7,{getA11yStatusMessage:ee.default.func,highlightedIndex:ee.default.number,defaultHighlightedIndex:ee.default.number,initialHighlightedIndex:ee.default.number,isOpen:ee.default.bool,defaultIsOpen:ee.default.bool,initialIsOpen:ee.default.bool,selectedItem:ee.default.any,initialSelectedItem:ee.default.any,defaultSelectedItem:ee.default.any,id:ee.default.string,labelId:ee.default.string,menuId:ee.default.string,getItemId:ee.default.func,toggleButtonId:ee.default.string,onSelectedItemChange:ee.default.func,onHighlightedIndexChange:ee.default.func,onStateChange:ee.default.func,onIsOpenChange:ee.default.func,scrollIntoView:ee.default.func}),Vo={itemToString:function(t){return t?String(t):""},itemToKey:function(t){return t},stateReducer:E7,scrollIntoView:H7,environment:typeof window>"u"?void 0:window},s1={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""},O7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?me.useLayoutEffect:me.useEffect;function _7(e){return/^\S{1}$/.test(e)}function si(e){var t=Dt(e,"selectedItem",s1),o=Dt(e,"isOpen",s1),r=B7(e),a=Dt(e,"inputValue",s1);return{highlightedIndex:r<0&&t&&o?e.items.findIndex(function(n){return e.itemToKey(n)===e.itemToKey(t)}):r,isOpen:o,selectedItem:t,inputValue:a}}function Ot(e,t,o){var r=e.items,a=e.initialHighlightedIndex,n=e.defaultHighlightedIndex,l=e.isItemDisabled,i=e.itemToKey,s=t.selectedItem,u=t.highlightedIndex;return r.length===0?-1:a!==void 0&&u===a&&!l(r[a],a)?a:n!==void 0&&!l(r[n],n)?n:s?r.findIndex(function(d){return i(s)===i(d)}):o<0&&!l(r[r.length-1],r.length-1)?r.length-1:o>0&&!l(r[0],0)?0:-1}function ui(e,t,o){var r=me.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),a=me.useCallback(function(){return o.map(function(n){return n.current})},[o]);return me.useEffect(function(){if(!e)return Do;function n(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function l(d){r.current.isMouseDown=!1,J0(d.target,a(),e)||t()}function i(){r.current.isTouchEnd=!1,r.current.isTouchMove=!1}function s(){r.current.isTouchMove=!0}function u(d){r.current.isTouchEnd=!0,!r.current.isTouchMove&&!J0(d.target,a(),e,!1)&&t()}return e.addEventListener("mousedown",n),e.addEventListener("mouseup",l),e.addEventListener("touchstart",i),e.addEventListener("touchmove",s),e.addEventListener("touchend",u),function(){e.removeEventListener("mousedown",n),e.removeEventListener("mouseup",l),e.removeEventListener("touchstart",i),e.removeEventListener("touchmove",s),e.removeEventListener("touchend",u)}},[e,a,t]),r.current}var Kn=function(){return Do};function di(e){var t=e.highlightedIndex,o=e.isOpen,r=e.itemRefs,a=e.getItemNodeFromIndex,n=e.menuElement,l=e.scrollIntoView,i=me.useRef(!0);return O7(function(){t<0||!o||!Object.keys(r.current).length||(i.current===!1?i.current=!0:l(a(t),n))},[t]),i}var Gn=Do;function jr(e,t,o){var r;o===void 0&&(o=!0);var a=((r=e.items)==null?void 0:r.length)&&t>=0;return ne({isOpen:!1,highlightedIndex:-1},a&&ne({selectedItem:e.items[t],isOpen:B1(e,"isOpen",s1),highlightedIndex:B1(e,"highlightedIndex",s1)},o&&{inputValue:e.itemToString(e.items[t])}))}function ci(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function Kr(e){var t=B1(e,"highlightedIndex",s1);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function B7(e){var t=Dt(e,"highlightedIndex",s1);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function fi(e,t,o,r){var a=o.type,n;switch(a){case r.ItemMouseMove:n={highlightedIndex:o.disabled?-1:o.index};break;case r.MenuMouseLeave:n={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:n={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ot(t,e,0)};break;case r.FunctionOpenMenu:n={isOpen:!0,highlightedIndex:Ot(t,e,0)};break;case r.FunctionCloseMenu:n={isOpen:!1};break;case r.FunctionSetHighlightedIndex:n={highlightedIndex:t.isItemDisabled(t.items[o.highlightedIndex],o.highlightedIndex)?-1:o.highlightedIndex};break;case r.FunctionSetInputValue:n={inputValue:o.inputValue};break;case r.FunctionReset:n={highlightedIndex:Kr(t),isOpen:B1(t,"isOpen",s1),selectedItem:B1(t,"selectedItem",s1),inputValue:B1(t,"inputValue",s1)};break;default:throw new Error("Reducer called without proper action type.")}return ne({},e,n)}var A7=ne({},To,{items:ee.default.array.isRequired,isItemDisabled:ee.default.func}),Z7=ne({},Vo,{isItemDisabled:function(){return!1}});function F7(e){for(var t=e.keysSoFar,o=e.highlightedIndex,r=e.items,a=e.itemToString,n=e.isItemDisabled,l=t.toLowerCase(),i=0;i<r.length;i++){var s=(i+o+(t.length<2?1:0))%r.length,u=r[s];if(u!==void 0&&a(u).toLowerCase().startsWith(l)&&!n(u,s))return s}return o}var Ur=0,Wn=1,Xn=2,Gr=3,Qn=4,Yn=5,Jn=6,el=7,tl=8,ol=9,rl=10,Wr=11,pi=12,Ci=13,al=14,mi=15,gi=16,hi=17,vi=18,nl=19,$n=20,xi=21,Li=Object.freeze({__proto__:null,FunctionCloseMenu:hi,FunctionOpenMenu:gi,FunctionReset:xi,FunctionSelectItem:nl,FunctionSetHighlightedIndex:vi,FunctionSetInputValue:$n,FunctionToggleMenu:mi,ItemClick:al,ItemMouseMove:Ci,MenuMouseLeave:pi,ToggleButtonBlur:Wr,ToggleButtonClick:Ur,ToggleButtonKeyDownArrowDown:Wn,ToggleButtonKeyDownArrowUp:Xn,ToggleButtonKeyDownCharacter:Gr,ToggleButtonKeyDownEnd:Jn,ToggleButtonKeyDownEnter:el,ToggleButtonKeyDownEscape:Qn,ToggleButtonKeyDownHome:Yn,ToggleButtonKeyDownPageDown:rl,ToggleButtonKeyDownPageUp:ol,ToggleButtonKeyDownSpaceButton:tl});function $7(e,t,o){var r,a=o.type,n=o.altKey,l;switch(a){case al:l={isOpen:B1(t,"isOpen",s1),highlightedIndex:Kr(t),selectedItem:t.items[o.index]};break;case Gr:{var i=o.key,s=""+e.inputValue+i,u=!e.isOpen&&e.selectedItem?t.items.findIndex(function(g){return t.itemToKey(g)===t.itemToKey(e.selectedItem)}):e.highlightedIndex,d=F7({keysSoFar:s,highlightedIndex:u,items:t.items,itemToString:t.itemToString,isItemDisabled:t.isItemDisabled});l={inputValue:s,highlightedIndex:d,isOpen:!0}}break;case Wn:{var c=e.isOpen?wt(e.highlightedIndex,1,t.items,t.isItemDisabled):n&&e.selectedItem==null?-1:Ot(t,e,1);l={highlightedIndex:c,isOpen:!0}}break;case Xn:if(e.isOpen&&n)l=jr(t,e.highlightedIndex,!1);else{var p=e.isOpen?wt(e.highlightedIndex,-1,t.items,t.isItemDisabled):Ot(t,e,-1);l={highlightedIndex:p,isOpen:!0}}break;case el:case tl:l=jr(t,e.highlightedIndex,!1);break;case Yn:l={highlightedIndex:ao(0,!1,t.items,t.isItemDisabled),isOpen:!0};break;case Jn:l={highlightedIndex:ao(t.items.length-1,!0,t.items,t.isItemDisabled),isOpen:!0};break;case ol:l={highlightedIndex:wt(e.highlightedIndex,-10,t.items,t.isItemDisabled)};break;case rl:l={highlightedIndex:wt(e.highlightedIndex,10,t.items,t.isItemDisabled)};break;case Qn:l={isOpen:!1,highlightedIndex:-1};break;case Wr:l=ne({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((r=t.items)==null?void 0:r.length)&&{selectedItem:t.items[e.highlightedIndex]});break;case nl:l={selectedItem:o.selectedItem};break;default:return fi(e,t,o,Li)}return ne({},e,l)}var N7=ne({},me),wi=N7.useId,Ii=typeof wi=="function"?U7:q7;function U7(e){var t=e.id,o=e.labelId,r=e.menuId,a=e.getItemId,n=e.toggleButtonId,l=e.inputId,i="downshift-"+wi();t||(t=i);var s=me.useMemo(function(){return{labelId:o??t+"-label",menuId:r??t+"-menu",getItemId:a??function(u){return t+"-item-"+u},toggleButtonId:n??t+"-toggle-button",inputId:l??t+"-input"}},[a,t,l,o,r,n]);return s}function q7(e){var t=e.id,o=e.labelId,r=e.menuId,a=e.getItemId,n=e.toggleButtonId,l=e.inputId,i=me.useRef(t??"downshift-"+ai()),s=i.current,u=me.useMemo(function(){return{labelId:o??s+"-label",menuId:r??s+"-menu",getItemId:a??function(d){return s+"-item-"+d},toggleButtonId:n??s+"-toggle-button",inputId:l??s+"-input"}},[a,l,o,r,n,s]);return u}var z7=["onClick"],j7=["onMouseLeave","refKey","ref"],K7=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],G7=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];Oo.stateChangeTypes=Li;function Oo(e){e===void 0&&(e={}),Nn(e,Oo,A7);var t=ne({},Z7,e),o=t.scrollIntoView,r=t.environment,a=t.getA11yStatusMessage,n=qn($7,t,si,ci),l=n[0],i=n[1],s=l.isOpen,u=l.highlightedIndex,d=l.selectedItem,c=l.inputValue,p=w1(null),g=w1(null),f=w1({}),M=w1(null),x=Ii(t),w=Eo({state:l,props:t}),h=pe(function(A){return f.current[x.getItemId(A)]},[x]);jn(a,l,[s,u,d,c],r);var S=di({menuElement:g.current,highlightedIndex:u,isOpen:s,itemRefs:f,scrollIntoView:o,getItemNodeFromIndex:h});_1(function(){return M.current=k7(function(A){A({type:$n,inputValue:""})},500),function(){M.current.cancel()}},[]),_1(function(){c&&M.current(i)},[i,c]),Gn({props:t,state:l}),_1(function(){var A=Dt(t,"isOpen",s1);A&&p.current&&p.current.focus()},[]);var H=pe(function(){w.current.state.isOpen&&i({type:Wr})},[i,w]),k=ro(function(){return[g,p]},[]),Z=ui(r,H,k),V=Kn("getMenuProps","getToggleButtonProps");_1(function(){s||(f.current={})},[s]);var L=ro(function(){return{ArrowDown:function(q){q.preventDefault(),i({type:Wn,altKey:q.altKey})},ArrowUp:function(q){q.preventDefault(),i({type:Xn,altKey:q.altKey})},Home:function(q){q.preventDefault(),i({type:Yn})},End:function(q){q.preventDefault(),i({type:Jn})},Escape:function(){w.current.state.isOpen&&i({type:Qn})},Enter:function(q){q.preventDefault(),i({type:w.current.state.isOpen?el:Ur})},PageUp:function(q){w.current.state.isOpen&&(q.preventDefault(),i({type:ol}))},PageDown:function(q){w.current.state.isOpen&&(q.preventDefault(),i({type:rl}))}," ":function(q){q.preventDefault();var T=w.current.state;if(!T.isOpen){i({type:Ur});return}T.inputValue?i({type:Gr,key:" "}):i({type:tl})}}},[i,w]),y=pe(function(){i({type:mi})},[i]),R=pe(function(){i({type:hi})},[i]),_=pe(function(){i({type:gi})},[i]),N=pe(function(A){i({type:vi,highlightedIndex:A})},[i]),K=pe(function(A){i({type:nl,selectedItem:A})},[i]),z=pe(function(){i({type:xi})},[i]),W=pe(function(A){i({type:$n,inputValue:A})},[i]),F=pe(function(A){var q=A===void 0?{}:A,T=q.onClick,j=i1(q,z7),m=function(){var P;(P=p.current)==null||P.focus()};return ne({id:x.labelId,htmlFor:x.toggleButtonId,onClick:Pe(T,m)},j)},[x]),D=pe(function(A,q){var T,j=A===void 0?{}:A,m=j.onMouseLeave,I=j.refKey,P=I===void 0?"ref":I,C=j.ref,$=i1(j,j7),v=q===void 0?{}:q,b=v.suppressRefError,G=b===void 0?!1:b,J=function(){i({type:pi})};return V("getMenuProps",G,P,g),ne((T={},T[P]=W1(C,function(oe){g.current=oe}),T.id=x.menuId,T.role="listbox",T["aria-labelledby"]=$&&$["aria-label"]?void 0:""+x.labelId,T.onMouseLeave=Pe(m,J),T),$)},[i,V,x]),B=pe(function(A,q){var T,j=A===void 0?{}:A,m=j.onBlur,I=j.onClick;j.onPress;var P=j.onKeyDown,C=j.refKey,$=C===void 0?"ref":C,v=j.ref,b=i1(j,K7),G=q===void 0?{}:q,J=G.suppressRefError,oe=J===void 0?!1:J,ce=w.current.state,he=function(){i({type:Ur})},Me=function(){ce.isOpen&&!Z.isMouseDown&&i({type:Wr})},p1=function(De){var Se=zr(De);Se&&L[Se]?L[Se](De):_7(Se)&&i({type:Gr,key:Se})},we=ne((T={},T[$]=W1(v,function(Te){p.current=Te}),T["aria-activedescendant"]=ce.isOpen&&ce.highlightedIndex>-1?x.getItemId(ce.highlightedIndex):"",T["aria-controls"]=x.menuId,T["aria-expanded"]=w.current.state.isOpen,T["aria-haspopup"]="listbox",T["aria-labelledby"]=b&&b["aria-label"]?void 0:""+x.labelId,T.id=x.toggleButtonId,T.role="combobox",T.tabIndex=0,T.onBlur=Pe(m,Me),T),b);return b.disabled||(we.onClick=Pe(I,he),we.onKeyDown=Pe(P,p1)),V("getToggleButtonProps",oe,$,p),we},[i,x,w,Z,V,L]),U=pe(function(A){var q,T=A===void 0?{}:A,j=T.item,m=T.index,I=T.onMouseMove,P=T.onClick,C=T.onMouseDown;T.onPress;var $=T.refKey,v=$===void 0?"ref":$,b=T.disabled,G=T.ref,J=i1(T,G7);b!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var oe=w.current,ce=oe.state,he=oe.props,Me=zn(j,m,he.items,"Pass either item or index to getItemProps!"),p1=Me[0],we=Me[1],Te=he.isItemDisabled(p1,we),De=function(){Z.isTouchEnd||we===ce.highlightedIndex||(S.current=!1,i({type:Ci,index:we,disabled:Te}))},Se=function(){i({type:al,index:we})},b1=function(re){return re.preventDefault()},Ne=ne((q={},q[v]=W1(G,function(Oe){Oe&&(f.current[x.getItemId(we)]=Oe)}),q["aria-disabled"]=Te,q["aria-selected"]=p1===ce.selectedItem,q.id=x.getItemId(we),q.role="option",q),J);return Te||(Ne.onClick=Pe(P,Se)),Ne.onMouseMove=Pe(I,De),Ne.onMouseDown=Pe(C,b1),Ne},[w,x,Z,S,i]);return{getToggleButtonProps:B,getLabelProps:F,getMenuProps:D,getItemProps:U,toggleMenu:y,openMenu:_,closeMenu:R,setHighlightedIndex:N,selectItem:K,reset:z,setInputValue:W,highlightedIndex:u,isOpen:s,selectedItem:d,inputValue:c}}var ll=0,il=1,sl=2,ul=3,dl=4,cl=5,fl=6,pl=7,Cl=8,Xr=9,ml=10,bi=11,yi=12,gl=13,Mi=14,Si=15,Ri=16,Hi=17,ki=18,hl=19,Pi=20,Ti=21,vl=22,Vi=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:vl,FunctionCloseMenu:Hi,FunctionOpenMenu:Ri,FunctionReset:Ti,FunctionSelectItem:hl,FunctionSetHighlightedIndex:ki,FunctionSetInputValue:Pi,FunctionToggleMenu:Si,InputBlur:Xr,InputChange:Cl,InputClick:ml,InputKeyDownArrowDown:ll,InputKeyDownArrowUp:il,InputKeyDownEnd:dl,InputKeyDownEnter:pl,InputKeyDownEscape:sl,InputKeyDownHome:ul,InputKeyDownPageDown:fl,InputKeyDownPageUp:cl,ItemClick:gl,ItemMouseMove:yi,MenuMouseLeave:bi,ToggleButtonClick:Mi});function W7(e){var t=si(e),o=t.selectedItem,r=t.inputValue;return r===""&&o&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(o)),ne({},t,{inputValue:r})}var X7=ne({},To,{items:ee.default.array.isRequired,isItemDisabled:ee.default.func,inputValue:ee.default.string,defaultInputValue:ee.default.string,initialInputValue:ee.default.string,inputId:ee.default.string,onInputValueChange:ee.default.func});function Q7(e,t,o,r){var a=w1(),n=ii(e,t,o,r),l=n[0],i=n[1],s=Qr();return _1(function(){if(P7(t,"selectedItem")){if(!s){var u=t.itemToKey(t.selectedItem)!==t.itemToKey(a.current);u&&i({type:vl,inputValue:t.itemToString(t.selectedItem)})}a.current=l.selectedItem===a.current?t.selectedItem:l.selectedItem}},[l.selectedItem,t.selectedItem]),[qr(l,t),i]}var Y7=ne({},Vo,{isItemDisabled:function(){return!1}});function J7(e,t,o){var r,a=o.type,n=o.altKey,l;switch(a){case gl:l={isOpen:B1(t,"isOpen",s1),highlightedIndex:Kr(t),selectedItem:t.items[o.index],inputValue:t.itemToString(t.items[o.index])};break;case ll:e.isOpen?l={highlightedIndex:wt(e.highlightedIndex,1,t.items,t.isItemDisabled,!0)}:l={highlightedIndex:n&&e.selectedItem==null?-1:Ot(t,e,1),isOpen:t.items.length>=0};break;case il:e.isOpen?n?l=jr(t,e.highlightedIndex):l={highlightedIndex:wt(e.highlightedIndex,-1,t.items,t.isItemDisabled,!0)}:l={highlightedIndex:Ot(t,e,-1),isOpen:t.items.length>=0};break;case pl:l=jr(t,e.highlightedIndex);break;case sl:l=ne({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case cl:l={highlightedIndex:wt(e.highlightedIndex,-10,t.items,t.isItemDisabled,!0)};break;case fl:l={highlightedIndex:wt(e.highlightedIndex,10,t.items,t.isItemDisabled,!0)};break;case ul:l={highlightedIndex:ao(0,!1,t.items,t.isItemDisabled)};break;case dl:l={highlightedIndex:ao(t.items.length-1,!0,t.items,t.isItemDisabled)};break;case Xr:l=ne({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((r=t.items)==null?void 0:r.length)&&o.selectItem&&{selectedItem:t.items[e.highlightedIndex],inputValue:t.itemToString(t.items[e.highlightedIndex])});break;case Cl:l={isOpen:!0,highlightedIndex:Kr(t),inputValue:o.inputValue};break;case ml:l={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ot(t,e,0)};break;case hl:l={selectedItem:o.selectedItem,inputValue:t.itemToString(o.selectedItem)};break;case vl:l={inputValue:o.inputValue};break;default:return fi(e,t,o,Vi)}return ne({},e,l)}var e4=["onMouseLeave","refKey","ref"],t4=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],o4=["onClick","onPress","refKey","ref"],r4=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];Ei.stateChangeTypes=Vi;function Ei(e){e===void 0&&(e={}),Nn(e,Ei,X7);var t=ne({},Y7,e),o=t.items,r=t.scrollIntoView,a=t.environment,n=t.getA11yStatusMessage,l=Q7(J7,t,W7,ci),i=l[0],s=l[1],u=i.isOpen,d=i.highlightedIndex,c=i.selectedItem,p=i.inputValue,g=w1(null),f=w1({}),M=w1(null),x=w1(null),w=Qr(),h=Ii(t),S=w1(),H=Eo({state:i,props:t}),k=pe(function(m){return f.current[h.getItemId(m)]},[h]);jn(n,i,[u,d,c,p],a);var Z=di({menuElement:g.current,highlightedIndex:d,isOpen:u,itemRefs:f,scrollIntoView:r,getItemNodeFromIndex:k});Gn({props:t,state:i}),_1(function(){var m=Dt(t,"isOpen",s1);m&&M.current&&M.current.focus()},[]),_1(function(){w||(S.current=o.length)});var V=pe(function(){H.current.state.isOpen&&s({type:Xr})},[s,H]),L=ro(function(){return[g,x,M]},[]),y=ui(a,V,L),R=Kn("getInputProps","getMenuProps");_1(function(){u||(f.current={})},[u]),_1(function(){var m;!u||!(a!=null&&a.document)||!(M!=null&&(m=M.current)!=null&&m.focus)||a.document.activeElement!==M.current&&M.current.focus()},[u,a]);var _=ro(function(){return{ArrowDown:function(I){I.preventDefault(),s({type:ll,altKey:I.altKey})},ArrowUp:function(I){I.preventDefault(),s({type:il,altKey:I.altKey})},Home:function(I){H.current.state.isOpen&&(I.preventDefault(),s({type:ul}))},End:function(I){H.current.state.isOpen&&(I.preventDefault(),s({type:dl}))},Escape:function(I){var P=H.current.state;(P.isOpen||P.inputValue||P.selectedItem||P.highlightedIndex>-1)&&(I.preventDefault(),s({type:sl}))},Enter:function(I){var P=H.current.state;!P.isOpen||I.which===229||(I.preventDefault(),s({type:pl}))},PageUp:function(I){H.current.state.isOpen&&(I.preventDefault(),s({type:cl}))},PageDown:function(I){H.current.state.isOpen&&(I.preventDefault(),s({type:fl}))}}},[s,H]),N=pe(function(m){return ne({id:h.labelId,htmlFor:h.inputId},m)},[h]),K=pe(function(m,I){var P,C=m===void 0?{}:m,$=C.onMouseLeave,v=C.refKey,b=v===void 0?"ref":v,G=C.ref,J=i1(C,e4),oe=I===void 0?{}:I,ce=oe.suppressRefError,he=ce===void 0?!1:ce;return R("getMenuProps",he,b,g),ne((P={},P[b]=W1(G,function(Me){g.current=Me}),P.id=h.menuId,P.role="listbox",P["aria-labelledby"]=J&&J["aria-label"]?void 0:""+h.labelId,P.onMouseLeave=Pe($,function(){s({type:bi})}),P),J)},[s,R,h]),z=pe(function(m){var I,P,C=m===void 0?{}:m,$=C.item,v=C.index,b=C.refKey,G=b===void 0?"ref":b,J=C.ref,oe=C.onMouseMove,ce=C.onMouseDown,he=C.onClick;C.onPress;var Me=C.disabled,p1=i1(C,t4);Me!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var we=H.current,Te=we.props,De=we.state,Se=zn($,v,Te.items,"Pass either item or index to getItemProps!"),b1=Se[0],Ne=Se[1],Oe=Te.isItemDisabled(b1,Ne),re="onClick",Ge=he,He=function(){y.isTouchEnd||Ne===De.highlightedIndex||(Z.current=!1,s({type:yi,index:Ne,disabled:Oe}))},C1=function(){s({type:gl,index:Ne})},y1=function(Y){return Y.preventDefault()};return ne((I={},I[G]=W1(J,function(e1){e1&&(f.current[h.getItemId(Ne)]=e1)}),I["aria-disabled"]=Oe,I["aria-selected"]=Ne===De.highlightedIndex,I.id=h.getItemId(Ne),I.role="option",I),!Oe&&(P={},P[re]=Pe(Ge,C1),P),{onMouseMove:Pe(oe,He),onMouseDown:Pe(ce,y1)},p1)},[s,h,H,y,Z]),W=pe(function(m){var I,P=m===void 0?{}:m,C=P.onClick;P.onPress;var $=P.refKey,v=$===void 0?"ref":$,b=P.ref,G=i1(P,o4),J=H.current.state,oe=function(){s({type:Mi})};return ne((I={},I[v]=W1(b,function(ce){x.current=ce}),I["aria-controls"]=h.menuId,I["aria-expanded"]=J.isOpen,I.id=h.toggleButtonId,I.tabIndex=-1,I),!G.disabled&&ne({},{onClick:Pe(C,oe)}),G)},[s,H,h]),F=pe(function(m,I){var P,C=m===void 0?{}:m,$=C.onKeyDown,v=C.onChange,b=C.onInput,G=C.onBlur;C.onChangeText;var J=C.onClick,oe=C.refKey,ce=oe===void 0?"ref":oe,he=C.ref,Me=i1(C,r4),p1=I===void 0?{}:I,we=p1.suppressRefError,Te=we===void 0?!1:we;R("getInputProps",Te,ce,M);var De=H.current.state,Se=function(y1){var e1=zr(y1);e1&&_[e1]&&_[e1](y1)},b1=function(y1){s({type:Cl,inputValue:y1.target.value})},Ne=function(y1){if(a!=null&&a.document&&De.isOpen&&!y.isMouseDown){var e1=y1.relatedTarget===null&&a.document.activeElement!==a.document.body;s({type:Xr,selectItem:!e1})}},Oe=function(){s({type:ml})},re="onChange",Ge={};if(!Me.disabled){var He;Ge=(He={},He[re]=Pe(v,b,b1),He.onKeyDown=Pe($,Se),He.onBlur=Pe(G,Ne),He.onClick=Pe(J,Oe),He)}return ne((P={},P[ce]=W1(he,function(C1){M.current=C1}),P["aria-activedescendant"]=De.isOpen&&De.highlightedIndex>-1?h.getItemId(De.highlightedIndex):"",P["aria-autocomplete"]="list",P["aria-controls"]=h.menuId,P["aria-expanded"]=De.isOpen,P["aria-labelledby"]=Me&&Me["aria-label"]?void 0:h.labelId,P.autoComplete="off",P.id=h.inputId,P.role="combobox",P.value=De.inputValue,P),Ge,Me)},[s,h,a,_,H,y,R]),D=pe(function(){s({type:Si})},[s]),B=pe(function(){s({type:Hi})},[s]),U=pe(function(){s({type:Ri})},[s]),A=pe(function(m){s({type:ki,highlightedIndex:m})},[s]),q=pe(function(m){s({type:hl,selectedItem:m})},[s]),T=pe(function(m){s({type:Pi,inputValue:m})},[s]),j=pe(function(){s({type:Ti})},[s]);return{getItemProps:z,getLabelProps:N,getMenuProps:K,getInputProps:F,getToggleButtonProps:W,toggleMenu:D,openMenu:U,closeMenu:B,setHighlightedIndex:A,setInputValue:T,selectItem:q,reset:j,highlightedIndex:d,isOpen:u,selectedItem:c,inputValue:p}}var Di={activeIndex:-1,selectedItems:[]};function ti(e,t){return Dt(e,t,Di)}function oi(e,t){return B1(e,t,Di)}function a4(e){var t=ti(e,"activeIndex"),o=ti(e,"selectedItems");return{activeIndex:t,selectedItems:o}}function ri(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==""&&(t.selectionStart!==0||t.selectionEnd!==0))}function n4(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}var Qw={stateReducer:To.stateReducer,itemToKey:To.itemToKey,environment:To.environment,selectedItems:ee.default.array,initialSelectedItems:ee.default.array,defaultSelectedItems:ee.default.array,getA11yStatusMessage:ee.default.func,activeIndex:ee.default.number,initialActiveIndex:ee.default.number,defaultActiveIndex:ee.default.number,onActiveIndexChange:ee.default.func,onSelectedItemsChange:ee.default.func,keyNavigationNext:ee.default.string,keyNavigationPrevious:ee.default.string},l4={itemToKey:Vo.itemToKey,stateReducer:Vo.stateReducer,environment:Vo.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},i4=Do,xl=0,Ll=1,wl=2,Il=3,bl=4,yl=5,Ml=6,Sl=7,Rl=8,Hl=9,kl=10,Pl=11,Tl=12,s4=Object.freeze({__proto__:null,DropdownClick:Sl,DropdownKeyDownBackspace:Ml,DropdownKeyDownNavigationPrevious:yl,FunctionAddSelectedItem:Rl,FunctionRemoveSelectedItem:Hl,FunctionReset:Tl,FunctionSetActiveIndex:Pl,FunctionSetSelectedItems:kl,SelectedItemClick:xl,SelectedItemKeyDownBackspace:wl,SelectedItemKeyDownDelete:Ll,SelectedItemKeyDownNavigationNext:Il,SelectedItemKeyDownNavigationPrevious:bl});function u4(e,t,o){var r=o.type,a=o.index,n=o.selectedItem,l=e.activeIndex,i=e.selectedItems,s;switch(r){case xl:s={activeIndex:a};break;case bl:s={activeIndex:l-1<0?0:l-1};break;case Il:s={activeIndex:l+1>=i.length?-1:l+1};break;case wl:case Ll:{if(l<0)break;var u=l;i.length===1?u=-1:l===i.length-1&&(u=i.length-2),s=ne({selectedItems:[].concat(i.slice(0,l),i.slice(l+1))},{activeIndex:u});break}case yl:s={activeIndex:i.length-1};break;case Ml:s={selectedItems:i.slice(0,i.length-1)};break;case Rl:s={selectedItems:[].concat(i,[n])};break;case Sl:s={activeIndex:-1};break;case Hl:{var d=l,c=i.findIndex(function(f){return t.itemToKey(f)===t.itemToKey(n)});if(c<0)break;i.length===1?d=-1:c===i.length-1&&(d=i.length-2),s={selectedItems:[].concat(i.slice(0,c),i.slice(c+1)),activeIndex:d};break}case kl:{var p=o.selectedItems;s={selectedItems:p};break}case Pl:{var g=o.activeIndex;s={activeIndex:g};break}case Tl:s={activeIndex:oi(t,"activeIndex"),selectedItems:oi(t,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return ne({},e,s)}var d4=["refKey","ref","onClick","onKeyDown","selectedItem","index"],c4=["refKey","ref","onKeyDown","onClick","preventKeyAction"];Oi.stateChangeTypes=s4;function Oi(e){e===void 0&&(e={}),i4(e,Oi);var t=ne({},l4,e),o=t.getA11yStatusMessage,r=t.environment,a=t.keyNavigationNext,n=t.keyNavigationPrevious,l=qn(u4,t,a4,n4),i=l[0],s=l[1],u=i.activeIndex,d=i.selectedItems,c=Qr(),p=w1(null),g=w1();g.current=[];var f=Eo({state:i,props:t});jn(o,i,[u,d],r),_1(function(){c||(u===-1&&p.current?p.current.focus():g.current[u]&&g.current[u].focus())},[u]),Gn({props:t,state:i});var M=Kn("getDropdownProps"),x=ro(function(){var y;return y={},y[n]=function(){s({type:bl})},y[a]=function(){s({type:Il})},y.Delete=function(){s({type:Ll})},y.Backspace=function(){s({type:wl})},y},[s,a,n]),w=ro(function(){var y;return y={},y[n]=function(R){ri(R)&&s({type:yl})},y.Backspace=function(_){ri(_)&&s({type:Ml})},y},[s,n]),h=pe(function(y){var R,_=y===void 0?{}:y,N=_.refKey,K=N===void 0?"ref":N,z=_.ref,W=_.onClick,F=_.onKeyDown,D=_.selectedItem,B=_.index,U=i1(_,d4),A=f.current.state,q=zn(D,B,A.selectedItems,"Pass either item or index to getSelectedItemProps!"),T=q[1],j=T>-1&&T===A.activeIndex,m=function(){s({type:xl,index:T})},I=function(C){var $=zr(C);$&&x[$]&&x[$](C)};return ne((R={},R[K]=W1(z,function(P){P&&g.current.push(P)}),R.tabIndex=j?0:-1,R.onClick=Pe(W,m),R.onKeyDown=Pe(F,I),R),U)},[s,f,x]),S=pe(function(y,R){var _,N=y===void 0?{}:y,K=N.refKey,z=K===void 0?"ref":K,W=N.ref,F=N.onKeyDown,D=N.onClick,B=N.preventKeyAction,U=B===void 0?!1:B,A=i1(N,c4),q=R===void 0?{}:R,T=q.suppressRefError,j=T===void 0?!1:T;M("getDropdownProps",j,z,p);var m=function(C){var $=zr(C);$&&w[$]&&w[$](C)},I=function(){s({type:Sl})};return ne((_={},_[z]=W1(W,function(P){P&&(p.current=P)}),_),!U&&{onKeyDown:Pe(F,m),onClick:Pe(D,I)},A)},[s,w,M]),H=pe(function(y){s({type:Rl,selectedItem:y})},[s]),k=pe(function(y){s({type:Hl,selectedItem:y})},[s]),Z=pe(function(y){s({type:kl,selectedItems:y})},[s]),V=pe(function(y){s({type:Pl,activeIndex:y})},[s]),L=pe(function(){s({type:Tl})},[s]);return{getSelectedItemProps:h,getDropdownProps:S,addSelectedItem:H,removeSelectedItem:k,setSelectedItems:Z,setActiveIndex:V,reset:L,selectedItems:d,activeIndex:u}}var Vl=0,El=1,Dl=2,Ol=3,_l=4,Bl=5,Al=6,f4=Object.freeze({__proto__:null,FunctionAddItem:Al,TagClick:Vl,TagGroupKeyDownArrowLeft:El,TagGroupKeyDownArrowRight:Dl,TagGroupKeyDownBackspace:_l,TagGroupKeyDownDelete:Ol,TagRemoveClick:Bl});function p4(e,t,o){var r=o.type,a;switch(r){case Vl:a={activeIndex:o.index};break;case El:a={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case Dl:a={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case _l:case Ol:{var n=[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),l=n.length===0?-1:n.length===e.activeIndex?e.activeIndex-1:e.activeIndex;a={items:[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),activeIndex:l};break}case Bl:{var i=[].concat(e.items.slice(0,o.index),e.items.slice(o.index+1)),s=i.length===0?-1:i.length===o.index?o.index-1:o.index;a={items:i,activeIndex:s}}break;case Al:{var u=[];o.index===void 0?u=[].concat(e.items,[o.item]):u=[].concat(e.items.slice(0,o.index),[o.item],e.items.slice(o.index));var d=e.activeIndex===-1?u.length-1:e.activeIndex;a={items:u,activeIndex:d};break}default:throw new Error("Invalid useTagGroup reducer action.")}return ne({},e,a)}var C4=ne({},me),_i=C4.useId,m4=typeof _i=="function"?g4:h4;function g4(e){var t=e.id,o=e.tagGroupId,r=e.getTagId,a="downshift-"+_i();t||(t=a);var n=me.useMemo(function(){return{tagGroupId:o??t+"-tag-group",getTagId:r??function(l){return t+"-tag-"+l}}},[r,t,o]);return n}function h4(e){var t=e.id,o=e.getTagId,r=e.tagGroupId,a=me.useRef(t??"downshift-"+ai()),n=a.current,l=me.useMemo(function(){return{tagGroupId:r??n+"-tag-group",getTagId:o??function(i){return n+"-tag-"+i}}},[o,n,r]);return l}function v4(e){var t,o,r,a,n=(t=(o=e.items)!=null?o:e.initialItems)!=null?t:[],l=(r=(a=e.activeIndex)!=null?a:e.initialActiveIndex)!=null?r:n.length===0?-1:0;return{activeIndex:l,items:n}}function x4(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var Bi="tag-group-a11y-description";function L4(e,t){me.useEffect(function(){if(e){var o=e.createElement("div");return o.setAttribute("id",Bi),o.style.display="none",o.textContent=t,e.body.appendChild(o),function(){o.remove()}}},[t,e])}function w4(e){return ne({stateReducer:function(o,r){var a=r.changes;return a},environment:typeof window>"u"?void 0:window,removeElementDescription:"Press Delete or Backspace to remove tag."},e)}function I4(e,t,o){var r=me.useRef({}),a=me.useRef(e),n=me.useRef(t);return me.useEffect(function(){if(e!==-1&&a.current!==-1&&e!==a.current||n.current===t+1){var l;(l=r.current[o(e)])==null||l.focus()}a.current=e,n.current=t},[e,o,t]),r}var b4={isItemDisabled:ee.default.func},y4=["onKeyDown"],M4=["index","refKey","ref","onClick"],S4=["index","onClick"],Ai=function(t){var o;t===void 0&&(t={}),Nn(t,Ai,b4);var r=w4(t),a=qn(p4,r,v4,x4),n=a[0],l=a[1],i=n.activeIndex,s=n.items,u=Eo({state:n,props:r}),d=m4({getTagId:r.getTagId,id:r.id,tagGroupId:r.tagGroupId});L4((o=r.environment)==null?void 0:o.document,r.removeElementDescription);var c=I4(i,s.length,d.getTagId),p=pe(function(x){var w=x??{},h=w.onKeyDown,S=i1(w,y4),H=function(V){switch(V.key){case"ArrowLeft":l({type:El});break;case"ArrowRight":l({type:Dl});break;case"Delete":l({type:Ol});break;case"Backspace":l({type:_l});break}},k=ne({id:d.tagGroupId,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions",role:"listbox",onKeyDown:Fn(h,H)},S);return k},[l,d.tagGroupId]),g=pe(function(x){var w,h=x.index,S=x.refKey,H=S===void 0?"ref":S,k=x.ref,Z=x.onClick,V=i1(x,M4);if(!Number.isInteger(h)||h<0)throw new Error("Pass correct item index to getTagProps!");var L=u.current.state,y=function(){l({type:Vl,index:h})},R=d.getTagId(h);return ne((w={"aria-describedby":Bi},w[H]=y7(k,function(_){_&&(c.current[R]=_)}),w["aria-labelledby"]=R,w.role="option",w.id=R,w.onClick=Fn(Z,y),w.tabIndex=L.activeIndex===h?0:-1,w),V)},[l,d,u,c]),f=pe(function(x){var w=x.index,h=x.onClick,S=i1(x,S4);if(!Number.isInteger(w)||w<0)throw new Error("Pass correct item index to getTagRemoveProps!");var H=function(L){L.stopPropagation(),l({type:Bl,index:w})},k=d.getTagId(w),Z=k+"-remove";return ne({id:Z,tabIndex:-1,"aria-labelledby":Z+" "+k,onClick:Fn(h,H)},S)},[d,l]),M=pe(function(x,w){l({type:Al,item:x,index:w})},[l]);return{activeIndex:i,addItem:M,getTagGroupProps:p,getTagProps:g,getTagRemoveProps:f,items:s}};Ai.stateChangeTypes=f4;import X1 from"react";import{createPortal as R4}from"react-dom";import{jsx as _t,jsxs as Zl}from"react/jsx-runtime";var H4=260,Yr=4;function k4(e){let t=e.getBoundingClientRect(),o=q1(e),r=o?o.getBoundingClientRect():{top:0,bottom:window.innerHeight},a=r.bottom-t.bottom-Yr,n=t.top-r.top-Yr,l=a<H4&&n>a;return{top:l?t.top-Yr:t.bottom+Yr,left:t.left,width:t.width,openAbove:l}}function Jr({label:e,options:t,dividerAfterValue:o,selectedItem:r,onChange:a,id:n="picklist",getOptionStyle:l,triggerLabel:i,triggerStyle:s}){let[u,d]=X1.useState({top:0,left:0,width:0,openAbove:!1}),c=X1.useRef(null),p=X1.useMemo(()=>{let R=new Map;return{document,Node:window.Node,addEventListener(_,N,K){let z=W=>{let F={target:W.composedPath()[0]??W.target};typeof N=="function"?N(F):N.handleEvent(F)};R.set(N,z),window.addEventListener(_,z,K)},removeEventListener(_,N,K){let z=R.get(N);z&&window.removeEventListener(_,z,K),R.delete(N)}}},[]),g=`${n}-legend`,{isOpen:f,closeMenu:M,highlightedIndex:x,getToggleButtonProps:w,getMenuProps:h,getItemProps:S}=Oo({environment:p,items:t,itemToString:R=>R?R.label:"",selectedItem:r,stateReducer:(R,{type:_,changes:N})=>_===Oo.stateChangeTypes.ToggleButtonBlur?{...N,selectedItem:R.selectedItem}:N,onSelectedItemChange:({selectedItem:R})=>{typeof a=="function"&&R&&R.value!==r?.value&&a(R.value)},onIsOpenChange:({isOpen:R})=>{R&&c.current&&d(k4(c.current))},id:n,labelId:g}),H=JSON.stringify(t.map(R=>R.value)),k=X1.useRef(H);X1.useLayoutEffect(()=>{k.current!==H&&M(),k.current=H},[H,M]),X1.useEffect(()=>{if(!f||!c.current)return;let R=q1(c.current);if(!R)return;let _=()=>M();return R.addEventListener("scroll",_,{passive:!0}),()=>R.removeEventListener("scroll",_)},[f,M]);let Z="picklistEditor-dropdown"+(f?" picklistEditor-dropdown--open":""),V=f?{top:u.top,left:u.left,width:u.width,...u.openAbove?{transform:"translateY(-100%)"}:void 0}:void 0,[L,y]=X1.useState(null);return X1.useLayoutEffect(()=>{let _=c.current?.getRootNode();y(_ instanceof ShadowRoot?_:document.body)},[]),_t(m1,{label:e,id:n,className:"picklistEditor-fieldset",children:Zl("div",{className:"picklistEditor-wrapper",children:[Zl("button",{type:"button",className:"picklistEditor-trigger",style:s,...w({ref:c}),children:[_t("span",{className:"picklistEditor-trigger-label",children:i??r?.label??"Default"}),_t("span",{className:"picklistEditor-trigger-chevron","aria-hidden":"true",children:_t(Zo,{width:12,height:12,"aria-hidden":"true"})})]}),R4(_t("ul",{className:Z,style:V,...h(),children:f&&t.map((R,_)=>Zl(X1.Fragment,{children:[_t("li",{className:"picklistEditor-option"+(x===_?" picklistEditor-option--highlighted":"")+(r?.value===R.value?" picklistEditor-option--selected":""),style:l?l(R):void 0,...S({item:R,index:_}),children:R.label}),R.value===o&&_t("li",{className:"picklistEditor-divider",role:"presentation","aria-hidden":"true"})]},R.value))}),L??document.body)]})})}import{jsx as T4}from"react/jsx-runtime";var Zi=[{value:"Arial, sans-serif",label:"Arial"},{value:"Helvetica, sans-serif",label:"Helvetica"},{value:"Verdana, sans-serif",label:"Verdana"},{value:"Tahoma, sans-serif",label:"Tahoma"},{value:"'Trebuchet MS', sans-serif",label:"Trebuchet MS"},{value:"'Lucida Sans Unicode', sans-serif",label:"Lucida Sans"},{value:"Georgia, serif",label:"Georgia"},{value:"'Times New Roman', serif",label:"Times New Roman"},{value:"'Palatino Linotype', serif",label:"Palatino"},{value:"'Courier New', monospace",label:"Courier New"},{value:"'Lucida Console', monospace",label:"Lucida Console"}];function Fl(e){return(e.split(",")[0]??"").trim().replace(/['"]/g,"")}function Fi(e,t){if(!e)return null;let o=Fl(e).toLowerCase();return o?t.find(r=>Fl(r.value).toLowerCase()===o)??null:null}function $i(e){return Fi(e,Zi)!==null}var P4=e=>e.value?{fontFamily:e.value}:void 0;function Ni({label:e="Font family",value:t,computedValue:o,options:r,onChange:a,matchOption:n=Fi,id:l="font-family",useInheritLabel:i="Inherited"}){let s=r??Zi,u={value:"inherit",label:i},d=t==="inherit"?u:n(t,s),c=o??t,p=c==="inherit"?void 0:c,g=n(p,s),f="Default";g?f=g.label:p&&(f=Fl(p)||"Default");let M=p?{fontFamily:p}:void 0;return T4(Jr,{label:e,options:[u,...s],dividerAfterValue:"inherit",selectedItem:d,triggerLabel:f,triggerStyle:M,onChange:a,id:l,getOptionStyle:P4})}import{jsx as O4}from"react/jsx-runtime";var V4=[{value:"100",labelKey:"thin",defaultWord:"Thin"},{value:"200",labelKey:"extraLight",defaultWord:"Extra Light"},{value:"300",labelKey:"light",defaultWord:"Light"},{value:"400",labelKey:"regular",defaultWord:"Regular"},{value:"500",labelKey:"medium",defaultWord:"Medium"},{value:"600",labelKey:"semiBold",defaultWord:"Semi Bold"},{value:"700",labelKey:"bold",defaultWord:"Bold"},{value:"800",labelKey:"extraBold",defaultWord:"Extra Bold"},{value:"900",labelKey:"black",defaultWord:"Black"}];function E4(e){return V4.map(t=>{let o=e?.[t.labelKey]??t.defaultWord;return{value:t.value,label:o}})}function D4(e,t){if(!e)return null;let o=String(e).trim();return t.find(r=>r.value===o)??null}function Ui({label:e="Font weight",value:t,computedValue:o,fontFamily:r,options:a,onChange:n,matchOption:l=D4,id:i="font-weight",useInheritLabel:s="Inherited",optionLabels:u}){let d=a??E4(u),c=!a&&$i(r)?d.filter(h=>h.value==="400"||h.value==="700"):d,p={value:"inherit",label:s},g=t==="inherit"?p:l(t,c),f=o??t,M=f==="inherit"?void 0:f,w=l(M,d)?.label??(M||"Default");return O4(Jr,{label:e,options:[p,...c],dividerAfterValue:"inherit",selectedItem:g,triggerLabel:w,onChange:n,id:i})}import te from"react";import{createPortal as B4}from"react-dom";import{jsx as qi,jsxs as _4}from"react/jsx-runtime";function zi({id:e,className:t,text:o}){return _4("p",{id:e,className:t?`fieldNotice ${t}`:"fieldNotice",children:[qi("svg",{className:"fieldNotice-icon",viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:qi("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),o]})}import{Fragment as ji,jsx as le,jsxs as Je}from"react/jsx-runtime";var A4={tabCms:"CMS",tabLocal:"Local",tabUrl:"URL",ariaTablist:"Image source",clearImage:"Clear image",chooseFile:"Choose File...",ariaChooseFile:"Choose an image file from your computer",ariaImageUrl:"Image URL",urlPlaceholder:"https://example.com/image.png",previewAlt:"Preview",altText:"Alt Text",altPlaceholder:"Describe the image",sourceFromData:"This image comes from data, so you can't edit it here.",sourceNotEditable:"You can't edit this image here.",altFromData:"This alt text comes from data, so you can't edit it here.",altNotEditable:"You can't edit this alt text here.",sourceShared:"This image is used {0} times on this page. Changing it changes all of them.",altShared:"This alt text is used on {0} images. Changing it changes all of them.",workspace:"Workspace",selectWorkspace:"Select a workspace...",selectImage:"Select an Image",loadingWorkspaces:"Loading workspaces...",noWorkspaces:"No CMS workspaces found",loadingImages:"Loading images...",noImages:"No images in this workspace",loadingMore:"Loading more...",untitled:"Untitled",downloadingImage:"Downloading image...",downloadFailed:"Download failed",closePicker:"Close",cancel:"Cancel",done:"Done",pickerTitle:"Select an image from {0}",pickerError:"Error: {0}"},no=["local","url"];function Z4({labels:e,workspaceName:t,folderId:o,portalTarget:r,folderItemsResult:a,contentDetail:n,thumbnailResult:l,onFetchFolderItems:i,onFetchContentDetail:s,onFetchThumbnail:u,onCancel:d,onConfirm:c}){let[p,g]=te.useState([]),[f,M]=te.useState(0),[x,w]=te.useState(!0),[h,S]=te.useState(!1),[H,k]=te.useState(null),[Z,V]=te.useState(null),[L,y]=te.useState({}),[R,_]=te.useState({}),N=te.useRef(new Set),K=te.useRef(new Set),z=te.useCallback(U=>{h||typeof i=="function"&&(S(!0),k(null),i(o,U,20))},[o,h,i]);te.useEffect(()=>{z(0)},[o]),te.useEffect(()=>{let U=A=>{A.key==="Escape"&&(A.stopPropagation(),d())};return document.addEventListener("keydown",U),()=>document.removeEventListener("keydown",U)},[d]);let W=te.useRef(null);te.useEffect(()=>{W.current?.focus()},[]),te.useEffect(()=>{if(!a)return;let U=(a.items??[]).map(A=>({contentKey:A.contentKey,title:A.title??e.untitled,mimeType:A.mimeType??"image/png"}));g(A=>a.page===0?U:[...A,...U]),w(!!a.hasMore),M(a.page??0),S(!1),a.error&&k(String(a.error))},[a]),te.useEffect(()=>{if(!n)return;let U=n.contentKey;if(!U||n.error)return;let A=n.url??"",q=n.mimeType??"image/png",T=n.title??"";y(j=>j[U]?j:{...j,[U]:{url:A,mimeType:q,title:T}}),A&&!K.current.has(U)&&typeof u=="function"&&(K.current.add(U),u(U,A,q))},[n,u]),te.useEffect(()=>{if(!l)return;let{imageId:U,thumbnailUrl:A}=l;U&&A&&_(q=>({...q,[U]:A}))},[l]);let F=te.useRef(null);te.useEffect(()=>{let U=F.current;if(!U||!x||h)return;let A=new IntersectionObserver(q=>{q.some(j=>j.isIntersecting)&&z(f+1)});return A.observe(U),()=>A.disconnect()},[x,h,f,z]);let D=te.useCallback(U=>{N.current.has(U)||typeof s=="function"&&(N.current.add(U),s(U))},[s]),B=()=>{if(!Z)return;let U=L[Z],A=p.find(q=>q.contentKey===Z);!U||!A||c({contentKey:Z,title:A.title,url:U.url,mimeType:U.mimeType||A.mimeType})};return B4(le("div",{ref:W,tabIndex:-1,className:"cmsPicker-overlay",role:"dialog","aria-modal":"true","aria-label":Re(e.pickerTitle,[t]),onClick:U=>{U.target===U.currentTarget&&d()},children:Je("div",{className:"cmsPicker-dialog",children:[Je("div",{className:"cmsPicker-header",children:[le("span",{className:"cmsPicker-title",children:Re(e.pickerTitle,[t])}),le("button",{type:"button",className:"cmsPicker-close",onClick:d,"aria-label":e.closePicker,title:e.closePicker,children:"\u2715"})]}),Je("div",{className:"cmsPicker-body",children:[p.length===0&&h&&le("div",{className:"cmsPicker-empty",children:e.loadingImages}),p.length===0&&!h&&!H&&le("div",{className:"cmsPicker-empty",children:e.noImages}),H&&le("div",{className:"cmsPicker-empty",children:Re(e.pickerError,[H])}),Je("div",{className:"cmsPicker-grid",children:[p.map(U=>le(F4,{item:U,selected:Z===U.contentKey,thumbnailDataUrl:R[U.contentKey],onIntersect:()=>D(U.contentKey),onClick:()=>V(U.contentKey)},U.contentKey)),x&&le("div",{className:"cmsPicker-sentinel",ref:F,children:h?e.loadingMore:""})]})]}),Je("div",{className:"cmsPicker-footer",children:[le("button",{type:"button",className:"cmsPicker-btn",onClick:d,children:e.cancel}),le("button",{type:"button",className:"cmsPicker-btn cmsPicker-btn--primary",disabled:!Z||!L[Z??""],onClick:B,children:e.done})]})]})}),r)}function F4({item:e,selected:t,thumbnailDataUrl:o,onIntersect:r,onClick:a}){let n=te.useRef(null),l=te.useRef(!1);return te.useEffect(()=>{let i=n.current;if(!i||l.current)return;let s=new IntersectionObserver(u=>{u.some(c=>c.isIntersecting)&&!l.current&&(l.current=!0,r(),s.disconnect())});return s.observe(i),()=>s.disconnect()},[r]),Je("button",{ref:n,type:"button",className:`cmsPicker-thumb${t?" cmsPicker-thumb--selected":""}`,onClick:a,title:e.title,"aria-pressed":t,children:[le("div",{className:"cmsPicker-thumb-img",children:o?le("img",{src:o,alt:e.title}):le("div",{className:"cmsPicker-thumb-placeholder","aria-hidden":"true",children:"\u2026"})}),le("span",{className:"cmsPicker-thumb-label",children:e.title})]})}function $4({labels:e,spaces:t,spacesLoading:o,selectedSpaceId:r,onSpaceSelect:a,onOpenPicker:n}){return o?le("div",{className:"imageEditor-cms",children:le("div",{className:"imageEditor-cms-loading",children:e.loadingWorkspaces})}):t.length===0?le("div",{className:"imageEditor-cms",children:le("div",{className:"imageEditor-cms-empty",children:e.noWorkspaces})}):Je("div",{className:"imageEditor-cms",children:[Je("div",{className:"imageEditor-cms-channel",children:[le("label",{className:"imageEditor-cms-channel-label",htmlFor:"cms-space-select",children:e.workspace}),Je("select",{id:"cms-space-select",className:"imageEditor-input imageEditor-cms-channel-select",value:r,onChange:l=>a(l.target.value),children:[le("option",{value:"",children:e.selectWorkspace}),t.map(l=>le("option",{value:l.id,children:l.name},l.id))]})]}),le("button",{type:"button",className:"imageEditor-cms-pick-btn",onClick:n,disabled:!r,children:e.selectImage})]})}function N4({labels:e,onPick:t}){return le("div",{className:"imageEditor-local",children:le("button",{className:"imageEditor-local-pick",onClick:t,type:"button","aria-label":e.ariaChooseFile,"aria-haspopup":"dialog",children:e.chooseFile})})}function Ki({src:e,alt:t,className:o}){let[r,a]=te.useState(!1);return te.useEffect(()=>{a(!1)},[e]),r?null:le("img",{src:e,alt:t,className:o,onError:()=>a(!0)})}function U4({labels:e,input:t,onInputChange:o,onApply:r,currentUrl:a}){return Je("div",{className:"imageEditor-url",children:[le("input",{type:"text",value:t,"aria-label":e.ariaImageUrl,placeholder:e.urlPlaceholder,className:"imageEditor-input",onChange:n=>o(n.target.value),onKeyDown:n=>{n.key==="Enter"&&t&&r(t)},onBlur:()=>{t&&t!==a&&r(t)}}),t&&le("div",{className:"imageEditor-url-preview",children:le(Ki,{src:t,alt:e.previewAlt,className:"imageEditor-preview-thumb"})})]})}function q4({id:e,label:t,value:o,placeholder:r,readOnly:a,describedBy:n,onCommit:l}){let[i,s]=te.useState(o),u=te.useRef(l);u.current=l;let d=te.useRef(o);te.useEffect(()=>{o!==d.current&&(d.current=o,s(o))},[o]);let c=()=>{!a&&i!==o&&(d.current=i,u.current(i))};return Je("div",{className:"imageEditor-attr",children:[le("label",{className:"imageEditor-attr-label",htmlFor:e,children:t}),le("input",{id:e,type:"text",value:i,placeholder:r,className:"imageEditor-input",disabled:a,"aria-describedby":n,onChange:p=>s(p.target.value),onKeyDown:p=>{p.key==="Enter"&&c()},onBlur:c})]})}function z4({labels:e,attributes:t,altReadOnly:o,describedBy:r,onAttributeChange:a}){return le("div",{className:"imageEditor-attrs",children:le(q4,{id:"design-img-alt",label:e.altText,value:t.alt,placeholder:e.altPlaceholder,readOnly:o,describedBy:r,onCommit:n=>a("alt",n)})})}function $l({label:e,value:t,onChange:o,id:r="image",attributes:a,onAttributeChange:n,sourceReadOnly:l,altReadOnly:i,sharedCount:s,cmsSpaces:u,cmsSpacesLoading:d,onFetchCmsSpaces:c,cmsFolderItemsResult:p,onFetchCmsFolderItems:g,cmsContentDetail:f,onFetchCmsContentDetail:M,cmsThumbnailResult:x,onFetchCmsThumbnail:w,onImportCmsImage:h,cmsImportResult:S,onPickLocalFile:H,localPreview:k,imageLabels:Z}){let V=M1(A4,Z),L=!!(a&&n),y=L&&!!i,R=l&&(l==="from-data"?V.sourceFromData:V.sourceNotEditable),_=y&&(i==="from-data"?V.altFromData:V.altNotEditable),N=s!==void 0&&s>1?s:void 0,K=N===void 0?void 0:l?L&&!y?Re(V.altShared,[N]):void 0:Re(V.sourceShared,[N]),z=[R||_,K].filter(Boolean).join(" ")||void 0,W=`${r}-notice`,F={cms:V.tabCms,local:V.tabLocal,url:V.tabUrl},[D,B]=te.useState("local"),[U,A]=te.useState(""),[q,T]=te.useState(!1),j=te.useRef(o);j.current=o;let m=te.useRef(t);m.current=t;let I=te.useRef(!!l);I.current=!!l;let P=te.useRef(k);te.useEffect(()=>{if(!k||k===P.current||(P.current=k,I.current))return;let re=k.devUrl||k.webviewUri;re&&re!==m.current&&j.current(re)},[k]);let C=re=>re?.startsWith("data:")?"":re??"",[$,v]=te.useState(()=>C(t)),b=te.useRef(t??"");te.useEffect(()=>{let re=t??"";re!==b.current&&(b.current=re,v(C(re)))},[t]);let[G,J]=te.useState("idle"),oe=te.useRef(null),ce=te.useRef(null),he=te.useCallback(()=>{let re=ce.current?.getRootNode();return re instanceof ShadowRoot?re:document.body},[]),Me=te.useRef({}),p1=te.useCallback(re=>{B(re),Me.current[re]?.focus()},[]),we=te.useCallback((re,Ge)=>{let He=null;switch(re.key){case"ArrowRight":He=(Ge+1)%no.length;break;case"ArrowLeft":He=(Ge-1+no.length)%no.length;break;case"Home":He=0;break;case"End":He=no.length-1;break;default:return}re.preventDefault();let C1=no[He];C1&&p1(C1)},[p1]),Te=u??[],De=d??!1,Se=t||"";te.useEffect(()=>{if(S){if(I.current){J("idle");return}if(S.success&&S.devUrl)o(S.devUrl),J("success");else{let re=oe.current?.url;re?(o(re),J("success")):J("error")}}},[S,o]),te.useEffect(()=>{D==="cms"&&Te.length===0&&!De&&typeof c=="function"&&c()},[D]);let b1=te.useMemo(()=>Te.find(re=>re.id===U)??null,[Te,U]),Ne=te.useCallback(re=>{if(I.current){T(!1);return}let Ge={id:re.contentKey,title:re.title,url:re.url,thumbnailUrl:"",contentType:re.mimeType};oe.current=Ge,T(!1),typeof h=="function"&&Ge.url?(J("importing"),h(Ge)):Ge.url&&o(Ge.url)},[o,h]),Oe=le(m1,{label:e,id:r,className:"imageEditor-fieldset",children:Je("div",{ref:ce,className:"imageEditor-root",children:[Se&&Je("div",{className:`imageEditor-current${l?" imageEditor-current--readonly":""}`,children:[le(Ki,{src:Se,alt:"",className:"imageEditor-current-thumb"}),le("span",{className:"imageEditor-current-url",title:Se,children:Se.length>30?`...${Se.slice(-30)}`:Se}),!l&&le("button",{className:"imageEditor-clear",onClick:()=>o(""),title:V.clearImage,"aria-label":V.clearImage,type:"button",children:"\u2715"})]}),!l&&Je(ji,{children:[le("div",{className:"imageEditor-tabs",role:"tablist","aria-label":V.ariaTablist,"aria-describedby":K?W:void 0,children:no.map((re,Ge)=>le("button",{id:`${r}-tab-${re}`,ref:He=>{Me.current[re]=He},role:"tab",type:"button","aria-selected":D===re,"aria-controls":`${r}-tabpanel`,tabIndex:D===re?0:-1,className:`imageEditor-tab${D===re?" imageEditor-tab--active":""}`,onClick:()=>B(re),onKeyDown:He=>we(He,Ge),children:F[re]},re))}),Je("div",{className:"imageEditor-tab-content",role:"tabpanel",id:`${r}-tabpanel`,"aria-labelledby":`${r}-tab-${D}`,children:[D==="cms"&&le($4,{labels:V,spaces:Te,spacesLoading:De,selectedSpaceId:U,onSpaceSelect:A,onOpenPicker:()=>T(!0)}),D==="cms"&&G==="importing"&&le("div",{className:"imageEditor-cms-loading",children:V.downloadingImage}),D==="cms"&&G==="error"&&le("div",{className:"imageEditor-cms-empty",children:V.downloadFailed}),D==="local"&&le(N4,{labels:V,onPick:()=>H?.()}),D==="url"&&le(U4,{labels:V,input:$,onInputChange:v,onApply:re=>{b.current=re,o(re)},currentUrl:Se})]})]}),a&&n&&le(z4,{labels:V,attributes:a,altReadOnly:!!i,describedBy:z&&(i||K)?W:void 0,onAttributeChange:n}),q&&b1&&le(Z4,{labels:V,workspaceName:b1.name,folderId:b1.rootFolderId,portalTarget:he(),folderItemsResult:p,contentDetail:f,thumbnailResult:x,onFetchFolderItems:g,onFetchContentDetail:M,onFetchThumbnail:w,onCancel:()=>T(!1),onConfirm:Ne})]})});return Je(ji,{children:[z&&le(zi,{id:W,className:"imageEditor-notice",text:z}),Oe]})}import P1 from"react";import*as Q1 from"react";import{jsx as j4}from"react/jsx-runtime";function lo(e,t=[]){let o=[];function r(n,l){let i=Q1.createContext(l),s=o.length;o=[...o,l];let u=c=>{let{scope:p,children:g,...f}=c,M=p?.[e]?.[s]||i,x=Q1.useMemo(()=>f,Object.values(f));return j4(M.Provider,{value:x,children:g})};u.displayName=n+"Provider";function d(c,p){let g=p?.[e]?.[s]||i,f=Q1.useContext(g);if(f)return f;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${n}\``)}return[u,d]}let a=()=>{let n=o.map(l=>Q1.createContext(l));return function(i){let s=i?.[e]||n;return Q1.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return a.scopeName=e,[r,K4(a,...t)]}function K4(...e){let t=e[0];if(e.length===1)return t;let o=()=>{let r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(n){let l=r.reduce((i,{useScope:s,scopeName:u})=>{let c=s(n)[`__scope${u}`];return{...i,...c}},{});return Q1.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return o.scopeName=t.scopeName,o}import*as Yi from"react";import*as ec from"react-dom";import*as Ae from"react";import*as G4 from"react";function Gi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Wi(...e){return t=>{let o=!1,r=e.map(a=>{let n=Gi(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():Gi(e[a],null)}}}}import{Fragment as HI,jsx as Xi}from"react/jsx-runtime";function Qi(e){let t=W4(e),o=Ae.forwardRef((r,a)=>{let{children:n,...l}=r,i=Ae.Children.toArray(n),s=i.find(Q4);if(s){let u=s.props.children,d=i.map(c=>c===s?Ae.Children.count(u)>1?Ae.Children.only(null):Ae.isValidElement(u)?u.props.children:null:c);return Xi(t,{...l,ref:a,children:Ae.isValidElement(u)?Ae.cloneElement(u,void 0,d):null})}return Xi(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function W4(e){let t=Ae.forwardRef((o,r)=>{let{children:a,...n}=o;if(Ae.isValidElement(a)){let l=J4(a),i=Y4(n,a.props);return a.type!==Ae.Fragment&&(i.ref=r?Wi(r,l):l),Ae.cloneElement(a,i)}return Ae.Children.count(a)>1?Ae.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var X4=Symbol("radix.slottable");function Q4(e){return Ae.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===X4}function Y4(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function J4(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}import{jsx as tc}from"react/jsx-runtime";var oc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nl=oc.reduce((e,t)=>{let o=Qi(`Primitive.${t}`),r=Yi.forwardRef((a,n)=>{let{asChild:l,...i}=a,s=l?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),tc(s,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});import*as je from"react";var EI=!!(typeof window<"u"&&window.document&&window.document.createElement);function Y1(e,t,{checkForDefaultPrevented:o=!0}={}){return function(a){if(e?.(a),o===!1||!a.defaultPrevented)return t?.(a)}}import Bt from"react";import*as e5 from"react";function Ji(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ul(...e){return t=>{let o=!1,r=e.map(a=>{let n=Ji(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():Ji(e[a],null)}}}}function ql(...e){return e5.useCallback(Ul(...e),e)}import*as Ze from"react";import{Fragment as AI,jsx as t5}from"react/jsx-runtime";function zl(e){let t=rc(e),o=Ze.forwardRef((r,a)=>{let{children:n,...l}=r,i=Ze.Children.toArray(n),s=i.find(nc);if(s){let u=s.props.children,d=i.map(c=>c===s?Ze.Children.count(u)>1?Ze.Children.only(null):Ze.isValidElement(u)?u.props.children:null:c);return t5(t,{...l,ref:a,children:Ze.isValidElement(u)?Ze.cloneElement(u,void 0,d):null})}return t5(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function rc(e){let t=Ze.forwardRef((o,r)=>{let{children:a,...n}=o;if(Ze.isValidElement(a)){let l=ic(a),i=lc(n,a.props);return a.type!==Ze.Fragment&&(i.ref=r?Ul(r,l):l),Ze.cloneElement(a,i)}return Ze.Children.count(a)>1?Ze.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ac=Symbol("radix.slottable");function nc(e){return Ze.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ac}function lc(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function ic(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}import{jsx as jl}from"react/jsx-runtime";import WI from"react";import{jsx as QI}from"react/jsx-runtime";function o5(e){let t=e+"CollectionProvider",[o,r]=lo(t),[a,n]=o(t,{collectionRef:{current:null},itemMap:new Map}),l=M=>{let{scope:x,children:w}=M,h=Bt.useRef(null),S=Bt.useRef(new Map).current;return jl(a,{scope:x,itemMap:S,collectionRef:h,children:w})};l.displayName=t;let i=e+"CollectionSlot",s=zl(i),u=Bt.forwardRef((M,x)=>{let{scope:w,children:h}=M,S=n(i,w),H=ql(x,S.collectionRef);return jl(s,{ref:H,children:h})});u.displayName=i;let d=e+"CollectionItemSlot",c="data-radix-collection-item",p=zl(d),g=Bt.forwardRef((M,x)=>{let{scope:w,children:h,...S}=M,H=Bt.useRef(null),k=ql(x,H),Z=n(d,w);return Bt.useEffect(()=>(Z.itemMap.set(H,{ref:H,...S}),()=>{Z.itemMap.delete(H)})),jl(p,{[c]:"",ref:k,children:h})});g.displayName=d;function f(M){let x=n(e+"CollectionConsumer",M);return Bt.useCallback(()=>{let h=x.collectionRef.current;if(!h)return[];let S=Array.from(h.querySelectorAll(`[${c}]`));return Array.from(x.itemMap.values()).sort((Z,V)=>S.indexOf(Z.ref.current)-S.indexOf(V.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:l,Slot:u,ItemSlot:g},f,r]}import*as a5 from"react";function r5(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kl(...e){return t=>{let o=!1,r=e.map(a=>{let n=r5(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():r5(e[a],null)}}}}function n5(...e){return a5.useCallback(Kl(...e),e)}import*as Gl from"react";import*as l5 from"react";var ea=globalThis?.document?l5.useLayoutEffect:()=>{};var sc=Gl[" useId ".trim().toString()]||(()=>{}),uc=0;function i5(e){let[t,o]=Gl.useState(sc());return ea(()=>{e||o(r=>r??String(uc++))},[e]),e||(t?`radix-${t}`:"")}import*as d5 from"react";import*as mc from"react-dom";import*as Fe from"react";import{Fragment as lb,jsx as s5}from"react/jsx-runtime";function u5(e){let t=dc(e),o=Fe.forwardRef((r,a)=>{let{children:n,...l}=r,i=Fe.Children.toArray(n),s=i.find(fc);if(s){let u=s.props.children,d=i.map(c=>c===s?Fe.Children.count(u)>1?Fe.Children.only(null):Fe.isValidElement(u)?u.props.children:null:c);return s5(t,{...l,ref:a,children:Fe.isValidElement(u)?Fe.cloneElement(u,void 0,d):null})}return s5(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function dc(e){let t=Fe.forwardRef((o,r)=>{let{children:a,...n}=o;if(Fe.isValidElement(a)){let l=Cc(a),i=pc(n,a.props);return a.type!==Fe.Fragment&&(i.ref=r?Kl(r,l):l),Fe.cloneElement(a,i)}return Fe.Children.count(a)>1?Fe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cc=Symbol("radix.slottable");function fc(e){return Fe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cc}function pc(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function Cc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}import{jsx as gc}from"react/jsx-runtime";var hc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wl=hc.reduce((e,t)=>{let o=u5(`Primitive.${t}`),r=d5.forwardRef((a,n)=>{let{asChild:l,...i}=a,s=l?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),gc(s,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});import*as io from"react";function c5(e){let t=io.useRef(e);return io.useEffect(()=>{t.current=e}),io.useMemo(()=>(...o)=>t.current?.(...o),[])}import*as I1 from"react";import*as ta from"react";var vc=I1[" useInsertionEffect ".trim().toString()]||ea;function At({prop:e,defaultProp:t,onChange:o=()=>{},caller:r}){let[a,n,l]=xc({defaultProp:t,onChange:o}),i=e!==void 0,s=i?e:a;{let d=I1.useRef(e!==void 0);I1.useEffect(()=>{let c=d.current;c!==i&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=i},[i,r])}let u=I1.useCallback(d=>{if(i){let c=Lc(d)?d(e):d;c!==e&&l.current?.(c)}else n(d)},[i,e,n,l]);return[s,u]}function xc({defaultProp:e,onChange:t}){let[o,r]=I1.useState(e),a=I1.useRef(o),n=I1.useRef(t);return vc(()=>{n.current=t},[t]),I1.useEffect(()=>{a.current!==o&&(n.current?.(o),a.current=o)},[o,a]),[o,r,n]}function Lc(e){return typeof e=="function"}import*as oa from"react";import{jsx as mb}from"react/jsx-runtime";var wc=oa.createContext(void 0);function ra(e){let t=oa.useContext(wc);return e||t||"ltr"}import{jsx as Zt}from"react/jsx-runtime";var Xl="rovingFocusGroup.onEntryFocus",Ic={bubbles:!1,cancelable:!0},_o="RovingFocusGroup",[Ql,f5,bc]=o5(_o),[yc,Yl]=lo(_o,[bc]),[Mc,Sc]=yc(_o),p5=je.forwardRef((e,t)=>Zt(Ql.Provider,{scope:e.__scopeRovingFocusGroup,children:Zt(Ql.Slot,{scope:e.__scopeRovingFocusGroup,children:Zt(Rc,{...e,ref:t})})}));p5.displayName=_o;var Rc=je.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:o,orientation:r,loop:a=!1,dir:n,currentTabStopId:l,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:s,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...c}=e,p=je.useRef(null),g=n5(t,p),f=ra(n),[M,x]=At({prop:l,defaultProp:i??null,onChange:s,caller:_o}),[w,h]=je.useState(!1),S=c5(u),H=f5(o),k=je.useRef(!1),[Z,V]=je.useState(0);return je.useEffect(()=>{let L=p.current;if(L)return L.addEventListener(Xl,S),()=>L.removeEventListener(Xl,S)},[S]),Zt(Mc,{scope:o,orientation:r,dir:f,loop:a,currentTabStopId:M,onItemFocus:je.useCallback(L=>x(L),[x]),onItemShiftTab:je.useCallback(()=>h(!0),[]),onFocusableItemAdd:je.useCallback(()=>V(L=>L+1),[]),onFocusableItemRemove:je.useCallback(()=>V(L=>L-1),[]),children:Zt(Wl.div,{tabIndex:w||Z===0?-1:0,"data-orientation":r,...c,ref:g,style:{outline:"none",...e.style},onMouseDown:Y1(e.onMouseDown,()=>{k.current=!0}),onFocus:Y1(e.onFocus,L=>{let y=!k.current;if(L.target===L.currentTarget&&y&&!w){let R=new CustomEvent(Xl,Ic);if(L.currentTarget.dispatchEvent(R),!R.defaultPrevented){let _=H().filter(F=>F.focusable),N=_.find(F=>F.active),K=_.find(F=>F.id===M),W=[N,K,..._].filter(Boolean).map(F=>F.ref.current);g5(W,d)}}k.current=!1}),onBlur:Y1(e.onBlur,()=>h(!1))})})}),C5="RovingFocusGroupItem",m5=je.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:o,focusable:r=!0,active:a=!1,tabStopId:n,children:l,...i}=e,s=i5(),u=n||s,d=Sc(C5,o),c=d.currentTabStopId===u,p=f5(o),{onFocusableItemAdd:g,onFocusableItemRemove:f,currentTabStopId:M}=d;return je.useEffect(()=>{if(r)return g(),()=>f()},[r,g,f]),Zt(Ql.ItemSlot,{scope:o,id:u,focusable:r,active:a,children:Zt(Wl.span,{tabIndex:c?0:-1,"data-orientation":d.orientation,...i,ref:t,onMouseDown:Y1(e.onMouseDown,x=>{r?d.onItemFocus(u):x.preventDefault()}),onFocus:Y1(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:Y1(e.onKeyDown,x=>{if(x.key==="Tab"&&x.shiftKey){d.onItemShiftTab();return}if(x.target!==x.currentTarget)return;let w=Pc(x,d.orientation,d.dir);if(w!==void 0){if(x.metaKey||x.ctrlKey||x.altKey||x.shiftKey)return;x.preventDefault();let S=p().filter(H=>H.focusable).map(H=>H.ref.current);if(w==="last")S.reverse();else if(w==="prev"||w==="next"){w==="prev"&&S.reverse();let H=S.indexOf(x.currentTarget);S=d.loop?Tc(S,H+1):S.slice(H+1)}setTimeout(()=>g5(S))}}),children:typeof l=="function"?l({isCurrentTabStop:c,hasTabStop:M!=null}):l})})});m5.displayName=C5;var Hc={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kc(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Pc(e,t,o){let r=kc(e.key,o);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Hc[r]}function g5(e,t=!1){let o=document.activeElement;for(let r of e)if(r===o||(r.focus({preventScroll:t}),document.activeElement!==o))return}function Tc(e,t){return e.map((o,r)=>e[(t+r)%e.length])}var h5=p5,v5=m5;import*as M5 from"react";import*as b5 from"react";import*as Zc from"react-dom";import*as $e from"react";import*as Ec from"react";function x5(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function L5(...e){return t=>{let o=!1,r=e.map(a=>{let n=x5(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():x5(e[a],null)}}}}import{Fragment as Pb,jsx as w5}from"react/jsx-runtime";function I5(e){let t=Dc(e),o=$e.forwardRef((r,a)=>{let{children:n,...l}=r,i=$e.Children.toArray(n),s=i.find(_c);if(s){let u=s.props.children,d=i.map(c=>c===s?$e.Children.count(u)>1?$e.Children.only(null):$e.isValidElement(u)?u.props.children:null:c);return w5(t,{...l,ref:a,children:$e.isValidElement(u)?$e.cloneElement(u,void 0,d):null})}return w5(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function Dc(e){let t=$e.forwardRef((o,r)=>{let{children:a,...n}=o;if($e.isValidElement(a)){let l=Ac(a),i=Bc(n,a.props);return a.type!==$e.Fragment&&(i.ref=r?L5(r,l):l),$e.cloneElement(a,i)}return $e.Children.count(a)>1?$e.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oc=Symbol("radix.slottable");function _c(e){return $e.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oc}function Bc(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function Ac(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}import{jsx as Fc}from"react/jsx-runtime";var $c=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],y5=$c.reduce((e,t)=>{let o=I5(`Primitive.${t}`),r=b5.forwardRef((a,n)=>{let{asChild:l,...i}=a,s=l?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),Fc(s,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});import{jsx as Nc}from"react/jsx-runtime";var S5="Toggle",Jl=M5.forwardRef((e,t)=>{let{pressed:o,defaultPressed:r,onPressedChange:a,...n}=e,[l,i]=At({prop:o,onChange:a,defaultProp:r??!1,caller:S5});return Nc(y5.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...n,ref:t,onClick:Y1(e.onClick,()=>{e.disabled||i(!l)})})});Jl.displayName=S5;import{jsx as u1}from"react/jsx-runtime";var It="ToggleGroup",[H5,Gb]=lo(It,[Yl]),k5=Yl(),e2=P1.forwardRef((e,t)=>{let{type:o,...r}=e;if(o==="single")return u1(Uc,{...r,ref:t});if(o==="multiple")return u1(qc,{...r,ref:t});throw new Error(`Missing prop \`type\` expected on \`${It}\``)});e2.displayName=It;var[P5,T5]=H5(It),Uc=P1.forwardRef((e,t)=>{let{value:o,defaultValue:r,onValueChange:a=()=>{},...n}=e,[l,i]=At({prop:o,defaultProp:r??"",onChange:a,caller:It});return u1(P5,{scope:e.__scopeToggleGroup,type:"single",value:P1.useMemo(()=>l?[l]:[],[l]),onItemActivate:i,onItemDeactivate:P1.useCallback(()=>i(""),[i]),children:u1(V5,{...n,ref:t})})}),qc=P1.forwardRef((e,t)=>{let{value:o,defaultValue:r,onValueChange:a=()=>{},...n}=e,[l,i]=At({prop:o,defaultProp:r??[],onChange:a,caller:It}),s=P1.useCallback(d=>i((c=[])=>[...c,d]),[i]),u=P1.useCallback(d=>i((c=[])=>c.filter(p=>p!==d)),[i]);return u1(P5,{scope:e.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:s,onItemDeactivate:u,children:u1(V5,{...n,ref:t})})});e2.displayName=It;var[zc,jc]=H5(It),V5=P1.forwardRef((e,t)=>{let{__scopeToggleGroup:o,disabled:r=!1,rovingFocus:a=!0,orientation:n,dir:l,loop:i=!0,...s}=e,u=k5(o),d=ra(l),c={role:"group",dir:d,...s};return u1(zc,{scope:o,rovingFocus:a,disabled:r,children:a?u1(h5,{asChild:!0,...u,orientation:n,dir:d,loop:i,children:u1(Nl.div,{...c,ref:t})}):u1(Nl.div,{...c,ref:t})})}),aa="ToggleGroupItem",E5=P1.forwardRef((e,t)=>{let o=T5(aa,e.__scopeToggleGroup),r=jc(aa,e.__scopeToggleGroup),a=k5(e.__scopeToggleGroup),n=o.value.includes(e.value),l=r.disabled||e.disabled,i={...e,pressed:n,disabled:l},s=P1.useRef(null);return r.rovingFocus?u1(v5,{asChild:!0,...a,focusable:!l,active:n,ref:s,children:u1(R5,{...i,ref:t})}):u1(R5,{...i,ref:t})});E5.displayName=aa;var R5=P1.forwardRef((e,t)=>{let{__scopeToggleGroup:o,value:r,...a}=e,n=T5(aa,o),l={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=n.type==="single"?l:void 0;return u1(Jl,{...i,...a,ref:t,onPressedChange:s=>{s?n.onItemActivate(r):n.onItemDeactivate(r)}})}),t2=e2,D5=E5;import{jsx as na}from"react/jsx-runtime";function la(e){let t=e.options.map(o=>na(D5,{value:o.value,className:"buttonGroupEditor-item","aria-label":o.label,title:o.label,children:o.icon??o.label},o.value));return na(m1,{label:e.label,id:e.id,children:e.type==="single"?na(t2,{type:"single",value:e.value,onValueChange:o=>{o&&e.onChange(o)},className:"buttonGroupEditor-root","aria-label":e.label,children:t}):na(t2,{type:"multiple",value:e.value,onValueChange:e.onChange,className:"buttonGroupEditor-root",children:t})})}import{jsx as O5}from"react/jsx-runtime";var Gc={uppercase:"M3.04 8.96L3.04 1.96L0.50 1.96L0.50 0.50L7.34 0.50L7.34 1.96L4.81 1.96L4.81 8.96ZM11.20 8.96L11.20 1.96L8.66 1.96L8.66 0.50L15.51 0.50L15.51 1.96L12.97 1.96L12.97 8.96Z",italic:"M380 123v-13a20 20 0 0 0-20-20H220a20 20 0 0 0-20 20v20c0 11 9 20 20 20 17 0 30 16 26 32l-36 176a27 27 0 0 1-26 22h-24a20 20 0 0 0-20 20v20c0 11 9 20 20 20h140a20 20 0 0 0 20-20v-20a20 20 0 0 0-20-20c-17 0-30-16-26-32l36-176a27 27 0 0 1 26-22h17c15 0 27-12 27-27",underline:"M445 420H75c-8 0-15 7-15 15v30c0 8 7 15 15 15h370c8 0 15-7 15-15v-30c0-8-7-15-15-15m-192-40a143 143 0 0 1-133-144V100c0-11 9-20 20-20h20a20 20 0 0 1 20 20v137c0 43 32 80 75 83a80 80 0 0 0 85-80V100c0-11 9-20 20-20h20a20 20 0 0 1 20 20v140a140 140 0 0 1-147 140",left_align_text:"M480 65c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm-80 120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15zm0 240c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15zm80-120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15z",center_align_text:"M480 65c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm-60 120c0-8-7-15-15-15H115c-8 0-15 7-15 15v30c0 8 7 15 15 15h290c8 0 15-7 15-15zm-20 240c0-8-7-15-15-15H135c-8 0-15 7-15 15v30c0 8 7 15 15 15h250c8 0 15-7 15-15zm80-120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15z",right_align_text:"M465 50H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15V65c0-8-7-15-15-15m0 120H135c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15v-30c0-8-7-15-15-15m0 240H135c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15v-30c0-8-7-15-15-15m0-120H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15v-30c0-8-7-15-15-15",justify_text:"M480 65c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm0 120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm0 240c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm0-120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15z"};function J1({name:e}){return O5("svg",{className:"slds-button__icon",width:e==="uppercase"?16.01:14,height:e==="uppercase"?9.46:14,viewBox:e==="uppercase"?"0 0 16.01 9.46":"0 0 520 520",fill:"currentColor","aria-hidden":"true",focusable:"false",children:O5("path",{d:Gc[e]})})}import{jsx as Bo}from"react/jsx-runtime";var Wc=[{value:"left",labelKey:"left",defaultLabel:"Left",icon:Bo(J1,{name:"left_align_text"})},{value:"center",labelKey:"center",defaultLabel:"Center",icon:Bo(J1,{name:"center_align_text"})},{value:"right",labelKey:"right",defaultLabel:"Right",icon:Bo(J1,{name:"right_align_text"})},{value:"justify",labelKey:"justify",defaultLabel:"Justify",icon:Bo(J1,{name:"justify_text"})}],Xc={start:"left",end:"right"};function _5({label:e="Text Align",value:t,onChange:o,id:r="text-align",optionLabels:a}){let n=Xc[t||""]||t||"left",l=Wc.map(i=>({value:i.value,label:a?.[i.labelKey]??i.defaultLabel,icon:i.icon}));return Bo(la,{type:"single",label:e,options:l,value:n,onChange:o,id:r})}import{jsx as ia}from"react/jsx-runtime";function B5({label:e="Text Styling",id:t="text-style",fontStyle:o,textDecoration:r,textTransform:a,onChange:n,optionLabels:l}){let i=[{property:"fontStyle",label:l?.italic??"Italic",pressed:o?.trim().toLowerCase()==="italic",on:"italic",off:"normal",icon:ia(J1,{name:"italic"})},{property:"textDecoration",label:l?.underline??"Underline",pressed:r?.trim().toLowerCase().split(/\s+/).includes("underline")??!1,on:"underline",off:"none",icon:ia(J1,{name:"underline"})},{property:"textTransform",label:l?.uppercase??"Uppercase",pressed:a?.trim().toLowerCase()==="uppercase",on:"uppercase",off:"none",icon:ia(J1,{name:"uppercase"})}];return ia(la,{type:"multiple",label:e,id:t,options:i.map(s=>({...s,value:s.property})),value:i.filter(s=>s.pressed).map(s=>s.property),onChange:s=>{for(let u of i){let d=s.includes(u.property);d!==u.pressed&&n(u.property,d?u.on:u.off)}}})}var A5="textContent";var Qc=e=>e!=null&&typeof e=="object"&&"property"in e,Yc=e=>typeof e?.sourceFile=="string"&&e.sourceFile!==""&&e.lineNumber!=null&&e.columnNumber!=null?{sourceFile:e.sourceFile,lineNumber:e.lineNumber,columnNumber:e.columnNumber}:void 0;function Z5(e){let t=[],o=new Map,r=n=>{let l=Yc(n);if(!l)return;let{sourceFile:i,lineNumber:s,columnNumber:u}=l,d=`${i}\0${s}:${u}`,c=o.get(d);return c||(c={byProperty:new Map,baselineByProperty:new Map,mediaByAttribute:new Map,debugSource:l},o.set(d,c),t.push(c)),c},a=(n,l,i)=>{n.baselineByProperty.has(l)||n.baselineByProperty.set(l,String(i??""))};for(let n of e){let l=n.data;if(n.type==="style"&&l?.property!=null){let i=r(l);if(i){let s=String(l.property);a(i,s,n.oldValue),i.byProperty.set(s,String(n.newValue??""))}}else if(n.type==="style-batch"&&Array.isArray(l?.changes)){let i=r(l);for(let s of l.changes)if(i&&Qc(s)&&s.property!=null){let u=String(s.property);a(i,u,s.oldValue),i.byProperty.set(u,String(s.newValue??""))}}else if(n.type==="text")r(l)?.byProperty.set(A5,String(n.newValue??""));else if(n.type==="media"&&typeof l?.attribute=="string"&&l.attribute!==""){let i=r(l),s=String(n.newValue??""),u=i?.mediaByAttribute.get(l.attribute);u?u.value=s:i?.mediaByAttribute.set(l.attribute,{oldValue:String(n.oldValue??""),value:s})}}return t.map(n=>{let l=[...n.byProperty].map(([u,d])=>({property:u,value:d})).filter(u=>u.property===A5||u.value!==""||n.baselineByProperty.get(u.property)!==""),i=[...n.mediaByAttribute].filter(([,u])=>u.value!==u.oldValue).map(([u,d])=>({changeType:"attribute",attribute:u,value:d.value,oldValue:d.oldValue})),s=[...l,...i];return{debugSource:n.debugSource,commands:s}}).filter(n=>n.commands.length>0)}var bt={CHANGED:"history-changed",COMMAND_PUSHED:"command-pushed",COMMAND_UNDONE:"command-undone",COMMAND_REDONE:"command-redone",CLEARED:"history-cleared"},sa=class{constructor(t={}){Ht(this,"undoStack",[]);Ht(this,"redoStack",[]);Ht(this,"maxHistorySize");Ht(this,"listeners",new Set);Ht(this,"_isProcessing",!1);Ht(this,"commandExecutor");if(this.maxHistorySize=t.maxHistorySize??200,!t.commandExecutor)throw new Error("CommandExecutor is required");this.commandExecutor=t.commandExecutor}createCommand(t,o,r,a){return Object.freeze({id:this._generateCommandId(),type:t,oldValue:o,newValue:r,data:a})}_generateCommandId(){return`cmd-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}subscribe(t){if(typeof t!="function")throw new Error("Listener must be a function");return this.listeners.add(t),()=>{this.listeners.delete(t)}}_notify(t,o={}){if(this.listeners.size===0)return;let r=Object.freeze({type:t,timestamp:Date.now(),canUndo:this.canUndo(),canRedo:this.canRedo(),undoCount:this.getUndoCount(),redoCount:this.getRedoCount(),...o}),a=Array.from(this.listeners);for(let n of a)try{n(r)}catch(l){console.error("[HistoryManager] Error in listener:",l)}}pushCommand(t){if(!t||typeof t!="object")throw new Error("Invalid command: must be an object");if(!t.type)throw new Error("Invalid command: missing required fields (type)");if(this._isProcessing){console.warn("[HistoryManager] pushCommand called during processing, ignoring");return}this.undoStack.length>=this.maxHistorySize||(this.undoStack.push(t),this.redoStack=[],this._notify(bt.COMMAND_PUSHED,{command:t}),this._notify(bt.CHANGED))}_trimStack(){if(this.undoStack.length>this.maxHistorySize){let t=this.undoStack.length-this.maxHistorySize;this.undoStack.splice(0,t)}}_applyCommand(t,o){if(!this.commandExecutor.canHandle(t.type))return console.warn("[HistoryManager] No executor for command type:",t.type),!1;try{return this.commandExecutor.execute(t,o)}catch(r){return console.error("[HistoryManager] Error applying command:",r,t),!1}}_createInverseCommand(t,o){let r=this.commandExecutor.getCurrentValue(t);return Object.freeze({id:this._generateCommandId(),type:t.type,oldValue:o?t.oldValue:r,newValue:o?r:t.newValue,data:t.data})}undo(){if(this._isProcessing)return console.warn("[HistoryManager] undo called during processing, ignoring"),!1;if(!this.canUndo())return!1;this._isProcessing=!0;try{let t=this.undoStack.pop(),o=this._applyCommand(t,!0);if(o){let r=this._createInverseCommand(t,!1);this.redoStack.push(r)}else this.undoStack.push(t),console.warn("[HistoryManager] Undo failed, command restored to stack");return this._notify(bt.COMMAND_UNDONE,{command:t,appliedValue:t.oldValue}),this._notify(bt.CHANGED),o}finally{this._isProcessing=!1}}redo(){if(this._isProcessing)return console.warn("[HistoryManager] redo called during processing, ignoring"),!1;if(!this.canRedo())return!1;this._isProcessing=!0;try{let t=this.redoStack.pop();if(!t)return console.warn("[HistoryManager] No command to redo"),!1;let o=this._applyCommand(t,!1);if(o){let r=this._createInverseCommand(t,!0);this.undoStack.push(r),this._trimStack()}else this.redoStack.push(t),console.warn("[HistoryManager] Redo failed, command restored to stack");return this._notify(bt.COMMAND_REDONE,{command:t,appliedValue:t.newValue}),this._notify(bt.CHANGED),o}finally{this._isProcessing=!1}}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}clear(){this.undoStack=[],this.redoStack=[],this._notify(bt.CLEARED),this._notify(bt.CHANGED)}getUndoCount(){return this.undoStack.length}getMaxHistorySize(){return this.maxHistorySize}getRedoCount(){return this.redoStack.length}getUndoStackSnapshot(){return this.undoStack.map(t=>({type:t.type,oldValue:t.oldValue,newValue:t.newValue,data:t.data}))}};var Jc=(e,t)=>{let o=t?e.oldValue:e.newValue;return typeof o=="string"?o:String(o??"")},ua=e=>{if(!e||typeof e!="object")return;let t=e;if(!(typeof t.sourceFile!="string"||typeof t.lineNumber!="number"||typeof t.columnNumber!="number"))return{sourceFile:t.sourceFile,lineNumber:t.lineNumber,columnNumber:t.columnNumber}},e8=e=>typeof e=="object"&&e!==null&&"property"in e&&typeof e.property=="string",t8=e=>typeof e=="object"&&e!==null&&Array.isArray(e.changes)&&e.changes.every(t=>t!=null&&typeof t.property=="string"),o8=e=>typeof e=="object"&&e!==null&&"tag"in e&&typeof e.tag=="string"&&"attribute"in e&&typeof e.attribute=="string",F5=(e,t,o)=>{let r=new Map;return{execute:(a,n)=>{let l=Jc(a,n);r.set(a.id,l);try{if(a.type==="style"&&e8(a.data)){let i=ua(a.data);return e(a.data.property,l,i),!0}else if(a.type==="style-batch"&&t8(a.data)){let i=ua(a.data);for(let s of a.data.changes)e(s.property,n?s.oldValue:s.newValue,i);return!0}else if(a.type==="text"){let i=ua(a.data);return t(l,i),!0}else if(a.type==="media"&&o8(a.data)){if(!o)return!1;let i=ua(a.data);return o(a.data.tag,{[a.data.attribute]:l},i),!0}}catch{return!1}return!1},getCurrentValue:a=>r.get(a.id)??a.newValue,canHandle:a=>a==="style"||a==="style-batch"||a==="text"||a==="media"&&typeof o=="function"}};function $5(e,t,o){let r=F5(e,t,o),a=new sa({commandExecutor:r});return{recordStyleChange(n,l,i,s){let u=a.createCommand("style",l,i,{...s,property:n});a.pushCommand(u)},recordStyleBatch(n,l){if(n.length===0)return;let i=n[0],s=a.createCommand("style-batch",i.oldValue,i.newValue,{...l,changes:n});a.pushCommand(s)},recordTextChange(n,l,i){let s=a.createCommand("text",n,l,{...i});a.pushCommand(s)},recordMediaChange(n,l,i,s,u){let d=a.createCommand("media",i,s,{...u,tag:n,attribute:l});a.pushCommand(d)},undo:()=>a.undo(),redo:()=>a.redo(),canUndo:()=>a.canUndo(),canRedo:()=>a.canRedo(),subscribe:n=>a.subscribe(n),getHistoryStack:()=>a.getUndoStackSnapshot(),clear:()=>a.clear(),getUndoCount:()=>a.getUndoCount(),getMaxHistorySize:()=>a.getMaxHistorySize()}}import da from"react";var r8=20,o2="design-mode:recent-colors:v1:",a8=r1("rgb");function fa(e){if(!Array.isArray(e))return[];let t=new Set,o=[];for(let r of e){if(typeof r!="string"||r.length>512||/^[\da-f]+$/i.test(r.trim()))continue;let a=z1(r);if(!a)continue;let n=a8(a),l=JSON.stringify([...[n.r,n.g,n.b].map(i=>Number((i??0).toFixed(12))),n.alpha??1]);if(!t.has(l)&&(t.add(l),o.push(r),o.length===r8))break}return o}function ca(e){if(!e)return[];let t;try{t=localStorage.getItem(o2+e)}catch{return}try{return fa(JSON.parse(t??"[]"))}catch{return[]}}function N5(e){let t=da.useRef([]),[o,r]=da.useState(()=>({applicationId:e,colors:ca(e)??[]})),a=o;o.applicationId!==e&&(t.current=[],a={applicationId:e,colors:ca(e)??[]},r(a));let n=da.useRef(a);n.current=a,da.useEffect(()=>{if(!e)return;let i=s=>{if(s.storageArea&&s.storageArea!==localStorage||s.key!==null&&s.key!==o2+e)return;let u=s.key===null||s.newValue===null;u&&(t.current=[]);let d={applicationId:e,colors:u?[]:fa([...t.current,...ca(e)??n.current.colors])};n.current=d,r(d)};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[e]);let l=i=>{let s=e?ca(e)??n.current.colors:n.current.colors,u=fa([i,...t.current,...s]),d={applicationId:e,colors:u};if(n.current=d,r(d),!!e)try{localStorage.setItem(o2+e,JSON.stringify(u)),t.current=[]}catch{t.current=fa([i,...t.current])}};return{recentColors:a.colors,recordColor:l}}var r2=`url\\(\\s*(['"]?)([^'")]+)\\1\\s*\\)`,n8=new RegExp(r2,"i");function pa(e){let t=[],o=0,r="";for(let a of e)a==="("?o++:a===")"&&o--,a===","&&o===0?(t.push(r.trim()),r=""):r+=a;return r.trim()!==""&&t.push(r.trim()),t}function a2(e){let t=pa((e??"").trim());for(let o=0;o<t.length;o++){let r=t[o]??"",a=n8.exec(r);if(a?.[2])return{index:o,layer:r,path:a[2].trim()}}return null}var l8=new RegExp(r2,"i");function i8(e,t){let o=`url("${t}")`,r=(e??"").trim();if(!K1(r))return o;let a=a2(r),n=pa(r);return a?n.map((l,i)=>i===a.index?l.replace(l8,()=>o):l).join(", "):[o,...n].join(", ")}function s8(e){let t=(e??"").trim();if(!K1(t))return"none";let o=a2(t);if(!o)return t;let r=pa(t);return r.splice(o.index,1),r.length===0?"none":r.join(", ")}function U5(e,t){return t.trim()===""?s8(e):i8(e,t)}import{Fragment as l2,jsx as ie,jsxs as Ke}from"react/jsx-runtime";var ga=["top","right","bottom","left"];function i2(e,t,o){let r=$1[e];return r.some(a=>o?.[a]!=null)?Object.fromEntries(r.map((a,n)=>[ga[n],t[a]??""])):lt(t[e]??"")}function Ao(e,t){let o=ga.map(n=>t[n].trim().split(/\s+/)),r=e==="borderRadius";if(o.some(n=>n.length>(r?2:1)||n.some(l=>{let i=/^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(px|%)?$/i.exec(l);return!i||!Number.isFinite(Number(i[1]))||e!=="margin"&&Number(i[1])<0||(i[2]==="%"?!r:!i[2]&&Number(i[1])!==0)})))return;let a=o.map(n=>n[0]).join(" ");return r&&o.some(n=>n.length===2)?`${a} / ${o.map(n=>n[1]??n[0]).join(" ")}`:a}function ma(e,t,o){if((t==="fontFamily"||t==="fontWeight")&&o&&!/^(inherit|initial|unset|revert|revert-layer)$/i.test(o.trim())&&!/\bvar\(/i.test(o))return{...e,[t]:o};if(!(t in $1))return e;let r=lt(o);return{...e,[t]:o,...Object.fromEntries($1[t].map((a,n)=>[a,r[ga[n]]]))}}function q5(e,t,o){let r=ma(e,t,o);return t==="color"?{...r,webkitTextFillColor:o||e.color||""}:r}function G5(e,t,o){if(t===o)return!0;if(e!=="fontFamily")return!1;let r=a=>a.replace(/['"]/g,"").replace(/\s*,\s*/g,",");return r(t)===r(o)}function z5(e){let t=e?.trim()??"";return t.endsWith("px")&&a1(t.slice(0,-2))?Number(t.slice(0,-2)):void 0}function n2(e,t,o){let r=t[e];if(r==="normal"){let l=o[e]?.trim().toLowerCase()??"";return/^[+-]?(?:0+(?:\.0*)?|\.0+)(?:[a-z]+|%)?$/i.test(l)||l==="inherit"&&e==="letterSpacing"?"0":r}let a=z5(r);if(a===void 0)return"";if(e==="fontSize")return String(Number(a.toFixed(2)));let n=z5(t.fontSize);return n!==void 0&&n>0?String(Number((a/n).toFixed(e==="letterSpacing"?3:2))):""}var d8="Edit this element's text on the canvas.",c8="You can't edit this element's text because it contains dynamic content.",f8={opacity:.4},p8=new Set(v2),C8="designMode.imageSourceEditorEnabled",m8=!1;function g8(){try{let e=window.localStorage.getItem(C8);return e==null?void 0:e==="true"}catch{return}}var h8={general:{headerTitle:"Selected Element",emptyPlaceholder:"To edit an element, select it on the canvas.",inlineEditEditable:d8,inlineEditNonEditable:c8,addToChatContext:"Add to chat as context",ariaPropertyPanel:"Property panel",ariaSelectedComponent:"Property panel for the selected element",ariaElementStyling:"Element properties",closePanel:"Close panel"},sections:{imageSource:"Image Source",background:"Background",spacing:"Layout",border:"Border",typography:"Typography"},instances:{imageSource:"Source",backgroundColor:"Background Color",padding:"Padding",margin:"Margin",borderRadius:"Border Radius",fontFamily:"Font Family",fontSize:"Font Size",fontWeight:"Font Style",textStyling:"Text Styling",textColor:"Text Color",textAlignment:"Text Alignment",lineHeight:"Line Height",letterSpacing:"Letter Spacing"},history:{changeLimitTitle:"You're at the edit limit",changeLimitBody:"To continue editing, save your changes."}};function j5(e,t){let o=e.get(t);return{baseStyles:o?.styles??et,baseComputed:o?.computedStyles??et,edits:o?.sessionEdits??new Set}}function v8({size:e=16}){return ie("svg",{width:e,height:e,viewBox:"-1 0 252 302",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:ie("path",{d:"M57 49Q67 49 74 42Q81 35 81 25Q81 15 74 8Q67 1 57 1Q47 1 40 8Q33 15 33 25Q33 35 40 42Q47 49 57 49ZM193 49Q203 49 210 42Q217 35 217 25Q217 15 210 8Q203 1 193 1Q183 1 176 8Q169 15 169 25Q169 35 176 42Q183 49 193 49ZM125 301Q100 301 71 292Q47 285 26 274Q7 265 3.5 259.5Q0 254 1 249Q13 216 20 189Q24 171 26 157V147Q28 120 30 105Q34 78 40 65Q48 48 63 39Q85 27 125 27Q165 27 186 39Q201 47 209 65Q216 78 220 105Q222 120 224 147V157Q226 171 230 189Q237 216 248 249Q250 254 246.5 259.5Q243 265 224 274Q203 285 179 292Q150 301 125 301ZM23 249Q39 259 63 268Q97 280 125 280Q153 280 187 268Q210 259 227 249Q216 219 210 194Q205 174 204 159L203 148Q199 91 191 73Q188 66 184 62Q177 56 165 52Q150 48 125 48Q90 48 73 57Q64 63 59 73Q51 91 47 148L46 158Q45 174 40 194Q34 220 23 249ZM124 248Q113 248 102 244Q84 236 76 217Q72 209 71 201Q70 193 70 179Q70 163 73 151Q76 142 81.5 134Q87 126 98 120Q109 114 125.5 114Q142 114 152 120Q164 127 169 134.5Q174 142 177 151Q180 163 180 178.5Q180 194 179 200Q178 209 174 218Q167 232 154.5 240Q142 248 126 248ZM124 228H126Q147 228 156 209Q158 203 159 197.5Q160 192 160 179Q160 166 157 157Q155 151 152 146.5Q149 142 141 138Q136 134 125 134Q114 134 107.5 138Q101 142 98 146.5Q95 151 93 157Q90 166 90 178.5Q90 191 91 197Q92 203 94 209Q99 221 111 225Q117 228 124 228ZM195 81Q192 79 190 78Q170 70 146 76Q134 80 125.5 80Q117 80 104 76Q80 70 60 78Q58 79 55 81Q50 84 51 89L55 112Q56 117 59.5 120.5Q63 124 68 125Q83 126 99 126Q111 126 115 114L122 92Q122 91 124 89L125 88L126 89Q128 91 128 92L135 114Q139 126 152 126Q167 126 182 125Q187 124 190.5 120.5Q194 117 195 112L199 89Q200 84 195 81ZM141 192Q137 190 133 193V171Q138 169 141 165Q143 163 144 161Q145 159 145 156.5Q145 154 143.5 152Q142 150 140 148.5Q138 147 134 146Q130 145 125.5 145Q121 145 116 146Q111 147 109 149Q107 151 106 153Q105 155 105 157Q105 159 106 161Q107 163 109.5 166Q112 169 116 171H117V193Q113 190 109 191.5Q105 193 104 196Q103 199 105 202Q108 210 117 213Q124 216 133 213L134 212Q143 209 146 202Q147 199 145.5 196Q144 193 141 192Z"})})}function x8({size:e=12}){return ie("svg",{width:e,height:e,viewBox:"0 0 12 12","aria-hidden":"true",style:{display:"block",flexShrink:0},children:ie("rect",{x:"1",y:"1",width:"10",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"2.5 2"})})}function L8(e,t){let o=e[t];return o!=null?String(o):""}function Ca(e){if(!(!e||!e.name||!e.debugSource))return{sourceFile:e.debugSource.sourceFile,lineNumber:e.debugSource.lineNumber,columnNumber:e.debugSource.columnNumber,componentName:e.name,tagName:e.tagName}}function w8({component:e,onOpenSourceFile:t,showOpenSourceFile:o,showComponentName:r,generalLabels:a}){if(!e||!e.name)return ie("section",{id:"property-panel-selected-component",className:"property-panel-selected-component",children:ie("p",{className:"property-panel-selected-component-placeholder",id:"component-info",children:a.emptyPlaceholder})});let n=e.tagName?e.tagName.toLowerCase():"",l=n?`${e.name} > ${n}`:e.name,i=null;if(o&&e.debugSource){let{sourceFile:s,lineNumber:u,columnNumber:d}=e.debugSource,c=s.split("/").pop()||s,p=`:${u}:${d}`;i=Ke("a",{href:"#",className:"property-panel-selected-component-source",onClick:f=>{f.preventDefault(),t?.({sourceFile:s,lineNumber:u,columnNumber:d})},title:`${s}${p}`,children:[c,p]})}return!r&&!i?null:ie("section",{id:"property-panel-selected-component",className:"property-panel-selected-component","aria-label":a.ariaSelectedComponent,children:Ke("div",{id:"component-info",className:"property-panel-selected-component-info",children:[r&&ie("span",{className:"property-panel-selected-component-name",children:l}),i&&Ke("span",{className:"property-panel-selected-component-source-row",children:["\u21B3 ",i]})]})})}var I8=Ce.forwardRef(function({title:t,body:o},r){return Ke("section",{ref:r,role:"alert","aria-live":"assertive","aria-labelledby":"property-panel-change-limit-title",className:"property-panel-change-limit-message",tabIndex:-1,children:[ie("svg",{className:"property-panel-change-limit-icon",viewBox:"0 0 520 520",fill:"currentColor","aria-hidden":"true",focusable:"false",children:ie("path",{d:"M260 20a240 240 0 100 480 240 240 0 100-480m0 121c17 0 30 13 30 30s-13 30-30 30-30-13-30-30 13-30 30-30m50 210c0 5-4 9-10 9h-80c-5 0-10-3-10-9v-20c0-5 4-11 10-11 5 0 10-3 10-9v-40c0-5-4-11-10-11-5 0-10-3-10-9v-20c0-5 4-11 10-11h60c5 0 10 5 10 11v80c0 5 4 9 10 9 5 0 10 5 10 11z"})}),Ke("div",{className:"property-panel-change-limit-content",children:[ie("h2",{id:"property-panel-change-limit-title",className:"property-panel-change-limit-title",children:t}),ie("p",{className:"property-panel-change-limit-body",children:o})]})]})});function K5(e,t){let o=t==="src"?e.srcKind:e.altKind;if(o===void 0)return"not-editable";if(!(o==="literal"||t==="src"&&o==="asset-import"))return"from-data"}function b8({recentColors:e,onColorApplied:t,styles:o,computedStyles:r,measuredStyles:a,editorResetVersion:n,colorResetVersion:l,hasSelection:i,onStyleChange:s,onBoxSidesChange:u,generalLabels:d,sectionLabels:c,instanceLabels:p,editorLabels:g,component:f,onImageAttributeChange:M,imageSource:x,imageSourceEditorEnabled:w}){let h=i?"visible":"",S=f?.tagName?.toUpperCase()??"",H=f?.propertyEditorCapabilities??{text:!"IMG SVG CANVAS VIDEO AUDIO IFRAME OBJECT EMBED HR BR SCRIPT STYLE TEMPLATE".split(" ").includes(S),box:!["SCRIPT","STYLE","TEMPLATE","OPTION","OPTGROUP","SVG"].includes(S)},k=w&&f?.media?.tag==="img"?f.media:null,Z=w&&f?.media?.tag==="background-image"?f.media:null,V=I=>a?.[I]?.computed!=null?a:void 0,L=Ce.useMemo(()=>Object.fromEntries(Object.keys($1).map(I=>[I,i2(I,r,a)])),[r,a]);if(!i)return null;let y=o.backgroundImage||r.backgroundImage,R=o.backgroundClip||r.backgroundClip,_=R0(y??"",R??"","text"),N=_!=="",K=H0(y??"",R??""),z=Vn(y??"",R??""),W=K1(K)?"rgba(0, 0, 0, 0)":"#ffffff",F=I=>I0(I)?I:void 0,D=F(o.backgroundColor),B=F(r.backgroundColor),U=F(o.color),A=F(r.color),q=o.webkitTextFillColor||r.webkitTextFillColor,T=o.color||r.color,j=En(q,T),m=I=>{let P=o[I],C=a?.[I];return C&&G5(I,P??"",C.inline??"")&&C.computed?C.computed:P&&!/^(inherit|initial|unset|revert|revert-layer)$/i.test(P.trim())&&!/\bvar\(/i.test(P)?P:r[I]};return ie("section",{className:"property-panel-style-properties-container"+(h?" "+h:""),"aria-label":d.ariaElementStyling,"aria-hidden":!i,children:Ke("div",{className:"property-panel-style-properties",children:[H.text&&Ke(l2,{children:[Ke(nt,{title:c.typography,children:[ie(Ni,{label:p.fontFamily,id:"design-font-family",value:o.fontFamily,computedValue:r.fontFamily,onChange:I=>s("fontFamily",I),useInheritLabel:g?.dimension?.useInherit}),Ke("div",{className:"property-panel-typography-row",children:[ie(Ui,{label:p.fontWeight,id:"design-font-weight",value:o.fontWeight,computedValue:r.fontWeight,fontFamily:r.fontFamily,onChange:I=>s("fontWeight",I),optionLabels:g?.fontWeight?.options,useInheritLabel:g?.dimension?.useInherit}),ie(Pr,{label:p.fontSize,id:"design-font-size",value:o.fontSize,...Fo.fontSize,displayValue:n2("fontSize",r,o),measurement:V("fontSize"),resetVersion:n,onChange:I=>s("fontSize",I),aria:g?.dimension})]}),ie(_5,{label:p.textAlignment,id:"design-text-align",value:o.textAlign||r.textAlign,onChange:I=>s("textAlign",I),optionLabels:g?.textAlignment?.options}),ie(B5,{label:p.textStyling,id:"design-text-style",fontStyle:m("fontStyle"),textDecoration:m("textDecoration"),textTransform:m("textTransform"),onChange:s,optionLabels:g?.textStyle?.options}),Ke("div",{className:"property-panel-typography-row",children:[ie(Pr,{label:p.lineHeight,id:"design-line-height",value:o.lineHeight,...Fo.lineHeight,displayValue:n2("lineHeight",r,o),measurement:V("lineHeight"),resetVersion:n,onChange:I=>s("lineHeight",I),aria:g?.dimension}),ie(Pr,{label:p.letterSpacing,id:"design-letter-spacing",value:o.letterSpacing,...Fo.letterSpacing,displayValue:n2("letterSpacing",r,o),measurement:V("letterSpacing"),resetVersion:n,onChange:I=>s("letterSpacing",I),aria:g?.dimension})]})]}),ie(nt,{title:p.textColor,children:ie(_n,{label:p.textColor,recentColors:e,onColorApplied:t,value:j?q:U||A||(N?"rgba(0, 0, 0, 0)":"#000000"),onChange:I=>s("color",I),id:"design-text-color",aria:g?.color,resetVersion:l,backgroundImage:N?_:void 0})})]}),H.box&&Ke(l2,{children:[Ke(nt,{title:c.spacing,children:[ie(Uo,{label:p.padding,id:"design-padding",displayValue:r.padding??"",displaySides:L.padding,measurement:V("padding"),resetVersion:n,paired:!0,onSidesChange:I=>u("padding",I),aria:g?.boxDimension}),ie(Uo,{label:p.margin,id:"design-margin",displayValue:r.margin??"",displaySides:L.margin,measurement:V("margin"),resetVersion:n,paired:!0,onSidesChange:I=>u("margin",I),allowNegative:!0,aria:g?.boxDimension})]}),ie(nt,{title:c.background,children:ie(_n,{label:p.backgroundColor,recentColors:e,onColorApplied:t,value:z?"rgba(0, 0, 0, 0)":D||B||W,onChange:I=>s("backgroundColor",I),id:"design-bg-color",aria:g?.color,resetVersion:l,backgroundImage:K||void 0})}),ie(nt,{title:c.border,children:ie(Uo,{label:p.borderRadius,id:"design-border-radius",displayValue:r.borderRadius??"",displaySides:L.borderRadius,measurement:V("borderRadius"),resetVersion:n,onSidesChange:I=>u("borderRadius",I),uniform:!0,sideLabelKind:"corners",aria:g?.boxDimension})})]}),k&&ie(nt,{title:c.imageSource,children:ie($l,{label:p.imageSource,value:k.src,onChange:I=>M("src",I),id:"design-img-src",attributes:{alt:k.alt},onAttributeChange:M,sourceReadOnly:K5(k,"src"),altReadOnly:K5(k,"alt"),sharedCount:f?.instanceCount,imageLabels:g?.image,...x})}),Z&&ie(nt,{title:c.imageSource,children:ie($l,{label:p.imageSource,value:Z.src,onChange:I=>s("backgroundImage",U5(y,I)),id:"design-bg-img-src",imageLabels:g?.image,...x})})]})})}var W5=["padding","margin","backgroundColor","backgroundImage","backgroundClip","borderRadius","color","webkitTextFillColor","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textAlign","textDecoration","textTransform",...Object.values($1).flat()],et=Object.fromEntries(W5.map(e=>[e,""]));function yt(e,t,o,r,a=et){let n={...t};for(let l of W5){let i=e[l];r==="computed"&&(l==="fontFamily"||l==="fontWeight")&&o.has(l)&&!G5(l,a[l]??"",i?.inline??"")||(r==="computed"&&L2.has(l)?n[l]=i?.computed??"":i!=null&&(!o.has(l)||r==="computed"&&(x2.has(l)||a[l]===""&&(i.inline??"")===""))&&(n[l]=i[r]??t[l]??""))}if(r==="computed"){let l=Object.fromEntries(Object.entries(e).map(([s,u])=>[s,u.inline??""])),i=s=>{let u=s.trim().split(/\s+/).map(d=>`${Number.parseFloat(d)}${d.endsWith("%")?"%":"px"}`);return[u[0],u[1]??u[0]].join(" ")};for(let[s,u]of Object.entries($1)){if(!o.has(s))continue;let d=Ao(s,lt(a[s]??"")),c=document.createElement("div").style;c[s]=d??"";let p=lt(c[s]),g=i2(s,l,e);if(Ao(s,p)!==void 0&&Ao(s,g)!==void 0&&ga.every(f=>i(p[f])===i(g[f]))){u.some(f=>e[f]!=null)||(n=ma(n,s,n[s]??""));continue}for(let f of[s,...u])n[f]=t[f]??""}}return n}var X5=Ce.forwardRef(function(t,o){return ie(y8,{...t,ref:o},t.applicationId)}),y8=Ce.forwardRef(function(t,o){let{component:r,styles:a,onStyleChange:n,onTextChange:l,onHistoryStateChange:i,onAddToChatContext:s,onOpenSourceFile:u,onClose:d,onMediaChange:c,showAddToChatContext:p=!0,showOpenSourceFile:g=!0,compactHeader:f=!1,labels:M,imageSource:x,imageSourceEditorEnabled:w}=t,{recentColors:h,recordColor:S}=N5(t.applicationId),H=Ce.useMemo(()=>w??g8()??m8,[w]),k=M1(h8,M),[Z,V]=Ce.useState(()=>yt(a||{},et,new Set,"inline")),[L,y]=Ce.useState(()=>yt(a||{},et,new Set,"computed")),[R,_]=Ce.useState(()=>new Set),N=Ce.useRef(Z);N.current=Z;let K=Ce.useRef(L);K.current=L;let z=Ce.useRef(R);z.current=R;let W=Ce.useCallback(Y=>{Y.styles&&(N.current=Y.styles,V(Y.styles)),Y.computed&&(K.current=Y.computed,y(Y.computed)),Y.edits&&(z.current=Y.edits,_(Y.edits))},[]),F=Ce.useRef(a);F.current=a;let D=Ce.useRef(new Map),B=Ce.useRef(n);B.current=n;let U=Ce.useRef(l);U.current=l;let A=Ce.useRef(c);A.current=c;let q=Ce.useRef(null);q.current||(q.current=$5((Y,se,ue)=>B.current(Y,se,ue,!0),(Y,se)=>U.current?.(Y,se),(Y,se,ue)=>A.current?.(Y,se,ue)));let T=q.current,j=Ce.useRef(i);j.current=i;let[m,I]=Ce.useState(()=>T.getUndoCount()),[P,C]=Ce.useState(0),[$,v]=Ce.useState(0),b=T.getMaxHistorySize(),G=Ce.useRef("none");Ce.useEffect(()=>{let Y=ue=>{if(j.current?.({canUndo:ue.canUndo,canRedo:ue.canRedo}),I(ue.undoCount),!(ue.type==="command-undone"||ue.type==="command-redone"))return;let Ue=ue.type==="command-undone",Xe=ue.command?.data?.property,d1=ue.command?.data?.changes,A1=[];if(typeof Xe=="string"?A1=[[Xe,typeof ue.appliedValue=="string"?ue.appliedValue:""]]:Array.isArray(d1)&&(A1=d1.filter(Ie=>Ie!=null&&typeof Ie.property=="string").map(Ie=>[Ie.property,String((Ue?Ie.oldValue:Ie.newValue)??"")])),A1.length===0)return;let Z1=ue.command?.data,Ft=Z1&&typeof Z1.componentName=="string"?`${Z1.sourceFile??""}-${Z1.componentName}-${Z1.tagName??""}-${Z1.lineNumber??""}-${Z1.columnNumber??""}`:null;if(Ft!==null&&Ft!==G.current){let Ie=D.current.get(Ft);if(!Ie)return;let tt={...Ie.styles},St=Ie.computedStyles,Le=new Set(Ie.sessionEdits);for(let[ot,Rt]of A1)tt[ot]=Rt,St=q5(St,ot,Rt),Le.add(ot);D.current.set(Ft,{...Ie,styles:tt,computedStyles:St,sessionEdits:Le});return}C(Ie=>Ie+1),v(Ie=>Ie+1);let so={...N.current},Mt=K.current,F1=new Set(z.current);for(let[Ie,tt]of A1)so[Ie]=tt,Mt=q5(Mt,Ie,tt),F1.add(Ie);W({styles:so,computed:Mt,edits:F1})},se=T.subscribe(Y);return j.current?.({canUndo:T.canUndo(),canRedo:T.canRedo()}),I(T.getUndoCount()),se},[T,W]);let J=m>=b,oe=Ce.useRef(null),ce=Ce.useRef(!1);Ce.useEffect(()=>{J&&!ce.current&&oe.current?.focus(),ce.current=J},[J]),Ce.useImperativeHandle(o,()=>({undo:()=>T.undo(),redo:()=>T.redo(),clearHistory:Y=>{if(Y?.keepSelectedStyles||v(se=>se+1),C(se=>se+1),T.clear(),D.current.clear(),Y?.keepSelectedStyles){let se=F.current||{},ue=new Set;W({styles:yt(se,et,ue,"inline"),computed:yt(se,et,ue,"computed"),edits:new Set})}else W({styles:et,computed:et,edits:new Set});I(0)},getHistoryStack:()=>T.getHistoryStack(),getChangeSet:()=>Z5(T.getHistoryStack()),recordTextChange:(Y,se,ue)=>T.recordTextChange(Y,se,ue),canUndo:()=>T.canUndo(),canRedo:()=>T.canRedo()}),[T,W]);let he=r?`${r.debugSource?.sourceFile??""}-${r.name}-${r.tagName??""}-${r.debugSource?.lineNumber??""}-${r.debugSource?.columnNumber??""}`:"none";G.current=he;let Me=Ce.useRef("none");Ce.useEffect(()=>{let Y=Me.current,se,ue,Ve;he!==Y?(Y!=="none"&&(z.current.size>0?D.current.set(Y,{styles:N.current,computedStyles:K.current,sessionEdits:z.current}):D.current.delete(Y)),Me.current=he,{baseStyles:se,baseComputed:ue,edits:Ve}=j5(D.current,he)):(se=N.current,ue=K.current,Ve=z.current);let Ue=a||{};W({styles:yt(Ue,se,Ve,"inline"),computed:yt(Ue,ue,Ve,"computed",se),edits:Ve})},[he,a,W]);let we=he!==Me.current?j5(D.current,he):void 0,Te=we?yt(a||{},we.baseStyles,we.edits,"inline"):Z,De=we?yt(a||{},we.baseComputed,we.edits,"computed",we.baseStyles):L,Se=(Y,se)=>{let ue=i2(Y,K.current,F.current),Ve=Ao(Y,ue),Ue=Ao(Y,{...ue,...se});if(Ve===void 0||Ue===void 0)return!1;if(Ve===Ue)return!0;let Xe=new Set(z.current);return Xe.add(Y),W({styles:{...N.current,[Y]:Ue},computed:ma(K.current,Y,Ue),edits:Xe}),T.recordStyleChange(Y,Ve,Ue,Ca(r)),n(Y,Ue,r?.debugSource),!0},b1=Ce.useCallback((Y,se)=>{let ue=L8(N.current,Y),Ve=Ca(r),Ue=r?.debugSource?{sourceFile:r.debugSource.sourceFile,lineNumber:r.debugSource.lineNumber,columnNumber:r.debugSource.columnNumber}:void 0,Xe=N.current.backgroundImage||K.current.backgroundImage||"",d1=N.current.backgroundClip||K.current.backgroundClip||"",A1=Vn(Xe,d1),Z1=N.current.color||K.current.color||"",Ft=!!N.current.webkitTextFillColor?.trim(),so={property:"webkitTextFillColor",isOccluding:Le=>En(Le,Z1,Ft),resetValue:"currentcolor"},Mt=[];Y==="backgroundColor"?Mt=A1?[so]:[]:Y==="color"&&(Mt=[so]);let F1=Mt.flatMap(({property:Le,isOccluding:ot,resetValue:Rt})=>E0(se,Le,K.current[Le],N.current[Le],ot,Rt)),Ie=(Le,ot,Rt)=>{Rt!==ot&&F1.push({property:Le,oldValue:ot,newValue:Rt})};if(se.trim()!==""&&(K1(Xe)||A1))if(Y==="backgroundColor"){let Le=A1?V0(Xe,d1):d1;Ie("backgroundClip",d1,Le),Ie("backgroundImage",Xe,T0(Xe,Le))}else Y==="color"&&Ie("backgroundImage",Xe,P0(Xe,d1));n(Y,se,Ue);for(let Le of F1)n(Le.property,Le.newValue,Ue);F1.length===0?T.recordStyleChange(Y,ue,se,Ve):T.recordStyleBatch([{property:Y,oldValue:ue,newValue:se},...F1.map(Le=>({property:Le.property,oldValue:Le.oldValue,newValue:Le.newValue}))],Ve);let tt={...N.current,[Y]:se};for(let Le of F1)tt[Le.property]=Le.newValue;W({styles:tt,computed:ma(K.current,Y,se)}),Y==="color"&&y(Le=>({...Le,webkitTextFillColor:se}));let St=new Set(z.current);St.add(Y);for(let Le of F1)St.add(Le.property);W({edits:St})},[n,T,r,W]),Ne=Ce.useCallback((Y,se)=>{let ue=r?.media;if(!ue)return;let Ve=r?.debugSource;c?.(ue.tag,{[Y]:se},Ve);let Ue=String(ue[Y]??"");T.recordMediaChange(ue.tag,Y,Ue,se,Ca(r))},[r,c,T]),Oe=!!(r&&r.name),re=Ce.useCallback(()=>{let Y=Ca(r);Y&&s?.(Y)},[r,s]),Ge=Oe&&r&&r.tagName&&p8.has(r.tagName.toUpperCase()),He=r?.hasNonEditableText?k.general.inlineEditNonEditable:k.general.inlineEditEditable,C1=r?.tagName?r.tagName.toLowerCase():r?.name,y1=Ce.useRef(null),e1=Ce.useRef(null);return Ce.useLayoutEffect(()=>{let Y=e1.current,se=y1.current;if(!Y||Y.isConnected||!se)return;let ue=se.getRootNode(),Ve=se.ownerDocument.activeElement,Ue=ue instanceof ShadowRoot?ue.host:null,Xe=!1;if(Ve?.tagName==="IFRAME")try{let d1=Ve.contentDocument;Xe=!!(d1&&(!d1.activeElement||d1.activeElement===d1.body))}catch{}(Ve===se.ownerDocument.body||Ve===Ue&&!ue.activeElement||Xe)&&se.focus(),e1.current=null}),Ke("div",{ref:y1,tabIndex:-1,onFocusCapture:Y=>{e1.current=Y.target},role:"complementary","aria-label":k.general.ariaPropertyPanel,className:"property-panel-container",children:[Ke("header",{className:f?"property-panel-header property-panel-header-compact":"property-panel-header",children:[f?Oe&&Ke("span",{className:"property-panel-selected-pill",children:[ie(x8,{size:12}),ie("span",{className:"property-panel-selected-pill-tag",children:C1})]}):ie("h2",{id:"design-property-panel-title",className:"property-panel-title",children:k.general.headerTitle}),(Oe||d)&&Ke("div",{className:"property-panel-header-actions",children:[Oe&&Ke(l2,{children:[Ge&&ie("span",{className:"property-panel-selected-component-action property-panel-selected-component-action-help","data-tooltip":He,"aria-label":He,children:ie(p2,{width:14,height:14,style:r.hasNonEditableText?f8:void 0})}),p&&!J&&ie("button",{type:"button",className:"property-panel-selected-component-action",onClick:re,"data-tooltip":k.general.addToChatContext,"aria-label":k.general.addToChatContext,children:ie(v8,{size:14})})]}),d&&ie("button",{type:"button",className:"property-panel-selected-component-action property-panel-close",onClick:d,"data-tooltip":k.general.closePanel,"aria-label":k.general.closePanel,children:ie(d2,{width:14,height:14,"aria-hidden":"true"})})]})]}),Ke("div",{className:"property-panel-content","aria-labelledby":f?void 0:"design-property-panel-title",children:[ie(w8,{component:r,onOpenSourceFile:u,showOpenSourceFile:g,showComponentName:!f,generalLabels:k.general}),J?ie(I8,{ref:oe,title:k.history.changeLimitTitle,body:k.history.changeLimitBody}):ie(b8,{recentColors:h,onColorApplied:S,editorResetVersion:P,colorResetVersion:$,styles:Te,computedStyles:De,measuredStyles:a,hasSelection:Oe,onStyleChange:b1,onBoxSidesChange:Se,generalLabels:k.general,sectionLabels:k.sections,instanceLabels:k.instances,editorLabels:M?.editors,component:r,onImageAttributeChange:Ne,imageSource:x,imageSourceEditorEnabled:H},he)]})]})});function M8(e,t,o){if(!e)return;u8(e).render(Ce.createElement(X5,{...t,ref:o}))}export{X5 as DesignPropertyPanel,w2 as REQUIRED_LABEL_KEYS,Re as interpolate,M8 as mountDesignPropertyPanel,vs as validateLabels};
|
|
3
|
+
`||t[ae]===" "||t[ae]===" ");)ae++;continue}if(r===",")return;if(r===")"){o.push({type:D.ParenClose});continue}if(r==="+"){if(ae--,or(t)){o.push(xo(t));continue}return}if(r==="-"){if(ae--,or(t)){o.push(xo(t));continue}if(_a(t)){o.push({type:D.Ident,value:ar(t)});continue}return}if(r==="."){if(ae--,or(t)){o.push(xo(t));continue}return}if(r==="/"){for(;ae<t.length&&(t[ae]===`
|
|
4
|
+
`||t[ae]===" "||t[ae]===" ");)ae++;let a;if(or(t)&&(a=xo(t),a.type!==D.Hue)){o.push({type:D.Alpha,value:a});continue}if(_a(t)&&ar(t)==="none"){o.push({type:D.Alpha,value:{type:D.None,value:void 0}});continue}return}if(/\d/.test(r)){ae--,o.push(xo(t));continue}if(Oa.test(r)){ae--,o.push(Xu(t));continue}return}return o}function Yu(e){e._i=0;let t=e[e._i++];if(!t||t.type!==D.Function||t.value!=="color"||(t=e[e._i++],t.type!==D.Ident))return;let o=Da[t.value];if(!o)return;let r={mode:o},a=g9(e,!1);if(!a)return;let n=tr(o).channels;for(let l=0,i,s;l<n.length;l++)i=a[l],s=n[l],i.type!==D.None&&(r[s]=i.type===D.Number?i.value:i.value/100,s==="alpha"&&(r[s]=Math.max(0,Math.min(1,r[s]))));return r}function g9(e,t){let o=[],r;for(;e._i<e.length;){if(r=e[e._i++],r.type===D.None||r.type===D.Number||r.type===D.Alpha||r.type===D.Percentage||t&&r.type===D.Hue){o.push(r);continue}if(r.type===D.ParenClose){if(e._i<e.length)return;continue}return}if(!(o.length<3||o.length>4)){if(o.length===4){if(o[3].type!==D.Alpha)return;o[3]=o[3].value}return o.length===3&&o.push({type:D.None,value:void 0}),o.every(a=>a.type!==D.Alpha)?o:void 0}}function Ju(e,t){e._i=0;let o=e[e._i++];if(!o||o.type!==D.Function)return;let r=g9(e,t);if(r)return r.unshift(o.value),r}var ed=e=>{if(typeof e!="string")return;let t=Qu(e),o=t?Ju(t,!0):void 0,r,a=0,n=vo.length;for(;a<n;)if((r=vo[a++](e,o))!==void 0)return r;return t?Yu(t):void 0},z1=ed;function td(e,t){if(!t||t[0]!=="rgb"&&t[0]!=="rgba")return;let o={mode:"rgb"},[,r,a,n,l]=t;if(!(r.type===D.Hue||a.type===D.Hue||n.type===D.Hue))return r.type!==D.None&&(o.r=r.type===D.Number?r.value/255:r.value/100),a.type!==D.None&&(o.g=a.type===D.Number?a.value/255:a.value/100),n.type!==D.None&&(o.b=n.type===D.Number?n.value/255:n.value/100),l.type!==D.None&&(o.alpha=Math.min(1,Math.max(0,l.type===D.Number?l.value:l.value/100))),o}var h9=td;var od=e=>e==="transparent"?{mode:"rgb",r:0,g:0,b:0,alpha:0}:void 0,v9=od;var x9=(e,t,o)=>e+o*(t-e);var rd=e=>{let t=[];for(let o=0;o<e.length-1;o++){let r=e[o],a=e[o+1];r===void 0&&a===void 0?t.push(void 0):r!==void 0&&a!==void 0?t.push([r,a]):t.push(r!==void 0?[r,r]:[a,a])}return t},L9=e=>t=>{let o=rd(t);return r=>{let a=r*o.length,n=r>=1?o.length-1:Math.max(Math.floor(a),0),l=o[n];return l===void 0?void 0:e(l[0],l[1],a-n)}};var _=L9(x9);var fe=e=>{let t=!1,o=e.map(r=>r!==void 0?(t=!0,r):1);return t?o:e};var ad={mode:"rgb",channels:["r","g","b","alpha"],parse:[h9,f9,C9,c9,v9,"srgb"],serialize:"srgb",interpolate:{r:_,g:_,b:_,alpha:{use:_,fixup:fe}},gamut:!0,white:{r:1,g:1,b:1},black:{r:0,g:0,b:0}},g1=ad;var Ba=(e=0)=>Math.pow(Math.abs(e),2.19921875)*Math.sign(e),nd=e=>{let t=Ba(e.r),o=Ba(e.g),r=Ba(e.b),a={mode:"xyz65",x:.5766690429101305*t+.1855582379065463*o+.1882286462349947*r,y:.297344975250536*t+.6273635662554661*o+.0752914584939979*r,z:.0270313613864123*t+.0706888525358272*o+.9913375368376386*r};return e.alpha!==void 0&&(a.alpha=e.alpha),a},Aa=nd;var Za=e=>Math.pow(Math.abs(e),.4547069271758437)*Math.sign(e),ld=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"a98",r:Za(e*2.0415879038107465-t*.5650069742788597-.3447313507783297*o),g:Za(e*-.9692436362808798+t*1.8759675015077206+.0415550574071756*o),b:Za(e*.0134442806320312-t*.1183623922310184+1.0151749943912058*o)};return r!==void 0&&(a.alpha=r),a},Fa=ld;var $a=(e=0)=>{let t=Math.abs(e);return t<=.04045?e/12.92:(Math.sign(e)||1)*Math.pow((t+.055)/1.055,2.4)},id=({r:e,g:t,b:o,alpha:r})=>{let a={mode:"lrgb",r:$a(e),g:$a(t),b:$a(o)};return r!==void 0&&(a.alpha=r),a},h1=id;var sd=e=>{let{r:t,g:o,b:r,alpha:a}=h1(e),n={mode:"xyz65",x:.4123907992659593*t+.357584339383878*o+.1804807884018343*r,y:.2126390058715102*t+.715168678767756*o+.0721923153607337*r,z:.0193308187155918*t+.119194779794626*o+.9505321522496607*r};return a!==void 0&&(n.alpha=a),n},l1=sd;var Na=(e=0)=>{let t=Math.abs(e);return t>.0031308?(Math.sign(e)||1)*(1.055*Math.pow(t,.4166666666666667)-.055):e*12.92},ud=({r:e,g:t,b:o,alpha:r},a="rgb")=>{let n={mode:a,r:Na(e),g:Na(t),b:Na(o)};return r!==void 0&&(n.alpha=r),n},v1=ud;var dd=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=v1({r:e*3.2409699419045226-t*1.537383177570094-.4986107602930034*o,g:e*-.9692436362808796+t*1.8759675015077204+.0415550574071756*o,b:e*.0556300796969936-t*.2039769588889765+1.0569715142428784*o});return r!==void 0&&(a.alpha=r),a},i1=dd;var cd={...g1,mode:"a98",parse:["a98-rgb"],serialize:"a98-rgb",fromMode:{rgb:e=>Fa(l1(e)),xyz65:Fa},toMode:{rgb:e=>i1(Aa(e)),xyz65:Aa}},w9=cd;var fd=e=>(e=e%360)<0?e+360:e,xe=fd;var pd=(e,t)=>e.map((o,r,a)=>{if(o===void 0)return o;let n=xe(o);return r===0||e[r-1]===void 0?n:t(n-xe(a[r-1]))}).reduce((o,r)=>!o.length||r===void 0||o[o.length-1]===void 0?(o.push(r),o):(o.push(r+o[o.length-1]),o),[]),qe=e=>pd(e,t=>Math.abs(t)<=180?t:t-360*Math.sign(t));var Ee=[-.14861,1.78277,-.29227,-.90649,1.97294,0],I9=Math.PI/180,b9=180/Math.PI;var y9=Ee[3]*Ee[4],M9=Ee[1]*Ee[4],S9=Ee[1]*Ee[2]-Ee[0]*Ee[3],Cd=({r:e,g:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(S9*o+e*y9-t*M9)/(S9+y9-M9),n=o-a,l=(Ee[4]*(t-a)-Ee[2]*n)/Ee[3],i={mode:"cubehelix",l:a,s:a===0||a===1?void 0:Math.sqrt(n*n+l*l)/(Ee[4]*a*(1-a))};return i.s&&(i.h=Math.atan2(l,n)*b9-120),r!==void 0&&(i.alpha=r),i},R9=Cd;var md=({h:e,s:t,l:o,alpha:r})=>{let a={mode:"rgb"};e=(e===void 0?0:e+120)*I9,o===void 0&&(o=0);let n=t===void 0?0:t*o*(1-o),l=Math.cos(e),i=Math.sin(e);return a.r=o+n*(Ee[0]*l+Ee[1]*i),a.g=o+n*(Ee[2]*l+Ee[3]*i),a.b=o+n*(Ee[4]*l+Ee[5]*i),r!==void 0&&(a.alpha=r),a},H9=md;var ft=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.s||!t.s)return 0;let o=xe(e.h),r=xe(t.h),a=Math.sin((r-o+360)/2*Math.PI/180);return 2*Math.sqrt(e.s*t.s)*a},k9=(e,t)=>{if(e.h===void 0||t.h===void 0)return 0;let o=xe(e.h),r=xe(t.h);return Math.abs(r-o)>180?o-(r-360*Math.sign(r-o)):r-o},pt=(e,t)=>{if(e.h===void 0||t.h===void 0||!e.c||!t.c)return 0;let o=xe(e.h),r=xe(t.h),a=Math.sin((r-o+360)/2*Math.PI/180);return 2*Math.sqrt(e.c*t.c)*a};var ze=e=>{let t=e.reduce((r,a)=>{if(a!==void 0){let n=a*Math.PI/180;r.sin+=Math.sin(n),r.cos+=Math.cos(n)}return r},{sin:0,cos:0}),o=Math.atan2(t.sin,t.cos)*180/Math.PI;return o<0?360+o:o};var gd={mode:"cubehelix",channels:["h","s","l","alpha"],parse:["--cubehelix"],serialize:"--cubehelix",ranges:{h:[0,360],s:[0,4.614],l:[0,1]},fromMode:{rgb:R9},toMode:{rgb:H9},interpolate:{h:{use:_,fixup:qe},s:_,l:_,alpha:{use:_,fixup:fe}},difference:{h:ft},average:{h:ze}},P9=gd;var hd=({l:e,a:t,b:o,alpha:r},a="lch")=>{t===void 0&&(t=0),o===void 0&&(o=0);let n=Math.sqrt(t*t+o*o),l={mode:a,l:e,c:n};return n&&(l.h=xe(Math.atan2(o,t)*180/Math.PI)),r!==void 0&&(l.alpha=r),l},f1=hd;var vd=({l:e,c:t,h:o,alpha:r},a="lab")=>{o===void 0&&(o=0);let n={mode:a,l:e,a:t?t*Math.cos(o/180*Math.PI):0,b:t?t*Math.sin(o/180*Math.PI):0};return r!==void 0&&(n.alpha=r),n},p1=vd;var nr=Math.pow(29,3)/Math.pow(3,3),lr=Math.pow(6,3)/Math.pow(29,3);var Me={X:.9642956764295677,Y:1,Z:.8251046025104602},Ct={X:.3127/.329,Y:1,Z:(1-.3127-.329)/.329},np=Math.pow(29,3)/Math.pow(3,3),lp=Math.pow(6,3)/Math.pow(29,3);var Ua=e=>Math.pow(e,3)>lr?Math.pow(e,3):(116*e-16)/nr,xd=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(e+16)/116,n=t/500+a,l=a-o/200,i={mode:"xyz65",x:Ua(n)*Ct.X,y:Ua(a)*Ct.Y,z:Ua(l)*Ct.Z};return r!==void 0&&(i.alpha=r),i},ir=xd;var Ld=e=>i1(ir(e)),mt=Ld;var qa=e=>e>lr?Math.cbrt(e):(nr*e+16)/116,wd=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=qa(e/Ct.X),n=qa(t/Ct.Y),l=qa(o/Ct.Z),i={mode:"lab65",l:116*n-16,a:500*(a-n),b:200*(n-l)};return r!==void 0&&(i.alpha=r),i},sr=wd;var Id=e=>{let t=sr(l1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},gt=Id;var Vt=.14444444444444443*Math.PI,zt=Math.cos(Vt),jt=Math.sin(Vt),ur=100/Math.log(139/100);var bd=({l:e,c:t,h:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"lab65",l:(Math.exp(e*1/ur)-1)/.0039},n=(Math.exp(.0435*t*1*1)-1)/.075,l=n*Math.cos(o/180*Math.PI-Vt),i=n*Math.sin(o/180*Math.PI-Vt);return a.a=l*zt-i/.83*jt,a.b=l*jt+i/.83*zt,r!==void 0&&(a.alpha=r),a},wo=bd;var yd=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=t*zt+o*jt,n=.83*(o*zt-t*jt),l=Math.sqrt(a*a+n*n),i={mode:"dlch",l:ur/1*Math.log(1+.0039*e),c:Math.log(1+.075*l)/(.0435*1*1)};return i.c&&(i.h=xe((Math.atan2(n,a)+Vt)/Math.PI*180)),r!==void 0&&(i.alpha=r),i},Io=yd;var T9=e=>wo(f1(e,"dlch")),V9=e=>p1(Io(e),"dlab"),Md={mode:"dlab",parse:["--din99o-lab"],serialize:"--din99o-lab",toMode:{lab65:T9,rgb:e=>mt(T9(e))},fromMode:{lab65:V9,rgb:e=>V9(gt(e))},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-40.09,45.501],b:[-40.469,44.344]},interpolate:{l:_,a:_,b:_,alpha:{use:_,fixup:fe}}},E9=Md;var Sd={mode:"dlch",parse:["--din99o-lch"],serialize:"--din99o-lch",toMode:{lab65:wo,dlab:e=>p1(e,"dlab"),rgb:e=>mt(wo(e))},fromMode:{lab65:Io,dlab:e=>f1(e,"dlch"),rgb:e=>Io(gt(e))},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,51.484],h:[0,360]},interpolate:{l:_,c:_,h:{use:_,fixup:qe},alpha:{use:_,fixup:fe}},difference:{h:pt},average:{h:ze}},D9=Sd;function ja({h:e,s:t,i:o,alpha:r}){e=xe(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.abs(e/60%2-1),n;switch(Math.floor(e/60)){case 0:n={r:o*(1+t*(3/(2-a)-1)),g:o*(1+t*(3*(1-a)/(2-a)-1)),b:o*(1-t)};break;case 1:n={r:o*(1+t*(3*(1-a)/(2-a)-1)),g:o*(1+t*(3/(2-a)-1)),b:o*(1-t)};break;case 2:n={r:o*(1-t),g:o*(1+t*(3/(2-a)-1)),b:o*(1+t*(3*(1-a)/(2-a)-1))};break;case 3:n={r:o*(1-t),g:o*(1+t*(3*(1-a)/(2-a)-1)),b:o*(1+t*(3/(2-a)-1))};break;case 4:n={r:o*(1+t*(3*(1-a)/(2-a)-1)),g:o*(1-t),b:o*(1+t*(3/(2-a)-1))};break;case 5:n={r:o*(1+t*(3/(2-a)-1)),g:o*(1-t),b:o*(1+t*(3*(1-a)/(2-a)-1))};break;default:n={r:o*(1-t),g:o*(1-t),b:o*(1-t)}}return n.mode="rgb",r!==void 0&&(n.alpha=r),n}function Ka({r:e,g:t,b:o,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.max(e,t,o),n=Math.min(e,t,o),l={mode:"hsi",s:e+t+o===0?0:1-3*n/(e+t+o),i:(e+t+o)/3};return a-n!==0&&(l.h=(a===e?(t-o)/(a-n)+(t<o)*6:a===t?(o-e)/(a-n)+2:(e-t)/(a-n)+4)*60),r!==void 0&&(l.alpha=r),l}var Rd={mode:"hsi",toMode:{rgb:ja},parse:["--hsi"],serialize:"--hsi",fromMode:{rgb:Ka},channels:["h","s","i","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:_,fixup:qe},s:_,i:_,alpha:{use:_,fixup:fe}},difference:{h:ft},average:{h:ze}},O9=Rd;function Ga({h:e,s:t,l:o,alpha:r}){e=xe(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let a=o+t*(o<.5?o:1-o),n=a-(a-o)*2*Math.abs(e/60%2-1),l;switch(Math.floor(e/60)){case 0:l={r:a,g:n,b:2*o-a};break;case 1:l={r:n,g:a,b:2*o-a};break;case 2:l={r:2*o-a,g:a,b:n};break;case 3:l={r:2*o-a,g:n,b:a};break;case 4:l={r:n,g:2*o-a,b:a};break;case 5:l={r:a,g:2*o-a,b:n};break;default:l={r:2*o-a,g:2*o-a,b:2*o-a}}return l.mode="rgb",r!==void 0&&(l.alpha=r),l}function Wa({r:e,g:t,b:o,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.max(e,t,o),n=Math.min(e,t,o),l={mode:"hsl",s:a===n?0:(a-n)/(1-Math.abs(a+n-1)),l:.5*(a+n)};return a-n!==0&&(l.h=(a===e?(t-o)/(a-n)+(t<o)*6:a===t?(o-e)/(a-n)+2:(e-t)/(a-n)+4)*60),r!==void 0&&(l.alpha=r),l}var Hd=(e,t)=>{switch(t){case"deg":return+e;case"rad":return e/Math.PI*180;case"grad":return e/10*9;case"turn":return e*360}},_9=Hd;var kd=new RegExp(`^hsla?\\(\\s*${p9}${ct}${Tt}${ct}${Tt}\\s*(?:,\\s*${ho}\\s*)?\\)$`),Pd=e=>{let t=e.match(kd);if(!t)return;let o={mode:"hsl"};return t[3]!==void 0?o.h=+t[3]:t[1]!==void 0&&t[2]!==void 0&&(o.h=_9(t[1],t[2])),t[4]!==void 0&&(o.s=Math.min(Math.max(0,t[4]/100),1)),t[5]!==void 0&&(o.l=Math.min(Math.max(0,t[5]/100),1)),t[6]!==void 0?o.alpha=Math.max(0,Math.min(1,t[6]/100)):t[7]!==void 0&&(o.alpha=Math.max(0,Math.min(1,+t[7]))),o},B9=Pd;function Td(e,t){if(!t||t[0]!=="hsl"&&t[0]!=="hsla")return;let o={mode:"hsl"},[,r,a,n,l]=t;if(r.type!==D.None){if(r.type===D.Percentage)return;o.h=r.value}if(a.type!==D.None){if(a.type===D.Hue)return;o.s=a.value/100}if(n.type!==D.None){if(n.type===D.Hue)return;o.l=n.value/100}return l.type!==D.None&&(o.alpha=Math.min(1,Math.max(0,l.type===D.Number?l.value:l.value/100))),o}var A9=Td;var Vd={mode:"hsl",toMode:{rgb:Ga},fromMode:{rgb:Wa},channels:["h","s","l","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[A9,B9],serialize:e=>`hsl(${e.h!==void 0?e.h:"none"} ${e.s!==void 0?e.s*100+"%":"none"} ${e.l!==void 0?e.l*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:_,fixup:qe},s:_,l:_,alpha:{use:_,fixup:fe}},difference:{h:ft},average:{h:ze}},dr=Vd;function bo({h:e,s:t,v:o,alpha:r}){e=xe(e!==void 0?e:0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.abs(e/60%2-1),n;switch(Math.floor(e/60)){case 0:n={r:o,g:o*(1-t*a),b:o*(1-t)};break;case 1:n={r:o*(1-t*a),g:o,b:o*(1-t)};break;case 2:n={r:o*(1-t),g:o,b:o*(1-t*a)};break;case 3:n={r:o*(1-t),g:o*(1-t*a),b:o};break;case 4:n={r:o*(1-t*a),g:o*(1-t),b:o};break;case 5:n={r:o,g:o*(1-t),b:o*(1-t*a)};break;default:n={r:o*(1-t),g:o*(1-t),b:o*(1-t)}}return n.mode="rgb",r!==void 0&&(n.alpha=r),n}function yo({r:e,g:t,b:o,alpha:r}){e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.max(e,t,o),n=Math.min(e,t,o),l={mode:"hsv",s:a===0?0:1-n/a,v:a};return a-n!==0&&(l.h=(a===e?(t-o)/(a-n)+(t<o)*6:a===t?(o-e)/(a-n)+2:(e-t)/(a-n)+4)*60),r!==void 0&&(l.alpha=r),l}var Ed={mode:"hsv",toMode:{rgb:bo},parse:["--hsv"],serialize:"--hsv",fromMode:{rgb:yo},channels:["h","s","v","alpha"],ranges:{h:[0,360]},gamut:"rgb",interpolate:{h:{use:_,fixup:qe},s:_,v:_,alpha:{use:_,fixup:fe}},difference:{h:ft},average:{h:ze}},cr=Ed;function Xa({h:e,w:t,b:o,alpha:r}){if(t===void 0&&(t=0),o===void 0&&(o=0),t+o>1){let a=t+o;t/=a,o/=a}return bo({h:e,s:o===1?1:1-t/(1-o),v:1-o,alpha:r})}function Qa(e){let t=yo(e);if(t===void 0)return;let o=t.s!==void 0?t.s:0,r=t.v!==void 0?t.v:0,a={mode:"hwb",w:(1-o)*r,b:1-r};return t.h!==void 0&&(a.h=t.h),t.alpha!==void 0&&(a.alpha=t.alpha),a}function Dd(e,t){if(!t||t[0]!=="hwb")return;let o={mode:"hwb"},[,r,a,n,l]=t;if(r.type!==D.None){if(r.type===D.Percentage)return;o.h=r.value}if(a.type!==D.None){if(a.type===D.Hue)return;o.w=a.value/100}if(n.type!==D.None){if(n.type===D.Hue)return;o.b=n.value/100}return l.type!==D.None&&(o.alpha=Math.min(1,Math.max(0,l.type===D.Number?l.value:l.value/100))),o}var Z9=Dd;var Od={mode:"hwb",toMode:{rgb:Xa},fromMode:{rgb:Qa},channels:["h","w","b","alpha"],ranges:{h:[0,360]},gamut:"rgb",parse:[Z9],serialize:e=>`hwb(${e.h!==void 0?e.h:"none"} ${e.w!==void 0?e.w*100+"%":"none"} ${e.b!==void 0?e.b*100+"%":"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:_,fixup:qe},w:_,b:_,alpha:{use:_,fixup:fe}},difference:{h:k9},average:{h:ze}},F9=Od;var Kt=.1593017578125,$9=78.84375,Gt=.8359375,Wt=18.8515625,Xt=18.6875;function fr(e){if(e<0)return 0;let t=Math.pow(e,1/$9);return 1e4*Math.pow(Math.max(0,t-Gt)/(Wt-Xt*t),1/Kt)}function pr(e){if(e<0)return 0;let t=Math.pow(e/1e4,Kt);return Math.pow((Gt+Wt*t)/(1+Xt*t),$9)}var Ya=e=>Math.max(e/203,0),Bd=({i:e,t,p:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=fr(e+.008609037037932761*t+.11102962500302593*o),n=fr(e-.00860903703793275*t-.11102962500302599*o),l=fr(e+.5600313357106791*t-.32062717498731885*o),i={mode:"xyz65",x:Ya(2.070152218389422*a-1.3263473389671556*n+.2066510476294051*l),y:Ya(.3647385209748074*a+.680566024947227*n-.0453045459220346*l),z:Ya(-.049747207535812*a-.0492609666966138*n+1.1880659249923042*l)};return r!==void 0&&(i.alpha=r),i},Ja=Bd;var en=(e=0)=>Math.max(e*203,0),Ad=({x:e,y:t,z:o,alpha:r})=>{let a=en(e),n=en(t),l=en(o),i=pr(.3592832590121217*a+.6976051147779502*n-.0358915932320289*l),s=pr(-.1920808463704995*a+1.1004767970374323*n+.0753748658519118*l),u=pr(.0070797844607477*a+.0748396662186366*n+.8433265453898765*l),d=.5*i+.5*s,c=1.61376953125*i-3.323486328125*s+1.709716796875*u,f=4.378173828125*i-4.24560546875*s-.132568359375*u,g={mode:"itp",i:d,t:c,p:f};return r!==void 0&&(g.alpha=r),g},tn=Ad;var Zd={mode:"itp",channels:["i","t","p","alpha"],parse:["--ictcp"],serialize:"--ictcp",toMode:{xyz65:Ja,rgb:e=>i1(Ja(e))},fromMode:{xyz65:tn,rgb:e=>tn(l1(e))},ranges:{i:[0,.581],t:[-.369,.272],p:[-.164,.331]},interpolate:{i:_,t:_,p:_,alpha:{use:_,fixup:fe}}},N9=Zd;var Fd=134.03437499999998,$d=16295499532821565e-27,on=e=>{if(e<0)return 0;let t=Math.pow(e/1e4,Kt);return Math.pow((Gt+Wt*t)/(1+Xt*t),Fd)},rn=(e=0)=>Math.max(e*203,0),Nd=({x:e,y:t,z:o,alpha:r})=>{e=rn(e),t=rn(t),o=rn(o);let a=1.15*e-.15*o,n=.66*t+.34*e,l=on(.41478972*a+.579999*n+.014648*o),i=on(-.20151*a+1.120649*n+.0531008*o),s=on(-.0166008*a+.2648*n+.6684799*o),u=(l+i)/2,d={mode:"jab",j:.44*u/(1-.56*u)-$d,a:3.524*l-4.066708*i+.542708*s,b:.199076*l+1.096799*i-1.295875*s};return r!==void 0&&(d.alpha=r),d},Cr=Nd;var Ud=134.03437499999998,U9=16295499532821565e-27,an=e=>{if(e<0)return 0;let t=Math.pow(e,1/Ud);return 1e4*Math.pow((Gt-t)/(Xt*t-Wt),1/Kt)},nn=e=>e/203,qd=({j:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(e+U9)/(.44+.56*(e+U9)),n=an(a+.13860504*t+.058047316*o),l=an(a-.13860504*t-.058047316*o),i=an(a-.096019242*t-.8118919*o),s={mode:"xyz65",x:nn(1.661373024652174*n-.914523081304348*l+.23136208173913045*i),y:nn(-.3250758611844533*n+1.571847026732543*l-.21825383453227928*i),z:nn(-.090982811*n-.31272829*l+1.5227666*i)};return r!==void 0&&(s.alpha=r),s},mr=qd;var zd=e=>{let t=Cr(l1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},gr=zd;var jd=e=>i1(mr(e)),hr=jd;var Kd={mode:"jab",channels:["j","a","b","alpha"],parse:["--jzazbz"],serialize:"--jzazbz",fromMode:{rgb:gr,xyz65:Cr},toMode:{rgb:hr,xyz65:mr},ranges:{j:[0,.222],a:[-.109,.129],b:[-.185,.134]},interpolate:{j:_,a:_,b:_,alpha:{use:_,fixup:fe}}},q9=Kd;var Gd=({j:e,a:t,b:o,alpha:r})=>{t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.sqrt(t*t+o*o),n={mode:"jch",j:e,c:a};return a&&(n.h=xe(Math.atan2(o,t)*180/Math.PI)),r!==void 0&&(n.alpha=r),n},ln=Gd;var Wd=({j:e,c:t,h:o,alpha:r})=>{o===void 0&&(o=0);let a={mode:"jab",j:e,a:t?t*Math.cos(o/180*Math.PI):0,b:t?t*Math.sin(o/180*Math.PI):0};return r!==void 0&&(a.alpha=r),a},sn=Wd;var Xd={mode:"jch",parse:["--jzczhz"],serialize:"--jzczhz",toMode:{jab:sn,rgb:e=>hr(sn(e))},fromMode:{rgb:e=>ln(gr(e)),jab:ln},channels:["j","c","h","alpha"],ranges:{j:[0,.221],c:[0,.19],h:[0,360]},interpolate:{h:{use:_,fixup:qe},c:_,j:_,alpha:{use:_,fixup:fe}},difference:{h:pt},average:{h:ze}},z9=Xd;var ht=Math.pow(29,3)/Math.pow(3,3),Qt=Math.pow(6,3)/Math.pow(29,3);var un=e=>Math.pow(e,3)>Qt?Math.pow(e,3):(116*e-16)/ht,Qd=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=(e+16)/116,n=t/500+a,l=a-o/200,i={mode:"xyz50",x:un(n)*Me.X,y:un(a)*Me.Y,z:un(l)*Me.Z};return r!==void 0&&(i.alpha=r),i},Yt=Qd;var Yd=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=v1({r:e*3.1341359569958707-t*1.6173863321612538-.4906619460083532*o,g:e*-.978795502912089+t*1.916254567259524+.03344273116131949*o,b:e*.07195537988411677-t*.2289768264158322+1.405386058324125*o});return r!==void 0&&(a.alpha=r),a},V1=Yd;var Jd=e=>V1(Yt(e)),vr=Jd;var e3=e=>{let{r:t,g:o,b:r,alpha:a}=h1(e),n={mode:"xyz50",x:.436065742824811*t+.3851514688337912*o+.14307845442264197*r,y:.22249319175623702*t+.7168870538238823*o+.06061979053616537*r,z:.013923904500943465*t+.09708128566574634*o+.7140993584005155*r};return a!==void 0&&(n.alpha=a),n},E1=e3;var dn=e=>e>Qt?Math.cbrt(e):(ht*e+16)/116,t3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=dn(e/Me.X),n=dn(t/Me.Y),l=dn(o/Me.Z),i={mode:"lab",l:116*n-16,a:500*(a-n),b:200*(n-l)};return r!==void 0&&(i.alpha=r),i},Jt=t3;var o3=e=>{let t=Jt(E1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},xr=o3;function r3(e,t){if(!t||t[0]!=="lab")return;let o={mode:"lab"},[,r,a,n,l]=t;if(!(r.type===D.Hue||a.type===D.Hue||n.type===D.Hue))return r.type!==D.None&&(o.l=Math.min(Math.max(0,r.value),100)),a.type!==D.None&&(o.a=a.type===D.Number?a.value:a.value*125/100),n.type!==D.None&&(o.b=n.type===D.Number?n.value:n.value*125/100),l.type!==D.None&&(o.alpha=Math.min(1,Math.max(0,l.type===D.Number?l.value:l.value/100))),o}var j9=r3;var a3={mode:"lab",toMode:{xyz50:Yt,rgb:vr},fromMode:{xyz50:Jt,rgb:xr},channels:["l","a","b","alpha"],ranges:{l:[0,100],a:[-125,125],b:[-125,125]},parse:[j9],serialize:e=>`lab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{l:_,a:_,b:_,alpha:{use:_,fixup:fe}}},eo=a3;var n3={...eo,mode:"lab65",parse:["--lab-d65"],serialize:"--lab-d65",toMode:{xyz65:ir,rgb:mt},fromMode:{xyz65:sr,rgb:gt},ranges:{l:[0,100],a:[-125,125],b:[-125,125]}},K9=n3;function l3(e,t){if(!t||t[0]!=="lch")return;let o={mode:"lch"},[,r,a,n,l]=t;if(r.type!==D.None){if(r.type===D.Hue)return;o.l=Math.min(Math.max(0,r.value),100)}if(a.type!==D.None&&(o.c=Math.max(0,a.type===D.Number?a.value:a.value*150/100)),n.type!==D.None){if(n.type===D.Percentage)return;o.h=n.value}return l.type!==D.None&&(o.alpha=Math.min(1,Math.max(0,l.type===D.Number?l.value:l.value/100))),o}var G9=l3;var i3={mode:"lch",toMode:{lab:p1,rgb:e=>vr(p1(e))},fromMode:{rgb:e=>f1(xr(e)),lab:f1},channels:["l","c","h","alpha"],ranges:{l:[0,100],c:[0,150],h:[0,360]},parse:[G9],serialize:e=>`lch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,interpolate:{h:{use:_,fixup:qe},c:_,l:_,alpha:{use:_,fixup:fe}},difference:{h:pt},average:{h:ze}},to=i3;var s3={...to,mode:"lch65",parse:["--lch-d65"],serialize:"--lch-d65",toMode:{lab65:e=>p1(e,"lab65"),rgb:e=>mt(p1(e,"lab65"))},fromMode:{rgb:e=>f1(gt(e),"lch65"),lab65:e=>f1(e,"lch65")},ranges:{l:[0,100],c:[0,150],h:[0,360]}},W9=s3;var u3=({l:e,u:t,v:o,alpha:r})=>{t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.sqrt(t*t+o*o),n={mode:"lchuv",l:e,c:a};return a&&(n.h=xe(Math.atan2(o,t)*180/Math.PI)),r!==void 0&&(n.alpha=r),n},cn=u3;var d3=({l:e,c:t,h:o,alpha:r})=>{o===void 0&&(o=0);let a={mode:"luv",l:e,u:t?t*Math.cos(o/180*Math.PI):0,v:t?t*Math.sin(o/180*Math.PI):0};return r!==void 0&&(a.alpha=r),a},fn=d3;var X9=(e,t,o)=>4*e/(e+15*t+3*o),Q9=(e,t,o)=>9*t/(e+15*t+3*o),c3=X9(Me.X,Me.Y,Me.Z),f3=Q9(Me.X,Me.Y,Me.Z),p3=e=>e<=Qt?ht*e:116*Math.cbrt(e)-16,C3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=p3(t/Me.Y),n=X9(e,t,o),l=Q9(e,t,o);!isFinite(n)||!isFinite(l)?a=n=l=0:(n=13*a*(n-c3),l=13*a*(l-f3));let i={mode:"luv",l:a,u:n,v:l};return r!==void 0&&(i.alpha=r),i},Mo=C3;var m3=(e,t,o)=>4*e/(e+15*t+3*o),g3=(e,t,o)=>9*t/(e+15*t+3*o),h3=m3(Me.X,Me.Y,Me.Z),v3=g3(Me.X,Me.Y,Me.Z),x3=({l:e,u:t,v:o,alpha:r})=>{if(e===void 0&&(e=0),e===0)return{mode:"xyz50",x:0,y:0,z:0};t===void 0&&(t=0),o===void 0&&(o=0);let a=t/(13*e)+h3,n=o/(13*e)+v3,l=Me.Y*(e<=8?e/ht:Math.pow((e+16)/116,3)),i=l*(9*a)/(4*n),s=l*(12-3*a-20*n)/(4*n),u={mode:"xyz50",x:i,y:l,z:s};return r!==void 0&&(u.alpha=r),u},So=x3;var L3=e=>cn(Mo(E1(e))),w3=e=>V1(So(fn(e))),I3={mode:"lchuv",toMode:{luv:fn,rgb:w3},fromMode:{rgb:L3,luv:cn},channels:["l","c","h","alpha"],parse:["--lchuv"],serialize:"--lchuv",ranges:{l:[0,100],c:[0,176.956],h:[0,360]},interpolate:{h:{use:_,fixup:qe},c:_,l:_,alpha:{use:_,fixup:fe}},difference:{h:pt},average:{h:ze}},Y9=I3;var b3={...g1,mode:"lrgb",toMode:{rgb:v1},fromMode:{rgb:h1},parse:["srgb-linear"],serialize:"srgb-linear"},J9=b3;var y3={mode:"luv",toMode:{xyz50:So,rgb:e=>V1(So(e))},fromMode:{xyz50:Mo,rgb:e=>Mo(E1(e))},channels:["l","u","v","alpha"],parse:["--luv"],serialize:"--luv",ranges:{l:[0,100],u:[-84.936,175.042],v:[-125.882,87.243]},interpolate:{l:_,u:_,v:_,alpha:{use:_,fixup:fe}}},e0=y3;var M3=({r:e,g:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.cbrt(.412221469470763*e+.5363325372617348*t+.0514459932675022*o),n=Math.cbrt(.2119034958178252*e+.6806995506452344*t+.1073969535369406*o),l=Math.cbrt(.0883024591900564*e+.2817188391361215*t+.6299787016738222*o),i={mode:"oklab",l:.210454268309314*a+.7936177747023054*n-.0040720430116193*l,a:1.9779985324311684*a-2.42859224204858*n+.450593709617411*l,b:.0259040424655478*a+.7827717124575296*n-.8086757549230774*l};return r!==void 0&&(i.alpha=r),i},Lr=M3;var S3=e=>{let t=Lr(h1(e));return e.r===e.b&&e.b===e.g&&(t.a=t.b=0),t},vt=S3;var R3=({l:e,a:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Math.pow(e+.3963377773761749*t+.2158037573099136*o,3),n=Math.pow(e-.1055613458156586*t-.0638541728258133*o,3),l=Math.pow(e-.0894841775298119*t-1.2914855480194092*o,3),i={mode:"lrgb",r:4.076741636075957*a-3.3077115392580616*n+.2309699031821044*l,g:-1.2684379732850317*a+2.6097573492876887*n-.3413193760026573*l,b:-.0041960761386756*a-.7034186179359362*n+1.7076146940746117*l};return r!==void 0&&(i.alpha=r),i},D1=R3;var H3=e=>v1(D1(e)),xt=H3;function Ro(e){let r=1.170873786407767;return .5*(r*e-.206+Math.sqrt((r*e-.206)*(r*e-.206)+4*.03*r*e))}function Et(e){return(e*e+.206*e)/(1.170873786407767*(e+.03))}function k3(e,t){let o,r,a,n,l,i,s,u;-1.88170328*e-.80936493*t>1?(o=1.19086277,r=1.76576728,a=.59662641,n=.75515197,l=.56771245,i=4.0767416621,s=-3.3077115913,u=.2309699292):1.81444104*e-1.19445276*t>1?(o=.73956515,r=-.45954404,a=.08285427,n=.1254107,l=.14503204,i=-1.2684380046,s=2.6097574011,u=-.3413193965):(o=1.35733652,r=-.00915799,a=-1.1513021,n=-.50559606,l=.00692167,i=-.0041960863,s=-.7034186147,u=1.707614701);let d=o+r*e+a*t+n*e*e+l*e*t,c=.3963377774*e+.2158037573*t,f=-.1055613458*e-.0638541728*t,g=-.0894841775*e-1.291485548*t;{let p=1+d*c,M=1+d*f,h=1+d*g,w=p*p*p,v=M*M*M,R=h*h*h,b=3*c*p*p,S=3*f*M*M,Z=3*g*h*h,T=6*c*c*p,L=6*f*f*M,V=6*g*g*h,y=i*w+s*v+u*R,H=i*b+s*S+u*Z,q=i*T+s*L+u*V;d=d-y*H/(H*H-.5*y*q)}return d}function pn(e,t){let o=k3(e,t),r=D1({l:1,a:o*e,b:o*t}),a=Math.cbrt(1/Math.max(r.r,r.g,r.b)),n=a*o;return[a,n]}function P3(e,t,o,r,a,n=null){n||(n=pn(e,t));let l;if((o-a)*n[1]-(n[0]-a)*r<=0)l=n[1]*a/(r*n[0]+n[1]*(a-o));else{l=n[1]*(a-1)/(r*(n[0]-1)+n[1]*(a-o));{let i=o-a,s=r,u=.3963377774*e+.2158037573*t,d=-.1055613458*e-.0638541728*t,c=-.0894841775*e-1.291485548*t,f=i+s*u,g=i+s*d,p=i+s*c;{let M=a*(1-l)+l*o,h=l*r,w=M+h*u,v=M+h*d,R=M+h*c,b=w*w*w,S=v*v*v,Z=R*R*R,T=3*f*w*w,L=3*g*v*v,V=3*p*R*R,y=6*f*f*w,H=6*g*g*v,q=6*p*p*R,K=4.0767416621*b-3.3077115913*S+.2309699292*Z-1,G=4.0767416621*T-3.3077115913*L+.2309699292*V,J=4.0767416621*y-3.3077115913*H+.2309699292*q,F=G/(G*G-.5*K*J),O=-K*F,A=-1.2684380046*b+2.6097574011*S-.3413193965*Z-1,z=-1.2684380046*T+2.6097574011*L-.3413193965*V,B=-1.2684380046*y+2.6097574011*H-.3413193965*q,j=z/(z*z-.5*A*B),P=-A*j,W=-.0041960863*b-.7034186147*S+1.707614701*Z-1,m=-.0041960863*T-.7034186147*L+1.707614701*V,x=-.0041960863*y-.7034186147*H+1.707614701*q,k=m/(m*m-.5*W*x),C=-W*k;O=F>=0?O:1e6,P=j>=0?P:1e6,C=k>=0?C:1e6,l+=Math.min(O,Math.min(P,C))}}}return l}function Ho(e,t,o=null){o||(o=pn(e,t));let r=o[0],a=o[1];return[a/r,a/(1-r)]}function wr(e,t,o){let r=pn(t,o),a=P3(t,o,e,1,e,r),n=Ho(t,o,r),l=.11516993+1/(7.4477897+4.1590124*o+t*(-2.19557347+1.75198401*o+t*(-2.13704948-10.02301043*o+t*(-4.24894561+5.38770819*o+4.69891013*t)))),i=.11239642+1/(1.6132032-.68124379*o+t*(.40370612+.90148123*o+t*(-.27087943+.6122399*o+t*(.00299215-.45399568*o-.14661872*t)))),s=a/Math.min(e*n[0],(1-e)*n[1]),u=e*l,d=(1-e)*i,c=.9*s*Math.sqrt(Math.sqrt(1/(1/(u*u*u*u)+1/(d*d*d*d))));return u=e*.4,d=(1-e)*.8,[Math.sqrt(1/(1/(u*u)+1/(d*d))),c,a]}function Ir(e){let t=e.l!==void 0?e.l:0,o=e.a!==void 0?e.a:0,r=e.b!==void 0?e.b:0,a={mode:"okhsl",l:Ro(t)};e.alpha!==void 0&&(a.alpha=e.alpha);let n=Math.sqrt(o*o+r*r);if(!n)return a.s=0,a;let[l,i,s]=wr(t,o/n,r/n),u;if(n<i){let d=0,c=.8*l,f=1-c/i;u=(n-d)/(c+f*(n-d))*.8}else{let d=i,c=.2*i*i*1.25*1.25/l,f=1-c/(s-i);u=.8+.2*((n-d)/(c+f*(n-d)))}return u&&(a.s=u,a.h=xe(Math.atan2(r,o)*180/Math.PI)),a}function br(e){let t=e.h!==void 0?e.h:0,o=e.s!==void 0?e.s:0,r=e.l!==void 0?e.l:0,a={mode:"oklab",l:Et(r)};if(e.alpha!==void 0&&(a.alpha=e.alpha),!o||r===1)return a.a=a.b=0,a;let n=Math.cos(t/180*Math.PI),l=Math.sin(t/180*Math.PI),[i,s,u]=wr(a.l,n,l),d,c,f,g;o<.8?(d=1.25*o,c=0,f=.8*i,g=1-f/s):(d=5*(o-.8),c=s,f=.2*s*s*1.25*1.25/i,g=1-f/(u-s));let p=c+d*f/(1-g*d);return a.a=p*n,a.b=p*l,a}var T3={...dr,mode:"okhsl",channels:["h","s","l","alpha"],parse:["--okhsl"],serialize:"--okhsl",fromMode:{oklab:Ir,rgb:e=>Ir(vt(e))},toMode:{oklab:br,rgb:e=>xt(br(e))}},t0=T3;function yr(e){let t=e.l!==void 0?e.l:0,o=e.a!==void 0?e.a:0,r=e.b!==void 0?e.b:0,a=Math.sqrt(o*o+r*r),n=a?o/a:1,l=a?r/a:1,[i,s]=Ho(n,l),u=.5,d=1-u/i,c=s/(a+t*s),f=c*t,g=c*a,p=Et(f),M=g*p/f,h=D1({l:p,a:n*M,b:l*M}),w=Math.cbrt(1/Math.max(h.r,h.g,h.b,0));t=t/w,a=a/w*Ro(t)/t,t=Ro(t);let v={mode:"okhsv",s:a?(u+s)*g/(s*u+s*d*g):0,v:t?t/f:0};return v.s&&(v.h=xe(Math.atan2(r,o)*180/Math.PI)),e.alpha!==void 0&&(v.alpha=e.alpha),v}function Mr(e){let t={mode:"oklab"};e.alpha!==void 0&&(t.alpha=e.alpha);let o=e.h!==void 0?e.h:0,r=e.s!==void 0?e.s:0,a=e.v!==void 0?e.v:0,n=Math.cos(o/180*Math.PI),l=Math.sin(o/180*Math.PI),[i,s]=Ho(n,l),u=.5,d=1-u/i,c=1-r*u/(u+s-s*d*r),f=r*s*u/(u+s-s*d*r),g=Et(c),p=f*g/c,M=D1({l:g,a:n*p,b:l*p}),h=Math.cbrt(1/Math.max(M.r,M.g,M.b,0)),w=Et(a*c),v=f*w/c;return t.l=w*h,t.a=v*n*h,t.b=v*l*h,t}var V3={...cr,mode:"okhsv",channels:["h","s","v","alpha"],parse:["--okhsv"],serialize:"--okhsv",fromMode:{oklab:yr,rgb:e=>yr(vt(e))},toMode:{oklab:Mr,rgb:e=>xt(Mr(e))}},o0=V3;function E3(e,t){if(!t||t[0]!=="oklab")return;let o={mode:"oklab"},[,r,a,n,l]=t;if(!(r.type===D.Hue||a.type===D.Hue||n.type===D.Hue))return r.type!==D.None&&(o.l=Math.min(Math.max(0,r.type===D.Number?r.value:r.value/100),1)),a.type!==D.None&&(o.a=a.type===D.Number?a.value:a.value*.4/100),n.type!==D.None&&(o.b=n.type===D.Number?n.value:n.value*.4/100),l.type!==D.None&&(o.alpha=Math.min(1,Math.max(0,l.type===D.Number?l.value:l.value/100))),o}var r0=E3;var D3={...eo,mode:"oklab",toMode:{lrgb:D1,rgb:xt},fromMode:{lrgb:Lr,rgb:vt},ranges:{l:[0,1],a:[-.4,.4],b:[-.4,.4]},parse:[r0],serialize:e=>`oklab(${e.l!==void 0?e.l:"none"} ${e.a!==void 0?e.a:"none"} ${e.b!==void 0?e.b:"none"}${e.alpha<1?` / ${e.alpha}`:""})`},a0=D3;function O3(e,t){if(!t||t[0]!=="oklch")return;let o={mode:"oklch"},[,r,a,n,l]=t;if(r.type!==D.None){if(r.type===D.Hue)return;o.l=Math.min(Math.max(0,r.type===D.Number?r.value:r.value/100),1)}if(a.type!==D.None&&(o.c=Math.max(0,a.type===D.Number?a.value:a.value*.4/100)),n.type!==D.None){if(n.type===D.Percentage)return;o.h=n.value}return l.type!==D.None&&(o.alpha=Math.min(1,Math.max(0,l.type===D.Number?l.value:l.value/100))),o}var n0=O3;var _3={...to,mode:"oklch",toMode:{oklab:e=>p1(e,"oklab"),rgb:e=>xt(p1(e,"oklab"))},fromMode:{rgb:e=>f1(vt(e),"oklch"),oklab:e=>f1(e,"oklch")},parse:[n0],serialize:e=>`oklch(${e.l!==void 0?e.l:"none"} ${e.c!==void 0?e.c:"none"} ${e.h!==void 0?e.h:"none"}${e.alpha<1?` / ${e.alpha}`:""})`,ranges:{l:[0,1],c:[0,.4],h:[0,360]}},l0=_3;var B3=e=>{let{r:t,g:o,b:r,alpha:a}=h1(e),n={mode:"xyz65",x:.486570948648216*t+.265667693169093*o+.1982172852343625*r,y:.2289745640697487*t+.6917385218365062*o+.079286914093745*r,z:0*t+.0451133818589026*o+1.043944368900976*r};return a!==void 0&&(n.alpha=a),n},Cn=B3;var A3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=v1({r:e*2.4934969119414263-t*.9313836179191242-.402710784450717*o,g:e*-.8294889695615749+t*1.7626640603183465+.0236246858419436*o,b:e*.0358458302437845-t*.0761723892680418+.9568845240076871*o},"p3");return r!==void 0&&(a.alpha=r),a},mn=A3;var Z3={...g1,mode:"p3",parse:["display-p3"],serialize:"display-p3",fromMode:{rgb:e=>mn(l1(e)),xyz65:mn},toMode:{rgb:e=>i1(Cn(e)),xyz65:Cn}},i0=Z3;var gn=e=>{let t=Math.abs(e);return t>=.001953125?Math.sign(e)*Math.pow(t,.5555555555555556):16*e},F3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"prophoto",r:gn(e*1.3457868816471585-t*.2555720873797946-.0511018649755453*o),g:gn(e*-.5446307051249019+t*1.5082477428451466+.0205274474364214*o),b:gn(e*0+t*0+1.2119675456389452*o)};return r!==void 0&&(a.alpha=r),a},hn=F3;var vn=(e=0)=>{let t=Math.abs(e);return t>=.03125?Math.sign(e)*Math.pow(t,1.8):e/16},$3=e=>{let t=vn(e.r),o=vn(e.g),r=vn(e.b),a={mode:"xyz50",x:.7977666449006423*t+.1351812974005331*o+.0313477341283922*r,y:.2880748288194013*t+.7118352342418731*o+899369387256e-16*r,z:0*t+0*o+.8251046025104602*r};return e.alpha!==void 0&&(a.alpha=e.alpha),a},xn=$3;var N3={...g1,mode:"prophoto",parse:["prophoto-rgb"],serialize:"prophoto-rgb",fromMode:{xyz50:hn,rgb:e=>hn(E1(e))},toMode:{xyz50:xn,rgb:e=>V1(xn(e))}},s0=N3;var u0=1.09929682680944,U3=.018053968510807,Ln=e=>{let t=Math.abs(e);return t>U3?(Math.sign(e)||1)*(u0*Math.pow(t,.45)-(u0-1)):4.5*e},q3=({x:e,y:t,z:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"rec2020",r:Ln(e*1.7166511879712683-t*.3556707837763925-.2533662813736599*o),g:Ln(e*-.6666843518324893+t*1.6164812366349395+.0157685458139111*o),b:Ln(e*.0176398574453108-t*.0427706132578085+.9421031212354739*o)};return r!==void 0&&(a.alpha=r),a},wn=q3;var d0=1.09929682680944,z3=.018053968510807,In=(e=0)=>{let t=Math.abs(e);return t<z3*4.5?e/4.5:(Math.sign(e)||1)*Math.pow((t+d0-1)/d0,1/.45)},j3=e=>{let t=In(e.r),o=In(e.g),r=In(e.b),a={mode:"xyz65",x:.6369580483012911*t+.1446169035862083*o+.1688809751641721*r,y:.262700212011267*t+.6779980715188708*o+.059301716469862*r,z:0*t+.0280726930490874*o+1.0609850577107909*r};return e.alpha!==void 0&&(a.alpha=e.alpha),a},bn=j3;var K3={...g1,mode:"rec2020",fromMode:{xyz65:wn,rgb:e=>wn(l1(e))},toMode:{xyz65:bn,rgb:e=>i1(bn(e))},parse:["rec2020"],serialize:"rec2020"},c0=K3;var j1=.0037930732552754493,Sr=Math.cbrt(j1);var yn=e=>Math.cbrt(e)-Sr,G3=e=>{let{r:t,g:o,b:r,alpha:a}=h1(e),n=yn(.3*t+.622*o+.078*r+j1),l=yn(.23*t+.692*o+.078*r+j1),i=yn(.2434226892454782*t+.2047674442449682*o+.5518098665095535*r+j1),s={mode:"xyb",x:(n-l)/2,y:(n+l)/2,b:i-(n+l)/2};return a!==void 0&&(s.alpha=a),s},f0=G3;var Mn=e=>Math.pow(e+Sr,3),W3=({x:e,y:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a=Mn(e+t)-j1,n=Mn(t-e)-j1,l=Mn(o+t)-j1,i=v1({r:11.031566904639861*a-9.866943908131562*n-.16462299650829934*l,g:-3.2541473810744237*a+4.418770377582723*n-.16462299650829934*l,b:-3.6588512867136815*a+2.7129230459360922*n+1.9459282407775895*l});return r!==void 0&&(i.alpha=r),i},p0=W3;var X3={mode:"xyb",channels:["x","y","b","alpha"],parse:["--xyb"],serialize:"--xyb",toMode:{rgb:p0},fromMode:{rgb:f0},ranges:{x:[-.0154,.0281],y:[0,.8453],b:[-.2778,.388]},interpolate:{x:_,y:_,b:_,alpha:{use:_,fixup:fe}}},C0=X3;var Q3={mode:"xyz50",parse:["xyz-d50"],serialize:"xyz-d50",toMode:{rgb:V1,lab:Jt},fromMode:{rgb:E1,lab:Yt},channels:["x","y","z","alpha"],ranges:{x:[0,.964],y:[0,.999],z:[0,.825]},interpolate:{x:_,y:_,z:_,alpha:{use:_,fixup:fe}}},m0=Q3;var Y3=e=>{let{x:t,y:o,z:r,alpha:a}=e;t===void 0&&(t=0),o===void 0&&(o=0),r===void 0&&(r=0);let n={mode:"xyz50",x:1.0479298208405488*t+.0229467933410191*o-.0501922295431356*r,y:.0296278156881593*t+.990434484573249*o-.0170738250293851*r,z:-.0092430581525912*t+.0150551448965779*o+.7518742899580008*r};return a!==void 0&&(n.alpha=a),n},g0=Y3;var J3=e=>{let{x:t,y:o,z:r,alpha:a}=e;t===void 0&&(t=0),o===void 0&&(o=0),r===void 0&&(r=0);let n={mode:"xyz65",x:.9554734527042182*t-.0230985368742614*o+.0632593086610217*r,y:-.0283697069632081*t+1.0099954580058226*o+.021041398966943*r,z:.0123140016883199*t-.0205076964334779*o+1.3303659366080753*r};return a!==void 0&&(n.alpha=a),n},h0=J3;var e7={mode:"xyz65",toMode:{rgb:i1,xyz50:g0},fromMode:{rgb:l1,xyz50:h0},ranges:{x:[0,.95],y:[0,1],z:[0,1.088]},channels:["x","y","z","alpha"],parse:["xyz","xyz-d65"],serialize:"xyz-d65",interpolate:{x:_,y:_,z:_,alpha:{use:_,fixup:fe}}},v0=e7;var t7=({r:e,g:t,b:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"yiq",y:.29889531*e+.58662247*t+.11448223*o,i:.59597799*e-.2741761*t-.32180189*o,q:.21147017*e-.52261711*t+.31114694*o};return r!==void 0&&(a.alpha=r),a},x0=t7;var o7=({y:e,i:t,q:o,alpha:r})=>{e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=0);let a={mode:"rgb",r:e+.95608445*t+.6208885*o,g:e-.27137664*t-.6486059*o,b:e-1.10561724*t+1.70250126*o};return r!==void 0&&(a.alpha=r),a},L0=o7;var r7={mode:"yiq",toMode:{rgb:L0},fromMode:{rgb:x0},channels:["y","i","q","alpha"],parse:["--yiq"],serialize:"--yiq",ranges:{i:[-.595,.595],q:[-.522,.522]},interpolate:{y:_,i:_,q:_,alpha:{use:_,fixup:fe}}},w0=r7;var a7=(e,t)=>Math.round(e*(t=Math.pow(10,t)))/t,n7=(e=4)=>t=>typeof t=="number"?a7(t,e):t,ko=n7;var bx=ko(2);var yx=a1("rgb"),Mx=a1("hsl");var Rr=e=>{let t=er(e);if(!t)return;let o=tr(t.mode);if(!o.serialize||typeof o.serialize=="string"){let r=`color(${o.serialize||`--${t.mode}`} `;return o.channels.forEach((a,n)=>{a!=="alpha"&&(r+=(n?" ":"")+(t[a]!==void 0?t[a]:"none"))}),t.alpha!==void 0&&t.alpha<1&&(r+=` / ${t.alpha}`),r+")"}if(typeof o.serialize=="function")return o.serialize(t)};var fL=he(w9),pL=he(P9),CL=he(E9),mL=he(D9),gL=he(O9),hL=he(dr),vL=he(cr),xL=he(F9),LL=he(N9),wL=he(q9),IL=he(z9),bL=he(eo),yL=he(K9),ML=he(to),SL=he(W9),RL=he(Y9),HL=he(J9),kL=he(e0),PL=he(t0),TL=he(o0),VL=he(a0),EL=he(l0),DL=he(i0),OL=he(s0),_L=he(c0),BL=he(g1),AL=he(C0),ZL=he(m0),FL=he(v0),$L=he(w0);var l7=a1("rgb"),GL=a1("hsl"),WL=a1("oklch"),XL=a1("oklab"),QL=a1("lch"),YL=a1("lab"),JL=ko(3),Sn=null;function i7(){return Sn??(Sn=document.createElement("canvas").getContext("2d")),Sn}function s7(e){try{let t=i7();if(!t)return null;t.fillStyle="#000000",t.fillStyle=e;let o=t.fillStyle;t.fillStyle="#ffffff",t.fillStyle=e;let r=t.fillStyle;return o===r?o:null}catch{return null}}function Rn(e){let t={r:255,g:255,b:255,a:1};if(!e||typeof e!="string")return t;let o=e.trim(),r=z1(o);if(r){let n=l7(r);if(n)return{r:Math.round(Math.min(255,Math.max(0,(n.r??0)*255))),g:Math.round(Math.min(255,Math.max(0,(n.g??0)*255))),b:Math.round(Math.min(255,Math.max(0,(n.b??0)*255))),a:n.alpha??1}}let a=s7(o);if(a){if(a.startsWith("#")){let l=a.slice(1);return{r:parseInt(l.slice(0,2),16),g:parseInt(l.slice(2,4),16),b:parseInt(l.slice(4,6),16),a:1}}let n=a.match(/rgba?\(\s*(\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);if(n&&n[1]!=null&&n[2]!=null&&n[3]!=null)return{r:+n[1],g:+n[2],b:+n[3],a:n[4]!=null?+n[4]:1}}return t}var u7=new Set(["initial","inherit","unset","revert","revert-layer"]);function Hr(e){return u7.has((e??"").trim().toLowerCase())}function I0(e){let t=(e??"").trim();if(t===""||Hr(t))return!1;let o=t.toLowerCase();return o!=="currentcolor"&&!o.includes("var(")}function b0(e){let t=e.startsWith("#")?e.slice(1):e;return/^[0-9a-fA-F]+$/.test(t)&&[3,4,6,8].includes(t.length)}function y0(e){let t=Math.round(Math.min(255,Math.max(0,e.r))),o=Math.round(Math.min(255,Math.max(0,e.g))),r=Math.round(Math.min(255,Math.max(0,e.b))),a=Math.min(1,Math.max(0,e.a)),n=`#${[t,o,r].map(l=>l.toString(16).padStart(2,"0")).join("")}`;return a<1?n+Math.round(a*255).toString(16).padStart(2,"0"):n}function Lt(e="#ffffff"){let t=Rn(e);return{declaration:e,native:z1(e)??{mode:"rgb",r:t.r/255,g:t.g/255,b:t.b/255,alpha:t.a},rgba:t,hex:y0({...t,a:1}).slice(1).toUpperCase()}}function Hn(e){return String(Math.round(e*1e4)/100)}function kn(e){let t=e.trim();if(!/^(?:\d+(?:\.\d{1,2})?|\.\d{1,2})$/.test(t))return;let o=Number(t);return Number.isFinite(o)&&o>=0&&o<=100?o:void 0}function M0(e,t,o){return Math.min(100,Math.max(0,Math.round((Number(e)+t*(o?10:1))*100)/100))}function Po({r:e,g:t,b:o,a:r}){let a=[e,t,o].map(Math.round).join(", ");return r===1?`rgb(${a})`:`rgba(${a}, ${r})`}function Pn(e,t){let o=t/100;return o===e.rgba.a?e:Lt(Rr({...e.native,alpha:o}))}function S0(e,t){let o=t.trim().replace(/^#/,""),r=Rn(`#${o}`);return(o.length===3||o.length===6)&&(r.a=e.rgba.a),Lt(Po(r))}function Tn(e){let t=(e??"").trim();return t===""||t.toLowerCase()==="none"||Hr(t)?"":t}function K1(e){return Tn(e)!==""}function kr(e){return(e??"").trim().toLowerCase()==="text"}function O1(e){let t=[],o=0,r="";for(let a of e)a==="("?o++:a===")"&&o--,a===","&&o===0?(t.push(r.trim()),r=""):r+=a;return r.trim()!==""&&t.push(r.trim()),t}function R0(e,t,o){let r=O1(e),a=O1(t.toLowerCase());if(r.length===0||a.length===0)return"";let n=o.toLowerCase();return r.filter((l,i)=>a[i%a.length]===n&&K1(l)).join(", ")}function H0(e,t){let o=O1(e);if(o.length===0)return"";let r=O1(t.toLowerCase());return o.filter((a,n)=>(r.length===0||!kr(r[n%r.length]))&&K1(a)).join(", ")}function Vn(e,t){let o=O1(t.toLowerCase());if(o.length===0)return!1;let r=O1(e).length||1;return kr(o[(r-1)%o.length])}function k0(e,t,o,r){let a=O1(e);if(a.length===0)return"";let n=O1(t.toLowerCase());return n.length===0?r==="unchanged"?e:a.map(()=>"none").join(", "):a.map((l,i)=>o(n[i%n.length])?"none":l).join(", ")}function P0(e,t){return k0(e,t,kr,"unchanged")}function T0(e,t){return k0(e,t,o=>!kr(o),"clearAll")}function V0(e,t){let o=O1(t.toLowerCase());if(o.length===0)return t;let a=((O1(e).length||1)-1)%o.length;return o.map((n,l)=>l===a?"border-box":n).join(", ")}function En(e,t,o=!1){let r=(e??"").trim();return r===""||Hr(r)||r.toLowerCase()==="currentcolor"?!1:o||t==null?!0:r.toLowerCase()!==t.trim().toLowerCase()}function E0(e,t,o,r,a=K1,n="none"){if(e.trim()==="")return[];let l=(r??"").trim();if(l.toLowerCase()===n.toLowerCase())return[];let i=l||(o??"");return a(i)?[{property:t,oldValue:i,newValue:n}]:[]}import{jsx as De,jsxs as x1}from"react/jsx-runtime";var Dn=16,oo=4,d7=280,D0=284,c7=200,f7="linear-gradient(45deg, #e0e0e0 25%, transparent 25%), linear-gradient(-45deg, #e0e0e0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e0e0e0 75%), linear-gradient(-45deg, transparent 75%, #e0e0e0 75%)";function p7(e){let t=q1(e);return t?t.getBoundingClientRect():{top:0,bottom:window.innerHeight,left:0,right:window.innerWidth}}function C7(e,t=d7){let o=e.getBoundingClientRect(),r=p7(e),a=r.bottom-o.bottom-oo,n=o.top-r.top-oo,i=a<t&&n>=t?o.top-t-oo:o.bottom+oo;i=Math.max(r.top+oo,Math.min(i,r.bottom-t-oo));let s=o.left;return s+D0>r.right&&(s=r.right-D0-Dn),s<r.left+Dn&&(s=r.left+Dn),{top:i,left:s}}function O0(e,t){let o=e||Po(t);return t.a>=1?{backgroundColor:o}:{backgroundColor:o,backgroundImage:`linear-gradient(0deg, ${o}, ${o}), ${f7}`,backgroundSize:"100% 100%, 8px 8px, 8px 8px, 8px 8px, 8px 8px",backgroundPosition:"0 0, 0 0, 0 4px, 4px -4px, -4px 0"}}var m7={placeholder:"Enter six-digit HEX",ariaValue:"{0} HEX color value",ariaOpenPicker:"{0}, open color picker. Current color: {1}",ariaPicker:"{0} picker",ariaSaturation:"Saturation {0}%, brightness {1}%",ariaEyedropper:"Pick color from screen",ariaHue:"Hue, 0 to 360 degrees",ariaAlphaSlider:"Alpha transparency, 0 to 100 percent",ariaHex:"Hexadecimal color value",ariaChannel:"{0} ({1}), {2} to {3}",ariaAlphaInput:"Alpha, 0 to 100 percent",ariaOpacity:"{0} opacity, 0 to 100 percent",invalidHex:"Enter a HEX color with 3, 4, 6, or 8 digits, with or without #.",invalidOpacity:"Enter an opacity from 0 to 100 with up to two decimal places.",invalidChannel:"Enter a whole number from 0 to 255.",gradientValue:"Gradient",imageValue:"Image",ariaRecentColors:"Recently applied colors",ariaApplyRecentColor:"Apply color {0}, opacity {1}%"};function On({value:e,label:t,className:o,validate:r,validateSyntax:a=r,error:n,errorContainer:l,onCommit:i,opacity:s=!1,resetVersion:u,readOnly:d=!1,placeholder:c}){let[f,g]=be.useState(e),[p,M]=be.useState(!1),h=be.useRef(!1),w=be.useId();be.useEffect(()=>{h.current||g(e)},[e]),be.useEffect(()=>{h.current=!1,g(e),M(!1)},[u]);let v=()=>{if(!h.current)return;if(f.trim()===""||!a(f)){h.current=!1,g(e),M(!1);return}if(!r(f)){M(!0);return}h.current=!1,g(e),M(!1),(s?Number(f)!==Number(e):f.trim().replace(/^#/,"").toUpperCase()!==e.toUpperCase())&&i(f.trim())},R=p?De("span",{id:w,className:"colorEditor-error",role:"alert",children:n}):null;return x1("div",{className:`colorEditor-control ${s?"colorEditor-opacity":""}`,children:[x1("div",{className:"colorEditor-input-suffix",children:[De("input",{type:"text",inputMode:s?"decimal":void 0,className:o,value:d?e:f,readOnly:d,placeholder:c,"aria-label":t,"aria-invalid":p||void 0,"aria-describedby":p?w:void 0,onChange:b=>{let S=b.target.value;h.current=!0,g(S),M(S.trim()!==""&&a(S)&&!r(S))},onBlur:v,onKeyDown:b=>{if(b.key==="Enter"&&(v(),b.currentTarget.blur()),b.key==="Escape"&&(h.current=!1,g(e),M(!1)),s&&(b.key==="ArrowUp"||b.key==="ArrowDown")){b.preventDefault();let S=kn(f)===void 0?e:f,Z=String(M0(S,b.key==="ArrowUp"?1:-1,b.shiftKey));h.current=!1,g(Z),M(!1),Z!==e&&i(Z)}},spellCheck:!1,autoComplete:"off"}),s&&De("span",{className:"colorEditor-percent","aria-hidden":"true",children:"%"})]}),l?_0(R,l):R]})}function _n({label:e,value:t,onChange:o,id:r="color",aria:a,backgroundImage:n,resetVersion:l,recentColors:i=[],onColorApplied:s}){let u=M1(m7,a),d=`${r}-trigger`,c=`${r}-popover`,[f,g]=be.useState(()=>Lt(t)),p=be.useRef(f);p.current=f;let[{colorInput:M,colorState:h},w]=i9(()=>({type:"rgba",...f.rgba})),v=be.useRef(o);v.current=o;let R=be.useRef(s);R.current=s;let b=be.useRef(void 0),S=be.useRef(null),[Z,T]=be.useState(null),L=be.useCallback(()=>{let I=b.current;b.current=void 0,I!==void 0&&R.current?.(I)},[]),V=be.useCallback(I=>{v.current(I),b.current=I},[]),y=s9(V,c7),H=Yo({computePosition:C7,onClose:()=>{y.flush(),L()},trapFocus:!0}),q=be.useRef(t);be.useEffect(()=>{if(q.current===t||(q.current=t,t===p.current.declaration))return;b.current=void 0,y.cancel();let I=Lt(t);p.current=I,g(I),w({type:"rgba",...I.rgba})},[t,w,y]),be.useEffect(()=>()=>{y.cancel(),L()},[y,L]),be.useEffect(()=>{if(!H.isOpen)return;let I=()=>{y.flush()};return document.addEventListener("mouseup",I),document.addEventListener("touchend",I),()=>{document.removeEventListener("mouseup",I),document.removeEventListener("touchend",I)}},[H.isOpen,y]);let K=(I,E=!1,ee=!1)=>{!ee&&I.declaration===p.current.declaration||(y.cancel(),p.current=I,g(I),w({type:"rgba",...I.rgba}),E?y(I.declaration):V(I.declaration))},G=be.useRef(K);G.current=K;let J=be.useCallback(I=>{let E=I.getRgba(),ee=p.current;F.current?G.current(Pn(ee,E.a*100),!0):G.current(Lt(Po({...E,a:ee.rgba.a})),!0)},[]),F=be.useRef(!1),O=I=>{let E=I.target;F.current=!!E.closest(".colorEditor-picker-alpha"),E.closest('[role="slider"]')?.focus({preventScroll:!0})},A=(I,E=!1)=>{let ee=I.relatedTarget;ee instanceof Node&&(S.current?.contains(ee)||H.popoverRef.current?.contains(ee))||H.isOpen&&(E||ee===null)||(y.flush(),L())},z=I=>{let E=I.target.closest('[role="slider"]');E instanceof HTMLElement&&E.focus(),y.flush()};be.useLayoutEffect(()=>{if(!H.isOpen||!H.popoverRef.current)return;let I=H.popoverRef.current.offsetHeight;I<=0||H.reposition(I)},[H.isOpen,H.reposition,i.length]);let B=h?.hsva??{h:0,s:0,v:100,a:1},j=Math.round(B.s),P=Math.round(B.v);be.useEffect(()=>{let I=H.popoverRef.current;if(!H.isOpen||!I)return;let E=(Ce,we,e1)=>{Ce&&Ce.getAttribute(we)!==e1&&Ce.setAttribute(we,e1)},ee=()=>{let Ce=I.querySelector(".colorEditor-picker-saturation [role=slider]");E(Ce,"aria-label",e),E(Ce,"aria-valuetext",Re(u.ariaSaturation,[j,P])),E(Ce,"aria-valuenow",String(j)),E(Ce,"aria-valuemin","0"),E(Ce,"aria-valuemax","100"),E(I.querySelector(".colorEditor-picker-hue [role=slider]"),"aria-label",u.ariaHue),E(I.querySelector(".colorEditor-picker-alpha [role=slider]"),"aria-label",u.ariaAlphaSlider)};ee();let ce=new MutationObserver(ee);return ce.observe(I,{subtree:!0,attributes:!0,attributeFilter:["aria-valuetext"]}),()=>ce.disconnect()});let W=f.rgba,m=Tn(n),x=m!==""&&W.a===0,k=x?/url\(/i.test(m)?u.imageValue:u.gradientValue:f.hex,C=x?{backgroundImage:m,backgroundSize:"cover",backgroundPosition:"center"}:O0(f.declaration,W),$=I=>De(On,{value:I?k:f.hex,label:I?Re(u.ariaValue,[e]):u.ariaHex,className:I?"colorEditor-value-input":"colorEditor-input-hex",placeholder:I?u.placeholder:void 0,validate:E=>b0(E.trim()),error:u.invalidHex,errorContainer:I?Z:void 0,onCommit:E=>K(S0(p.current,E)),resetVersion:l,readOnly:I&&x}),N=I=>De(On,{value:Hn(W.a),label:I?Re(u.ariaOpacity,[e]):u.ariaAlphaInput,className:I?"colorEditor-value-input":"colorEditor-input-rgba",validate:E=>kn(E)!==void 0,validateSyntax:E=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/.test(E.trim()),error:u.invalidOpacity,errorContainer:I?Z:void 0,onCommit:E=>K(Pn(p.current,Number(E))),resetVersion:l,opacity:!0}),U=be.useMemo(()=>{let I=H.triggerRef.current;if(!I)return document.body;let E=I.getRootNode();return E instanceof ShadowRoot?E:document.body},[H.isOpen,H.triggerRef]);return x1(m1,{label:e,id:r,className:"colorEditor-fieldset",children:[x1("div",{ref:S,className:"colorEditor-wrapper",onBlur:I=>A(I,!0),children:[De("button",{ref:H.triggerRef,id:d,type:"button",className:"colorEditor-swatch-only",onClick:H.toggle,"aria-expanded":H.isOpen,"aria-haspopup":"dialog","aria-controls":c,"aria-label":Re(u.ariaOpenPicker,[e,k]),children:De("span",{style:C,"aria-hidden":"true",className:"colorEditor-swatch"})}),$(!0),!x&&N(!0)]}),De("div",{ref:T}),H.isOpen&&_0(x1("div",{ref:H.popoverRef,id:c,role:"dialog","aria-modal":"true","aria-label":Re(u.ariaPicker,[e]),style:{top:H.position.top,left:H.position.left},onDragStart:I=>I.preventDefault(),onMouseUp:z,onMouseDownCapture:O,onTouchStartCapture:O,onPointerDownCapture:O,onKeyDownCapture:I=>{F.current=!!I.target.closest(".colorEditor-picker-alpha")},className:"colorEditor-popover",onBlur:A,children:[x1(qt,{color:M,onChange:J,className:"colorEditor-picker",children:[De(qt.Saturation,{className:"colorEditor-picker-saturation"}),x1("div",{className:"colorEditor-picker-toolbar",children:[De(qt.EyeDropper,{title:u.ariaEyedropper,children:De(Co,{size:18,"aria-hidden":"true"})}),x1("div",{className:"colorEditor-picker-sliders",children:[De(qt.Hue,{className:"colorEditor-picker-hue"}),De(qt.Alpha,{className:"colorEditor-picker-alpha"})]})]})]}),x1("div",{className:"colorEditor-input-wrapper",children:[x1("div",{className:"colorEditor-input-group",children:[$(!1),De("span",{className:"colorEditor-input-label",children:"HEX"})]}),["r","g","b"].map(I=>x1("div",{className:"colorEditor-input-group",children:[De(On,{value:String(W[I]),className:"colorEditor-input-rgba",label:Re(u.ariaChannel,[I.toUpperCase(),"RGB",0,255]),validate:E=>/^\d+$/.test(E.trim())&&Number(E)<=255,validateSyntax:E=>/^-?\d+$/.test(E.trim()),error:u.invalidChannel,resetVersion:l,onCommit:E=>K(Lt(Po({...p.current.rgba,[I]:Number(E)})))}),De("span",{className:"colorEditor-input-label",children:I.toUpperCase()})]},I)),x1("div",{className:"colorEditor-input-group",children:[N(!1),De("span",{className:"colorEditor-input-label",children:"A"})]})]}),i.length>0&&De("div",{className:"colorEditor-recent-colors",role:"group","aria-label":u.ariaRecentColors,children:i.slice(0,20).map(I=>{let E=Lt(I),ee=Re(u.ariaApplyRecentColor,[`#${E.hex}`,Hn(E.rgba.a)]);return De("button",{type:"button",className:"colorEditor-recent-color","aria-label":ee,title:`#${E.hex}`,onClick:()=>K(E,!1,!0),children:De("span",{className:"colorEditor-swatch",style:O0(I,E.rgba),"aria-hidden":"true"})},I)})})]}),U)]})}import Ye from"react";import{jsx as G1,jsxs as Bn}from"react/jsx-runtime";var g7={ariaValue:"{0} value",ariaActions:"{0} options",useNormalLineHeight:"Normal",useNormalSpacing:"Normal",useInherit:"Inherited",invalidRange:"Set a value between {0} and {1}."};function B0(e){let t=q1(e)?.getBoundingClientRect();return{top:Math.max(0,t?.top??0),left:Math.max(0,t?.left??0),bottom:Math.min(window.innerHeight,t?.bottom??window.innerHeight),right:Math.min(window.innerWidth,t?.right??window.innerWidth)}}function Pr({label:e,value:t,onChange:o,id:r="dimension",aria:a,unit:n,icon:l,constraints:i,presets:s,normalLabelKey:u,displayValue:d,measurement:c,resetVersion:f}){let g=M1(g7,a),p=u!==void 0,M=fo(n,i),[h,w]=Ye.useState({}),v=Yo({restoreFocusOnOutside:!1,computePosition:(C,$=200,N=76)=>{let U=C.getBoundingClientRect(),I=B0(C);N=Math.min(N,Math.max(0,I.bottom-I.top-8)),$=Math.min($,Math.max(0,I.right-I.left-8));let E=U.bottom+N+4>I.bottom?U.top-N-4:U.bottom+4;return{top:Math.max(I.top+4,Math.min(E,I.bottom-N-4)),left:Math.max(I.left+4,Math.min(U.right-$,I.right-$-4))}}});Ye.useLayoutEffect(()=>{if(!v.isOpen||!v.popoverRef.current||!v.triggerRef.current)return;let C=B0(v.triggerRef.current);w({maxHeight:Math.max(0,C.bottom-C.top-8),maxWidth:Math.max(0,C.right-C.left-8)})},[v.isOpen]),Ye.useLayoutEffect(()=>{if(!v.isOpen||!v.popoverRef.current)return;let{width:C,height:$}=v.popoverRef.current.getBoundingClientRect();v.reposition(C,$)},[v.isOpen,v.reposition,h]);let[R,b]=Ye.useState(d),S=Ye.useRef(o);S.current=o;let Z=Ye.useRef(t),T=Ye.useRef(!1),L=Ye.useRef(d),V=Ye.useRef(d),y=Ye.useRef(c),H=Ye.useRef(!1),q=Ye.useRef(f),[K,G]=Ye.useState(!1),J=Ye.useRef(void 0),F=()=>{clearTimeout(J.current),J.current=void 0};Ye.useEffect(()=>()=>clearTimeout(J.current),[]),Ye.useEffect(()=>{let C=f!==q.current;q.current=f;let $=t!==Z.current,N=d!==V.current&&L.current===V.current||c!==y.current;V.current=d,y.current=c,Z.current=t,C||($||N)&&!T.current?(F(),b(d),L.current=d,T.current=!1,H.current=!1,G(!1)):N&&(H.current=!0)},[t,d,c,f]);let O=C=>n1(C)&&n1(L.current)&&Number(C)===Number(L.current),A=C=>{let $=C.trim().toLowerCase();return!n1($)||O($)?!0:Number($)>=M.min&&Number($)<=M.max},z=C=>{F(),G(!1),J.current=setTimeout(()=>{J.current=void 0,G(!A(C))},300)},B=(C,$=!1)=>{F();let N=H.current,U=C.trim().toLowerCase(),I=U==="inherit"||p&&U==="normal";if(!I&&!n1(U)){G(!1),(N||Z.current?.trim().toLowerCase()==="inherit")&&(L.current=d),H.current=!1,b(L.current),T.current=!1;return}if(!A(C)){G(!0);return}if(G(!1),H.current=!1,!$&&(U===L.current||O(U))){N&&(L.current=d),b(L.current),T.current=!1;return}let E=U==="inherit"?d:I?U:String(xa(Number(U),n,i)),ee=E===L.current;if(T.current=!1,b(E),ee&&!$&&U!=="inherit")return;L.current=E;let ce=I?U:`${E}${n}`;ce!==Z.current&&(Z.current=ce,S.current(ce))},j=C=>{if(C.key==="Enter"){T.current&&B(R),C.currentTarget.blur();return}if(C.key==="ArrowUp"||C.key==="ArrowDown"){C.preventDefault();let $=R.trim().toLowerCase();if(!T.current&&t?.trim().toLowerCase()==="inherit"||$==="inherit"||p&&$==="normal")return;if(T.current&&!A(R)){F(),G(!0);return}if(!n1(R.trim()))return;B(I2(R,C.key,C.shiftKey,n,i))}},P=`${r}-input`,W=C=>{let $=t?.trim().toLowerCase()??"";if(!n1(C))return $===C;let N=$.match(y2);if(!N)return!1;let U=Number(N[1]);return Number.isFinite(U)&&U===Number(C)&&(N[2]===n||U===0)},m=[...u?[{label:g[u],value:"normal"}]:[],{label:g.useInherit,value:"inherit"}],x=s.map(C=>({label:String(C),value:String(C)})),k=C=>G1("button",{type:"button",role:"menuitemcheckbox","aria-checked":W(C.value),tabIndex:-1,onClick:()=>{B(C.value,!0),v.close()},children:C.label},C.value);return G1(m1,{label:e,id:r,className:"dimensionEditor-fieldset",children:Bn("div",{onBlur:C=>{C.relatedTarget instanceof Node&&C.currentTarget.contains(C.relatedTarget)||v.isOpen&&v.close(!1)},children:[Bn("div",{className:`dimensionEditor-row${K?" dimensionEditor-row--invalid":""}`,children:[G1("span",{className:"dimensionEditor-icon","aria-hidden":"true",children:G1(l,{size:14,width:14,height:14})}),G1("input",{id:P,type:"text",className:"dimensionEditor-input dimensionEditor-input--with-icon",value:R,onChange:C=>{b(C.target.value),T.current=!0,z(C.target.value)},onPaste:C=>{C.preventDefault();let $=C.currentTarget,N=R.slice(0,$.selectionStart??0)+C.clipboardData.getData("text")+R.slice($.selectionEnd??R.length);b(N),T.current=!0,z(N)},onBlur:()=>{T.current&&B(R)},onKeyDown:j,"aria-label":Re(g.ariaValue,[e]),"aria-invalid":K||void 0,"aria-describedby":K?`${r}-error`:void 0,autoComplete:"off",spellCheck:"false"}),G1("button",{type:"button",className:"dimensionEditor-actions",ref:v.triggerRef,"aria-label":Re(g.ariaActions,[e]),"aria-haspopup":"menu","aria-expanded":v.isOpen,"aria-controls":v.isOpen?`${r}-actions`:void 0,onClick:v.toggle,onKeyDown:C=>{(C.key==="ArrowDown"||C.key==="ArrowUp")&&(C.preventDefault(),v.open())},children:G1(Zo,{width:12,height:12,"aria-hidden":"true"})})]}),v.isOpen&&Bn("div",{id:`${r}-actions`,role:"menu","aria-label":Re(g.ariaActions,[e]),className:"dimensionEditor-menu",ref:v.popoverRef,style:{...h,top:v.position.top,left:v.position.left},onKeyDown:C=>{if(C.key==="Tab"){v.close();return}let $=Array.from(C.currentTarget.querySelectorAll("button")),N=$.indexOf(C.target),U;if(C.key==="Home")U=0;else if(C.key==="End")U=$.length-1;else if(C.key==="ArrowDown")U=(N+1)%$.length;else if(C.key==="ArrowUp")U=(N+$.length-1)%$.length;else return;C.preventDefault(),$[U]?.focus()},children:[m.map(k),G1("div",{role:"separator"}),x.map(k)]}),K&&G1("span",{id:`${r}-error`,role:"alert",className:"dimensionEditor-error",children:Re(g.invalidRange,[String(M.min),String(M.max)])})]})})}function s1(e,t){if(e==null)return{};var o={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;o[r]=e[r]}return o}function ne(){return ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)({}).hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},ne.apply(null,arguments)}var te=s2(z0(),1),I7=s2(W0(),1);import*as ge from"react";import{cloneElement as Gw,Component as Ww,useRef as w1,useCallback as pe,useEffect as _1,useMemo as ro}from"react";var X0=e=>typeof e=="object"&&e!=null&&e.nodeType===1,Q0=(e,t)=>(!t||e!=="hidden")&&e!=="visible"&&e!=="clip",$r=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let o=getComputedStyle(e,null);return Q0(o.overflowY,t)||Q0(o.overflowX,t)||(r=>{let a=(n=>{if(!n.ownerDocument||!n.ownerDocument.defaultView)return null;try{return n.ownerDocument.defaultView.frameElement}catch{return null}})(r);return!!a&&(a.clientHeight<r.scrollHeight||a.clientWidth<r.scrollWidth)})(e)}return!1},Nr=(e,t,o,r,a,n,l,i)=>n<e&&l>t||n>e&&l<t?0:n<=e&&i<=o||l>=t&&i>=o?n-e-r:l>t&&i<o||n<e&&i>o?l-t+a:0,w7=e=>{let t=e.parentElement;return t??(e.getRootNode().host||null)},Y0=(e,t)=>{var o,r,a,n;if(typeof document>"u")return[];let{scrollMode:l,block:i,inline:s,boundary:u,skipOverflowHiddenElements:d}=t,c=typeof u=="function"?u:F=>F!==u;if(!X0(e))throw new TypeError("Invalid target");let f=document.scrollingElement||document.documentElement,g=[],p=e;for(;X0(p)&&c(p);){if(p=w7(p),p===f){g.push(p);break}p!=null&&p===document.body&&$r(p)&&!$r(document.documentElement)||p!=null&&$r(p,d)&&g.push(p)}let M=(r=(o=window.visualViewport)==null?void 0:o.width)!=null?r:innerWidth,h=(n=(a=window.visualViewport)==null?void 0:a.height)!=null?n:innerHeight,{scrollX:w,scrollY:v}=window,{height:R,width:b,top:S,right:Z,bottom:T,left:L}=e.getBoundingClientRect(),{top:V,right:y,bottom:H,left:q}=(F=>{let O=window.getComputedStyle(F);return{top:parseFloat(O.scrollMarginTop)||0,right:parseFloat(O.scrollMarginRight)||0,bottom:parseFloat(O.scrollMarginBottom)||0,left:parseFloat(O.scrollMarginLeft)||0}})(e),K=i==="start"||i==="nearest"?S-V:i==="end"?T+H:S+R/2-V+H,G=s==="center"?L+b/2-q+y:s==="end"?Z+y:L-q,J=[];for(let F=0;F<g.length;F++){let O=g[F],{height:A,width:z,top:B,right:j,bottom:P,left:W}=O.getBoundingClientRect();if(l==="if-needed"&&S>=0&&L>=0&&T<=h&&Z<=M&&(O===f&&!$r(O)||S>=B&&T<=P&&L>=W&&Z<=j))return J;let m=getComputedStyle(O),x=parseInt(m.borderLeftWidth,10),k=parseInt(m.borderTopWidth,10),C=parseInt(m.borderRightWidth,10),$=parseInt(m.borderBottomWidth,10),N=0,U=0,I="offsetWidth"in O?O.offsetWidth-O.clientWidth-x-C:0,E="offsetHeight"in O?O.offsetHeight-O.clientHeight-k-$:0,ee="offsetWidth"in O?O.offsetWidth===0?0:z/O.offsetWidth:0,ce="offsetHeight"in O?O.offsetHeight===0?0:A/O.offsetHeight:0;if(f===O)N=i==="start"?K:i==="end"?K-h:i==="nearest"?Nr(v,v+h,h,k,$,v+K,v+K+R,R):K-h/2,U=s==="start"?G:s==="center"?G-M/2:s==="end"?G-M:Nr(w,w+M,M,x,C,w+G,w+G+b,b),N=Math.max(0,N+v),U=Math.max(0,U+w);else{N=i==="start"?K-B-k:i==="end"?K-P+$+E:i==="nearest"?Nr(B,P,A,k,$+E,K,K+R,R):K-(B+A/2)+E/2,U=s==="start"?G-W-x:s==="center"?G-(W+z/2)+I/2:s==="end"?G-j+C+I:Nr(W,j,z,x,C+I,G,G+b,b);let{scrollLeft:Ce,scrollTop:we}=O;N=ce===0?0:Math.max(0,Math.min(we+N/ce,O.scrollHeight-A/ce+E)),U=ee===0?0:Math.max(0,Math.min(Ce+U/ee,O.scrollWidth-z/ee+I)),K+=we-N,G+=Ce-U}J.push({el:O,top:N,left:U})}return J};var b7=0;function ni(){return String(b7++)}function Eo(e){var t=ge.useRef(e);return t.current=e,t}function y7(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){t.forEach(function(a){typeof a=="function"?a(r):a&&(a.current=r)})}}function Fn(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){for(var a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];return t.some(function(i){return i&&i.apply(void 0,[r].concat(n)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function li(e,t){var o;function r(){o&&clearTimeout(o)}function a(){for(var n=arguments.length,l=new Array(n),i=0;i<n;i++)l[i]=arguments[i];r(),o=setTimeout(function(){o=null,e.apply(void 0,l)},t)}return a.cancel=r,a}var M7=li(function(e){ii(e).textContent=""},500);function ii(e){var t=e.getElementById("a11y-status-message");return t||(t=e.createElement("div"),t.setAttribute("id","a11y-status-message"),t.setAttribute("role","status"),t.setAttribute("aria-live","polite"),t.setAttribute("aria-relevant","additions text"),Object.assign(t.style,{border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px"}),e.body.appendChild(t),t)}function S7(e,t){if(!(!e||!t)){var o=ii(t);o.textContent=e,M7(t)}}function R7(e){var t=e?.getElementById("a11y-status-message");t&&t.remove()}function Do(){}var Nn=Do;function qr(e,t){if(!t)return e;var o=Object.keys(e);return o.reduce(function(r,a){return t[a]!==void 0&&(r[a]=t[a]),r},ne({},e))}function H7(e,t){if(e){var o=Y0(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});o.forEach(function(r){var a=r.el,n=r.top,l=r.left;a.scrollTop=n,a.scrollLeft=l})}}function J0(e,t,o){var r=e===t||t instanceof o.Node&&e.contains&&e.contains(t);return r}function k7(e,t){var o;function r(){o&&clearTimeout(o)}function a(){for(var n=arguments.length,l=new Array(n),i=0;i<n;i++)l[i]=arguments[i];r(),o=setTimeout(function(){o=null,e.apply(void 0,l)},t)}return a.cancel=r,a}function Pe(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){for(var a=arguments.length,n=new Array(a>1?a-1:0),l=1;l<a;l++)n[l-1]=arguments[l];return t.some(function(i){return i&&i.apply(void 0,[r].concat(n)),r.preventDownshiftDefault||r.hasOwnProperty("nativeEvent")&&r.nativeEvent.preventDownshiftDefault})}}function W1(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return function(r){t.forEach(function(a){typeof a=="function"?a(r):a&&(a.current=r)})}}function P7(e,t){return e[t]!==void 0}function zr(e){var t=e.key,o=e.keyCode;return o>=37&&o<=40&&t.indexOf("Arrow")!==0?"Arrow"+t:t}function wt(e,t,o,r,a){a===void 0&&(a=!1);var n=o.length;if(n===0)return-1;var l=n-1;(typeof e!="number"||e<0||e>l)&&(e=t>0?-1:l+1);var i=e+t;i<0?i=a?l:0:i>l&&(i=a?0:l);var s=ao(i,t<0,o,r,a);return s===-1?e>=n?-1:e:s}function ao(e,t,o,r,a){a===void 0&&(a=!1);var n=o.length;if(t){for(var l=e;l>=0;l--)if(!r(o[l],l))return l}else for(var i=e;i<n;i++)if(!r(o[i],i))return i;return a?ao(t?n-1:0,t,o,r):-1}function ei(e,t,o,r){return r===void 0&&(r=!0),o&&t.some(function(a){return a&&(J0(a,e,o)||r&&J0(a,o.document.activeElement,o))})}function Un(e){return""+e.slice(0,1).toUpperCase()+e.slice(1)}function T7(e,t,o,r){for(var a=e.type,n={},l=Object.keys(o),i=0,s=l;i<s.length;i++){var u=s[i];V7(u,e,t,o,r),r[u]!==o[u]&&(n[u]=r[u])}t.onStateChange&&Object.keys(n).length&&t.onStateChange(ne({type:a},n))}function V7(e,t,o,r,a){if(a[e]!==r[e]){var n="on"+Un(e)+"Change",l=o[n];if(typeof l=="function"){var i=t.type;l(ne({type:i},a))}}}function si(e,t,o,r){var a=ge.useRef(null),n=ge.useRef(void 0),l=Eo(t),i=ge.useCallback(function(f,g){n.current=g,f=qr(f,l.current);var p=e(f,l.current,g),M=l.current.stateReducer(f,ne({},g,{changes:p}));return ne({},f,M)},[l,e]),s=ge.useReducer(i,t,o),u=s[0],d=s[1],c=n.current;return ge.useEffect(function(){var f,g=qr((f=a.current)!=null?f:{},l.current),p=c&&a.current&&!r(g,u);p&&T7(c,l.current,g,u),a.current=u},[u,c,r,l]),[u,d]}function qn(e,t,o,r){var a=si(e,t,o,r),n=a[0],l=a[1];return[qr(n,t),l]}function zn(e,t,o,r){if(e!==void 0&&t!==void 0)return[e,t];if(e!==void 0){var a=o.indexOf(e);if(a<0)throw new Error(r);return[e,o.indexOf(e)]}if(t!==void 0){var n=o[t];if(n===void 0)throw new Error(r);return[n,t]}throw new Error(r)}function Qr(){var e=ge.useRef(!0);return ge.useEffect(function(){return e.current=!1,function(){e.current=!0}},[]),e.current}function E7(e,t){return t.changes}var D7={environment:te.default.shape({addEventListener:te.default.func.isRequired,removeEventListener:te.default.func.isRequired,document:te.default.shape({createElement:te.default.func.isRequired,getElementById:te.default.func.isRequired,activeElement:te.default.any.isRequired,body:te.default.any.isRequired}).isRequired,Node:te.default.func.isRequired}),itemToKey:te.default.func,stateReducer:te.default.func};function B1(e,t,o){var r=e["default"+Un(t)];return r!==void 0?r:o[t]}function Dt(e,t,o){var r=e[t];if(r!==void 0)return r;var a=e["initial"+Un(t)];return a!==void 0?a:B1(e,t,o)}var ti=li(function(e,t){S7(e,t)},200);function jn(e,t,o,r){var a=r?.document,n=Qr();ge.useEffect(function(){if(!(!e||n||!a)){var l=e(t);ti(l,a)}},o),ge.useEffect(function(){return function(){ti.cancel(),R7(a)}},[a])}var To=ne({},D7,{getA11yStatusMessage:te.default.func,highlightedIndex:te.default.number,defaultHighlightedIndex:te.default.number,initialHighlightedIndex:te.default.number,isOpen:te.default.bool,defaultIsOpen:te.default.bool,initialIsOpen:te.default.bool,selectedItem:te.default.any,initialSelectedItem:te.default.any,defaultSelectedItem:te.default.any,id:te.default.string,labelId:te.default.string,menuId:te.default.string,getItemId:te.default.func,toggleButtonId:te.default.string,onSelectedItemChange:te.default.func,onHighlightedIndexChange:te.default.func,onStateChange:te.default.func,onIsOpenChange:te.default.func,scrollIntoView:te.default.func}),Vo={itemToString:function(t){return t?String(t):""},itemToKey:function(t){return t},stateReducer:E7,scrollIntoView:H7,environment:typeof window>"u"?void 0:window},u1={highlightedIndex:-1,isOpen:!1,selectedItem:null,inputValue:""},O7=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?ge.useLayoutEffect:ge.useEffect;function _7(e){return/^\S{1}$/.test(e)}function ui(e){var t=Dt(e,"selectedItem",u1),o=Dt(e,"isOpen",u1),r=B7(e),a=Dt(e,"inputValue",u1);return{highlightedIndex:r<0&&t&&o?e.items.findIndex(function(n){return e.itemToKey(n)===e.itemToKey(t)}):r,isOpen:o,selectedItem:t,inputValue:a}}function Ot(e,t,o){var r=e.items,a=e.initialHighlightedIndex,n=e.defaultHighlightedIndex,l=e.isItemDisabled,i=e.itemToKey,s=t.selectedItem,u=t.highlightedIndex;return r.length===0?-1:a!==void 0&&u===a&&!l(r[a],a)?a:n!==void 0&&!l(r[n],n)?n:s?r.findIndex(function(d){return i(s)===i(d)}):o<0&&!l(r[r.length-1],r.length-1)?r.length-1:o>0&&!l(r[0],0)?0:-1}function di(e,t,o){var r=ge.useRef({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1}),a=ge.useCallback(function(){return o.map(function(n){return n.current})},[o]);return ge.useEffect(function(){if(!e)return Do;function n(){r.current.isTouchEnd=!1,r.current.isMouseDown=!0}function l(d){r.current.isMouseDown=!1,ei(d.target,a(),e)||t()}function i(){r.current.isTouchEnd=!1,r.current.isTouchMove=!1}function s(){r.current.isTouchMove=!0}function u(d){r.current.isTouchEnd=!0,!r.current.isTouchMove&&!ei(d.target,a(),e,!1)&&t()}return e.addEventListener("mousedown",n),e.addEventListener("mouseup",l),e.addEventListener("touchstart",i),e.addEventListener("touchmove",s),e.addEventListener("touchend",u),function(){e.removeEventListener("mousedown",n),e.removeEventListener("mouseup",l),e.removeEventListener("touchstart",i),e.removeEventListener("touchmove",s),e.removeEventListener("touchend",u)}},[e,a,t]),r.current}var Kn=function(){return Do};function ci(e){var t=e.highlightedIndex,o=e.isOpen,r=e.itemRefs,a=e.getItemNodeFromIndex,n=e.menuElement,l=e.scrollIntoView,i=ge.useRef(!0);return O7(function(){t<0||!o||!Object.keys(r.current).length||(i.current===!1?i.current=!0:l(a(t),n))},[t]),i}var Gn=Do;function jr(e,t,o){var r;o===void 0&&(o=!0);var a=((r=e.items)==null?void 0:r.length)&&t>=0;return ne({isOpen:!1,highlightedIndex:-1},a&&ne({selectedItem:e.items[t],isOpen:B1(e,"isOpen",u1),highlightedIndex:B1(e,"highlightedIndex",u1)},o&&{inputValue:e.itemToString(e.items[t])}))}function fi(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function Kr(e){var t=B1(e,"highlightedIndex",u1);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function B7(e){var t=Dt(e,"highlightedIndex",u1);return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}function pi(e,t,o,r){var a=o.type,n;switch(a){case r.ItemMouseMove:n={highlightedIndex:o.disabled?-1:o.index};break;case r.MenuMouseLeave:n={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:n={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ot(t,e,0)};break;case r.FunctionOpenMenu:n={isOpen:!0,highlightedIndex:Ot(t,e,0)};break;case r.FunctionCloseMenu:n={isOpen:!1};break;case r.FunctionSetHighlightedIndex:n={highlightedIndex:t.isItemDisabled(t.items[o.highlightedIndex],o.highlightedIndex)?-1:o.highlightedIndex};break;case r.FunctionSetInputValue:n={inputValue:o.inputValue};break;case r.FunctionReset:n={highlightedIndex:Kr(t),isOpen:B1(t,"isOpen",u1),selectedItem:B1(t,"selectedItem",u1),inputValue:B1(t,"inputValue",u1)};break;default:throw new Error("Reducer called without proper action type.")}return ne({},e,n)}var A7=ne({},To,{items:te.default.array.isRequired,isItemDisabled:te.default.func}),Z7=ne({},Vo,{isItemDisabled:function(){return!1}});function F7(e){for(var t=e.keysSoFar,o=e.highlightedIndex,r=e.items,a=e.itemToString,n=e.isItemDisabled,l=t.toLowerCase(),i=0;i<r.length;i++){var s=(i+o+(t.length<2?1:0))%r.length,u=r[s];if(u!==void 0&&a(u).toLowerCase().startsWith(l)&&!n(u,s))return s}return o}var Ur=0,Wn=1,Xn=2,Gr=3,Qn=4,Yn=5,Jn=6,el=7,tl=8,ol=9,rl=10,Wr=11,Ci=12,mi=13,al=14,gi=15,hi=16,vi=17,xi=18,nl=19,$n=20,Li=21,wi=Object.freeze({__proto__:null,FunctionCloseMenu:vi,FunctionOpenMenu:hi,FunctionReset:Li,FunctionSelectItem:nl,FunctionSetHighlightedIndex:xi,FunctionSetInputValue:$n,FunctionToggleMenu:gi,ItemClick:al,ItemMouseMove:mi,MenuMouseLeave:Ci,ToggleButtonBlur:Wr,ToggleButtonClick:Ur,ToggleButtonKeyDownArrowDown:Wn,ToggleButtonKeyDownArrowUp:Xn,ToggleButtonKeyDownCharacter:Gr,ToggleButtonKeyDownEnd:Jn,ToggleButtonKeyDownEnter:el,ToggleButtonKeyDownEscape:Qn,ToggleButtonKeyDownHome:Yn,ToggleButtonKeyDownPageDown:rl,ToggleButtonKeyDownPageUp:ol,ToggleButtonKeyDownSpaceButton:tl});function $7(e,t,o){var r,a=o.type,n=o.altKey,l;switch(a){case al:l={isOpen:B1(t,"isOpen",u1),highlightedIndex:Kr(t),selectedItem:t.items[o.index]};break;case Gr:{var i=o.key,s=""+e.inputValue+i,u=!e.isOpen&&e.selectedItem?t.items.findIndex(function(g){return t.itemToKey(g)===t.itemToKey(e.selectedItem)}):e.highlightedIndex,d=F7({keysSoFar:s,highlightedIndex:u,items:t.items,itemToString:t.itemToString,isItemDisabled:t.isItemDisabled});l={inputValue:s,highlightedIndex:d,isOpen:!0}}break;case Wn:{var c=e.isOpen?wt(e.highlightedIndex,1,t.items,t.isItemDisabled):n&&e.selectedItem==null?-1:Ot(t,e,1);l={highlightedIndex:c,isOpen:!0}}break;case Xn:if(e.isOpen&&n)l=jr(t,e.highlightedIndex,!1);else{var f=e.isOpen?wt(e.highlightedIndex,-1,t.items,t.isItemDisabled):Ot(t,e,-1);l={highlightedIndex:f,isOpen:!0}}break;case el:case tl:l=jr(t,e.highlightedIndex,!1);break;case Yn:l={highlightedIndex:ao(0,!1,t.items,t.isItemDisabled),isOpen:!0};break;case Jn:l={highlightedIndex:ao(t.items.length-1,!0,t.items,t.isItemDisabled),isOpen:!0};break;case ol:l={highlightedIndex:wt(e.highlightedIndex,-10,t.items,t.isItemDisabled)};break;case rl:l={highlightedIndex:wt(e.highlightedIndex,10,t.items,t.isItemDisabled)};break;case Qn:l={isOpen:!1,highlightedIndex:-1};break;case Wr:l=ne({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((r=t.items)==null?void 0:r.length)&&{selectedItem:t.items[e.highlightedIndex]});break;case nl:l={selectedItem:o.selectedItem};break;default:return pi(e,t,o,wi)}return ne({},e,l)}var N7=ne({},ge),Ii=N7.useId,bi=typeof Ii=="function"?U7:q7;function U7(e){var t=e.id,o=e.labelId,r=e.menuId,a=e.getItemId,n=e.toggleButtonId,l=e.inputId,i="downshift-"+Ii();t||(t=i);var s=ge.useMemo(function(){return{labelId:o??t+"-label",menuId:r??t+"-menu",getItemId:a??function(u){return t+"-item-"+u},toggleButtonId:n??t+"-toggle-button",inputId:l??t+"-input"}},[a,t,l,o,r,n]);return s}function q7(e){var t=e.id,o=e.labelId,r=e.menuId,a=e.getItemId,n=e.toggleButtonId,l=e.inputId,i=ge.useRef(t??"downshift-"+ni()),s=i.current,u=ge.useMemo(function(){return{labelId:o??s+"-label",menuId:r??s+"-menu",getItemId:a??function(d){return s+"-item-"+d},toggleButtonId:n??s+"-toggle-button",inputId:l??s+"-input"}},[a,l,o,r,n,s]);return u}var z7=["onClick"],j7=["onMouseLeave","refKey","ref"],K7=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],G7=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];Oo.stateChangeTypes=wi;function Oo(e){e===void 0&&(e={}),Nn(e,Oo,A7);var t=ne({},Z7,e),o=t.scrollIntoView,r=t.environment,a=t.getA11yStatusMessage,n=qn($7,t,ui,fi),l=n[0],i=n[1],s=l.isOpen,u=l.highlightedIndex,d=l.selectedItem,c=l.inputValue,f=w1(null),g=w1(null),p=w1({}),M=w1(null),h=bi(t),w=Eo({state:l,props:t}),v=pe(function(B){return p.current[h.getItemId(B)]},[h]);jn(a,l,[s,u,d,c],r);var R=ci({menuElement:g.current,highlightedIndex:u,isOpen:s,itemRefs:p,scrollIntoView:o,getItemNodeFromIndex:v});_1(function(){return M.current=k7(function(B){B({type:$n,inputValue:""})},500),function(){M.current.cancel()}},[]),_1(function(){c&&M.current(i)},[i,c]),Gn({props:t,state:l}),_1(function(){var B=Dt(t,"isOpen",u1);B&&f.current&&f.current.focus()},[]);var b=pe(function(){w.current.state.isOpen&&i({type:Wr})},[i,w]),S=ro(function(){return[g,f]},[]),Z=di(r,b,S),T=Kn("getMenuProps","getToggleButtonProps");_1(function(){s||(p.current={})},[s]);var L=ro(function(){return{ArrowDown:function(j){j.preventDefault(),i({type:Wn,altKey:j.altKey})},ArrowUp:function(j){j.preventDefault(),i({type:Xn,altKey:j.altKey})},Home:function(j){j.preventDefault(),i({type:Yn})},End:function(j){j.preventDefault(),i({type:Jn})},Escape:function(){w.current.state.isOpen&&i({type:Qn})},Enter:function(j){j.preventDefault(),i({type:w.current.state.isOpen?el:Ur})},PageUp:function(j){w.current.state.isOpen&&(j.preventDefault(),i({type:ol}))},PageDown:function(j){w.current.state.isOpen&&(j.preventDefault(),i({type:rl}))}," ":function(j){j.preventDefault();var P=w.current.state;if(!P.isOpen){i({type:Ur});return}P.inputValue?i({type:Gr,key:" "}):i({type:tl})}}},[i,w]),V=pe(function(){i({type:gi})},[i]),y=pe(function(){i({type:vi})},[i]),H=pe(function(){i({type:hi})},[i]),q=pe(function(B){i({type:xi,highlightedIndex:B})},[i]),K=pe(function(B){i({type:nl,selectedItem:B})},[i]),G=pe(function(){i({type:Li})},[i]),J=pe(function(B){i({type:$n,inputValue:B})},[i]),F=pe(function(B){var j=B===void 0?{}:B,P=j.onClick,W=s1(j,z7),m=function(){var k;(k=f.current)==null||k.focus()};return ne({id:h.labelId,htmlFor:h.toggleButtonId,onClick:Pe(P,m)},W)},[h]),O=pe(function(B,j){var P,W=B===void 0?{}:B,m=W.onMouseLeave,x=W.refKey,k=x===void 0?"ref":x,C=W.ref,$=s1(W,j7),N=j===void 0?{}:j,U=N.suppressRefError,I=U===void 0?!1:U,E=function(){i({type:Ci})};return T("getMenuProps",I,k,g),ne((P={},P[k]=W1(C,function(ee){g.current=ee}),P.id=h.menuId,P.role="listbox",P["aria-labelledby"]=$&&$["aria-label"]?void 0:""+h.labelId,P.onMouseLeave=Pe(m,E),P),$)},[i,T,h]),A=pe(function(B,j){var P,W=B===void 0?{}:B,m=W.onBlur,x=W.onClick;W.onPress;var k=W.onKeyDown,C=W.refKey,$=C===void 0?"ref":C,N=W.ref,U=s1(W,K7),I=j===void 0?{}:j,E=I.suppressRefError,ee=E===void 0?!1:E,ce=w.current.state,Ce=function(){i({type:Ur})},we=function(){ce.isOpen&&!Z.isMouseDown&&i({type:Wr})},e1=function(Oe){var Se=zr(Oe);Se&&L[Se]?L[Se](Oe):_7(Se)&&i({type:Gr,key:Se})},Ie=ne((P={},P[$]=W1(N,function(Te){f.current=Te}),P["aria-activedescendant"]=ce.isOpen&&ce.highlightedIndex>-1?h.getItemId(ce.highlightedIndex):"",P["aria-controls"]=h.menuId,P["aria-expanded"]=w.current.state.isOpen,P["aria-haspopup"]="listbox",P["aria-labelledby"]=U&&U["aria-label"]?void 0:""+h.labelId,P.id=h.toggleButtonId,P.role="combobox",P.tabIndex=0,P.onBlur=Pe(m,we),P),U);return U.disabled||(Ie.onClick=Pe(x,Ce),Ie.onKeyDown=Pe(k,e1)),T("getToggleButtonProps",ee,$,f),Ie},[i,h,w,Z,T,L]),z=pe(function(B){var j,P=B===void 0?{}:B,W=P.item,m=P.index,x=P.onMouseMove,k=P.onClick,C=P.onMouseDown;P.onPress;var $=P.refKey,N=$===void 0?"ref":$,U=P.disabled,I=P.ref,E=s1(P,G7);U!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var ee=w.current,ce=ee.state,Ce=ee.props,we=zn(W,m,Ce.items,"Pass either item or index to getItemProps!"),e1=we[0],Ie=we[1],Te=Ce.isItemDisabled(e1,Ie),Oe=function(){Z.isTouchEnd||Ie===ce.highlightedIndex||(R.current=!1,i({type:mi,index:Ie,disabled:Te}))},Se=function(){i({type:al,index:Ie})},b1=function(re){return re.preventDefault()},Ne=ne((j={},j[N]=W1(I,function(_e){_e&&(p.current[h.getItemId(Ie)]=_e)}),j["aria-disabled"]=Te,j["aria-selected"]=e1===ce.selectedItem,j.id=h.getItemId(Ie),j.role="option",j),E);return Te||(Ne.onClick=Pe(k,Se)),Ne.onMouseMove=Pe(x,Oe),Ne.onMouseDown=Pe(C,b1),Ne},[w,h,Z,R,i]);return{getToggleButtonProps:A,getLabelProps:F,getMenuProps:O,getItemProps:z,toggleMenu:V,openMenu:H,closeMenu:y,setHighlightedIndex:q,selectItem:K,reset:G,setInputValue:J,highlightedIndex:u,isOpen:s,selectedItem:d,inputValue:c}}var ll=0,il=1,sl=2,ul=3,dl=4,cl=5,fl=6,pl=7,Cl=8,Xr=9,ml=10,yi=11,Mi=12,gl=13,Si=14,Ri=15,Hi=16,ki=17,Pi=18,hl=19,Ti=20,Vi=21,vl=22,Ei=Object.freeze({__proto__:null,ControlledPropUpdatedSelectedItem:vl,FunctionCloseMenu:ki,FunctionOpenMenu:Hi,FunctionReset:Vi,FunctionSelectItem:hl,FunctionSetHighlightedIndex:Pi,FunctionSetInputValue:Ti,FunctionToggleMenu:Ri,InputBlur:Xr,InputChange:Cl,InputClick:ml,InputKeyDownArrowDown:ll,InputKeyDownArrowUp:il,InputKeyDownEnd:dl,InputKeyDownEnter:pl,InputKeyDownEscape:sl,InputKeyDownHome:ul,InputKeyDownPageDown:fl,InputKeyDownPageUp:cl,ItemClick:gl,ItemMouseMove:Mi,MenuMouseLeave:yi,ToggleButtonClick:Si});function W7(e){var t=ui(e),o=t.selectedItem,r=t.inputValue;return r===""&&o&&e.defaultInputValue===void 0&&e.initialInputValue===void 0&&e.inputValue===void 0&&(r=e.itemToString(o)),ne({},t,{inputValue:r})}var X7=ne({},To,{items:te.default.array.isRequired,isItemDisabled:te.default.func,inputValue:te.default.string,defaultInputValue:te.default.string,initialInputValue:te.default.string,inputId:te.default.string,onInputValueChange:te.default.func});function Q7(e,t,o,r){var a=w1(),n=si(e,t,o,r),l=n[0],i=n[1],s=Qr();return _1(function(){if(P7(t,"selectedItem")){if(!s){var u=t.itemToKey(t.selectedItem)!==t.itemToKey(a.current);u&&i({type:vl,inputValue:t.itemToString(t.selectedItem)})}a.current=l.selectedItem===a.current?t.selectedItem:l.selectedItem}},[l.selectedItem,t.selectedItem]),[qr(l,t),i]}var Y7=ne({},Vo,{isItemDisabled:function(){return!1}});function J7(e,t,o){var r,a=o.type,n=o.altKey,l;switch(a){case gl:l={isOpen:B1(t,"isOpen",u1),highlightedIndex:Kr(t),selectedItem:t.items[o.index],inputValue:t.itemToString(t.items[o.index])};break;case ll:e.isOpen?l={highlightedIndex:wt(e.highlightedIndex,1,t.items,t.isItemDisabled,!0)}:l={highlightedIndex:n&&e.selectedItem==null?-1:Ot(t,e,1),isOpen:t.items.length>=0};break;case il:e.isOpen?n?l=jr(t,e.highlightedIndex):l={highlightedIndex:wt(e.highlightedIndex,-1,t.items,t.isItemDisabled,!0)}:l={highlightedIndex:Ot(t,e,-1),isOpen:t.items.length>=0};break;case pl:l=jr(t,e.highlightedIndex);break;case sl:l=ne({isOpen:!1,highlightedIndex:-1},!e.isOpen&&{selectedItem:null,inputValue:""});break;case cl:l={highlightedIndex:wt(e.highlightedIndex,-10,t.items,t.isItemDisabled,!0)};break;case fl:l={highlightedIndex:wt(e.highlightedIndex,10,t.items,t.isItemDisabled,!0)};break;case ul:l={highlightedIndex:ao(0,!1,t.items,t.isItemDisabled)};break;case dl:l={highlightedIndex:ao(t.items.length-1,!0,t.items,t.isItemDisabled)};break;case Xr:l=ne({isOpen:!1,highlightedIndex:-1},e.highlightedIndex>=0&&((r=t.items)==null?void 0:r.length)&&o.selectItem&&{selectedItem:t.items[e.highlightedIndex],inputValue:t.itemToString(t.items[e.highlightedIndex])});break;case Cl:l={isOpen:!0,highlightedIndex:Kr(t),inputValue:o.inputValue};break;case ml:l={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ot(t,e,0)};break;case hl:l={selectedItem:o.selectedItem,inputValue:t.itemToString(o.selectedItem)};break;case vl:l={inputValue:o.inputValue};break;default:return pi(e,t,o,Ei)}return ne({},e,l)}var e4=["onMouseLeave","refKey","ref"],t4=["item","index","refKey","ref","onMouseMove","onMouseDown","onClick","onPress","disabled"],o4=["onClick","onPress","refKey","ref"],r4=["onKeyDown","onChange","onInput","onBlur","onChangeText","onClick","refKey","ref"];Di.stateChangeTypes=Ei;function Di(e){e===void 0&&(e={}),Nn(e,Di,X7);var t=ne({},Y7,e),o=t.items,r=t.scrollIntoView,a=t.environment,n=t.getA11yStatusMessage,l=Q7(J7,t,W7,fi),i=l[0],s=l[1],u=i.isOpen,d=i.highlightedIndex,c=i.selectedItem,f=i.inputValue,g=w1(null),p=w1({}),M=w1(null),h=w1(null),w=Qr(),v=bi(t),R=w1(),b=Eo({state:i,props:t}),S=pe(function(m){return p.current[v.getItemId(m)]},[v]);jn(n,i,[u,d,c,f],a);var Z=ci({menuElement:g.current,highlightedIndex:d,isOpen:u,itemRefs:p,scrollIntoView:r,getItemNodeFromIndex:S});Gn({props:t,state:i}),_1(function(){var m=Dt(t,"isOpen",u1);m&&M.current&&M.current.focus()},[]),_1(function(){w||(R.current=o.length)});var T=pe(function(){b.current.state.isOpen&&s({type:Xr})},[s,b]),L=ro(function(){return[g,h,M]},[]),V=di(a,T,L),y=Kn("getInputProps","getMenuProps");_1(function(){u||(p.current={})},[u]),_1(function(){var m;!u||!(a!=null&&a.document)||!(M!=null&&(m=M.current)!=null&&m.focus)||a.document.activeElement!==M.current&&M.current.focus()},[u,a]);var H=ro(function(){return{ArrowDown:function(x){x.preventDefault(),s({type:ll,altKey:x.altKey})},ArrowUp:function(x){x.preventDefault(),s({type:il,altKey:x.altKey})},Home:function(x){b.current.state.isOpen&&(x.preventDefault(),s({type:ul}))},End:function(x){b.current.state.isOpen&&(x.preventDefault(),s({type:dl}))},Escape:function(x){var k=b.current.state;(k.isOpen||k.inputValue||k.selectedItem||k.highlightedIndex>-1)&&(x.preventDefault(),s({type:sl}))},Enter:function(x){var k=b.current.state;!k.isOpen||x.which===229||(x.preventDefault(),s({type:pl}))},PageUp:function(x){b.current.state.isOpen&&(x.preventDefault(),s({type:cl}))},PageDown:function(x){b.current.state.isOpen&&(x.preventDefault(),s({type:fl}))}}},[s,b]),q=pe(function(m){return ne({id:v.labelId,htmlFor:v.inputId},m)},[v]),K=pe(function(m,x){var k,C=m===void 0?{}:m,$=C.onMouseLeave,N=C.refKey,U=N===void 0?"ref":N,I=C.ref,E=s1(C,e4),ee=x===void 0?{}:x,ce=ee.suppressRefError,Ce=ce===void 0?!1:ce;return y("getMenuProps",Ce,U,g),ne((k={},k[U]=W1(I,function(we){g.current=we}),k.id=v.menuId,k.role="listbox",k["aria-labelledby"]=E&&E["aria-label"]?void 0:""+v.labelId,k.onMouseLeave=Pe($,function(){s({type:yi})}),k),E)},[s,y,v]),G=pe(function(m){var x,k,C=m===void 0?{}:m,$=C.item,N=C.index,U=C.refKey,I=U===void 0?"ref":U,E=C.ref,ee=C.onMouseMove,ce=C.onMouseDown,Ce=C.onClick;C.onPress;var we=C.disabled,e1=s1(C,t4);we!==void 0&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useCombobox.');var Ie=b.current,Te=Ie.props,Oe=Ie.state,Se=zn($,N,Te.items,"Pass either item or index to getItemProps!"),b1=Se[0],Ne=Se[1],_e=Te.isItemDisabled(b1,Ne),re="onClick",Ge=Ce,He=function(){V.isTouchEnd||Ne===Oe.highlightedIndex||(Z.current=!1,s({type:Mi,index:Ne,disabled:_e}))},C1=function(){s({type:gl,index:Ne})},y1=function(Y){return Y.preventDefault()};return ne((x={},x[I]=W1(E,function(t1){t1&&(p.current[v.getItemId(Ne)]=t1)}),x["aria-disabled"]=_e,x["aria-selected"]=Ne===Oe.highlightedIndex,x.id=v.getItemId(Ne),x.role="option",x),!_e&&(k={},k[re]=Pe(Ge,C1),k),{onMouseMove:Pe(ee,He),onMouseDown:Pe(ce,y1)},e1)},[s,v,b,V,Z]),J=pe(function(m){var x,k=m===void 0?{}:m,C=k.onClick;k.onPress;var $=k.refKey,N=$===void 0?"ref":$,U=k.ref,I=s1(k,o4),E=b.current.state,ee=function(){s({type:Si})};return ne((x={},x[N]=W1(U,function(ce){h.current=ce}),x["aria-controls"]=v.menuId,x["aria-expanded"]=E.isOpen,x.id=v.toggleButtonId,x.tabIndex=-1,x),!I.disabled&&ne({},{onClick:Pe(C,ee)}),I)},[s,b,v]),F=pe(function(m,x){var k,C=m===void 0?{}:m,$=C.onKeyDown,N=C.onChange,U=C.onInput,I=C.onBlur;C.onChangeText;var E=C.onClick,ee=C.refKey,ce=ee===void 0?"ref":ee,Ce=C.ref,we=s1(C,r4),e1=x===void 0?{}:x,Ie=e1.suppressRefError,Te=Ie===void 0?!1:Ie;y("getInputProps",Te,ce,M);var Oe=b.current.state,Se=function(y1){var t1=zr(y1);t1&&H[t1]&&H[t1](y1)},b1=function(y1){s({type:Cl,inputValue:y1.target.value})},Ne=function(y1){if(a!=null&&a.document&&Oe.isOpen&&!V.isMouseDown){var t1=y1.relatedTarget===null&&a.document.activeElement!==a.document.body;s({type:Xr,selectItem:!t1})}},_e=function(){s({type:ml})},re="onChange",Ge={};if(!we.disabled){var He;Ge=(He={},He[re]=Pe(N,U,b1),He.onKeyDown=Pe($,Se),He.onBlur=Pe(I,Ne),He.onClick=Pe(E,_e),He)}return ne((k={},k[ce]=W1(Ce,function(C1){M.current=C1}),k["aria-activedescendant"]=Oe.isOpen&&Oe.highlightedIndex>-1?v.getItemId(Oe.highlightedIndex):"",k["aria-autocomplete"]="list",k["aria-controls"]=v.menuId,k["aria-expanded"]=Oe.isOpen,k["aria-labelledby"]=we&&we["aria-label"]?void 0:v.labelId,k.autoComplete="off",k.id=v.inputId,k.role="combobox",k.value=Oe.inputValue,k),Ge,we)},[s,v,a,H,b,V,y]),O=pe(function(){s({type:Ri})},[s]),A=pe(function(){s({type:ki})},[s]),z=pe(function(){s({type:Hi})},[s]),B=pe(function(m){s({type:Pi,highlightedIndex:m})},[s]),j=pe(function(m){s({type:hl,selectedItem:m})},[s]),P=pe(function(m){s({type:Ti,inputValue:m})},[s]),W=pe(function(){s({type:Vi})},[s]);return{getItemProps:G,getLabelProps:q,getMenuProps:K,getInputProps:F,getToggleButtonProps:J,toggleMenu:O,openMenu:z,closeMenu:A,setHighlightedIndex:B,setInputValue:P,selectItem:j,reset:W,highlightedIndex:d,isOpen:u,selectedItem:c,inputValue:f}}var Oi={activeIndex:-1,selectedItems:[]};function oi(e,t){return Dt(e,t,Oi)}function ri(e,t){return B1(e,t,Oi)}function a4(e){var t=oi(e,"activeIndex"),o=oi(e,"selectedItems");return{activeIndex:t,selectedItems:o}}function ai(e){if(e.shiftKey||e.metaKey||e.ctrlKey||e.altKey)return!1;var t=e.target;return!(t instanceof HTMLInputElement&&t.value!==""&&(t.selectionStart!==0||t.selectionEnd!==0))}function n4(e,t){return e.selectedItems===t.selectedItems&&e.activeIndex===t.activeIndex}var Qw={stateReducer:To.stateReducer,itemToKey:To.itemToKey,environment:To.environment,selectedItems:te.default.array,initialSelectedItems:te.default.array,defaultSelectedItems:te.default.array,getA11yStatusMessage:te.default.func,activeIndex:te.default.number,initialActiveIndex:te.default.number,defaultActiveIndex:te.default.number,onActiveIndexChange:te.default.func,onSelectedItemsChange:te.default.func,keyNavigationNext:te.default.string,keyNavigationPrevious:te.default.string},l4={itemToKey:Vo.itemToKey,stateReducer:Vo.stateReducer,environment:Vo.environment,keyNavigationNext:"ArrowRight",keyNavigationPrevious:"ArrowLeft"},i4=Do,xl=0,Ll=1,wl=2,Il=3,bl=4,yl=5,Ml=6,Sl=7,Rl=8,Hl=9,kl=10,Pl=11,Tl=12,s4=Object.freeze({__proto__:null,DropdownClick:Sl,DropdownKeyDownBackspace:Ml,DropdownKeyDownNavigationPrevious:yl,FunctionAddSelectedItem:Rl,FunctionRemoveSelectedItem:Hl,FunctionReset:Tl,FunctionSetActiveIndex:Pl,FunctionSetSelectedItems:kl,SelectedItemClick:xl,SelectedItemKeyDownBackspace:wl,SelectedItemKeyDownDelete:Ll,SelectedItemKeyDownNavigationNext:Il,SelectedItemKeyDownNavigationPrevious:bl});function u4(e,t,o){var r=o.type,a=o.index,n=o.selectedItem,l=e.activeIndex,i=e.selectedItems,s;switch(r){case xl:s={activeIndex:a};break;case bl:s={activeIndex:l-1<0?0:l-1};break;case Il:s={activeIndex:l+1>=i.length?-1:l+1};break;case wl:case Ll:{if(l<0)break;var u=l;i.length===1?u=-1:l===i.length-1&&(u=i.length-2),s=ne({selectedItems:[].concat(i.slice(0,l),i.slice(l+1))},{activeIndex:u});break}case yl:s={activeIndex:i.length-1};break;case Ml:s={selectedItems:i.slice(0,i.length-1)};break;case Rl:s={selectedItems:[].concat(i,[n])};break;case Sl:s={activeIndex:-1};break;case Hl:{var d=l,c=i.findIndex(function(p){return t.itemToKey(p)===t.itemToKey(n)});if(c<0)break;i.length===1?d=-1:c===i.length-1&&(d=i.length-2),s={selectedItems:[].concat(i.slice(0,c),i.slice(c+1)),activeIndex:d};break}case kl:{var f=o.selectedItems;s={selectedItems:f};break}case Pl:{var g=o.activeIndex;s={activeIndex:g};break}case Tl:s={activeIndex:ri(t,"activeIndex"),selectedItems:ri(t,"selectedItems")};break;default:throw new Error("Reducer called without proper action type.")}return ne({},e,s)}var d4=["refKey","ref","onClick","onKeyDown","selectedItem","index"],c4=["refKey","ref","onKeyDown","onClick","preventKeyAction"];_i.stateChangeTypes=s4;function _i(e){e===void 0&&(e={}),i4(e,_i);var t=ne({},l4,e),o=t.getA11yStatusMessage,r=t.environment,a=t.keyNavigationNext,n=t.keyNavigationPrevious,l=qn(u4,t,a4,n4),i=l[0],s=l[1],u=i.activeIndex,d=i.selectedItems,c=Qr(),f=w1(null),g=w1();g.current=[];var p=Eo({state:i,props:t});jn(o,i,[u,d],r),_1(function(){c||(u===-1&&f.current?f.current.focus():g.current[u]&&g.current[u].focus())},[u]),Gn({props:t,state:i});var M=Kn("getDropdownProps"),h=ro(function(){var V;return V={},V[n]=function(){s({type:bl})},V[a]=function(){s({type:Il})},V.Delete=function(){s({type:Ll})},V.Backspace=function(){s({type:wl})},V},[s,a,n]),w=ro(function(){var V;return V={},V[n]=function(y){ai(y)&&s({type:yl})},V.Backspace=function(H){ai(H)&&s({type:Ml})},V},[s,n]),v=pe(function(V){var y,H=V===void 0?{}:V,q=H.refKey,K=q===void 0?"ref":q,G=H.ref,J=H.onClick,F=H.onKeyDown,O=H.selectedItem,A=H.index,z=s1(H,d4),B=p.current.state,j=zn(O,A,B.selectedItems,"Pass either item or index to getSelectedItemProps!"),P=j[1],W=P>-1&&P===B.activeIndex,m=function(){s({type:xl,index:P})},x=function(C){var $=zr(C);$&&h[$]&&h[$](C)};return ne((y={},y[K]=W1(G,function(k){k&&g.current.push(k)}),y.tabIndex=W?0:-1,y.onClick=Pe(J,m),y.onKeyDown=Pe(F,x),y),z)},[s,p,h]),R=pe(function(V,y){var H,q=V===void 0?{}:V,K=q.refKey,G=K===void 0?"ref":K,J=q.ref,F=q.onKeyDown,O=q.onClick,A=q.preventKeyAction,z=A===void 0?!1:A,B=s1(q,c4),j=y===void 0?{}:y,P=j.suppressRefError,W=P===void 0?!1:P;M("getDropdownProps",W,G,f);var m=function(C){var $=zr(C);$&&w[$]&&w[$](C)},x=function(){s({type:Sl})};return ne((H={},H[G]=W1(J,function(k){k&&(f.current=k)}),H),!z&&{onKeyDown:Pe(F,m),onClick:Pe(O,x)},B)},[s,w,M]),b=pe(function(V){s({type:Rl,selectedItem:V})},[s]),S=pe(function(V){s({type:Hl,selectedItem:V})},[s]),Z=pe(function(V){s({type:kl,selectedItems:V})},[s]),T=pe(function(V){s({type:Pl,activeIndex:V})},[s]),L=pe(function(){s({type:Tl})},[s]);return{getSelectedItemProps:v,getDropdownProps:R,addSelectedItem:b,removeSelectedItem:S,setSelectedItems:Z,setActiveIndex:T,reset:L,selectedItems:d,activeIndex:u}}var Vl=0,El=1,Dl=2,Ol=3,_l=4,Bl=5,Al=6,f4=Object.freeze({__proto__:null,FunctionAddItem:Al,TagClick:Vl,TagGroupKeyDownArrowLeft:El,TagGroupKeyDownArrowRight:Dl,TagGroupKeyDownBackspace:_l,TagGroupKeyDownDelete:Ol,TagRemoveClick:Bl});function p4(e,t,o){var r=o.type,a;switch(r){case Vl:a={activeIndex:o.index};break;case El:a={activeIndex:e.activeIndex===0?e.items.length-1:e.activeIndex-1};break;case Dl:a={activeIndex:e.activeIndex===e.items.length-1?0:e.activeIndex+1};break;case _l:case Ol:{var n=[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),l=n.length===0?-1:n.length===e.activeIndex?e.activeIndex-1:e.activeIndex;a={items:[].concat(e.items.slice(0,e.activeIndex),e.items.slice(e.activeIndex+1)),activeIndex:l};break}case Bl:{var i=[].concat(e.items.slice(0,o.index),e.items.slice(o.index+1)),s=i.length===0?-1:i.length===o.index?o.index-1:o.index;a={items:i,activeIndex:s}}break;case Al:{var u=[];o.index===void 0?u=[].concat(e.items,[o.item]):u=[].concat(e.items.slice(0,o.index),[o.item],e.items.slice(o.index));var d=e.activeIndex===-1?u.length-1:e.activeIndex;a={items:u,activeIndex:d};break}default:throw new Error("Invalid useTagGroup reducer action.")}return ne({},e,a)}var C4=ne({},ge),Bi=C4.useId,m4=typeof Bi=="function"?g4:h4;function g4(e){var t=e.id,o=e.tagGroupId,r=e.getTagId,a="downshift-"+Bi();t||(t=a);var n=ge.useMemo(function(){return{tagGroupId:o??t+"-tag-group",getTagId:r??function(l){return t+"-tag-"+l}}},[r,t,o]);return n}function h4(e){var t=e.id,o=e.getTagId,r=e.tagGroupId,a=ge.useRef(t??"downshift-"+ni()),n=a.current,l=ge.useMemo(function(){return{tagGroupId:r??n+"-tag-group",getTagId:o??function(i){return n+"-tag-"+i}}},[o,n,r]);return l}function v4(e){var t,o,r,a,n=(t=(o=e.items)!=null?o:e.initialItems)!=null?t:[],l=(r=(a=e.activeIndex)!=null?a:e.initialActiveIndex)!=null?r:n.length===0?-1:0;return{activeIndex:l,items:n}}function x4(e,t){return e.activeIndex===t.activeIndex&&e.items===t.items}var Ai="tag-group-a11y-description";function L4(e,t){ge.useEffect(function(){if(e){var o=e.createElement("div");return o.setAttribute("id",Ai),o.style.display="none",o.textContent=t,e.body.appendChild(o),function(){o.remove()}}},[t,e])}function w4(e){return ne({stateReducer:function(o,r){var a=r.changes;return a},environment:typeof window>"u"?void 0:window,removeElementDescription:"Press Delete or Backspace to remove tag."},e)}function I4(e,t,o){var r=ge.useRef({}),a=ge.useRef(e),n=ge.useRef(t);return ge.useEffect(function(){if(e!==-1&&a.current!==-1&&e!==a.current||n.current===t+1){var l;(l=r.current[o(e)])==null||l.focus()}a.current=e,n.current=t},[e,o,t]),r}var b4={isItemDisabled:te.default.func},y4=["onKeyDown"],M4=["index","refKey","ref","onClick"],S4=["index","onClick"],Zi=function(t){var o;t===void 0&&(t={}),Nn(t,Zi,b4);var r=w4(t),a=qn(p4,r,v4,x4),n=a[0],l=a[1],i=n.activeIndex,s=n.items,u=Eo({state:n,props:r}),d=m4({getTagId:r.getTagId,id:r.id,tagGroupId:r.tagGroupId});L4((o=r.environment)==null?void 0:o.document,r.removeElementDescription);var c=I4(i,s.length,d.getTagId),f=pe(function(h){var w=h??{},v=w.onKeyDown,R=s1(w,y4),b=function(T){switch(T.key){case"ArrowLeft":l({type:El});break;case"ArrowRight":l({type:Dl});break;case"Delete":l({type:Ol});break;case"Backspace":l({type:_l});break}},S=ne({id:d.tagGroupId,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions",role:"listbox",onKeyDown:Fn(v,b)},R);return S},[l,d.tagGroupId]),g=pe(function(h){var w,v=h.index,R=h.refKey,b=R===void 0?"ref":R,S=h.ref,Z=h.onClick,T=s1(h,M4);if(!Number.isInteger(v)||v<0)throw new Error("Pass correct item index to getTagProps!");var L=u.current.state,V=function(){l({type:Vl,index:v})},y=d.getTagId(v);return ne((w={"aria-describedby":Ai},w[b]=y7(S,function(H){H&&(c.current[y]=H)}),w["aria-labelledby"]=y,w.role="option",w.id=y,w.onClick=Fn(Z,V),w.tabIndex=L.activeIndex===v?0:-1,w),T)},[l,d,u,c]),p=pe(function(h){var w=h.index,v=h.onClick,R=s1(h,S4);if(!Number.isInteger(w)||w<0)throw new Error("Pass correct item index to getTagRemoveProps!");var b=function(L){L.stopPropagation(),l({type:Bl,index:w})},S=d.getTagId(w),Z=S+"-remove";return ne({id:Z,tabIndex:-1,"aria-labelledby":Z+" "+S,onClick:Fn(v,b)},R)},[d,l]),M=pe(function(h,w){l({type:Al,item:h,index:w})},[l]);return{activeIndex:i,addItem:M,getTagGroupProps:f,getTagProps:g,getTagRemoveProps:p,items:s}};Zi.stateChangeTypes=f4;import X1 from"react";import{createPortal as R4}from"react-dom";import{jsx as _t,jsxs as Zl}from"react/jsx-runtime";var H4=260,Yr=4;function k4(e){let t=e.getBoundingClientRect(),o=q1(e),r=o?o.getBoundingClientRect():{top:0,bottom:window.innerHeight},a=r.bottom-t.bottom-Yr,n=t.top-r.top-Yr,l=a<H4&&n>a;return{top:l?t.top-Yr:t.bottom+Yr,left:t.left,width:t.width,openAbove:l}}function Jr({label:e,options:t,dividerAfterValue:o,selectedItem:r,onChange:a,id:n="picklist",getOptionStyle:l,triggerLabel:i,triggerStyle:s}){let[u,d]=X1.useState({top:0,left:0,width:0,openAbove:!1}),c=X1.useRef(null),f=X1.useMemo(()=>{let y=new Map;return{document,Node:window.Node,addEventListener(H,q,K){let G=J=>{let F={target:J.composedPath()[0]??J.target};typeof q=="function"?q(F):q.handleEvent(F)};y.set(q,G),window.addEventListener(H,G,K)},removeEventListener(H,q,K){let G=y.get(q);G&&window.removeEventListener(H,G,K),y.delete(q)}}},[]),g=`${n}-legend`,{isOpen:p,closeMenu:M,highlightedIndex:h,getToggleButtonProps:w,getMenuProps:v,getItemProps:R}=Oo({environment:f,items:t,itemToString:y=>y?y.label:"",selectedItem:r,stateReducer:(y,{type:H,changes:q})=>H===Oo.stateChangeTypes.ToggleButtonBlur?{...q,selectedItem:y.selectedItem}:q,onSelectedItemChange:({selectedItem:y})=>{typeof a=="function"&&y&&y.value!==r?.value&&a(y.value)},onIsOpenChange:({isOpen:y})=>{y&&c.current&&d(k4(c.current))},id:n,labelId:g}),b=JSON.stringify(t.map(y=>y.value)),S=X1.useRef(b);X1.useLayoutEffect(()=>{S.current!==b&&M(),S.current=b},[b,M]),X1.useEffect(()=>{if(!p||!c.current)return;let y=q1(c.current);if(!y)return;let H=()=>M();return y.addEventListener("scroll",H,{passive:!0}),()=>y.removeEventListener("scroll",H)},[p,M]);let Z="picklistEditor-dropdown"+(p?" picklistEditor-dropdown--open":""),T=p?{top:u.top,left:u.left,width:u.width,...u.openAbove?{transform:"translateY(-100%)"}:void 0}:void 0,[L,V]=X1.useState(null);return X1.useLayoutEffect(()=>{let H=c.current?.getRootNode();V(H instanceof ShadowRoot?H:document.body)},[]),_t(m1,{label:e,id:n,className:"picklistEditor-fieldset",children:Zl("div",{className:"picklistEditor-wrapper",children:[Zl("button",{type:"button",className:"picklistEditor-trigger",style:s,...w({ref:c}),children:[_t("span",{className:"picklistEditor-trigger-label",children:i??r?.label??"Default"}),_t("span",{className:"picklistEditor-trigger-chevron","aria-hidden":"true",children:_t(Zo,{width:12,height:12,"aria-hidden":"true"})})]}),R4(_t("ul",{className:Z,style:T,...v(),children:p&&t.map((y,H)=>Zl(X1.Fragment,{children:[_t("li",{className:"picklistEditor-option"+(h===H?" picklistEditor-option--highlighted":"")+(r?.value===y.value?" picklistEditor-option--selected":""),style:l?l(y):void 0,...R({item:y,index:H}),children:y.label}),y.value===o&&_t("li",{className:"picklistEditor-divider",role:"presentation","aria-hidden":"true"})]},y.value))}),L??document.body)]})})}import{jsx as T4}from"react/jsx-runtime";var Fi=[{value:"Arial, sans-serif",label:"Arial"},{value:"Helvetica, sans-serif",label:"Helvetica"},{value:"Verdana, sans-serif",label:"Verdana"},{value:"Tahoma, sans-serif",label:"Tahoma"},{value:"'Trebuchet MS', sans-serif",label:"Trebuchet MS"},{value:"'Lucida Sans Unicode', sans-serif",label:"Lucida Sans"},{value:"Georgia, serif",label:"Georgia"},{value:"'Times New Roman', serif",label:"Times New Roman"},{value:"'Palatino Linotype', serif",label:"Palatino"},{value:"'Courier New', monospace",label:"Courier New"},{value:"'Lucida Console', monospace",label:"Lucida Console"}];function Fl(e){return(e.split(",")[0]??"").trim().replace(/['"]/g,"")}function $i(e,t){if(!e)return null;let o=Fl(e).toLowerCase();return o?t.find(r=>Fl(r.value).toLowerCase()===o)??null:null}function Ni(e){return $i(e,Fi)!==null}var P4=e=>e.value?{fontFamily:e.value}:void 0;function Ui({label:e="Font family",value:t,computedValue:o,options:r,onChange:a,matchOption:n=$i,id:l="font-family",useInheritLabel:i="Inherited"}){let s=r??Fi,u={value:"inherit",label:i},d=t==="inherit"?u:n(t,s),c=o??t,f=c==="inherit"?void 0:c,g=n(f,s),p="Default";g?p=g.label:f&&(p=Fl(f)||"Default");let M=f?{fontFamily:f}:void 0;return T4(Jr,{label:e,options:[u,...s],dividerAfterValue:"inherit",selectedItem:d,triggerLabel:p,triggerStyle:M,onChange:a,id:l,getOptionStyle:P4})}import{jsx as O4}from"react/jsx-runtime";var V4=[{value:"100",labelKey:"thin",defaultWord:"Thin"},{value:"200",labelKey:"extraLight",defaultWord:"Extra Light"},{value:"300",labelKey:"light",defaultWord:"Light"},{value:"400",labelKey:"regular",defaultWord:"Regular"},{value:"500",labelKey:"medium",defaultWord:"Medium"},{value:"600",labelKey:"semiBold",defaultWord:"Semi Bold"},{value:"700",labelKey:"bold",defaultWord:"Bold"},{value:"800",labelKey:"extraBold",defaultWord:"Extra Bold"},{value:"900",labelKey:"black",defaultWord:"Black"}];function E4(e){return V4.map(t=>{let o=e?.[t.labelKey]??t.defaultWord;return{value:t.value,label:o}})}function D4(e,t){if(!e)return null;let o=String(e).trim();return t.find(r=>r.value===o)??null}function qi({label:e="Font weight",value:t,computedValue:o,fontFamily:r,options:a,onChange:n,matchOption:l=D4,id:i="font-weight",useInheritLabel:s="Inherited",optionLabels:u}){let d=a??E4(u),c=!a&&Ni(r)?d.filter(v=>v.value==="400"||v.value==="700"):d,f={value:"inherit",label:s},g=t==="inherit"?f:l(t,c),p=o??t,M=p==="inherit"?void 0:p,w=l(M,d)?.label??(M||"Default");return O4(Jr,{label:e,options:[f,...c],dividerAfterValue:"inherit",selectedItem:g,triggerLabel:w,onChange:n,id:i})}import oe from"react";import{createPortal as B4}from"react-dom";import{jsx as zi,jsxs as _4}from"react/jsx-runtime";function ji({id:e,className:t,text:o}){return _4("p",{id:e,className:t?`fieldNotice ${t}`:"fieldNotice",children:[zi("svg",{className:"fieldNotice-icon",viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:zi("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"})}),o]})}import{Fragment as Ki,jsx as le,jsxs as Je}from"react/jsx-runtime";var A4={tabCms:"CMS",tabLocal:"Local",tabUrl:"URL",ariaTablist:"Image source",clearImage:"Clear image",chooseFile:"Choose File...",ariaChooseFile:"Choose an image file from your computer",ariaImageUrl:"Image URL",urlPlaceholder:"https://example.com/image.png",previewAlt:"Preview",altText:"Alt Text",altPlaceholder:"Describe the image",sourceFromData:"This image comes from data, so you can't edit it here.",sourceNotEditable:"You can't edit this image here.",altFromData:"This alt text comes from data, so you can't edit it here.",altNotEditable:"You can't edit this alt text here.",sourceShared:"This image is used {0} times on this page. Changing it changes all of them.",altShared:"This alt text is used on {0} images. Changing it changes all of them.",workspace:"Workspace",selectWorkspace:"Select a workspace...",selectImage:"Select an Image",loadingWorkspaces:"Loading workspaces...",noWorkspaces:"No CMS workspaces found",loadingImages:"Loading images...",noImages:"No images in this workspace",loadingMore:"Loading more...",untitled:"Untitled",downloadingImage:"Downloading image...",downloadFailed:"Download failed",closePicker:"Close",cancel:"Cancel",done:"Done",pickerTitle:"Select an image from {0}",pickerError:"Error: {0}"},no=["local","url"];function Z4({labels:e,workspaceName:t,folderId:o,portalTarget:r,folderItemsResult:a,contentDetail:n,thumbnailResult:l,onFetchFolderItems:i,onFetchContentDetail:s,onFetchThumbnail:u,onCancel:d,onConfirm:c}){let[f,g]=oe.useState([]),[p,M]=oe.useState(0),[h,w]=oe.useState(!0),[v,R]=oe.useState(!1),[b,S]=oe.useState(null),[Z,T]=oe.useState(null),[L,V]=oe.useState({}),[y,H]=oe.useState({}),q=oe.useRef(new Set),K=oe.useRef(new Set),G=oe.useCallback(z=>{v||typeof i=="function"&&(R(!0),S(null),i(o,z,20))},[o,v,i]);oe.useEffect(()=>{G(0)},[o]),oe.useEffect(()=>{let z=B=>{B.key==="Escape"&&(B.stopPropagation(),d())};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[d]);let J=oe.useRef(null);oe.useEffect(()=>{J.current?.focus()},[]),oe.useEffect(()=>{if(!a)return;let z=(a.items??[]).map(B=>({contentKey:B.contentKey,title:B.title??e.untitled,mimeType:B.mimeType??"image/png"}));g(B=>a.page===0?z:[...B,...z]),w(!!a.hasMore),M(a.page??0),R(!1),a.error&&S(String(a.error))},[a]),oe.useEffect(()=>{if(!n)return;let z=n.contentKey;if(!z||n.error)return;let B=n.url??"",j=n.mimeType??"image/png",P=n.title??"";V(W=>W[z]?W:{...W,[z]:{url:B,mimeType:j,title:P}}),B&&!K.current.has(z)&&typeof u=="function"&&(K.current.add(z),u(z,B,j))},[n,u]),oe.useEffect(()=>{if(!l)return;let{imageId:z,thumbnailUrl:B}=l;z&&B&&H(j=>({...j,[z]:B}))},[l]);let F=oe.useRef(null);oe.useEffect(()=>{let z=F.current;if(!z||!h||v)return;let B=new IntersectionObserver(j=>{j.some(W=>W.isIntersecting)&&G(p+1)});return B.observe(z),()=>B.disconnect()},[h,v,p,G]);let O=oe.useCallback(z=>{q.current.has(z)||typeof s=="function"&&(q.current.add(z),s(z))},[s]),A=()=>{if(!Z)return;let z=L[Z],B=f.find(j=>j.contentKey===Z);!z||!B||c({contentKey:Z,title:B.title,url:z.url,mimeType:z.mimeType||B.mimeType})};return B4(le("div",{ref:J,tabIndex:-1,className:"cmsPicker-overlay",role:"dialog","aria-modal":"true","aria-label":Re(e.pickerTitle,[t]),onClick:z=>{z.target===z.currentTarget&&d()},children:Je("div",{className:"cmsPicker-dialog",children:[Je("div",{className:"cmsPicker-header",children:[le("span",{className:"cmsPicker-title",children:Re(e.pickerTitle,[t])}),le("button",{type:"button",className:"cmsPicker-close",onClick:d,"aria-label":e.closePicker,title:e.closePicker,children:"\u2715"})]}),Je("div",{className:"cmsPicker-body",children:[f.length===0&&v&&le("div",{className:"cmsPicker-empty",children:e.loadingImages}),f.length===0&&!v&&!b&&le("div",{className:"cmsPicker-empty",children:e.noImages}),b&&le("div",{className:"cmsPicker-empty",children:Re(e.pickerError,[b])}),Je("div",{className:"cmsPicker-grid",children:[f.map(z=>le(F4,{item:z,selected:Z===z.contentKey,thumbnailDataUrl:y[z.contentKey],onIntersect:()=>O(z.contentKey),onClick:()=>T(z.contentKey)},z.contentKey)),h&&le("div",{className:"cmsPicker-sentinel",ref:F,children:v?e.loadingMore:""})]})]}),Je("div",{className:"cmsPicker-footer",children:[le("button",{type:"button",className:"cmsPicker-btn",onClick:d,children:e.cancel}),le("button",{type:"button",className:"cmsPicker-btn cmsPicker-btn--primary",disabled:!Z||!L[Z??""],onClick:A,children:e.done})]})]})}),r)}function F4({item:e,selected:t,thumbnailDataUrl:o,onIntersect:r,onClick:a}){let n=oe.useRef(null),l=oe.useRef(!1);return oe.useEffect(()=>{let i=n.current;if(!i||l.current)return;let s=new IntersectionObserver(u=>{u.some(c=>c.isIntersecting)&&!l.current&&(l.current=!0,r(),s.disconnect())});return s.observe(i),()=>s.disconnect()},[r]),Je("button",{ref:n,type:"button",className:`cmsPicker-thumb${t?" cmsPicker-thumb--selected":""}`,onClick:a,title:e.title,"aria-pressed":t,children:[le("div",{className:"cmsPicker-thumb-img",children:o?le("img",{src:o,alt:e.title}):le("div",{className:"cmsPicker-thumb-placeholder","aria-hidden":"true",children:"\u2026"})}),le("span",{className:"cmsPicker-thumb-label",children:e.title})]})}function $4({labels:e,spaces:t,spacesLoading:o,selectedSpaceId:r,onSpaceSelect:a,onOpenPicker:n}){return o?le("div",{className:"imageEditor-cms",children:le("div",{className:"imageEditor-cms-loading",children:e.loadingWorkspaces})}):t.length===0?le("div",{className:"imageEditor-cms",children:le("div",{className:"imageEditor-cms-empty",children:e.noWorkspaces})}):Je("div",{className:"imageEditor-cms",children:[Je("div",{className:"imageEditor-cms-channel",children:[le("label",{className:"imageEditor-cms-channel-label",htmlFor:"cms-space-select",children:e.workspace}),Je("select",{id:"cms-space-select",className:"imageEditor-input imageEditor-cms-channel-select",value:r,onChange:l=>a(l.target.value),children:[le("option",{value:"",children:e.selectWorkspace}),t.map(l=>le("option",{value:l.id,children:l.name},l.id))]})]}),le("button",{type:"button",className:"imageEditor-cms-pick-btn",onClick:n,disabled:!r,children:e.selectImage})]})}function N4({labels:e,onPick:t}){return le("div",{className:"imageEditor-local",children:le("button",{className:"imageEditor-local-pick",onClick:t,type:"button","aria-label":e.ariaChooseFile,"aria-haspopup":"dialog",children:e.chooseFile})})}function Gi({src:e,alt:t,className:o}){let[r,a]=oe.useState(!1);return oe.useEffect(()=>{a(!1)},[e]),r?null:le("img",{src:e,alt:t,className:o,onError:()=>a(!0)})}function U4({labels:e,input:t,onInputChange:o,onApply:r,currentUrl:a}){return Je("div",{className:"imageEditor-url",children:[le("input",{type:"text",value:t,"aria-label":e.ariaImageUrl,placeholder:e.urlPlaceholder,className:"imageEditor-input",onChange:n=>o(n.target.value),onKeyDown:n=>{n.key==="Enter"&&t&&r(t)},onBlur:()=>{t&&t!==a&&r(t)}}),t&&le("div",{className:"imageEditor-url-preview",children:le(Gi,{src:t,alt:e.previewAlt,className:"imageEditor-preview-thumb"})})]})}function q4({id:e,label:t,value:o,placeholder:r,readOnly:a,describedBy:n,onCommit:l}){let[i,s]=oe.useState(o),u=oe.useRef(l);u.current=l;let d=oe.useRef(o);oe.useEffect(()=>{o!==d.current&&(d.current=o,s(o))},[o]);let c=()=>{!a&&i!==o&&(d.current=i,u.current(i))};return Je("div",{className:"imageEditor-attr",children:[le("label",{className:"imageEditor-attr-label",htmlFor:e,children:t}),le("input",{id:e,type:"text",value:i,placeholder:r,className:"imageEditor-input",disabled:a,"aria-describedby":n,onChange:f=>s(f.target.value),onKeyDown:f=>{f.key==="Enter"&&c()},onBlur:c})]})}function z4({labels:e,attributes:t,altReadOnly:o,describedBy:r,onAttributeChange:a}){return le("div",{className:"imageEditor-attrs",children:le(q4,{id:"design-img-alt",label:e.altText,value:t.alt,placeholder:e.altPlaceholder,readOnly:o,describedBy:r,onCommit:n=>a("alt",n)})})}function $l({label:e,value:t,onChange:o,id:r="image",attributes:a,onAttributeChange:n,sourceReadOnly:l,altReadOnly:i,sharedCount:s,cmsSpaces:u,cmsSpacesLoading:d,onFetchCmsSpaces:c,cmsFolderItemsResult:f,onFetchCmsFolderItems:g,cmsContentDetail:p,onFetchCmsContentDetail:M,cmsThumbnailResult:h,onFetchCmsThumbnail:w,onImportCmsImage:v,cmsImportResult:R,onPickLocalFile:b,localPreview:S,imageLabels:Z}){let T=M1(A4,Z),L=!!(a&&n),V=L&&!!i,y=l&&(l==="from-data"?T.sourceFromData:T.sourceNotEditable),H=V&&(i==="from-data"?T.altFromData:T.altNotEditable),q=s!==void 0&&s>1?s:void 0,K=q===void 0?void 0:l?L&&!V?Re(T.altShared,[q]):void 0:Re(T.sourceShared,[q]),G=[y||H,K].filter(Boolean).join(" ")||void 0,J=`${r}-notice`,F={cms:T.tabCms,local:T.tabLocal,url:T.tabUrl},[O,A]=oe.useState("local"),[z,B]=oe.useState(""),[j,P]=oe.useState(!1),W=oe.useRef(o);W.current=o;let m=oe.useRef(t);m.current=t;let x=oe.useRef(!!l);x.current=!!l;let k=oe.useRef(S);oe.useEffect(()=>{if(!S||S===k.current||(k.current=S,x.current))return;let re=S.devUrl||S.webviewUri;re&&re!==m.current&&W.current(re)},[S]);let C=re=>re?.startsWith("data:")?"":re??"",[$,N]=oe.useState(()=>C(t)),U=oe.useRef(t??"");oe.useEffect(()=>{let re=t??"";re!==U.current&&(U.current=re,N(C(re)))},[t]);let[I,E]=oe.useState("idle"),ee=oe.useRef(null),ce=oe.useRef(null),Ce=oe.useCallback(()=>{let re=ce.current?.getRootNode();return re instanceof ShadowRoot?re:document.body},[]),we=oe.useRef({}),e1=oe.useCallback(re=>{A(re),we.current[re]?.focus()},[]),Ie=oe.useCallback((re,Ge)=>{let He=null;switch(re.key){case"ArrowRight":He=(Ge+1)%no.length;break;case"ArrowLeft":He=(Ge-1+no.length)%no.length;break;case"Home":He=0;break;case"End":He=no.length-1;break;default:return}re.preventDefault();let C1=no[He];C1&&e1(C1)},[e1]),Te=u??[],Oe=d??!1,Se=t||"";oe.useEffect(()=>{if(R){if(x.current){E("idle");return}if(R.success&&R.devUrl)o(R.devUrl),E("success");else{let re=ee.current?.url;re?(o(re),E("success")):E("error")}}},[R,o]),oe.useEffect(()=>{O==="cms"&&Te.length===0&&!Oe&&typeof c=="function"&&c()},[O]);let b1=oe.useMemo(()=>Te.find(re=>re.id===z)??null,[Te,z]),Ne=oe.useCallback(re=>{if(x.current){P(!1);return}let Ge={id:re.contentKey,title:re.title,url:re.url,thumbnailUrl:"",contentType:re.mimeType};ee.current=Ge,P(!1),typeof v=="function"&&Ge.url?(E("importing"),v(Ge)):Ge.url&&o(Ge.url)},[o,v]),_e=le(m1,{label:e,id:r,className:"imageEditor-fieldset",children:Je("div",{ref:ce,className:"imageEditor-root",children:[Se&&Je("div",{className:`imageEditor-current${l?" imageEditor-current--readonly":""}`,children:[le(Gi,{src:Se,alt:"",className:"imageEditor-current-thumb"}),le("span",{className:"imageEditor-current-url",title:Se,children:Se.length>30?`...${Se.slice(-30)}`:Se}),!l&&le("button",{className:"imageEditor-clear",onClick:()=>o(""),title:T.clearImage,"aria-label":T.clearImage,type:"button",children:"\u2715"})]}),!l&&Je(Ki,{children:[le("div",{className:"imageEditor-tabs",role:"tablist","aria-label":T.ariaTablist,"aria-describedby":K?J:void 0,children:no.map((re,Ge)=>le("button",{id:`${r}-tab-${re}`,ref:He=>{we.current[re]=He},role:"tab",type:"button","aria-selected":O===re,"aria-controls":`${r}-tabpanel`,tabIndex:O===re?0:-1,className:`imageEditor-tab${O===re?" imageEditor-tab--active":""}`,onClick:()=>A(re),onKeyDown:He=>Ie(He,Ge),children:F[re]},re))}),Je("div",{className:"imageEditor-tab-content",role:"tabpanel",id:`${r}-tabpanel`,"aria-labelledby":`${r}-tab-${O}`,children:[O==="cms"&&le($4,{labels:T,spaces:Te,spacesLoading:Oe,selectedSpaceId:z,onSpaceSelect:B,onOpenPicker:()=>P(!0)}),O==="cms"&&I==="importing"&&le("div",{className:"imageEditor-cms-loading",children:T.downloadingImage}),O==="cms"&&I==="error"&&le("div",{className:"imageEditor-cms-empty",children:T.downloadFailed}),O==="local"&&le(N4,{labels:T,onPick:()=>b?.()}),O==="url"&&le(U4,{labels:T,input:$,onInputChange:N,onApply:re=>{U.current=re,o(re)},currentUrl:Se})]})]}),a&&n&&le(z4,{labels:T,attributes:a,altReadOnly:!!i,describedBy:G&&(i||K)?J:void 0,onAttributeChange:n}),j&&b1&&le(Z4,{labels:T,workspaceName:b1.name,folderId:b1.rootFolderId,portalTarget:Ce(),folderItemsResult:f,contentDetail:p,thumbnailResult:h,onFetchFolderItems:g,onFetchContentDetail:M,onFetchThumbnail:w,onCancel:()=>P(!1),onConfirm:Ne})]})});return Je(Ki,{children:[G&&le(ji,{id:J,className:"imageEditor-notice",text:G}),_e]})}import P1 from"react";import*as Q1 from"react";import{jsx as j4}from"react/jsx-runtime";function lo(e,t=[]){let o=[];function r(n,l){let i=Q1.createContext(l),s=o.length;o=[...o,l];let u=c=>{let{scope:f,children:g,...p}=c,M=f?.[e]?.[s]||i,h=Q1.useMemo(()=>p,Object.values(p));return j4(M.Provider,{value:h,children:g})};u.displayName=n+"Provider";function d(c,f){let g=f?.[e]?.[s]||i,p=Q1.useContext(g);if(p)return p;if(l!==void 0)return l;throw new Error(`\`${c}\` must be used within \`${n}\``)}return[u,d]}let a=()=>{let n=o.map(l=>Q1.createContext(l));return function(i){let s=i?.[e]||n;return Q1.useMemo(()=>({[`__scope${e}`]:{...i,[e]:s}}),[i,s])}};return a.scopeName=e,[r,K4(a,...t)]}function K4(...e){let t=e[0];if(e.length===1)return t;let o=()=>{let r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(n){let l=r.reduce((i,{useScope:s,scopeName:u})=>{let c=s(n)[`__scope${u}`];return{...i,...c}},{});return Q1.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return o.scopeName=t.scopeName,o}import*as Ji from"react";import*as ec from"react-dom";import*as Ae from"react";import*as G4 from"react";function Wi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Xi(...e){return t=>{let o=!1,r=e.map(a=>{let n=Wi(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():Wi(e[a],null)}}}}import{Fragment as HI,jsx as Qi}from"react/jsx-runtime";function Yi(e){let t=W4(e),o=Ae.forwardRef((r,a)=>{let{children:n,...l}=r,i=Ae.Children.toArray(n),s=i.find(Q4);if(s){let u=s.props.children,d=i.map(c=>c===s?Ae.Children.count(u)>1?Ae.Children.only(null):Ae.isValidElement(u)?u.props.children:null:c);return Qi(t,{...l,ref:a,children:Ae.isValidElement(u)?Ae.cloneElement(u,void 0,d):null})}return Qi(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function W4(e){let t=Ae.forwardRef((o,r)=>{let{children:a,...n}=o;if(Ae.isValidElement(a)){let l=J4(a),i=Y4(n,a.props);return a.type!==Ae.Fragment&&(i.ref=r?Xi(r,l):l),Ae.cloneElement(a,i)}return Ae.Children.count(a)>1?Ae.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var X4=Symbol("radix.slottable");function Q4(e){return Ae.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===X4}function Y4(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function J4(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}import{jsx as tc}from"react/jsx-runtime";var oc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Nl=oc.reduce((e,t)=>{let o=Yi(`Primitive.${t}`),r=Ji.forwardRef((a,n)=>{let{asChild:l,...i}=a,s=l?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),tc(s,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});import*as je from"react";var EI=!!(typeof window<"u"&&window.document&&window.document.createElement);function Y1(e,t,{checkForDefaultPrevented:o=!0}={}){return function(a){if(e?.(a),o===!1||!a.defaultPrevented)return t?.(a)}}import Bt from"react";import*as t5 from"react";function e5(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Ul(...e){return t=>{let o=!1,r=e.map(a=>{let n=e5(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():e5(e[a],null)}}}}function ql(...e){return t5.useCallback(Ul(...e),e)}import*as Ze from"react";import{Fragment as AI,jsx as o5}from"react/jsx-runtime";function zl(e){let t=rc(e),o=Ze.forwardRef((r,a)=>{let{children:n,...l}=r,i=Ze.Children.toArray(n),s=i.find(nc);if(s){let u=s.props.children,d=i.map(c=>c===s?Ze.Children.count(u)>1?Ze.Children.only(null):Ze.isValidElement(u)?u.props.children:null:c);return o5(t,{...l,ref:a,children:Ze.isValidElement(u)?Ze.cloneElement(u,void 0,d):null})}return o5(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function rc(e){let t=Ze.forwardRef((o,r)=>{let{children:a,...n}=o;if(Ze.isValidElement(a)){let l=ic(a),i=lc(n,a.props);return a.type!==Ze.Fragment&&(i.ref=r?Ul(r,l):l),Ze.cloneElement(a,i)}return Ze.Children.count(a)>1?Ze.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ac=Symbol("radix.slottable");function nc(e){return Ze.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ac}function lc(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function ic(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}import{jsx as jl}from"react/jsx-runtime";import WI from"react";import{jsx as QI}from"react/jsx-runtime";function r5(e){let t=e+"CollectionProvider",[o,r]=lo(t),[a,n]=o(t,{collectionRef:{current:null},itemMap:new Map}),l=M=>{let{scope:h,children:w}=M,v=Bt.useRef(null),R=Bt.useRef(new Map).current;return jl(a,{scope:h,itemMap:R,collectionRef:v,children:w})};l.displayName=t;let i=e+"CollectionSlot",s=zl(i),u=Bt.forwardRef((M,h)=>{let{scope:w,children:v}=M,R=n(i,w),b=ql(h,R.collectionRef);return jl(s,{ref:b,children:v})});u.displayName=i;let d=e+"CollectionItemSlot",c="data-radix-collection-item",f=zl(d),g=Bt.forwardRef((M,h)=>{let{scope:w,children:v,...R}=M,b=Bt.useRef(null),S=ql(h,b),Z=n(d,w);return Bt.useEffect(()=>(Z.itemMap.set(b,{ref:b,...R}),()=>{Z.itemMap.delete(b)})),jl(f,{[c]:"",ref:S,children:v})});g.displayName=d;function p(M){let h=n(e+"CollectionConsumer",M);return Bt.useCallback(()=>{let v=h.collectionRef.current;if(!v)return[];let R=Array.from(v.querySelectorAll(`[${c}]`));return Array.from(h.itemMap.values()).sort((Z,T)=>R.indexOf(Z.ref.current)-R.indexOf(T.ref.current))},[h.collectionRef,h.itemMap])}return[{Provider:l,Slot:u,ItemSlot:g},p,r]}import*as n5 from"react";function a5(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Kl(...e){return t=>{let o=!1,r=e.map(a=>{let n=a5(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():a5(e[a],null)}}}}function l5(...e){return n5.useCallback(Kl(...e),e)}import*as Gl from"react";import*as i5 from"react";var ea=globalThis?.document?i5.useLayoutEffect:()=>{};var sc=Gl[" useId ".trim().toString()]||(()=>{}),uc=0;function s5(e){let[t,o]=Gl.useState(sc());return ea(()=>{e||o(r=>r??String(uc++))},[e]),e||(t?`radix-${t}`:"")}import*as c5 from"react";import*as mc from"react-dom";import*as Fe from"react";import{Fragment as lb,jsx as u5}from"react/jsx-runtime";function d5(e){let t=dc(e),o=Fe.forwardRef((r,a)=>{let{children:n,...l}=r,i=Fe.Children.toArray(n),s=i.find(fc);if(s){let u=s.props.children,d=i.map(c=>c===s?Fe.Children.count(u)>1?Fe.Children.only(null):Fe.isValidElement(u)?u.props.children:null:c);return u5(t,{...l,ref:a,children:Fe.isValidElement(u)?Fe.cloneElement(u,void 0,d):null})}return u5(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function dc(e){let t=Fe.forwardRef((o,r)=>{let{children:a,...n}=o;if(Fe.isValidElement(a)){let l=Cc(a),i=pc(n,a.props);return a.type!==Fe.Fragment&&(i.ref=r?Kl(r,l):l),Fe.cloneElement(a,i)}return Fe.Children.count(a)>1?Fe.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var cc=Symbol("radix.slottable");function fc(e){return Fe.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===cc}function pc(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function Cc(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}import{jsx as gc}from"react/jsx-runtime";var hc=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wl=hc.reduce((e,t)=>{let o=d5(`Primitive.${t}`),r=c5.forwardRef((a,n)=>{let{asChild:l,...i}=a,s=l?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),gc(s,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});import*as io from"react";function f5(e){let t=io.useRef(e);return io.useEffect(()=>{t.current=e}),io.useMemo(()=>(...o)=>t.current?.(...o),[])}import*as I1 from"react";import*as ta from"react";var vc=I1[" useInsertionEffect ".trim().toString()]||ea;function At({prop:e,defaultProp:t,onChange:o=()=>{},caller:r}){let[a,n,l]=xc({defaultProp:t,onChange:o}),i=e!==void 0,s=i?e:a;{let d=I1.useRef(e!==void 0);I1.useEffect(()=>{let c=d.current;c!==i&&console.warn(`${r} is changing from ${c?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=i},[i,r])}let u=I1.useCallback(d=>{if(i){let c=Lc(d)?d(e):d;c!==e&&l.current?.(c)}else n(d)},[i,e,n,l]);return[s,u]}function xc({defaultProp:e,onChange:t}){let[o,r]=I1.useState(e),a=I1.useRef(o),n=I1.useRef(t);return vc(()=>{n.current=t},[t]),I1.useEffect(()=>{a.current!==o&&(n.current?.(o),a.current=o)},[o,a]),[o,r,n]}function Lc(e){return typeof e=="function"}import*as oa from"react";import{jsx as mb}from"react/jsx-runtime";var wc=oa.createContext(void 0);function ra(e){let t=oa.useContext(wc);return e||t||"ltr"}import{jsx as Zt}from"react/jsx-runtime";var Xl="rovingFocusGroup.onEntryFocus",Ic={bubbles:!1,cancelable:!0},_o="RovingFocusGroup",[Ql,p5,bc]=r5(_o),[yc,Yl]=lo(_o,[bc]),[Mc,Sc]=yc(_o),C5=je.forwardRef((e,t)=>Zt(Ql.Provider,{scope:e.__scopeRovingFocusGroup,children:Zt(Ql.Slot,{scope:e.__scopeRovingFocusGroup,children:Zt(Rc,{...e,ref:t})})}));C5.displayName=_o;var Rc=je.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:o,orientation:r,loop:a=!1,dir:n,currentTabStopId:l,defaultCurrentTabStopId:i,onCurrentTabStopIdChange:s,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...c}=e,f=je.useRef(null),g=l5(t,f),p=ra(n),[M,h]=At({prop:l,defaultProp:i??null,onChange:s,caller:_o}),[w,v]=je.useState(!1),R=f5(u),b=p5(o),S=je.useRef(!1),[Z,T]=je.useState(0);return je.useEffect(()=>{let L=f.current;if(L)return L.addEventListener(Xl,R),()=>L.removeEventListener(Xl,R)},[R]),Zt(Mc,{scope:o,orientation:r,dir:p,loop:a,currentTabStopId:M,onItemFocus:je.useCallback(L=>h(L),[h]),onItemShiftTab:je.useCallback(()=>v(!0),[]),onFocusableItemAdd:je.useCallback(()=>T(L=>L+1),[]),onFocusableItemRemove:je.useCallback(()=>T(L=>L-1),[]),children:Zt(Wl.div,{tabIndex:w||Z===0?-1:0,"data-orientation":r,...c,ref:g,style:{outline:"none",...e.style},onMouseDown:Y1(e.onMouseDown,()=>{S.current=!0}),onFocus:Y1(e.onFocus,L=>{let V=!S.current;if(L.target===L.currentTarget&&V&&!w){let y=new CustomEvent(Xl,Ic);if(L.currentTarget.dispatchEvent(y),!y.defaultPrevented){let H=b().filter(F=>F.focusable),q=H.find(F=>F.active),K=H.find(F=>F.id===M),J=[q,K,...H].filter(Boolean).map(F=>F.ref.current);h5(J,d)}}S.current=!1}),onBlur:Y1(e.onBlur,()=>v(!1))})})}),m5="RovingFocusGroupItem",g5=je.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:o,focusable:r=!0,active:a=!1,tabStopId:n,children:l,...i}=e,s=s5(),u=n||s,d=Sc(m5,o),c=d.currentTabStopId===u,f=p5(o),{onFocusableItemAdd:g,onFocusableItemRemove:p,currentTabStopId:M}=d;return je.useEffect(()=>{if(r)return g(),()=>p()},[r,g,p]),Zt(Ql.ItemSlot,{scope:o,id:u,focusable:r,active:a,children:Zt(Wl.span,{tabIndex:c?0:-1,"data-orientation":d.orientation,...i,ref:t,onMouseDown:Y1(e.onMouseDown,h=>{r?d.onItemFocus(u):h.preventDefault()}),onFocus:Y1(e.onFocus,()=>d.onItemFocus(u)),onKeyDown:Y1(e.onKeyDown,h=>{if(h.key==="Tab"&&h.shiftKey){d.onItemShiftTab();return}if(h.target!==h.currentTarget)return;let w=Pc(h,d.orientation,d.dir);if(w!==void 0){if(h.metaKey||h.ctrlKey||h.altKey||h.shiftKey)return;h.preventDefault();let R=f().filter(b=>b.focusable).map(b=>b.ref.current);if(w==="last")R.reverse();else if(w==="prev"||w==="next"){w==="prev"&&R.reverse();let b=R.indexOf(h.currentTarget);R=d.loop?Tc(R,b+1):R.slice(b+1)}setTimeout(()=>h5(R))}}),children:typeof l=="function"?l({isCurrentTabStop:c,hasTabStop:M!=null}):l})})});g5.displayName=m5;var Hc={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function kc(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function Pc(e,t,o){let r=kc(e.key,o);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Hc[r]}function h5(e,t=!1){let o=document.activeElement;for(let r of e)if(r===o||(r.focus({preventScroll:t}),document.activeElement!==o))return}function Tc(e,t){return e.map((o,r)=>e[(t+r)%e.length])}var v5=C5,x5=g5;import*as S5 from"react";import*as y5 from"react";import*as Zc from"react-dom";import*as $e from"react";import*as Ec from"react";function L5(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function w5(...e){return t=>{let o=!1,r=e.map(a=>{let n=L5(a,t);return!o&&typeof n=="function"&&(o=!0),n});if(o)return()=>{for(let a=0;a<r.length;a++){let n=r[a];typeof n=="function"?n():L5(e[a],null)}}}}import{Fragment as Pb,jsx as I5}from"react/jsx-runtime";function b5(e){let t=Dc(e),o=$e.forwardRef((r,a)=>{let{children:n,...l}=r,i=$e.Children.toArray(n),s=i.find(_c);if(s){let u=s.props.children,d=i.map(c=>c===s?$e.Children.count(u)>1?$e.Children.only(null):$e.isValidElement(u)?u.props.children:null:c);return I5(t,{...l,ref:a,children:$e.isValidElement(u)?$e.cloneElement(u,void 0,d):null})}return I5(t,{...l,ref:a,children:n})});return o.displayName=`${e}.Slot`,o}function Dc(e){let t=$e.forwardRef((o,r)=>{let{children:a,...n}=o;if($e.isValidElement(a)){let l=Ac(a),i=Bc(n,a.props);return a.type!==$e.Fragment&&(i.ref=r?w5(r,l):l),$e.cloneElement(a,i)}return $e.Children.count(a)>1?$e.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oc=Symbol("radix.slottable");function _c(e){return $e.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oc}function Bc(e,t){let o={...t};for(let r in t){let a=e[r],n=t[r];/^on[A-Z]/.test(r)?a&&n?o[r]=(...i)=>{let s=n(...i);return a(...i),s}:a&&(o[r]=a):r==="style"?o[r]={...a,...n}:r==="className"&&(o[r]=[a,n].filter(Boolean).join(" "))}return{...e,...o}}function Ac(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning;return o?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}import{jsx as Fc}from"react/jsx-runtime";var $c=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],M5=$c.reduce((e,t)=>{let o=b5(`Primitive.${t}`),r=y5.forwardRef((a,n)=>{let{asChild:l,...i}=a,s=l?o:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),Fc(s,{...i,ref:n})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});import{jsx as Nc}from"react/jsx-runtime";var R5="Toggle",Jl=S5.forwardRef((e,t)=>{let{pressed:o,defaultPressed:r,onPressedChange:a,...n}=e,[l,i]=At({prop:o,onChange:a,defaultProp:r??!1,caller:R5});return Nc(M5.button,{type:"button","aria-pressed":l,"data-state":l?"on":"off","data-disabled":e.disabled?"":void 0,...n,ref:t,onClick:Y1(e.onClick,()=>{e.disabled||i(!l)})})});Jl.displayName=R5;import{jsx as d1}from"react/jsx-runtime";var It="ToggleGroup",[k5,Gb]=lo(It,[Yl]),P5=Yl(),e2=P1.forwardRef((e,t)=>{let{type:o,...r}=e;if(o==="single")return d1(Uc,{...r,ref:t});if(o==="multiple")return d1(qc,{...r,ref:t});throw new Error(`Missing prop \`type\` expected on \`${It}\``)});e2.displayName=It;var[T5,V5]=k5(It),Uc=P1.forwardRef((e,t)=>{let{value:o,defaultValue:r,onValueChange:a=()=>{},...n}=e,[l,i]=At({prop:o,defaultProp:r??"",onChange:a,caller:It});return d1(T5,{scope:e.__scopeToggleGroup,type:"single",value:P1.useMemo(()=>l?[l]:[],[l]),onItemActivate:i,onItemDeactivate:P1.useCallback(()=>i(""),[i]),children:d1(E5,{...n,ref:t})})}),qc=P1.forwardRef((e,t)=>{let{value:o,defaultValue:r,onValueChange:a=()=>{},...n}=e,[l,i]=At({prop:o,defaultProp:r??[],onChange:a,caller:It}),s=P1.useCallback(d=>i((c=[])=>[...c,d]),[i]),u=P1.useCallback(d=>i((c=[])=>c.filter(f=>f!==d)),[i]);return d1(T5,{scope:e.__scopeToggleGroup,type:"multiple",value:l,onItemActivate:s,onItemDeactivate:u,children:d1(E5,{...n,ref:t})})});e2.displayName=It;var[zc,jc]=k5(It),E5=P1.forwardRef((e,t)=>{let{__scopeToggleGroup:o,disabled:r=!1,rovingFocus:a=!0,orientation:n,dir:l,loop:i=!0,...s}=e,u=P5(o),d=ra(l),c={role:"group",dir:d,...s};return d1(zc,{scope:o,rovingFocus:a,disabled:r,children:a?d1(v5,{asChild:!0,...u,orientation:n,dir:d,loop:i,children:d1(Nl.div,{...c,ref:t})}):d1(Nl.div,{...c,ref:t})})}),aa="ToggleGroupItem",D5=P1.forwardRef((e,t)=>{let o=V5(aa,e.__scopeToggleGroup),r=jc(aa,e.__scopeToggleGroup),a=P5(e.__scopeToggleGroup),n=o.value.includes(e.value),l=r.disabled||e.disabled,i={...e,pressed:n,disabled:l},s=P1.useRef(null);return r.rovingFocus?d1(x5,{asChild:!0,...a,focusable:!l,active:n,ref:s,children:d1(H5,{...i,ref:t})}):d1(H5,{...i,ref:t})});D5.displayName=aa;var H5=P1.forwardRef((e,t)=>{let{__scopeToggleGroup:o,value:r,...a}=e,n=V5(aa,o),l={role:"radio","aria-checked":e.pressed,"aria-pressed":void 0},i=n.type==="single"?l:void 0;return d1(Jl,{...i,...a,ref:t,onPressedChange:s=>{s?n.onItemActivate(r):n.onItemDeactivate(r)}})}),t2=e2,O5=D5;import{jsx as na}from"react/jsx-runtime";function la(e){let t=e.options.map(o=>na(O5,{value:o.value,className:"buttonGroupEditor-item","aria-label":o.label,title:o.label,children:o.icon??o.label},o.value));return na(m1,{label:e.label,id:e.id,children:e.type==="single"?na(t2,{type:"single",value:e.value,onValueChange:o=>{o&&e.onChange(o)},className:"buttonGroupEditor-root","aria-label":e.label,children:t}):na(t2,{type:"multiple",value:e.value,onValueChange:e.onChange,className:"buttonGroupEditor-root",children:t})})}import{jsx as _5}from"react/jsx-runtime";var Gc={uppercase:"M3.04 8.96L3.04 1.96L0.50 1.96L0.50 0.50L7.34 0.50L7.34 1.96L4.81 1.96L4.81 8.96ZM11.20 8.96L11.20 1.96L8.66 1.96L8.66 0.50L15.51 0.50L15.51 1.96L12.97 1.96L12.97 8.96Z",italic:"M380 123v-13a20 20 0 0 0-20-20H220a20 20 0 0 0-20 20v20c0 11 9 20 20 20 17 0 30 16 26 32l-36 176a27 27 0 0 1-26 22h-24a20 20 0 0 0-20 20v20c0 11 9 20 20 20h140a20 20 0 0 0 20-20v-20a20 20 0 0 0-20-20c-17 0-30-16-26-32l36-176a27 27 0 0 1 26-22h17c15 0 27-12 27-27",underline:"M445 420H75c-8 0-15 7-15 15v30c0 8 7 15 15 15h370c8 0 15-7 15-15v-30c0-8-7-15-15-15m-192-40a143 143 0 0 1-133-144V100c0-11 9-20 20-20h20a20 20 0 0 1 20 20v137c0 43 32 80 75 83a80 80 0 0 0 85-80V100c0-11 9-20 20-20h20a20 20 0 0 1 20 20v140a140 140 0 0 1-147 140",left_align_text:"M480 65c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm-80 120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15zm0 240c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15zm80-120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15z",center_align_text:"M480 65c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm-60 120c0-8-7-15-15-15H115c-8 0-15 7-15 15v30c0 8 7 15 15 15h290c8 0 15-7 15-15zm-20 240c0-8-7-15-15-15H135c-8 0-15 7-15 15v30c0 8 7 15 15 15h250c8 0 15-7 15-15zm80-120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15z",right_align_text:"M465 50H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15V65c0-8-7-15-15-15m0 120H135c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15v-30c0-8-7-15-15-15m0 240H135c-8 0-15 7-15 15v30c0 8 7 15 15 15h330c8 0 15-7 15-15v-30c0-8-7-15-15-15m0-120H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15v-30c0-8-7-15-15-15",justify_text:"M480 65c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm0 120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm0 240c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15zm0-120c0-8-7-15-15-15H55c-8 0-15 7-15 15v30c0 8 7 15 15 15h410c8 0 15-7 15-15z"};function J1({name:e}){return _5("svg",{className:"slds-button__icon",width:e==="uppercase"?16.01:14,height:e==="uppercase"?9.46:14,viewBox:e==="uppercase"?"0 0 16.01 9.46":"0 0 520 520",fill:"currentColor","aria-hidden":"true",focusable:"false",children:_5("path",{d:Gc[e]})})}import{jsx as Bo}from"react/jsx-runtime";var Wc=[{value:"left",labelKey:"left",defaultLabel:"Left",icon:Bo(J1,{name:"left_align_text"})},{value:"center",labelKey:"center",defaultLabel:"Center",icon:Bo(J1,{name:"center_align_text"})},{value:"right",labelKey:"right",defaultLabel:"Right",icon:Bo(J1,{name:"right_align_text"})},{value:"justify",labelKey:"justify",defaultLabel:"Justify",icon:Bo(J1,{name:"justify_text"})}],Xc={start:"left",end:"right"};function B5({label:e="Text Align",value:t,onChange:o,id:r="text-align",optionLabels:a}){let n=Xc[t||""]||t||"left",l=Wc.map(i=>({value:i.value,label:a?.[i.labelKey]??i.defaultLabel,icon:i.icon}));return Bo(la,{type:"single",label:e,options:l,value:n,onChange:o,id:r})}import{jsx as ia}from"react/jsx-runtime";function A5({label:e="Text Styling",id:t="text-style",fontStyle:o,textDecoration:r,textTransform:a,onChange:n,optionLabels:l}){let i=[{property:"fontStyle",label:l?.italic??"Italic",pressed:o?.trim().toLowerCase()==="italic",on:"italic",off:"normal",icon:ia(J1,{name:"italic"})},{property:"textDecoration",label:l?.underline??"Underline",pressed:r?.trim().toLowerCase().split(/\s+/).includes("underline")??!1,on:"underline",off:"none",icon:ia(J1,{name:"underline"})},{property:"textTransform",label:l?.uppercase??"Uppercase",pressed:a?.trim().toLowerCase()==="uppercase",on:"uppercase",off:"none",icon:ia(J1,{name:"uppercase"})}];return ia(la,{type:"multiple",label:e,id:t,options:i.map(s=>({...s,value:s.property})),value:i.filter(s=>s.pressed).map(s=>s.property),onChange:s=>{for(let u of i){let d=s.includes(u.property);d!==u.pressed&&n(u.property,d?u.on:u.off)}}})}var Z5="textContent";var Qc=e=>e!=null&&typeof e=="object"&&"property"in e,Yc=e=>typeof e?.sourceFile=="string"&&e.sourceFile!==""&&e.lineNumber!=null&&e.columnNumber!=null?{sourceFile:e.sourceFile,lineNumber:e.lineNumber,columnNumber:e.columnNumber}:void 0;function F5(e){let t=[],o=new Map,r=n=>{let l=Yc(n);if(!l)return;let{sourceFile:i,lineNumber:s,columnNumber:u}=l,d=`${i}\0${s}:${u}`,c=o.get(d);return c||(c={byProperty:new Map,baselineByProperty:new Map,mediaByAttribute:new Map,debugSource:l},o.set(d,c),t.push(c)),c},a=(n,l,i)=>{n.baselineByProperty.has(l)||n.baselineByProperty.set(l,String(i??""))};for(let n of e){let l=n.data;if(n.type==="style"&&l?.property!=null){let i=r(l);if(i){let s=String(l.property);a(i,s,n.oldValue),i.byProperty.set(s,String(n.newValue??""))}}else if(n.type==="style-batch"&&Array.isArray(l?.changes)){let i=r(l);for(let s of l.changes)if(i&&Qc(s)&&s.property!=null){let u=String(s.property);a(i,u,s.oldValue),i.byProperty.set(u,String(s.newValue??""))}}else if(n.type==="text")r(l)?.byProperty.set(Z5,String(n.newValue??""));else if(n.type==="media"&&typeof l?.attribute=="string"&&l.attribute!==""){let i=r(l),s=String(n.newValue??""),u=i?.mediaByAttribute.get(l.attribute);u?u.value=s:i?.mediaByAttribute.set(l.attribute,{oldValue:String(n.oldValue??""),value:s})}}return t.map(n=>{let l=[...n.byProperty].map(([u,d])=>({property:u,value:d})).filter(u=>u.property===Z5||u.value!==""||n.baselineByProperty.get(u.property)!==""),i=[...n.mediaByAttribute].filter(([,u])=>u.value!==u.oldValue).map(([u,d])=>({changeType:"attribute",attribute:u,value:d.value,oldValue:d.oldValue})),s=[...l,...i];return{debugSource:n.debugSource,commands:s}}).filter(n=>n.commands.length>0)}var bt={CHANGED:"history-changed",COMMAND_PUSHED:"command-pushed",COMMAND_UNDONE:"command-undone",COMMAND_REDONE:"command-redone",CLEARED:"history-cleared"},sa=class{constructor(t={}){Ht(this,"undoStack",[]);Ht(this,"redoStack",[]);Ht(this,"maxHistorySize");Ht(this,"listeners",new Set);Ht(this,"_isProcessing",!1);Ht(this,"commandExecutor");if(this.maxHistorySize=t.maxHistorySize??200,!t.commandExecutor)throw new Error("CommandExecutor is required");this.commandExecutor=t.commandExecutor}createCommand(t,o,r,a){return Object.freeze({id:this._generateCommandId(),type:t,oldValue:o,newValue:r,data:a})}_generateCommandId(){return`cmd-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}subscribe(t){if(typeof t!="function")throw new Error("Listener must be a function");return this.listeners.add(t),()=>{this.listeners.delete(t)}}_notify(t,o={}){if(this.listeners.size===0)return;let r=Object.freeze({type:t,timestamp:Date.now(),canUndo:this.canUndo(),canRedo:this.canRedo(),undoCount:this.getUndoCount(),redoCount:this.getRedoCount(),...o}),a=Array.from(this.listeners);for(let n of a)try{n(r)}catch(l){console.error("[HistoryManager] Error in listener:",l)}}pushCommand(t){if(!t||typeof t!="object")throw new Error("Invalid command: must be an object");if(!t.type)throw new Error("Invalid command: missing required fields (type)");if(this._isProcessing){console.warn("[HistoryManager] pushCommand called during processing, ignoring");return}this.undoStack.length>=this.maxHistorySize||(this.undoStack.push(t),this.redoStack=[],this._notify(bt.COMMAND_PUSHED,{command:t}),this._notify(bt.CHANGED))}_trimStack(){if(this.undoStack.length>this.maxHistorySize){let t=this.undoStack.length-this.maxHistorySize;this.undoStack.splice(0,t)}}_applyCommand(t,o){if(!this.commandExecutor.canHandle(t.type))return console.warn("[HistoryManager] No executor for command type:",t.type),!1;try{return this.commandExecutor.execute(t,o)}catch(r){return console.error("[HistoryManager] Error applying command:",r,t),!1}}_createInverseCommand(t,o){let r=this.commandExecutor.getCurrentValue(t);return Object.freeze({id:this._generateCommandId(),type:t.type,oldValue:o?t.oldValue:r,newValue:o?r:t.newValue,data:t.data})}undo(){if(this._isProcessing)return console.warn("[HistoryManager] undo called during processing, ignoring"),!1;if(!this.canUndo())return!1;this._isProcessing=!0;try{let t=this.undoStack.pop(),o=this._applyCommand(t,!0);if(o){let r=this._createInverseCommand(t,!1);this.redoStack.push(r)}else this.undoStack.push(t),console.warn("[HistoryManager] Undo failed, command restored to stack");return this._notify(bt.COMMAND_UNDONE,{command:t,appliedValue:t.oldValue}),this._notify(bt.CHANGED),o}finally{this._isProcessing=!1}}redo(){if(this._isProcessing)return console.warn("[HistoryManager] redo called during processing, ignoring"),!1;if(!this.canRedo())return!1;this._isProcessing=!0;try{let t=this.redoStack.pop();if(!t)return console.warn("[HistoryManager] No command to redo"),!1;let o=this._applyCommand(t,!1);if(o){let r=this._createInverseCommand(t,!0);this.undoStack.push(r),this._trimStack()}else this.redoStack.push(t),console.warn("[HistoryManager] Redo failed, command restored to stack");return this._notify(bt.COMMAND_REDONE,{command:t,appliedValue:t.newValue}),this._notify(bt.CHANGED),o}finally{this._isProcessing=!1}}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}clear(){this.undoStack=[],this.redoStack=[],this._notify(bt.CLEARED),this._notify(bt.CHANGED)}getUndoCount(){return this.undoStack.length}getMaxHistorySize(){return this.maxHistorySize}getRedoCount(){return this.redoStack.length}getUndoStackSnapshot(){return this.undoStack.map(t=>({type:t.type,oldValue:t.oldValue,newValue:t.newValue,data:t.data}))}};var Jc=(e,t)=>{let o=t?e.oldValue:e.newValue;return typeof o=="string"?o:String(o??"")},ua=e=>{if(!e||typeof e!="object")return;let t=e;if(!(typeof t.sourceFile!="string"||typeof t.lineNumber!="number"||typeof t.columnNumber!="number"))return{sourceFile:t.sourceFile,lineNumber:t.lineNumber,columnNumber:t.columnNumber}},e8=e=>typeof e=="object"&&e!==null&&"property"in e&&typeof e.property=="string",t8=e=>typeof e=="object"&&e!==null&&Array.isArray(e.changes)&&e.changes.every(t=>t!=null&&typeof t.property=="string"),o8=e=>typeof e=="object"&&e!==null&&"tag"in e&&typeof e.tag=="string"&&"attribute"in e&&typeof e.attribute=="string",$5=(e,t,o)=>{let r=new Map;return{execute:(a,n)=>{let l=Jc(a,n);r.set(a.id,l);try{if(a.type==="style"&&e8(a.data)){let i=ua(a.data);return e(a.data.property,l,i),!0}else if(a.type==="style-batch"&&t8(a.data)){let i=ua(a.data);for(let s of a.data.changes)e(s.property,n?s.oldValue:s.newValue,i);return!0}else if(a.type==="text"){let i=ua(a.data);return t(l,i),!0}else if(a.type==="media"&&o8(a.data)){if(!o)return!1;let i=ua(a.data);return o(a.data.tag,{[a.data.attribute]:l},i),!0}}catch{return!1}return!1},getCurrentValue:a=>r.get(a.id)??a.newValue,canHandle:a=>a==="style"||a==="style-batch"||a==="text"||a==="media"&&typeof o=="function"}};function N5(e,t,o){let r=$5(e,t,o),a=new sa({commandExecutor:r});return{recordStyleChange(n,l,i,s){let u=a.createCommand("style",l,i,{...s,property:n});a.pushCommand(u)},recordStyleBatch(n,l){if(n.length===0)return;let i=n[0],s=a.createCommand("style-batch",i.oldValue,i.newValue,{...l,changes:n});a.pushCommand(s)},recordTextChange(n,l,i){let s=a.createCommand("text",n,l,{...i});a.pushCommand(s)},recordMediaChange(n,l,i,s,u){let d=a.createCommand("media",i,s,{...u,tag:n,attribute:l});a.pushCommand(d)},undo:()=>a.undo(),redo:()=>a.redo(),canUndo:()=>a.canUndo(),canRedo:()=>a.canRedo(),subscribe:n=>a.subscribe(n),getHistoryStack:()=>a.getUndoStackSnapshot(),clear:()=>a.clear(),getUndoCount:()=>a.getUndoCount(),getMaxHistorySize:()=>a.getMaxHistorySize()}}import da from"react";var r8=20,o2="design-mode:recent-colors:v1:",a8=a1("rgb");function fa(e){if(!Array.isArray(e))return[];let t=new Set,o=[];for(let r of e){if(typeof r!="string"||r.length>512||/^[\da-f]+$/i.test(r.trim()))continue;let a=z1(r);if(!a)continue;let n=a8(a),l=JSON.stringify([...[n.r,n.g,n.b].map(i=>Number((i??0).toFixed(12))),n.alpha??1]);if(!t.has(l)&&(t.add(l),o.push(r),o.length===r8))break}return o}function ca(e){if(!e)return[];let t;try{t=localStorage.getItem(o2+e)}catch{return}try{return fa(JSON.parse(t??"[]"))}catch{return[]}}function U5(e){let t=da.useRef([]),[o,r]=da.useState(()=>({applicationId:e,colors:ca(e)??[]})),a=o;o.applicationId!==e&&(t.current=[],a={applicationId:e,colors:ca(e)??[]},r(a));let n=da.useRef(a);n.current=a,da.useEffect(()=>{if(!e)return;let i=s=>{if(s.storageArea&&s.storageArea!==localStorage||s.key!==null&&s.key!==o2+e)return;let u=s.key===null||s.newValue===null;u&&(t.current=[]);let d={applicationId:e,colors:u?[]:fa([...t.current,...ca(e)??n.current.colors])};n.current=d,r(d)};return window.addEventListener("storage",i),()=>window.removeEventListener("storage",i)},[e]);let l=i=>{let s=e?ca(e)??n.current.colors:n.current.colors,u=fa([i,...t.current,...s]),d={applicationId:e,colors:u};if(n.current=d,r(d),!!e)try{localStorage.setItem(o2+e,JSON.stringify(u)),t.current=[]}catch{t.current=fa([i,...t.current])}};return{recentColors:a.colors,recordColor:l}}var r2=`url\\(\\s*(['"]?)([^'")]+)\\1\\s*\\)`,n8=new RegExp(r2,"i");function pa(e){let t=[],o=0,r="";for(let a of e)a==="("?o++:a===")"&&o--,a===","&&o===0?(t.push(r.trim()),r=""):r+=a;return r.trim()!==""&&t.push(r.trim()),t}function a2(e){let t=pa((e??"").trim());for(let o=0;o<t.length;o++){let r=t[o]??"",a=n8.exec(r);if(a?.[2])return{index:o,layer:r,path:a[2].trim()}}return null}var l8=new RegExp(r2,"i");function i8(e,t){let o=`url("${t}")`,r=(e??"").trim();if(!K1(r))return o;let a=a2(r),n=pa(r);return a?n.map((l,i)=>i===a.index?l.replace(l8,()=>o):l).join(", "):[o,...n].join(", ")}function s8(e){let t=(e??"").trim();if(!K1(t))return"none";let o=a2(t);if(!o)return t;let r=pa(t);return r.splice(o.index,1),r.length===0?"none":r.join(", ")}function q5(e,t){return t.trim()===""?s8(e):i8(e,t)}import{Fragment as l2,jsx as ie,jsxs as Ke}from"react/jsx-runtime";var ga=["top","right","bottom","left"];function i2(e,t,o){let r=$1[e];return r.some(a=>o?.[a]!=null)?Object.fromEntries(r.map((a,n)=>[ga[n],t[a]??""])):lt(t[e]??"")}function Ao(e,t){let o=ga.map(n=>t[n].trim().split(/\s+/)),r=e==="borderRadius";if(o.some(n=>n.length>(r?2:1)||n.some(l=>{let i=/^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(px|%)?$/i.exec(l);return!i||!Number.isFinite(Number(i[1]))||e!=="margin"&&Number(i[1])<0||(i[2]==="%"?!r:!i[2]&&Number(i[1])!==0)})))return;let a=o.map(n=>n[0]).join(" ");return r&&o.some(n=>n.length===2)?`${a} / ${o.map(n=>n[1]??n[0]).join(" ")}`:a}function ma(e,t,o){if((t==="fontFamily"||t==="fontWeight")&&o&&!/^(inherit|initial|unset|revert|revert-layer)$/i.test(o.trim())&&!/\bvar\(/i.test(o))return{...e,[t]:o};if(!(t in $1))return e;let r=lt(o);return{...e,[t]:o,...Object.fromEntries($1[t].map((a,n)=>[a,r[ga[n]]]))}}function z5(e,t,o){let r=ma(e,t,o);return t==="color"?{...r,webkitTextFillColor:o||e.color||""}:r}function W5(e,t,o){if(t===o)return!0;if(e!=="fontFamily")return!1;let r=a=>a.replace(/['"]/g,"").replace(/\s*,\s*/g,",");return r(t)===r(o)}function j5(e){let t=e?.trim()??"";return t.endsWith("px")&&n1(t.slice(0,-2))?Number(t.slice(0,-2)):void 0}function n2(e,t,o){let r=t[e];if(r==="normal"){let l=o[e]?.trim().toLowerCase()??"";return/^[+-]?(?:0+(?:\.0*)?|\.0+)(?:[a-z]+|%)?$/i.test(l)||l==="inherit"&&e==="letterSpacing"?"0":r}let a=j5(r);if(a===void 0)return"";if(e==="fontSize")return String(Number(a.toFixed(2)));let n=j5(t.fontSize);return n!==void 0&&n>0?String(Number((a/n).toFixed(e==="letterSpacing"?3:2))):""}var d8="Edit this element's text on the canvas.",c8="You can't edit this element's text because it contains dynamic content.",f8={opacity:.4},p8=new Set(v2),C8="designMode.imageSourceEditorEnabled",m8=!1;function g8(){try{let e=window.localStorage.getItem(C8);return e==null?void 0:e==="true"}catch{return}}var h8={general:{headerTitle:"Selected Element",emptyPlaceholder:"To edit an element, select it on the canvas.",inlineEditEditable:d8,inlineEditNonEditable:c8,addToChatContext:"Add to chat as context",ariaPropertyPanel:"Property panel",ariaSelectedComponent:"Property panel for the selected element",ariaElementStyling:"Element properties",closePanel:"Close panel"},sections:{imageSource:"Image Source",background:"Background",spacing:"Layout",border:"Border",typography:"Typography"},instances:{imageSource:"Source",backgroundColor:"Background Color",padding:"Padding",margin:"Margin",borderRadius:"Border Radius",fontFamily:"Font Family",fontSize:"Font Size",fontWeight:"Font Style",textStyling:"Text Styling",textColor:"Text Color",textAlignment:"Text Alignment",lineHeight:"Line Height",letterSpacing:"Letter Spacing"},history:{changeLimitTitle:"You're at the edit limit",changeLimitBody:"To continue editing, save your changes."}};function K5(e,t){let o=e.get(t);return{baseStyles:o?.styles??et,baseComputed:o?.computedStyles??et,edits:o?.sessionEdits??new Set}}function v8({size:e=16}){return ie("svg",{width:e,height:e,viewBox:"-1 0 252 302",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:ie("path",{d:"M57 49Q67 49 74 42Q81 35 81 25Q81 15 74 8Q67 1 57 1Q47 1 40 8Q33 15 33 25Q33 35 40 42Q47 49 57 49ZM193 49Q203 49 210 42Q217 35 217 25Q217 15 210 8Q203 1 193 1Q183 1 176 8Q169 15 169 25Q169 35 176 42Q183 49 193 49ZM125 301Q100 301 71 292Q47 285 26 274Q7 265 3.5 259.5Q0 254 1 249Q13 216 20 189Q24 171 26 157V147Q28 120 30 105Q34 78 40 65Q48 48 63 39Q85 27 125 27Q165 27 186 39Q201 47 209 65Q216 78 220 105Q222 120 224 147V157Q226 171 230 189Q237 216 248 249Q250 254 246.5 259.5Q243 265 224 274Q203 285 179 292Q150 301 125 301ZM23 249Q39 259 63 268Q97 280 125 280Q153 280 187 268Q210 259 227 249Q216 219 210 194Q205 174 204 159L203 148Q199 91 191 73Q188 66 184 62Q177 56 165 52Q150 48 125 48Q90 48 73 57Q64 63 59 73Q51 91 47 148L46 158Q45 174 40 194Q34 220 23 249ZM124 248Q113 248 102 244Q84 236 76 217Q72 209 71 201Q70 193 70 179Q70 163 73 151Q76 142 81.5 134Q87 126 98 120Q109 114 125.5 114Q142 114 152 120Q164 127 169 134.5Q174 142 177 151Q180 163 180 178.5Q180 194 179 200Q178 209 174 218Q167 232 154.5 240Q142 248 126 248ZM124 228H126Q147 228 156 209Q158 203 159 197.5Q160 192 160 179Q160 166 157 157Q155 151 152 146.5Q149 142 141 138Q136 134 125 134Q114 134 107.5 138Q101 142 98 146.5Q95 151 93 157Q90 166 90 178.5Q90 191 91 197Q92 203 94 209Q99 221 111 225Q117 228 124 228ZM195 81Q192 79 190 78Q170 70 146 76Q134 80 125.5 80Q117 80 104 76Q80 70 60 78Q58 79 55 81Q50 84 51 89L55 112Q56 117 59.5 120.5Q63 124 68 125Q83 126 99 126Q111 126 115 114L122 92Q122 91 124 89L125 88L126 89Q128 91 128 92L135 114Q139 126 152 126Q167 126 182 125Q187 124 190.5 120.5Q194 117 195 112L199 89Q200 84 195 81ZM141 192Q137 190 133 193V171Q138 169 141 165Q143 163 144 161Q145 159 145 156.5Q145 154 143.5 152Q142 150 140 148.5Q138 147 134 146Q130 145 125.5 145Q121 145 116 146Q111 147 109 149Q107 151 106 153Q105 155 105 157Q105 159 106 161Q107 163 109.5 166Q112 169 116 171H117V193Q113 190 109 191.5Q105 193 104 196Q103 199 105 202Q108 210 117 213Q124 216 133 213L134 212Q143 209 146 202Q147 199 145.5 196Q144 193 141 192Z"})})}function x8({size:e=12}){return ie("svg",{width:e,height:e,viewBox:"0 0 12 12","aria-hidden":"true",style:{display:"block",flexShrink:0},children:ie("rect",{x:"1",y:"1",width:"10",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"2.5 2"})})}function L8(e,t){let o=e[t];return o!=null?String(o):""}function Ca(e){if(!(!e||!e.name||!e.debugSource))return{sourceFile:e.debugSource.sourceFile,lineNumber:e.debugSource.lineNumber,columnNumber:e.debugSource.columnNumber,componentName:e.name,tagName:e.tagName}}function w8({component:e,onOpenSourceFile:t,showOpenSourceFile:o,showComponentName:r,generalLabels:a}){if(!e||!e.name)return ie("section",{id:"property-panel-selected-component",className:"property-panel-selected-component",children:ie("p",{className:"property-panel-selected-component-placeholder",id:"component-info",children:a.emptyPlaceholder})});let n=e.tagName?e.tagName.toLowerCase():"",l=n?`${e.name} > ${n}`:e.name,i=null;if(o&&e.debugSource){let{sourceFile:s,lineNumber:u,columnNumber:d}=e.debugSource,c=s.split("/").pop()||s,f=`:${u}:${d}`;i=Ke("a",{href:"#",className:"property-panel-selected-component-source",onClick:p=>{p.preventDefault(),t?.({sourceFile:s,lineNumber:u,columnNumber:d})},title:`${s}${f}`,children:[c,f]})}return!r&&!i?null:ie("section",{id:"property-panel-selected-component",className:"property-panel-selected-component","aria-label":a.ariaSelectedComponent,children:Ke("div",{id:"component-info",className:"property-panel-selected-component-info",children:[r&&ie("span",{className:"property-panel-selected-component-name",children:l}),i&&Ke("span",{className:"property-panel-selected-component-source-row",children:["\u21B3 ",i]})]})})}var I8=me.forwardRef(function({title:t,body:o},r){return Ke("section",{ref:r,role:"alert","aria-live":"assertive","aria-labelledby":"property-panel-change-limit-title",className:"property-panel-change-limit-message",tabIndex:-1,children:[ie("svg",{className:"property-panel-change-limit-icon",viewBox:"0 0 520 520",fill:"currentColor","aria-hidden":"true",focusable:"false",children:ie("path",{d:"M260 20a240 240 0 100 480 240 240 0 100-480m0 121c17 0 30 13 30 30s-13 30-30 30-30-13-30-30 13-30 30-30m50 210c0 5-4 9-10 9h-80c-5 0-10-3-10-9v-20c0-5 4-11 10-11 5 0 10-3 10-9v-40c0-5-4-11-10-11-5 0-10-3-10-9v-20c0-5 4-11 10-11h60c5 0 10 5 10 11v80c0 5 4 9 10 9 5 0 10 5 10 11z"})}),Ke("div",{className:"property-panel-change-limit-content",children:[ie("h2",{id:"property-panel-change-limit-title",className:"property-panel-change-limit-title",children:t}),ie("p",{className:"property-panel-change-limit-body",children:o})]})]})});function G5(e,t){let o=t==="src"?e.srcKind:e.altKind;if(o===void 0)return"not-editable";if(!(o==="literal"||t==="src"&&o==="asset-import"))return"from-data"}function b8({recentColors:e,onColorApplied:t,styles:o,computedStyles:r,measuredStyles:a,editorResetVersion:n,colorResetVersion:l,hasSelection:i,onStyleChange:s,onBoxSidesChange:u,generalLabels:d,sectionLabels:c,instanceLabels:f,editorLabels:g,component:p,onImageAttributeChange:M,imageSource:h,imageSourceEditorEnabled:w}){let v=i?"visible":"",R=p?.tagName?.toUpperCase()??"",b=p?.propertyEditorCapabilities??{text:!"IMG SVG CANVAS VIDEO AUDIO IFRAME OBJECT EMBED HR BR SCRIPT STYLE TEMPLATE".split(" ").includes(R),box:!["SCRIPT","STYLE","TEMPLATE","OPTION","OPTGROUP","SVG"].includes(R)},S=w&&p?.media?.tag==="img"?p.media:null,Z=w&&p?.media?.tag==="background-image"?p.media:null,T=x=>a?.[x]?.computed!=null?a:void 0,L=me.useMemo(()=>Object.fromEntries(Object.keys($1).map(x=>[x,i2(x,r,a)])),[r,a]);if(!i)return null;let V=o.backgroundImage||r.backgroundImage,y=o.backgroundClip||r.backgroundClip,H=R0(V??"",y??"","text"),q=H!=="",K=H0(V??"",y??""),G=Vn(V??"",y??""),J=K1(K)?"rgba(0, 0, 0, 0)":"#ffffff",F=x=>I0(x)?x:void 0,O=F(o.backgroundColor),A=F(r.backgroundColor),z=F(o.color),B=F(r.color),j=o.webkitTextFillColor||r.webkitTextFillColor,P=o.color||r.color,W=En(j,P),m=x=>{let k=o[x],C=a?.[x];return C&&W5(x,k??"",C.inline??"")&&C.computed?C.computed:k&&!/^(inherit|initial|unset|revert|revert-layer)$/i.test(k.trim())&&!/\bvar\(/i.test(k)?k:r[x]};return ie("section",{className:"property-panel-style-properties-container"+(v?" "+v:""),"aria-label":d.ariaElementStyling,"aria-hidden":!i,children:Ke("div",{className:"property-panel-style-properties",children:[b.text&&Ke(l2,{children:[Ke(nt,{title:c.typography,children:[ie(Ui,{label:f.fontFamily,id:"design-font-family",value:o.fontFamily,computedValue:r.fontFamily,onChange:x=>s("fontFamily",x),useInheritLabel:g?.dimension?.useInherit}),Ke("div",{className:"property-panel-typography-row",children:[ie(qi,{label:f.fontWeight,id:"design-font-weight",value:o.fontWeight,computedValue:r.fontWeight,fontFamily:r.fontFamily,onChange:x=>s("fontWeight",x),optionLabels:g?.fontWeight?.options,useInheritLabel:g?.dimension?.useInherit}),ie(Pr,{label:f.fontSize,id:"design-font-size",value:o.fontSize,...Fo.fontSize,displayValue:n2("fontSize",r,o),measurement:T("fontSize"),resetVersion:n,onChange:x=>s("fontSize",x),aria:g?.dimension})]}),ie(B5,{label:f.textAlignment,id:"design-text-align",value:o.textAlign||r.textAlign,onChange:x=>s("textAlign",x),optionLabels:g?.textAlignment?.options}),ie(A5,{label:f.textStyling,id:"design-text-style",fontStyle:m("fontStyle"),textDecoration:m("textDecoration"),textTransform:m("textTransform"),onChange:s,optionLabels:g?.textStyle?.options}),Ke("div",{className:"property-panel-typography-row",children:[ie(Pr,{label:f.lineHeight,id:"design-line-height",value:o.lineHeight,...Fo.lineHeight,displayValue:n2("lineHeight",r,o),measurement:T("lineHeight"),resetVersion:n,onChange:x=>s("lineHeight",x),aria:g?.dimension}),ie(Pr,{label:f.letterSpacing,id:"design-letter-spacing",value:o.letterSpacing,...Fo.letterSpacing,displayValue:n2("letterSpacing",r,o),measurement:T("letterSpacing"),resetVersion:n,onChange:x=>s("letterSpacing",x),aria:g?.dimension})]})]}),ie(nt,{title:f.textColor,children:ie(_n,{label:f.textColor,recentColors:e,onColorApplied:t,value:W?j:z||B||(q?"rgba(0, 0, 0, 0)":"#000000"),onChange:x=>s("color",x),id:"design-text-color",aria:g?.color,resetVersion:l,backgroundImage:q?H:void 0})})]}),b.box&&Ke(l2,{children:[Ke(nt,{title:c.spacing,children:[ie(Uo,{label:f.padding,id:"design-padding",displayValue:r.padding??"",displaySides:L.padding,measurement:T("padding"),resetVersion:n,paired:!0,onSidesChange:x=>u("padding",x),aria:g?.boxDimension}),ie(Uo,{label:f.margin,id:"design-margin",displayValue:r.margin??"",displaySides:L.margin,measurement:T("margin"),resetVersion:n,paired:!0,onSidesChange:x=>u("margin",x),allowNegative:!0,aria:g?.boxDimension})]}),ie(nt,{title:c.background,children:ie(_n,{label:f.backgroundColor,recentColors:e,onColorApplied:t,value:G?"rgba(0, 0, 0, 0)":O||A||J,onChange:x=>s("backgroundColor",x),id:"design-bg-color",aria:g?.color,resetVersion:l,backgroundImage:K||void 0})}),ie(nt,{title:c.border,children:ie(Uo,{label:f.borderRadius,id:"design-border-radius",displayValue:r.borderRadius??"",displaySides:L.borderRadius,measurement:T("borderRadius"),resetVersion:n,onSidesChange:x=>u("borderRadius",x),uniform:!0,sideLabelKind:"corners",aria:g?.boxDimension})})]}),S&&ie(nt,{title:c.imageSource,children:ie($l,{label:f.imageSource,value:S.src,onChange:x=>M("src",x),id:"design-img-src",attributes:{alt:S.alt},onAttributeChange:M,sourceReadOnly:G5(S,"src"),altReadOnly:G5(S,"alt"),sharedCount:p?.instanceCount,imageLabels:g?.image,...h})}),Z&&ie(nt,{title:c.imageSource,children:ie($l,{label:f.imageSource,value:Z.src,onChange:x=>s("backgroundImage",q5(V,x)),id:"design-bg-img-src",imageLabels:g?.image,...h})})]})})}var X5=["padding","margin","backgroundColor","backgroundImage","backgroundClip","borderRadius","color","webkitTextFillColor","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textAlign","textDecoration","textTransform",...Object.values($1).flat()],et=Object.fromEntries(X5.map(e=>[e,""]));function yt(e,t,o,r,a=et){let n={...t};for(let l of X5){let i=e[l];r==="computed"&&(l==="fontFamily"||l==="fontWeight")&&o.has(l)&&!W5(l,a[l]??"",i?.inline??"")||(r==="computed"&&L2.has(l)?n[l]=i?.computed??"":i!=null&&(!o.has(l)||r==="computed"&&(x2.has(l)||a[l]===""&&(i.inline??"")===""))&&(n[l]=i[r]??t[l]??""))}if(r==="computed"){let l=Object.fromEntries(Object.entries(e).map(([s,u])=>[s,u.inline??""])),i=s=>{let u=s.trim().split(/\s+/).map(d=>`${Number.parseFloat(d)}${d.endsWith("%")?"%":"px"}`);return[u[0],u[1]??u[0]].join(" ")};for(let[s,u]of Object.entries($1)){if(!o.has(s))continue;let d=Ao(s,lt(a[s]??"")),c=document.createElement("div").style;c[s]=d??"";let f=lt(c[s]),g=i2(s,l,e);if(Ao(s,f)!==void 0&&Ao(s,g)!==void 0&&ga.every(p=>i(f[p])===i(g[p]))){u.some(p=>e[p]!=null)||(n=ma(n,s,n[s]??""));continue}for(let p of[s,...u])n[p]=t[p]??""}}return n}var Q5=me.forwardRef(function(t,o){return ie(y8,{...t,ref:o},t.applicationId)}),y8=me.forwardRef(function(t,o){let{component:r,styles:a,onStyleChange:n,onTextChange:l,onHistoryStateChange:i,onAddToChatContext:s,onOpenSourceFile:u,onClose:d,onMediaChange:c,showAddToChatContext:f=!0,showOpenSourceFile:g=!0,compactHeader:p=!1,labels:M,imageSource:h,imageSourceEditorEnabled:w}=t,{recentColors:v,recordColor:R}=U5(t.applicationId),b=me.useMemo(()=>w??g8()??m8,[w]),S=M1(h8,M),[Z,T]=me.useState(()=>yt(a||{},et,new Set,"inline")),[L,V]=me.useState(()=>yt(a||{},et,new Set,"computed")),[y,H]=me.useState(()=>new Set),q=me.useRef(Z);q.current=Z;let K=me.useRef(L);K.current=L;let G=me.useRef(y);G.current=y;let J=me.useCallback(Y=>{Y.styles&&(q.current=Y.styles,T(Y.styles)),Y.computed&&(K.current=Y.computed,V(Y.computed)),Y.edits&&(G.current=Y.edits,H(Y.edits))},[]),F=me.useRef(a);F.current=a;let O=me.useRef(new Map),A=me.useRef(n);A.current=n;let z=me.useRef(l);z.current=l;let B=me.useRef(c);B.current=c;let j=me.useRef(null);j.current||(j.current=N5((Y,se,ue)=>A.current(Y,se,ue,!0),(Y,se)=>z.current?.(Y,se),(Y,se,ue)=>B.current?.(Y,se,ue)));let P=j.current,W=me.useRef(i);W.current=i;let[m,x]=me.useState(()=>P.getUndoCount()),[k,C]=me.useState(0),[$,N]=me.useState(0),U=P.getMaxHistorySize(),I=me.useRef("none");me.useEffect(()=>{let Y=ue=>{if(W.current?.({canUndo:ue.canUndo,canRedo:ue.canRedo}),x(ue.undoCount),!(ue.type==="command-undone"||ue.type==="command-redone"))return;let Ue=ue.type==="command-undone",Xe=ue.command?.data?.property,c1=ue.command?.data?.changes,A1=[];if(typeof Xe=="string"?A1=[[Xe,typeof ue.appliedValue=="string"?ue.appliedValue:""]]:Array.isArray(c1)&&(A1=c1.filter(ye=>ye!=null&&typeof ye.property=="string").map(ye=>[ye.property,String((Ue?ye.oldValue:ye.newValue)??"")])),A1.length===0)return;let Z1=ue.command?.data,Ft=Z1&&typeof Z1.componentName=="string"?`${Z1.sourceFile??""}-${Z1.componentName}-${Z1.tagName??""}-${Z1.lineNumber??""}-${Z1.columnNumber??""}`:null;if(Ft!==null&&Ft!==I.current){let ye=O.current.get(Ft);if(!ye)return;let tt={...ye.styles},St=ye.computedStyles,Le=new Set(ye.sessionEdits);for(let[ot,Rt]of A1)tt[ot]=Rt,St=z5(St,ot,Rt),Le.add(ot);O.current.set(Ft,{...ye,styles:tt,computedStyles:St,sessionEdits:Le});return}C(ye=>ye+1),N(ye=>ye+1);let so={...q.current},Mt=K.current,F1=new Set(G.current);for(let[ye,tt]of A1)so[ye]=tt,Mt=z5(Mt,ye,tt),F1.add(ye);J({styles:so,computed:Mt,edits:F1})},se=P.subscribe(Y);return W.current?.({canUndo:P.canUndo(),canRedo:P.canRedo()}),x(P.getUndoCount()),se},[P,J]);let E=m>=U,ee=me.useRef(null),ce=me.useRef(!1);me.useEffect(()=>{E&&!ce.current&&ee.current?.focus(),ce.current=E},[E]),me.useImperativeHandle(o,()=>({undo:()=>P.undo(),redo:()=>P.redo(),clearHistory:Y=>{if(Y?.keepSelectedStyles||N(se=>se+1),C(se=>se+1),P.clear(),O.current.clear(),Y?.keepSelectedStyles){let se=F.current||{},ue=new Set;J({styles:yt(se,et,ue,"inline"),computed:yt(se,et,ue,"computed"),edits:new Set})}else J({styles:et,computed:et,edits:new Set});x(0)},getHistoryStack:()=>P.getHistoryStack(),getChangeSet:()=>F5(P.getHistoryStack()),recordTextChange:(Y,se,ue)=>P.recordTextChange(Y,se,ue),canUndo:()=>P.canUndo(),canRedo:()=>P.canRedo()}),[P,J]);let Ce=r?`${r.debugSource?.sourceFile??""}-${r.name}-${r.tagName??""}-${r.debugSource?.lineNumber??""}-${r.debugSource?.columnNumber??""}`:"none";I.current=Ce;let we=me.useRef("none");me.useEffect(()=>{let Y=we.current,se,ue,Ve;Ce!==Y?(Y!=="none"&&(G.current.size>0?O.current.set(Y,{styles:q.current,computedStyles:K.current,sessionEdits:G.current}):O.current.delete(Y)),we.current=Ce,{baseStyles:se,baseComputed:ue,edits:Ve}=K5(O.current,Ce)):(se=q.current,ue=K.current,Ve=G.current);let Ue=a||{};J({styles:yt(Ue,se,Ve,"inline"),computed:yt(Ue,ue,Ve,"computed",se),edits:Ve})},[Ce,a,J]);let Ie=Ce!==we.current?K5(O.current,Ce):void 0,Te=Ie?yt(a||{},Ie.baseStyles,Ie.edits,"inline"):Z,Oe=Ie?yt(a||{},Ie.baseComputed,Ie.edits,"computed",Ie.baseStyles):L,Se=(Y,se)=>{let ue=i2(Y,K.current,F.current),Ve=Ao(Y,ue),Ue=Ao(Y,{...ue,...se});if(Ve===void 0||Ue===void 0)return!1;if(Ve===Ue)return!0;let Xe=new Set(G.current);return Xe.add(Y),J({styles:{...q.current,[Y]:Ue},computed:ma(K.current,Y,Ue),edits:Xe}),P.recordStyleChange(Y,Ve,Ue,Ca(r)),n(Y,Ue,r?.debugSource),!0},b1=me.useCallback((Y,se)=>{let ue=L8(q.current,Y),Ve=Ca(r),Ue=r?.debugSource?{sourceFile:r.debugSource.sourceFile,lineNumber:r.debugSource.lineNumber,columnNumber:r.debugSource.columnNumber}:void 0,Xe=q.current.backgroundImage||K.current.backgroundImage||"",c1=q.current.backgroundClip||K.current.backgroundClip||"",A1=Vn(Xe,c1),Z1=q.current.color||K.current.color||"",Ft=!!q.current.webkitTextFillColor?.trim(),so={property:"webkitTextFillColor",isOccluding:Le=>En(Le,Z1,Ft),resetValue:"currentcolor"},Mt=[];Y==="backgroundColor"?Mt=A1?[so]:[]:Y==="color"&&(Mt=[so]);let F1=Mt.flatMap(({property:Le,isOccluding:ot,resetValue:Rt})=>E0(se,Le,K.current[Le],q.current[Le],ot,Rt)),ye=(Le,ot,Rt)=>{Rt!==ot&&F1.push({property:Le,oldValue:ot,newValue:Rt})};if(se.trim()!==""&&(K1(Xe)||A1))if(Y==="backgroundColor"){let Le=A1?V0(Xe,c1):c1;ye("backgroundClip",c1,Le),ye("backgroundImage",Xe,T0(Xe,Le))}else Y==="color"&&ye("backgroundImage",Xe,P0(Xe,c1));n(Y,se,Ue);for(let Le of F1)n(Le.property,Le.newValue,Ue);F1.length===0?P.recordStyleChange(Y,ue,se,Ve):P.recordStyleBatch([{property:Y,oldValue:ue,newValue:se},...F1.map(Le=>({property:Le.property,oldValue:Le.oldValue,newValue:Le.newValue}))],Ve);let tt={...q.current,[Y]:se};for(let Le of F1)tt[Le.property]=Le.newValue;J({styles:tt,computed:ma(K.current,Y,se)}),Y==="color"&&V(Le=>({...Le,webkitTextFillColor:se}));let St=new Set(G.current);St.add(Y);for(let Le of F1)St.add(Le.property);J({edits:St})},[n,P,r,J]),Ne=me.useCallback((Y,se)=>{let ue=r?.media;if(!ue)return;let Ve=r?.debugSource;c?.(ue.tag,{[Y]:se},Ve);let Ue=String(ue[Y]??"");P.recordMediaChange(ue.tag,Y,Ue,se,Ca(r))},[r,c,P]),_e=!!(r&&r.name),re=me.useCallback(()=>{let Y=Ca(r);Y&&s?.(Y)},[r,s]),Ge=_e&&r&&r.tagName&&p8.has(r.tagName.toUpperCase()),He=r?.hasNonEditableText?S.general.inlineEditNonEditable:S.general.inlineEditEditable,C1=r?.tagName?r.tagName.toLowerCase():r?.name,y1=me.useRef(null),t1=me.useRef(null);return me.useLayoutEffect(()=>{let Y=t1.current,se=y1.current;if(!Y||Y.isConnected||!se)return;let ue=se.getRootNode(),Ve=se.ownerDocument.activeElement,Ue=ue instanceof ShadowRoot?ue.host:null,Xe=!1;if(Ve?.tagName==="IFRAME")try{let c1=Ve.contentDocument;Xe=!!(c1&&(!c1.activeElement||c1.activeElement===c1.body))}catch{}(Ve===se.ownerDocument.body||Ve===Ue&&!ue.activeElement||Xe)&&se.focus(),t1.current=null}),Ke("div",{ref:y1,tabIndex:-1,onFocusCapture:Y=>{t1.current=Y.target},role:"complementary","aria-label":S.general.ariaPropertyPanel,className:"property-panel-container",children:[Ke("header",{className:p?"property-panel-header property-panel-header-compact":"property-panel-header",children:[p?_e&&Ke("span",{className:"property-panel-selected-pill",children:[ie(x8,{size:12}),ie("span",{className:"property-panel-selected-pill-tag",children:C1})]}):ie("h2",{id:"design-property-panel-title",className:"property-panel-title",children:S.general.headerTitle}),(_e||d)&&Ke("div",{className:"property-panel-header-actions",children:[_e&&Ke(l2,{children:[Ge&&ie("span",{className:"property-panel-selected-component-action property-panel-selected-component-action-help","data-tooltip":He,"aria-label":He,children:ie(p2,{width:14,height:14,style:r.hasNonEditableText?f8:void 0})}),f&&!E&&ie("button",{type:"button",className:"property-panel-selected-component-action",onClick:re,"data-tooltip":S.general.addToChatContext,"aria-label":S.general.addToChatContext,children:ie(v8,{size:14})})]}),d&&ie("button",{type:"button",className:"property-panel-selected-component-action property-panel-close",onClick:d,"data-tooltip":S.general.closePanel,"aria-label":S.general.closePanel,children:ie(d2,{width:14,height:14,"aria-hidden":"true"})})]})]}),Ke("div",{className:"property-panel-content","aria-labelledby":p?void 0:"design-property-panel-title",children:[ie(w8,{component:r,onOpenSourceFile:u,showOpenSourceFile:g,showComponentName:!p,generalLabels:S.general}),E?ie(I8,{ref:ee,title:S.history.changeLimitTitle,body:S.history.changeLimitBody}):ie(b8,{recentColors:v,onColorApplied:R,editorResetVersion:k,colorResetVersion:$,styles:Te,computedStyles:Oe,measuredStyles:a,hasSelection:_e,onStyleChange:b1,onBoxSidesChange:Se,generalLabels:S.general,sectionLabels:S.sections,instanceLabels:S.instances,editorLabels:M?.editors,component:r,onImageAttributeChange:Ne,imageSource:h,imageSourceEditorEnabled:b},Ce)]})]})});function M8(e,t,o){if(!e)return;u8(e).render(me.createElement(Q5,{...t,ref:o}))}export{Q5 as DesignPropertyPanel,w2 as REQUIRED_LABEL_KEYS,Re as interpolate,M8 as mountDesignPropertyPanel,xs as validateLabels};
|
|
5
5
|
/*! Bundled license information:
|
|
6
6
|
|
|
7
7
|
react-is/cjs/react-is.production.min.js:
|