"),rn=(gr(""),(e,t,r)=>t.indexOf(e[0])+1||r&&t.indexOf(e[r])+1),nn=/"(?:\\[^]|[^\\\n"])*"|'(?:\\[^]|[^\\\n'])*'/g,on=nn.source,sn={rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^)]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}};sn[Jt]=rr.css={comment:/\/\*[^]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^\\s;{"']|\\s+(?!\\s)|${on})*?(?:;|(?=\\s*\\{))`),inside:sn},url:{pattern:RegExp(`\\burl\\((?:${on}|(?:[^\\\\\n"')=]|\\\\[^])*)\\)`,"gi"),inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:/^["'][^]+/,alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^\\s{}](?:[^\\s{};"']|\\s+(?![\\s{])|${on})*(?=\\s*\\{)`),lookbehind:!0},string:nn,variable:{pattern:/(^|[^-\w\xa0-\uffff])--(?:(?!\s)[-\w\xa0-\uffff])*/,lookbehind:!0},property:{pattern:/(^|[^-\w\xa0-\uffff])(?!\d)(?:(?!\s)[-\w\xa0-\uffff])+(?=\s*:)/,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z\d])[-a-z\d]+(?=\()/i,lookbehind:!0},punctuation:/[(){},:;]/};var an=rr.css;an.selector.inside=an.atrule.inside["selector-function-argument"].inside={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:/\[(?:[^[\]"']|(["'])(?:\\[^]|(?!\1)[^\\\n])*\1)*\]/g,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xa0-\uffff])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xa0-\uffff])+/,lookbehind:!0},"attr-value":{pattern:/(=\s*)(?:(?!\s)[-\w\xa0-\uffff])+(?=\s*$)|(["'])(?:\\[^]|(?!\2)[^\\\n])*\2/,lookbehind:!0},operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/[>+~]|\|\|/,punctuation:/[(),]/},((e,t,r)=>{var n={};for(var o in e)n[o]=e[o],delete e[o];for(var o in n)"function"==o&&Object.assign(e,r),r.hasOwnProperty(o)||(e[o]=n[o])})(an,0,{operator:{pattern:/(\s)[/*+-](?!\S)/,lookbehind:!0},hexcode:{pattern:/\B#[a-f\d]{3,8}\b/i,alias:"color"},entity:/\\[a-f\d]{1,8}/i,unit:{pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},number:{pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0}});var ln=/\[]|\(\)|{}/,cn=/[([{][^)\]}]*$/,un=([e,t],r)=>ln.test(r[e-1]+r[t]),dn={line:"//",block:["/*","*/"]},pn=(e=dn,t=cn)=>({comments:e,autoIndent:[([e],r)=>t.test(Tr(r,e)),un]});wr.css=pn({block:["/*","*/"]}),wr.less=wr.scss=pn(),wr.sass={comments:dn};var hn=r(9456);const fn=hn.all.filter((e=>!e.startsWith("-")&&!e.startsWith("--"))).sort(),mn={display:["block","inline","inline-block","flex","inline-flex","grid","inline-grid","none","contents","flow-root","table","table-row","table-cell","list-item"],position:["static","relative","absolute","fixed","sticky"],visibility:["visible","hidden","collapse"],overflow:["visible","hidden","scroll","auto","clip"],"overflow-x":["visible","hidden","scroll","auto","clip"],"overflow-y":["visible","hidden","scroll","auto","clip"],"flex-direction":["row","row-reverse","column","column-reverse"],"flex-wrap":["nowrap","wrap","wrap-reverse"],"justify-content":["flex-start","flex-end","center","space-between","space-around","space-evenly","start","end"],"align-items":["stretch","flex-start","flex-end","center","baseline","start","end"],"align-content":["stretch","flex-start","flex-end","center","space-between","space-around","start","end"],"align-self":["auto","stretch","flex-start","flex-end","center","baseline","start","end"],"grid-auto-flow":["row","column","dense","row dense","column dense"],"justify-items":["start","end","center","stretch","legacy"],"place-items":["start","end","center","stretch"],"place-content":["start","end","center","stretch","space-between","space-around","space-evenly"],"text-align":["left","right","center","justify","start","end"],"text-decoration":["none","underline","overline","line-through"],"text-transform":["none","capitalize","uppercase","lowercase"],"white-space":["normal","nowrap","pre","pre-wrap","pre-line","break-spaces"],"word-break":["normal","break-all","keep-all","break-word"],"word-wrap":["normal","break-word"],"overflow-wrap":["normal","break-word","anywhere"],"text-overflow":["clip","ellipsis"],"vertical-align":["baseline","top","middle","bottom","text-top","text-bottom","sub","super"],"line-height":["normal"],"font-weight":["normal","bold","bolder","lighter","100","200","300","400","500","600","700","800","900"],"font-style":["normal","italic","oblique"],"font-size":["xx-small","x-small","small","medium","large","x-large","xx-large","xxx-large","smaller","larger"],"background-repeat":["repeat","repeat-x","repeat-y","no-repeat","space","round"],"background-position":["top","right","bottom","left","center"],"background-size":["auto","cover","contain"],"background-attachment":["scroll","fixed","local"],"background-clip":["border-box","padding-box","content-box","text"],"background-origin":["border-box","padding-box","content-box"],"background-blend-mode":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],"border-style":["none","solid","dotted","dashed","double","groove","ridge","inset","outset","hidden"],"border-top-style":["none","solid","dotted","dashed","double","groove","ridge","inset","outset","hidden"],"border-right-style":["none","solid","dotted","dashed","double","groove","ridge","inset","outset","hidden"],"border-bottom-style":["none","solid","dotted","dashed","double","groove","ridge","inset","outset","hidden"],"border-left-style":["none","solid","dotted","dashed","double","groove","ridge","inset","outset","hidden"],"border-collapse":["collapse","separate"],"box-sizing":["content-box","border-box"],cursor:["auto","default","none","pointer","grab","grabbing","text","crosshair","move","not-allowed","wait","progress","help","zoom-in","zoom-out"],"pointer-events":["auto","none"],"user-select":["auto","none","text","all","contain"],resize:["none","both","horizontal","vertical","block","inline"],"object-fit":["fill","contain","cover","none","scale-down"],"object-position":["top","right","bottom","left","center"],float:["none","left","right","inline-start","inline-end"],clear:["none","left","right","both","inline-start","inline-end"],"list-style-type":["none","disc","circle","square","decimal","decimal-leading-zero","lower-roman","upper-roman","lower-alpha","upper-alpha","lower-greek"],"list-style-position":["inside","outside"],"table-layout":["auto","fixed"],"caption-side":["top","bottom"],"empty-cells":["show","hide"],"animation-direction":["normal","reverse","alternate","alternate-reverse"],"animation-fill-mode":["none","forwards","backwards","both"],"animation-play-state":["running","paused"],"animation-timing-function":["ease","ease-in","ease-out","ease-in-out","linear","step-start","step-end"],"transition-timing-function":["ease","ease-in","ease-out","ease-in-out","linear","step-start","step-end"],"transform-style":["flat","preserve-3d"],"backface-visibility":["visible","hidden"],"mix-blend-mode":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],"writing-mode":["horizontal-tb","vertical-rl","vertical-lr"],direction:["ltr","rtl"],"aspect-ratio":["auto"],"container-type":["normal","size","inline-size"],content:["none","normal","open-quote","close-quote","no-open-quote","no-close-quote"],appearance:["none","auto"],"will-change":["auto","scroll-position","contents","transform","opacity"],"z-index":["auto"],width:["auto","fit-content","min-content","max-content"],height:["auto","fit-content","min-content","max-content"],"min-width":["auto","fit-content","min-content","max-content"],"min-height":["auto","fit-content","min-content","max-content"],"max-width":["none","fit-content","min-content","max-content"],"max-height":["none","fit-content","min-content","max-content"],flex:["none","auto"],"flex-grow":["0","1"],"flex-shrink":["0","1"],"flex-basis":["auto","content","fit-content","min-content","max-content"],order:["0"],gap:["normal"],"row-gap":["normal"],"column-gap":["normal"],top:["auto"],right:["auto"],bottom:["auto"],left:["auto"],inset:["auto"]},gn=new Set(["color","background-color","border-color","border-top-color","border-right-color","border-bottom-color","border-left-color","outline-color","text-decoration-color","fill","stroke","caret-color","accent-color","column-rule-color","text-emphasis-color","stop-color","flood-color","lighting-color"]),bn=["transparent","currentColor","black","white","red","blue","green","yellow","orange","purple","pink","gray","grey"],vn=[":active",":any-link",":checked",":disabled",":empty",":enabled",":first-child",":first-of-type",":focus",":focus-visible",":focus-within",":has()",":hover",":in-range",":invalid",":is()",":last-child",":last-of-type",":not()",":nth-child()",":nth-last-child()",":nth-of-type()",":only-child",":only-of-type",":out-of-range",":placeholder-shown",":required",":root",":target",":valid",":visited",":where()"].map((e=>({label:e,icon:"function"}))),yn=["::after","::backdrop","::before","::cue","::file-selector-button","::first-letter","::first-line","::grammar-error","::marker","::part()","::placeholder","::selection","::slotted()","::spelling-error"].map((e=>({label:e,icon:"function"})));function wn(e){return String(e||"").replace(/([A-Z])/g,"-$1").toLowerCase()}function kn(e,t,r,n){const o=String(t||"").toLowerCase().trim();if(!o)return e.slice(0,r);const s=[],a=[],l=[];for(const t of e){const e=String(t),i=e.toLowerCase();if(i===o?s.push(e):i.startsWith(o)?a.push(e):n&&i.includes(o)&&l.push(e),s.length+a.length+l.length>=2*r)break}return[...s,...a,...l].slice(0,r)}function En(e){return gn.has(wn(e))}function Sn(e=""){const t=wn(e);let r=mn[t]||[];return En(t)&&(r=[...bn,...r]),function(e){return[...new Set(e.filter(Boolean))]}([...r,...N])}const xn=[{label:"@media",icon:"keyword"},{label:"@supports",icon:"keyword"},{label:"@container",icon:"keyword"}],Cn=new Set(xn.map((e=>e.label))),An=fn.map((function(e){return{label:e,icon:"property",insert:`${e}: ;`,tabStops:[e.length+2]}}));function Rn(e){return"string"==typeof e?e:""}function On(e,t){return Number.isFinite(e)?Math.max(0,Math.min(e,t.length)):0}function Tn(e,t){const r=e.slice(0,t).match(/[\w-]*$/);return t-(r?.[0].length||0)}function In(e,t){const r=e.slice(0,t).match(/@[\w-]*$/);return r?t-r[0].length:Tn(e,t)}var Pn;Pn={sources:[function(e,t){var r;return function(e,t){return!!e&&!!Pr(e,".comment,.string",0,0,t)}(t,null!==(r=e?.pos)&&void 0!==r?r:0)?null:function(e,t){var r,n;if(!e||!Array.isArray(e.options))return null;const o=function(e){return e.every((e=>Rn(e?.label).startsWith("@")))?e.filter((e=>Cn.has(e.label))):e}(e.options);if(0===o.length)return null;const s=Rn(t?.before),a=On(null!==(r=t?.pos)&&void 0!==r?r:s.length,s),l=On(null!==(n=e.from)&&void 0!==n?n:a,s),i=s.slice(l,a).trim().toLowerCase();if(!t?.explicit&&i.length<2)return null;if(!i)return{...e,options:o.slice(0,60)};const c=[],u=[];for(const e of o){const r=Rn(e?.label).toLowerCase();if(r.startsWith(i)?c.push(e):t?.explicit&&r.includes(i)&&u.push(e),c.length+u.length>=60)break}const d=[...c,...u].slice(0,60);return 1===d.length&&Rn(d[0]?.label).toLowerCase()===i?null:d.length?{...e,options:d}:null}(function(e){var t;const r=Rn(e?.before),n=On(null!==(t=e?.pos)&&void 0!==t?t:r.length,r),o=function(e){return Math.max(e.lastIndexOf(";"),e.lastIndexOf("{"),e.lastIndexOf("}"))+1}(r.slice(0,n)),s=r.slice(o,n),a=s.search(/\S|$/),l=s.slice(a),i=o+a;if(!l)return{from:n,options:An};if(l.startsWith("@"))return{from:In(r,n),options:xn};if(l.startsWith("&"))return function(e,t){const r=e.slice(0,t).match(/:{1,2}[\w-]*$/);return r?{from:t-r[0].length,options:r[0].startsWith("::")?yn:vn}:null}(r,n);if(l.includes(":")){const e=function(e){const t=e.indexOf(":");return-1===t?"":e.slice(0,t).trim()}(l);return{from:Tn(r,n),options:Sn(e).map((e=>({label:e,icon:"enum"})))}}return{from:Math.max(i,Tn(r,n)),options:An}}(e),e)}]},["css"].forEach((e=>Yr[e]=Pn));const Mn=(0,s.forwardRef)((function({value:t,onChange:r,onPasteText:n,readOnly:o=!1,autoFocus:a=!1,ariaLabel:l,className:i},c){const u=(0,s.useRef)(null),d=(0,s.useRef)(null),p=(0,s.useRef)(Rn(t)),h=(0,s.useRef)(r),f=(0,s.useRef)(n),m=(0,s.useRef)(o),g=(0,s.useRef)(l),b=(0,s.useRef)(!1),v=(0,s.useRef)(null),y=(0,s.useRef)(null);h.current=r,f.current=n,m.current=o,g.current=l;const w=(0,s.useCallback)((()=>{null!==y.current&&(clearTimeout(y.current),y.current=null)}),[]),k=(0,s.useCallback)((()=>{const e=d.current,t=v.current;e&&t&&(w(),y.current=setTimeout((()=>{if(y.current=null,d.current!==e||v.current!==t)return;let r;if("line"===t.type)r=function(e,t){const r=Rn(e),n=Math.max(1,Number.parseInt(t,10)||1);let o=1,s=0;for(;o({focusAtEditorEnd(){v.current={type:"editorEnd"},k()},selectLine(e){e&&(v.current={type:"line",lineNumber:e},k())}})),[k]),(0,s.useEffect)((()=>{if(!u.current||d.current)return;const e=((e,t,...r)=>{let n,o,s,a,l=[],i="",c=!1,u=!0,d=[],p=0;const h=kr(),f=h.firstChild,m=f.children,g=m[0],b=g.firstChild,v={language:"text",value:i},y=new Set(r),w={},k=e=>{Object.assign(v,e);let t=i!=(i=e.value??i),r=n!=(n=v.language);a=!!v.readOnly,h.style.tabSize=v.tabSize||2,b.inputMode=a?"none":"",b.setAttribute("aria-readonly",a),x(),S(),t&&(c||b.remove(),b.value=i,b.selectionEnd=0,c||g.prepend(b)),(t||r)&&E()},E=()=>{d=nr(i=b.value,rr[n]||{}),R("tokenize",d,n,i);let e=cr(d).split("\n"),t=0,r=p,o=p=e.length;for(;e[t]==l[t]&&t${e[++s]}\n
`;for(s=ou=!0)),l=e,u=!1},S=e=>{(e||y).forEach((t=>{"object"==typeof t?(t.update(T,v),e&&y.add(t)):(t(T,v),e||y.delete(t))}))},x=([e,t]=C())=>{h.className=`prism-code-editor language-${n}${0==v.lineNumbers?"":" show-line-numbers"} pce-${v.wordWrap?"":"no"}wrap${v.rtl?" pce-rtl":""} pce-${e[b.selectionStart,b.selectionEnd,b.selectionDirection],_={Escape(){b.blur()}},A={},R=(e,...t)=>{w[e]?.forEach((e=>e.apply(T,t))),v["on"+e[0].toUpperCase()+e.slice(1)]?.(...t,T)},O=e=>{if(e||u){const e=C(),t=m[s=yr(i,0,e[e[2]<"f"?0:1])];t!=o&&(o?.classList.remove("active-line"),t.classList.add("active-line"),o=t),x(e),R("selectionChange",e,i)}},T={container:h,wrapper:f,lines:m,textarea:b,get activeLine(){return s},get value(){return i},options:v,get focused(){return c},get tokens(){return d},inputCommandMap:A,keyCommandMap:_,extensions:{},setOptions:k,update:E,getSelection:C,addExtensions(...e){S(e)},on:(e,t)=>((w[e]||=new Set).add(t),()=>w[e].delete(t)),remove(){h.remove()}};return br(b,"keydown",(e=>{_[e.key]?.(e,C(),i)&&Er(e)})),br(b,"beforeinput",(e=>{(a||"insertText"==e.inputType&&A[e.data]?.(e,C(),i))&&Er(e)})),br(b,"input",E),br(b,"blur",(()=>{hr=null,c=!1,x()})),br(b,"focus",(()=>{hr=O,c=!0,x()})),br(b,"selectionchange",(e=>{O(),Er(e)})),vr(e)?.append(h),t&&k(t),T})(u.current,{language:"css",value:p.current,tabSize:4,insertSpaces:!0,lineNumbers:!0,readOnly:m.current,wordWrap:!0,onUpdate(e){b.current||e===p.current?p.current=e:(p.current=e,h.current?.(e))}},((e=['""',"''","``","()","[]","{}"],t=/([^$\w'"`]["'`]|.[[({])[.,:;\])}>\s]|.[[({]`/s)=>(r,n)=>{let o;const{keyCommandMap:s,inputCommandMap:a,getSelection:l,container:i}=r,c=navigator.clipboard,u=({insertSpaces:e=!0,tabSize:t}=n)=>[e?" ":"\t",e?t||2:1],d=()=>!n.readOnly&&!r.extensions.cursor?.scrollIntoView(),p=([e,n],[o,s],a,l)=>(ee==t&&o[t]==n&&!Nr(r,e+1),f=(e,t,n,o,s,a)=>{let l=t.join("\n");if(l!=e.join("\n")){const i=e.length-1,c=t[i],u=e[i],d=u.length-c.length,p=t[0].length-e[0].length,h=n+en((p<0?t:e)[0]),f=o-u.length+en(d>0?c:u),m=n-o+l.length+d,g=h>s?s:Math.max(h,s+p),b=a+n-o+l.length;Dr(r,l,n,o,g,a{f(t,t.map(e?e=>e.slice(en(e)?l-en(e)%l:0):e=>e&&a.repeat(l-en(e)%l)+e),r,n,o,s)};a["<"]=(e,t,r)=>p(t,"<>",r,!0),e.forEach((([e,t])=>{const r=e==t;a[e]=(n,o,s)=>(r&&h(o,t,s)||p(o,e+t,s))&&d(),r||(a[t]=(e,r,n)=>h(r,t,n)&&d())})),a[">"]=(e,t,n)=>{const o=wr[Mr(r)]?.autoCloseTags?.(t,n,r);o&&(Dr(r,">"+o,null,null,t[0]+1),Er(e))},s.Tab=(e,[t,o],s)=>{if(Qr||n.readOnly||6&Fr(e))return;const[a,l]=u(n),i=e.shiftKey,[c,p,h]=Ir(s,t,o);return t{const o=7&Fr(e);if(!o||o==Jr){o&&(t[0]=t[1]=Ir(n,t[1])[2]);const[e,s]=u(),[a,l]=t,i=wr[Mr(r)]?.autoIndent,c=Math.floor(en(Tr(n,a))/s)*s,p=i?.[0]?.(t,n,r)?s:0,h=i?.[1]?.(t,n,r),f="\n"+e.repeat(c+p)+(h?"\n"+e.repeat(c):"");if(f[1]||n[l])return Dr(r,f,a,l,a+c+p+1),d()}},s.Backspace=(t,[o,s],a)=>{if(o==s){const t=Tr(a,o),s=n.tabSize||2,l=e.includes(a.slice(o-1,o+1)),i=/[^ ]/.test(t)?0:(t.length-1)%s+1;if(l||i>1)return Dr(r,"",o-(l?1:i),o+l),d()}};for(let e=0;e<2;e++)s[e?"ArrowDown":"ArrowUp"]=(t,[n,o],s)=>{const a=Fr(t);if(1==a){const t=e?n:xr(s,n)-1,a=e?s.indexOf("\n",o)+1:o;if(t>-1&&a>0){const[l,i,c]=Ir(s,t,a),u=l[e?"pop":"shift"](),d=(u.length+1)*(e?1:-1);l[e?"unshift":"push"](u),Dr(r,l.join("\n"),i,c,n+d,o+d)}return d()}if(9==a){const[t,a,l]=Ir(s,n,o),i=t.join("\n"),c=e?i.length+1:0;return Dr(r,i+"\n"+i,a,l,n+c,o+c),d()}if(2==a&&!zr)return i.scrollBy(0,Ar(i,"lineHeight")*(e?1:-1)),!0};_r(r,"keydown",(e=>{const t=Fr(e),n=e.keyCode,[o,s,a]=l();if(t!=Jr||221!=n&&219!=n){if(t==(zr?10:2)&&77==n)Qr=!Qr,Er(e);else if(191==n&&t==Jr||65==n&&9==t){const n=r.value,a=9==t,l=a?o:xr(n,o),i=wr[Mr(r,l)]||{},{line:c,block:u}=i.getComments?.(r,l,n)||i.comments||{},[p,h,m]=Ir(n,o,s),g=p.length-1;if(a){if(u){const[t,a]=u,l=n.slice(o,s),i=n.slice(0,o).search(Or(t)+" ?$"),c=RegExp("^ ?"+Or(a)).test(n.slice(s));i+1&&c?Dr(r,l,i,s+ +(" "==n[s])+a.length,i,i+s-o):Dr(r,`${t} ${l} ${a}`,o,s,o+t.length+1,s+t.length+1),d(),Er(e)}}else if(c){const t=Or(c),r=RegExp(`^\\s*(${t} ?|$)`),a=RegExp(t+" ?"),l=!/\S/.test(n.slice(h,m));f(p,p.map(p.every((e=>r.test(e)))&&!l?e=>e.replace(a,""):e=>l||/\S/.test(e)?e.replace(/^\s*/,`$&${c} `):e),h,m,o,s),d(),Er(e)}else if(u){const[t,n]=u,a=en(p[0]),l=p[0].startsWith(t,a)&&p[g].endsWith(n),i=p.slice();i[0]=p[0].replace(l?RegExp(Or(t)+" ?"):/(?=\S)|$/,l?"":t+" ");let c=i[0].length-p[0].length;i[g]=l?i[g].replace(RegExp(`( ?${Or(n)})?$`),""):i[g]+" "+n;let f=i.join("\n"),b=a+h,v=b>o?o:Math.max(o+c,b),y=b>s-(o!=s)?s:Math.min(Math.max(b,s+c),h+f.length);Dr(r,f,h,m,v,Math.max(v,y)),d(),Er(e)}}else if(t==8+Jr&&75==n){const t=r.value,[n,l,i]=Ir(t,o,s),c=a>"f"?s-i+n.pop().length:o-l,u=Cr(t,i+1)-i-1;Dr(r,"",l-!!l,i+!l,l+Math.min(c,u)),d(),Er(e)}}else m(219==n,...Ir(r.value,o,s),o,s,...u()),d(),Er(e)})),["copy","cut","paste"].forEach((e=>_r(r,e,(t=>{const[n,s]=l();if(n==s&&c){const[[a],l,i]=Ir(r.value,n,s);"paste"==e?t.clipboardData.getData("text/plain")==o&&(Dr(r,o+"\n",l,l,n+o.length+1),d(),Er(t)):(c.writeText(o=a),"cut"==e&&(Dr(r,"",l,i+1),d()),Er(t))}}))))})(),(()=>{let e;const t=tn(),[r,n]=t.childNodes,[o,s]=n.childNodes,a=()=>{const n=e.getSelection(),o=e.value,a=e.lines[e.activeLine],l=n[n[2]<"f"?0:1];Rr(r,Tr(o,l)),Rr(s,o.slice(l,Cr(o,l))+"\n"),t.parentNode!=a&&a.prepend(t)},l=()=>{a(),((e,t,r=0)=>{const n=e.container.style;n.setProperty("--_sp","var(--pce-scroll-padding, 2ch)"),n.scrollPaddingBlock=`calc(var(--_sp) + ${r}px) calc(var(--_sp) + ${Br&&!t.offsetWidth?t.offsetHeight:0}px)`,t.scrollIntoView({block:"nearest"}),n.scrollPaddingBlock="",n.removeProperty("--_sp")})(e,o)},i=t=>{e=t,t.extensions.cursor=i,_r(t,"input",(e=>{/history/.test(e.inputType)&&l()}))};return i.getPosition=()=>(a(),((e,t)=>{const r=t.getBoundingClientRect(),n=e.lines[0].getBoundingClientRect();return{top:r.y-n.y,bottom:n.bottom-r.bottom,left:r.x-n.x,right:n.right-r.right,height:r.height}})(e,o)),i.scrollIntoView=l,i.element=o,i})(),((e=!0,t="()[]{}")=>{let r,n;const o=[],s=t=>{t.extensions.matchBrackets=s,t.on("tokenize",i),e&&t.tokens[0]?t.update():i(t.tokens)},a=s.brackets=[],l=s.pairs=[],i=t=>{if(l.length=a.length=n=r=0,c(t,0),e)for(let e,t=0;e=a[t];){let r=e[0].alias;e[0].alias=(r?r+" ":"")+"bracket-"+(t++in l?"level-"+e[3]%12:"error")}},c=(e,s)=>{let i,u=0;for(;i=e[u++];){let e=i.length;if("string"!=typeof i){let u=i.content;if(Array.isArray(u))c(u,s);else if("punctuation"==(i.alias||i.type)){let c=rn(u,t,e-1),d=c%2;if(c){if(a[r]=[i,s,s+e,n,u,!!d],d)o[n++]=[r,c+1];else for(let e,t=n;e=o[--t];)if(c==e[1]){l[l[r]=e[0]]=r,a[r][3]=n=t;break}r++}}}s+=e}};return s})(),(e=>{let t,r=[],n=()=>{let n=e.extensions.matchBrackets,[s,a]=e.getSelection();if(n){let l,i,c=n.brackets,u=n.pairs;if(e.focused&&s==a)for(let e,t=0;e=c[++t];)if(!e[5]&&e[2]>=a&&c[u[t]]?.[1]<=a){l=c[u[t]],i=e;break}i!=t&&(o(),i?(r=[l,i].map((t=>Pr(e,".punctuation",0,-1,t[1]))),r[0]!=r[1]&&l[2]==i[1]&&(r[0].textContent+=r[1].textContent,r[1].textContent="",r[1]=r[0]),o(!0)):r=[]),t=i}},o=e=>r.forEach((t=>t.classList.toggle("active-bracket",!!e)));_r(e,"focus",n),_r(e,"blur",n),e.on("selectionChange",n)}),(e=>{const t=(r,n)=>{let o,s,a,l,i,c,u,d,p,h,f,m,g,b,v,y,w,k,E,S;const x=r.container,C=r.textarea,_=r.getSelection,A=Gr(),R=$r(),[O,T]=((e,t,r=!0)=>{const n=Ur(),o=n.style,s=n.firstChild;return n.append(t),(r?t:s).style.flexShrink=0,[t=>{let r=e.extensions.cursor?.getPosition();if(r){n.parentNode||Vr(e,n),s.style.width=(e.options.rtl?r.right:r.left)+"px";let a=r.top,l=r.bottom,i=!t==a>l&&(t?a:l)n.remove()]})(r,A),[I,P]=A.children,[M,D,N]=P.children,L=I.firstChild,z=L.id="pce-ac-"+qr++,B=L.children,j=[],F=()=>{o&&(T(),C.removeAttribute("aria-controls"),C.removeAttribute("aria-haspopup"),C.removeAttribute("aria-activedescendant"),w&&P.remove(),o=!1)},V=()=>{p=Ar(B[0],"height")},$=e=>{const t=a[e+d],[r,n,o]=B[e].children,s=t[4],l=s.icon||"variable";Hr(n,t[1],s.label),Rr(o.firstChild.firstChild,s.detail||""),j[e]!=l&&(r.className=`pce-ac-icon pce-ac-icon-${j[e]=l}`,r.style.color=`var(--pce-ac-icon-${l})`),B[e].setAttribute("aria-posinset",e+d)},W=()=>{V();const e=I.scrollTop,t=p*i,r=p*(i+1)-I.clientHeight;I.scrollTop=e>t?t:e{const e=c;c=B[i-d],e?.removeAttribute("aria-selected"),e?.removeAttribute("aria-describedby"),D.remove(),c?(C.setAttribute("aria-activedescendant",c.id),c.setAttribute("aria-selected",!0),a[i][4].renderDocs?(c.append(D),w=!w,J()):P.remove()):e&&C.removeAttribute("aria-activedescendant")},H=()=>{const e=Math.min(Math.floor(I.scrollTop/p),l-13);if(e==d||e<0)return!0;d=e;for(let e=0;e<13;)$(e++);L.style.paddingTop=d*p+"px"},q=e=>G(a[e][4],a[e][2],a[e][3]),G=t.insertCompletion=(e,t,o=t)=>{if(n.readOnly)return;let{label:s,tabStops:a=[],insert:l}=e,i=a.length;if(a=a.map((e=>e+t)),l){let e="\n"+Tr(r.value,u).match(/\s*/)[0],o=0==n.insertSpaces?"\t":" ".repeat(n.tabSize||2),s=a.slice();l=l.replace(/\n| /g,((r,n)=>{let l="\t"==r?o:e,c=l.length-1,u=0;for(;un+t&&(a[u]+=c),u++;return l}))}else l=s;i%2&&(a[i]=a[i-1]),Dr(r,l,t,o,a[0],a[1]),i>2?(h||Vr(r,R),h=a,f=0,g=r.value.length,X(),m=_(),Z()):r.extensions.cursor?.scrollIntoView()},Z=()=>{R.children[f/2].scrollIntoView({block:"nearest"})},Y=e=>{f+=e,Nr(r,h[f],h[f+1]),Z()},K=()=>{R.remove(),h=null},X=()=>{let e=[],t=0;for(;te[0]-t[0])),Hr(R,e.flat(),r.value)},Q=()=>{A.className=`pce-ac-wrapper pce-ac-${(()=>{const e=x.clientWidth,t=Math.abs(x.scrollLeft),o=r.extensions.cursor.getPosition(),s=n.rtl?o.right:o.left,a=Ar(x,"fontSize");if(e>=46*a){if(s+45.5*at)return v+"-start"}return v})()}`},J=()=>{w?P.remove():(()=>{const e=a[i][4];e.renderDocs&&(P.parentNode||A.append(P),y!=e&&(y=e,N.textContent="",N.append(...e.renderDocs(e,k,r))),c?.setAttribute("aria-describedby",z+"d"))})(),w=!w},ee=t.startQuery=t=>{const[s,c,h]=_(),f=Mr(r,u=h<"f"?s:c),m=Yr[f],g=r.extensions.cursor;if(g&&m&&(t||s==c)&&!n.readOnly){const n=r.value,s=Tr(n,u),h=n.slice(0,u),b=e.filter;if(k={before:h,lineBefore:s,language:f,explicit:!!t,pos:u},Object.assign(k,m.context?.(k,r)),a=[],m.sources.forEach((e=>{const t=e(k,r);if(t){const e=t.from,r=h.slice(e);t.options.forEach((n=>{const o=b(r,n.label);o&&(o[0]+=n.boost||0,o.push(e,t.to??c,n),a.push(o))}))}})),a[0]){a.sort(((e,t)=>t[0]-e[0]||e[4].label.localeCompare(t[4].label))),l=a.length,i=d=0;for(let e=0,t=l<13?l:13;e{V(),H()||U()})),r.on("update",(()=>{if(h){let e=r.value,t=g-(g=e.length),[n,o]=m,s=0,a=h.length,l=h[f],i=h[f+1];if(ni)K();else{for(b&&o++,o<=i&&(h[f+1]-=t),o<=l&&t>0&&(h[f]-=t);s=i&&(h[s]=Math.max(h[s]-t,h[f+1]),h[s+1]=Math.max(h[s+1]-t,h[f+1]));X()}b=!1,m=_()}})),r.on("selectionChange",(([e,t])=>{if(h){if(eh[f+1])for(let r=0;r=h[r]&&t<=h[r+1]){f=r;break}(f+3>h.length||eh[f+1])&&K()}s?(s=!1,ee()):E==e&&S==t||F(),E=e,S=t})),br(C,"beforeinput",(t=>{let r=t.inputType,n="d"==r[0],l="insertText"==r,c=t.data;o&&l&&!Sr&&c&&!c[1]&&a[i][4].commitChars?.includes(c)&&q(i),h&&(m=_(),b=n&&"F"==r[13]&&m[0]==m[1]),s=!e.explicitOnly&&(s||l&&!Sr||n&&o)}),!0),br(C,"blur",(t=>{0==e.closeOnBlur||A.contains(t.relatedTarget)||F()})),br(C,"keydown",(e=>{let t,r,n,s=e.key,a=Fr(e);var c;2==a&&" "==s||a==(zr?4:2)&&"i"==s||zr&&!o&&1==a&&"Escape"==s?(o?J():ee(!0),Er(e)):o?a||(/^Arrow[UD]/.test(s)?(c="U"==s[5],i=c?i?i-1:l-1:i+1{e.target!=D&&q([].indexOf.call(B,e.target.closest("li"))+d),Er(e)})),br(A,"focusout",(t=>{0!=e.closeOnBlur&&t.relatedTarget!=C&&F()})),br(x,"scroll",(()=>{o&&Q()})),br(M,"click",J),br(M,"mousedown",Er),br(D,"click",J),P.id=z+"d",D.remove(),P.remove(),r.extensions.autoComplete=t};return t.startQuery=t.insertCompletion=()=>{},t})({filter:Kr}),((e=999)=>{let t,r,n,o,s,a,l,i,c=0,u=!1;const d=[],p=r=>{r>=e&&(r--,d.shift()),d.splice(c=r,e,[t.value,i(),i()])},h=e=>{d[e]&&(l.value=d[e][0],l.setSelectionRange(...d[e][e{e.extensions.history=f,t=e,i=e.getSelection,l||p(0),l=e.textarea,e.on("selectionChange",(()=>{r=u,u=!1})),_r(e,"beforeinput",(e=>{let t=e.data,l=e.inputType,p=e.timeStamp;/history/.test(l)?(h(c+("U"==l[7]?-1:1)),Er(e)):(a=r&&(n==l||p-s<99&&"Drop"==l.slice(-4))&&!Sr&&(" "!=t||o==t))||(d[c][2]=Sr||i()),u=!0,o=t,s=p,n=l})),_r(e,"input",(()=>p(c+!a))),_r(e,"keydown",(e=>{if(!g.readOnly){const t=Fr(e),r=e.keyCode,n=t==Jr+8&&90==r||!zr&&t==Jr&&89==r;t==Jr&&90==r?(h(c-1),Er(e)):n&&(h(c+1),Er(e))}})),e.addExtensions({update(){e.value!=l.value&&m()}})},m=f.clear=()=>{p(0),r=!1};return f.has=e=>c+e in d,f.go=e=>h(c+e),f})());d.current=e,e.textarea.readOnly=!!m.current,e.textarea.setAttribute("aria-label",g.current||"CSS editor");let t=null;const r=()=>{var r;null===t&&(r=()=>{t=null,e.extensions.cursor?.scrollIntoView?.()},t="function"==typeof requestAnimationFrame?requestAnimationFrame(r):setTimeout(r,0))},n=t=>{if(m.current)return void t.preventDefault();const n=t.clipboardData?.getData("text/plain"),o=f.current?.(n);null!=o&&(t.preventDefault(),Dr(e,Rn(o)),r())},o=e.on("selectionChange",r);return e.textarea.addEventListener("input",r),e.textarea.addEventListener("paste",n),a&&(v.current=v.current||{type:"editorEnd"}),k(),()=>{var s;null!==t&&(s=t,"function"!=typeof cancelAnimationFrame?clearTimeout(s):cancelAnimationFrame(s)),w(),o(),e.textarea.removeEventListener("input",r),e.textarea.removeEventListener("paste",n),e.remove(),d.current=null}}),[a,w,k]),(0,s.useEffect)((()=>{const e=d.current,r=Rn(t);if(e&&r!==e.value){b.current=!0;try{e.setOptions({value:r}),e.extensions.history?.clear(),p.current=r}finally{b.current=!1}}else p.current=r}),[t]),(0,s.useEffect)((()=>{const e=d.current;e&&function(e,t){e.setOptions({readOnly:t}),e.textarea.readOnly=!!t}(e,o)}),[o]),(0,s.useEffect)((()=>{const e=d.current;e?.textarea&&e.textarea.setAttribute("aria-label",l||"CSS editor")}),[l]),(0,e.createElement)("div",{className:i,ref:u})}));function Dn(e){const t=function(e){if(!e||"object"!=typeof e)return"";const t=" ",r=[],n=St(e);n&&r.push(Rt(n).map((e=>e+";")).join("\n"));for(const[n,o]of Object.entries(e)){if("object"!=typeof o||null===o||n.startsWith("@"))continue;const e=n,s=[];for(const[e,t]of Object.entries(o))e.startsWith("@")&&"object"==typeof t&&null!==t&&s.push({atRule:e,props:t});const a=[],l=St(o);l&&a.push(Rt(l).map((e=>`${t}${e};`)).join("\n"));for(const{atRule:e,props:r}of s){const n=St(r);if(!n)continue;const o=Rt(n).map((e=>`${t}${t}${e};`)).join("\n");a.push(`${t}${e} {\n${o}\n${t}}`)}a.length>0&&r.push(`${e} {\n${a.join("\n\n")}\n}`)}for(const[n,o]of Object.entries(e)){if(!n.startsWith("@")||"object"!=typeof o||null===o)continue;const e=St(o),s=[];if(e){const r=Rt(e).map((e=>`${t}${e};`)).join("\n");s.push(r)}for(const[e,r]of Object.entries(o)){if(e.startsWith("@")||"object"!=typeof r||null===r)continue;const n=St(r);if(!n)continue;const o=Rt(n).map((e=>`${t}${t}${e};`)).join("\n");s.push(`${t}${e} {\n${o}\n${t}}`)}s.length>0&&r.push(`${n} {\n${s.join("\n\n")}\n}`)}return r.join("\n\n")}(e)||"",r=t.replace(/\s+$/,"");return r?r+"\n":""}function Nn(e){if(""!==e&&null!=e){if(Array.isArray(e)){const t=e.map(Nn).filter((e=>void 0!==e));return t.length>0?t:void 0}if("object"==typeof e){const t=Object.keys(e).sort().reduce(((t,r)=>{const n=Nn(e[r]);return void 0!==n&&(t[r]=n),t}),{});return Object.keys(t).length>0?t:void 0}return String(e)}}function Ln(e){return JSON.stringify(Nn(e)||{})}function zn(e,t){if(!e)return null;const r=e.message||t;return r?{message:r,line:Number.isFinite(e.line)?e.line:null}:null}function Bn(e){const t=e.message.replace(/\.$/,"");return null!==e.line?`${t} (line ${e.line})`:t}function jn(e){if(1===e.length)return Bn(e[0])+" "+(0,a.__)("Fix or remove before applying.","generateblocks-pro");const t=e.slice(0,5).map(Bn),r=e.length-t.length,n=r>0?"; "+r+" "+(0,a.__)("more.","generateblocks-pro"):"";return e.length+" "+(0,a.__)("issues found. Fix these before applying:","generateblocks-pro")+" "+t.join("; ")+n}function Fn(e,t){const r=function(e){return e.startsWith("@")||e.startsWith("&")?e:S(e)}(t),n=function(e,t){if(!e||!t)return null;const r=e=>e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=t=>{let r,n=null;for(;null!==(r=t.exec(e));)n=r,r.index===t.lastIndex&&t.lastIndex++;return n};let o;if(t.startsWith("@")||t.startsWith("&"))o=n(new RegExp("^\\s*"+r(t),"gm"));else{const e=S(t);o=n(new RegExp("^\\s*"+r(e)+"\\s*:","gim")),o||e===t||(o=n(new RegExp("^\\s*"+r(t)+"\\s*:","gim")))}return o?e.slice(0,o.index).split("\n").length:null}(e,t);return{message:(0,a.__)("Invalid or unsupported CSS:","generateblocks-pro")+' "'+r+'".',line:n}}function Vn(e){const t=e.trim();if(!t)return{validStyles:{},messages:[],isEmpty:!0};if(t.length>1e5)return{error:(0,a.__)("CSS is too large.","generateblocks-pro")};const r=Ht(e),n=[],o=new Set;if(Array.isArray(r.issues))for(const e of r.issues){const t=zn(e);t&&(n.push(t),o.add(t.message))}if(Array.isArray(r.warnings))for(const e of r.warnings){if(o.has(e))continue;const t=zn({message:e});t&&n.push(t)}if(0===Object.keys(r.styles).length&&0===n.length)return{error:(0,a.__)("No valid declarations found in the CSS.","generateblocks-pro")};const{validStyles:s,invalidProperties:l}=Kt(r.styles);if(t.includes("{")&&r.discardedSelectors.length>0&&n.push({message:(0,a.__)("Unsupported selectors:","generateblocks-pro")+" "+r.discardedSelectors.join(", "),line:null}),l.length>0)for(const t of l)n.push(Fn(e,t));if(n.length>0){const e=function(e){return e.map(((e,t)=>({...e,index:t}))).sort(((e,t)=>{const r=null===e.line?Number.MAX_SAFE_INTEGER:e.line,n=null===t.line?Number.MAX_SAFE_INTEGER:t.line;return r===n?e.index-t.index:r-n})).map((({index:e,...t})=>t))}(n);return{error:jn(e),issues:e,invalidLines:e.map((e=>e.line)).filter((e=>null!==e))}}return 0===Xt(s)?{error:(0,a.__)("No valid CSS found.","generateblocks-pro")}:{validStyles:s,messages:[],invalidLines:[]}}function $n({status:t,issues:r,onJumpToLine:n}){const s=g(c.cssEditorStatusDot,"success"===t.tone&&c.cssEditorStatusDotOk,"saving"===t.tone&&c.cssEditorStatusDotSaving,"info"===t.tone&&c.cssEditorStatusDotInfo,"error"===t.tone&&c.cssEditorStatusDotError),l=(0,e.createElement)("span",{className:c.cssEditorStatusLive,role:"status","aria-live":"polite"},t.text);if("error"!==t.tone)return(0,e.createElement)("div",{className:c.cssEditorStatus},l,(0,e.createElement)(o.Tooltip,{text:t.text},(0,e.createElement)("span",{className:c.cssEditorStatusToggle,role:"img","aria-label":t.text,tabIndex:0,"data-testid":"css-editor-status"},(0,e.createElement)("span",{className:s}))));const i=Array.isArray(r)&&r.length>0;return(0,e.createElement)("div",{className:c.cssEditorStatus},l,(0,e.createElement)(o.Dropdown,{className:c.cssEditorStatusDropdown,popoverProps:{placement:"bottom-end",className:c.cssEditorIssuesPopover},renderToggle:({isOpen:r,onToggle:n})=>(0,e.createElement)(o.Button,{className:c.cssEditorStatusToggle,onClick:n,"aria-expanded":r,label:t.text,showTooltip:!0,"data-testid":"css-editor-status"},(0,e.createElement)("span",{className:s})),renderContent:({onClose:s})=>(0,e.createElement)("div",{className:c.cssEditorIssues,"data-testid":"css-editor-issues"},i?(0,e.createElement)("ul",{className:c.cssEditorIssuesList},r.map(((t,r)=>(0,e.createElement)("li",{key:r,className:c.cssEditorIssuesItem},(0,e.createElement)(o.Button,{className:c.cssEditorIssueButton,variant:"tertiary",disabled:null===t.line,onClick:()=>{null!==t.line&&n(t.line),s()}},(0,e.createElement)(d,{icon:ct,className:c.cssEditorIssueIcon}),(0,e.createElement)("span",{className:c.cssEditorIssueMessage},t.message),null!==t.line&&(0,e.createElement)("span",{className:c.cssEditorIssueLine},(0,a.sprintf)(
// translators: %d: line number.
// translators: %d: line number.
(0,a.__)("Line %d","generateblocks-pro"),t.line))))))):(0,e.createElement)("p",{className:c.cssEditorIssuesText},t.text))}))}const Wn=(0,s.forwardRef)((function({allStyles:t,selector:r,onApply:n,onClose:l,closeOnApply:i=!0,autoFocus:u=!1,autoApply:d=!1,autoApplyDelay:p=500,focusRequestId:h=0,onFocusRequestConsumed:f,title:m,closeLabel:b,className:v},y){const w=(0,s.useRef)(d);w.current=d;const k=(0,s.useRef)(n);k.current=n;const[E,S]=(0,s.useState)(null),x=(0,s.useRef)(null),[C,_]=(0,s.useState)(null),A=(0,s.useRef)(C);A.current=C;const R=(0,s.useRef)(null),O=(0,s.useRef)(null),[T,I]=(0,s.useState)(null),[P,M]=(0,s.useState)(!1),D=(0,s.useRef)(!1),N=(0,s.useCallback)((e=>{D.current=e,M(e)}),[]),L=(0,s.useRef)(!0);(0,s.useEffect)((()=>(L.current=!0,()=>{L.current=!1})),[]),(0,s.useEffect)((()=>{const e=O.current,t=e?.closest(".interface-complementary-area")?.querySelector(".components-panel__header");if(!e||!t)return;const r=()=>{e.style.setProperty("--gb-css-editor-pin",`${Math.round(t.getBoundingClientRect().height)}px`)};if(r(),"undefined"==typeof ResizeObserver)return;const n=new ResizeObserver(r);return n.observe(t),()=>n.disconnect()}),[]);const z=(0,s.useRef)(l);(0,s.useEffect)((()=>{z.current=l}),[l]);const B=(0,s.useRef)(u),j=(0,s.useCallback)((()=>{_(null),B.current=u,D.current||S(null)}),[u]),F=(0,s.useCallback)((({bufferMatches:e})=>{e&&_(null)}),[]),{cssValue:V,cssValueRef:$,isDirty:W,setDraftCss:U,clearAutoApplyTimer:H,scheduleAutoApply:q,hasPendingAutoApply:G,blockAutoApply:Z,isAutoApplyBlocked:Y,isCleanCss:K,beginApply:X,cancelApply:Q,completeApply:J}=function({allStyles:e,onExternalReset:t,onOwnEcho:r}){const n=(0,s.useRef)(null);null===n.current&&(n.current=Dn(e));const o=(0,s.useRef)(null);null===o.current&&(o.current=Ln(e));const[a,l]=(0,s.useState)(n.current),i=(0,s.useRef)(n.current);i.current=a;const c=(0,s.useRef)(null),u=(0,s.useRef)(null),d=(0,s.useRef)(n.current),p=(0,s.useRef)(o.current),h=(0,s.useRef)(null),f=a!==n.current,m=(0,s.useCallback)((()=>{const e=!!c.current;return c.current&&(clearTimeout(c.current),c.current=null),e}),[]),g=(0,s.useCallback)(((e,t)=>{m(),c.current=setTimeout((()=>{c.current=null,e()}),Math.max(0,t))}),[m]),b=(0,s.useCallback)((()=>!!c.current),[]),v=(0,s.useCallback)((e=>{u.current=null,m(),l(e)}),[m]),y=(0,s.useCallback)(((e=i.current)=>{u.current=e}),[]),w=(0,s.useCallback)((e=>u.current===e),[]),k=(0,s.useCallback)((e=>e===n.current),[]),E=(0,s.useCallback)(((e,t)=>{const r=Ln(t);h.current={key:r,buffer:e}}),[]),S=(0,s.useCallback)(((e,t)=>{const r=Ln(t),n=h.current;n&&n.key===r&&n.buffer===e&&(h.current=null)}),[]),x=(0,s.useCallback)(((e,t)=>{const r=Ln(t),o=h.current;o&&o.key===r&&o.buffer===e&&(i.current===e&&(n.current=e),r===p.current&&(h.current=null),u.current=null)}),[]);return(0,s.useEffect)((()=>{const o=Dn(e),s=Ln(e);if(o===d.current&&s===p.current)return;d.current=o,p.current=s;const a=h.current;if(a&&a.key===s){const e=i.current,t=e===a.buffer;return h.current=null,n.current=t?e:o,void r?.({bufferMatches:t})}a?i.current!==n.current&&(n.current=o):i.current===n.current?(n.current=o,u.current=null,m(),l(o),t?.()):n.current=o}),[e,m,t,r]),{cssValue:a,cssValueRef:i,isDirty:f,setDraftCss:v,clearAutoApplyTimer:m,scheduleAutoApply:g,hasPendingAutoApply:b,blockAutoApply:y,isAutoApplyBlocked:w,isCleanCss:k,beginApply:E,cancelApply:S,completeApply:x}}({allStyles:t,onExternalReset:j,onOwnEcho:F});(0,s.useEffect)((()=>{if(!u||!B.current)return;const e=R.current;e&&(B.current=!1,e.focusAtEditorEnd())}),[u,V]);const ee=(0,s.useRef)(0);(0,s.useEffect)((()=>{if(!h||ee.current===h)return;ee.current=h,R.current?.focusAtEditorEnd();let e=!1;const t=(r=()=>{e=!0,f?.(h)},"function"==typeof requestAnimationFrame?requestAnimationFrame(r):setTimeout(r,0));var r;return()=>{var r;e||ee.current!==h||(ee.current=0),r=t,"function"!=typeof cancelAnimationFrame?clearTimeout(r):cancelAnimationFrame(r)}}),[h,f]);const te=(0,s.useCallback)((()=>{x.current&&(clearTimeout(x.current),x.current=null)}),[]),re=(0,s.useCallback)((e=>{te(),S(e)}),[te]),ne=(0,s.useCallback)(((e,t=4e3)=>{te(),S(e),x.current=setTimeout((()=>{S(null),x.current=null}),t)}),[te]),oe=(0,s.useCallback)((e=>{D.current||(te(),S(null),U(e))}),[te,U]),se=(0,s.useRef)(null),ae=(0,s.useCallback)((()=>{if(!D.current)return W?(H(),void _({type:"close"})):void l()}),[W,l,H]);(0,s.useImperativeHandle)(y,(()=>({requestClose:ae})),[ae]);const le=(0,s.useCallback)((e=>{if(!e.trim())return{validStyles:{},messages:[],invalidLines:[]};const t=Vn(e);return t.error?{error:t.error,issues:t.issues||[],invalidLines:t.invalidLines||[]}:{validStyles:t.validStyles,messages:t.messages,invalidLines:t.invalidLines||[]}}),[]),ie=(0,s.useRef)(le);ie.current=le,(0,s.useEffect)((()=>()=>{const e=G();x.current&&clearTimeout(x.current),H();const t=$.current;if(!e||!w.current||D.current||A.current||Y(t)||K(t)||"function"!=typeof k.current)return;const r=ie.current(t);r.error||Promise.resolve().then((()=>k.current(r.validStyles))).catch((()=>{}))}),[H,G,Y,K]);const ce=(0,s.useCallback)((e=>{e&&R.current?.selectLine(e)}),[]),ue=(0,s.useCallback)((async(e={})=>{const t=!!e.isAutoApply;if(D.current||!W)return;H();const r=le(V);if(r.error)return re({type:"error",message:r.error,issues:r.issues}),(t||d)&&Z(V),void(!t&&r.invalidLines?.length>0&&ce(r.invalidLines[0]));X(V,r.validStyles),N(!0),_(null),t||S({type:"info",message:(0,a.__)("Saving…","generateblocks-pro")});let o=null;try{await Promise.resolve().then((()=>n(r.validStyles)))}catch(e){o=e}if(o){if(Q(V,r.validStyles),!L.current)return;return N(!1),ne({type:"error",message:o?.message||(0,a.__)("Failed to save.","generateblocks-pro")},5e3),void((t||d)&&Z(V))}L.current&&(J(V,r.validStyles),N(!1),t||(i?z.current():ne({type:"success",message:(0,a.__)("Applied.","generateblocks-pro")},2500)))}),[d,X,Z,Q,H,i,J,V,W,n,le,re,ne,N,ce]);se.current=ue,(0,s.useEffect)((()=>{if(H(),d&&W&&!P&&!C&&!Y(V)&&!K(V))return q((()=>{ue({isAutoApply:!0})}),p),H}),[d,p,H,C,V,ue,Y,K,W,P,q]);const de=W&&!P,pe=r||(0,a.__)("Styles","generateblocks-pro"),he=(0,a.sprintf)(
// translators: %s: CSS selector the editor is editing.
// translators: %s: CSS selector the editor is editing.
(0,a.__)("CSS editor for %s","generateblocks-pro"),pe);let fe;fe=P?{tone:"saving",text:d?(0,a.__)("Applying…","generateblocks-pro"):(0,a.__)("Saving…","generateblocks-pro")}:"error"===E?.type?{tone:"error",text:d?(0,a.__)("Not applied -","generateblocks-pro")+" "+E.message:E.message}:"success"===E?.type?{tone:"success",text:E.message}:W?{tone:"info",text:(0,a.__)("Unsaved changes","generateblocks-pro")}:{tone:"success",text:(0,a.__)("Applied","generateblocks-pro")};const me="close"===C?.type,ge=m||(0,a.__)("CSS Editor","generateblocks-pro"),be=b||(0,a.__)("Close","generateblocks-pro"),ve=(0,a.sprintf)(
// translators: %s: CSS editor title.
// translators: %s: CSS editor title.
(0,a.__)("Open %s documentation","generateblocks-pro"),ge);return(0,e.createElement)("div",{ref:O,className:g(c.cssEditorRoot,v),"aria-busy":P,onKeyDown:e=>{D.current?("Escape"===e.key||"s"===e.key&&(e.metaKey||e.ctrlKey))&&(e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),e.preventDefault()):("Escape"===e.key&&(e.stopPropagation(),C?_(null):W?_({type:"close"}):l()),"s"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),e.stopPropagation(),e.nativeEvent.stopImmediatePropagation(),se.current?.()))}},(0,e.createElement)("div",{className:c.cssEditorHeader},(0,e.createElement)("div",{className:c.cssEditorTitleRow},(0,e.createElement)("h1",{className:c.cssEditorTitle},ge),(0,e.createElement)(o.Button,{className:c.cssEditorHelpButton,icon:ut,size:"compact",variant:"link",label:ve,href:"https://learn.generatepress.com/blocks/block-guide/css-editor/",target:"_blank",rel:"noreferrer noopener",showTooltip:!0})),(0,e.createElement)("div",{className:c.cssEditorHeaderActions},(0,e.createElement)($n,{status:fe,issues:E?.issues,onJumpToLine:ce}),!d&&(0,e.createElement)(o.Button,{variant:"primary",size:"compact",onClick:()=>ue(),disabled:!de||me},P?(0,a.__)("Saving…","generateblocks-pro"):(0,a.__)("Apply","generateblocks-pro")),(0,e.createElement)("span",{className:c.cssEditorCloseAnchor,ref:I},(0,e.createElement)(o.Button,{icon:dt,size:"small",label:be,onClick:ae,disabled:P})),me&&T&&(0,e.createElement)(o.Popover,{anchor:T,placement:"bottom-end",onClose:()=>_(null),className:c.cssEditorConfirmPopover,focusOnMount:"firstElement"},(0,e.createElement)("div",{className:c.cssEditorConfirm,"data-testid":"css-editor-confirm"},(0,e.createElement)("p",{className:c.cssEditorConfirmMessage},(0,a.__)("Discard unsaved changes?","generateblocks-pro")),(0,e.createElement)("div",{className:c.cssEditorConfirmActions},(0,e.createElement)(o.Button,{variant:"tertiary",size:"compact",onClick:()=>_(null)},(0,a.__)("Keep editing","generateblocks-pro")),(0,e.createElement)(o.Button,{isDestructive:!0,variant:"primary",size:"compact",onClick:()=>z.current?.()},(0,a.__)("Discard","generateblocks-pro"))))))),(0,e.createElement)("div",{className:c.cssEditor},(0,e.createElement)("div",{className:c.cssEditorSelectorBar},(0,e.createElement)("span",{className:c.cssEditorSelectorName},pe)),(0,e.createElement)("div",{className:c.cssEditorBody},(0,e.createElement)(Mn,{ref:R,autoFocus:u,value:V,onChange:oe,ariaLabel:he,className:c.cssEditorTextarea,readOnly:P}))))}));function Un({closeOnApply:t=!0,...r}){const n=(0,s.useRef)(null);return(0,e.createElement)(o.Modal,{onRequestClose:()=>n.current?.requestClose?.(),className:c.cssEditorModal,size:"large",isDismissible:!1,title:(0,a.__)("CSS Editor","generateblocks-pro")},(0,e.createElement)(Wn,{ref:n,...r,closeOnApply:t,autoFocus:!0,className:g(c.cssEditorModalBody,r.className)}))}function Hn(t){return(0,e.createElement)(Un,{...t})}const qn=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));function Gn(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}function Zn(){return Zn=Object.assign?Object.assign.bind():function(e){for(var t=1;t"object"==typeof e&&null!=e&&1===e.nodeType,Qn=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,Jn=(e,t)=>{if(e.clientHeight{const t=(e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch(e){return null}})(e);return!!t&&(t.clientHeightst||s>e&&a=t&&l>=r?s-e-n:a>t&&lr?a-t+o:0,to=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var ro=function(){return ro=Object.assign||function(e){for(var t,r=1,n=arguments.length;r1?r-1:0),o=1;oa)&&(e=t>0?-1:a+1);var l=e+t;l<0?l=o?a:0:l>a&&(l=o?0:a);var i=po(l,t<0,r,n,o);return-1===i?e>=s?-1:e:i}function po(e,t,r,n,o){void 0===o&&(o=!1);var s=r.length;if(t){for(var a=e;a>=0;a--)if(!n(r[a],a))return a}else for(var l=e;l{var r,n,o,s;if("undefined"==typeof document)return[];const{scrollMode:a,block:l,inline:i,boundary:c,skipOverflowHiddenElements:u}=t,d="function"==typeof c?c:e=>e!==c;if(!Xn(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,h=[];let f=e;for(;Xn(f)&&d(f);){if(f=to(f),f===p){h.push(f);break}null!=f&&f===document.body&&Jn(f)&&!Jn(document.documentElement)||null!=f&&Jn(f,u)&&h.push(f)}const m=null!=(n=null==(r=window.visualViewport)?void 0:r.width)?n:innerWidth,g=null!=(s=null==(o=window.visualViewport)?void 0:o.height)?s:innerHeight,{scrollX:b,scrollY:v}=window,{height:y,width:w,top:k,right:E,bottom:S,left:x}=e.getBoundingClientRect(),{top:C,right:_,bottom:A,left:R}=(e=>{const t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}})(e);let O="start"===l||"nearest"===l?k-C:"end"===l?S+A:k+y/2-C+A,T="center"===i?x+w/2-R+_:"end"===i?E+_:x-R;const I=[];for(let e=0;e=0&&x>=0&&S<=g&&E<=m&&k>=o&&S<=c&&x>=u&&E<=s)return I;const d=getComputedStyle(t),f=parseInt(d.borderLeftWidth,10),C=parseInt(d.borderTopWidth,10),_=parseInt(d.borderRightWidth,10),A=parseInt(d.borderBottomWidth,10);let R=0,P=0;const M="offsetWidth"in t?t.offsetWidth-t.clientWidth-f-_:0,D="offsetHeight"in t?t.offsetHeight-t.clientHeight-C-A:0,N="offsetWidth"in t?0===t.offsetWidth?0:n/t.offsetWidth:0,L="offsetHeight"in t?0===t.offsetHeight?0:r/t.offsetHeight:0;if(p===t)R="start"===l?O:"end"===l?O-g:"nearest"===l?eo(v,v+g,g,C,A,v+O,v+O+y,y):O-g/2,P="start"===i?T:"center"===i?T-m/2:"end"===i?T-m:eo(b,b+m,m,f,_,b+T,b+T+w,w),R=Math.max(0,R+v),P=Math.max(0,P+b);else{R="start"===l?O-o-C:"end"===l?O-c+A+D:"nearest"===l?eo(o,c,r,C,A+D,O,O+y,y):O-(o+r/2)+D/2,P="start"===i?T-u-f:"center"===i?T-(u+n/2)+M/2:"end"===i?T-s+_+M:eo(u,s,n,f,_+M,T,T+w,w);const{scrollLeft:e,scrollTop:a}=t;R=0===L?0:Math.max(0,Math.min(a+R/L,t.scrollHeight-r/L+D)),P=0===N?0:Math.max(0,Math.min(e+P/N,t.scrollWidth-n/N+M)),O+=a-R,T+=e-P}I.push({el:t,top:R,left:P})}return I})(e,{boundary:t,block:"nearest",scrollMode:"if-needed"});r.forEach((function(e){var t=e.el,r=e.top,n=e.left;t.scrollTop=r,t.scrollLeft=n}))}},environment:"undefined"==typeof window?void 0:window};function xo(e,t,r){void 0===r&&(r=go);var n=e["default"+wo(t)];return void 0!==n?n:r[t]}function Co(e,t,r){void 0===r&&(r=go);var n=e[t];if(void 0!==n)return n;var o=e["initial"+wo(t)];return void 0!==o?o:xo(e,t,r)}function _o(e){var t=Co(e,"selectedItem"),r=Co(e,"isOpen"),n=function(e){var t=Co(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}(e),o=Co(e,"inputValue");return{highlightedIndex:n<0&&t&&r?e.items.findIndex((function(r){return e.itemToKey(r)===e.itemToKey(t)})):n,isOpen:r,selectedItem:t,inputValue:o}}function Ao(e,t,r){var n=e.items,o=e.initialHighlightedIndex,s=e.defaultHighlightedIndex,a=e.isItemDisabled,l=e.itemToKey,i=t.selectedItem,c=t.highlightedIndex;return 0===n.length?-1:void 0===o||c!==o||a(n[o],o)?void 0===s||a(n[s],s)?i?n.findIndex((function(e){return l(i)===l(e)})):r<0&&!a(n[n.length-1],n.length-1)?n.length-1:r>0&&!a(n[0],0)?0:-1:s:o}var Ro=function(){return oo};function Oo(r,n,o,s){void 0===s&&(s={});var a,l=s.document,i=(a=t().useRef(!0),t().useEffect((function(){return a.current=!1,function(){a.current=!0}}),[]),a.current);(0,e.useEffect)((function(){if(r&&!i&&l){var e=r(n);bo(e,l)}}),o),(0,e.useEffect)((function(){return function(){var e,t;bo.cancel(),(t=null==(e=l)?void 0:e.getElementById("a11y-status-message"))&&t.remove()}}),[l])}var To=oo;function Io(e,t,r){var n;return void 0===r&&(r=!0),Zn({isOpen:!1,highlightedIndex:-1},(null==(n=e.items)?void 0:n.length)&&t>=0&&Zn({selectedItem:e.items[t],isOpen:xo(e,"isOpen"),highlightedIndex:xo(e,"highlightedIndex")},r&&{inputValue:e.itemToString(e.items[t])}))}function Po(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function Mo(e){var t=xo(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var Do=Zn({},{environment:Kn().shape({addEventListener:Kn().func.isRequired,removeEventListener:Kn().func.isRequired,document:Kn().shape({createElement:Kn().func.isRequired,getElementById:Kn().func.isRequired,activeElement:Kn().any.isRequired,body:Kn().any.isRequired}).isRequired,Node:Kn().func.isRequired}),itemToString:Kn().func,itemToKey:Kn().func,stateReducer:Kn().func},{getA11yStatusMessage:Kn().func,highlightedIndex:Kn().number,defaultHighlightedIndex:Kn().number,initialHighlightedIndex:Kn().number,isOpen:Kn().bool,defaultIsOpen:Kn().bool,initialIsOpen:Kn().bool,selectedItem:Kn().any,initialSelectedItem:Kn().any,defaultSelectedItem:Kn().any,id:Kn().string,labelId:Kn().string,menuId:Kn().string,getItemId:Kn().func,toggleButtonId:Kn().string,onSelectedItemChange:Kn().func,onHighlightedIndexChange:Kn().func,onStateChange:Kn().func,onIsOpenChange:Kn().func,scrollIntoView:Kn().func});ro(ro({},Do),{items:Kn().array.isRequired,isItemDisabled:Kn().func});var No=ro(ro({},So),{isItemDisabled:function(){return!1}}),Lo=oo,zo=0,Bo=1,jo=2,Fo=3,Vo=4,$o=5,Wo=6,Uo=7,Ho=8,qo=9,Go=10,Zo=11,Yo=12,Ko=13,Xo=14,Qo=15,Jo=16,es=17,ts=18,rs=19,ns=20,os=21,ss=Object.freeze({__proto__:null,FunctionCloseMenu:es,FunctionOpenMenu:Jo,FunctionReset:os,FunctionSelectItem:rs,FunctionSetHighlightedIndex:ts,FunctionSetInputValue:ns,FunctionToggleMenu:Qo,ItemClick:Xo,ItemMouseMove:Ko,MenuMouseLeave:Yo,ToggleButtonBlur:Zo,ToggleButtonClick:zo,ToggleButtonKeyDownArrowDown:Bo,ToggleButtonKeyDownArrowUp:jo,ToggleButtonKeyDownCharacter:Fo,ToggleButtonKeyDownEnd:Wo,ToggleButtonKeyDownEnter:Uo,ToggleButtonKeyDownEscape:Vo,ToggleButtonKeyDownHome:$o,ToggleButtonKeyDownPageDown:Go,ToggleButtonKeyDownPageUp:qo,ToggleButtonKeyDownSpaceButton:Ho});function as(e,t){var r,n,o=t.type,s=t.props,a=t.altKey;switch(o){case Xo:n={isOpen:xo(s,"isOpen"),highlightedIndex:Mo(s),selectedItem:s.items[t.index]};break;case Fo:var l=t.key,i=""+e.inputValue+l;n={inputValue:i,highlightedIndex:function(e){for(var t=e.keysSoFar,r=e.highlightedIndex,n=e.items,o=e.itemToString,s=e.isItemDisabled,a=t.toLowerCase(),l=0;l=0&&(null==(r=s.items)?void 0:r.length)&&{selectedItem:s.items[e.highlightedIndex]});break;case rs:n={selectedItem:t.selectedItem};break;default:return function(e,t,r){var n,o=t.type,s=t.props;switch(o){case r.ItemMouseMove:n={highlightedIndex:t.disabled?-1:t.index};break;case r.MenuMouseLeave:n={highlightedIndex:-1};break;case r.ToggleButtonClick:case r.FunctionToggleMenu:n={isOpen:!e.isOpen,highlightedIndex:e.isOpen?-1:Ao(s,e,0)};break;case r.FunctionOpenMenu:n={isOpen:!0,highlightedIndex:Ao(s,e,0)};break;case r.FunctionCloseMenu:n={isOpen:!1};break;case r.FunctionSetHighlightedIndex:n={highlightedIndex:s.isItemDisabled(s.items[t.highlightedIndex],t.highlightedIndex)?-1:t.highlightedIndex};break;case r.FunctionSetInputValue:n={inputValue:t.inputValue};break;case r.FunctionReset:n={highlightedIndex:Mo(s),isOpen:xo(s,"isOpen"),selectedItem:xo(s,"selectedItem"),inputValue:xo(s,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return Zn({},e,n)}(e,t,ss)}return Zn({},e,n)}var ls=["onClick"],is=["onMouseLeave","refKey","ref"],cs=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],us=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function ds(t){void 0===t&&(t={}),Lo(t,ds);var r=Zn({},No,t),n=r.scrollIntoView,o=r.environment,s=r.getA11yStatusMessage,a=function(e,t,r,n){var o=Eo(e,t,r,n),s=o[0],a=o[1];return[co(s,t),a]}(as,r,_o,Po),l=a[0],i=a[1],c=l.isOpen,u=l.highlightedIndex,d=l.selectedItem,p=l.inputValue,h=(0,e.useRef)(null),f=(0,e.useRef)(null),m=(0,e.useRef)({}),g=(0,e.useRef)(null),b=yo(r),v=ko({state:l,props:r}),y=(0,e.useCallback)((function(e){return m.current[b.getItemId(e)]}),[b]);Oo(s,l,[c,u,d,p],o);var w=function(t){var r=t.highlightedIndex,n=t.isOpen,o=t.itemRefs,s=t.getItemNodeFromIndex,a=t.menuElement,l=t.scrollIntoView,i=(0,e.useRef)(!0);return vo((function(){r<0||!n||!Object.keys(o.current).length||(!1===i.current?i.current=!0:l(s(r),a))}),[r]),i}({menuElement:f.current,highlightedIndex:u,isOpen:c,itemRefs:m,scrollIntoView:n,getItemNodeFromIndex:y});(0,e.useEffect)((function(){return g.current=ao((function(e){e({type:ns,inputValue:""})}),500),function(){g.current.cancel()}}),[]),(0,e.useEffect)((function(){p&&g.current(i)}),[i,p]),To({props:r,state:l}),(0,e.useEffect)((function(){Co(r,"isOpen")&&h.current&&h.current.focus()}),[]);var k=function(t,r,n){var o=(0,e.useRef)({isMouseDown:!1,isTouchMove:!1,isTouchEnd:!1});return(0,e.useEffect)((function(){if(!t)return oo;var e=n.map((function(e){return e.current}));function s(){o.current.isTouchEnd=!1,o.current.isMouseDown=!0}function a(n){o.current.isMouseDown=!1,ho(n.target,e,t)||r()}function l(){o.current.isTouchEnd=!1,o.current.isTouchMove=!1}function i(){o.current.isTouchMove=!0}function c(n){o.current.isTouchEnd=!0,o.current.isTouchMove||ho(n.target,e,t,!1)||r()}return t.addEventListener("mousedown",s),t.addEventListener("mouseup",a),t.addEventListener("touchstart",l),t.addEventListener("touchmove",i),t.addEventListener("touchend",c),function(){t.removeEventListener("mousedown",s),t.removeEventListener("mouseup",a),t.removeEventListener("touchstart",l),t.removeEventListener("touchmove",i),t.removeEventListener("touchend",c)}}),[n,t,r]),o.current}(o,(0,e.useCallback)((function(){v.current.state.isOpen&&i({type:Zo})}),[i,v]),(0,e.useMemo)((function(){return[f,h]}),[f.current,h.current])),E=Ro("getMenuProps","getToggleButtonProps");(0,e.useEffect)((function(){c||(m.current={})}),[c]);var S=(0,e.useMemo)((function(){return{ArrowDown:function(e){e.preventDefault(),i({type:Bo,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),i({type:jo,altKey:e.altKey})},Home:function(e){e.preventDefault(),i({type:$o})},End:function(e){e.preventDefault(),i({type:Wo})},Escape:function(){v.current.state.isOpen&&i({type:Vo})},Enter:function(e){e.preventDefault(),i({type:v.current.state.isOpen?Uo:zo})},PageUp:function(e){v.current.state.isOpen&&(e.preventDefault(),i({type:qo}))},PageDown:function(e){v.current.state.isOpen&&(e.preventDefault(),i({type:Go}))}," ":function(e){e.preventDefault();var t=v.current.state;t.isOpen?t.inputValue?i({type:Fo,key:" "}):i({type:Ho}):i({type:zo})}}}),[i,v]),x=(0,e.useCallback)((function(){i({type:Qo})}),[i]),C=(0,e.useCallback)((function(){i({type:es})}),[i]),_=(0,e.useCallback)((function(){i({type:Jo})}),[i]),A=(0,e.useCallback)((function(e){i({type:ts,highlightedIndex:e})}),[i]),R=(0,e.useCallback)((function(e){i({type:rs,selectedItem:e})}),[i]),O=(0,e.useCallback)((function(){i({type:os})}),[i]),T=(0,e.useCallback)((function(e){i({type:ns,inputValue:e})}),[i]),I=(0,e.useCallback)((function(e){var t=void 0===e?{}:e,r=t.onClick,n=Gn(t,ls);return Zn({id:b.labelId,htmlFor:b.toggleButtonId,onClick:lo(r,(function(){var e;null==(e=h.current)||e.focus()}))},n)}),[b]),P=(0,e.useCallback)((function(e,t){var r,n=void 0===e?{}:e,o=n.onMouseLeave,s=n.refKey,a=void 0===s?"ref":s,l=n.ref,c=Gn(n,is),u=(void 0===t?{}:t).suppressRefError;return E("getMenuProps",void 0!==u&&u,a,f),Zn(((r={})[a]=io(l,(function(e){f.current=e})),r.id=b.menuId,r.role="listbox",r["aria-labelledby"]=c&&c["aria-label"]?void 0:""+b.labelId,r.onMouseLeave=lo(o,(function(){i({type:Yo})})),r),c)}),[i,E,b]);return{getToggleButtonProps:(0,e.useCallback)((function(e,t){var r,n=void 0===e?{}:e,o=n.onBlur,s=n.onClick;n.onPress;var a=n.onKeyDown,l=n.refKey,c=void 0===l?"ref":l,u=n.ref,d=Gn(n,cs),p=(void 0===t?{}:t).suppressRefError,f=void 0!==p&&p,m=v.current.state,g=Zn(((r={})[c]=io(u,(function(e){h.current=e})),r["aria-activedescendant"]=m.isOpen&&m.highlightedIndex>-1?b.getItemId(m.highlightedIndex):"",r["aria-controls"]=b.menuId,r["aria-expanded"]=v.current.state.isOpen,r["aria-haspopup"]="listbox",r["aria-labelledby"]=d&&d["aria-label"]?void 0:""+b.labelId,r.id=b.toggleButtonId,r.role="combobox",r.tabIndex=0,r.onBlur=lo(o,(function(){m.isOpen&&!k.isMouseDown&&i({type:Zo})})),r),d);return d.disabled||(g.onClick=lo(s,(function(){i({type:zo})})),g.onKeyDown=lo(a,(function(e){var t=function(e){var t=e.key,r=e.keyCode;return r>=37&&r<=40&&0!==t.indexOf("Arrow")?"Arrow"+t:t}(e);t&&S[t]?S[t](e):function(e){return/^\S{1}$/.test(e)}(t)&&i({type:Fo,key:t})}))),E("getToggleButtonProps",f,c,h),g}),[i,b,v,k,E,S]),getLabelProps:I,getMenuProps:P,getItemProps:(0,e.useCallback)((function(e){var t,r=void 0===e?{}:e,n=r.item,o=r.index,s=r.onMouseMove,a=r.onClick,l=r.onMouseDown;r.onPress;var c=r.refKey,u=void 0===c?"ref":c,d=r.disabled,p=r.ref,h=Gn(r,us);void 0!==d&&console.warn('Passing "disabled" as an argument to getItemProps is not supported anymore. Please use the isItemDisabled prop from useSelect.');var f=v.current,g=f.state,y=f.props,E=function(e,t,r,n){var o,s;if(void 0===e){if(void 0===t)throw new Error(n);o=r[t],s=t}else s=void 0===t?r.indexOf(e):t,o=e;return[o,s]}(n,o,y.items,"Pass either item or index to getItemProps!"),S=E[0],x=E[1],C=y.isItemDisabled(S,x),_=Zn(((t={})[u]=io(p,(function(e){e&&(m.current[b.getItemId(x)]=e)})),t["aria-disabled"]=C,t["aria-selected"]=S===g.selectedItem,t.id=b.getItemId(x),t.role="option",t),h);return C||(_.onClick=lo(a,(function(){i({type:Xo,index:x})}))),_.onMouseMove=lo(s,(function(){k.isTouchEnd||x===g.highlightedIndex||(w.current=!1,i({type:Ko,index:x,disabled:C}))})),_.onMouseDown=lo(l,(function(e){return e.preventDefault()})),_}),[v,b,k,w,i]),toggleMenu:x,openMenu:_,closeMenu:C,setHighlightedIndex:A,selectItem:R,reset:O,setInputValue:T,highlightedIndex:u,isOpen:c,selectedItem:d,inputValue:p}}ds.stateChangeTypes=ss,Zn({},Do,{items:Kn().array.isRequired,isItemDisabled:Kn().func,inputValue:Kn().string,defaultInputValue:Kn().string,initialInputValue:Kn().string,inputId:Kn().string,onInputValueChange:Kn().func}),Zn({},So,{isItemDisabled:function(){return!1}}),Kn().array,Kn().array,Kn().array,Kn().func,Kn().number,Kn().number,Kn().number,Kn().func,Kn().func,Kn().string,Kn().string;const ps=()=>(0,e.createElement)("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16"},(0,e.createElement)("path",{d:"M9.414 8l3.293-3.293-1.414-1.414L8 6.586 4.707 3.293 3.293 4.707 6.586 8l-3.293 3.293 1.414 1.414L8 9.414l3.293 3.293 1.414-1.414L9.414 8z"})),hs=()=>(0,e.createElement)("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16"},(0,e.createElement)("path",{d:"M1 7h14v2H1z"})),fs=()=>(0,e.createElement)("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16"},(0,e.createElement)("path",{d:"M0 7h4v2H0zm6 0h4v2H6zm6 0h4v2h-4z"})),ms=()=>(0,e.createElement)("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 16 16"},(0,e.createElement)("path",{d:"M1 7h2v2H1zm4 0h2v2H5zm4 0h2v2H9zm4 0h2v2h-2z"})),gs=()=>(0,e.createElement)("svg",{"aria-hidden":"true",focusable:"false",width:"16",height:"16",viewBox:"0 0 256 256",style:{opacity:.1}},(0,e.createElement)("rect",{width:"256",height:"256",fill:"none"}),(0,e.createElement)("rect",{x:"32",y:"32",width:"192",height:"192",rx:"16"})),bs=()=>(0,e.createElement)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fillRule:"evenodd","aria-hidden":"true",focusable:"false"},(0,e.createElement)("path",{d:"M18.895,1.105C20.368,2.579 20.368,17.421 18.895,18.895C17.421,20.368 2.579,20.368 1.105,18.895C-0.368,17.421 -0.368,2.579 1.105,1.105C2.579,-0.368 17.421,-0.368 18.895,1.105ZM17.116,2.884C18.295,4.063 18.295,15.937 17.116,17.116C15.937,18.295 4.063,18.295 2.884,17.116C1.705,15.937 1.705,4.063 2.884,2.884C4.063,1.705 15.937,1.705 17.116,2.884Z"}),(0,e.createElement)("path",{d:"M15.93,4.07C16.912,5.053 16.912,14.947 15.93,15.93C14.947,16.912 5.053,16.912 4.07,15.93C3.088,14.947 3.088,5.053 4.07,4.07C5.053,3.088 14.947,3.088 15.93,4.07Z"})),vs=({size:t,...r})=>(0,e.createElement)("svg",{viewBox:"0 0 20 20",width:t||20,height:t||20,...r},(0,e.createElement)("path",{d:"M5 6l5 5 5-5 2 1-7 7-7-7 2-1z",fill:"#0a0a0a",style:{transformOrigin:"center"}})),ys=({size:t,...r})=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:t||24,height:t||24,"aria-hidden":"true",focusable:"false",...r},(0,e.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 18.5A6.5 6.5 0 0 1 6.93 7.931l9.139 9.138A6.473 6.473 0 0 1 12 18.5Zm5.123-2.498a6.5 6.5 0 0 0-9.124-9.124l9.124 9.124ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Z"})),ws=({size:t,...r})=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:t||24,height:t||24,"aria-hidden":"true",focusable:"false",...r},(0,e.createElement)("path",{d:"M14 22H2V10h12v12ZM3.999 12v8h8v-8h-8ZM22 22h-6V10h6v12Zm-4-10v8h2v-8h-2ZM22 8H2V2h20v6ZM4 4v2h16V4H4Z"})),ks=({size:t,...r})=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:t||24,height:t||24,"aria-hidden":"true",focusable:"false",fillRule:"evenodd",...r},(0,e.createElement)("path",{d:"M7.95 22v-6.95H2v-2.1h5.95V5H6l3-3 3 3h-1.95v7.95H19V11l3 3-3 3v-1.95h-8.95V22h-2.1Z"})),Es=({size:t,...r})=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:t||24,height:t||24,"aria-hidden":"true",focusable:"false",fillRule:"evenodd",...r},(0,e.createElement)("path",{d:"M22 2v20H2V2h20Zm-2 2H4v16h16V4Z"}),(0,e.createElement)("path",{d:"M16.586 18H7.414l2-2h5.172l2 2ZM8 9.414v5.172l-2 2V7.414l2 2Zm10 7.172-2-2V9.414l2-2v9.172ZM14.586 8H9.414l-2-2h9.172l-2 2Z"})),Ss=({size:t,...r})=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:t||24,height:t||24,"aria-hidden":"true",focusable:"false",fillRule:"evenodd",...r},(0,e.createElement)("path",{d:"M2 6.036v-4.03c4.298 0 8.596-.026 12.893.001 3.746.071 7.083 3.41 7.107 7.199v12.8h-4.03v-2H20c0-3.645.067-7.29-.002-10.935-.084-2.665-2.439-5.013-5.13-5.064-3.618-.023-7.235-.001-10.852-.001H4v2.03H2Z"}),(0,e.createElement)("path",{d:"M4 10.036v-2H2v2h2ZM4 14.036v-2H2v2h2ZM4 18.031v-2H2v2h2ZM4 22.006v-2H2v2h2Z"}),(0,e.createElement)("path",{d:"M2 20.006h2v2H2zM6 20.006h2v2H6zM10 20.006h2v2h-2zM13.996 20.006h2v2h-2z"})),xs=({size:t,...r})=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:t||24,height:t||24,"aria-hidden":"true",focusable:"false",...r},(0,e.createElement)("path",{d:"m8.824 5.832 4.448 12.164H11.11l-1.304-3.554H5.43a70.44 70.44 0 0 1-.661 1.768c-.214.607-.429 1.197-.643 1.786H2.001L6.448 5.832h2.376ZM7.609 8.386l-1.536 4.323h3.09L7.609 8.386ZM22.002 17.764a3.626 3.626 0 0 1-.446.232 2.065 2.065 0 0 1-.34.125c-.107.036-.196.036-.268.054h-.178c-.215 0-.411-.036-.572-.125a1.361 1.361 0 0 1-.464-.286 2.916 2.916 0 0 1-.34-.447 2.712 2.712 0 0 1-.232-.518c-.268.268-.518.501-.75.661a4.194 4.194 0 0 1-.679.429 2.666 2.666 0 0 1-.679.214 3.101 3.101 0 0 1-.714.072c-.393 0-.768-.072-1.126-.197a2.638 2.638 0 0 1-.893-.536 2.148 2.148 0 0 1-.607-.821 2.698 2.698 0 0 1-.214-1.09c0-.339.071-.643.232-.893.143-.232.357-.464.607-.643.25-.196.536-.339.858-.482.321-.125.66-.25.982-.357.339-.108.679-.215 1-.322.322-.089.608-.196.858-.304.25-.107.464-.232.607-.375a.622.622 0 0 0 .232-.482.808.808 0 0 0-.143-.482 1.185 1.185 0 0 0-.357-.304 2.376 2.376 0 0 0-.5-.161 3.087 3.087 0 0 0-.536-.053c-.179 0-.357.018-.536.071a1.628 1.628 0 0 0-.464.232 1.41 1.41 0 0 0-.375.411c-.09.161-.161.357-.179.59h-2.09c.036-.518.161-.965.375-1.34.215-.393.5-.697.84-.947.339-.25.714-.446 1.143-.571a5.085 5.085 0 0 1 1.286-.179c.464 0 .929.054 1.358.161.428.107.821.268 1.143.5.339.214.607.518.804.857.196.358.285.786.285 1.269v4.322a.42.42 0 0 0 .125.304.363.363 0 0 0 .322.161c.018 0 .071-.018.179-.036.125-.018.267-.072.446-.161v1.447Zm-3.126-4.019a3.016 3.016 0 0 1-.518.214c-.214.072-.446.125-.696.197-.25.071-.501.143-.769.214-.25.072-.464.161-.678.268a1.481 1.481 0 0 0-.5.357.66.66 0 0 0-.197.483c0 .178.036.339.089.464a.814.814 0 0 0 .233.304.706.706 0 0 0 .321.178c.125.036.25.072.375.072.393 0 .804-.143 1.215-.411.429-.268.804-.679 1.125-1.233v-1.107Z",style:{fillRule:"nonzero"}})),Cs=({size:t,...r})=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:t||24,height:t||24,"aria-hidden":"true",focusable:"false",...r},(0,e.createElement)("path",{d:"m17.588 3.708.721.595L4.303 18.31l-.595-.721-.533-.98L16.608 3.176l.98.532ZM14.013 2.202l.565.176-12.2 12.2-.176-.565-.191-1.896L12.116 2.011l1.897.191ZM8.696 2.603 2.602 8.696c.979-2.868 3.238-5.134 6.094-6.093ZM20.29 6.41l.56 1.031L7.441 20.85l-1.032-.56-.677-.559L19.731 5.732l.559.678ZM21.795 9.985l.194 1.921L11.906 21.99l-1.921-.194-.545-.169L21.626 9.441l.169.544ZM21.393 15.31c-.978 2.863-3.236 5.128-6.083 6.083l6.083-6.083Z"})),_s=({size:t,...r})=>(0,e.createElement)("svg",{width:t||24,height:t||24,viewBox:"0 0 24 24",fillRule:"evenodd","aria-hidden":"true",focusable:"false",...r},(0,e.createElement)("path",{d:"M14.694 9.306 21.976 12l-7.282 2.694L12 21.976l-2.694-7.282L2.024 12l7.282-2.694L12 2.024l2.694 7.282Zm-3.832 1.556L7.787 12l3.075 1.138L12 16.213l1.138-3.075L16.213 12l-3.075-1.138L12 7.787l-1.138 3.075Z"}),(0,e.createElement)("path",{d:"m18.746 3.024.81 2.19 2.19.81-2.19.81-.81 2.19-.81-2.19-2.19-.81 2.19-.81.81-2.19ZM18.746 14.976l.81 2.19 2.19.81-2.19.81-.81 2.19-.81-2.19-2.19-.81 2.19-.81.81-2.19Z"})),As=({size:t,...r})=>(0,e.createElement)("svg",{width:t||24,height:t||24,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",...r},(0,e.createElement)("path",{d:"m14.879 16.293 1.414 1.415L12 22l-4.293-4.292 1.415-1.415L12 19.172l2.879-2.879ZM6.293 7.708l1.414 1.414L4.829 12l2.878 2.879-1.414 1.414L2 12l4.293-4.292ZM22 12l-4.293 4.293-1.414-1.414L19.172 12l-2.879-2.878 1.414-1.414L22 12Zm-5.707-5.707-1.414 1.415L12 4.829 9.122 7.708 7.707 6.293 12 2l4.293 4.293ZM14.879 12.05l-2.829 2.829-2.928-2.928 2.829-2.829 2.928 2.928Zm-2.929-.099.099.099-.099-.099Z"})),Rs=({size:t,...r})=>(0,e.createElement)("svg",{width:t||24,height:t||24,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",...r},(0,e.createElement)("path",{d:"M3.013 4h2v2h-2zM3.013 18h2v2h-2zM7.013 4h2v2h-2zM7.013 18h2v2h-2zM11.013 4h2v2h-2zM11.013 18h2v2h-2zM15.008 4h2v2h-2zM15.008 18h2v2h-2zM18.983 4h2v2h-2zM18.983 18h2v2h-2zM20.998 15.12H2.999l4.284-4.286 2.144 2.143 4.714-4.715 6.857 6.858Z"})),Os=({size:t,...r})=>(0,e.createElement)("svg",{width:t||24,height:t||24,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",...r},(0,e.createElement)("path",{fillRule:"nonzero",d:"M3.2 21.491c.688 0 1.226-.538 1.226-1.226 0-.689-.538-1.226-1.226-1.226s-1.226.537-1.226 1.226c0 .688.538 1.226 1.226 1.226Z"}),(0,e.createElement)("path",{fillRule:"nonzero",d:"M11.387 22H12v-1.573h-.446c-1.573 0-2.209-.725-2.209-2.51v-3.179c0-1.606-.803-2.442-2.443-2.61v-.267c1.64-.168 2.443-1.004 2.443-2.611V6.083c0-1.785.636-2.51 2.209-2.51H12V2h-.613C8.709 2 7.516 3.238 7.516 5.837v2.722c0 1.785-.614 2.376-2.432 2.376v2.119c1.818 0 2.432.591 2.432 2.376v2.733c0 2.599 1.238 3.837 3.871 3.837Z"}),(0,e.createElement)("path",{fillRule:"nonzero",d:"M15.698 22h-.614v-1.573h.446c1.573 0 2.209-.725 2.209-2.51v-3.179c0-1.606.803-2.442 2.443-2.61v-.267c-1.64-.168-2.443-1.004-2.443-2.611V6.083c0-1.785-.636-2.51-2.209-2.51h-.446V2h.614c2.677 0 3.87 1.238 3.87 3.837v2.722c0 1.785.614 2.376 2.432 2.376v2.119c-1.818 0-2.432.591-2.432 2.376v2.733c0 2.599-1.238 3.837-3.87 3.837Z"})),Ts=({size:t,...r})=>(0,e.createElement)("svg",{viewBox:"0 0 24 24",width:t||24,height:t||24,"aria-hidden":"true",focusable:"false",...r},(0,e.createElement)("rect",{x:"7.052",y:"10.981",width:"2",height:"2"}),(0,e.createElement)("rect",{x:"11.052",y:"10.981",width:"2",height:"2"}),(0,e.createElement)("rect",{x:"15.052",y:"10.981",width:"2",height:"2"})),Is={button:"HX7SENFhNwuMDRdgiuZQ",control:"qy8hNqqOX4xkf5NfwYLb",open:"CHCZyXypWUjModBDceDo",icon:"h4eVH1fZL9Qf46YwpLgi",dropdown:"zeCnelvoY8EOmsrft4EK",hidden:"h0OYVPSQc6p0AFCOzLu_",item:"UCzS2frgtXOVSPxj7ybx",highlighted:"dc1bjB5c1n79TJVhmfXg",selected:"zoDmD_G5sd6uHUoKgzNk","has-icon":"Mr6EimotnUdjiUt4_toH",help:"O0VtO8JH23MfE8iJw4H6"};function Ps({item:t}){return(0,e.createElement)("span",null,t.label)}function Ms({label:t,onChange:r,id:n,help:s,className:l="",items:i=[],selectedItem:c=null,selectedStyle:u="highlight",defaultText:p=(0,a.__)("Select…","generateblocks-pro"),"aria-labelledby":h,"aria-label":f,itemToString:m=e=>e?e.label:"",ItemComponent:b=Ps}){const v={items:i,itemToString:m,selectedItem:c};r&&(v.onSelectedItemChange=({selectedItem:e})=>{r(e)});const{isOpen:y,getToggleButtonProps:w,getLabelProps:k,getMenuProps:E,highlightedIndex:S,getItemProps:x}=ds(v),C=w({id:n,"aria-describedby":s&&n?`${n}__help`:void 0}),_="icon"===u;return(0,e.createElement)(o.BaseControl,{className:g(Is.control,l),label:t,id:C.id,help:s},(0,e.createElement)("div",{className:Is.header},t&&(0,e.createElement)("div",{...k({className:Is.label})},t),(0,e.createElement)("button",{className:g(Is.button,y&&Is.open),...C},c?(0,e.createElement)(b,{item:c}):p,(0,e.createElement)("span",{className:Is.icon},(0,e.createElement)(vs,{size:"12"})))),(0,e.createElement)("ul",{"aria-labelledby":h,"aria-label":f,className:g(Is.dropdown,!y&&Is.hidden),...E()},y&&i.map(((t,r)=>{const n=c===t,o=S===r;return(0,e.createElement)("li",{key:t.id,className:g(o&&Is.highlighted,!_&&n&&Is.selected,Is.item,_&&Is["has-icon"]),...x({item:t,index:r})},(0,e.createElement)(b,{item:t}),_&&n&&(0,e.createElement)(d,{icon:qn,size:"18"}))}))))}const Ds=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z"})),Ns=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z"})),Ls={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var zs,Bs=new Uint8Array(16);function js(){if(!zs&&!(zs="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return zs(Bs)}for(var Fs=[],Vs=0;Vs<256;++Vs)Fs.push((Vs+256).toString(16).slice(1));const $s=function(e,t,r){if(Ls.randomUUID&&!t&&!e)return Ls.randomUUID();var n=(e=e||{}).random||(e.rng||js)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var o=0;o<16;++o)t[r+o]=n[o];return t}return function(e,t=0){return(Fs[e[t+0]]+Fs[e[t+1]]+Fs[e[t+2]]+Fs[e[t+3]]+"-"+Fs[e[t+4]]+Fs[e[t+5]]+"-"+Fs[e[t+6]]+Fs[e[t+7]]+"-"+Fs[e[t+8]]+Fs[e[t+9]]+"-"+Fs[e[t+10]]+Fs[e[t+11]]+Fs[e[t+12]]+Fs[e[t+13]]+Fs[e[t+14]]+Fs[e[t+15]]).toLowerCase()}(n)},Ws=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"})),Us=window.wp.hooks,Hs=window.wp.blockEditor,qs=window.wp.htmlEntities;var Gs=r(2895);const Zs=Gs;Gs.stringify,Gs.fromJSON,Gs.plugin,Gs.parse,Gs.list,Gs.document,Gs.comment,Gs.atRule,Gs.rule,Gs.decl,Gs.root,Gs.CssSyntaxError,Gs.Declaration,Gs.Container,Gs.Processor,Gs.Document,Gs.Comment,Gs.Warning,Gs.AtRule,Gs.Result,Gs.Input,Gs.Rule,Gs.Root,Gs.Node;var Ys=r(3268),Ks=r.n(Ys),Xs=r(691),Qs=r.n(Xs),Js=r(7307),ea=r.n(Js);const ta={a:"a:where(:not(.components-external-link))",button:"button:where(:not(.components-button))"};function ra(e){let t="",r="",n="";return e.forEach((e=>{const{prop:o,value:s}=e;o.includes("width")?t=s:o.includes("style")?r=s:o.includes("color")&&(n=s)})),t&&r&&n?`${t} ${r} ${n}`:""}function na(e){let t="",r="",n="",o="";return e.forEach((e=>{const{prop:s,value:a}=e;s.includes("top")?t=a:s.includes("right")?r=a:s.includes("bottom")?n=a:s.includes("left")&&(o=a)})),[t,r,n,o].some((e=>""===e))?"":t===n&&r===o?t===r?t:`${t} ${r}`:`${t} ${r} ${n} ${o}`}const oa=e=>/^([-]?\d|[-]?\.)/.test(e);function sa(e){var t;return e?(null!==(t=generateBlocksEditor?.wpContentUrl)&&void 0!==t?t:location.origin+"/wp-content")+e:""}function aa(e=[]){return e.reduce(((e,t)=>{if(t.hidden)return e;const{type:r,backgroundAttachment:n="",backgroundImage:o="",backgroundSize:s="",backgroundRepeat:a="",backgroundPosition:l=""}=t;if(!o)return e;let i="";return o&&(i+=`${o.replaceAll("'","").replaceAll('"',"")}`),"image"===r&&(l&&(i+=` ${l}`),s&&(l||(i+="0% 0% "),i+=` / ${s}`),a&&(i+=` ${a}`),n&&(i+=` ${n}`)),i.length?e.length>0?`${e}, ${i}`:`${i}`:e}),"").replace(/,$/,"").trim()}function la(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}const ia=/(?:#(?:[0-9a-fA-F]{3}){1,2}|(?:rgb|rgba|hsl|hsla)\(\s*\d+%?\s*(?:,\s*\d+%?\s*){2,3}(?:,\s*(?:0?\.\d+|1|100%))?\))/g,ca=/(linear-gradient|radial-gradient)\([^)]*\)(?:\s*\d+%?,\s*(?:rgba?\([^)]*\)|#[0-9a-fA-F]+)\s*\d*%?)+\s*\)|url\([^)]*\)[^,)]*/g;function ua(e=""){const t=sa("/plugins/generateblocks-pro/dist/assets/placeholder-lg.min.jpg");return""===e?{type:"image",media:{selectedSize:"full",sizes:{}},backgroundAttachment:"",backgroundImage:`url(${t})`,backgroundPosition:"center",backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundBlendMode:"normal"}:{type:"image",media:{id:0},backgroundAttachment:"",backgroundImage:"",backgroundPosition:"",backgroundSize:"",backgroundRepeat:"",backgroundBlendMode:""}}function da(){const e="rgba(0, 0, 0, .25)",t=`linear-gradient(to right, ${e} 0%, ${e} 100%)`;return{...ua(),type:"overlay",backgroundBlendMode:"normal",backgroundImage:t,overlayColor:e}}function pa(e){const t=e.replace(/^(linear-gradient|radial-gradient)\(|\)$/g,"").trim(),r={type:e.includes("linear-gradient")?"linear-gradient":"radial-gradient",angle:null,colorStops:[]};let n=t;const o=n.match(/^(to\s+(?:top|bottom|left|right)(?:\s+(?:top|bottom|left|right))?|\d+deg|circle|ellipse(?:\s+at\s+center)?|closest-side|closest-corner|farthest-side|farthest-corner)/);for(o&&(r.angle=o[0],n=n.slice(o[0].length).trim());n.length>0;){let e="",t=0;for(let r=0;re.prop&&e.prop.startsWith("background-")));if(0===n.length)return;const o=null!==(r=n.find((e=>"background-image"===e.prop)))&&void 0!==r?r:{value:""},s=Ia(o.value);if(s&&s.length>1)try{var a,l,i,c;const r=null!==(a=n.find((e=>"background-attachment"===e.prop)))&&void 0!==a?a:{value:""},s=null!==(l=n.find((e=>"background-size"===e.prop)))&&void 0!==l?l:{value:""},u=null!==(i=n.find((e=>"background-repeat"===e.prop)))&&void 0!==i?i:{value:""},d=null!==(c=n.find((e=>"background-position"===e.prop)))&&void 0!==c?c:{value:""},p=Pa({backgroundAttachment:r.value,backgroundSize:s.value,backgroundImage:o.value,backgroundRepeat:u.value,backgroundPosition:d.value});n.forEach((t=>{const r=t.prop;e.includes(r)&&t.remove()})),t.append(Zs.decl({prop:"background",value:aa(p)}))}catch(e){console.error(e.messsage)}}return{postcssPlugin:"combine-background-properties",Once(e){const r=e.nodes.filter((e=>"rule"===e.type)),n=e.nodes.filter((e=>"atrule"===e.type));r.forEach(t),n.forEach((e=>{e.nodes.forEach(t)}))}}}const fa=/(!?\(\s*min(-device)?-width)(.|\n)+\(\s*max(-device)?-width|\(\s*width\s*>(=)?(.|\n)+\(\s*width\s*<(=)?|(!?\(.*<(=)?\s*width\s*<(=)?)/i,ma=/(!?\(\s*max(-device)?-width)(.|\n)+\(\s*min(-device)?-width|\(\s*width\s*<(=)?(.|\n)+\(\s*width\s*>(=)?|(!?\(.*>(=)?\s*width\s*>(=)?)/i,ga=_a(fa,ma,/\(\s*min(-device)?-width|\(\s*width\s*>(=)?/i),ba=_a(ma,fa,/\(\s*max(-device)?-width|\(\s*width\s*<(=)?/i),va=/(!?\(\s*min(-device)?-height)(.|\n)+\(\s*max(-device)?-height|\(\s*height\s*>(=)?(.|\n)+\(\s*height\s*<(=)?|(!?\(.*<(=)?\s*height\s*<(=)?)/i,ya=/(!?\(\s*max(-device)?-height)(.|\n)+\(\s*min(-device)?-height|\(\s*height\s*<(=)?(.|\n)+\(\s*height\s*>(=)?|(!?\(.*>(=)?\s*height\s*>(=)?)/i,wa=_a(va,ya,/\(\s*min(-device)?-height|\(\s*height\s*>(=)?/i),ka=_a(ya,va,/\(\s*max(-device)?-height|\(\s*height\s*<(=)?/i),Ea=/print/i,Sa=/^print$/i,xa=Number.MAX_VALUE;function Ca(e){let t=/(-?\d*\.?\d+)(ch|em|ex|px|rem)/.exec(e);if(null===t&&(ga(e)||wa(e))&&(t=/(\d)/.exec(e)),"0"===t)return 0;if(null===t)return xa;let r=t[1];switch(t[2]){case"ch":r=8.8984375*parseFloat(r);break;case"em":case"rem":r=16*parseFloat(r);break;case"ex":r=8.296875*parseFloat(r);break;case"px":r=parseFloat(r)}return+r}function _a(e,t,r){return function(n){return!!e.test(n)||!t.test(n)&&r.test(n)}}const Aa=!0;function Ra(e,t){const r=function(e,t){const r=Ea.test(e),n=Sa.test(e),o=Ea.test(t),s=Sa.test(t);return r&&o?!n&&s?1:n&&!s?-1:e.localeCompare(t):r?1:o?-1:null}(e,t);if(null!==r)return r;const n=ga(e)||wa(e),o=ba(e)||ka(e),s=ga(t)||wa(t),a=ba(t)||ka(t);if(Aa&&(!n&&!o||!s&&!a))return n||o||s||a?s||a?-1:1:e.localeCompare(t);if(n&&a)return-1;if(o&&s)return 1;const l=Ca(e),i=Ca(t);return l===xa&&i===xa?e.localeCompare(t):l===xa?1:i===xa?-1:l>i?o?-1:1:l{if(e.onlyTopLevel&&"root"===t.parent.type){const e=t.params;n[e]||(n[e]=new r({name:t.name,params:t.params,source:t.source})),t.nodes.forEach((t=>{n[e].append(t.clone())})),t.remove()}if(!e.onlyTopLevel){const e=t.params;n[e]||(n[e]=new r({name:t.name,params:t.params,source:t.source})),t.nodes.forEach((t=>{n[e].append(t.clone())})),t.remove()}})),n&&Object.keys(n).sort(Ra).forEach((e=>{t.append(n[e])}))}}}function Ta(e){let t=e.trim();t=t.replace(/url\s*\(\s*(['"]?)([^)]*)\)?/g,((e,t,r)=>`url('${r=r.replace(/^['"]|['"]$/g,"")}')`));const r=[];let n="";for(let e=0;e0))continue;r.pop()}n+=o}return n+=")".repeat(r.length),(n.match(/"/g)||[]).length%2!=0&&(n+='"'),n}function Ia(e){return v(e)}function Pa({backgroundAttachment:e="",backgroundImage:t="",backgroundSize:r="",backgroundRepeat:n="",backgroundPosition:o="",backgroundBlendMode:s=""}){const a=/(?:#(?:[0-9a-fA-F]{3}){1,2}|(?:rgb|rgba|hsl|hsla)\(\s*\d+%?\s*(?:,\s*\d+%?\s*){2,3}(?:,\s*(?:0?\.\d+|1|100%))?\)|var\(--[^\s)]+\))/g,l=e.split(","),i=r.split(","),c=n.split(","),u=o.split(","),d=Ia(t),p=s.split(",");let h=0;const f=[];for(;he===n[0]))&&(t="overlay",r=n[0])}f.push({backgroundAttachment:null!==(m=l[h])&&void 0!==m?m:"",backgroundSize:null!==(g=i[h])&&void 0!==g?g:"",backgroundRepeat:null!==(b=c[h])&&void 0!==b?b:"",backgroundPosition:null!==(v=u[h])&&void 0!==v?v:"",backgroundImage:d[h],backgroundBlendMode:null!==(y=p[h])&&void 0!==y?y:"",type:t,overlayColor:r,media:{id:0}}),h++}return f}function Ma(e){const t={atRules:{},nestedRules:{},propertyRules:{}};function r(e={},t={}){return"object"!=typeof t||null===t||Array.isArray(t)?e:Object.entries(t).reduce(((e,[t,r])=>{const n=e?.[t],o=!("object"!=typeof n||null===n||Array.isArray(n)||n instanceof ja||"object"!=typeof r||null===r||Array.isArray(r)||r instanceof ja);return e[t]=o?{...n,...r}:r,e}),{...e})}for(const[o,s]of Object.entries(e))if(o.startsWith("@")){var n;const e=null!==(n=t?.atRules?.[o])&&void 0!==n?n:{};t.atRules[o]=r(e,s)}else"object"==typeof s?Object.entries(s).forEach((([e,n])=>{if(e.startsWith("@")){var s,a;const l=null!==(s=t?.atRules?.[e])&&void 0!==s?s:{},i=null!==(a=l?.[o])&&void 0!==a?a:{};t.atRules[e]={...l,[o]:r(i,n)}}else{var l;const r=null!==(l=t?.nestedRules?.[o])&&void 0!==l?l:{};t.nestedRules[o]={...r,[e]:n}}})):t.propertyRules[o]=s;function o(e){return Object.keys(e).sort().reduce(((t,r)=>(t[r]=e[r],t)),{})}return{atRules:o(t.atRules),nestedRules:o(t.nestedRules),propertyRules:o(t.propertyRules)}}function Da(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function Na(e,t,r){e+=`${t} {`;const n=r&&"object"==typeof r?Object.entries(r):[];for(let[t,r]of n)"settings"!==t&&(t=Da(t),C(t)&&null!=r&&(e+=`${t}:${Ta(r.toString())};`));return e+"}"}function La(e,t=""){const r=(0,qs.decodeEntities)(t);if(!r)return e;const n=v(e),o=v(r),s=[];return n.forEach((e=>{o.forEach((t=>{s.push(t.startsWith("&")?e+t.replace("&",""):e+" "+t)}))})),s.join(",")}async function za(e,t,r="frontend"){var n;const o=(0,Us.applyFilters)("generateStylesBuilder.rawCss",function(e,t){if(!e)return"";let r="";if((t=Ma(t)).propertyRules&&Object.keys(t.propertyRules).length>0&&(r=Na(r,La(e),t.propertyRules)),t.nestedRules&&Object.keys(t.nestedRules).length>0)for(const n in t.nestedRules)r=Na(r,La(e,n),t.nestedRules[n]);if(t.atRules&&Object.keys(t.atRules).length>0)for(const n in t.atRules){const o=Ma(t.atRules[n]);if(r+=`${n} {`,o.propertyRules&&Object.keys(o.propertyRules).length>0&&(r=Na(r,e,o.propertyRules)),o.nestedRules&&Object.keys(o.nestedRules).length>0)for(const t in o.nestedRules)r=Na(r,La(e,t),o.nestedRules[t]);r+="}"}return r}(e,t)),s=[{css:o}],a="editor"===r?(0,Hs.transformStyles)(s,".editor-styles-wrapper")?.[0]:o;let l=[{postcssPlugin:"gb-editor-transforms",Rule(e){let t=e.selector;Object.keys(ta).forEach((e=>{const r=new RegExp(`(^|\\s|>|\\+|~)(${e})(\\s|$|>|\\+|~)(?!:where)`,"g");t=t.replace(r,`$1${ta[e]}$3`)})),e.selector=t}},ea()({"properties-order":"alphabetical"})];"frontend"===r&&(l=[Ks()(),ea()({"properties-order":"alphabetical"}),{postcssPlugin:"gb-merge-longhand",OnceExit(e){e.walkRules((e=>{const t=e.nodes.filter((e=>e.prop&&e.prop.startsWith("border-")&&!e.prop.includes("radius"))),r=e.nodes.filter((e=>e.prop&&e.prop.startsWith("border-")&&e.prop.includes("radius"))),n=e.nodes.filter((e=>e.prop&&e.prop.startsWith("margin-"))),o=e.nodes.filter((e=>e.prop&&e.prop.startsWith("padding-")));if(t){const r=[],n=t.filter((e=>e.prop.startsWith("border-top"))),o=t.filter((e=>e.prop.startsWith("border-right"))),s=t.filter((e=>e.prop.startsWith("border-bottom"))),a=t.filter((e=>e.prop.startsWith("border-left"))),l={top:!1,left:!1,bottom:!1,right:!1},i=ra(n);i&&(r.push(ra(n)),l.top=!0);const c=ra(o);c&&(r.push(ra(o)),l.right=!0);const u=ra(s);u&&(r.push(ra(s)),l.bottom=!0);const d=ra(a);d&&(r.push(ra(a)),l.left=!0),4===r.length&&r.every((e=>e===r[0]))?(e.append({prop:"border",value:r[0]}),t.forEach((e=>e.remove()))):(l.top&&(e.append({prop:"border-top",value:i}),n.forEach((e=>e.remove()))),l.right&&(e.append({prop:"border-right",value:c}),o.forEach((e=>e.remove()))),l.bottom&&(e.append({prop:"border-bottom",value:u}),s.forEach((e=>e.remove()))),l.left&&(e.append({prop:"border-left",value:d}),a.forEach((e=>e.remove()))))}if(4===r.length){const t=function(e){let t="",r="",n="",o="";return e.forEach((e=>{const{prop:s,value:a}=e;s.includes("top-left")?t=a:s.includes("top-right")?r=a:s.includes("bottom-right")?n=a:s.includes("bottom-left")&&(o=a)})),t&&r&&n&&o?t===n&&r===o?t===r?t:`${t} ${r}`:`${t} ${r} ${n} ${o}`:""}(r);e.append({prop:"border-radius",value:t}),r.forEach((e=>e.remove()))}if(4===n.length){const t=na(n);e.append({prop:"margin",value:t}),n.forEach((e=>e.remove()))}if(4===o.length){const t=na(o);e.append({prop:"padding",value:t}),o.forEach((e=>e.remove()))}})),e.rawCache={beforeDecl:"",beforeRule:"",colon:":",indent:"",after:"",semicolon:!0}}},ha(),Oa(),Qs()()]);const i=await Zs(l).process(a,{from:void 0}).catch((e=>{console.error(e.message)}));return null!==(n=i?.css)&&void 0!==n?n:a}function Ba(e){return"object"!=typeof e||null===e?{}:Object.entries(e).reduce(((e,[t,r])=>{if(r instanceof ja)e[t]=r;else if("object"!=typeof r||null===r||Array.isArray(r)){if(""!==r&&null!=r){const n=r.toString().replace(";","").replace("{","").replace("}","");e[t]=n}}else{const n=Ba(r);Object.keys(n).length>0&&(e[t]=n)}return e}),{})}class ja{constructor({value:e,settings:t=[]}){this.value=e,this.settings=t}toString(){return this.value}}function Fa(e,t,r,n,o){let s={};const a="object"==typeof r&&null!==r?new ja(r):r;if(o){var l;const r=null!==(l=e?.[o])&&void 0!==l?l:{};if(n){var i;const l=null!==(i=e?.[o]?.[n])&&void 0!==i?i:{};s={...e,[o]:{...r,[n]:{...l,[t]:a}}}}else s={...e,[o]:{...r,[t]:a}}}else if(n){var c;const r=null!==(c=e?.[n])&&void 0!==c?c:{};s={...e,[n]:{...r,[t]:a}}}else s={...e,[t]:a};return Ba(s)}function Va(e,t,r,n=""){const o={},s=n&&t.startsWith("@"),a=s?e[n]:e;return Object.entries(a).forEach((([e,n])=>{e===t?o[r]=n:o[e]=n})),s?{...e,[n]:o}:o}function $a(e,t,r=""){const n={},o=r&&t.startsWith("@"),s=o?e[r]:e;return Object.entries(s).forEach((([e,r])=>{e!==t&&(n[e]=r)})),o?{...e,[r]:n}:n}function Wa(e,t="",r=""){return"object"!=typeof e||Array.isArray(e)?{}:r?t?null!==(o=e?.[r]?.[t])&&void 0!==o?o:{}:null!==(n=e?.[r])&&void 0!==n?n:{}:t?null!==(s=e?.[t])&&void 0!==s?s:{}:null!=e?e:{};var n,o,s}function Ua(e){return"CSSMediaRule"===e.constructor.name?{name:"media",type:CSSMediaRule}:"CSSSupportsRule"===e.constructor.name?{name:"supports",type:CSSSupportsRule}:"CSSContainerRule"===e.constructor.name?{name:"container",type:window.CSSContainerRule}:{name:"unknown",type:Error}}function Ha({element:e,properties:t,sources:r=["inline","tag"],computedStyles:n=null,deviceAttributes:o={},atRule:s="",nestedRule:a=""}){if(!n||!t||0===t.length)return null;const l=document.querySelector('iframe[name="editor-canvas"]'),i=l?l.contentDocument:document,c=l?l.contentWindow:window;if("loading"===i.readyState&&l)return l.addEventListener("load",(()=>Ha({element:e,properties:t,sources:r,computedStyles:n,deviceAttributes:o,atRule:s,nestedRule:a})),{once:!0}),{source:"other",selector:"",value:""};const u=null!=n?n:{},d={},p=r.includes("tag")?i.querySelectorAll("style"):[],h=r.includes("stylesheet")?i.styleSheets:[],f=["width","height","minWidth","minHeight","maxWidth","maxHeight"],m=["fontFamily","fontSize","fontWeight","letterSpacing","lineHeight","textAlign","textTransform"],g=e=>null!=e&&""!==e;for(const E of t){var b;const S=E.startsWith("padding")||E.startsWith("margin"),x=f.includes(E),C=E.startsWith("border");if(m.includes(E)){var v;const O=null!==(v=o?.typography?.[E])&&void 0!==v?v:"";if(g(O)){d[E]={source:"local",selector:"",value:O};continue}}else if(C){var y;const T=null!==(y=o?.borders?.[E])&&void 0!==y?y:"";if(g(T)){d[E]={source:"local",selector:"",value:T};continue}}else if(S){var w;const I=null!==(w=o?.spacing?.[E])&&void 0!==w?w:"";if(g(I)){d[E]={source:"local",selector:"",value:I};continue}}else if(x){var k;const P=null!==(k=o?.sizing?.[E])&&void 0!==k?k:"";if(g(P)){d[E]={source:"local",selector:"",value:P};continue}}else if(g(o?.[E])){d[E]={source:"local",selector:"",value:o[E]};continue}const _=null!==(b=u[E])&&void 0!==b?b:null;if(null===_){d[E]={source:null,selector:"",value:_};continue}const A=[".editor-styles-wrapper .gb-container, .editor-styles-wrapper .gb-headline, .editor-styles-wrapper .gb-button"];function R(t,r,o=""){for(const s of t){const t=!!s?.cssRules&&s.cssRules.length>0,i=!!s?.conditionText;if("CSSStyleRule"===s.constructor.name){let t=E in s.style?s.style[E]:null;if(t?.startsWith("var(")&&(e.style[E]=t,t=u[E]||t,e.style[E]=""),!g(t))continue;if(A.includes(s.selectorText))continue;if(o){const e=o.replace("@media ",""),t=c.matchMedia(e).matches;if(l&&l.contentWindow?.innerWidth+"px"!==l.style.width)continue;if(!t)continue}if(wt(s.selectorText).some((e=>"pseudo-class"===e.type))&&!a)continue;if(e.matches(s.selectorText)){let a=!1;if(S||x||C||["fontSize","lineHeight","letterSpacing","transform"].includes(E)){e.style[E]=t;const r=n?.[E];e.style[E]="",r===_&&(a=!0)}else t===_&&(a=!0);if(a){d[E]={source:r,selector:s.selectorText,value:_,valueRaw:t,atRule:o};break}}}else if(t&&i){const e=Ua(s);if("media"!==e.name)return;const t=D(`@${e.name} ${s.conditionText}`);R(s.cssRules,r,t)}}}if(r.includes("inline")&&!s){const M=e.style[E];if(M&&null!==_){d[E]={source:"inline",selector:"",value:_,valueRaw:M};continue}}if(r.includes("tag")){for(const N of p)try{R(N.sheet.cssRules,"tag")}catch(L){console.error(L.message)}if(E in d)continue}if(r.includes("stylesheet")){for(const z of h)try{R(z.rules||z.cssRules,"stylesheet")}catch(B){console.error("Error accessing stylesheet:",B.message)}if(E in d)continue}d[E]={source:"other",selector:"",value:_}}return d}function qa({elements:e,properties:t,computedStyles:r=null,deviceAttributes:n={},atRule:o="",nestedRule:s="",sources:a=["inline","tag"]}){const l=!Array.isArray(t),i=l?[t]:t;if(Array.isArray(e))return e.map((e=>{const c=Ha({element:e,properties:i,computedStyles:r,deviceAttributes:n,atRule:o,nestedRule:s,sources:a});return l?c[t]:c}));const c=Ha({element:e,properties:i,computedStyles:r,deviceAttributes:n,atRule:o,nestedRule:s,sources:a});return l?c[t]:c}const Ga={all:"",largeWidth:"@media (min-width:1025px)",mediumWidth:"@media (max-width:1024px) and (min-width:768px)",mediumSmallWidth:"@media (max-width:1024px)",mediumLargeWidth:"@media (min-width:768px)",smallWidth:"@media (max-width:767px)"},Za=(0,Us.applyFilters)("generateblocks.styles.defaultAtRules",[{label:(0,a.__)("All screens","generateblocks-pro"),value:"",icon:()=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:"24",height:"24","aria-hidden":"true",focusable:"false"},(0,e.createElement)("path",{d:"M57.128 31.707h5.556v5.556h-5.556zM75.489 50.836h3.703v3.704H75.49z"}),(0,e.createElement)("path",{d:"M93.396 15.181c1.926.074 3.598 1.704 3.673 3.676.263 20.76 0 41.528 0 62.287-.025 1.972-1.691 3.695-3.673 3.769-28.896.37-57.797.009-86.695.009-1.966-.028-3.694-1.695-3.769-3.676-.263-20.76-.001-41.528-.001-62.287.025-1.972 1.692-3.695 3.673-3.778 28.928-.361 57.864-.361 86.792 0Zm-4.772 65.111h3.816V19.811H7.56v60.481h31.664c-.21-17.342.006-34.676.006-52.009.027-2.13 1.792-4.037 4.014-4.12 11.109-.14 22.222-.14 33.331 0 2.113.083 3.93 1.86 4.012 4.009.07 5.565.096 11.12.1 16.685 1.907.01 3.817.028 5.725.046 1.147.047 2.139 1.028 2.183 2.186.14 11.064.15 22.13.03 33.203Zm-3.886 0V48.764H69.946v31.528h14.792Zm-7.962-35.444c-.023-5.51-.045-11.028-.045-16.537 0-.167-.107-.278-.245-.287-11.03-.417-22.075 0-33.112 0-.163 0-.28.11-.285.25-.225 17.333-.005 34.676-.001 52.018H66.06c-.12-11.074-.11-22.139.029-33.203.044-1.149 1.028-2.14 2.183-2.186 2.835-.037 5.67-.055 8.504-.055Z"})),show:!0,id:"all"},{label:(0,a.__)("Desktop","generateblocks-pro"),value:Ga.largeWidth,icon:()=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 417 417",width:"24",height:"24","aria-hidden":"true",focusable:"false"},(0,e.createElement)("path",{d:"M389.233 63.228c7.989.304 14.98 7.083 15.229 15.28 1.082 86.514 0 173.028 0 259.542-.083 8.196-6.99 15.38-15.23 15.684-120.42 1.518-240.84 0-361.26 0-8.155-.101-15.395-7.083-15.728-15.28-1.082-86.513 0-173.028 0-259.542.083-8.196 7.074-15.38 15.312-15.684a13466.862 13466.862 0 0 1 361.677 0ZM31.55 82.454v251.953h353.687V82.454H31.551Z"})),show:!1,id:"largeWidth"},{label:(0,a.__)("Desktop & tablet","generateblocks-pro"),value:Ga.mediumLargeWidth,icon:()=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 417 417",width:"24",height:"24","aria-hidden":"true",focusable:"false"},(0,e.createElement)("path",{d:"M389.145 63.263c8.025.309 15.008 7.099 15.317 15.316 1.08 86.497 0 173.033 0 259.53-.116 8.217-7.06 15.393-15.317 15.702-120.409 1.543-240.818.038-361.227.038-8.179-.115-15.393-7.06-15.702-15.316-1.08-86.497 0-173.032 0-259.53.077-8.217 7.06-15.393 15.317-15.74a14485.169 14485.169 0 0 1 361.612 0Zm-3.973 19.29H31.506v252.006h145.487c-.926-72.762 0-145.524 0-218.287.115-8.873 7.484-16.82 16.705-17.168 46.296-.579 92.592-.579 138.889 0 8.796.347 16.396 7.755 16.744 16.705.926 72.917 0 145.834 0 218.75h35.84V82.553Zm-51.89 252.006c2.7-72.685-.04-145.486-.04-218.21 0-.617-.424-1.119-1.002-1.157-45.988-1.736-91.976 0-137.963 0-.695 0-1.196.463-1.196 1.042-.926 72.762 0 145.524 0 218.325h140.2Z"}),(0,e.createElement)("path",{d:"M251.558 132.111h23.148v23.15h-23.148z"})),show:!1,id:"mediumLargeWidth"},{label:(0,a.__)("Tablet","generateblocks-pro"),value:Ga.mediumWidth,icon:()=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:"24",height:"24","aria-hidden":"true",focusable:"false"},(0,e.createElement)("path",{d:"M0 0h24v24H0z",style:{fill:"none",transform:"scale(4.16667)"}}),(0,e.createElement)("path",{d:"M69.096 15.124c2.445.045 4.626 2.189 4.659 4.673.132 20.139.396 40.278 0 60.417-.066 2.396-2.181 4.525-4.593 4.599a969.265 969.265 0 0 1-38.233 0c-2.412-.074-4.527-2.174-4.61-4.599-.38-20.154-.38-40.322 0-60.491.083-2.395 2.181-4.525 4.61-4.599 12.722-.236 25.444-.074 38.167 0ZM31.06 19.131c-.38 0-.727.311-.743.695-.397 20.08 0 40.175 0 60.255 0 .385.314.725.694.74 12.672.413 25.345 0 38.017 0 .397 0 .727-.34.727-.74.017-20.065.017-40.145 0-60.21 0-.4-.314-.725-.694-.74-12.656-.414-25.328 0-38 0Z"}),(0,e.createElement)("path",{d:"M46.842 22.597h6.4v6.4h-6.4z"})),show:!1,id:"mediumWidth"},{label:(0,a.__)("Tablet & mobile","generateblocks-pro"),value:Ga.mediumSmallWidth,icon:()=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:"24",height:"24","aria-hidden":"true",focusable:"false"},(0,e.createElement)("path",{d:"M42.284 22.603h6.4v6.4h-6.4zM63.082 45.178h4.8v4.8h-4.8z"}),(0,e.createElement)("path",{d:"M61.364 84.873c-11.663.184-23.333.168-34.996-.056-2.4-.072-4.528-2.183-4.6-4.6a1588.412 1588.412 0 0 1 0-60.489c.072-2.4 2.184-4.527 4.6-4.599 12.726-.24 25.453-.08 38.18 0 2.431.04 4.615 2.192 4.663 4.663.04 6.36.088 12.711.128 19.07 2.184.008 4.368.032 6.551.056 1.312.048 2.456 1.184 2.504 2.504.176 13.63.176 27.261 0 40.892-.048 1.32-1.176 2.455-2.504 2.503-4.839.064-9.678.08-14.526.056Zm3.104-65.744H26.504c-.4 0-.728.336-.736.711-.112 20.078 0 40.164 0 60.242 0 .368.32.72.688.736 8.703.28 17.398.176 26.101.088a1665.8 1665.8 0 0 1 .016-39.484c.056-1.32 1.184-2.456 2.504-2.504 3.423-.04 6.839-.064 10.255-.064a1880.03 1880.03 0 0 1-.12-18.99.751.751 0 0 0-.744-.735Zm9.927 23.789H56.573v37.9h17.822v-37.9Z"})),show:!0,id:"mediumSmallWidth"},{label:(0,a.__)("Mobile","generateblocks-pro"),value:Ga.smallWidth,icon:()=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",width:"24",height:"24","aria-hidden":"true",focusable:"false"},(0,e.createElement)("path",{d:"M62.043 23.435c1.52.056 2.841 1.364 2.893 2.897.208 15.781.208 31.563 0 47.333-.052 1.533-1.363 2.84-2.893 2.897-8.025.101-16.06.101-24.085 0-1.53-.056-2.84-1.364-2.903-2.897-.198-15.77-.198-31.552 0-47.333.062-1.522 1.363-2.84 2.903-2.897 8.025-.102 16.06-.102 24.085 0Zm-22.357 4.633V71.94h20.629V28.068H39.686Z"}),(0,e.createElement)("path",{d:"M47.22 30.36h5.556v5.557h-5.555z"})),show:!0,id:"smallWidth"}]);function Ya(e="object"){return"object"===e?Za.reduce(((e,t)=>(e[t.id]=t,e)),{}):Za}function Ka(e){const t=Za.find((t=>t.id===e)),r=Ga[e];return t?.value||r}const Xa=["display","alignItems","justifyContent","justifyItems","justifySelf","alignSelf","gridTemplateColumns","gridTemplateRows","columnGap","rowGap","gridAutoFlow","gridAutoColumns","gridAutoRows","gridTemplateAreas","gridColumn","gridRow","gridArea","order","flexDirection","flexWrap","flexGrow","flexShrink","flexBasis","containerType","containerName","float","clear"],Qa=["width","height","minWidth","minHeight","maxWidth","maxHeight","aspectRatio"],Ja=["paddingTop","paddingRight","paddingBottom","paddingLeft","marginTop","marginRight","marginBottom","marginLeft"],el=["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],tl=["color","fontSize","fontWeight","fontStyle","textAlign","textTransform","textDecoration","lineHeight","letterSpacing","fontFamily","whiteSpace","textWrap"],rl=["background","backgroundColor","backgroundClip","backgroundOrigin","backgroundBlendMode","backgroundAttachment","backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat"],nl=["position","overflowX","overflowY","zIndex","top","right","bottom","left"],ol=["backdropFilter","boxShadow","filter","mixBlendMode","opacity","transform","transformOrigin","transition","visibility","textShadow"],sl=["objectFit","objectPosition"],al=["listStyleType","listStyleImage","listStylePosition"],ll=["content","pointerEvents","fill","stroke","cursor"],il=[...Xa,...Qa,...Ja,...el,...tl,...rl,...nl,...ol,...sl,...al,...ll],cl=window.wp.editPost,ul={header:"r8VKzpD4xIjh7C6cNSd4",label:"jol8WAj80MZMQbQoD4PE",options:"OAlCu5cjesRCOe9Oi_Sf",dropdown:"ecUFZg_BvV5uEVL6O6vU",popover:"ZIkvusMvpfven_IaSKwQ",control:"ZJAwcH_31EJdfRc06wbT",inline:"QO0YbZozhJPqaRR3xacc",description:"Ema6BPwKafJm_y5u0XlF",close:"X7GQPjGdX3evCwBMsO0r",pill:"ffbW4nkBKFhgCDDtRw4m",local:"U4_yEHrDsxSyPrm8Jaia",dot:"SS_N6XNiAGnEV9wbXL5A",current:"UOhd8GXIdtpcL9OXIm2z",shorthand:"CVt01RVyjRq7wtonoilX",labelWrap:"gHSfEaLVmGbNA7OMKvLe",popoverContent:"USxAzCfrk0MResImMMzQ",resetButton:"G3Q1m5rQUCDtLo_go5Wu",indent:"SIMaTWYn6WV2ZvEyeFML",rule:"Jfk755Ht4edlY1LoSZas",button:"gvYHD5QRZBMy0TfXBitp",css:"doPm5O4uTPLqAdvcjdm7",indicatorDots:"iKFVpvaeey3zDLHoVXZT"},dl=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z"}));function pl({group:t,editStyle:r,setSearch:n,setLocalTab:s,cancelEditStyle:l,onAtRuleChange:i,onNestedRuleChange:c,canManageStyles:u,openGeneralSidebar:d,isNested:p,currentSelector:h,onClose:f,scope:m}){const b=t[0].selector,v=t[0].nestedSelector,y=""!==t[0].atRule?t[0].atRule:null,w=(0,e.createElement)("div",{className:g(ul.rules,p&&ul.indent)},t.map((({property:t,valueRaw:p,source:g,atRule:v,selector:y})=>(0,e.createElement)("div",{key:t,className:ul.rule,tabIndex:"0"},(0,e.createElement)("span",{"data-property":t},Da(t)),": ",(0,e.createElement)("span",{"data-value":!0},p),";",u&&(0,e.createElement)(o.Button,{className:ul.button,variant:"link",label:(0,a.__)("Go to style source","generateblocks-pro"),showTooltip:!0,size:"small",iconSize:"18",icon:dl,onClick:async()=>{try{const e={atRule:v,nestedRule:"local"===g&&y!==h?y:""};"global"===g?(await r(y||b,e),n(t,g),void 0!==e.atRule&&requestAnimationFrame((()=>i(e.atRule))),void 0!==e.nestedRule&&c(e.nestedRule)):"local"===g&&("global"!==m&&(await l(),s("styles"),d("edit-post/block")),n(t,"global"===m?"global":g),void 0!==e.atRule&&requestAnimationFrame((()=>i(e.atRule))),void 0!==e.nestedRule&&c(e.nestedRule))}catch(e){console.error(e)}f()}})))));function k(){let e=b;return v&&(v.startsWith("&")?e+=v.replace("&",""):e+=" "+v),e}return y?(0,e.createElement)("div",{className:ul.group,"data-at-rule-declaration":!0},(0,e.createElement)("div",{"data-at-rule":y},y," ","{"),(0,e.createElement)("div",{className:ul.indent},(0,e.createElement)("span",{"data-selector":!0},k())," ",(0,e.createElement)("span",{"data-bracket":"open"},"{")),w,(0,e.createElement)("div",{className:ul.indent,"data-bracket":"close"},"}"),(0,e.createElement)("div",{"data-bracket":"close"},"}")):(0,e.createElement)("div",{"data-declaration":!0,className:ul.rules},(0,e.createElement)("div",null,(0,e.createElement)("span",{"data-selector":!0},k())," ",(0,e.createElement)("span",{"data-bracket":"open"},"{")),w,(0,e.createElement)("div",{"data-bracket":"close"},"}"))}function hl({controlInheritedSources:t,matchType:r}){const n=Xe(),{onEditStyle:s,setSearch:l,setLocalTab:i,cancelEditStyle:c,onAtRuleChange:u,canManageStyles:d,currentSelector:p,onNestedRuleChange:h,scope:f}=n,{openGeneralSidebar:m}=(0,Fe.useDispatch)(cl.store),b=function(e,t,r){const n=new Set;return e.filter((e=>e.hasInheritedValue&&e.source===r)).map((e=>e.shorthandProperty?{atRule:e.inheritedAtRule||"",selector:e.classNameSelector||t,nestedSelector:e.inheritedNestedRule||"",property:e.shorthandProperty,valueRaw:e.shorthandValue,source:e.source}:{atRule:e.inheritedAtRule||"",selector:e.classNameSelector||t,nestedSelector:e.inheritedNestedRule||"",property:e.property,valueRaw:e.value,source:e.source})).filter((e=>{const t=`${e.atRule}::${e.selector}::${e.nestedSelector}::${e.property}`;return!n.has(t)&&(n.add(t),!0)})).reduce(((e,t)=>{const r=`${t.atRule}::${t.selector}::${t.nestedSelector}`;return e[r]||(e[r]=[]),e[r].push(t),e}),{})}(t,p,r);return Object.keys(b).length>0&&r?(0,e.createElement)(o.Dropdown,{className:g(ul.popover,ul[r]),contentClassName:ul.popoverContent,renderToggle:({onToggle:t})=>(0,e.createElement)(o.Button,{className:g(ul.dot,ul[r]),onClick:()=>{t()},title:"current"===r?(0,a.__)("Has local styles","generateblocks-pro"):"global"===r?(0,a.__)("Has inherited global styles","generateblocks-pro"):"local"===r?(0,a.__)("Has inherited local styles","generateblocks-pro"):"shorthand"===r?(0,a.__)("Value from CSS shorthand","generateblocks-pro"):void 0}),renderContent:({onClose:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.Button,{icon:dt,label:(0,a.__)("Close","generateblocks-pro"),size:"small",className:ul.close,onClick:t}),(0,e.createElement)("div",{className:ul.css},Object.values(b).map(((r,n)=>(0,e.createElement)(pl,{key:n,group:r,editStyle:s,setSearch:l,setLocalTab:i,cancelEditStyle:c,onAtRuleChange:u,onNestedRuleChange:h,canManageStyles:d,openGeneralSidebar:m,isNested:"all"!==r[0].atRule,currentSelector:p,onClose:t,scope:f})))))}):null}const fl=(0,s.memo)((function({dropdownOptions:t,dropdownChildren:r,allowCustomValue:n,usingCustomValue:s,setUsingCustomValue:l,learnMoreUrl:c,learnMoreLabel:u,beforeDropdownMenu:d,menuVisible:p=!1}){return(0,e.createElement)("div",{className:ul.options},d,p&&(0,e.createElement)(o.DropdownMenu,{className:ul.dropdown,icon:i,label:(0,a.__)("More options","generateblocks-pro"),controls:t,popoverProps:{className:ul.popover}},(({onClose:t})=>(0,e.createElement)(e.Fragment,null,r&&r({onClose:t}),n&&(0,e.createElement)(o.MenuGroup,null,(0,e.createElement)(o.MenuItem,{onClick:()=>{l(!s),t()},suffix:s?qn:""},(0,a.__)("Enter Custom Value","generateblocks-pro"))),c&&u&&(0,e.createElement)(o.MenuGroup,null,(0,e.createElement)(o.MenuItem,{icon:Ns,iconSize:10,onClick:()=>{window.open(c,"_blank"),t()}},u))))))})),ml={control:"Y_SZocKPG8xUe9IfpF4w",multiRow:"lPEoVnH96M3UNpOX8P6E",button:"cPJ3wQ9eQxECE0Z1y_mg",fallback:"gzcUop1fr5T1KjhxdpZX"};function gl({buttons:t,value:r,placeholder:n="",onChange:s,className:a,multiRow:l}){return(0,e.createElement)(o.ButtonGroup,{className:g("gb-button-icon-control",ml.control,a,l&&ml.multiRow)},Object.values(t).map((t=>(0,e.createElement)(o.Button,{key:t.value,isPressed:t.value===r,onClick:()=>{s(t.value!==r?t.value:"")},label:t.label,showTooltip:!!t.icon,className:g(ml.button,!r&&n===t.value&&ml.fallback)},t.icon?t.icon:t.label))))}const bl=["label","hideLabelFromVision","value","help","id","className","onChange","type"],vl=(0,s.forwardRef)((function(t,r){const{id:n,children:l,label:i,dropdownOptions:c,dropdownChildren:u,learnMoreLabel:d,learnMoreUrl:p,style:h,beforeDropdownMenu:f,afterLabel:m,onVisibilityChange:b,value:v,cssProp:y=!1,as:w=null,allowCustomValue:k=!1,hasCustomValue:E=!1,customValueHelp:S=(0,a.__)("Enter a custom value.","generateblocks-pro"),onChange:x,searchKeywords:C=[],className:_="",alwaysVisible:A=!1,...R}=t,O=Xe(),{atRule:T,controlFilters:I,controlIsVisible:P,inheritedSources:M}=O,D=M.filter((e=>(Array.isArray(y)?y:[y]).includes(e.property))),N={current:0,local:1,global:2},L=D.filter((e=>e.hasInheritedValue)).sort(((e,t)=>N[e.source]-N[t.source])),z=L.map((({source:e})=>e)),B=new Set(z),j=Array.from(B),F=`control-wrapper-${$s()}`,V=n||`control-${$s()}`,[$,W]=(0,s.useState)(E&&""!==v),U=k&&$?o.TextControl:w,H=p||u||k,[q,G]=(0,s.useState)(v),Z=(0,s.useRef)(!1),[Y,K]=(0,s.useState)({[T]:!1}),X=(0,s.useRef)(),Q=r||X,J=(0,s.useMemo)((()=>(0,$e.debounce)(x,200)),[x]);(0,s.useEffect)((()=>{Z.current?Z.current=!1:q!==v&&G(v)}),[v]);const ee={...R,onChange:e=>{const t=void 0===e?"":e;Z.current=!0,G(t),J(t);const r="show-with-value"===I?.activeFilter;K((e=>({...e,[T]:!t&&v&&r})))},onBlur:e=>{const t=Ta(e.target.value);t!==e.target.value&&(Z.current=!0,G(t),x(t))},value:q},te=s.Children.count(l)>0;if(w&&te)throw new Error((0,a.__)("Control component cannot have both a component and children.","generateblocks-pro"));const re={className:ul.label},ne=![o.RangeControl].includes(w);ne?w===o.AnglePickerControl&&i&&(ee.label=""):(ee.label=i||ee["aria-label"],ee.hideLabelFromVision=!0),ne?(ee.id=V,re.htmlFor=V):re["aria-hidden"]="true",$&&(ee.help=S,Object.keys(ee).forEach((e=>{bl.includes(e)||delete ee[e]})));let oe=[...C];if("string"==typeof y?oe.push(y):Array.isArray(y)?oe.push(...y):"object"==typeof y&&oe.push(...Object.keys(y)),w===o.SelectControl){const{options:e=[]}=ee;oe.push(...e.filter((e=>!e?.disabled)).map((e=>e.value)))}if(w===gl){const{buttons:e=[]}=ee;oe.push(...e.map((e=>e.value)))}if(oe=Array.from(new Set([...oe,...oe.map((e=>Da(e)))])),k&&w===o.SelectControl){const{options:e=[]}=ee,t=q.trim();if(e.every((e=>e.value!==t))&&!e.some((e=>e.value===t))){const r=[{label:(0,a.sprintf)(
// Translators: %s is the value of the select control.
// Translators: %s is the value of the select control.
(0,a.__)(" %s (Custom)","generateblocks-pro"),t),value:t},...e];ee.options=r}}!ee.placeholder&&y&&(ee.placeholder=function(e,t){const r=t.find((t=>t.property===e&&"current"!==t.source));return r?r.value:""}(y,D),"opacity"===y&&ee.placeholder&&(ee.placeholder=100*parseFloat(ee.placeholder)));const se={componentProps:ee,props:t,wrapperRef:Q,label:i,labelProps:re,controlId:V,unusedProps:R,cssProp:y,searchKeywords:oe,alwaysVisible:A,matchTypes:j},ae=(0,Us.applyFilters)("generateblocks.control.props",ee,se),le=P(se,ae),ie=A||Y[T]||le;if(!ie)return null;const ce={menuVisible:H,dropdownOptions:c,dropdownChildren:u,allowCustomValue:k,usingCustomValue:$,setUsingCustomValue:W,learnMoreUrl:p,learnMoreLabel:d,beforeDropdownMenu:f};if(!ce.learnMoreLabel&&"string"==typeof y){const e=y.replace(/([A-Z])/g," $1").trim();ce.learnMoreLabel=(0,a.sprintf)(
// Translators: %s is the CSS property.
// Translators: %s is the CSS property.
(0,a.__)("Learn more about %s","generateblocks-pro"),e.slice(0,1).toUpperCase()+e.slice(1))}return(0,e.createElement)("div",{className:g("gb-styles-builder-control",ul.control,!i&&ul.inline,ie?"visible":"hidden",_),id:te?V:F,ref:Q,style:h},i&&(0,e.createElement)("div",{className:g("gb-styles-builder-control__header",ul.header)},(0,e.createElement)("div",{className:g(ul.labelWrap,"gb-styles-builder-control__header--label")},(0,e.createElement)("label",{...re}," ",i),m,j.length>0&&(0,e.createElement)("div",{className:ul.indicatorDots},j.map((t=>(0,e.createElement)(hl,{key:t,controlInheritedSources:D,matchType:t}))))),(0,e.createElement)(fl,{...ce})),!l&&U&&(0,e.createElement)(U,{...ae}),l,!i&&(0,e.createElement)(fl,{...ce}))}));vl.Description=function({label:t,children:r,onClick:n}){return r&&(0,e.createElement)(o.MenuGroup,{label:t},(0,e.createElement)("div",{className:ul.description},r,n&&(0,e.createElement)(o.Button,{className:ul.close,variant:"none",onClick:n,label:(0,a.__)("Close","generateblocks-pro"),icon:Ws})))};const yl={list:"b_RXikA0yLfFJYpaeVgv",options:"lxgVamEFQoMoRBFAsc7N",swatch:"xRajaL3JQdzyijENb4zU",circle:"F891aRoicQ0aqJE5A3Nq","swatch-wrapper":"bOqFC3Gpl25YDYrg8wsU",item:"or7wCQk5yZF2zwc9ofBQ",css:"m2VqTHwrhvcLUAMDncQE",control:"mIXmPx68gq724E3V7nEb",icons:"RPDTh49UEnnJJ4rFgNRM",toggle:"pGzKzEb_ChmAD1xwD9Sq",body:"wk14gfzCsilRJLyj2aNF",dropdown:"lXKFALy9Y5kIkh1BxKsT","dropdown-popover":"rYhu0inN18qta9nrRpRZ","is-disabled":"zy3hLXLGoHyDrCrmInOv","dropdown-content":"CFHpyDRWkEB0LSf8Rzff","dropdown-actions":"QCY9ZcRrfiOjDZgwkcs3",edit:"eNQeQJT8iU3f3fgt20SO","modal-description":"V8pft_uiZlKShPeJBiOa","modal-actions":"EEN3NhJ2Lk8sHuFPgaow","modal-confirm":"zfws_IoIsj73yFjWPOww"};function wl({children:t,label:r,dropdownControls:n,dropdownChildren:s,onAdd:l,onClickDone:i,onClickDelete:c,isEditing:u,id:d,cssProp:p,searchKeywords:f=[],showAdd:m=!0,items:g=[]}){const b=`effect-control-${$s()}`;return(0,e.createElement)(vl,{label:r,beforeDropdownMenu:(0,e.createElement)("div",{className:yl.icons},u?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.Button,{variant:"primary",size:"small",icon:qn,onClick:i,label:(0,a.__)("Done","generateblocks-pro"),showTooltip:!0}),(0,e.createElement)(o.Button,{variant:"tertiary",size:"small",isDestructive:!0,icon:Ds,onClick:c,label:(0,a.__)("Delete","generateblocks-pro"),showTooltip:!0})):m&&(0,e.createElement)(o.Button,{variant:"tertiary",size:"small",icon:h,onClick:l,label:(0,a.__)("Add new","generateblocks-pro")})),id:d||b,className:`gb-effects-control ${yl.control}`,dropdownControls:n,dropdownChildren:s,popoverProps:{className:yl["dropdown-popover"]},searchKeywords:f,cssProp:p,value:g.length>0?g.length:""},(0,e.createElement)("div",{className:yl.body,style:{display:g.length>0?"block":"none"}},t))}function kl({children:t}){return(0,e.createElement)(b.Stack,{className:yl.edit,gap:"12px","data-component":"EffectEdit"},t)}wl.LearnMore=({learnMoreLabel:t,learnMoreURL:r,onClose:n})=>t&&r&&(0,e.createElement)(o.MenuGroup,null,(0,e.createElement)(o.MenuItem,{icon:Ns,iconSize:10,onClick:()=>{window.open(r,"_blank"),n()}},t)),wl.DeleteAll=function({label:t,content:r,confirmDelete:n,items:s,setConfirmDelete:l,onClose:i,onDelete:c}){return(0,e.createElement)(e.Fragment,null,n?(0,e.createElement)("div",{className:yl["dropdown-content"]},r,(0,e.createElement)("div",{className:yl["dropdown-actions"]},(0,e.createElement)(o.Button,{variant:"secondary",size:"compact",onClick:()=>{l(!1),i()}},(0,a.__)("Cancel","generateblocks-pro")),(0,e.createElement)(o.Button,{isDestructive:!0,variant:"secondary",size:"compact",onClick:()=>{c([]),l(!1),i()}},(0,a.__)("Confirm","generateblocks-pro")))):(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.MenuItem,{icon:Ds,onClick:()=>{s.length>0&&l(!0)},className:g(0===s.length&&yl["is-disabled"]),tabIndex:s.length>0?0:-1},t)))},wl.PasteModal=function({showPasteStyles:t,setShowPasteStyles:r,property:n,onAddStyles:l,errorMessage:i,learnMoreUrl:c=`https://developer.mozilla.org/en-US/docs/Web/CSS/${n}`}){const[u,d]=(0,s.useState)(""),[p,h]=(0,s.useState)(!0),f=n.charAt(0).toUpperCase()+n.slice(1);return!!t&&(0,e.createElement)(o.Modal,{title:(0,a.sprintf)(
// Translators: %s: CSS property string in title case
// Translators: %s: CSS property string in title case
(0,a.__)("Paste %s Styles","generateblocks-pro"),f),isDismissible:!0,onRequestClose:()=>r(!1),style:{maxWidth:"425px",width:"425px"}},(0,e.createElement)(o.TextareaControl,{rows:5,value:u,onChange:e=>{d(e)},help:i}),(0,e.createElement)("div",{className:yl["modal-description"]},(0,s.createInterpolateElement)(
// Translators: %s is the learn more link, property prop is the inner text.
// Translators: %s is the learn more link, property prop is the inner text.
(0,a.__)("Paste in valid CSS styles to add to the current list.","generateblocks-pro"),{Link:(0,e.createElement)((function(){return(0,e.createElement)("a",{href:c,target:"_blank",rel:"noreferrer"},n)}),null)})),(0,e.createElement)("div",{className:yl["modal-confirm"]},(0,e.createElement)(o.CheckboxControl,{checked:p,label:(0,a.sprintf)(
// Translators: %s: CSS property string
// Translators: %s: CSS property string
(0,a.__)("Replace %s styles.","generateblocks-pro"),n),help:(0,a.sprintf)(
// Translators: %s: CSS property string
// Translators: %s: CSS property string
(0,a.__)("If checked this will replace all existing %s styles.","generateblocks-pro"),n),onChange:e=>{h(e)}})),(0,e.createElement)("div",{className:yl["modal-actions"]},(0,e.createElement)(o.Button,{variant:"secondary",onClick:()=>r(!1)},(0,a.__)("Cancel","generateblocks-pro")),(0,e.createElement)(o.Button,{disabled:!u||0===u.length,variant:"primary",onClick:()=>{l&&l({pastedValue:u,replaceStyles:p})&&d("")}},(0,a.__)("Add Styles","generateblocks-pro"))))};const El=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M5 4.5h11a.5.5 0 0 1 .5.5v11a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V5a.5.5 0 0 1 .5-.5ZM3 5a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5Zm17 3v10.75c0 .69-.56 1.25-1.25 1.25H6v1.5h12.75a2.75 2.75 0 0 0 2.75-2.75V8H20Z"})),Sl=(0,e.createElement)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)(l.Path,{d:"M4.67 10.664s-2.09 1.11-2.917 1.582l.494.87 1.608-.914.002.002c.343.502.86 1.17 1.563 1.84.348.33.742.663 1.185.976L5.57 16.744l.858.515 1.02-1.701a9.1 9.1 0 0 0 4.051 1.18V19h1v-2.263a9.1 9.1 0 0 0 4.05-1.18l1.021 1.7.858-.514-1.034-1.723c.442-.313.837-.646 1.184-.977.703-.669 1.22-1.337 1.563-1.839l.002-.003 1.61.914.493-.87c-1.75-.994-2.918-1.58-2.918-1.58l-.003.005a8.29 8.29 0 0 1-.422.689 10.097 10.097 0 0 1-1.36 1.598c-1.218 1.16-3.042 2.293-5.544 2.293-2.503 0-4.327-1.132-5.546-2.293a10.099 10.099 0 0 1-1.359-1.599 8.267 8.267 0 0 1-.422-.689l-.003-.005Z"})),xl=(0,e.createElement)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)(l.Path,{d:"M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z"})),Cl=(0,s.forwardRef)((({items:t,className:r,...n},o)=>(0,e.createElement)(b.SortableList,{...n,items:t,className:g("gb-effect-list",yl.list,r),ref:o})));Cl.Item=function({hidden:t,onDuplicate:r,onHidden:n,onEdit:s,css:l="",label:i="",swatchColor:c=null,canDuplicate:u=!0,canHide:d=!1,canEdit:p=!0}){return(0,e.createElement)("div",{className:`gb-effect-list-item ${yl.item}`},c&&(0,e.createElement)("div",{className:yl["swatch-wrapper"]},(0,e.createElement)("div",{className:yl.swatch},(0,e.createElement)("div",{className:yl.circle,style:{backgroundColor:c}}))),(0,e.createElement)("div",{title:l,className:yl.css,style:t?{opacity:"0.4"}:{}},(0,e.createElement)("span",null,i.length?i:l)),(0,e.createElement)("div",{className:yl.options},u&&(0,e.createElement)(o.Button,{label:(0,a.__)("Duplicate","generateblocks-pro"),showTooltip:!0,variant:"tertiary",size:"small",icon:El,onClick:r}),d&&(0,e.createElement)(o.Button,{label:t?(0,a.__)("Show","generateblocks-pro"):(0,a.__)("Hide","generateblocks-pro"),showTooltip:!0,variant:"tertiary",size:"small",icon:t?Sl:xl,onClick:n}),p&&(0,e.createElement)(o.Button,{label:(0,a.__)("Edit","generateblocks-pro"),showTooltip:!0,variant:"tertiary",size:"small",icon:dl,onClick:s})))};const _l=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"})),Al=(0,e.createElement)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)(l.Path,{d:"M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z"})),Rl={alignItems:"zaM5rUtG4Gg27nF90BH7",flexColumn:"A0HlCF3cLZLW0qHXcnXD",justifyContent:"fbzKTZ2t8ssUGTMSe0BP",flexReverse:"oq1EmoOocVOgcqOGcter",buttonGroup:"eZDoLX5oqxWC87AGQe7d",isInherited:"zOPpqELSb9VPv1nRyOs2",presets:"Ux91JIyGwAvlSfU5cGA1",presetButton:"yahMeNjMMJdPa8RXL84s",preview:"o4WseA5e5RYL8wKL5tuq",gridTemplateColumns:"I3Y2fphQELks0YSnM2u2"},Ol=[{value:"flex-start",icon:(0,e.createElement)("svg",{"aria-hidden":"true",style:{width:"16px",height:"16px"},viewBox:"0 0 16 16"},(0,e.createElement)("path",{fill:"currentColor",d:"M0 0h16v1H0z"}),(0,e.createElement)("path",{fill:"currentColor",stroke:"currentColor",d:"M3.5 2.5h3v7h-3zm5 0h3v5h-3z"})),label:"Align Start"},{value:"center",icon:(0,e.createElement)("svg",{"aria-hidden":"true",style:{width:"16px",height:"16px"},viewBox:"0 0 16 16"},(0,e.createElement)("path",{fill:"currentColor",stroke:"currentColor",d:"M3.5 3.5h3v8h-3zm5 1h3v6h-3z"}),(0,e.createElement)("path",{fill:"currentColor",d:"M0 7h16v1H0z"})),label:"Align Center"},{value:"flex-end",icon:(0,e.createElement)("svg",{"aria-hidden":"true",style:{width:"16px",height:"16px"},viewBox:"0 0 16 16"},(0,e.createElement)("path",{fill:"currentColor",d:"M0 15h16v1H0z"}),(0,e.createElement)("path",{fill:"currentColor",stroke:"currentColor",d:"M3.5 6.5h3v7h-3zm5 2h3v5h-3z"})),label:"Align End"},{value:"stretch",icon:(0,e.createElement)("svg",{"aria-hidden":"true",style:{width:"16px",height:"16px"},viewBox:"0 0 16 16"},(0,e.createElement)("path",{fill:"currentColor",d:"M0 0h16v1H0zm0 15h16v1H0z"}),(0,e.createElement)("path",{fill:"currentColor",stroke:"currentColor",d:"M3.5 2.5h3v11h-3zm5 0h3v11h-3z"})),label:"Stretch"},{value:"baseline",icon:(0,e.createElement)("svg",{"aria-hidden":"true",style:{width:"16px",height:"16px"},viewBox:"0 0 16 16"},(0,e.createElement)("path",{fill:"currentColor",d:"M0 7h16v1H0z"}),(0,e.createElement)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 3H8v7h4V3zm-1 1H9v3h2V4zM7 3H3v9h4V3zM6 4H4v3h2V4z",fill:"currentColor"})),label:"Baseline"}];function Tl({value:t,onChange:r,flexDirection:n}){const o=(0,s.useMemo)((()=>Ol.every((e=>e.value!==t))),[t]);return(0,e.createElement)(vl,{as:gl,allowCustomValue:!0,hasCustomValue:o,label:"Align Items",id:"gblocks-align-items",value:t,onChange:r,buttons:Ol,cssProp:"alignItems",className:g(Rl.alignItems,n.includes("column")&&Rl.flexColumn,n.includes("reverse")&&Rl.flexReverse),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/align-items"})}function Il({value:t,onChange:r}){const n=(0,s.useMemo)((()=>[{label:"Row",value:"row"},{label:"Column",value:"column"},{label:"Row Reverse",value:"row-reverse"},{label:"Column Reverse",value:"column-reverse"}]),[t]),o=(0,s.useMemo)((()=>n.every((e=>e.value!==t))),[t]);return(0,e.createElement)(vl,{as:gl,multiRow:!0,allowCustomValue:!0,hasCustomValue:o,label:"Flex Direction",id:"gblocks-flex-direction",value:t,onChange:r,buttons:n,cssProp:"flexDirection",learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction"})}const Pl=[{label:"No Wrap",value:"nowrap"},{label:"Wrap",value:"wrap"},{label:"Reverse Wrap",value:"wrap-reverse"}];function Ml({value:t,onChange:r}){const n=(0,s.useMemo)((()=>Pl.every((e=>e.value!==t))),[t]);return(0,e.createElement)(vl,{as:gl,allowCustomValue:!0,hasCustomValue:n,label:"Flex Wrap",id:"gblocks-flex-wrap",value:t,onChange:r,buttons:Pl,cssProp:"flexWrap",learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap"})}function Dl({onClick:t,value:r}){const n={"1fr":1,"repeat(2, minmax(0, 1fr))":2,"repeat(3, minmax(0, 1fr))":3,"repeat(4, minmax(0, 1fr))":4,"1fr 3fr":2,"3fr 1fr":2,"1fr 1fr 2fr":3,"1fr 2fr 1fr":3,"2fr 1fr 1fr":3,"1fr 3fr 1fr":3,"repeat(5, minmax(0, 1fr))":5,"repeat(6, minmax(0, 1fr))":6};return(0,e.createElement)("div",{className:Rl.presets},Object.keys(n).map((s=>(0,e.createElement)(o.Button,{label:s,showTooltip:!0,key:`layout-${s}`,className:Rl.presetButton,onClick:()=>t(s),isPressed:s===r,style:{"--grid-template-columns":s}},Array.from({length:n[s]},((t,r)=>(0,e.createElement)("div",{key:`layout-${r}`,className:Rl.preview})))))))}function Nl({value:t,onChange:r,onShortcutChange:n}){const[l,i]=(0,s.useState)(!1);return(0,e.createElement)(vl,{label:"Grid Template Columns",id:"grid-template-columns",value:t,cssProp:"gridTemplateColumns"},(0,e.createElement)("div",{className:Rl.gridTemplateColumns},(0,e.createElement)(vl,{as:o.TextControl,value:t,onChange:r,cssProp:!1,alwaysVisible:!0}),(0,e.createElement)(o.Button,{size:"small",onClick:()=>i(!l),icon:()=>(0,e.createElement)("svg",{style:{width:"100%"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256"},(0,e.createElement)("rect",{width:"256",height:"256",fill:"none"}),(0,e.createElement)("rect",{x:"32",y:"56",width:"192",height:"144",rx:"8",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),(0,e.createElement)("line",{x1:"96",y1:"56",x2:"96",y2:"200",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),(0,e.createElement)("line",{x1:"160",y1:"56",x2:"160",y2:"200",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),(0,e.createElement)("line",{x1:"32",y1:"104",x2:"224",y2:"104",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"}),(0,e.createElement)("line",{x1:"32",y1:"152",x2:"224",y2:"152",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"12"})),isPressed:l,label:(0,a.__)("Choose a preset","generateblocks-pro"),showTooltip:!0})),!!l&&(0,e.createElement)(Dl,{value:t,onClick:n}))}const Ll=[{value:"flex-start",icon:(0,e.createElement)("svg",{"aria-hidden":"true",style:{width:"16px",height:"16px"},viewBox:"0 0 16 16"},(0,e.createElement)("path",{fill:"currentColor",stroke:"currentColor",d:"M2.5 4.5h3v7h-3zm5 0h3v7h-3z"}),(0,e.createElement)("path",{fill:"currentColor",d:"M0 0h1v16H0z"})),label:"Flex Start"},{value:"center",icon:(0,e.createElement)("svg",{"aria-hidden":"true",style:{width:"16px",height:"16px"},viewBox:"0 0 16 16"},(0,e.createElement)("path",{fill:"currentColor",stroke:"currentColor",d:"M2.5 4.5h3v7h-3zm7 0h3v7h-3z"}),(0,e.createElement)("path",{fill:"currentColor",d:"M7 0h1v16H7z"})),label:"Center"},{value:"flex-end",icon:(0,e.createElement)("svg",{"aria-hidden":"true",style:{width:"16px",height:"16px"},viewBox:"0 0 16 16"},(0,e.createElement)("path",{fill:"currentColor",d:"M15 0h1v16h-1z"}),(0,e.createElement)("path",{fill:"currentColor",stroke:"currentColor",d:"M5.5 4.5h3v7h-3zm5 0h3v7h-3z"})),label:"Flex End"},{value:"space-between",icon:(0,e.createElement)("svg",{"aria-hidden":"true",style:{width:"16px",height:"16px"},viewBox:"0 0 16 16"},(0,e.createElement)("path",{fill:"currentColor",d:"M15 0h1v16h-1zM0 0h1v16H0z"}),(0,e.createElement)("path",{fill:"currentColor",stroke:"currentColor",d:"M10.5 4.5h3v7h-3zm-8 0h3v7h-3z"})),label:"Space Between"},{value:"space-around",icon:(0,e.createElement)("svg",{"aria-hidden":"true",style:{width:"16px",height:"16px"},viewBox:"0 0 16 16"},(0,e.createElement)("path",{fill:"currentColor",d:"M15 0h1v16h-1zM0 0h1v16H0z"}),(0,e.createElement)("path",{fill:"currentColor",stroke:"currentColor",d:"M9.5 4.5h3v7h-3zm-6 0h3v7h-3z"})),label:"Space Around"}];function zl({value:t,onChange:r,flexDirection:n}){const o=(0,s.useMemo)((()=>Ll.every((e=>e.value!==t))),[t]);return(0,e.createElement)(vl,{as:gl,allowCustomValue:!0,hasCustomValue:o,label:"Justify Content",id:"gblocks-justify-content",value:t,onChange:r,buttons:Ll,cssProp:"justifyContent",className:g(Rl.justifyContent,n.includes("column")&&Rl.flexColumn,n.includes("reverse")&&Rl.flexReverse),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content"})}const Bl=function(t,r){var n,o=(n=(0,e.useRef)(!0)).current?(n.current=!1,!0):n.current;(0,e.useEffect)((function(){if(!o)return t()}),r)},jl={wrapper:"Tamw_DXL_RTGVdO76M6G",action:"PJ04dXqqfciw2I8gsIhV",overrideAction:"ihQLlqhvkEDznp554jxD",units:"YCW8afC5xbRDyhRcSfWa",popover:"C1sMRQWzWYZKO76qnDPm",disabled:"h9LfZfsyqxzX_NERwneg"};function Fl({value:t,onChange:r,units:n=[],disabled:s}){if(!n.length)return null;const l=[...n];return l.includes(t)||(l[l.length-1]=t),(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.DropdownMenu,{className:jl.units,label:(0,a.__)("Select a unit","generateblocks-pro"),icon:null,toggleProps:{children:t||String.fromCharCode(8212),disabled:s},popoverProps:{className:jl.popover,focusOnMount:!0,noArrow:!1}},(({onClose:n})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.MenuGroup,null,l.map((s=>(0,e.createElement)(o.MenuItem,{key:s,onClick:()=>{r(s),n()},isSelected:s===t,variant:s===t?"primary":""},s||String.fromCharCode(8212)))),(0,e.createElement)(o.MenuItem,{onClick:()=>{window.open("https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units","_blank").focus()},label:(0,a.__)("Learn more about units","generateblocks-pro"),showTooltip:!0},ut))))))}const Vl=["px","em","%","rem","vw","vh","ch"],$l=new RegExp(`(${["px","em","%","rem","vw","vh","ch","cm","mm","in","pt","pc","ex","lh","rlh","vmin","vmax","vb","vi","svw","svh","svb","svi","svmax","svmin","lvw","lvh","lvb","lvi","lvmax","lvmin","dvw","dvh","dvb","dvi","dvmax","dvmin","fr","s","ms"].join("|")})`);function Wl(e,t=""){var r,n;if(""===e)return{value:"",unit:t};if(0===e||"0"===e)return{value:"0",unit:""};if(!oa(e)&&"-"!==e)return{value:e,unit:"none"};const o=e?e.toString().toLowerCase().split($l).filter((e=>""!==e)):[];return{value:null!==(r=o[0]?.trim())&&void 0!==r?r:"",unit:null!==(n=o[1]?.trim())&&void 0!==n?n:""}}function Ul(t){var r,n;const{label:a,units:l=Vl,defaultUnit:i,step:c,id:u,max:d,min:p=0,disabled:h=!1,onChange:f=e=>e,help:m="",onFocus:b=()=>null,onBlur:v=()=>null,overrideAction:y=()=>null,allowOtherUnits:w=!0}=t,k=(0,s.useCallback)((e=>{D(!0),f(e)}),[f]),E=null!==(r=t?.value?.toString())&&void 0!==r?r:"",S=null!==(n=t?.placeholder?.toString())&&void 0!==n?n:"",x=0===l?.length||!l,C="string"==typeof i?i:l[0],{value:_="",unit:A=""}=(0,s.useMemo)((()=>Wl(E,C)),[E,C]),R=(0,s.useMemo)((()=>E?{value:"",unit:""}:Wl(S,C)),[E,S,C]),[O,T]=(0,s.useState)(_),[I,P]=(0,s.useState)(E?A:Wl(S,C).unit||C),[M,D]=(0,s.useState)(!1),N=(0,s.useCallback)((function(e){const t=e.key,r=e.target.value;if(isNaN(r))return;let n=r;switch(t){case"ArrowUp":n=+r+1,k(`${n}${A}`),T(n);break;case"ArrowDown":n=+r-1,k(`${n}${A}`),T(n)}}),[A,k]),L=(0,s.useCallback)((function(e){let{value:t="",unit:r=""}=Wl(e.toString());if(T(t),""===t){if(k(""),S&&""!==S){const{unit:e}=Wl(S,C);P(""!==e?e:C)}else"none"===I&&P(C);return}const n=(x?[]:[...l,"none"]).includes(r)||w;r&&n||(r="none"!==I||isNaN(t)?I:C),P(r),k(r&&"none"!==r&&!x?`${t}${r}`:t)}),[A,I,l,w,k,C]),z=(0,s.useCallback)((function(e){l.length>1&&l.includes(e)&&(P(e),k(`${_}${e}`))}),[O,l,P,k]);return(0,s.useEffect)((()=>{if(M)return void D(!1);const{value:e="",unit:t=""}=Wl(E,C);O!==e&&T(e),E&&I!==t&&P(t)}),[E]),Bl((()=>{if(E||!S)return;const{unit:e}=Wl(S,C);P(""!==S&&""!==e?e:C)}),[E,S,C]),(0,e.createElement)(o.BaseControl,{label:a,help:m,id:u,className:g("gb-unit-control",h&&jl.disabled),__nextHasNoMarginBottom:!0},(0,e.createElement)("div",{className:jl.wrapper,"data-component":"UnitControl"},(0,e.createElement)(o.TextControl,{type:"text",value:O,placeholder:R?.value,min:p,max:d,step:c,autoComplete:"off",disabled:h,onKeyDown:N,onChange:L,onFocus:b,onBlur:v,__nextHasNoMarginBottom:!0}),(0,e.createElement)("div",{className:jl.action},!!y&&(0,e.createElement)("div",{className:jl.overrideAction},y(L)),"none"!==I&&(0,e.createElement)(Fl,{value:I,disabled:h||1===l.length||""===O,units:l,onChange:z}))))}Ul.defaultUnits=Vl;const Hl=(0,e.createElement)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)(l.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),ql=(0,e.createElement)(l.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)(l.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),Gl={details:"wVjjTdvPGdIxqFn48zqu",summary:"anUKSZGKh4woAlhsgmuk",filtersActive:"HCu7v87YZzvnN5U_sc3M",summaryIcon:"NEmU6LKIKPKNuZq1AV_p",separator:"LexWJoT7vrxJHuvbI0am"},Zl={panel:"lEDHzMIb7xESVsaytp_g",filtersActive:"w3DBngPVzz7jHmCpYBYw",indicatorDots:"eVjspRaQMttxMSEfv1zL",dot:"rHGAMvaQEoXJwEgnbftW",local:"YoOSOFEcl_kcJ1aUlh_V",current:"CjZXBdTpVNPRTOG0JPDg",shorthand:"uZIXuc4X0PxLVuHuYa_w"};function Yl({cssProps:t}){const r=Xe(),{inheritedSources:n}=r,o=n.filter((e=>t.includes(e.property))),s=o.some((e=>"global"===e.source)),l=o.some((e=>"local"===e.source)),i=o.some((e=>"current"===e.source)),c=o.some((e=>"shorthand"===e.source));return s||l||i||c?(0,e.createElement)("div",{className:Zl.indicatorDots},!!i&&(0,e.createElement)("div",{title:(0,a.__)("Has local styles","generateblocks-pro"),className:g(Zl.dot,Zl.current)}),!!l&&(0,e.createElement)("div",{title:(0,a.__)("Has inherited local styles","generateblocks-pro"),className:g(Zl.dot,Zl.local)}),!!s&&(0,e.createElement)("div",{title:(0,a.__)("Has inherited global styles","generateblocks-pro"),className:Zl.dot}),!!c&&(0,e.createElement)("div",{title:(0,a.__)("Value from CSS shorthand","generateblocks-pro"),className:g(Zl.dot,Zl.shorthand)})):null}function Kl({filtersActive:t,scope:r,panel:n,search:o="",filter:a,atRule:l,id:i,currentSelector:c,...u}){const d=!(!t&&!o),p=c?`gb-styles-builder-open-panels-${r}-${function(e){let t=0;for(let r=0;r{if(m.current&&d){const e=m.current.querySelector(".gb-styles-builder-control");v(!!e)}else v(!0)}),[o,a,d]),b?(0,e.createElement)("div",{ref:m,className:g(Zl.panel,(t||o)&&Zl.filtersActive,Zl[`panel-${i}`])},(0,e.createElement)(n,{...u,opened:d,atRule:l,currentSelector:c,scrollAfterOpen:!1,filtersActive:t,search:o,initialOpen:f,onToggle:()=>{if(d)return;const e=JSON.parse(sessionStorage.getItem(p))||[],t=e.includes(i)?e.filter((e=>e!==i)):[...e,i];!function(e,t,r=25){if(0===t.length)return void sessionStorage.removeItem(e);const n=Object.keys(sessionStorage).filter((e=>e.startsWith("gb-styles-builder-open-panels-")));n.length>=r&&n.slice(0,n.length-r+1).forEach((e=>sessionStorage.removeItem(e))),sessionStorage.setItem(e,JSON.stringify(t))}(p,t)}})):null}function Xl({children:t,title:r,onClick:n,open:l=!0,filtersActive:i=!1,search:c="",cssProps:u=[]}){if(!r)throw new Error("PanelSection requires a title");const p=(0,s.useRef)(null);let h;return(i||l)&&(h=!0),(0,e.createElement)("details",{ref:p,className:g("gb-panel-section",Gl.details,(i||c)&&Gl.filtersActive),open:h,onToggle:()=>{if(n){const e=p.current?.hasAttribute("open");n(e)}}},(0,e.createElement)("summary",{className:Gl.summary},r,(0,e.createElement)(o.VisuallyHidden,null,(0,a.__)("style controls","generateblocks-pro")),!!u.length>0&&(0,e.createElement)(Yl,{cssProps:u}),(0,e.createElement)("div",{className:Gl.summaryIcon},(0,e.createElement)(d,{icon:l?Hl:ql,size:"18"}))),!!h&&(0,e.createElement)(b.Stack,{gap:"10px",className:g(Gl.children,"gb-styles-builder-panel__content")},t))}function Ql({value:t,onChange:r}){const n=(0,s.useMemo)((()=>[{label:"Stretch",value:"stretch"},{label:"Center",value:"center"},{label:"Start",value:"start"},{label:"End",value:"end"}]),[t]),o=(0,s.useMemo)((()=>n.every((e=>e.value!==t))),[t]);return(0,e.createElement)(vl,{as:gl,allowCustomValue:!0,hasCustomValue:o,label:"Justify Items",id:"gblocks-justify-items",value:t,onChange:r,buttons:n,cssProp:"justifyItems",learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/justify-items"})}function Jl({value:t,onChange:r}){const n=(0,s.useMemo)((()=>[{label:"Stretch",value:"stretch"},{label:"Center",value:"center"},{label:"Start",value:"start"},{label:"End",value:"end"}]),[t]),o=(0,s.useMemo)((()=>n.every((e=>e.value!==t))),[t]);return(0,e.createElement)(vl,{as:gl,allowCustomValue:!0,hasCustomValue:o,label:"Justify Self",id:"gblocks-justify-self",value:t,onChange:r,buttons:n,cssProp:"justifySelf",learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self"})}function ei({value:t,onChange:r}){const n=(0,s.useMemo)((()=>[{label:"Stretch",value:"stretch"},{label:"Center",value:"center"},{label:"Start",value:"start"},{label:"End",value:"end"}]),[t]),o=(0,s.useMemo)((()=>n.every((e=>e.value!==t))),[t]);return(0,e.createElement)(vl,{as:gl,allowCustomValue:!0,hasCustomValue:o,label:"Align Self",id:"gblocks-align-self",value:t,onChange:r,buttons:n,cssProp:"alignSelf",learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/align-self"})}const ti=[{label:"inherit",value:"inherit"},{label:"initial",value:"initial"},{label:"revert",value:"revert"},{label:"revert-layer",value:"revert-layer"},{label:"unset",value:"unset"}],ri=(e=[],t={})=>{const{exclude:r=[],includeSeparator:n=!0}=t,o=ti.filter((e=>!r.includes(e.value)));if(0===o.length)return e;const s=[...e];return n&&s.push({label:"—",value:"__css-global-values-separator__",disabled:!0}),s.push(...o),s},ni="gbp-panel-state-layout";function oi(t){const{styles:r,onStyleChange:n,filtersActive:l,search:i,opened:c,scrollAfterOpen:u,onToggle:d,initialOpen:p,allowCustomAtRule:h}=t,{alignItems:f="",columnGap:m="",containerName:g="",containerType:v="",display:y="",flexBasis:w="",flexDirection:k="",flexGrow:E="",flexShrink:S="",flexWrap:x="",gridAutoFlow:C="",gridAutoColumns:_="",gridAutoRows:A="",gridTemplateAreas:R="",gridColumn:O="",gridRow:T="",gridArea:I="",gridTemplateColumns:P="",gridTemplateRows:M="",justifyContent:D="",order:N="",rowGap:L="",float:z="",clear:B="",justifyItems:j="",justifySelf:F="",alignSelf:V=""}=r,$=sessionStorage.getItem(ni),[W,U]=(0,s.useState)((()=>$&&!l?JSON.parse($):{alignment:!1,grid:!1,flex:!1,containerQueries:!1,floats:!1})),{onSectionToggle:H}=Ge({sectionState:W,setSectionState:U,filtersActive:l,search:i,storageKey:ni});return(0,e.createElement)(o.PanelBody,{title:(0,a.__)("Layout","generateblocks-pro"),initialOpen:p,opened:!!c||void 0,icon:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(ws,{size:"20"}),(0,e.createElement)(Yl,{cssProps:Xa})),scrollAfterOpen:u,onToggle:d},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(vl,{as:o.SelectControl,allowCustomValue:!0,label:"Display",value:y,options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"Block",value:"block"},{label:"Flex",value:"flex"},{label:"Grid",value:"grid"},{label:"Inline",value:"inline"},{label:"Inline Block",value:"inline-block"},{label:"Inline Flex",value:"inline-flex"},{label:"Inline Grid",value:"inline-grid"},{label:"List Item",value:"list-item"},{label:"None",value:"none"}]),onChange:e=>n("display",e),searchKeywords:["block","inline-block","flex","inline-flex","inline-grid","grid","inline","list-item"],cssProp:"display"}),(0,e.createElement)(Xl,{title:"Alignment",onClick:e=>H("alignment",e),open:W.alignment,filtersActive:l,search:i,cssProps:["alignItems","justifyContent","justifyItems","justifySelf","alignSelf"]},(0,e.createElement)(Tl,{flexDirection:k,value:f,onChange:e=>n("alignItems",e)}),(0,e.createElement)(zl,{flexDirection:k,value:D,onChange:e=>n("justifyContent",e)}),(0,e.createElement)(Ql,{value:j,onChange:e=>n("justifyItems",e)}),(0,e.createElement)(Jl,{value:F,onChange:e=>n("justifySelf",e)}),(0,e.createElement)(ei,{value:V,onChange:e=>n("alignSelf",e)})),(0,e.createElement)(Xl,{title:"Grid Layout",onClick:e=>H("grid",e),open:W.grid,filtersActive:l,search:i,cssProps:["gridTemplateColumns","gridTemplateRows","gridAutoColumns","gridAutoRows","gridTemplateAreas","columnGap","rowGap","gridAutoFlow","gridColumn","gridRow","gridArea","order"]},(0,e.createElement)(Nl,{value:P,onShortcutChange:e=>{n("gridTemplateColumns",e!==P?e:"")},onChange:e=>{n("gridTemplateColumns",e)}}),(0,e.createElement)(vl,{as:o.TextControl,label:"Grid Template Rows",value:M,onChange:e=>n("gridTemplateRows",e),cssProp:"gridTemplateRows"}),(0,e.createElement)(vl,{as:o.TextareaControl,label:"Grid Template Areas",value:R,onChange:e=>n("gridTemplateAreas",e),cssProp:"gridTemplateAreas",rows:3}),(0,e.createElement)(vl,{as:o.TextControl,label:"Grid Auto Columns",id:"gblocks-grid-auto-columns",value:_,onChange:e=>n("gridAutoColumns",e),cssProp:"gridAutoColumns"}),(0,e.createElement)(vl,{as:o.TextControl,label:"Grid Auto Rows",id:"gblocks-grid-auto-rows",value:A,onChange:e=>n("gridAutoRows",e),cssProp:"gridAutoRows"}),(0,e.createElement)(o.Flex,null,(0,e.createElement)(vl,{as:Ul,label:"Column Gap",id:"gblocks-column-gap",value:m,onChange:e=>n("columnGap",e),cssProp:"columnGap"}),(0,e.createElement)(vl,{as:Ul,label:"Row Gap",id:"gblocks-row-gap",value:L,onChange:e=>n("rowGap",e),cssProp:"rowGap"})),(0,e.createElement)(vl,{as:o.TextControl,label:"Grid Auto Flow",value:C,onChange:e=>n("gridAutoFlow",e),cssProp:"gridAutoFlow"}),(0,e.createElement)(o.Flex,null,(0,e.createElement)(vl,{as:o.TextControl,label:"Grid Column",id:"gblocks-grid-column",value:O,onChange:e=>n("gridColumn",e),cssProp:"gridColumn"}),(0,e.createElement)(vl,{as:o.TextControl,label:"Grid Row",id:"gblocks-grid-row",value:T,onChange:e=>n("gridRow",e),cssProp:"gridRow"})),(0,e.createElement)(vl,{as:o.TextControl,label:"Grid Area",value:I,onChange:e=>n("gridArea",e),cssProp:"gridArea"}),(0,e.createElement)(vl,{as:Ul,value:N,cssProp:"order",units:[],onChange:e=>n("order",e),label:(0,a.__)("Order","generateblocks-pro")})),(0,e.createElement)(Xl,{title:"Flex Layout",onClick:e=>H("flex",e),open:W.flex,filtersActive:l,search:i,cssProps:["flexDirection","flexWrap","columnGap","rowGap","flexGrow","flexShrink","flexBasis","order"]},(0,e.createElement)(Il,{value:k,onChange:e=>{n("flexDirection",e!==k?e:"")}}),(0,e.createElement)(Ml,{value:x,onChange:e=>n("flexWrap",e!==x?e:"")}),(0,e.createElement)(o.Flex,null,(0,e.createElement)(vl,{as:Ul,label:"Column Gap",id:"gblocks-column-gap",value:m,onChange:e=>n("columnGap",e),cssProp:"columnGap"}),(0,e.createElement)(vl,{as:Ul,label:"Row Gap",id:"gblocks-row-gap",value:L,onChange:e=>n("rowGap",e),cssProp:"rowGap"})),(0,e.createElement)(o.Flex,null,(0,e.createElement)(vl,{as:o.TextControl,label:"Flex Grow",id:"gblocks-flex-grow",value:E,onChange:e=>n("flexGrow",e),cssProp:"flexGrow"}),(0,e.createElement)(vl,{as:o.TextControl,label:"Flex Shrink",id:"gblocks-flex-shrink",value:S,onChange:e=>n("flexShrink",e),cssProp:"flexShrink"})),(0,e.createElement)(vl,{as:Ul,label:"Flex Basis",id:"gblocks-flex-basis",value:w,onChange:e=>n("flexBasis",e),cssProp:"flexBasis"}),(0,e.createElement)(vl,{as:Ul,value:N,cssProp:"order",units:[],onChange:e=>n("order",e),label:(0,a.__)("Order","generateblocks-pro")})),!!h&&(0,e.createElement)(Xl,{title:"Container Queries",onClick:e=>H("containerQueries",e),open:W.containerQueries,filtersActive:l,search:i,cssProps:["containerType","containerName"]},(0,e.createElement)(vl,{as:o.SelectControl,allowCustomValue:!0,label:"Container Type",value:v,options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"Size",value:"size"},{label:"Inline Size",value:"inline-size"},{label:"Normal",value:"normal"}]),onChange:e=>n("containerType",e),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro"),cssProp:"containerType"}),(0,e.createElement)(vl,{as:o.TextControl,label:"Container Name",id:"gblocks-container-name",value:g,onChange:e=>n("containerName",e),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_containment/Container_queries",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro"),cssProp:"containerName"})),(0,e.createElement)(Xl,{title:"Floats",onClick:e=>H("floats",e),open:W.floats,filtersActive:l,search:i,cssProps:["float","clear"]},(0,e.createElement)(vl,{as:o.SelectControl,allowCustomValue:!0,label:"Float",value:z,options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"None",value:"none"},{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Inline Start",value:"inline-start"},{label:"Inline End",value:"inline-end"}]),onChange:e=>n("float",e),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/float",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro"),cssProp:"float"}),(0,e.createElement)(vl,{as:o.SelectControl,allowCustomValue:!0,label:"Clear",value:B,options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"None",value:"none"},{label:"Left",value:"left"},{label:"Right",value:"right"},{label:"Both",value:"both"}]),onChange:e=>n("clear",e),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/clear",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro"),cssProp:"clear"}))))}const si={panel:"sqnVycrGODNTfAhpXG3l",filtersActive:"X4NnPSZdu27R6QVtzp3w"};function ai(t){const{styles:r,onStyleChange:n,opened:s,scrollAfterOpen:l,filtersActive:i,search:c,onToggle:u,initialOpen:d}=t,{width:p="",height:h="",minWidth:f="",minHeight:m="",maxWidth:v="",maxHeight:y="",aspectRatio:w=""}=r;return(0,e.createElement)(o.PanelBody,{title:(0,a.__)("Sizing","generateblocks-pro"),initialOpen:d,icon:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(ks,{size:"20"}),(0,e.createElement)(Yl,{cssProps:Qa})),opened:!!s||void 0,scrollAfterOpen:l,className:g(si.panel,(c||i)&&si.filtersActive),onToggle:u},(0,e.createElement)(b.Stack,{gap:"12px",wrap:!0,className:"gb-styles-builder-panel__content"},(0,e.createElement)(b.Stack,{gap:"12px",wrap:!0,layout:"flex",direction:"horizontal",className:"gb-styles-builder-panel__content"},(0,e.createElement)(vl,{as:Ul,label:"Width",id:"width",value:p,onChange:e=>n("width",e),cssProp:"width"}),(0,e.createElement)(vl,{as:Ul,label:"Height",id:"height",value:h,onChange:e=>n("height",e),cssProp:"height"}),(0,e.createElement)(vl,{as:Ul,label:"Min Width",id:"min-width",value:f,onChange:e=>n("minWidth",e),cssProp:"minWidth"}),(0,e.createElement)(vl,{as:Ul,label:"Min Height",id:"min-height",value:m,onChange:e=>n("minHeight",e),cssProp:"minHeight"}),(0,e.createElement)(vl,{as:Ul,label:"Max Width",id:"max-width",value:v,onChange:e=>n("maxWidth",e),cssProp:"maxWidth"}),(0,e.createElement)(vl,{as:Ul,label:"Max Height",id:"max-height",value:y,onChange:e=>n("maxHeight",e),cssProp:"maxHeight"})),(0,e.createElement)(vl,{as:o.TextControl,label:"Aspect Ratio",id:"gblocks-aspect-ratio",value:w,onChange:e=>n("aspectRatio",e),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/aspect-ratio",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro"),cssProp:"aspectRatio",__nextHasNoMarginBottom:!0})))}const li=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z"})),ii=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"m7.5 6h9v-1.5h-9zm0 13.5h9v-1.5h-9zm-3-3h1.5v-9h-1.5zm13.5-9v9h1.5v-9z"})),ci={component:"JMPhp6ekKLmvoGwaZcBa"};function ui({sync:t,setSync:r,syncTypes:n=["all","axis"],onClick:s=()=>{}}){const l=n.includes("axis"),i=n.includes("all");return(i||l)&&(0,e.createElement)("div",{className:ci.component},i&&(0,e.createElement)(o.Button,{icon:li,isPressed:"all"===t,size:"small",iconSize:18,onClick:()=>{if("all"===t)return r(!1),void s(!1);r("all"),s("all")},label:(0,a.__)("Link all sides","generateblocks-pro"),showTooltip:!0}),l&&(0,e.createElement)(o.Button,{icon:ii,isPressed:"axis"===t,size:"small",iconSize:18,onClick:()=>{if("axis"===t)return r(!1),void s(!1);r("axis"),s("axis")},label:(0,a.__)("Link axis","generateblocks-pro"),showTooltip:!0}))}const di={control:"DuwdPu36nb6NATzhJc6f",inputs:"wrpRndoV9gQREMmp3iiA",circle:"eoeSswtzaSZXfVpWHYcT",syncActive:"veC012SPNrfZ2Bl2RxxQ",top:"tNxOxbjvZGNTCB3YYva1",left:"n5GwnP76u50n8vJpQjw2",right:"JNulxcMTfF9gRfsZwl8P",bottom:"M43bIBDvJYieaNVas_Jr",label:"AhEl_6LWT09RnxcGVg1L",syncItems:"oPjMLifBYlwA2yq0LCm3"};function pi(e){const t={};let r;return e.forEach((e=>{e&&(t[e]?t[e]+=1:t[e]=1,(!r||t[e]>t[r])&&(r=e))})),r||""}function hi(e){return Object.values(e).reduce(((e,{prop:t,value:r})=>(e[t]=r,e)),{})}function fi(e,t=[]){var r,n;return null!==(n=(null!==(r=e.find((e=>t.includes(e[0].toLowerCase().trim()))))&&void 0!==r?r:["",""])[1].value)&&void 0!==n?n:""}function mi(t){const{onChange:r,id:n,units:o,label:l="",cssProps:i={},layout:c="circle",syncTypes:u=["all","axis"]}=t,[d,p]=(0,s.useState)(!1),[h,f]=(0,s.useState)(""),m=u.includes("axis"),b=u.includes("all"),v=Object.entries(i),y=(0,s.useMemo)((()=>b&&"all"===d?pi(v.map((e=>e[1].value))):""),[v,d]),w=(0,s.useMemo)((()=>m&&"axis"===d?fi(v,["top","bottom"]):""),[v,m,d]),k=(0,s.useMemo)((()=>m&&"axis"===d?fi(v,["left","right"]):""),[v,m,d]);(0,s.useEffect)((()=>{v.some((e=>!e[1].value))||d||v.every((e=>e[1].value===v[0][1].value))&&!d&&p("all")}),[JSON.stringify(v)]),(0,s.useEffect)((()=>{document.getElementById(h)?.focus()}),[d]);const E=hi(i),S=Object.keys(E),x=[i?.Top?.prop,i?.Bottom?.prop].filter(Boolean),C=[i?.Left?.prop,i?.Right?.prop].filter(Boolean);return(0,e.createElement)(vl,{id:n,value:Object.values(E).filter(Boolean).join(","),searchKeywords:Object.keys(i),cssProp:S,className:g(di.control),label:l,beforeDropdownMenu:(0,e.createElement)(ui,{sync:d,setSync:p,syncTypes:u,onClick:e=>{if("axis"===e){const e=fi(v,["top","bottom"]),t=fi(v,["left","right"]),n={...i};for(const r in n)["top","bottom"].includes(r.toLowerCase().trim())&&(n[r].value=e),["left","right"].includes(r.toLowerCase().trim())&&(n[r].value=t);const o=hi(n);r(o)}if("all"===e){const e=pi(v.map((e=>e[1].value)));if(!e)return;const t={...i};for(const r in t)t[r].value=e;const n=hi(t);r(n)}}})},(0,e.createElement)("div",{className:g(di.inputs,di[c],d&&di.syncActive)},"all"===d&&(0,e.createElement)(vl,{as:Ul,id:`${n}-all-control`,value:y,units:o,onChange:e=>{const t={...i};for(const r in t)t[r].value=e;const n=hi(t);r(n)},onFocus:()=>f(`${n}-all-control`),label:(0,a.__)("All sides","generateblocks-pro"),cssProp:S,searchKeywords:[l]}),"axis"===d&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(vl,{as:Ul,label:(0,a.__)("Vertical","generateblocks-pro"),id:`${n}-vertical-control`,value:w,units:o,onChange:e=>{const t={...i};for(const r in t)["top","bottom"].includes(r.toLowerCase().trim())&&(t[r].value=e);const n=hi(t);r(n)},onFocus:()=>f(`${n}-vertical-control`),cssProp:x,searchKeywords:[l]}),(0,e.createElement)(vl,{as:Ul,label:(0,a.__)("Horizontal","generateblocks-pro"),id:`${n}-horizontal-control`,value:k,units:o,onChange:e=>{const t={...i};for(const r in t)["left","right"].includes(r.toLowerCase().trim())&&(t[r].value=e);const n=hi(t);r(n)},onFocus:()=>f(`${n}-horizontal-control`),cssProp:C,searchKeywords:[l]})),!1===d&&v.map((t=>{const n=t[1].value,s=t[1].prop,a=`${s}-control`,i=t[0].toLowerCase().trim();return(0,e.createElement)(vl,{key:a,className:g(di[i]),as:Ul,id:a,value:n,units:o,onChange:e=>{r({[s]:e})},onFocus:()=>f(a),label:t[0],cssProp:s,searchKeywords:[l]})}))))}function gi(t){const{styles:r,onStyleChange:n,opened:l,scrollAfterOpen:i,onToggle:c,initialOpen:u}=t,{marginTop:d="",marginRight:p="",marginBottom:h="",marginLeft:f="",paddingTop:m="",paddingRight:g="",paddingBottom:v="",paddingLeft:y=""}=r,w=(0,s.useMemo)((()=>({Top:{prop:"paddingTop",value:m},Right:{prop:"paddingRight",value:g},Bottom:{prop:"paddingBottom",value:v},Left:{prop:"paddingLeft",value:y}})),[m,g,v,y]),k=(0,s.useMemo)((()=>({Top:{prop:"marginTop",value:d},Right:{prop:"marginRight",value:p},Bottom:{prop:"marginBottom",value:h},Left:{prop:"marginLeft",value:f}})),[d,p,h,f]);return(0,e.createElement)(o.PanelBody,{title:(0,a.__)("Spacing","generateblocks-pro"),initialOpen:u,icon:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Es,{size:"20"}),(0,e.createElement)(Yl,{cssProps:Ja})),opened:!!l||void 0,scrollAfterOpen:i,onToggle:c},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(mi,{id:"padding",label:"Padding",cssProps:w,onChange:n}),(0,e.createElement)(mi,{id:"margin",label:"Margin",cssProps:k,onChange:n})))}var bi={grad:.9,turn:360,rad:360/(2*Math.PI)},vi=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},yi=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},wi=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},ki=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Ei=function(e){return{r:wi(e.r,0,255),g:wi(e.g,0,255),b:wi(e.b,0,255),a:wi(e.a)}},Si=function(e){return{r:yi(e.r),g:yi(e.g),b:yi(e.b),a:yi(e.a,3)}},xi=/^#([0-9a-f]{3,8})$/i,Ci=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},_i=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,s=Math.max(t,r,n),a=s-Math.min(t,r,n),l=a?s===t?(r-n)/a:s===r?2+(n-t)/a:4+(t-r)/a:0;return{h:60*(l<0?l+6:l),s:s?a/s*100:0,v:s/255*100,a:o}},Ai=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var s=Math.floor(t),a=n*(1-r),l=n*(1-(t-s)*r),i=n*(1-(1-t+s)*r),c=s%6;return{r:255*[n,l,a,a,i,n][c],g:255*[i,n,n,l,a,a][c],b:255*[a,a,i,n,n,l][c],a:o}},Ri=function(e){return{h:ki(e.h),s:wi(e.s,0,100),l:wi(e.l,0,100),a:wi(e.a)}},Oi=function(e){return{h:yi(e.h),s:yi(e.s),l:yi(e.l),a:yi(e.a,3)}},Ti=function(e){return Ai((r=(t=e).s,{h:t.h,s:(r*=((n=t.l)<50?n:100-n)/100)>0?2*r/(n+r)*100:0,v:n+r,a:t.a}));var t,r,n},Ii=function(e){return{h:(t=_i(e)).h,s:(o=(200-(r=t.s))*(n=t.v)/100)>0&&o<200?r*n/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,r,n,o},Pi=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Mi=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Di=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ni=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Li={string:[[function(e){var t=xi.exec(e);return t?(e=t[1]).length<=4?{r:parseInt(e[0]+e[0],16),g:parseInt(e[1]+e[1],16),b:parseInt(e[2]+e[2],16),a:4===e.length?yi(parseInt(e[3]+e[3],16)/255,2):1}:6===e.length||8===e.length?{r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16),a:8===e.length?yi(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Di.exec(e)||Ni.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Ei({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=Pi.exec(e)||Mi.exec(e);if(!t)return null;var r,n,o=Ri({h:(r=t[1],n=t[2],void 0===n&&(n="deg"),Number(r)*(bi[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Ti(o)},"hsl"]],object:[[function(e){var t=e.r,r=e.g,n=e.b,o=e.a,s=void 0===o?1:o;return vi(t)&&vi(r)&&vi(n)?Ei({r:Number(t),g:Number(r),b:Number(n),a:Number(s)}):null},"rgb"],[function(e){var t=e.h,r=e.s,n=e.l,o=e.a,s=void 0===o?1:o;if(!vi(t)||!vi(r)||!vi(n))return null;var a=Ri({h:Number(t),s:Number(r),l:Number(n),a:Number(s)});return Ti(a)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,o=e.a,s=void 0===o?1:o;if(!vi(t)||!vi(r)||!vi(n))return null;var a=function(e){return{h:ki(e.h),s:wi(e.s,0,100),v:wi(e.v,0,100),a:wi(e.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(s)});return Ai(a)},"hsv"]]},zi=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){return t=(e=Si(this.rgba)).r,r=e.g,n=e.b,s=(o=e.a)<1?Ci(yi(255*o)):"","#"+Ci(t)+Ci(r)+Ci(n)+s;var e,t,r,n,o,s},e.prototype.toRgb=function(){return Si(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Si(this.rgba)).r,r=e.g,n=e.b,(o=e.a)<1?"rgba("+t+", "+r+", "+n+", "+o+")":"rgb("+t+", "+r+", "+n+")";var e,t,r,n,o},e.prototype.toHsl=function(){return Oi(Ii(this.rgba))},e.prototype.toHslString=function(){return t=(e=Oi(Ii(this.rgba))).h,r=e.s,n=e.l,(o=e.a)<1?"hsla("+t+", "+r+"%, "+n+"%, "+o+")":"hsl("+t+", "+r+"%, "+n+"%)";var e,t,r,n,o},e.prototype.toHsv=function(){return e=_i(this.rgba),{h:yi(e.h),s:yi(e.s),v:yi(e.v),a:yi(e.a,3)};var e},e.prototype.invert=function(){return $i({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},e.prototype.saturate=function(e){return void 0===e&&(e=.1),$i(Bi(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),$i(Bi(this.rgba,-e))},e.prototype.grayscale=function(){return $i(Bi(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),$i(Fi(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),$i(Fi(this.rgba,-e))},e.prototype.rotate=function(e){return void 0===e&&(e=15),this.hue(this.hue()+e)},e.prototype.alpha=function(e){return"number"==typeof e?$i({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):yi(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ii(this.rgba);return"number"==typeof e?$i({h:e,s:t.s,l:t.l,a:t.a}):yi(t.h)},e.prototype.isEqual=function(e){return this.toHex()===$i(e).toHex()},e}(),$i=function(e){return e instanceof Vi?e:new Vi(e)};const Wi=[];function Ui(){return(Ui=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}function qi(t){var r=(0,e.useRef)(t),n=(0,e.useRef)((function(e){r.current&&r.current(e)}));return r.current=t,n.current}var Gi=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e0:e.buttons>0)&&s.current?a(Ki(s.current,e,i.current)):r(!1)},t=function(){return r(!1)};function r(r){var n=c.current,o=Yi(s.current),a=r?o.addEventListener:o.removeEventListener;a(n?"touchmove":"mousemove",e),a(n?"touchend":"mouseup",t)}return[function(e){var t=e.nativeEvent,n=s.current;if(n&&(Xi(t),!function(e,t){return t&&!Zi(e)}(t,c.current)&&n)){if(Zi(t)){c.current=!0;var o=t.changedTouches||[];o.length&&(i.current=o[0].identifier)}n.focus(),a(Ki(n,t,i.current)),r(!0)}},function(e){var t=e.which||e.keyCode;t<37||t>40||(e.preventDefault(),l({left:39===t?.05:37===t?-.05:0,top:40===t?.05:38===t?-.05:0}))},r]}),[l,a]),d=u[0],p=u[1],h=u[2];return(0,e.useEffect)((function(){return h}),[h]),e.createElement("div",Ui({},o,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:s,onKeyDown:p,tabIndex:0,role:"slider"}))})),Ji=function(e){return e.filter(Boolean).join(" ")},ec=function(t){var r=t.color,n=t.left,o=t.top,s=void 0===o?.5:o,a=Ji(["react-colorful__pointer",t.className]);return e.createElement("div",{className:a,style:{top:100*s+"%",left:100*n+"%"}},e.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:r}}))},tc=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r},rc=(Math.PI,function(e){var t=e.s,r=e.v,n=e.a,o=(200-t)*r/100;return{h:tc(e.h),s:tc(o>0&&o<200?t*r/100/(o<=100?o:200-o)*100:0),l:tc(o/2),a:tc(n,2)}}),nc=function(e){var t=rc(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},oc=function(e){var t=rc(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},sc=function(e){var t=e.r,r=e.g,n=e.b,o=e.a,s=Math.max(t,r,n),a=s-Math.min(t,r,n),l=a?s===t?(r-n)/a:s===r?2+(n-t)/a:4+(t-r)/a:0;return{h:tc(60*(l<0?l+6:l)),s:tc(s?a/s*100:0),v:tc(s/255*100),a:o}},ac=e.memo((function(t){var r=t.hue,n=t.onChange,o=Ji(["react-colorful__hue",t.className]);return e.createElement("div",{className:o},e.createElement(Qi,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:Gi(r+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":tc(r),"aria-valuemax":"360","aria-valuemin":"0"},e.createElement(ec,{className:"react-colorful__hue-pointer",left:r/360,color:nc({h:r,s:100,v:100,a:1})})))})),lc=e.memo((function(t){var r=t.hsva,n=t.onChange,o={backgroundColor:nc({h:r.h,s:100,v:100,a:1})};return e.createElement("div",{className:"react-colorful__saturation",style:o},e.createElement(Qi,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:Gi(r.s+100*e.left,0,100),v:Gi(r.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+tc(r.s)+"%, Brightness "+tc(r.v)+"%"},e.createElement(ec,{className:"react-colorful__saturation-pointer",top:1-r.v/100,left:r.s/100,color:nc(r)})))}));var ic="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,cc=new Map,uc=function(t){var r=t.className,n=t.hsva,o=t.onChange,s={backgroundImage:"linear-gradient(90deg, "+oc(Object.assign({},n,{a:0}))+", "+oc(Object.assign({},n,{a:1}))+")"},a=Ji(["react-colorful__alpha",r]),l=tc(100*n.a);return e.createElement("div",{className:a},e.createElement("div",{className:"react-colorful__alpha-gradient",style:s}),e.createElement(Qi,{onMove:function(e){o({a:e.left})},onKey:function(e){o({a:Gi(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":l+"%","aria-valuenow":l,"aria-valuemin":"0","aria-valuemax":"100"},e.createElement(ec,{className:"react-colorful__alpha-pointer",left:n.a,color:oc(n)})))},dc=function(t){var n,o=t.className,s=t.colorModel,a=t.color,l=void 0===a?s.defaultColor:a,i=t.onChange,c=Hi(t,["className","colorModel","color","onChange"]),u=(0,e.useRef)(null);n=u,ic((function(){var e=n.current?n.current.ownerDocument:document;if(void 0!==e&&!cc.has(e)){var t=e.createElement("style");t.innerHTML='.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url(\'data:image/svg+xml;charset=utf-8,\')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}',cc.set(e,t);var o=r.nc;o&&t.setAttribute("nonce",o),e.head.appendChild(t)}}),[]);var d=function(t,r,n){var o=qi(n),s=(0,e.useState)((function(){return t.toHsva(r)})),a=s[0],l=s[1],i=(0,e.useRef)({color:r,hsva:a});(0,e.useEffect)((function(){if(!t.equal(r,i.current.color)){var e=t.toHsva(r);i.current={hsva:e,color:r},l(e)}}),[r,t]),(0,e.useEffect)((function(){var e;(function(e,t){if(e===t)return!0;for(var r in e)if(e[r]!==t[r])return!1;return!0})(a,i.current.hsva)||t.equal(e=t.fromHsva(a),i.current.color)||(i.current={hsva:a,color:e},o(e))}),[a,t,o]);var c=(0,e.useCallback)((function(e){l((function(t){return Object.assign({},t,e)}))}),[]);return[a,c]}(s,l,i),p=d[0],h=d[1],f=Ji(["react-colorful",o]);return e.createElement("div",Ui({},c,{ref:u,className:f}),e.createElement(lc,{hsva:p,onChange:h}),e.createElement(ac,{hue:p.h,onChange:h}),e.createElement(uc,{hsva:p,onChange:h,className:"react-colorful__last-control"}))},pc={defaultColor:"rgba(0, 0, 0, 1)",toHsva:function(e){var t=/rgba?\(?\s*(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?[,\s]+(-?\d*\.?\d+)(%)?,?\s*[/\s]*(-?\d*\.?\d+)?(%)?\s*\)?/i.exec(e);return t?sc({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:void 0===t[7]?1:Number(t[7])/(t[8]?100:1)}):{h:0,s:0,v:0,a:1}},fromHsva:function(e){var t=function(e){var t=e.h,r=e.s,n=e.v,o=e.a;t=t/360*6,r/=100,n/=100;var s=Math.floor(t),a=n*(1-r),l=n*(1-(t-s)*r),i=n*(1-(1-t+s)*r),c=s%6;return{r:tc(255*[n,l,a,a,i,n][c]),g:tc(255*[i,n,n,l,a,a][c]),b:tc(255*[a,a,i,n,n,l][c]),a:tc(o,2)}}(e);return"rgba("+t.r+", "+t.g+", "+t.b+", "+t.a+")"},equal:function(e,t){return e.replace(/\s/g,"")===t.replace(/\s/g,"")}},hc=function(t){return e.createElement(dc,Ui({},t,{colorModel:pc}))};const fc=({color:t,onChange:r,rgbColor:n})=>{const[o,a]=(0,s.useState)(t);return((t,r=0,n=Wi)=>{const o=(0,e.useRef)(!0),s=((t,r=0)=>{const n=(0,e.useRef)(0),o=(0,e.useCallback)(((...e)=>{cancelAnimationFrame(n.current);const o=performance.now(),s=a=>{a-o()=>cancelAnimationFrame(n.current)),[]),o})(t,r);(0,e.useEffect)((()=>{o.current?o.current=!1:s()}),n)})((0,s.useCallback)((()=>{r(o)}),[r,o]),200,[o]),(0,e.createElement)(hc,{color:n,onChange:a})},mc={control:"VRVGQpI3zaaudCXO9pfb",toggleButton:"XrISJIngb2x9EtcYAzMU",toggleIndicator:"Ouj472tQv3blob0sqmH6",fallback:"zkAvCiYqWBX4cAy33wxh",content:"J62xAdJErvGbqxOlNbW7",inputWrapper:"J30BF_9MPB5F7qf3L8al",input:"Vw12WmPhE7aPUCHBLLEL",clear:"XbAJl6cbZMlX7GBgAzs5",palette:"z6nZBcaVAN7pqDiQoXQT",opacity:"Suqn3en4cxHuOZ8Uu2D7"},gc="gb-color-picker-palettes";function bc(e){return e?.color?.startsWith("var(")?{...e,color:e.color}:{...e,color:`var(--wp--preset--color--${e.slug}, ${e.color})`}}function vc(e){let t=e;if(String(t).startsWith("var(")){const e=t.match(/\(([^)]+)\)/);if(e){const r=e[1].split(",").map((e=>e.trim())),n=r[0],o=r[1]||"#000000";t=getComputedStyle(document.documentElement).getPropertyValue(n)||o}}return $i(t).toRgbString()}function yc(t){const{value:r,placeholder:n="",onChange:l,label:i,tooltip:c,"aria-label":u,colors:d,renderToggle:p,onClick:h}=t,f=!r&&!!n,m=r||n||null,b=(0,s.useMemo)((()=>{if(!f)return null;try{const e=vc(m),t=$i(e);return t.isValid()?t.isLight()?"rgba(0, 0, 0, 0.5)":"rgba(255, 255, 255, 0.6)":"rgba(0, 0, 0, 0.5)"}catch(e){return"rgba(0, 0, 0, 0.5)"}}),[f,m]),v=(0,s.useRef)(null),y=(0,s.useMemo)((()=>vc(r)),[r]),w=function(){const[e=[],t=[]]=(0,Hs.useSettings)("color.palette.custom","color.palette.theme");return(0,s.useMemo)((()=>[...e.map(bc),...t.map(bc)]),[e,t])}(),k=(0,Us.applyFilters)("generateblocks.components.colorPalettes",d||w,t,w);(0,s.useEffect)((()=>{sessionStorage.setItem(gc,JSON.stringify(k))}),[k]);const E=$s();return(0,e.createElement)(o.BaseControl,{id:E,label:i,className:g("gb-color-picker",mc.control),"data-gb-control":"ColorPickerControl"},(0,e.createElement)(o.Dropdown,{className:mc.toggle,contentClassName:mc.content,placement:"top left",renderToggle:({isOpen:t,onToggle:r})=>{if(p)return p({isOpen:t,onToggle:r});const n=(0,e.createElement)(o.Button,{className:mc.toggleButton,onClick:()=>{r(),h&&h()},"aria-expanded":t,"aria-label":u},(0,e.createElement)("span",{className:g(mc.toggleIndicator,f&&mc.fallback),style:{background:m,...b&&{"--gb-color-picker-stripe":b}}}));return(0,e.createElement)(e.Fragment,null,c?(0,e.createElement)(o.Tooltip,{text:c},n):n)},renderContent:()=>{const t=sessionStorage.getItem(gc),s=sessionStorage?JSON.parse(t):k;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(fc,{color:r,rgbColor:y,onChange:e=>{$i(e).isValid()&&(e=1===$i(e).alpha()?$i(e).toHex():e),l(e)}}),(0,e.createElement)("div",{className:mc.inputWrapper},(0,e.createElement)(o.TextControl,{ref:v,className:mc.input,type:"text",value:r,placeholder:n||void 0,onChange:e=>{!e.startsWith("#")&&/^([0-9A-F]{3}){1,2}$/i.test(e)&&(e="#"+e),l(e)},onBlur:()=>{$i(r).isValid()&&1===$i(r).alpha()&&l($i(r).toHex())}}),(0,e.createElement)(o.Button,{size:"small",variant:"secondary",className:mc.clear,onClick:()=>{l("")}},(0,a.__)("Clear","generateblocks"))),(0,e.createElement)(o.BaseControl,{className:mc.palette},(0,e.createElement)(Hs.ColorPalette,{colors:s,value:r||"",onChange:e=>{l(e)},disableCustomColors:!0,clearable:!1})))}}))}const wc=[{icon:(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M13 5.5H4V4h9v1.5Zm7 7H4V11h16v1.5Zm-7 7H4V18h9v1.5Z"})),title:"Align text left",value:"left"},{icon:(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M7.5 5.5h9V4h-9v1.5Zm-3.5 7h16V11H4v1.5Zm3.5 7h9V18h-9v1.5Z"})),title:"Align text center",value:"center"},{icon:(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M11.111 5.5H20V4h-8.889v1.5ZM4 12.5h16V11H4v1.5Zm7.111 7H20V18h-8.889v1.5Z"})),title:"Align text right",value:"right"},{icon:(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M4 12.8h16v-1.5H4v1.5zm0 7h12.4v-1.5H4v1.5zM4 4.3v1.5h16V4.3H4z"})),title:"Justify text",value:"justify"}];function kc({value:t,onChange:r,cssProp:n}){const o=(0,s.useMemo)((()=>wc.every((e=>e.value!==t))),[t]);return(0,e.createElement)(vl,{allowCustomValue:!0,hasCustomValue:o,as:gl,label:"Text Alignment",id:"text-align",buttons:wc,value:t,onChange:r,cssProp:n})}const Ec=window.wp.apiFetch;var Sc=r.n(Ec);const xc={preview:"ZGQCNoUr2ZjtbpQO28Va",fallback:"Bo5sw1e4yZI2xQ7LAYgH"},Cc=(0,s.memo)((function({font:t,loading:r="lazy",fallbackText:n="",showPreviewSvg:s=!1}){const{name:l,alias:i,preview:c,fontFamily:u,cssVariable:d=""}=t;return(0,e.createElement)("div",{className:xc.preview},s&&c?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("img",{className:xc.image,src:c,alt:(0,a.__)("A graphical rendering of the font family","gp-premium"),height:"23",loading:r}),(0,e.createElement)(o.VisuallyHidden,null,n||l)):(0,e.createElement)("span",{className:xc.fallback,style:{fontFamily:d?`var(${d})`:u}},l," ",i&&`(${i})`))})),_c="undefined"==typeof AbortController?void 0:new AbortController,Ac="generatepress-font-library";let Rc=null;const Oc=(0,s.memo)(Ms),Tc=(0,s.memo)((function({item:t}){return t?(0,e.createElement)(Cc,{font:t}):null}));function Ic(){const{typographyFontFamilyList:e}=generateBlocksEditor,t=[{id:"default",name:(0,a.__)("Default","generateblocks-pro"),fontFamily:""},{id:"inherit",name:"Inherit",fontFamily:"inherit"},{id:"system",name:"System Font",fontFamily:'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif'}];return e?(e.forEach((e=>{var r;(null!==(r=e?.options)&&void 0!==r?r:[]).forEach((({label:e,value:r},n)=>{if(t.some((e=>e.fontFamily===r)))return;const o=n+1;t.push({id:`system-${o}`,name:e,fontFamily:r})}))})),t):[]}function Pc({onStyleChange:t,fontFamily:r="",cssProp:n=""}){var o;const[l,i]=(0,s.useState)((()=>Rc||Ic())),[c,u]=(0,s.useState)(r),[d,p]=(0,s.useState)(!1),[h,f]=(0,s.useState)(null),m=null!==(o=window?.generateBlocksEditor?.hasGPFontLibrary)&&void 0!==o&&o,g=(0,s.useMemo)((()=>"custom"===h?.id?[h,...l]:l),[h,l.length]),b=(0,s.useMemo)((()=>{const e=r.match(/var\((--[^)]+)\)/);return e?e[1]:null}),[r]);return(0,s.useEffect)((()=>{m&&!Rc&&async function(){try{const e=await Sc()({path:"/generatepress-font-library/v1/get-fonts",method:"GET"});if(!e.response)throw new Error("Request failed");const t=[...Ic(),...e.response];Rc=t,i(t)}catch(e){"AbortError"===e.name&&console.error("Request has been aborted"),_c?.abort()}}()}),[]),(0,s.useEffect)((()=>{c!==r&&u(r)}),[c,r]),(0,s.useEffect)((()=>{let e=l.find((e=>b===e?.cssVariable||r===e?.fontFamily));if(e)return p(!1),void f(e);if(e={id:"custom",name:r,fontFamily:r},b){const t=b?getComputedStyle(document.documentElement).getPropertyValue(b):null;if(t)return void(e.name=t);p(!0)}e.name=e.name.split(",")[0].trim(),f(e)}),[r,l,b]),(0,e.createElement)(vl,{className:"gb-styles-builder__font-family",as:Oc,label:"Font Family",id:"gblocks-font-family",value:c,onChange:e=>{let r="string"==typeof e?e:e?.fontFamily;e?.cssVariable&&(r=`var(${e.cssVariable})`),t("fontFamily",r)},items:g,itemToString:e=>e?.fontFamily||e?.cssVariable?e.cssVariable||e.fontFamily:"",ItemComponent:Tc,allowCustomValue:!0,hasCustomValue:d,selectedItem:h,setSelectedItem:f,dropdownChildren:({onClose:t})=>(0,e.createElement)(vl.Description,{label:(0,a.__)("About Font Family","generateblocks-pro"),onClick:t},(0,a.__)("Select a font from the list or enter your own custom value.","generateblocks-pro")),learnMoreLabel:!!m&&(0,a.__)("Manage Fonts","generateblocks-pro"),learnMoreUrl:!!m&&`/wp-admin/themes.php?page=${Ac}`,cssProp:n,selectedStyle:"icon"})}const Mc=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})),Dc=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})),Nc=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"})),Lc=[{label:"None",value:"none",icon:(0,e.createElement)(ys,null)},{label:"Uppercase",value:"uppercase",icon:Mc},{label:"Lowercase",value:"lowercase",icon:Dc},{label:"Capitalize",value:"capitalize",icon:Nc}];function zc({value:t,onChange:r,cssProp:n}){const o=(0,s.useMemo)((()=>Lc.every((e=>e.value!==t))),[t]);return(0,e.createElement)(vl,{as:gl,allowCustomValue:!0,hasCustomValue:o,label:"Text Transform",id:"gblocks-text-transform",value:t,buttons:Lc,onChange:r,cssProp:n})}const Bc=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),jc=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})),Fc=[{label:"None",value:"none",icon:(0,e.createElement)(ys,null)},{label:"Underline",value:"underline",icon:Bc},{label:"Overline",value:"overline",icon:(0,e.createElement)((({size:t,...r})=>(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:t||24,height:t||24,"aria-hidden":"true",focusable:"false",...r},(0,e.createElement)("path",{d:"M7 4v1h10V4H7zm5 14c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V7H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V7H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"}))),null)},{label:"Line-through",value:"line-through",icon:jc}];function Vc({value:t,onChange:r,cssProp:n}){return(0,e.createElement)(vl,{as:gl,allowCustomValue:!0,label:"Text Decoration",id:"gblocks-text-decoration",value:t,onChange:r,buttons:Fc,cssProp:n})}const $c=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M12.5 5L10 19h1.9l2.5-14z"})),Wc=[{label:"None",value:"none",icon:(0,e.createElement)(ys,null)},{label:"Normal",value:"normal",icon:Nc},{label:"Italic",value:"italic",icon:$c}];function Uc({value:t,onChange:r,cssProp:n}){const o=(0,s.useMemo)((()=>Wc.every((e=>e.value!==t))),[t]);return(0,e.createElement)(vl,{as:gl,allowCustomValue:!0,hasCustomValue:o,label:"Font Style",id:"gblocks-font-style",value:t,onChange:r,buttons:Wc,cssProp:n})}function Hc({value:t,onChange:r,cssProp:n}){return(0,e.createElement)(vl,{as:o.SelectControl,allowCustomValue:!0,label:"Text Wrap",id:"gblocks-text-wrap",value:t,onChange:r,cssProp:n,options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"wrap",value:"wrap"},{label:"nowrap",value:"nowrap"},{label:"balance",value:"balance"},{label:"pretty",value:"pretty"},{label:"stable",value:"stable"}])})}function qc(t){const{styles:r,onStyleChange:n,opened:s,scrollAfterOpen:l,onToggle:i,initialOpen:c}=t,{fontSize:u="",color:d="",lineHeight:p="",letterSpacing:h="",textAlign:f="",fontWeight:m="",fontStyle:g="",textDecoration:v="",fontFamily:y="",textTransform:w="",whiteSpace:k="",textWrap:E=""}=r;return(0,e.createElement)(o.PanelBody,{title:(0,a.__)("Typography","generateblocks-pro"),initialOpen:c,icon:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(xs,{size:"20"}),(0,e.createElement)(Yl,{cssProps:tl})),opened:!!s||void 0,scrollAfterOpen:l,onToggle:i},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(vl,{as:yc,label:"Text Color",value:d,onChange:e=>n("color",e),cssProp:"color"}),(0,e.createElement)(vl,{as:Ul,label:"Font Size",id:"gblocks-font-size",value:u,onChange:e=>n("fontSize",e),fallbackProp:!0,cssProp:"fontSize"}),(0,e.createElement)(vl,{as:o.SelectControl,allowCustomValue:!0,label:"Font Weight",id:"gblocks-font-weight",value:m,options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"Normal",value:"normal"},{label:"Bold",value:"bold"},{label:"100",value:"100"},{label:"200",value:"200"},{label:"300",value:"300"},{label:"400",value:"400"},{label:"500",value:"500"},{label:"600",value:"600"},{label:"700",value:"700"},{label:"800",value:"800"},{label:"900",value:"900"}]),onChange:e=>n("fontWeight",e),cssProp:"fontWeight"}),(0,e.createElement)(Uc,{value:g,onChange:e=>n("fontStyle",e),cssProp:"fontStyle"}),(0,e.createElement)(kc,{value:f,onChange:e=>n("textAlign",e),cssProp:"textAlign"}),(0,e.createElement)(zc,{value:w,onChange:e=>n("textTransform",e),cssProp:"textTransform"}),(0,e.createElement)(Vc,{value:v,onChange:e=>n("textDecoration",e),cssProp:"textDecoration"}),(0,e.createElement)(o.Flex,null,(0,e.createElement)(vl,{as:Ul,label:"Line Height",id:"gblocks-line-height",value:p,onChange:e=>n("lineHeight",e),cssProp:"lineHeight",units:[...Ul.defaultUnits,""],defaultUnit:""}),(0,e.createElement)(vl,{as:Ul,label:"Letter Spacing",id:"gblocks-letter-spacing",value:h,onChange:e=>n("letterSpacing",e),cssProp:"letterSpacing"})),(0,e.createElement)(Pc,{fontFamily:y,onStyleChange:n,cssProp:"fontFamily"}),(0,e.createElement)(vl,{id:"gblocks-white-space",as:o.SelectControl,allowCustomValue:!0,label:"White Space",cssProp:"whiteSpace",value:k,onChange:e=>n("whiteSpace",e),options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"normal",value:"normal"},{label:"nowrap",value:"nowrap"},{label:"pre",value:"pre"},{label:"pre-wrap",value:"pre-wrap"}])}),(0,e.createElement)(Hc,{value:E,onChange:e=>n("textWrap",e),cssProp:"textWrap"})))}const Gc={control:"_NzRFkfAZdO5fz9mzYFQ",gradient:"cyvbDSEsQuxCaJCPye3A",preview:"Gju0ESWDpMRAgnbjzF3R",bar:"pQ9zUrWi3t9NOp3KWntX",settings:"p6mQxmsHgrNb8BF8VGZF",setting:"MpCOS2rTgQDvUYzTNB5e","gb-styles-builder-control":"P2KynxdukVwFgLMCPBgU",remove:"FKBKF3OsLoLFUbpGbPaS",stops:"Oz7scs8qnBeA0B_akmfu",preset:"NuZkbpFc1n3LTbpK9UVw"};function Zc({onChange:t,setCurrentGradient:r,currentGradient:n,index:l}){const{colorStops:i}=n,c=i[l],[u,d]=(0,s.useState)(c.value),[p,h]=(0,s.useState)(c.length?c.length.value:void 0);return(0,s.useEffect)((()=>{t&&t({value:u},void 0!==p?{type:"%",value:p}:void 0)}),[u,p]),(0,e.createElement)(b.Stack,{direction:"horizontal",layout:"flex"},(0,e.createElement)(vl,{as:yc,"aria-label":"Color",value:u,onChange:d,cssProp:!1}),(0,e.createElement)("div",{style:{flexGrow:1}},(0,e.createElement)(vl,{as:o.RangeControl,value:void 0!==p?parseInt(p):void 0,hideLabelFromVision:!0,onChange:h,allowReset:!0,cssProp:!1})),(0,e.createElement)(o.Button,{disabled:i.length<3,tooltip:i.length<3?(0,a.__)("At least 2 color stops are required","generateblocks-pro"):null,className:Gc.remove,icon:dt,onClick:()=>{r((e=>{const t=[...e.colorStops];return t.splice(l,1),{...e,colorStops:t}}))},"aria-label":(0,a.sprintf)(
// translators: %s is the color stop number.
// translators: %s is the color stop number.
(0,a.__)("Remove stop %s","generateblocks-pro"),l)}))}function Yc({onChange:t,value:r="",presets:n=[],selectingPreset:l,setSelectingPreset:i=!1}){const[c,u]=(0,s.useState)(pa(r)),{type:d,angle:p,colorStops:h=[]}=c,f=(0,Us.applyFilters)("generateblocks.editor.gradientPresets",n);return(0,s.useEffect)((()=>{try{t(function(e){const{type:t,angle:r,colorStops:n}=e;return`${t}(${r?`${r}, `:""}${n.map((e=>`${e.value}${e.length?` ${e.length.value}%`:""}`)).join(", ")})`}(c))}catch(e){console.error(e.message)}}),[c]),(0,e.createElement)("div",{className:Gc.gradient},(0,e.createElement)(b.Stack,{gap:"12px"},(0,e.createElement)("div",{className:Gc.preview},(0,e.createElement)("div",{className:Gc.bar,style:{backgroundImage:r}})),l&&f?(0,e.createElement)(e.Fragment,null,f.map((t=>(0,e.createElement)("div",{className:Gc.preset,key:t.name},(0,e.createElement)("span",{className:ul.label},t.name),(0,e.createElement)(b.Stack,{direction:"horizontal",layout:"flex",gap:"2px"},t.gradients.map((t=>(0,e.createElement)(o.Button,{key:t.slug,onClick:()=>{u(pa(t.gradient))}},(0,e.createElement)("span",{style:{background:t.gradient?t.gradient:null}})))))))),(0,e.createElement)(o.Button,{variant:"link",onClick:()=>i(!1)},(0,a.__)("Back","generateblocks-pro"))):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:Gc.settings},(0,e.createElement)(b.Stack,{layout:"flex",direction:"horizontal",wrap:!1},(0,e.createElement)(vl,{as:o.SelectControl,label:(0,a.__)("Type","generateblocks-pro"),value:d,options:[{label:"Linear",value:"linear-gradient"},{label:"Radial",value:"radial-gradient"}],onChange:e=>{u((t=>({...t,type:e,angle:"radial-gradient"===e?void 0:t.angle||"90deg"})))},style:{flexGrow:1}}),"linear-gradient"===d&&(0,e.createElement)(vl,{as:o.AnglePickerControl,label:"Angle",value:p?parseFloat(p):0,onChange:e=>{u((t=>({...t,angle:`${e}deg`})))}}))),(0,e.createElement)("ul",{className:Gc.stops,role:"list"},h.map(((t,r)=>(0,e.createElement)("li",{key:r,style:{marginBottom:0}},(0,e.createElement)(Zc,{index:r,currentGradient:c,setCurrentGradient:u,colorStop:t,onChange:(e,t)=>{u((n=>{const o=[...n.colorStops],s=o[r];return o[r]={...s,...e,length:t},{...n,colorStops:o}}))}})))),(0,e.createElement)(o.Button,{variant:"primary",size:"compact",onClick:()=>{u((e=>({...e,colorStops:[...e.colorStops,{type:"rgb",value:"rgb(0, 0, 0)",length:{type:"%",value:0}}]})))}},(0,a.__)("Add Color","generateblocks-pro"))))))}const Kc={left:0,center:.5,top:0,right:1,bottom:1};function Xc(e,{width:t,height:r}){var n,o;const s=document.createElement("div");if(s.style.backgroundPosition=e,""===s.style.backgroundPosition)return e;t&&(s.style.width=`${t}px`),r&&(s.style.height=`${r}px`),document.body.appendChild(s);const a=getComputedStyle(s),l=a.backgroundPositionX,i=a.backgroundPositionY;document.body.removeChild(s);let c=null,u=null;return l.endsWith("%")?c=parseFloat(l)/100:l.endsWith("px")?c=parseFloat(i)/t:l in Kc&&(c=Kc[l]),i.endsWith("%")?u=parseFloat(i)/100:i.endsWith("px")?u=parseFloat(i)/t:i in Kc&&(u=Kc[l]),{x:null!==(n=parseFloat(Math.round(100*c)/100))&&void 0!==n?n:.5,y:null!==(o=parseFloat(Math.round(100*u)/100))&&void 0!==o?o:.5}}const Qc={control:"S_cDmslMmM_T8hmDHcBb",selectButton:"NycH4LLYToN_mjyxoQ43",url:"_AAylWX06i7jVP_6zJmF",flex:"HbiGF2bjGrx5ssezTmA2"};function Jc({onUrlChange:t,onPositionChange:r,onSizeChange:n,onMediaSelect:l,url:i,urlInputLabel:c,imageSizeLabel:u=(0,a.__)("Media Size","generateblocks-pro"),position:d="center",size:p="full"}){const h=sa("/plugins/generateblocks-pro/dist/assets/placeholder-lg.min.jpg"),f=(0,s.useRef)(null),[m,v]=(0,s.useState)({width:240,height:131}),[y,w]=(0,s.useState)((()=>Xc(d,m))),k=(0,a.__)("Enter any valid background position.","generateblocks-pro"),[E,S]=(0,s.useState)(k),[x,C,_]=(0,$e.useDebouncedInput)(d),[A,R]=(0,s.useState)((()=>{var e;return null!==(e=JSON.parse(sessionStorage.getItem("gb_image_sizes")))&&void 0!==e?e:{}})),[O,T]=(0,s.useState)((()=>function(e){if(e.startsWith("url(")){const t=e.match(/url\((.*?)\)/);return(t?t[1]:"").replaceAll('"',"").replaceAll("'","")}return e}(i))),[I,P]=(0,s.useState)(!0),[M,D]=(0,s.useState)(O),N=(0,s.useMemo)((()=>{var e;return null!==(e=function(e,t){const r=Object.keys(e).find((r=>Object.values(e[r]).some((e=>e.url===t))));return r?e[r]:null}(A,O))&&void 0!==e?e:{}}),[A,O]),L=(0,s.useMemo)((()=>{if(!Object.keys(N).length)return[{label:(0,a.__)("Current size","generateblocks-pro"),value:""}];const e=Object.keys(N).map((e=>({label:e.charAt(0).toUpperCase()+e.slice(1),value:e})));return e.length||e.unshift({label:(0,a.__)("Full","generateblocks-pro"),value:""}),e}),[N]),z=(0,s.useMemo)((()=>{var e;return Object.keys(N).length&&null!==(e=Object.entries(N).find((([,e])=>e.url===O))[0])&&void 0!==e?e:""}),[N,O]),B=(0,s.useCallback)((function(e){const t=`${Math.round(100*e.x)}% ${Math.round(100*e.y)}%`;w(e),C(t)}),[r]),j=(0,s.useCallback)((function(e){const t=function(e){const t=document.createElement("div");return t.style.backgroundPosition=e,""!==t.style.backgroundPosition}(e);C(e),t?(S(k),w(Xc(e,m))):S((0,a.__)("Invalid background position.","generateblocks-pro"))}),[]),F=(0,s.useCallback)((function(e){t&&(t(e),T(e),D(e)),P(!0)}),[t]);return(0,s.useLayoutEffect)((()=>{if(!f.current)return;const e=f.current.querySelector(".components-focal-point-picker__media--image");function t(){O.startsWith("var(")||"none"===O||P(!1),D(h),e.style.width="240px",e.style.height="131px"}if(e){e.addEventListener("error",t);const r=e.clientWidth||240,n=e.clientHeight||131;v({width:r,height:n})}return()=>{e&&e.removeEventListener("error",t)}}),[O]),Bl((()=>{r&&r(x)}),[_]),(0,e.createElement)("div",{className:g("gb-image-control",Qc.control),ref:f},(0,e.createElement)(b.Stack,{gap:"12px"},(0,e.createElement)("div",{className:Qc.flex},(0,e.createElement)(vl,{as:o.TextControl,className:Qc.url,type:"text",value:O,onChange:F,label:c,help:!I&&(0,a.__)("Could not load image.","generateblocks-pro")}),(0,e.createElement)(Hs.MediaUploadCheck,null,(0,e.createElement)(Hs.MediaUpload,{title:(0,a.__)("Choose Media","generateblocks-pro"),onSelect:e=>{var t,r;const n={...A,[e.id]:e.sizes};sessionStorage.setItem("gb_image_sizes",JSON.stringify(n)),R(n);const o=null!==(t=null!==(r=e.sizes?.[p].url)&&void 0!==r?r:e?.url)&&void 0!==t?t:"";F(o),l&&l(e)},allowedTypes:["image"],value:O,modalClass:"gb-image-control-modal",render:({open:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.Tooltip,{text:(0,a.__)("Open the Media Library","generateblocks-pro")},(0,e.createElement)(o.Button,{variant:"secondary",onClick:()=>{t()},className:Qc.selectButton},(0,a.__)("Select","generateblocks-pro"))))}))),"none"!==O&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Hs.MediaUploadCheck,null,(0,e.createElement)(vl,{as:o.SelectControl,value:z,options:L,disabled:!Object.keys(N).length,onChange:e=>{var t;(null!==(t=N?.[e])&&void 0!==t?t:null)&&F(N?.[e].url),n&&n(e)},label:u,help:Object.keys(N).length?(0,a.__)("Sets the size of the image chosen from the Media Library.","generateblocks-pro"):(0,a.__)("Size information is not available. Try re-inserting the image from the Media Library.","generateblocks-pro")})),(0,e.createElement)(o.FocalPointPicker,{url:M,value:y,onDragStart:B,onDrag:B,onChange:B}),(0,e.createElement)(vl,{as:o.TextControl,label:"Background Position",value:x,help:E,onChange:j}))))}const eu=[{label:"Default",value:""},{label:"Normal",value:"normal"},{label:"Multiply",value:"multiply"},{label:"Screen",value:"screen"},{label:"Overlay",value:"overlay"},{label:"Darken",value:"darken"},{label:"Lighten",value:"lighten"},{label:"Color-dodge",value:"color-dodge"},{label:"Color-burn",value:"color-burn"},{label:"Hard-light",value:"hard-light"},{label:"Soft-light",value:"soft-light"},{label:"Difference",value:"difference"},{label:"Exclusion",value:"exclusion"},{label:"Hue",value:"hue"},{label:"Saturation",value:"saturation"},{label:"Color",value:"color"},{label:"Luminosity",value:"luminosity"}],tu={image:(0,a.__)("Choose a background image from the Media Library or enter a URL to a remote image.","generateblocks-pro"),gradient:(0,a.__)("Use this to create a linear or radial gradient. To overlay a gradient over another background, the gradient colors must be semi-transparent.","generateblocks-pro"),overlay:(0,a.__)("Use this to overlay a single color over one or more backgrounds. The chosen color must semi-transparent.","generateblocks-pro"),none:(0,a.__)("Disables the background for this at-rule (sets background: none","generateblocks-pro")},ru="linear-gradient(to right, rgba(0, 0, 0, 1) 0%,rgba(10, 10, 10, 0.5) 100%)";function nu({currentOption:t,findBackgroundIndex:r,setSettings:n}){const l=(0,Hs.useSetting)("color.gradients")||[],[i,c]=(0,s.useState)(!1),u=[];l.length&&u.push({name:(0,a.__)("Theme.JSON Presets","generateblocks-pro"),gradients:l});const{styles:d,index:p}=r(),{type:h,backgroundImage:f="",backgroundSize:m="",backgroundRepeat:g="",backgroundPosition:b="",backgroundBlendMode:v="",backgroundAttachment:y="",overlayColor:w=""}=t,[k,E]=(0,s.useState)((()=>({prevType:h,prevValue:f}))),[S,x]=(0,s.useState)((()=>"gradient"===h?f:ru)),[C,_]=(0,s.useState)((()=>w||"rgba(0, 0, 0, .25)"));(0,s.useEffect)((()=>{if("gradient"===h&&f!==S){const e=[...d];e[p]={...e[p],backgroundImage:S},n(e)}}),[h,f,S,p,d,n]);const A=(0,s.useCallback)((e=>{const t=d[p].backgroundImage,{prevType:r="",prevValue:o=""}=k,s=[...d];s[p]={...s[p],type:e},["overlay","gradient"].includes(e)?("overlay"===e&&(s[p].overlayColor=C,s[p].backgroundImage="overlay"===r?o:`linear-gradient(to left, ${C} 0%, ${C} 100%)`),"gradient"===e&&(s[p].backgroundImage="gradient"===r?o:ru)):"image"===e?s[p].backgroundImage="image"===r?o:"":"none"===e&&(s[p].backgroundImage="none"),E({prevType:h,prevValue:t}),n(s)}),[d,p,C,h,k,n]);return t&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(kl,null,(0,e.createElement)(vl,{alwaysVisible:!0,as:o.SelectControl,options:[{label:(0,a.__)("Image","generateblocks-pro"),value:"image"},{label:(0,a.__)("Gradient","generateblocks-pro"),value:"gradient"},{label:(0,a.__)("Overlay","generateblocks-pro"),value:"overlay"},{label:(0,a.__)("None","generateblocks-pro"),value:"none"}],label:(0,a.__)("Background Type","generateblocks-pro"),onChange:A,dropdownChildren:({onClose:t})=>(0,e.createElement)(vl.Description,{label:(0,a.__)("About Background Types","generateblocks-pro"),onClick:t},(0,e.createElement)("dl",null,(0,e.createElement)("dt",null,(0,a.__)("Image","generateblocks-pro")," ","image"===h&&(0,a.__)("(Current)","generateblocks-pro")),(0,e.createElement)("dd",null,tu.image),(0,e.createElement)("dt",null,(0,a.__)("Gradient","generateblocks-pro")," ","gradient"===h&&(0,a.__)("(Current)","generateblocks-pro")),(0,e.createElement)("dd",null,tu.gradient),(0,e.createElement)("dt",null,(0,a.__)("Overlay","generateblocks-pro")," ","overlay"===h&&(0,a.__)("(Current)","generateblocks-pro")),(0,e.createElement)("dd",null,tu.overlay))),value:h}),"overlay"===h&&(0,e.createElement)(vl,{alwaysVisible:!0,as:yc,label:(0,a.__)("Overlay Color","generateblocks-pro"),help:(0,e.createElement)(e.Fragment,null,!C.includes("rgba")&&!C.includes("hsla")&&(0,a.__)("The chosen color must have some transparency for the background(s) beneath to be visible.","generateblocks-pro")),value:C,onChange:e=>{d[p].overlayColor=e,d[p].backgroundImage=`linear-gradient(to left, ${e} 0%, ${e} 100%)`,_(e),n(d)},dropdownChildren:({onClose:t})=>(0,e.createElement)(vl.Description,{label:(0,a.__)("About Background Overlay","generateblocks-pro"),onClick:t},tu.overlay)}),"image"===h&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(vl,{alwaysVisible:!0,as:Jc,label:"Background Image",url:f,position:b,onUrlChange:e=>{const t=e.startsWith("http")||e.startsWith("://")||e.startsWith("/");d[p].backgroundImage=t?`url(${e})`:e,n(d)},onPositionChange:e=>{d[p].backgroundPosition=e,n(d)},dropdownChildren:({onClose:t})=>(0,e.createElement)(vl.Description,{label:(0,a.__)("About Background Image","generateblocks-pro"),onClick:t},tu.image)}),"none"!==f&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(vl,{alwaysVisible:!0,allowCustomValue:!0,as:o.SelectControl,label:"Repeat",value:g,options:[{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"repeat",value:"repeat"},{label:"repeat-x",value:"repeat-x"},{label:"repeat-y",value:"repeat-y"},{label:"round",value:"round"},{label:"space",value:"space"},{label:"no-repeat",value:"no-repeat"}],dropdownChildren:({onClose:t})=>(0,e.createElement)(vl.Description,{label:(0,a.__)("About Background Repeat","generateblocks-pro"),onClick:t},(0,a.__)("The background-repeat CSS property sets how background images are repeated. A background image can be repeated along the horizontal and vertical axes, or not repeated at all.","generateblocks-pro")),onChange:(e=0)=>{d[p].backgroundRepeat=e,n(d)},learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/background-repeat",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro")}),(0,e.createElement)(vl,{alwaysVisible:!0,as:o.SelectControl,allowCustomValue:!0,label:"Size",value:m,placeholder:(0,a.__)("100px 50%, cover, contain, etc","generateblocks-pro"),options:[{id:1,label:(0,a.__)("Default","generateblocks-pro"),value:""},{id:2,label:"cover",value:"cover"},{id:3,label:"contain",value:"contain"},{id:4,label:"auto",value:"auto"}],onChange:e=>{d[p].backgroundSize=e,n(d)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:o.SelectControl,allowCustomValue:!0,label:"Attachment Type",value:y,options:[{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"Fixed",value:"fixed"},{label:"Scroll with Content (scroll)",value:"scroll"},{label:"Local",value:"local"}],dropdownChildren:({onClose:t})=>(0,e.createElement)(vl.Description,{label:(0,a.__)("About Background Attachment","generateblocks-pro"),onClick:t},(0,a.__)("The background-attachment CSS property sets whether a background image's position is fixed within the viewport, or scrolls with its containing block.","generateblocks-pro")),onChange:(e=0)=>{d[p].backgroundAttachment=e,n(d)},learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/background-attachment",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro")}))),"gradient"===h&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(vl,{alwaysVisible:!0,as:Yc,selectingPreset:i,setSelectingPreset:c,presets:u,label:"Gradient",onChange:x,value:f.includes("gradient")?f:ru,dropdownChildren:({onClose:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(vl.Description,{label:(0,a.__)("About Gradients","generateblocks-pro"),onClick:t},tu.gradient),(0,e.createElement)(o.MenuGroup,null,(0,e.createElement)(o.MenuItem,{onClick:()=>{t(),c(!i)}},i?(0,a.__)("Cancel select preset","generateblocks-pro"):(0,a.__)("Select preset","generateblocks-pro")))),learnMoreLabel:(0,a.__)("Learn more about gradients.","generateblocks-pro"),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/gradient"})),"none"!==f&&(0,e.createElement)(vl,{alwaysVisible:!0,as:o.SelectControl,allowCustomValue:!0,label:"Blend Mode",value:v,options:eu,onChange:(e=0)=>{d[p].backgroundBlendMode=e,n(d)},dropdownChildren:({onClose:t})=>(0,e.createElement)(vl.Description,{label:(0,a.__)("About Background Blend Mode","generateblocks-pro"),onClick:t},(0,a.__)("The background-blend-mode CSS property sets how an element's background images should blend with each other and with the element's background color.","generateblocks-pro")),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/background-blend-mode",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro")})))}function ou(e){const{background:t="",backgroundBlendMode:r="",backgroundAttachment:n="",backgroundImage:o="",backgroundPosition:s="",backgroundSize:a="",backgroundRepeat:l=""}=e;if(Object.values(e).every((e=>""===e)))return[];if(t){const e=r.split(",");return function(e){return(e.match(ca)||[]).map((e=>{const t=document.createElement("div");if(t.style.background=e,""===t.style.background)return{type:"image"};const{backgroundAttachment:r="",backgroundImage:n="",backgroundSize:o="",backgroundRepeat:s="",backgroundPosition:a=""}=t.style,l=n.includes("gradient("),i=n.startsWith("url(");if(!l&&!i)return{type:"image"};let c="image",u="";if(l){c="gradient";const e=n.match(ia);e&&e.every((t=>t===e[0]))&&(c="overlay",u=e[0])}return{type:c,backgroundAttachment:"initial"===r?"":r,backgroundImage:n.replaceAll('"',"").replaceAll("'",""),backgroundSize:o,backgroundRepeat:s,backgroundPosition:a,overlayColor:u}}))}(t).map(((t,r)=>(t.backgroundBlendMode=e[r]||"normal","image"===t.type&&(t.media={id:0}),t)))}return Pa({backgroundBlendMode:r,backgroundAttachment:n,backgroundImage:o,backgroundPosition:s,backgroundSize:a,backgroundRepeat:l})}const su=({onStyleChange:t,value:r,atRule:n})=>{var l;const[i,c]=(0,s.useState)(!1),[u,d]=(0,s.useState)((()=>ou(r))),[p,h]=(0,s.useState)(null),f=u.some((e=>"none"===e.backgroundImage)),m=(0,s.useRef)(!1),g=null!==(l=u[p])&&void 0!==l?l:null,b=null!==g;(0,s.useEffect)((()=>{m.current?m.current=!1:d(ou(r))}),[r]);const v=(0,$e.useDebounce)(t,0),y=(0,s.useCallback)((function(e){m.current=!0,d(e),v({backgroundAttachment:e.reduce(((e,t)=>{const{backgroundAttachment:r=""}=t;return e.length>0?`${e},${r.trim()}`:`${r.trim()}`}),""),backgroundImage:e.reduce(((e,t)=>{const{backgroundImage:r=""}=t;return e.length>0?`${e},${r.trim()}`:`${r.trim()}`}),""),backgroundSize:e.reduce(((e,t)=>{const{backgroundSize:r=""}=t;return e.length>0?`${e},${r.trim()}`:`${r.trim()}`}),""),backgroundRepeat:e.reduce(((e,t)=>{const{backgroundRepeat:r=""}=t;return e.length>0?`${e},${r.trim()}`:`${r.trim()}`}),""),backgroundPosition:e.reduce(((e,t)=>{const{backgroundPosition:r=""}=t;return e.length>0?`${e},${r.trim()}`:`${r.trim()}`}),""),backgroundBlendMode:e.reduce(((e,t)=>{const{backgroundBlendMode:r="normal"}=t;return e.length>0?`${e},${r.trim()}`:`${r.trim()}`}),"").trim()})}),[v]),w=(0,s.useCallback)((()=>{const e=[...u];return{styles:e,index:e[p]?p:-1}}),[u,p]),{styles:k,index:E}=w();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(wl,{id:"BackgroundControl",items:u,label:(0,a.__)("Backgrounds","generateblocks-pro"),isEditing:b,onClickDelete:()=>{k.splice(E,1),y(k),h(null)},onClickDone:()=>{h(null)},showAdd:!f,dropdownChildren:({onClose:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.MenuGroup,{label:(0,a.__)("Options","generateblocks-pro")},(0,e.createElement)(wl.DeleteAll,{label:(0,a.__)("Delete all background styles","generateblocks-pro"),content:(0,a.__)("This will delete all background styles for the current selector. This operation cannot be undone.","generateblocks-pro"),items:u,onDelete:()=>{y([]),h(null)},onClose:t,confirmDelete:i,setConfirmDelete:c})),!i&&(0,e.createElement)(wl.LearnMore,{learnMoreLabel:(0,a.__)("Learn more about Backgrounds","generateblocks-pro"),learnMoreURL:"https://developer.mozilla.org/en-US/docs/Web/CSS/background",onClose:t})),onAdd:()=>{const e=u.some((e=>"image"===e.type));h(0),y([e?da():ua(n),...u])},learnMoreLabel:(0,a.__)("Learn more about Backgrounds","generateblocks-pro"),learnMoreURL:"https://developer.mozilla.org/en-US/docs/Web/CSS/background",help:f&&(0,a.__)("Remove the disabled background to enable.","generateblocks-pro"),searchKeywords:["image","gradient","blend mode","bg"],cssProp:Object.keys(r)},(0,e.createElement)("div",{className:Gc.control},(0,e.createElement)("div",{className:Gc.wrapper},!b&&(0,e.createElement)("div",null,(0,e.createElement)(Cl,{items:u,dragHandleLabel:(0,a.__)("Reorder Background","generateblocks-pro"),setItems:e=>{y(e)},itemComponent:function({item:t,index:r}){const n=function(e={}){var t;return[["backgroundImage",null!==(t=e.backgroundImage)&&void 0!==t?t:""],...Object.entries(e).filter((([e])=>e.startsWith("background")&&"backgroundImage"!==e))].reduce(((e,[t,r])=>t.startsWith("background")&&r?e?`${e}\n${la(t)}: ${r};`:`${la(t)}: ${r};`:e),"")}(t),o=n.length>0?n:(0,a.__)("Empty","generateblocks-pro");return(0,e.createElement)(Cl.Item,{label:t.label,css:o,canDuplicate:n.length>0,onDuplicate:()=>{const e=[...u,{...t}];h(e.length-1),y(e)},onEdit:()=>{h(r)}})},dragHandle:!0})),b&&(0,e.createElement)(nu,{isEditing:b,currentOption:g,findBackgroundIndex:w,setSettings:y})))))};function au(t){const{styles:r,onStyleChange:n,nestedRule:l,atRule:i,opened:c,scrollAfterOpen:u,onToggle:d,initialOpen:p}=t,{background:h="",backgroundColor:f="",backgroundClip:m="",backgroundOrigin:g="",backgroundBlendMode:v="",backgroundAttachment:y="",backgroundImage:w="",backgroundPosition:k="",backgroundSize:E="",backgroundRepeat:S=""}=r,x=(0,s.useMemo)((()=>({background:h,backgroundBlendMode:v,backgroundAttachment:y,backgroundImage:w,backgroundPosition:k,backgroundSize:E,backgroundRepeat:S})),[h,v,y,w,k,E,S]);return(0,e.createElement)(o.PanelBody,{title:(0,a.__)("Backgrounds","generateblocks-pro"),initialOpen:p,icon:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Cs,{size:"20"}),(0,e.createElement)(Yl,{cssProps:rl})),opened:!!c||void 0,scrollAfterOpen:u,onToggle:d},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(su,{value:x,onStyleChange:n,nestedRule:l,atRule:i}),(0,e.createElement)(vl,{as:yc,label:"Background Color",value:f,cssProp:"backgroundColor",onChange:e=>n("backgroundColor",e),searchKeywords:["bg"]}),(0,e.createElement)(vl,{allowCustomValue:!0,as:o.SelectControl,label:"Background Clip",value:m,cssProp:"backgroundClip",options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"border-box",value:"border-box"},{label:"padding-box",value:"padding-box"},{label:"content-box",value:"content-box"},{label:"text",value:"text"}]),onChange:e=>n("backgroundClip",e),learnMoreLabel:(0,a.__)("Learn more about this property","generateblocks-pro"),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip",dropdownChildren:()=>(0,e.createElement)(o.MenuGroup,{label:(0,a.__)("About Background Clip","generateblocks-pro")},(0,e.createElement)("p",{style:{padding:"0 8px"}},(0,a.__)("This property only will apply if a background color or image is set, or if the element has a border with transparency.","generateblocks-pro")))}),(0,e.createElement)(vl,{allowCustomValue:!0,as:o.SelectControl,label:"Background Origin",value:g,cssProp:"backgroundOrigin",options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"border-box",value:"border-box"},{label:"padding-box",value:"padding-box"},{label:"content-box",value:"content-box"}]),onChange:e=>n("backgroundOrigin",e),learnMoreLabel:(0,a.__)("Learn more about this property","generateblocks-pro"),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/background-origin",dropdownChildren:()=>(0,e.createElement)(o.MenuGroup,{label:(0,a.__)("About Background Origin","generateblocks-pro")},(0,e.createElement)("p",{style:{padding:"0 8px"}},(0,a.__)("This property property sets the background's origin: from the border start, inside the border, or inside the padding.","generateblocks-pro")))})))}const lu=window.lodash,iu={parentControl:"gHGfHBQP2C81NWCZwcnN",control:"EniC23tEnw6w8g9DWTFR",dropdown:"e6ezWqom3L7Tmh5dVC5E",fallback:"H1Q7u0ti2sm6ebVl62oO",colors:"WwmfJitInBLetqwKtfQ0",sync:"BbSvFj3yOxLBpu_v_AbE",flexShrink:"Ax6Yv9sD57Z1rKvYHJI_"};function cu({icon:t}){return"border-none"===t?(0,e.createElement)(ps,null):"border-solid"===t?(0,e.createElement)(hs,null):"border-dashed"===t?(0,e.createElement)(fs,null):"border-dotted"===t?(0,e.createElement)(ms,null):"border-default"===t?(0,e.createElement)(gs,null):"borders"===t?(0,e.createElement)(bs,null):void 0}function uu({value:t,placeholder:r="",onChange:n}){const s={none:(0,e.createElement)(cu,{icon:"border-none"}),solid:(0,e.createElement)(cu,{icon:"border-solid"}),dashed:(0,e.createElement)(cu,{icon:"border-dashed"}),dotted:(0,e.createElement)(cu,{icon:"border-dotted"})},l=t||r,i=!t&&!!r;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.DropdownMenu,{className:g(iu.dropdown,i&&iu.fallback),icon:s[l]||(0,e.createElement)(cu,{icon:"border-default"}),label:(0,a.__)("Select a style","generateblocks-pro")},(({onClose:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.MenuGroup,null,(0,e.createElement)(o.MenuItem,{icon:(0,e.createElement)(cu,{icon:"border-default"}),onClick:()=>{n(""),t()}},(0,a.__)("Default","generateblocks-pro")),(0,e.createElement)(o.MenuItem,{icon:(0,e.createElement)(cu,{icon:"border-none"}),onClick:()=>{n("none"),t()}},"None"),(0,e.createElement)(o.MenuItem,{icon:(0,e.createElement)(cu,{icon:"border-solid"}),onClick:()=>{n("solid"),t()}},"Solid"),(0,e.createElement)(o.MenuItem,{icon:(0,e.createElement)(cu,{icon:"border-dashed"}),onClick:()=>{n("dashed"),t()}},"Dashed"),(0,e.createElement)(o.MenuItem,{icon:(0,e.createElement)(cu,{icon:"border-dotted"}),onClick:()=>{n("dotted"),t()}},"Dotted"))))))}const du=["borderTop","borderRight","borderBottom","borderLeft"],pu=new Set(["borderTopWidth","borderTopStyle","borderTopColor","borderRightWidth","borderRightStyle","borderRightColor","borderBottomWidth","borderBottomStyle","borderBottomColor","borderLeftWidth","borderLeftStyle","borderLeftColor"]);function hu(e){return null==e||""===e?"":String(e)}function fu(e,t=[]){const r=du.map((t=>({width:hu(e[t+"Width"]),style:hu(e[t+"Style"]),color:hu(e[t+"Color"])}))),n=r.every((e=>""===e.width&&""===e.style&&""===e.color));if(n&&!function(e){return!!Array.isArray(e)&&e.some((e=>pu.has(e.property)&&e.hasInheritedValue&&e.source&&"current"!==e.source))}(t))return"all";const o=r.some((e=>""===e.width||""===e.style||""===e.color)),s=r.every((e=>(0,lu.isEqual)(e,r[0])));return!(!s||o)&&"all"}const mu=["borderTop","borderRight","borderBottom","borderLeft"];function gu(t){var r;const{styles:n,onStyleChange:l,opened:i,scrollAfterOpen:c,onToggle:u,initialOpen:d}=t,p=Xe(),{search:h="",activeFilter:f=""}=p?.controlFilters,m=null!==(r=p?.inheritedSources)&&void 0!==r?r:[],[v,y]=(0,s.useState)((()=>fu(n,m))),{border:w="",borderTopWidth:k="",borderTopStyle:E="",borderTopColor:S="",borderRightWidth:x="",borderRightStyle:C="",borderRightColor:_="",borderBottomWidth:A="",borderBottomStyle:R="",borderBottomColor:O="",borderLeftWidth:T="",borderLeftStyle:I="",borderLeftColor:P="",borderTopLeftRadius:M="",borderTopRightRadius:D="",borderBottomRightRadius:N="",borderBottomLeftRadius:L=""}=n,z={border:w,borderTopWidth:k,borderTopStyle:E,borderTopColor:S,borderRightWidth:x,borderRightStyle:C,borderRightColor:_,borderBottomWidth:A,borderBottomStyle:R,borderBottomColor:O,borderLeftWidth:T,borderLeftStyle:I,borderLeftColor:P},B={borderTop:"Top",borderRight:"Right",borderBottom:"Bottom",borderLeft:"Left"};(0,s.useEffect)((()=>{if("all"===v&&(h||f))return void y(!1);if(h||f)return;const e=e=>null==e||""===e?"":String(e),t=mu.map((t=>({width:e(z[t+"Width"]),style:e(z[t+"Style"]),color:e(z[t+"Color"])}))),r=t.every((e=>(0,lu.isEqual)(e,t[0])));!v||r?v||"all"===fu(z,m)&&y("all"):y(!1)}),[h,f,JSON.stringify(z),JSON.stringify(m)]);const j=(0,s.useCallback)((function(){const e=mu.filter((e=>{return z[e+"Width"]||(t=z[e+"Width"],isNaN(parseFloat(t))&&isFinite(t));var t}));if(!e.length)return;const t=e[0],r=Object.entries(z).reduce(((e,[r,n])=>(r.startsWith(t)&&(e[r.replace(t,"")]=n),e)),{}),n=Object.entries(r).reduce(((e,[t,r])=>r?(mu.forEach((n=>{e[n+t]=r})),e):e),{});l(n)}),[z,l]),F={"Top Left":{prop:"borderTopLeftRadius",value:M},"Top Right":{prop:"borderTopRightRadius",value:D},"Bottom Right":{prop:"borderBottomRightRadius",value:N},"Bottom Left":{prop:"borderBottomLeftRadius",value:L}},V=(0,s.useMemo)((()=>v?w:Object.values(z).filter(Boolean).join(",")),[z,v]);return(0,e.createElement)(o.PanelBody,{title:(0,a.__)("Borders","generateblocks-pro"),initialOpen:d,icon:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Ss,{size:"20"}),(0,e.createElement)(Yl,{cssProps:el})),opened:!!i||void 0,scrollAfterOpen:c,onToggle:u},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(vl,{label:"Border",id:"gblocks-border",className:g("gb-borders",iu.parentControl),beforeDropdownMenu:(0,e.createElement)(ui,{sync:v,setSync:y,syncTypes:["all"],onClick:e=>{e&&j()}}),searchKeywords:Object.keys(z),cssProp:Object.keys(z),value:V},(0,e.createElement)(b.Stack,{gap:"12px"},mu.map(((t,r)=>{if(v&&r>0)return null;const n=v?(0,a.__)("All sides","generateblocks-pro"):B[t],o=v?Object.keys(z):[t+"Width",t+"Style",t+"Color"],s=v?V:[z[t+"Width"],z[t+"Style"],z[t+"Color"]].filter(Boolean).join(","),i=v?"all-sides":t,c=v?Object.keys(z):[t+"Width",t+"Style",t+"Color"];return(0,e.createElement)(vl,{key:i,label:n,searchKeywords:o,value:s,cssProp:c},(0,e.createElement)("div",{className:iu.control,"data-border-area":i},(0,e.createElement)(vl,{as:Ul,id:"gblocks-"+t+"-width",value:z[t+"Width"]||"",cssProp:t+"Width",alwaysVisible:!0,"aria-label":`border ${t} width`,onChange:e=>{const r={[t+"Width"]:e};v&&(r.borderRightWidth=e,r.borderBottomWidth=e,r.borderLeftWidth=e),e?z[t+"Style"]||(r[t+"Style"]="solid",v&&(r.borderRightStyle="solid",r.borderBottomStyle="solid",r.borderLeftStyle="solid")):(r[t+"Style"]="",v&&(r.borderRightStyle="",r.borderBottomStyle="",r.borderLeftStyle="")),l(r)}}),(0,e.createElement)(vl,{as:uu,value:z[t+"Style"],cssProp:t+"Style",alwaysVisible:!0,onChange:e=>{const r={[t+"Style"]:e};v&&(r.borderRightStyle=e,r.borderBottomStyle=e,r.borderLeftStyle=e),l(r)},"aria-label":`border ${t} style`,className:iu.flexShrink}),(0,e.createElement)(vl,{as:yc,value:z[t+"Color"]||"",cssProp:t+"Color",alwaysVisible:!0,alpha:!0,onChange:e=>{const r={[t+"Color"]:e};v&&(r.borderRightColor=e,r.borderBottomColor=e,r.borderLeftColor=e),l(r)},"aria-label":`border ${t} color`})))})))),(0,e.createElement)(mi,{id:"border-radius",label:"Border Radius",onChange:l,cssProps:F,syncTypes:["all"],layout:"corners",className:"border-radius"})))}function bu(t){const{styles:r,onStyleChange:n,opened:l,scrollAfterOpen:i,onToggle:c,initialOpen:u}=t,{position:d="",overflowX:p="",overflowY:h="",zIndex:f="",top:m="",right:g="",bottom:v="",left:y=""}=r,w=ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"visible",value:"visible"},{label:"hidden",value:"hidden"},{label:"clip",value:"clip"},{label:"scroll",value:"scroll"},{label:"auto",value:"auto"}]),k=(0,s.useMemo)((()=>({Top:{prop:"top",value:m},Right:{prop:"right",value:g},Bottom:{prop:"bottom",value:v},Left:{prop:"left",value:y}})),[m,g,v,y]);return(0,e.createElement)(o.PanelBody,{title:(0,a.__)("Position","generateblocks-pro"),initialOpen:u,icon:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(As,{size:"20"}),(0,e.createElement)(Yl,{cssProps:nl})),opened:!!l||void 0,scrollAfterOpen:i,onToggle:c},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(vl,{allowCustomValue:!0,as:o.SelectControl,label:"position",value:d,options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"Relative",value:"relative"},{label:"Absolute",value:"absolute"},{label:"Sticky",value:"sticky"},{label:"Fixed",value:"fixed"},{label:"Static",value:"static"}]),onChange:e=>n("position",e),cssProp:"position"}),(0,e.createElement)(mi,{id:"inset",cssProps:k,onChange:n,syncTypes:["all"],label:"Inset"}),(0,e.createElement)(vl,{allowCustomValue:!0,as:o.SelectControl,label:"Overflow-X",value:p,options:w,onChange:e=>n("overflowX",e),cssProp:"overflowX"}),(0,e.createElement)(vl,{allowCustomValue:!0,as:o.SelectControl,label:"Overflow-Y",value:h,options:w,onChange:e=>n("overflowY",e),cssProp:"overflowY"}),(0,e.createElement)(vl,{as:o.TextControl,label:"z-index",value:f,cssProp:"zIndex",onChange:e=>{n("zIndex",e),d||n("position","relative")}})))}function vu({opacity:t,onStyleChange:r}){let n=100*parseFloat(t);return isNaN(n)&&(n=t),(0,e.createElement)(vl,{as:Ul,label:"Opacity",value:n,step:1,cssProp:"opacity",onChange:e=>{let t=parseFloat(e)/100;isNaN(t)&&(t=e),r("opacity",t)},min:0,max:100,allowOtherUnits:!1,units:["%"]})}const yu=e=>e.replace(/-webkit-box-shadow:[^;]+;|-moz-box-shadow:[^;]+;/g,""),wu=e=>e.replace(/box-shadow/g,"").replace(/webkit/g,"").replace(/\r?\n|\r/g,"").replace(/;/g,"").replace(/:/g,"").trim(),ku=(e=[])=>e.reduce(((e,t)=>{if(t.hidden)return e;const{offsetX:r="",offsetY:n="",blur:o="",spread:s="",color:a="",inset:l=!1}=t,i=`${l?"inset":""} ${r} ${n} ${o} ${s} ${a}`.trim();return i.trim().length?e.length>0?`${e}, ${i}`:`${i}`:e}),"").replace(/,$/,"").trim(),Eu=function(){const e=/,(?![^\(]*\))/,t=/\s(?![^(]*\))/,r=/^[0-9]+[a-zA-Z%]+$/,n=e=>{const r=e.split(t),n=r.includes("inset"),o=r.slice(-1)[0],a=s(o)?void 0:o,l=r.filter((e=>"inset"!==e)).filter((e=>e!==a)),[i,c,u,d]=l;return{inset:n,offsetX:i,offsetY:c,blur:u,spread:d,color:a}},o=e=>{const{inset:t,offsetX:r=0,offsetY:n=0,blur:o=0,spread:s,color:a}=e||{};return[t?"inset":null,r,n,o,s,a].filter((e=>null!=e)).map((e=>(""+e).trim())).join(" ")},s=e=>r.test(e);return{parse:t=>t?t.split(e).map((e=>e.trim())).map(n):[],stringify:e=>e?.length?e.map(o).join(", "):""}}(),Su=["px","em","rem","vw","vh","ch"];function xu({findBoxShadowIndex:t,setSettings:r,currentOption:n=null}){const{styles:s,index:a}=t();return n&&(0,e.createElement)(kl,null,(0,e.createElement)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},(0,e.createElement)(o.CheckboxControl,{checked:n.inset,label:"Inset",onChange:e=>{s[a].inset=e,r(s)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:yc,value:n?.color||"rgba(0,0,0,.1)",tooltip:"Box Shadow Color",onChange:e=>{s[a].color=e,r(s)}})),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,label:"x-Offset",units:Su,value:n.offsetX,onChange:e=>{s[a].offsetX=e,r(s)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,label:"y-Offset",units:Su,value:n.offsetY,onChange:e=>{s[a].offsetY=e,r(s)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,label:"blur",units:Su,value:n?.blur,onChange:e=>{s[a].blur=e,r(s)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,label:"spread",units:Su,value:n?.spread,onChange:e=>{s[a].spread=e,r(s)}}))}function Cu({onStyleChange:t,value:r}){var n;const[l,i]=(0,s.useState)(!1),[c,u]=(0,s.useState)(""),[d,p]=(0,s.useState)(!1),[h,f]=(0,s.useState)((()=>Eu.parse(r))),[m,g]=(0,s.useState)(null),b=(0,s.useRef)(!1),v=null!==(n=h[m])&&void 0!==n?n:null,y=null!==v;(0,s.useEffect)((()=>{b.current?b.current=!1:f(Eu.parse(r))}),[r]);const w=(0,$e.useDebounce)(t,0),k=(0,s.useCallback)((function(e){b.current=!0,f(e),w("boxShadow",ku(e))}),[w]),E=(0,s.useCallback)((()=>{const e=[...h];return{styles:e,index:e[m]?m:-1}}),[h,m]),{styles:S,index:x}=E();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(wl,{items:h,label:"Box Shadow",searchKeywords:["shadows","box-shadow"],cssProp:"boxShadow",onAdd:()=>{const e=[...h,{offsetX:"10px",offsetY:"10px",blur:"5px",spread:"7px",color:"rgba(0,0,0,0.1)",inset:!1}];g(e.length-1),k(e)},isEditing:y,onClickDelete:()=>{S.splice(x,1),k(S),g(null)},onClickDone:()=>{g(null)},dropdownChildren:({onClose:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.MenuGroup,{label:(0,a.__)("Options","generateblocks-pro")},!d&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.MenuItem,{onClick:()=>{i(!0),t()}},(0,a.__)("Add via paste…","generateblocks-pro"))),(0,e.createElement)(wl.DeleteAll,{label:(0,a.__)("Delete all box shadow styles","generateblocks-pro"),content:(0,a.__)("This will delete all box shadow styles for the current selector. This operation cannot be undone.","generateblocks-pro"),items:h,onDelete:e=>{k(e),g(null)},onClose:t,confirmDelete:d,setConfirmDelete:p})),!d&&(0,e.createElement)(wl.LearnMore,{learnMoreLabel:(0,a.__)("Learn more about CSS Box Shadows","generateblocks-pro"),learnMoreURL:"https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow",onClose:t}))},(0,e.createElement)("div",{className:"gb-box-shadow"},(0,e.createElement)("div",{className:"gb-box-shadow__wrapper"},!y&&(0,e.createElement)("div",null,(0,e.createElement)(Cl,{items:h,dragHandleLabel:(0,a.__)("Reorder Box Shadow","generateblocks-pro"),setItems:e=>{k(e)},itemComponent:function({item:t,index:r}){const n=ku([t]),o=n.length>0?n:(0,a.__)("Invalid box shadow","generateblocks-pro");return(0,e.createElement)(Cl.Item,{css:o,swatchColor:t.color,canDuplicate:n.length>0,onDuplicate:()=>{const e=[...h,{...t}];g(e.length-1),k(e)},onEdit:()=>{g(r)}})},dragHandle:!0})),(0,e.createElement)(xu,{isEditing:y,currentOption:v,findBoxShadowIndex:E,setSettings:k}))),(0,e.createElement)(wl.PasteModal,{property:"box-shadow",errorMessage:c,showPasteStyles:l,setShowPasteStyles:i,onAddStyles:({pastedValue:e,replaceStyles:t})=>{if(!e||0===e.length)return!1;try{const r=Eu.parse(wu(yu(e))),n=t?[...r]:[...h,...r];return k(n),i(!1),u(""),!0}catch(e){return u((0,a.__)("Error parsing pasted styles. Please check your CSS and try again.","generateblocks-pro")),!1}}})))}function _u(e){return e?v(e).map((e=>{const t=document.createElement("div");if(t.style.transition=e,""===t.style.transition)return!1;const{transitionProperty:r="",transitionDuration:n="",transitionTimingFunction:o="",transitionDelay:s=""}=t.style;return{transitionProperty:r,transitionDuration:n,transitionTimingFunction:o,transitionDelay:s}})).filter(Boolean):[]}const Au=e=>e.replace(/transition/g,"").replace(/webkit/g,"").replace(/\r?\n|\r/g,"").replace(/;/g,"").replace(/:/g,"").trim(),Ru=(e=[])=>e.reduce(((e,t)=>{if(t.hidden)return e;const{transitionProperty:r,transitionDuration:n,transitionDelay:o,transitionTimingFunction:s}=t,a=`${r} ${n} ${s} ${o}`.trim();return a.length?e.length>0?`${e}, ${a}`:`${a}`:e}),"").replace(/,$/,"").trim(),Ou=(e="")=>{const t=e.match(/^cubic-bezier\((\d+(?:\.\d+)?),\s*(\d+(?:\.\d+)?),\s*(\d+(?:\.\d+)?),\s*(\d+(?:\.\d+)?)\)$/);if(t){const[,e,,r]=t;return e<0||e>1||r<0||r>1?[!1,(0,a.__)("Invalid cubic-bezier definition.","generateblocks-pro")]:[!0,""]}const r=e.match(/^steps\(([^,]+),\s*(.+)\)$/);if(r){const[,e,t]=r,n=parseInt(e,10),o=["jump-start","jump-end","jump-none","jump-both","start","end"];return isNaN(n)||n<1||!o.includes(t)?[!1,(0,a.__)("Invalid steps definition.","generateblocks-pro")]:[!0,""]}return e.startsWith("var(--")||["ease","linear","ease-in","ease-out","ease-in-out","initial","inherit","revert","revert-layer","unset"].includes(e)?[!0,""]:[!1,(0,a.__)("Unknown timing function.","generateblocks-pro")]},Tu=["s"];function Iu({currentOption:t,findTransitionIndex:r,setSettings:n,cssPropertyError:s,cssTimingError:l}){const{styles:i,index:c}=r();if(t){var u;let e=!1;hn.all.includes(null!==(u=t.transitionProperty)&&void 0!==u?u:"")||(i[c].transitionProperty="all",e=!0),Ou(t.transitionTimingFunction)||(i[c].transitionTimingFunction="ease",e=!0),e&&n(i)}return t&&(0,e.createElement)(kl,null,(0,e.createElement)(vl,{as:Ul,label:"Duration",units:Tu,value:t.transitionDuration,defaultUnitValue:"s",onChange:e=>{i[c].transitionDuration=e,n(i)},alwaysVisible:!0,allowOtherUnits:!1}),(0,e.createElement)(vl,{as:Ul,label:"Delay",units:Tu,value:t.transitionDelay,defaultUnitValue:"s",onChange:e=>{i[c].transitionDelay=e,n(i)},alwaysVisible:!0,allowOtherUnits:!1}),(0,e.createElement)(vl,{as:o.TextControl,label:"Transition Property",value:t.transitionProperty,onChange:e=>{i[c].transitionProperty=e,n(i)},help:s,alwaysVisible:!0}),(0,e.createElement)(vl,{alwaysVisible:!0,as:o.SelectControl,allowCustomValue:!0,label:"Timing Function",value:t.transitionTimingFunction,options:ri([{label:"Ease",value:"ease"},{label:"Linear",value:"linear"},{label:"Ease-in",value:"ease-in"},{label:"Ease-out",value:"ease-out"},{label:"Ease-in-out",value:"ease-in-out"},{label:"Step-start",value:"step-start"},{label:"Step-end",value:"step-end"}]),help:l,customValueHelp:l||(0,a.__)("Enter any valid CSS timing function.","generateblocks-pro"),onChange:e=>{i[c].transitionTimingFunction=e,n(i)}}))}function Pu({onStyleChange:t,value:r}){var n;const[l,i]=(0,s.useState)(!1),[c,u]=(0,s.useState)(""),[d,p]=(0,s.useState)(!1),[h,f]=(0,s.useState)((()=>_u(r))),[m,g]=(0,s.useState)(null),[b,v]=(0,s.useState)(null),[y,w]=(0,s.useState)(null),k=(0,s.useRef)(!1),E=null!==(n=h[y])&&void 0!==n?n:null,S=null!==E;(0,s.useEffect)((()=>{k.current?k.current=!1:f(_u(r))}),[r]);const x=(0,$e.useDebounce)(t,0),C=(0,s.useCallback)((function(e){k.current=!0,f(e),x("transition",Ru(e))}),[x]),_=(0,s.useCallback)((()=>{const e=[...h];return{styles:e,index:e[y]?y:-1}}),[h,y]),{styles:A,index:R}=_();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(wl,{items:h,label:"Transition",cssProp:"transition",searchKeywords:["tween","timing","duration","delay","timing-function"],onAdd:()=>{const e=[...h,{transitionProperty:"all",transitionDuration:"0.5s",transitionDelay:"0s",transitionTimingFunction:"ease"}];w(e.length-1),C(e)},isEditing:S,onClickDelete:()=>{A.splice(R,1),C(A),w(null)},onClickDone:()=>{const e=Ou(E.transitionTimingFunction);let t=!1;g(null),v(null),hn.all.includes(E.transitionProperty)||(g((0,a.__)("Please enter a valid CSS property!","generateblocks-pro")),t=!0),e[0]||(v(e[1]),t=!0),t||(g(null),v(null)),w(null)},dropdownChildren:({onClose:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.MenuGroup,{label:(0,a.__)("Options","generateblocks-pro")},!d&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.MenuItem,{onClick:()=>{i(!0),t()}},(0,a.__)("Paste in transition styles","generateblocks-pro"))),(0,e.createElement)(wl.DeleteAll,{label:(0,a.__)("Delete all transition styles","generateblocks-pro"),content:(0,a.__)("This will delete all transition styles for the current selector. This operation cannot be undone.","generateblocks-pro"),items:h,onDelete:e=>{C(e),w(null)},onClose:t,confirmDelete:d,setConfirmDelete:p})),!d&&(0,e.createElement)(wl.LearnMore,{learnMoreLabel:(0,a.__)("Learn more about CSS Transitions","generateblocks-pro"),learnMoreURL:"https://developer.mozilla.org/en-US/docs/Web/CSS/transition",onClose:t}))},(0,e.createElement)("div",{className:"gb-transition"},(0,e.createElement)("div",{className:"gb-transition__wrapper"},!S&&(0,e.createElement)("div",null,(0,e.createElement)(Cl,{items:h,dragHandleLabel:(0,a.__)("Reorder Transition","generateblocks-pro"),setItems:e=>{C(e)},itemComponent:function({item:t,index:r}){const n=Ru([t]),o=n.length>0?n:(0,a.__)("Invalid transition","generateblocks-pro");return(0,e.createElement)(Cl.Item,{css:o,swatchColor:t.color,onDuplicate:()=>{const e=[...h,{...t}];w(e.length-1),C(e)},onEdit:()=>{w(r)}})},dragHandle:!0})),(0,e.createElement)(Iu,{currentOption:E,findTransitionIndex:_,setSettings:C,cssPropertyError:m,cssTimingError:b}))),(0,e.createElement)(wl.PasteModal,{property:"transition",errorMessage:c,showPasteStyles:l,setShowPasteStyles:i,onAddStyles:({pastedValue:e,replaceStyles:t})=>{if(!e||0===e.length)return!1;try{const r=_u(Au(e)).map((e=>{const{transitionProperty:t,transitionDuration:r,transitionDelay:n,transitionTimingFunction:o}=e;return{transitionProperty:t,transitionDuration:r,transitionDelay:n,transitionTimingFunction:o}})),n=t?[...r]:[...h,...r];return C(n),i(!1),u(""),!0}catch(e){return u((0,a.__)("Error parsing pasted styles. Please check your CSS and try again.","generateblocks-pro")),console.error(e),!1}}})))}function Mu(e=[]){return e.reduce(((e,t)=>{if(t?.hidden)return e;const{type:r,value:n,dropShadow:{xOffset:o="",yOffset:s="",blur:a="",color:l=""}={}}=t;let i=`${r}(${n})`;return"drop-shadow"===r&&(i=`${r}(${o} ${s} ${a} ${l})`),e.length>0?`${e} ${i}`:`${i}`}),"").trim()}function Du(e){const t=e.match(/\b(blur|brightness|contrast|drop-shadow|grayscale|hue-rotate|invert|opacity|saturate|sepia)\(([^)]+)\)/g),r=[];return t?(t.forEach((e=>{const t=e.split("(")[0],n=e.match(/\(([^)]+)\)/)[1];if("drop-shadow"===t){const e=function(e){const t=e.split(" ").filter(Boolean);if(4!==t.length)return null;let r=t.pop();return/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(r)||(r="#cccccc"),{xOffset:t[0],yOffset:t[1],blur:t[2],color:r}}(n);e&&r.push({type:"drop-shadow",dropShadow:e})}else(function(e){const t=document.createElement("div");return t.style.filter=e,""!==t.style.filter})(e)&&r.push({type:t,value:n,dropShadow:{}})})),Array.from(new Set(r.map(JSON.stringify))).map(JSON.parse)):[]}const Nu={blur:["px"],brightness:["%"],contrast:["%"],"drop-shadow":["px","em","rem","vw","vh","ch"],grayscale:["%"],"hue-rotate":["deg"],invert:["%"],opacity:["%"],saturate:["%"],sepia:["%"]},Lu={blur:"5px",brightness:"100%",contrast:"100%","drop-shadow":{xOffset:"10px",yOffset:"10px",blur:"5px",color:"#cccccc"},grayscale:"100%","hue-rotate":"0deg",invert:"100%",opacity:"100%",saturate:"100%",sepia:"100%"},zu={blur:"Blur",brightness:"Brightness",contrast:"Contrast","drop-shadow":"Drop Shadow",grayscale:"Grayscale","hue-rotate":"Hue Rotate",invert:"Invert",opacity:"Opacity",saturate:"Saturate",sepia:"Sepia"};function Bu({findFilterIndex:t,setSettings:r,transitionSettings:n,onStyleChange:s,currentOption:l=null}){const{styles:i,index:c}=t(),u=!n.some((e=>["all","filter"].includes(e.transitionProperty)));return l&&(0,e.createElement)(kl,null,(0,e.createElement)(vl,{as:o.SelectControl,label:(0,a.__)("Filter type","generateblocks-pro"),value:l.type,options:[{label:zu.blur,value:"blur"},{label:zu.brightness,value:"brightness"},{label:zu.contrast,value:"contrast"},{label:zu["drop-shadow"],value:"drop-shadow"},{label:zu.grayscale,value:"grayscale"},{label:zu["hue-rotate"],value:"hue-rotate"},{label:zu.invert,value:"invert"},{label:zu.opacity,value:"opacity"},{label:zu.saturate,value:"saturate"},{label:zu.sepia,value:"sepia"}],onChange:e=>{i[c].type=e,i[c].value=Lu[e],r(i)},alwaysVisible:!0}),"blur"===l.type&&(0,e.createElement)(vl,{as:Ul,label:zu.blur,units:Nu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"brightness"===l.type&&(0,e.createElement)(vl,{as:Ul,label:zu.brightness,units:Nu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"contrast"===l.type&&(0,e.createElement)(vl,{as:Ul,label:zu.contrast,units:Nu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"drop-shadow"===l.type&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(vl,{as:Ul,allowCustomValue:!0,label:"X-Offset",units:Nu[l.type],value:l.dropShadow.xOffset[0],onChange:e=>{i[c].dropShadow.xOffset=e,r(i)},alwaysVisible:!0}),(0,e.createElement)(vl,{as:Ul,allowCustomValue:!0,label:"Y-Offset",units:Nu[l.type],value:l.dropShadow.yOffset[0],onChange:e=>{i[c].dropShadow.yOffset=e,r(i)},alwaysVisible:!0}),(0,e.createElement)(vl,{as:Ul,allowCustomValue:!0,label:"Blur",units:Nu[l.type],value:l.dropShadow.blur[0],onChange:e=>{i[c].dropShadow.blur=e,r(i)},alwaysVisible:!0}),(0,e.createElement)(vl,{as:yc,value:l.dropShadow.color,label:"Color",tooltip:(0,a.__)("Filter color","generateblocks-pro"),onChange:e=>{i[c].dropShadow.color=e,r(i)},alwaysVisible:!0})),"grayscale"===l.type&&(0,e.createElement)(vl,{as:Ul,label:zu.grayscale,allowCustomValue:!0,units:Nu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"hue-rotate"===l.type&&(0,e.createElement)(vl,{as:Ul,label:zu["hue-rotate"],allowCustomValue:!0,units:Nu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"invert"===l.type&&(0,e.createElement)(vl,{as:Ul,label:zu.invert,units:Nu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"opacity"===l.type&&(0,e.createElement)(vl,{as:Ul,label:zu.opacity,units:Nu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"saturate"===l.type&&(0,e.createElement)(vl,{as:Ul,label:zu.saturate,units:Nu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"sepia"===l.type&&(0,e.createElement)(vl,{as:Ul,label:zu.sepia,units:Nu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)}}),u&&(0,e.createElement)(o.Button,{style:{marginTop:"10px"},label:(0,a.__)("Automatically add a smooth transition for filters","generateblocks-pro"),showTooltip:!0,variant:"secondary",size:"compact",icon:h,onClick:()=>{const e=[...n,{transitionProperty:"all",transitionDuration:"0.5s",transitionDelay:"0s",transitionTimingFunction:"ease",transitionProperty:"filter"}];s("transition",Ru(e),e)}},"Transition"))}function ju({onStyleChange:t,value:r="",transition:n=""}){var l;const i=(0,s.useMemo)((()=>_u(n)),[n]),[c,u]=(0,s.useState)(!1),[d,p]=(0,s.useState)(""),[h,f]=(0,s.useState)(!1),[m,g]=(0,s.useState)((()=>Du(r))),[b,v]=(0,s.useState)(null),y=(0,s.useRef)(!1),w=null!==(l=m[b])&&void 0!==l?l:null,k=(0,s.useMemo)((()=>null!==w),[w]);(0,s.useEffect)((()=>{y.current?y.current=!1:g(Du(r))}),[r]);const E=(0,$e.useDebounce)(t,0),S=(0,s.useCallback)((function(e){y.current=!0,g(e),E("filter",Mu(e))}),[E]),x=(0,s.useCallback)((()=>{const e=[...m];return{styles:e,index:e[b]?b:-1}}),[m,b]),{styles:C,index:_}=x();return(0,e.createElement)(wl,{items:m,label:"Filter",cssProp:"filter",isEditing:k,onClickDelete:()=>{C.splice(_,1),S(C),v(null)},onClickDone:()=>{v(null)},dropdownChildren:({onClose:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.MenuGroup,{label:(0,a.__)("Options","generateblocks-pro")},!h&&(0,e.createElement)(o.MenuItem,{onClick:()=>{u(!0),t()}},(0,a.__)("Add via paste…","generateblocks-pro")),(0,e.createElement)(wl.DeleteAll,{label:(0,a.__)("Delete all filter styles","generateblocks-pro"),content:(0,a.__)("This will delete all filter styles for the current selector. This operation cannot be undone.","generateblocks-pro"),items:m,onDelete:e=>{S(e),v(null)},onClose:t,confirmDelete:h,setConfirmDelete:f})),!h&&(0,e.createElement)(wl.LearnMore,{learnMoreLabel:(0,a.__)("Learn more about CSS Filters","generateblocks-pro"),learnMoreURL:"https://developer.mozilla.org/en-US/docs/Web/CSS/filter",onClose:t})),onAdd:()=>{const e=[...m,{type:"blur",value:"5px",dropShadow:{xOffset:"10px",yOffset:"10px",blur:"5px",color:"#cccccc"}}];v(e.length-1),S(e)},learnMoreLabel:(0,a.__)("Learn more about CSS Filters","generateblocks-pro"),learnMoreURL:"https://developer.mozilla.org/en-US/docs/Web/CSS/filter"},(0,e.createElement)("div",{className:"gb-filter"},(0,e.createElement)("div",{className:"gb-filter__wrapper"},!k&&(0,e.createElement)("div",null,(0,e.createElement)(Cl,{items:m,dragHandleLabel:(0,a.__)("Reorder Filter","generateblocks-pro"),setItems:e=>{S(e)},itemComponent:function({item:t,index:r}){const n=Mu([t]),o=n.length>0?n:(0,a.__)("Invalid transform","generateblocks-pro");return(0,e.createElement)(Cl.Item,{css:o,swatchColor:"drop-shadow"===t.type&&t?.dropShadow?.color,onDuplicate:()=>{const e=[...m,{...t}];v(e.length-1),S(e)},onEdit:()=>{v(r)}})},dragHandle:!0})),k&&(0,e.createElement)(Bu,{currentOption:w,findFilterIndex:x,settings:m,setSettings:S,transitionSettings:i,onStyleChange:t}))),(0,e.createElement)(wl.PasteModal,{property:"filter",errorMessage:d,showPasteStyles:c,setShowPasteStyles:u,onAddStyles:({pastedValue:e,replaceStyles:t})=>{if(!e||0===e.length)return!1;try{const r=Du(e),n=t?[...r]:[...m,...r];return S(n),u(!1),p(""),!0}catch(e){return p((0,a.__)("Error parsing pasted styles. Please check your CSS and try again.","generateblocks-pro")),!1}}}))}const Fu=e=>e.replace(/-webkit-text-shadow:[^;]+;|-moz-text-shadow:[^;]+;/g,""),Vu=e=>e.replace(/text-shadow/g,"").replace(/webkit/g,"").replace(/\r?\n|\r/g,"").replace(/;/g,"").replace(/:/g,"").trim(),$u=(e=[])=>e.reduce(((e,t)=>{if(t.hidden)return e;const{offsetX:r="",offsetY:n="",blur:o="",color:s=""}=t,a=`${s} ${r} ${n} ${o}`.trim();return a.trim().length?e.length>0?`${e}, ${a}`:`${a}`:e}),"").replace(/,$/,"").trim(),Wu=function(){const e=/,(?![^\(]*\))/,t=/\s(?![^(]*\))/,r=/^[0-9]+[a-zA-Z%]+$/,n=e=>{const r=e.split(t),n=s(r[0])?void 0:r[0],o=r.filter((e=>e!==n)),[a,l,i]=o;return{offsetX:a,offsetY:l,blur:i,color:n}},o=e=>{const{offsetX:t=0,offsetY:r=0,blur:n=0,color:o}=e||{};return[o,t,r,n].filter((e=>null!=e)).map((e=>(""+e).trim())).join(" ")},s=e=>r.test(e);return{parse:t=>t?t.split(e).map((e=>e.trim())).map(n):[],stringify:e=>e?.length?e.map(o).join(", "):""}}(),Uu=["px","em","rem","vw","vh","ch"];function Hu({findTextShadowIndex:t,setSettings:r,currentOption:n=null}){const{styles:o,index:s}=t();return n&&(0,e.createElement)(kl,null,(0,e.createElement)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},(0,e.createElement)(vl,{alwaysVisible:!0,as:yc,value:n?.color||"rgba(0,0,0,1)",tooltip:"Text Shadow Color",onChange:e=>{o[s].color=e,r(o)}})),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,label:"x-Offset",units:Uu,value:n.offsetX,onChange:e=>{o[s].offsetX=e,r(o)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,label:"y-Offset",units:Uu,value:n.offsetY,onChange:e=>{o[s].offsetY=e,r(o)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,label:"blur",units:Uu,value:n?.blur,onChange:e=>{o[s].blur=e,r(o)}}))}function qu({onStyleChange:t,value:r}){var n;const[l,i]=(0,s.useState)(!1),[c,u]=(0,s.useState)(""),[d,p]=(0,s.useState)(!1),[h,f]=(0,s.useState)((()=>Wu.parse(r))),[m,g]=(0,s.useState)(null),b=(0,s.useRef)(!1),v=null!==(n=h[m])&&void 0!==n?n:null,y=null!==v;(0,s.useEffect)((()=>{b.current?b.current=!1:f(Wu.parse(r))}),[r]);const w=(0,$e.useDebounce)(t,0),k=(0,s.useCallback)((function(e){b.current=!0,f(e),w("textShadow",$u(e))}),[w]),E=(0,s.useCallback)((()=>{const e=[...h];return{styles:e,index:e[m]?m:-1}}),[h,m]),{styles:S,index:x}=E();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(wl,{items:h,label:"Text Shadow",searchKeywords:["shadows","text-shadow"],cssProp:"textShadow",onAdd:()=>{const e=[...h,{offsetX:"1px",offsetY:"1px",blur:"2px",color:"rgba(0,0,0,1)"}];g(e.length-1),k(e)},isEditing:y,onClickDelete:()=>{S.splice(x,1),k(S),g(null)},onClickDone:()=>{g(null)},dropdownChildren:({onClose:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.MenuGroup,{label:(0,a.__)("Options","generateblocks-pro")},!d&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.MenuItem,{onClick:()=>{i(!0),t()}},(0,a.__)("Add via paste…","generateblocks-pro"))),(0,e.createElement)(wl.DeleteAll,{label:(0,a.__)("Delete all text shadow styles","generateblocks-pro"),content:(0,a.__)("This will delete all text shadow styles for the current selector. This operation cannot be undone.","generateblocks-pro"),items:h,onDelete:e=>{k(e),g(null)},onClose:t,confirmDelete:d,setConfirmDelete:p})),!d&&(0,e.createElement)(wl.LearnMore,{learnMoreLabel:(0,a.__)("Learn more about CSS Text Shadows","generateblocks-pro"),learnMoreURL:"https://developer.mozilla.org/en-US/docs/Web/CSS/text-shadow",onClose:t}))},(0,e.createElement)("div",{className:"gb-text-shadow"},(0,e.createElement)("div",{className:"gb-text-shadow__wrapper"},!y&&(0,e.createElement)("div",null,(0,e.createElement)(Cl,{items:h,dragHandleLabel:(0,a.__)("Reorder Text Shadow","generateblocks-pro"),setItems:e=>{k(e)},itemComponent:function({item:t,index:r}){const n=$u([t]),o=n.length>0?n:(0,a.__)("Invalid text shadow","generateblocks-pro");return(0,e.createElement)(Cl.Item,{css:o,swatchColor:t.color,canDuplicate:n.length>0,onDuplicate:()=>{const e=[...h,{...t}];g(e.length-1),k(e)},onEdit:()=>{g(r)}})},dragHandle:!0})),(0,e.createElement)(Hu,{isEditing:y,currentOption:v,findTextShadowIndex:E,setSettings:k}))),(0,e.createElement)(wl.PasteModal,{property:"text-shadow",errorMessage:c,showPasteStyles:l,setShowPasteStyles:i,onAddStyles:({pastedValue:e,replaceStyles:t})=>{if(!e||0===e.length)return!1;try{const r=Wu.parse(Vu(Fu(e))),n=t?[...r]:[...h,...r];return k(n),i(!1),u(""),!0}catch(e){return u((0,a.__)("Error parsing pasted styles. Please check your CSS and try again.","generateblocks-pro")),!1}}})))}const Gu=["perspective","rotate","rotate3d","scale","scale3d","skew","translate3d"];function Zu(e=[]){return e.reduce(((e,t)=>{const{hidden:r=!1,values:n=[],type:o=""}=t,s=`${o}(${n.join(", ").trim()})`;return r?e:s?e.length>0?`${e} ${s}`:`${s}`:e}),"").trim()}function Yu(e=""){const t=function(e){const t=document.createElement("div");return t.style.transform=e,t.style.transform}(e);if(!t)return null;if(["unset","inherit","initial"].includes(t))return{[t]:!0};const r=t.replaceAll(/var\(([^)]+)\)/g,"$1").match(/([A-z\d]+)\(([^)]+)\)/g);return r?r.reduce(((e,t)=>{if(!t)return e;const[r,n]=t.match(/(^[a-z\d]*)|\(([^)]+)\)/g),o=n.replace("(","").replace(")","").split(",").map((e=>{const t=e.trim();return t.startsWith("--")?`var(${t})`:t}));return{...e,[r]:{type:r,values:o,cssText:`${r}${n}`}}}),{}):null}const Ku={perspective:["px","em","%","vh","vw"],rotate:["deg"],rotate3d:["deg"],scale:[],scale3d:[],skew:["deg"],translate3d:["px","em","%","vh","vw"]},Xu={perspective:{cssText:"perspective(0px)",values:["0px"]},rotate:{cssText:"rotate(0deg)",values:["0deg"]},scale:{cssText:"scale(1)",values:["1"]},scale3d:{cssText:"scale3d(1, 1, 1)",values:["1","1","1"]},skew:{cssText:"skew(0deg)",values:["0deg"]},translate3d:{cssText:"translate3d(0px, 0px, 0px)",values:["0px","0px","0px"]},rotate3d:{cssText:"rotate3d(0, 0, 0, 0deg)",values:["0","0","0","0deg"]},custom:{cssText:"",values:[""]}},Qu={perspective:"Perspective",translate3d:"Translate",rotate:"Rotate",rotate3d:"Rotate (3d)",scale:"Scale",scale3d:"Scale (3d)",skew:"Skew",custom:(0,a.__)("Custom","generateblocks-pro")},Ju=(0,a.__)("Enter any valid transform value here.","generateblocks-pro");function ed({findTransformIndex:t,setSettings:r,settings:n,onStyleChange:l,setNextEditIndex:i,currentOption:c=null,transitionSettings:u=[]}){var d,p;const[f,m]=(0,s.useState)(Ju),{styles:g,index:b}=t(),v=null!==(d=c?.values)&&void 0!==d?d:[],y=null!==(p=c?.cssText)&&void 0!==p?p:"";let w=c?.type||"custom";const k=!u.some((e=>["all","transform"].includes(e.transitionProperty))),E=!Gu.includes(w);return E&&"custom"!==w&&(w="custom"),c&&(0,e.createElement)(kl,null,(0,e.createElement)(vl,{alwaysVisible:!0,as:o.SelectControl,label:(0,a.__)("Transform type","generateblocks-pro"),value:w,options:[{label:Qu.perspective,value:"perspective",disabled:n.some((e=>"perspective"===e.type))},{label:Qu.rotate,value:"rotate"},{label:Qu.rotate3d,value:"rotate3d"},{label:Qu.translate3d,value:"translate3d"},{label:Qu.scale,value:"scale"},{label:Qu.scale3d,value:"scale3d"},{label:Qu.skew,value:"skew"},{label:Qu.custom,value:"custom"}],onChange:e=>{g[b].type=e,"custom"!==e&&(g[b]={...g[b],...Xu[e]}),"perspective"===e&&b>0&&(g.unshift(g.splice(b,1)[0]),i(0)),r(g)}}),E&&(0,e.createElement)(vl,{alwaysVisible:!0,as:o.TextControl,label:Qu[w],help:f||Ju,placeholder:"e.g. rotate(45deg)",onChange:(e="")=>{if(""===e)return g[b].values=[""],g[b].cssText="",r(g),void m(Ju);const t=Yu(e);if(null===t)return void m((0,a.__)("Invalid value"));if(Object.keys(t).length>1)return void m((0,a.__)("Only one transform value is allowed.","generateblocks-pro"));f!==Ju&&m(Ju);const n=Object.keys(t)[0];g[b]={type:n,...t[n]},r(g)},value:y}),"translate3d"===w&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,units:Ku[w],label:`${Qu[w]} X`,value:v[0],onChange:e=>{g[b].values[0]=e,r(g)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,units:Ku[w],label:`${Qu[w]} Y`,value:v[1],onChange:e=>{g[b].values[1]=e,r(g)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,units:Ku[w],label:`${Qu[w]} Z`,value:v[2],onChange:e=>{g[b].values[2]=e,r(g)}})),["rotate","skew"].includes(w)&&(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,units:Ku[w],label:Qu[w],value:v[0],onChange:(e=0)=>{g[b].values[0]=e,r(g)}}),"scale"===w&&(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,units:Ku[w],label:Qu[w],value:v[0],onChange:e=>{g[b].values[0]=e,r(g)}}),"perspective"===w&&(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,units:Ku[w],label:Qu[w],value:v[0],onChange:e=>{g[b].values[0]=e,r(g)}}),"rotate3d"===w&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,units:[],label:`${Qu[w]} X`,value:v[0],onChange:e=>{g[b].values[0]=e,r(g)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,units:[],label:`${Qu[w]} Y`,value:v[1],onChange:e=>{g[b].values[1]=e,r(g)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,units:[],label:`${Qu[w]} Z`,value:v[2],onChange:e=>{g[b].values[2]=e,r(g)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,units:Ku[w],label:`${Qu[w]} Angle`,value:v[3],onChange:e=>{g[b].values[3]=e,r(g)}})),"scale3d"===w&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,units:Ku[w],label:`${Qu[w]} X`,value:v[0],onChange:e=>{g[b].values[0]=e,r(g)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,units:Ku[w],label:`${Qu[w]} Y`,value:v[1],onChange:e=>{g[b].values[1]=e,r(g)}}),(0,e.createElement)(vl,{alwaysVisible:!0,as:Ul,units:Ku[w],label:`${Qu[w]} Z`,value:v[2],onChange:e=>{g[b].values[2]=e,r(g)}})),k&&(0,e.createElement)(o.Button,{label:(0,a.__)("Automatically add a smooth transition for transforms","generateblocks-pro"),showTooltip:!0,variant:"secondary",size:"compact",icon:h,onClick:()=>{const e=[...u,{transitionProperty:"all",transitionDuration:"0.5s",transitionDelay:"0s",transitionTimingFunction:"ease",transitionProperty:"transform"}],t=Ru(e);l("transition",t)}},"Transition"))}function td(e){if(!e)return[];const t=Yu(e);return null===t?[]:Object.entries(t).map((([e,t])=>{const{disabled:r=!1}=t;return{type:e,...t,id:$s(),disabled:"perspective"===e||r}}))}function rd({onStyleChange:t,value:r="",transition:n=""}){var l;const i=(0,s.useMemo)((()=>_u(n)),[n]),[c,u]=(0,s.useState)((()=>td(r))),[d,p]=(0,s.useState)(!1),[h,f]=(0,s.useState)(""),[m,g]=(0,s.useState)(!1),[b,v]=(0,s.useState)(null),y=(0,s.useRef)(!1),w=null!==(l=c[b])&&void 0!==l?l:null,k=null!==w;(0,s.useEffect)((()=>{y.current?y.current=!1:u(td(r))}),[r]);const E=(0,$e.useDebounce)(t,0),S=(0,s.useCallback)((function(e){y.current=!0,u(e),E("transform",Zu(e))}),[E]),x=(0,s.useCallback)((()=>{const e=[...c];return{styles:e,index:e[b]?b:-1}}),[c,b]),{styles:C,index:_}=x();return(0,e.createElement)(wl,{items:c,label:"Transform",isEditing:k,cssProp:"transform",onClickDelete:()=>{C.splice(_,1),S(C),v(null)},onClickDone:()=>{v(null)},dropdownChildren:({onClose:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.MenuGroup,{label:(0,a.__)("Options","generateblocks-pro")},!m&&(0,e.createElement)(o.MenuItem,{onClick:()=>{p(!0),t()}},(0,a.__)("Add via paste…","generateblocks-pro")),(0,e.createElement)(wl.DeleteAll,{label:(0,a.__)("Delete all transform styles","generateblocks-pro"),content:(0,a.__)("This will delete all transform styles for the current selector. This operation cannot be undone.","generateblocks-pro"),items:c,onDelete:e=>{S(e),v(null)},onClose:t,confirmDelete:m,setConfirmDelete:g})),!m&&(0,e.createElement)(wl.LearnMore,{learnMoreLabel:(0,a.__)("Learn more about CSS Transforms","generateblocks-pro"),learnMoreURL:"https://developer.mozilla.org/en-US/docs/Web/CSS/transform",onClose:t})),onAdd:()=>{const e=[...c,{type:"translate3d",values:["0px","0px","0px"],cssText:"translate3d(0px, 0px, 0px)"}];v(e.length-1),S(e)},learnMoreLabel:(0,a.__)("Learn more about CSS Transforms","generateblocks-pro"),learnMoreURL:"https://developer.mozilla.org/en-US/docs/Web/CSS/transform"},(0,e.createElement)("div",{className:"gb-transform"},(0,e.createElement)("div",{className:"gb-transform__wrapper"},!k&&(0,e.createElement)("div",null,(0,e.createElement)(Cl,{items:c,dragHandleLabel:(0,a.__)("Reorder Transform","generateblocks-pro"),setItems:e=>{S(e.map((e=>({...e,disabled:"perspective"===e.type}))))},itemComponent:function({item:t,index:r}){const n=Zu([t]),o=n.length>0?n:(0,a.__)("Invalid transform","generateblocks-pro"),{type:s,color:l}=t;return(0,e.createElement)(Cl.Item,{css:o,swatchColor:l,canDuplicate:"perspective"!==s,onDuplicate:()=>{const e=[...c,{...t}];v(e.length-1),S(e)},onEdit:()=>{v(r)}})},dragHandle:!0})),k&&(0,e.createElement)(ed,{isEditing:k,currentOption:w,findTransformIndex:x,settings:c,setSettings:S,transitionSettings:i,onStyleChange:t,setNextEditIndex:v}))),(0,e.createElement)(wl.PasteModal,{property:"transform",errorMessage:h,showPasteStyles:d,setShowPasteStyles:p,onAddStyles:({pastedValue:e,replaceStyles:t})=>{if(!e||0===e.length)return!1;try{const r=td(e),n=t?[...r]:[...c,...r],o=n.findIndex((({type:e})=>"perspective"===e));return o>0&&n.unshift(n.splice(o,1)[0]),S(n),p(!1),f(""),!0}catch(e){return f((0,a.__)("Error parsing pasted styles. Please check your CSS and try again.","generateblocks-pro")),!1}}}))}function nd(t){const{styles:r,onStyleChange:n,atRule:s,nestedRule:l,opened:i,scrollAfterOpen:c,onToggle:u,initialOpen:d}=t,{backdropFilter:p="",boxShadow:h="",filter:f="",mixBlendMode:m="",opacity:g="",transform:v="",transformOrigin:y="",transition:w="",visibility:k="",textShadow:E=""}=r;let S=parseFloat(g);return isNaN(S)&&(S=g),(0,e.createElement)(o.PanelBody,{title:(0,a.__)("Effects","generateblocks-pro"),initialOpen:d,icon:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(_s,{size:"20"}),(0,e.createElement)(Yl,{cssProps:ol})),open,opened:!!i||void 0,scrollAfterOpen:c,onToggle:u},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(Cu,{value:h,onStyleChange:n,atRule:s,nestedRule:l}),(0,e.createElement)(Pu,{value:w,onStyleChange:n,atRule:s,nestedRule:l}),(0,e.createElement)(ju,{value:f,transition:w,onStyleChange:n,atRule:s,nestedRule:l}),(0,e.createElement)(qu,{value:E,onStyleChange:n,atRule:s,nestedRule:l}),(0,e.createElement)(rd,{value:v,transformOrigin:y,transition:w,onStyleChange:n,atRule:s,nestedRule:l}),(0,e.createElement)(vl,{as:o.TextControl,label:"Transform Origin",value:y,placeholder:"ex: center, 50% -100%, etc.",onChange:e=>n("transformOrigin",e),cssProp:"transformOrigin",learnMoreLabel:(0,a.__)("Learn more about transform origin","generateblocks-pro"),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/transform-origin"}),(0,e.createElement)(vu,{onStyleChange:n,opacity:g}),(0,e.createElement)(vl,{allowCustomValue:!0,as:o.SelectControl,label:"Visibility",value:k,cssProp:"visibility",options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"Visible",value:"visible"},{label:"Hidden",value:"hidden"}]),onChange:e=>n("visibility",e),help:(0,a.__)('Using the "hidden" value may cause some block editor elements to become invisible.',"generateblocks-pro")}),(0,e.createElement)(vl,{as:o.SelectControl,allowCustomValue:!0,label:"Mix Blend Mode",value:m,cssProp:"mixBlendMode",options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"Normal",value:"normal"},{label:"Multiply",value:"multiply"},{label:"Screen",value:"screen"},{label:"Overlay",value:"overlay"},{label:"Darken",value:"darken"},{label:"Lighten",value:"lighten"},{label:"Color Dodge",value:"color-dodge"},{label:"Color Burn",value:"color-burn"},{label:"Hard Light",value:"hard-light"},{label:"Soft Light",value:"soft-light"},{label:"Difference",value:"difference"},{label:"Exclusion",value:"exclusion"},{label:"Hue",value:"hue"},{label:"Saturation",value:"saturation"},{label:"Color",value:"color"},{label:"Luminosity",value:"luminosity"}]),onChange:e=>n("mixBlendMode",e)}),(0,e.createElement)(vl,{as:o.TextControl,label:"Backdrop Filter",value:p,cssProp:"backdropFilter",onChange:e=>n("backdropFilter",e)})))}function od(t){const{styles:r,onStyleChange:n,opened:s,scrollAfterOpen:l,onToggle:i,initialOpen:c}=t,{objectFit:u="",objectPosition:d=""}=r;return(0,e.createElement)(o.PanelBody,{title:(0,a.__)("Media","generateblocks-pro"),initialOpen:c,icon:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Rs,{size:"20"}),(0,e.createElement)(Yl,{cssProps:sl})),opened:!!s||void 0,scrollAfterOpen:l,onToggle:i},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(vl,{as:o.SelectControl,label:"Object Fit",id:"gblocks-object-fit",allowCustomValue:!0,options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"fill",value:"fill"},{label:"contain",value:"contain"},{label:"cover",value:"cover"},{label:"none",value:"none"},{label:"scale-down",value:"scale-down"}]),value:u,onChange:e=>n("objectFit",e),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro"),cssProp:"objectFit"}),(0,e.createElement)(vl,{as:o.TextControl,label:"Object Position",id:"gblocks-object-position",value:d,onChange:e=>n("objectPosition",e),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/object-position",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro"),cssProp:"objectPosition"})))}const sd=(0,e.createElement)(l.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(l.Path,{d:"M3 6v11.5h8V6H3Zm11 3h7V7.5h-7V9Zm7 3.5h-7V11h7v1.5ZM14 16h7v-1.5h-7V16Z"}));function ad(t){const{styles:r,onStyleChange:n,opened:s,scrollAfterOpen:l,onToggle:i,initialOpen:c}=t,{listStyleType:u="",listStyleImage:p="",listStylePosition:h="",display:f=""}=r;return(0,e.createElement)(o.PanelBody,{title:(0,a.__)("Lists","generateblocks-pro"),initialOpen:c,icon:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(d,{icon:sd,size:"20"}),(0,e.createElement)(Yl,{cssProps:al})),opened:!!s||void 0,scrollAfterOpen:l,onToggle:i},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(vl,{as:o.SelectControl,label:"List Style Type",id:"gblocks-list-style-type",options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"none",value:"none"},{label:"disc",value:"disc"},{label:"circle",value:"circle"},{label:"square",value:"square"},{label:"decimal",value:"decimal"},{label:"decimal-leading-zero",value:"decimal-leading-zero"},{label:"lower-roman",value:"lower-roman"},{label:"upper-roman",value:"upper-roman"},{label:"lower-greek",value:"lower-greek"}]),value:u,cssProp:"listStyleType",allowCustomValue:!0,onChange:e=>n("listStyleType",e)}),(0,e.createElement)(vl,{as:o.TextControl,label:"List Style Image",id:"gblocks-list-style-image",value:p,allowCustomValue:!0,cssProp:"listStyleImage",onChange:e=>n("listStyleImage",e),help:(0,a.__)("The URL of an image to be used as the list item marker.","generateblocks-pro")}),(0,e.createElement)(vl,{id:"gblocks-list-style-position",label:"List Style Position",as:o.SelectControl,options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"Inside",value:"inside"},{label:"Outside",value:"outside"}]),help:(0,a.__)("The position of the list item marker.","generateblocks-pro"),allowCustomValue:!0,value:h,cssProp:"listStylePosition",onChange:e=>n("listStylePosition",e)}),!["","list-item"].includes(f)&&(0,e.createElement)(o.Notice,{status:"warning",isDismissible:!1},(0,a.__)("List properties will not apply unless the element's display property is set to list-item","generateblocks-pro"))))}function ld(t){const{styles:r,onStyleChange:n,nestedRule:s,opened:l,scrollAfterOpen:i,onToggle:c,initialOpen:u}=t,{content:d="",pointerEvents:p="",fill:h="",stroke:f="",cursor:m=""}=r;return(0,e.createElement)(o.PanelBody,{title:(0,a.__)("More","generateblocks-pro"),initialOpen:u,icon:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Ts,{size:"20"}),(0,e.createElement)(Yl,{cssProps:ll})),opened:!!l||void 0,scrollAfterOpen:i,onToggle:c},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(s.includes(":before")||s.includes(":after"))&&(0,e.createElement)(vl,{as:o.TextControl,label:"Content",id:"gblocks-content",value:d,cssProp:"content",onChange:e=>n("content",e),help:(0,a.__)("The content property is used with the ::before and ::after pseudo-elements and must be wrapped in quotes.","generateblocks-pro")}),(0,e.createElement)(vl,{as:o.SelectControl,label:"Pointer Events",id:"gblocks-pointer-events",allowCustomValue:!0,options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"auto",value:"auto"},{label:"none",value:"none"}]),value:p,cssProp:"pointerEvents",onChange:e=>n("pointerEvents",e),dropdownChildren:({onClose:t})=>(0,e.createElement)(vl.Description,{label:(0,a.__)("About Pointer Events","generateblocks-pro"),onClick:t},(0,a.__)("Use this property to control whether an element can be the target for click/keyboard events. See the documentation link below for a complete list (note: some only apply to SVG tags).","generateblocks-pro")),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/pointer-events",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro")}),(0,e.createElement)(vl,{as:o.SelectControl,label:"Cursor",id:"gblocks-cursor",allowCustomValue:!0,options:ri([{label:(0,a.__)("Default","generateblocks-pro"),value:""},{label:"auto",value:"auto"},{label:"none",value:"none"},{value:"pointer",label:"pointer"},{value:"not-allowed",label:"not-allowed"},{value:"grab",label:"grab"},{value:"grabbing",label:"grabbing"},{value:"help",label:"help"}]),value:m,cssProp:"cursor",onChange:e=>n("cursor",e),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/cursor",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro")}),(0,e.createElement)(vl,{as:yc,label:"Fill Color",id:"gblocks-fill",allowCustomValue:!0,value:h,cssProp:"fill",onChange:e=>n("fill",e),dropdownChildren:({onClose:t})=>(0,e.createElement)(vl.Description,{label:(0,a.__)("About Fill","generateblocks-pro"),onClick:t},(0,a.__)("Set the color of an svg element or svg child element.","generateblocks-pro")),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/fill",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro")}),(0,e.createElement)(vl,{as:yc,label:"Stroke Color",id:"gblocks-stroke",allowCustomValue:!0,value:f,cssProp:"stroke",onChange:e=>n("stroke",e),dropdownChildren:({onClose:t})=>(0,e.createElement)(vl.Description,{label:(0,a.__)("About Stroke","generateblocks-pro"),onClick:t},(0,a.__)("Set the stroke (border) color of an svg element or svg child element.","generateblocks-pro")),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/stroke",learnMoreLabel:(0,a.__)("Learn more about this property.","generateblocks-pro")})))}function id({inputValue:e="",onSelect:t,maxSuggestions:r=10}={}){const[n,o]=(0,s.useState)(!1),[a,l]=(0,s.useState)(0),i=(0,s.useMemo)((()=>function(e="",t=10,r={}){const{includeContains:n=!0,includeEmpty:o=!1}=r;return o||String(e||"").trim()?kn(fn,e,t,n):[]}(e,r)),[e,r]),c=(0,s.useCallback)((()=>{i.length>0&&(o(!0),l(0))}),[i.length]),u=(0,s.useCallback)((()=>{o(!1),l(0)}),[]),d=(0,s.useCallback)((e=>{t&&t(e),u()}),[t,u]),p=(0,s.useCallback)((t=>{if(!n||0===i.length)return!1;switch(t.key){case"ArrowDown":return t.preventDefault(),l((e=>ee>0?e-1:i.length-1)),!0;case"Enter":case"Tab":{const r=a>=0?i[a]:null;if(!r||r===e.toLowerCase().trim()){u();break}return t.preventDefault(),d(r),!0}case"Escape":return t.preventDefault(),u(),!0}return!1}),[n,i,a,e,d,u]);return{isOpen:n&&i.length>0,suggestions:i,highlightedIndex:a,showAutocomplete:c,hideAutocomplete:u,selectSuggestion:d,handleKeyDown:p,setHighlightedIndex:l}}const cd={panel:"ZWccAybXnR3FLLwJx4UW",propertyList:"Co5kvm1MS7RjADlL9z1w",propertyRow:"nSAaluTn0319ilBI7EsM",invalid:"Iqa992s4ij1ASpSrRLPw",inputWrapper:"OhQSUapBXI_bcsGKNmX1",separator:"ey2Hbms1oQoxKEw4cUIe",valueInputWrapper:"OgZIDn8NdDA3lyjnK941",input:"Ysy1r33mqox1HrL_KTfQ",property:"m0ohsUJ4a6kykkKZRnXG",value:"NObMO2vz2nuET9tlpt2r",autocompletePopover:"pc9OEP0IoWYtzeADYhPC",autocomplete:"hfNxdu7xWR8EHbiGaNNi",autocompleteItem:"ovh1z7RJ8_bsmJRrVQfr",highlighted:"_oFYqPONvaQ5q7ENeKjj",colorSwatch:"Z9Hmg8ADttOaec3zPwpA",colorPickerPopover:"UZMDfjI0yYdyVr9_dvOQ",addProperty:"ARK2fFeC6d1YqiwTqdOI",active:"QZe_dYnnigM23BBhsSod",validationWarning:"dIhOPZT2ux6ukR_Z71CB",sectionHeader:"__JpOvlBlho49OW04v78",emptyState:"hL5uD7ap9sC4FRjhcJCa",editFullStylesheet:"_b6w66ZPmZrN5qzYDz19"},ud=150;function dd({value:t,onChange:r,onCommit:n,onCancel:l,onFocus:i,onTab:c,onDelete:u,autoFocus:d=!1,placeholder:p}){const h=(0,s.useRef)(null),f=(0,s.useRef)(null),m=(0,s.useRef)(null),b=(0,s.useRef)(!1),v=(0,s.useRef)(!1),y=(0,$e.useInstanceId)(dd);(0,s.useEffect)((()=>()=>{m.current&&clearTimeout(m.current)}),[]);const{isOpen:w,suggestions:k,highlightedIndex:E,showAutocomplete:S,hideAutocomplete:x,selectSuggestion:C,handleKeyDown:_,setHighlightedIndex:A}=id({inputValue:t,onSelect:e=>{r(e),c?c():n&&n()}});(0,s.useEffect)((()=>{d&&h.current&&h.current.focus()}),[d]),(0,s.useEffect)((()=>{b.current&&(t?S():x())}),[t,S,x]);const R=(0,s.useCallback)((e=>{r(e.target.value),S()}),[r,S]),O=(0,s.useCallback)((e=>{if(!_(e))switch(e.key){case"Enter":e.preventDefault(),x(),n&&n(),c||h.current?.blur();break;case"Tab":e.shiftKey?x():c?(e.preventDefault(),x(),c()):(x(),n&&n());break;case"Escape":e.preventDefault(),x(),l&&l();break;case"Backspace":!t&&u&&(e.preventDefault(),v.current=!0,u())}}),[_,n,c,l,u,x,t]),T=(0,s.useCallback)((()=>{m.current=setTimeout((()=>{if(v.current)return void(v.current=!1);const e=f.current?.ownerDocument||document;f.current?.contains(e.activeElement)||(b.current=!1,x(),n&&n())}),ud)}),[x,n]),I=(0,s.useCallback)((()=>{b.current=!0,h.current?.select(),i&&i()}),[i]);return(0,e.createElement)("div",{ref:f,className:cd.inputWrapper},(0,e.createElement)("input",{ref:h,type:"text",value:t,onChange:R,onKeyDown:O,onBlur:T,onFocus:I,placeholder:p||(0,a.__)("property","generateblocks-pro"),className:g(cd.input,cd.property),style:{width:`${t?Math.min(t.length,22):8}ch`},spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",role:"combobox","aria-label":(0,a.__)("CSS property name","generateblocks-pro"),"aria-expanded":w,"aria-autocomplete":"list","aria-controls":`property-listbox-${y}`,"aria-activedescendant":w&&E>=0&&k[E]?`property-option-${y}-${k[E]}`:void 0}),w&&(0,e.createElement)(o.Popover,{anchor:h.current,focusOnMount:!1,animate:!1,placement:"bottom-start",variant:"unstyled",className:cd.autocompletePopover},(0,e.createElement)("div",{id:`property-listbox-${y}`,className:cd.autocomplete,role:"listbox","aria-label":(0,a.__)("CSS property suggestions","generateblocks-pro")},k.map(((t,r)=>(0,e.createElement)("div",{key:t,id:`property-option-${y}-${t}`,ref:r===E?e=>{e?.scrollIntoView?.({block:"nearest"})}:void 0,role:"option",tabIndex:-1,"aria-selected":E>=0&&r===E,className:g(cd.autocompleteItem,E>=0&&r===E&&cd.highlighted),onMouseDown:e=>{e.preventDefault(),C(t)},onMouseEnter:()=>A(r)},t))))))}function pd(e){return En(e)}function hd({property:t,value:r,onChange:n,onCommit:l,onCancel:i,onFocus:c,onTab:u,onShiftTab:d,autoFocus:p=!1,disabled:h=!1,placeholder:f}){const m=(0,s.useRef)(null),b=(0,s.useRef)(null),v=(0,s.useRef)(null),y=(0,s.useRef)(!1),w=(0,$e.useInstanceId)(hd);(0,s.useEffect)((()=>()=>{v.current&&clearTimeout(v.current)}),[]);const k=pd(t),{isOpen:E,suggestions:S,highlightedIndex:x,showAutocomplete:C,hideAutocomplete:_,selectSuggestion:A,handleKeyDown:R,setHighlightedIndex:O}=function({property:e="",inputValue:t="",onSelect:r,maxSuggestions:n=10}={}){const[o,a]=(0,s.useState)(!1),[l,i]=(0,s.useState)(0),c=(0,s.useMemo)((()=>function(e="",t="",r=10,n={}){const{includeContains:o=!0}=n;return kn(Sn(e),t,r,o)}(e,t,n)),[e,t,n]),u=(0,s.useCallback)((()=>{c.length>0&&(a(!0),i(0))}),[c.length]),d=(0,s.useCallback)((()=>{a(!1),i(0)}),[]),p=(0,s.useCallback)((e=>{r&&r(e),d()}),[r,d]),h=(0,s.useCallback)((e=>{if(!o||0===c.length)return!1;switch(e.key){case"ArrowDown":return e.preventDefault(),i((e=>ee>0?e-1:c.length-1)),!0;case"Enter":case"Tab":{const r=l>=0?c[l]:null;if(!r||r.toLowerCase()===t.toLowerCase().trim()){d();break}return e.preventDefault(),p(r),!0}case"Escape":return e.preventDefault(),d(),!0}return!1}),[o,c,l,t,p,d]);return{isOpen:o&&c.length>0,suggestions:c,highlightedIndex:l,showAutocomplete:u,hideAutocomplete:d,selectSuggestion:p,handleKeyDown:h,setHighlightedIndex:i,isColorProperty:pd(e)}}({property:t,inputValue:r,onSelect:e=>{n(e),_()}});(0,s.useEffect)((()=>{p&&m.current&&m.current.focus()}),[p]);const T=(0,s.useCallback)((e=>{n(e.target.value),C()}),[n,C]),I=(0,s.useCallback)((e=>{if(!R(e))switch(e.key){case"Enter":e.preventDefault(),_(),l&&l(),u&&u();break;case"Tab":_(),e.shiftKey&&d?(e.preventDefault(),d()):!e.shiftKey&&u?(e.preventDefault(),u()):l&&l();break;case"Escape":e.preventDefault(),_(),i&&i();break;case"Backspace":!r&&d&&(e.preventDefault(),_(),y.current=!0,d())}}),[R,l,u,d,i,_,r]),P=(0,s.useCallback)((()=>{v.current=setTimeout((()=>{if(y.current)return void(y.current=!1);const e=b.current?.ownerDocument||document;b.current?.contains(e.activeElement)||(_(),l&&l())}),ud)}),[_,l]),M=(0,s.useCallback)((()=>{m.current?.select(),c&&c(),C()}),[c,C]),D=(0,s.useCallback)((e=>{n(e||"")}),[n]);return(0,e.createElement)("div",{ref:b,className:g(cd.inputWrapper,cd.valueInputWrapper)},k&&(0,e.createElement)(yc,{value:r,onChange:D,renderToggle:({isOpen:t,onToggle:n})=>(0,e.createElement)("button",{type:"button",tabIndex:-1,className:cd.colorSwatch,style:r?{"--swatch-color":r}:void 0,onClick:n,"aria-expanded":t,"aria-label":(0,a.__)("Open color picker","generateblocks-pro")})}),(0,e.createElement)("input",{ref:m,type:"text",value:r,onChange:T,onKeyDown:I,onBlur:P,onFocus:M,disabled:h,placeholder:f||(0,a.__)("value","generateblocks-pro"),className:g(cd.input,cd.value),spellCheck:!1,autoComplete:"off",autoCapitalize:"off",autoCorrect:"off",role:"combobox","aria-label":t?/* translators: %s: CSS property name */ /* translators: %s: CSS property name */(0,a.sprintf)((0,a.__)("Value for %s","generateblocks-pro"),t):(0,a.__)("CSS property value","generateblocks-pro"),"aria-expanded":E,"aria-autocomplete":"list","aria-controls":`value-listbox-${w}`,"aria-activedescendant":E&&x>=0&&S[x]?`value-option-${w}-${S[x]}`:void 0}),E&&(0,e.createElement)(o.Popover,{anchor:m.current,focusOnMount:!1,animate:!1,placement:"bottom-start",variant:"unstyled",className:cd.autocompletePopover},(0,e.createElement)("div",{id:`value-listbox-${w}`,className:cd.autocomplete,role:"listbox","aria-label":(0,a.__)("CSS value suggestions","generateblocks-pro")},S.map(((t,r)=>(0,e.createElement)("div",{key:t,id:`value-option-${w}-${t}`,ref:r===x?e=>{e?.scrollIntoView?.({block:"nearest"})}:void 0,role:"option",tabIndex:-1,"aria-selected":x>=0&&r===x,className:g(cd.autocompleteItem,x>=0&&r===x&&cd.highlighted),onMouseDown:e=>{e.preventDefault(),A(t)},onMouseEnter:()=>O(r)},t))))))}function fd({property:t,value:r,onPropertyChange:n,onValueChange:o,onDelete:l,onFocusPreviousValue:i}){const c=S(t),u=(0,s.useRef)(null),[d,p]=(0,s.useState)(c),[h,f]=(0,s.useState)(r),m=(0,s.useRef)(c),b=(0,s.useRef)(r),v=(0,s.useRef)(t),y=(0,$e.useInstanceId)(fd);v.current=t;const w=(0,s.useMemo)((()=>Ie(c,r)),[c,r]),k=w.valid,E=`property-error-${y}`;(0,s.useEffect)((()=>{p(c)}),[c]),(0,s.useEffect)((()=>{f(r)}),[r]);const x=(0,s.useMemo)((()=>(0,$e.debounce)((e=>{o(v.current,e)}),150)),[o]);(0,s.useEffect)((()=>()=>x.cancel()),[x]),(0,s.useEffect)((()=>{x.flush()}),[t,x]);const C=(0,s.useCallback)((e=>{f(e),e&&x(e)}),[x]),_=(0,s.useCallback)((()=>{if(x.flush(),!h.trim()&&l){const e=u.current?.ownerDocument||document;u.current?.contains(e.activeElement)||l(t)}}),[x,h,t,l]),A=(0,s.useCallback)((()=>{const e=d.trim();if(e&&h.trim())e!==c&&n(t,T(e),h);else if(l){const e=u.current?.ownerDocument||document;u.current?.contains(e.activeElement)||l(t)}}),[d,h,c,t,n,l]),R=(0,s.useCallback)((()=>{p(m.current)}),[]),O=(0,s.useCallback)((()=>{x.cancel();const e=b.current;f(e),o(t,e)}),[t,o,x]),I=(0,s.useCallback)((()=>{m.current=d}),[d]),P=(0,s.useCallback)((()=>{b.current=h}),[h]),M=(0,s.useCallback)((()=>{i?i(t):l&&l(t)}),[t,l,i]),D=(0,s.useCallback)((()=>{const e=u.current?.querySelectorAll('input[type="text"]'),t=e?.[e.length-1];if(t){t.focus();const e=t.value.length;t.setSelectionRange(e,e)}}),[]),N=(0,s.useCallback)((()=>{if(!u.current)return;const e=u.current.nextElementSibling;if(e){const t=e.querySelector('input[type="text"]');t&&t.focus()}}),[]),L=(0,s.useCallback)((()=>{const e=u.current?.querySelector('input[type="text"]');if(e){e.focus();const t=e.value.length;e.setSelectionRange(t,t)}}),[]);return(0,e.createElement)("div",{ref:u,role:"listitem","data-property":t,className:g(cd.propertyRow,!k&&cd.invalid),"aria-invalid":!k||void 0,"aria-describedby":k?void 0:E},!k&&(0,e.createElement)("span",{id:E,className:"screen-reader-text"},w.error||(0,a.__)("Invalid property or value","generateblocks-pro")),(0,e.createElement)(dd,{value:d,onChange:p,onCommit:A,onCancel:R,onFocus:I,onTab:D,onDelete:M}),(0,e.createElement)("span",{className:cd.separator},":"),(0,e.createElement)(hd,{property:t,value:h,onChange:C,onCommit:_,onCancel:O,onFocus:P,onTab:N,onShiftTab:L}))}function md({onAdd:t,startActive:r,onDismiss:n,onFocusPreviousValue:o}){const[l,i]=(0,s.useState)(""),[c,u]=(0,s.useState)(""),[d,p]=(0,s.useState)("property"),[h,f]=(0,s.useState)(""),m=(0,s.useRef)(null),b=(0,s.useRef)(null),v=(0,s.useRef)(!1),y=(0,s.useRef)(null);(0,s.useEffect)((()=>()=>{b.current&&clearTimeout(b.current),y.current&&clearTimeout(y.current)}),[]),(0,s.useEffect)((()=>{if(!v.current||!m.current)return;v.current=!1;const e=m.current.querySelectorAll('input[type="text"]');"value"===d&&e[1]?e[1].focus():"property"===d&&e[0]&&e[0].focus()}),[d]);const w=(0,s.useCallback)((()=>{n?n():(i(""),u(""),p("property"))}),[n]),k=(0,s.useCallback)((()=>{l.trim()&&(b.current&&clearTimeout(b.current),v.current=!0,p("value"))}),[l]),E=(0,s.useCallback)((e=>{y.current&&clearTimeout(y.current),f(e),y.current=setTimeout((()=>{f(""),y.current=null}),3e3)}),[]),S=(0,s.useCallback)((()=>{const e=l.trim(),r=c.trim();if(e&&r){if(!C(T(e)))return void E((0,a.__)("Invalid property name","generateblocks-pro"));const o=Ie(e,r);if(o.valid||E(o.error||(0,a.__)("Invalid property or value","generateblocks-pro")),t(e,r),n)return void n();i(""),u(""),v.current=!0,p("property")}else e&&!r?(v.current=!0,p("value")):w()}),[l,c,t,n,w,E]),x=(0,s.useCallback)((()=>{w()}),[w]),_=(0,s.useCallback)((()=>{b.current=setTimeout((()=>{const e=m.current?.ownerDocument||document;m.current&&!m.current.contains(e.activeElement)&&(l.trim()&&c.trim()?S():w())}),ud)}),[l,c,S,w]),A=(0,s.useCallback)((()=>{b.current&&clearTimeout(b.current),v.current=!0,p("property")}),[]),R=(0,s.useCallback)((()=>{S()}),[S]),O=(0,s.useCallback)((()=>{"value"!==d&&l.trim()&&p("value")}),[d,l]);return(0,e.createElement)("div",{ref:m,role:"listitem",className:g(cd.addProperty,(l||c)&&cd.active),onBlur:_},(0,e.createElement)(dd,{value:l,onChange:i,onCommit:k,onCancel:x,onTab:k,onDelete:o,autoFocus:!!r&&"property"===d,placeholder:(0,a.__)("property","generateblocks-pro")}),(0,e.createElement)("span",{className:cd.separator},":"),(0,e.createElement)(hd,{property:l,value:c,onChange:u,onCommit:S,onCancel:x,onTab:R,onShiftTab:A,onFocus:O,autoFocus:!!r&&"value"===d,disabled:"property"===d&&!l.trim(),placeholder:(0,a.__)("value","generateblocks-pro")}),h&&(0,e.createElement)("span",{role:"status","aria-live":"polite",className:cd.validationWarning},h))}function gd(t){const{styles:r,onStyleChange:n,opened:l,scrollAfterOpen:i,onToggle:c,initialOpen:u,onOpenCssEditor:d}=t,p=(0,s.useRef)(null),[h,f]=(0,s.useState)(""),m=(0,s.useRef)(0),g=(0,s.useRef)(new Map),v=(0,s.useMemo)((()=>{if(!r||"object"!=typeof r)return[];const e=Object.entries(r).filter((([,e])=>"string"==typeof e&&""!==e)).map((([e,t])=>(g.current.has(e)||g.current.set(e,++m.current),{property:e,value:t,key:g.current.get(e)}))),t=new Set(e.map((e=>e.property)));for(const e of g.current.keys())t.has(e)||g.current.delete(e);return e}),[r]),y=(0,s.useCallback)(((e,t,r)=>{const o=T(t);if(!C(o))return void f((0,a.__)("Invalid property name","generateblocks-pro"));const s=T(e);s!==o&&n({[s]:"",[o]:r})}),[n]),w=(0,s.useCallback)(((e,t)=>{const r=T(e);C(r)&&n({[r]:Me(t)})}),[n]),k=(0,s.useCallback)((e=>{const t=v.findIndex((t=>t.property===e)),r=T(e);n({[r]:""}),f(`${e} ${(0,a.__)("deleted","generateblocks-pro")}`),requestAnimationFrame((()=>{if(!p.current)return;const e=p.current.querySelectorAll("[data-property]"),r=e[t]||e[e.length-1];if(r){const e=r.querySelector('input[type="text"]');if(e)return void e.focus()}const n=p.current.querySelector('input[type="text"]:last-of-type');n&&n.focus()}))}),[v,n]),E=(0,s.useCallback)((e=>{const t=v.findIndex((t=>t.property===e));if(t>0&&p.current){const e=p.current.querySelectorAll("[data-property]")[t-1];if(e){const t=e.querySelectorAll('input[type="text"]'),r=t[t.length-1];if(r){r.focus();const e=r.value.length;r.setSelectionRange(e,e)}}}const r=T(e);n({[r]:""}),f(`${e} ${(0,a.__)("deleted","generateblocks-pro")}`)}),[v,n]),S=(0,s.useCallback)(((e,t)=>{const r=T(e);C(r)?(n({[r]:Me(t)}),f(`${e} ${(0,a.__)("added","generateblocks-pro")}`)):f((0,a.__)("Invalid property name","generateblocks-pro"))}),[n]);return(0,e.createElement)(o.PanelBody,{title:(0,a.__)("CSS Properties","generateblocks-pro"),initialOpen:u,icon:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Os,{size:"20"})),opened:!!l||void 0,scrollAfterOpen:i,onToggle:c},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)("div",{className:cd.panel},(0,e.createElement)("div",{ref:p,className:cd.propertyList,role:"list","aria-label":(0,a.__)("CSS properties","generateblocks-pro")},0===v.length?(0,e.createElement)("div",{className:cd.emptyState},(0,a.__)("No styles defined. Add a property to get started.","generateblocks-pro")):v.map(((t,r)=>(0,e.createElement)(fd,{key:t.key,property:t.property,value:t.value,onPropertyChange:y,onValueChange:w,onDelete:k,onFocusPreviousValue:r>0?E:void 0}))),(0,e.createElement)(md,{onAdd:S,startActive:0===v.length,onFocusPreviousValue:v.length>0?()=>{if(!p.current)return;const e=p.current.querySelectorAll("[data-property]"),t=e[e.length-1];if(t){const e=t.querySelectorAll('input[type="text"]'),r=e[e.length-1];if(r){r.focus();const e=r.value.length;r.setSelectionRange(e,e)}}}:void 0})),(0,e.createElement)("div",{className:"screen-reader-text","aria-live":"polite",role:"status"},h)),!!d&&(0,e.createElement)(o.Button,{variant:"link",onClick:d,className:cd.editFullStylesheet},(0,a.__)("Enable CSS Mode","generateblocks-pro"))))}const bd={controls:"M2tce9CYmar_SaRfGDX4",noResults:"K4d6zHrYGGMqx2tHymDN",filtersActive:"vp1WYiEC_A5yOD05azTr",addMargin:"kTu1tFTn2rKREMXAJXQj",vertical:"XtAYx8ZKvqUBbv4KiKga",isSearching:"E5rfTBAoCUgE1l42TSkQ"};class vd extends s.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){console.error(e,t.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}}function yd({styles:t,allStyles:r,settings:n,onStyleChange:l,nestedRule:i,atRule:c,deviceType:u,filters:d,dispatchFilters:p,scope:h="",allowCustomAtRule:f,allowDevTools:m,currentSelector:b,onOpenCssEditor:v}){var y,w;const k=(0,s.useMemo)((()=>Object.values(t).filter((e=>"string"==typeof e)).length>0),[t]),E=!!d.activeFilter,S={styles:t,allStyles:r,settings:n,onStyleChange:l,nestedRule:i,atRule:c,deviceType:u,filtersActive:E,filter:null!==(y=d.activeFilter)&&void 0!==y?y:"",search:null!==(w=d.search)&&void 0!==w?w:"",scope:h,allowCustomAtRule:f,currentSelector:b};return(0,e.createElement)("div",{className:g("gb-inspector-controls",bd.controls,(d.search||E)&&"gb-inspector-controls--filtering")},(0,e.createElement)(vd,{fallback:(0,a.__)("An error has occured, please reload and try again","generateblocks-pro")},!!d.search&&(0,e.createElement)(o.Notice,{className:g(bd.isSearching),isDismissible:!0,onDismiss:()=>{p({type:"RESET"})}},(0,a.sprintf)(/* translators: %s: search term */ /* translators: %s: search term */
(0,a.__)("Searching for: %s","generateblocks-pro"),d.search)),(0,e.createElement)(Kl,{id:"layout",panel:oi,...S}),(0,e.createElement)(Kl,{id:"sizing",panel:ai,...S}),(0,e.createElement)(Kl,{id:"spacing",panel:gi,...S}),(0,e.createElement)(Kl,{id:"typography",panel:qc,...S}),(0,e.createElement)(Kl,{id:"backgrounds",panel:au,...S}),(0,e.createElement)(Kl,{id:"borders",panel:gu,...S}),(0,e.createElement)(Kl,{id:"position",panel:bu,...S}),(0,e.createElement)(Kl,{id:"effects",panel:nd,...S}),(0,e.createElement)(Kl,{id:"media",panel:od,...S}),(0,e.createElement)(Kl,{id:"lists",panel:ad,...S}),(0,e.createElement)(Kl,{id:"more",panel:ld,...S}),!!m&&(0,e.createElement)(Kl,{id:"dev-tools",panel:gd,...S,onOpenCssEditor:v}),!k&&"show-with-value"===d.activeFilter&&(0,e.createElement)(o.Notice,{className:g(bd.addMargin,bd.vertical),isDismissible:!1},(0,a.__)("No styles set.","generateblocks-pro")," ",(0,e.createElement)(o.Button,{className:bd.resetButton,variant:"link",onClick:()=>{p({type:"RESET"})}},(0,a.__)("Reset filters","generateblocks-pro"))),k&&(0,e.createElement)(o.Notice,{className:g(bd.addMargin,bd.vertical,bd.noResults,(E||d.search)&&bd.filtersActive),isDismissible:!1},(0,a.__)("No results found.","generateblocks-pro"))))}const wd=r(8907);function kd(e,t){if(!t)return null;const r=H(e);for(const e of r)if(t[e]&&"string"==typeof t[e])return{property:e,value:t[e]};return null}const Ed=["color","font","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textAlign","textIndent","textTransform","visibility","whiteSpace","wordSpacing","letterSpacing","direction","cursor"];function Sd(e,t){if(e===t)return!0;if(e.startsWith(t)&&" "===e[t.length])return!0;const r=v(t);return r.length>1&&r.some((t=>e===t||!(!e.startsWith(t)||" "!==e[t.length])))}const xd=e=>{if("string"!=typeof e)return{value:e,important:!1};const t=e.trim(),r=t.endsWith("!important");return{value:t,important:r}};function Cd(e){const t=e.match(/min-width:\s*(\d*\.?\d+)/),r=e.match(/max-width:\s*(\d*\.?\d+)/);return{minWidth:t?parseFloat(t[1]):0,maxWidth:r?parseFloat(r[1]):1/0}}function _d(e){return"string"==typeof e&&/^@media(?:\s|\()/i.test(e)}function Ad(e,t){if(!_d(e))return!1;try{return wd.match(function(e){return e.replace(/^@media\s*/i,"").trim()}(e),{width:`${t}px`})}catch{return!1}}const Rd="edge22/styles-builder/css-mode",Od="generateblocks-css-mode-enabled";function Td(){const e="undefined"!=typeof window?window:null;if(!e)return null;try{return e.localStorage||null}catch{return null}}function Id(){const e=Td();if(!e)return!1;try{return"true"===e.getItem(Od)}catch{return!1}}function Pd(e){const t=Td();if(t)try{e?t.setItem(Od,"true"):t.removeItem(Od)}catch{}}function Md(e="local"){return e||"local"}function Dd(e){return e?`selector:${e}`:"__all__"}function Nd(){return{enabled:Id(),focusRequestIdsByScope:{},nextFocusRequestId:0}}function Ld(e={}){return Object.keys(e).length>0}const zd=(0,Fe.createReduxStore)(Rd,{reducer:function(e=Nd(),t){switch(t.type){case"SET_CSS_MODE_ENABLED":return e.enabled!==t.enabled||!t.enabled&&Ld(e.focusRequestIdsByScope)?{...e,enabled:t.enabled,focusRequestIdsByScope:t.enabled?e.focusRequestIdsByScope:{}}:e;case"ENABLE_CSS_MODE":{let r=e.enabled?e:{...e,enabled:!0};return t.focus&&(r=function(e,{scope:t="local",selector:r}={}){const n=Md(t),o=Dd(r),s=(e.nextFocusRequestId||0)+1;return{...e,nextFocusRequestId:s,focusRequestIdsByScope:{...e.focusRequestIdsByScope,[n]:{...e.focusRequestIdsByScope[n]||{},[o]:s}}}}(r,t)),r}case"DISABLE_CSS_MODE":return e.enabled||Ld(e.focusRequestIdsByScope)?{...e,enabled:!1,focusRequestIdsByScope:{}}:e;case"CONSUME_CSS_MODE_FOCUS_REQUEST":{const r=e.focusRequestIdsByScope[Md(t.scope)];return t.requestId&&r?.[Dd(t.selector)]===t.requestId?function(e,{scope:t="local",selector:r}={}){const n=Md(t),o=Dd(r),s=e.focusRequestIdsByScope[n];if(!s||!s[o])return e;const a={...s};delete a[o];const l={...e.focusRequestIdsByScope};return Object.keys(a).length>0?l[n]=a:delete l[n],{...e,focusRequestIdsByScope:l}}(e,t):e}case"RESET_CSS_MODE_STORE":return t.state;default:return e}},actions:{setCssModeEnabled(e){const t=!!e;return Pd(t),{type:"SET_CSS_MODE_ENABLED",enabled:t}},enableCssMode:({scope:e="local",selector:t,focus:r=!1}={})=>(Pd(!0),{type:"ENABLE_CSS_MODE",scope:e,selector:t,focus:!!r}),disableCssMode:()=>(Pd(!1),{type:"DISABLE_CSS_MODE"}),consumeCssModeFocusRequest:({scope:e="local",selector:t,requestId:r}={})=>({type:"CONSUME_CSS_MODE_FOCUS_REQUEST",scope:e,selector:t,requestId:r}),resetCssModeStoreForTests:()=>({type:"RESET_CSS_MODE_STORE",state:Nd()})},selectors:{isCssModeEnabled:e=>!!e?.enabled,getCssModeFocusRequest(e,t="local",r){const n=e?.focusRequestIdsByScope?.[Md(t)];return n?.[Dd(r)]||0}},initialState:Nd()});function Bd(){try{return(0,Fe.select)(Rd)}catch{return}}function jd(){const e=Bd();return"function"==typeof e?.isCssModeEnabled}function Fd(){if(jd())return!0;try{(0,Fe.register)(zd)}catch{return jd()}return jd()}function Vd(){if(!Fd())return{};try{return(0,Fe.dispatch)(Rd)||{}}catch{return{}}}function $d(){return Fd(),!!Bd()?.isCssModeEnabled?.()}function Wd(e){Vd().setCssModeEnabled?.(e)}function Ud(e="local",t){return Fd(),Bd()?.getCssModeFocusRequest?.(e,t)||0}function Hd({scope:e="local",selector:t,requestId:r}={}){Vd().consumeCssModeFocusRequest?.({scope:e,selector:t,requestId:r})}function qd({scope:e="local",selector:t,focus:r=!1}={}){Vd().enableCssMode?.({scope:e,selector:t,focus:r})}function Gd(){Vd().disableCssMode?.()}function Zd(e){return"function"==typeof e&&Fd()?(0,Fe.subscribe)(e,Rd):()=>{}}function Yd(e,t){switch(t.type){case"SET_SEARCH":return function({query:e,type:t}){const r=new URLSearchParams(window.location.search);r.set(`gb-${t}-styles-search`,e),window.history.replaceState(null,"",`${window.location.pathname}?${r.toString()}`)}(t.payload),{...e,search:t.payload.query};case"SET_FILTER":return function({activeFilter:e,type:t}){const r=new URLSearchParams(window.location.search);r.set(`gb-${t}-styles-filter`,e),window.history.replaceState(null,"",`${window.location.pathname}?${r.toString()}`)}(t.payload),{...e,activeFilter:t.payload.activeFilter};case"RESET":return{search:"",activeFilter:""};default:return e}}function Kd(e,t){return Array.isArray(e)?e.some((e=>Kd(e,t))):"string"==typeof e?e.toLowerCase().includes(t.toLowerCase()):!!(0,s.isValidElement)(e)&&Xd(e,t)}function Xd(e,t){const{children:r}=e.props;return"string"==typeof r?r.toLowerCase().includes(t.toLowerCase()):!!Array.isArray(r)&&r.some((e=>"string"==typeof e?e.toLowerCase().includes(t.toLowerCase()):(0,s.isValidElement)(e)&&Xd(e,t)))}function Qd(t){const{settings:r,onStyleChange:n,nestedRule:l,onNestedRuleChange:i,onAtRuleChange:u,onEditStyle:p,atRule:h,currentSelector:f,onUpdateKey:m,onDeleteStyle:b,styles:v={},allStyles:y={},customAtRules:w=[],selectorShortcuts:k={},visibleSelectors:E=[],scope:S="",canManageStyles:x=!0,setLocalTab:C=()=>{},cancelEditStyle:_=()=>{},allowCustomAtRule:A=!0,allowCustomAdvancedSelector:R=!0,allowDevTools:O=!1,appliedGlobalStyles:T=[],onAllStylesChange:I}=t,[P,M]=(0,s.useState)(!1),[N,L]=(0,s.useState)(!1),z=Md(S),B=function(){const e=(0,s.useMemo)(Ye,[]);return(0,Fe.useSelect)(e,[])}(),j=He(),F=(0,s.useRef)(null);(0,s.useEffect)((()=>{F.current=j}),[j]);const V=(0,s.useSyncExternalStore)(Zd,$d),$=(0,s.useCallback)((()=>Ud(z,f)),[z,f]),W=(0,s.useSyncExternalStore)(Zd,$),U=O&&!!I,H=U&&V,q=(0,s.useCallback)((()=>{U&&qd({scope:z,selector:f,focus:!0})}),[U,z,f]),G=(0,s.useCallback)((()=>{var e;Gd(),e=()=>function(e){if(!e?.isConnected||"function"!=typeof e.focus)return;const t=e.hasAttribute("tabindex"),r=e.getAttribute("tabindex");t||e.setAttribute("tabindex","-1");try{e.focus({preventScroll:!0})}catch{e.focus()}t?e.setAttribute("tabindex",r):e.removeAttribute("tabindex")}(F.current),"function"==typeof requestAnimationFrame?requestAnimationFrame(e):setTimeout(e,0)}),[z,f]),Z=(0,s.useCallback)((e=>{Hd({scope:z,selector:f,requestId:e})}),[z,f]),Y=(0,s.useMemo)((()=>D(h)),[h]),K=w.length>0?w:Za,[X,Q]=(0,s.useReducer)(Yd,{search:"",activeFilter:""},(()=>{var e,t;const r=new URLSearchParams(window.location.search);return{search:null!==(e=r.get(`gb-${S}-styles-search`))&&void 0!==e?e:"",activeFilter:null!==(t=r.get(`gb-${S}-styles-filter`))&&void 0!==t?t:""}})),J=!!X.activeFilter,[ee,te]=(0,s.useState)(X.search);(0,s.useEffect)((()=>{te(X.search)}),[X.search]);const re=(0,s.useCallback)(((e,t=S)=>{Q({type:"SET_SEARCH",payload:{query:e,type:t}})}),[Q,S]);(0,s.useEffect)((()=>{const e=setTimeout((()=>{ee!==X.search&&re(ee,S)}),300);return()=>clearTimeout(e)}),[ee,X.search,re,S]);const ne=(0,s.useMemo)((()=>X.search?X.search.split(",").filter(Boolean):[]),[X.search]),oe=(0,s.useMemo)((()=>X.activeFilter),[X.activeFilter]),se=(0,s.useCallback)(((e,t)=>{if(!oe&&0===ne.length)return!0;const{label:r="",searchKeywords:n=[],matchTypes:o=[],cssProp:s}=e;let a=!0;if(oe)switch(oe){case"show-with-value":a=""!==t?.value||void 0===t?.value;break;case"show-inherited":a=o.includes("local")||o.includes("global")||!1===s}return a&&0!==ne.length?ne.length>1?ne.some((e=>Kd([r,...n],e.trim()))):Kd([r,...n],ne[0]):a}),[oe,ne]),ae=(0,s.useMemo)((()=>_t(y||{})),[y]),le=(0,s.useMemo)((()=>(B||[]).map((e=>({...e,styles:_t(e.styles||{})})))),[B]);function ie(e="",t="",r=null){const n=null!==r?r:v;return function(e={},t="",r="",n,o=[],s=[],a,l={},i={}){const c=Array.isArray(n)?n:[n],u=o.some((e=>e.classNameSelector===a)),d=u&&0===Object.keys(e).length?o.find((e=>e.classNameSelector===a))?.styles||{}:e,p=(e,t)=>e&&Object.keys(e).some((e=>!e.match(/^[@.&]/)&&e===t)),h=!u&&s.length?o.filter((e=>s.includes(e.className))).reverse():[],f=new Map,m=(e,n,o=!1)=>{const s=`${JSON.stringify(e)}-${n}-${o}`;if(f.has(s))return f.get(s);let a={nest:"",at:"",val:null,important:!1};const l=1200,i=!r||_d(r),c=_d(r)?Math.min(Cd(r).maxWidth,Math.max(Cd(r).minWidth,l)):l;if(t){const r=Object.keys(e).filter((t=>"object"==typeof e[t]&&!t.startsWith("@")));for(const o of r)if(Sd(t,o)){if(e[o]?.[n]){const{value:t,important:r}=xd(e[o][n]);return a={nest:o,at:"",val:t,important:r},f.set(s,a),a}if(i){const t=Object.keys(e[o]||{}).filter(_d);for(const r of t)if(Ad(r,c)&&e[o][r]?.[n]){const{value:t,important:l}=xd(e[o][r][n]);return a={nest:o,at:r,val:t,important:l},f.set(s,a),a}}}}if(r&&e[r]){if(t){const o=Object.keys(e[r]).filter((t=>"object"==typeof e[r][t]&&!t.startsWith("@")));for(const l of o)if(Sd(t,l)&&e[r][l]?.[n]){const{value:t,important:o}=xd(e[r][l][n]);if(o)return a={nest:l,at:r,val:t,important:o},f.set(s,a),a}}if(e[r][n]){const{value:t,important:o}=xd(e[r][n]);if(o)return a={nest:"",at:r,val:t,important:o},f.set(s,a),a}}if(r&&e[r]){if(t){const o=Object.keys(e[r]).filter((t=>"object"==typeof e[r][t]&&!t.startsWith("@")));for(const l of o)if(Sd(t,l)&&e[r][l]?.[n]){const{value:t,important:o}=xd(e[r][l][n]);return a={nest:l,at:r,val:t,important:o},f.set(s,a),a}}if(e[r][n]){const{value:t,important:o}=xd(e[r][n]);return a={nest:"",at:r,val:t,important:o},f.set(s,a),a}}const u=Object.keys(e).filter(_d).sort(((e,t)=>{const r=parseFloat(e.match(/max-width:(\d*\.?\d+)/)?.[1])||1/0,n=parseFloat(t.match(/max-width:(\d*\.?\d+)/)?.[1])||1/0;if(r!==n)return r-n;const o=parseFloat(e.match(/min-width:(\d*\.?\d+)/)?.[1])||0;return(parseFloat(t.match(/min-width:(\d*\.?\d+)/)?.[1])||0)-o}));if(r&&_d(r))for(const r of u)if(Ad(r,c)&&e[r]){if(t){const o=Object.keys(e[r]).filter((t=>"object"==typeof e[r][t]&&!t.startsWith("@")));for(const l of o)if(Sd(t,l)&&e[r][l]?.[n]){const{value:t,important:o}=xd(e[r][l][n]);if(o)return a={nest:l,at:r,val:t,important:o},f.set(s,a),a}}if(e[r][n]){const{value:t,important:o}=xd(e[r][n]);if(o)return a={nest:"",at:r,val:t,important:o},f.set(s,a),a}}if(r&&_d(r))for(const r of u)if(Ad(r,c)&&e[r]){if(t){const o=Object.keys(e[r]).filter((t=>"object"==typeof e[r][t]&&!t.startsWith("@")));for(const l of o)if(Sd(t,l)&&e[r][l]?.[n]){const{value:t,important:o}=xd(e[r][l][n]);return a={nest:l,at:r,val:t,important:o},f.set(s,a),a}}if(e[r][n]){const{value:t,important:o}=xd(e[r][n]);return a={nest:"",at:r,val:t,important:o},f.set(s,a),a}}if(p(e,n)){const{value:r,important:l}=xd(e[n]);if(l&&(!t||Ed.includes(n)||o))return a={nest:"",at:"",val:r,important:l},f.set(s,a),a}if(!r)for(const r of u)if(Ad(r,l)&&e[r]){if(t){const o=Object.keys(e[r]).filter((t=>"object"==typeof e[r][t]&&!t.startsWith("@")));for(const l of o)if(Sd(t,l)&&e[r][l]?.[n]){const{value:t,important:o}=xd(e[r][l][n]);if(o)return a={nest:l,at:r,val:t,important:o},f.set(s,a),a}}if(e[r][n]){const{value:t,important:o}=xd(e[r][n]);if(o)return a={nest:"",at:r,val:t,important:o},f.set(s,a),a}}if(p(e,n)){const{value:r,important:s}=xd(e[n]);(!t||Ed.includes(n)||o&&!t)&&(a={nest:"",at:"",val:r,important:s})}if(!a.val&&!r)for(const r of u)if(Ad(r,l)&&e[r]){if(t){const o=Object.keys(e[r]).filter((t=>"object"==typeof e[r][t]&&!t.startsWith("@")));for(const l of o)if(Sd(t,l)&&e[r][l]?.[n]){const{value:t,important:o}=xd(e[r][l][n]);return a={nest:l,at:r,val:t,important:o},f.set(s,a),a}}if(e[r][n]){const{value:t,important:o}=xd(e[r][n]);a={nest:"",at:r,val:t,important:o};break}}return f.set(s,a),a};return c.map((e=>{if(!Array.isArray(l)&&void 0!==l[e]){const{value:n,important:o}=xd(l[e]),s=i?kd(e,i):null,a=s&&!i[e];if(o)return{hasInheritedValue:!0,source:a?"shorthand":"current",classNameSelector:null,inheritedNestedRule:t,inheritedAtRule:r,property:e,value:n,...a&&{shorthandProperty:s.property,shorthandValue:s.value}}}const{nest:n,at:o,val:s,important:c}=m(d,e,!1);if(s&&c){const i=""!==n||""!==o||""!==t||""!==r||l[e]?"local":"current";return{hasInheritedValue:!0,source:i,classNameSelector:"current"===i?null:a,inheritedNestedRule:n,inheritedAtRule:o,property:e,value:s}}if(h.length)for(const r of h){const n=r.styles||{},{nest:o,at:s,val:a,important:l}=m(n,e,!0);if(a&&l)return{hasInheritedValue:!0,source:"global",classNameSelector:r.classNameSelector,inheritedNestedRule:o||(t&&r.classNameSelector===t?t:""),inheritedAtRule:s,property:e,value:a}}if(!Array.isArray(l)&&void 0!==l[e]){const{value:n}=xd(l[e]),o=i?kd(e,i):null,s=o&&!i[e];return{hasInheritedValue:!0,source:s?"shorthand":"current",classNameSelector:null,inheritedNestedRule:t,inheritedAtRule:r,property:e,value:n,...s&&{shorthandProperty:o.property,shorthandValue:o.value}}}if(s){const i=""!==n||""!==o||""!==t||""!==r||l[e]?"local":"current";return{hasInheritedValue:!0,source:i,classNameSelector:"current"===i?null:a,inheritedNestedRule:n,inheritedAtRule:o,property:e,value:s}}if(h.length)for(const r of h){const n=r.styles||{},{nest:o,at:s,val:a}=m(n,e,!0);if(a)return{hasInheritedValue:!0,source:"global",classNameSelector:r.classNameSelector,inheritedNestedRule:o||(t&&r.classNameSelector===t?t:""),inheritedAtRule:s,property:e,value:a}}return{hasInheritedValue:!1,source:null,classNameSelector:null,inheritedNestedRule:"",inheritedAtRule:"",property:e,value:null}}))}(ae,e,t,il,le,T||[],f,_t(n||{}),n||{})}const ce=ie(l,h),ue={atRule:Y,currentSelector:f,canManageStyles:x,onEditStyle:p,setLocalTab:C,cancelEditStyle:_,onAtRuleChange:u,controlFilters:X,controlIsVisible:se,setSearch:re,inheritedSources:ce,onNestedRuleChange:i,getValueSources:ie,scope:S};return(0,e.createElement)(Ke.Provider,{value:ue},(0,e.createElement)("div",{className:g("gb-styles-builder",H&&"gb-styles-builder--css-editor-open",c.component)},H?(0,e.createElement)(Wn,{allStyles:y,selector:f,onApply:I,onClose:G,closeOnApply:!1,autoApply:!0,title:(0,a.__)("CSS Mode","generateblocks-pro"),closeLabel:(0,a.__)("Disable CSS Mode","generateblocks-pro"),focusRequestId:W,onFocusRequestConsumed:Z,className:c.cssEditorSidebar}):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:c.header},(0,e.createElement)(et,{allStyles:y,onUpdateKey:m,onNestedRuleChange:i,currentSelector:f,nestedRule:l,showSelectorOptions:P,setShowSelectorOptions:M,onDeleteStyle:b,selectorShortcuts:k,visibleSelectors:E,allowCustomAdvancedSelector:R,atRule:h}),!P&&(0,e.createElement)("div",{className:c.atRuleFilters},!!K.length>0&&(0,e.createElement)(it,{atRule:Y,onAtRuleChange:u,onNestedRuleChange:i,defaultAtRules:K,allStyles:y,showAtRuleOptions:N,setShowAtRuleOptions:L,onUpdateKey:m,nestedRule:l,onDeleteStyle:b,allowCustomAtRule:A,styles:v})),!P&&!N&&(0,e.createElement)("div",{className:c.filters},(0,e.createElement)("div",{className:c.searchWrapper},(0,e.createElement)(o.TextControl,{type:"search",__nextHasNoMarginBottom:!0,value:ee,onChange:te,label:(0,a.__)("Search Controls","generateblocks-pro"),hideLabelFromVision:!0,placeholder:(0,a.__)("Search controls…","generateblocks-pro"),className:g(c.search,ee&&c.searchActive),autoComplete:"off"}),(0,e.createElement)("div",{className:c.searchIcon},ee?(0,e.createElement)(o.Button,{size:"small",onClick:()=>{te(""),re("",S)},icon:dt,label:(0,a.__)("Clear search","generateblocks-pro")}):(0,e.createElement)(d,{icon:_l}))),(0,e.createElement)(o.DropdownMenu,{variant:"link",size:"small",icon:Al,label:(0,a.__)("Filter Controls","generateblocks-pro"),className:c.filtersDropdown,popoverProps:{className:c.filtersPopover},toggleProps:{size:"compact",isPressed:J,iconSize:"18"}},(({onClose:t})=>(0,e.createElement)(o.MenuGroup,{label:(0,a.__)("Controls Visibility","generateblocks-pro")},(0,e.createElement)(o.MenuItemsChoice,{value:X.activeFilter,choices:[{label:(0,a.__)("Show all","generateblocks-pro"),value:""},{label:(0,a.__)("Show controls with value","generateblocks-pro"),value:"show-with-value"},{label:(0,a.__)("Show inherited values","generateblocks-pro"),value:"show-inherited"}],onSelect:e=>{Q({type:"SET_FILTER",payload:{activeFilter:e,type:S}}),t()}})))),U&&(0,e.createElement)(o.Button,{size:"compact",icon:(0,e.createElement)(Os,{size:"16"}),iconSize:16,label:(0,a.__)("Enable CSS Mode","generateblocks-pro"),onClick:q,className:c.cssModeButton,showTooltip:!0}))),!N&&!P&&(0,e.createElement)(yd,{currentSelector:f,settings:r,styles:v,allStyles:y,onStyleChange:n,onNestedRuleChange:i,nestedRule:l,atRule:Y,filters:X,dispatchFilters:Q,scope:S,allowCustomAtRule:A,allowDevTools:O,onOpenCssEditor:U?q:void 0}),(0,e.createElement)("div",{className:c.legend},(0,e.createElement)("div",null,(0,e.createElement)("span",{className:g(c.dot,c.current),title:(0,a.__)("Local style","generateblocks-pro")}),(0,a.__)("Local","generateblocks-pro")),(0,e.createElement)("div",null,(0,e.createElement)("span",{className:g(c.dot,c.local),title:(0,a.__)("Inherited style","generateblocks-pro")}),(0,a.__)("Inherited","generateblocks-pro")),!!T.length&&(0,e.createElement)("div",null,(0,e.createElement)("span",{className:g(c.dot,c.global),title:(0,a.__)("Global style","generateblocks-pro")}),(0,a.__)("Global","generateblocks-pro")),ce.some((e=>"shorthand"===e.source))&&(0,e.createElement)("div",null,(0,e.createElement)("span",{className:g(c.dot,c.shorthand),title:(0,a.__)("CSS shorthand","generateblocks-pro")}),(0,a.__)("Shorthand","generateblocks-pro"))))))}function Jd(e){const t=e.replace(/^@media\s+/,"").trim(),r={mobile:375,tablet:768,laptop:1366,desktop:1920};if(r[t.toLowerCase()])return r[t.toLowerCase()];const n=t.match(/max-width:\s*(\d+)px/),o=t.match(/min-width:\s*(\d+)px/);let s=null,a=null;return n&&(s=parseInt(n[1])),o&&(a=parseInt(o[1])),s&&a?s-a<0?1200:Math.round((s+a)/2):s?s<320?375:s:a?a>1920?1920:a:1200}Fd();const ep={data:{},settings:{}},tp={setStyles:e=>({type:"SET_DATA",payload:e}),addStyle:(e,t,r,n)=>({type:"ADD_STYLE",payload:{property:e,value:t,atRule:r,nestedRule:n}}),updateKey:(e,t,r)=>({type:"UPDATE_KEY",payload:{oldKey:e,newKey:t,nestedRule:r}}),deleteStyle:(e,t)=>({type:"DELETE_STYLE",payload:{key:e,nestedRule:t}})},rp={getStyles:(e,t="",r="")=>Wa(e.data,t,r)};function np(e=ep,t){if("SET_DATA"===t.type)return Object.assign({},e,{data:t.payload});if("ADD_STYLE"===t.type){const{property:r,value:n,atRule:o,nestedRule:s}=t.payload;let{data:a}=e;return"object"==typeof r?Object.entries(r).forEach((([e,t])=>{a=Fa(a,e,t,o,s)})):Array.isArray(r)?r.forEach((e=>{a=Fa(a,e.property,e.value,o,s)})):a=Fa(e.data,r,n,o,s),{...e,data:a}}if("UPDATE_KEY"===t.type){const{oldKey:r,newKey:n,nestedRule:o}=t.payload,s=Va(e.data,r,n,o);return{...e,data:s}}if("DELETE_STYLE"===t.type){const{key:r,nestedRule:n}=t.payload,o=$a(e.data,r,n);return{...e,data:o}}return{...e}}const op="",sp={setNestedRule:e=>({type:"SET_DATA",payload:e})},ap={getNestedRule:e=>e};function lp(e=op,t){return"SET_DATA"===t.type?t.payload:e}const ip={data:{}},cp={setCurrentStyle:e=>({type:"SET_DATA",payload:e})},up={currentStyle:e=>e.data};function dp(e=ip,t){return"SET_DATA"===t.type?Object.assign({},e,{data:t.payload}):{...e}}const pp="",hp={setAtRule:e=>({type:"SET_DATA",payload:e})},fp={getAtRule:e=>e};function mp(e=pp,t){return"SET_DATA"===t.type?t.payload:e}const gp="",bp={setFilters:e=>({type:"SET_DATA",payload:e})},vp={getFilters:e=>e};function yp(e=gp,t){return"SET_DATA"===t.type?t.payload:e}})(),n})(),e.exports=t()}},t={},r=function r(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,r),s.exports}(7189);(window.gbp=window.gbp||{}).stylesBuilder=r})();