"),on=(vr(""),(e,t,r)=>t.indexOf(e[0])+1||r&&t.indexOf(e[r])+1),sn=/"(?:\\[^]|[^\\\n"])*"|'(?:\\[^]|[^\\\n'])*'/g,an=sn.source,ln={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}};ln[tr]=or.css={comment:/\/\*[^]*?\*\//,atrule:{pattern:RegExp(`@[\\w-](?:[^\\s;{"']|\\s+(?!\\s)|${an})*?(?:;|(?=\\s*\\{))`),inside:ln},url:{pattern:RegExp(`\\burl\\((?:${an}|(?:[^\\\\\n"')=]|\\\\[^])*)\\)`,"gi"),inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:/^["'][^]+/,alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^\\s{}](?:[^\\s{};"']|\\s+(?![\\s{])|${an})*(?=\\s*\\{)`),lookbehind:!0},string:sn,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 cn=or.css;cn.selector.inside=cn.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])})(cn,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 un=/\[]|\(\)|{}/,dn=/[([{][^)\]}]*$/,pn=([e,t],r)=>un.test(r[e-1]+r[t]),hn={line:"//",block:["/*","*/"]},fn=(e=hn,t=dn)=>({comments:e,autoIndent:[([e],r)=>t.test(Pr(r,e)),pn]});Er.css=fn({block:["/*","*/"]}),Er.less=Er.scss=fn(),Er.sass={comments:hn};var mn=r(9456);const gn=mn.all.filter((e=>!e.startsWith("-")&&!e.startsWith("--"))).sort(),bn={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"]},vn=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"]),yn=["transparent","currentColor","black","white","red","blue","green","yellow","orange","purple","pink","gray","grey"],wn=[":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"}))),kn=["::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 En(e){return String(e||"").replace(/([A-Z])/g,"-$1").toLowerCase()}function Sn(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 xn(e){return vn.has(En(e))}function Cn(e=""){const t=En(e);let r=bn[t]||[];return xn(t)&&(r=[...yn,...r]),function(e){return[...new Set(e.filter(Boolean))]}([...r,...N])}const An=[{label:"@media",icon:"keyword"},{label:"@supports",icon:"keyword"},{label:"@container",icon:"keyword"}],Rn=new Set(An.map((e=>e.label))),On=gn.map((function(e){return{label:e,icon:"property",insert:`${e}: ;`,tabStops:[e.length+2]}}));function Tn(e){return"string"==typeof e?e:""}function In(e,t){return Number.isFinite(e)?Math.max(0,Math.min(e,t.length)):0}function Pn(e,t){const r=e.slice(0,t).match(/[\w-]*$/);return t-(r?.[0].length||0)}function Mn(e,t){const r=e.slice(0,t).match(/@[\w-]*$/);return r?t-r[0].length:Pn(e,t)}var Dn;Dn={sources:[function(e,t){var r;return function(e,t){return!!e&&!!Dr(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=>Tn(e?.label).startsWith("@")))?e.filter((e=>Rn.has(e.label))):e}(e.options);if(0===o.length)return null;const s=Tn(t?.before),a=In(null!==(r=t?.pos)&&void 0!==r?r:s.length,s),l=In(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=Tn(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&&Tn(d[0]?.label).toLowerCase()===i?null:d.length?{...e,options:d}:null}(function(e){var t;const r=Tn(e?.before),n=In(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:On};if(l.startsWith("@"))return{from:Mn(r,n),options:An};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("::")?kn:wn}: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:Pn(r,n),options:Cn(e).map((e=>({label:e,icon:"enum"})))}}return{from:Math.max(i,Pn(r,n)),options:On}}(e),e)}]},["css"].forEach((e=>Xr[e]=Dn));const Nn=(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)(Tn(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=Tn(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=Sr(),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=sr(i=b.value,or[n]||{}),R("tokenize",d,n,i);let e=dr(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=kr(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 yr(b,"keydown",(e=>{_[e.key]?.(e,C(),i)&&xr(e)})),yr(b,"beforeinput",(e=>{(a||"insertText"==e.inputType&&A[e.data]?.(e,C(),i))&&xr(e)})),yr(b,"input",E),yr(b,"blur",(()=>{mr=null,c=!1,x()})),yr(b,"focus",(()=>{mr=O,c=!0,x()})),yr(b,"selectionchange",(e=>{O(),xr(e)})),wr(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&&!zr(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+rn((p<0?t:e)[0]),f=o-u.length+rn(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;Lr(r,l,n,o,g,a{f(t,t.map(e?e=>e.slice(rn(e)?l-rn(e)%l:0):e=>e&&a.repeat(l-rn(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=Er[Nr(r)]?.autoCloseTags?.(t,n,r);o&&(Lr(r,">"+o,null,null,t[0]+1),xr(e))},s.Tab=(e,[t,o],s)=>{if(en||n.readOnly||6&$r(e))return;const[a,l]=u(n),i=e.shiftKey,[c,p,h]=Mr(s,t,o);return t{const o=7&$r(e);if(!o||o==tn){o&&(t[0]=t[1]=Mr(n,t[1])[2]);const[e,s]=u(),[a,l]=t,i=Er[Nr(r)]?.autoIndent,c=Math.floor(rn(Pr(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 Lr(r,f,a,l,a+c+p+1),d()}},s.Backspace=(t,[o,s],a)=>{if(o==s){const t=Pr(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 Lr(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=$r(t);if(1==a){const t=e?n:_r(s,n)-1,a=e?s.indexOf("\n",o)+1:o;if(t>-1&&a>0){const[l,i,c]=Mr(s,t,a),u=l[e?"pop":"shift"](),d=(u.length+1)*(e?1:-1);l[e?"unshift":"push"](u),Lr(r,l.join("\n"),i,c,n+d,o+d)}return d()}if(9==a){const[t,a,l]=Mr(s,n,o),i=t.join("\n"),c=e?i.length+1:0;return Lr(r,i+"\n"+i,a,l,n+c,o+c),d()}if(2==a&&!jr)return i.scrollBy(0,Or(i,"lineHeight")*(e?1:-1)),!0};Rr(r,"keydown",(e=>{const t=$r(e),n=e.keyCode,[o,s,a]=l();if(t!=tn||221!=n&&219!=n){if(t==(jr?10:2)&&77==n)en=!en,xr(e);else if(191==n&&t==tn||65==n&&9==t){const n=r.value,a=9==t,l=a?o:_r(n,o),i=Er[Nr(r,l)]||{},{line:c,block:u}=i.getComments?.(r,l,n)||i.comments||{},[p,h,m]=Mr(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(Ir(t)+" ?$"),c=RegExp("^ ?"+Ir(a)).test(n.slice(s));i+1&&c?Lr(r,l,i,s+ +(" "==n[s])+a.length,i,i+s-o):Lr(r,`${t} ${l} ${a}`,o,s,o+t.length+1,s+t.length+1),d(),xr(e)}}else if(c){const t=Ir(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(),xr(e)}else if(u){const[t,n]=u,a=rn(p[0]),l=p[0].startsWith(t,a)&&p[g].endsWith(n),i=p.slice();i[0]=p[0].replace(l?RegExp(Ir(t)+" ?"):/(?=\S)|$/,l?"":t+" ");let c=i[0].length-p[0].length;i[g]=l?i[g].replace(RegExp(`( ?${Ir(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);Lr(r,f,h,m,v,Math.max(v,y)),d(),xr(e)}}else if(t==8+tn&&75==n){const t=r.value,[n,l,i]=Mr(t,o,s),c=a>"f"?s-i+n.pop().length:o-l,u=Ar(t,i+1)-i-1;Lr(r,"",l-!!l,i+!l,l+Math.min(c,u)),d(),xr(e)}}else m(219==n,...Mr(r.value,o,s),o,s,...u()),d(),xr(e)})),["copy","cut","paste"].forEach((e=>Rr(r,e,(t=>{const[n,s]=l();if(n==s&&c){const[[a],l,i]=Mr(r.value,n,s);"paste"==e?t.clipboardData.getData("text/plain")==o&&(Lr(r,o+"\n",l,l,n+o.length+1),d(),xr(t)):(c.writeText(o=a),"cut"==e&&(Lr(r,"",l,i+1),d()),xr(t))}}))))})(),(()=>{let e;const t=nn(),[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];Tr(r,Pr(o,l)),Tr(s,o.slice(l,Ar(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) + ${Fr&&!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,Rr(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=on(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=>Dr(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)));Rr(e,"focus",n),Rr(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=Yr(),R=Ur(),[O,T]=((e,t,r=!0)=>{const n=qr(),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||Wr(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-"+Zr++,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=Or(B[0],"height")},$=e=>{const t=a[e+d],[r,n,o]=B[e].children,s=t[4],l=s.icon||"variable";Gr(n,t[1],s.label),Tr(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"+Pr(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]),Lr(r,l,t,o,a[0],a[1]),i>2?(h||Wr(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,zr(r,h[f],h[f+1]),Z()},K=()=>{R.remove(),h=null},X=()=>{let e=[],t=0;for(;te[0]-t[0])),Gr(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=Or(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=Nr(r,u=h<"f"?s:c),m=Xr[f],g=r.extensions.cursor;if(g&&m&&(t||s==c)&&!n.readOnly){const n=r.value,s=Pr(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})),yr(C,"beforeinput",(t=>{let r=t.inputType,n="d"==r[0],l="insertText"==r,c=t.data;o&&l&&!Cr&&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&&!Cr||n&&o)}),!0),yr(C,"blur",(t=>{0==e.closeOnBlur||A.contains(t.relatedTarget)||F()})),yr(C,"keydown",(e=>{let t,r,n,s=e.key,a=$r(e);var c;2==a&&" "==s||a==(jr?4:2)&&"i"==s||jr&&!o&&1==a&&"Escape"==s?(o?J():ee(!0),xr(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),xr(e)})),yr(A,"focusout",(t=>{0!=e.closeOnBlur&&t.relatedTarget!=C&&F()})),yr(x,"scroll",(()=>{o&&Q()})),yr(M,"click",J),yr(M,"mousedown",xr),yr(D,"click",J),P.id=z+"d",D.remove(),P.remove(),r.extensions.autoComplete=t};return t.startQuery=t.insertCompletion=()=>{},t})({filter:Qr}),((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})),Rr(e,"beforeinput",(e=>{let t=e.data,l=e.inputType,p=e.timeStamp;/history/.test(l)?(h(c+("U"==l[7]?-1:1)),xr(e)):(a=r&&(n==l||p-s<99&&"Drop"==l.slice(-4))&&!Cr&&(" "!=t||o==t))||(d[c][2]=Cr||i()),u=!0,o=t,s=p,n=l})),Rr(e,"input",(()=>p(c+!a))),Rr(e,"keydown",(e=>{if(!g.readOnly){const t=$r(e),r=e.keyCode,n=t==tn+8&&90==r||!jr&&t==tn&&89==r;t==tn&&90==r?(h(c-1),xr(e)):n&&(h(c+1),xr(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(),Lr(e,Tn(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=Tn(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 Ln(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 zn(e){if(""!==e&&null!=e){if(Array.isArray(e)){const t=e.map(zn).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=zn(e[r]);return void 0!==n&&(t[r]=n),t}),{});return Object.keys(t).length>0?t:void 0}return String(e)}}function Bn(e){return JSON.stringify(zn(e)||{})}function jn(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 Fn(e){const t=e.message.replace(/\.$/,"");return null!==e.line?`${t} (line ${e.line})`:t}function Vn(e){if(1===e.length)return Fn(e[0])+" "+(0,a.__)("Fix or remove before applying.","generateblocks-pro");const t=e.slice(0,5).map(Fn),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 $n(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 Wn(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=jn(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=jn({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}=Qt(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($n(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:Vn(e),issues:e,invalidLines:e.map((e=>e.line)).filter((e=>null!==e))}}return 0===Jt(s)?{error:(0,a.__)("No valid CSS found.","generateblocks-pro")}:{validStyles:s,messages:[],invalidLines:[]}}function Un({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 Hn=(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=Ln(e));const o=(0,s.useRef)(null);null===o.current&&(o.current=Bn(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=Bn(t);h.current={key:r,buffer:e}}),[]),S=(0,s.useCallback)(((e,t)=>{const r=Bn(t),n=h.current;n&&n.key===r&&n.buffer===e&&(h.current=null)}),[]),x=(0,s.useCallback)(((e,t)=>{const r=Bn(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=Ln(e),s=Bn(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=Wn(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)(Un,{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)(Nn,{ref:R,autoFocus:u,value:V,onChange:oe,ariaLabel:he,className:c.cssEditorTextarea,readOnly:P}))))}));function qn({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)(Hn,{ref:n,...r,closeOnApply:t,autoFocus:!0,className:g(c.cssEditorModalBody,r.className)}))}function Gn(t){return(0,e.createElement)(qn,{...t})}const Zn=(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 Yn(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 Kn(){return Kn=Object.assign?Object.assign.bind():function(e){for(var t=1;t"object"==typeof e&&null!=e&&1===e.nodeType,eo=(e,t)=>(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e,to=(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,no=e=>{const t=e.parentElement;return null==t?e.getRootNode().host||null:t};var oo=function(){return oo=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=fo(l,t<0,r,n,o);return-1===i?e>=s?-1:e:i}function fo(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(!Jn(e))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,h=[];let f=e;for(;Jn(f)&&d(f);){if(f=no(f),f===p){h.push(f);break}null!=f&&f===document.body&&to(f)&&!to(document.documentElement)||null!=f&&to(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?ro(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:ro(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?ro(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:ro(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 _o(e,t,r){void 0===r&&(r=vo);var n=e["default"+Eo(t)];return void 0!==n?n:r[t]}function Ao(e,t,r){void 0===r&&(r=vo);var n=e[t];if(void 0!==n)return n;var o=e["initial"+Eo(t)];return void 0!==o?o:_o(e,t,r)}function Ro(e){var t=Ao(e,"selectedItem"),r=Ao(e,"isOpen"),n=function(e){var t=Ao(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}(e),o=Ao(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 Oo(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 To=function(){return ao};function Io(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);yo(e,l)}}),o),(0,e.useEffect)((function(){return function(){var e,t;yo.cancel(),(t=null==(e=l)?void 0:e.getElementById("a11y-status-message"))&&t.remove()}}),[l])}var Po=ao;function Mo(e,t,r){var n;return void 0===r&&(r=!0),Kn({isOpen:!1,highlightedIndex:-1},(null==(n=e.items)?void 0:n.length)&&t>=0&&Kn({selectedItem:e.items[t],isOpen:_o(e,"isOpen"),highlightedIndex:_o(e,"highlightedIndex")},r&&{inputValue:e.itemToString(e.items[t])}))}function Do(e,t){return e.isOpen===t.isOpen&&e.inputValue===t.inputValue&&e.highlightedIndex===t.highlightedIndex&&e.selectedItem===t.selectedItem}function No(e){var t=_o(e,"highlightedIndex");return t>-1&&e.isItemDisabled(e.items[t],t)?-1:t}var Lo=Kn({},{environment:Qn().shape({addEventListener:Qn().func.isRequired,removeEventListener:Qn().func.isRequired,document:Qn().shape({createElement:Qn().func.isRequired,getElementById:Qn().func.isRequired,activeElement:Qn().any.isRequired,body:Qn().any.isRequired}).isRequired,Node:Qn().func.isRequired}),itemToString:Qn().func,itemToKey:Qn().func,stateReducer:Qn().func},{getA11yStatusMessage:Qn().func,highlightedIndex:Qn().number,defaultHighlightedIndex:Qn().number,initialHighlightedIndex:Qn().number,isOpen:Qn().bool,defaultIsOpen:Qn().bool,initialIsOpen:Qn().bool,selectedItem:Qn().any,initialSelectedItem:Qn().any,defaultSelectedItem:Qn().any,id:Qn().string,labelId:Qn().string,menuId:Qn().string,getItemId:Qn().func,toggleButtonId:Qn().string,onSelectedItemChange:Qn().func,onHighlightedIndexChange:Qn().func,onStateChange:Qn().func,onIsOpenChange:Qn().func,scrollIntoView:Qn().func});oo(oo({},Lo),{items:Qn().array.isRequired,isItemDisabled:Qn().func});var zo=oo(oo({},Co),{isItemDisabled:function(){return!1}}),Bo=ao,jo=0,Fo=1,Vo=2,$o=3,Wo=4,Uo=5,Ho=6,qo=7,Go=8,Zo=9,Yo=10,Ko=11,Xo=12,Qo=13,Jo=14,es=15,ts=16,rs=17,ns=18,os=19,ss=20,as=21,ls=Object.freeze({__proto__:null,FunctionCloseMenu:rs,FunctionOpenMenu:ts,FunctionReset:as,FunctionSelectItem:os,FunctionSetHighlightedIndex:ns,FunctionSetInputValue:ss,FunctionToggleMenu:es,ItemClick:Jo,ItemMouseMove:Qo,MenuMouseLeave:Xo,ToggleButtonBlur:Ko,ToggleButtonClick:jo,ToggleButtonKeyDownArrowDown:Fo,ToggleButtonKeyDownArrowUp:Vo,ToggleButtonKeyDownCharacter:$o,ToggleButtonKeyDownEnd:Ho,ToggleButtonKeyDownEnter:qo,ToggleButtonKeyDownEscape:Wo,ToggleButtonKeyDownHome:Uo,ToggleButtonKeyDownPageDown:Yo,ToggleButtonKeyDownPageUp:Zo,ToggleButtonKeyDownSpaceButton:Go});function is(e,t){var r,n,o=t.type,s=t.props,a=t.altKey;switch(o){case Jo:n={isOpen:_o(s,"isOpen"),highlightedIndex:No(s),selectedItem:s.items[t.index]};break;case $o: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 os: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:Oo(s,e,0)};break;case r.FunctionOpenMenu:n={isOpen:!0,highlightedIndex:Oo(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:No(s),isOpen:_o(s,"isOpen"),selectedItem:_o(s,"selectedItem"),inputValue:_o(s,"inputValue")};break;default:throw new Error("Reducer called without proper action type.")}return Kn({},e,n)}(e,t,ls)}return Kn({},e,n)}var cs=["onClick"],us=["onMouseLeave","refKey","ref"],ds=["onBlur","onClick","onPress","onKeyDown","refKey","ref"],ps=["item","index","onMouseMove","onClick","onMouseDown","onPress","refKey","disabled","ref"];function hs(t){void 0===t&&(t={}),Bo(t,hs);var r=Kn({},zo,t),n=r.scrollIntoView,o=r.environment,s=r.getA11yStatusMessage,a=function(e,t,r,n){var o=xo(e,t,r,n),s=o[0],a=o[1];return[po(s,t),a]}(is,r,Ro,Do),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=ko(r),v=So({state:l,props:r}),y=(0,e.useCallback)((function(e){return m.current[b.getItemId(e)]}),[b]);Io(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 wo((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=io((function(e){e({type:ss,inputValue:""})}),500),function(){g.current.cancel()}}),[]),(0,e.useEffect)((function(){p&&g.current(i)}),[i,p]),Po({props:r,state:l}),(0,e.useEffect)((function(){Ao(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 ao;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,mo(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||mo(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:Ko})}),[i,v]),(0,e.useMemo)((function(){return[f,h]}),[f.current,h.current])),E=To("getMenuProps","getToggleButtonProps");(0,e.useEffect)((function(){c||(m.current={})}),[c]);var S=(0,e.useMemo)((function(){return{ArrowDown:function(e){e.preventDefault(),i({type:Fo,altKey:e.altKey})},ArrowUp:function(e){e.preventDefault(),i({type:Vo,altKey:e.altKey})},Home:function(e){e.preventDefault(),i({type:Uo})},End:function(e){e.preventDefault(),i({type:Ho})},Escape:function(){v.current.state.isOpen&&i({type:Wo})},Enter:function(e){e.preventDefault(),i({type:v.current.state.isOpen?qo:jo})},PageUp:function(e){v.current.state.isOpen&&(e.preventDefault(),i({type:Zo}))},PageDown:function(e){v.current.state.isOpen&&(e.preventDefault(),i({type:Yo}))}," ":function(e){e.preventDefault();var t=v.current.state;t.isOpen?t.inputValue?i({type:$o,key:" "}):i({type:Go}):i({type:jo})}}}),[i,v]),x=(0,e.useCallback)((function(){i({type:es})}),[i]),C=(0,e.useCallback)((function(){i({type:rs})}),[i]),_=(0,e.useCallback)((function(){i({type:ts})}),[i]),A=(0,e.useCallback)((function(e){i({type:ns,highlightedIndex:e})}),[i]),R=(0,e.useCallback)((function(e){i({type:os,selectedItem:e})}),[i]),O=(0,e.useCallback)((function(){i({type:as})}),[i]),T=(0,e.useCallback)((function(e){i({type:ss,inputValue:e})}),[i]),I=(0,e.useCallback)((function(e){var t=void 0===e?{}:e,r=t.onClick,n=Yn(t,cs);return Kn({id:b.labelId,htmlFor:b.toggleButtonId,onClick:co(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=Yn(n,us),u=(void 0===t?{}:t).suppressRefError;return E("getMenuProps",void 0!==u&&u,a,f),Kn(((r={})[a]=uo(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=co(o,(function(){i({type:Xo})})),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=Yn(n,ds),p=(void 0===t?{}:t).suppressRefError,f=void 0!==p&&p,m=v.current.state,g=Kn(((r={})[c]=uo(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=co(o,(function(){m.isOpen&&!k.isMouseDown&&i({type:Ko})})),r),d);return d.disabled||(g.onClick=co(s,(function(){i({type:jo})})),g.onKeyDown=co(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:$o,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=Yn(r,ps);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),_=Kn(((t={})[u]=uo(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=co(a,(function(){i({type:Jo,index:x})}))),_.onMouseMove=co(s,(function(){k.isTouchEnd||x===g.highlightedIndex||(w.current=!1,i({type:Qo,index:x,disabled:C}))})),_.onMouseDown=co(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}}hs.stateChangeTypes=ls,Kn({},Lo,{items:Qn().array.isRequired,isItemDisabled:Qn().func,inputValue:Qn().string,defaultInputValue:Qn().string,initialInputValue:Qn().string,inputId:Qn().string,onInputValueChange:Qn().func}),Kn({},Co,{isItemDisabled:function(){return!1}}),Qn().array,Qn().array,Qn().array,Qn().func,Qn().number,Qn().number,Qn().number,Qn().func,Qn().func,Qn().string,Qn().string;const fs=()=>(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"})),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 7h14v2H1z"})),gs=()=>(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"})),bs=()=>(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"})),vs=()=>(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"})),ys=()=>(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"})),ws=({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"}})),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",...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"})),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",...r},(0,e.createElement)("path",{d:"M14 22H2V10h12v12ZM3.999 12v8h8v-8h-8ZM22 22h-6V10h6v12Zm-4-10v8h2v-8h-2ZM22 8H2V2h20v6ZM4 4v2h16V4H4Z"})),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:"M7.95 22v-6.95H2v-2.1h5.95V5H6l3-3 3 3h-1.95v7.95H19V11l3 3-3 3v-1.95h-8.95V22h-2.1Z"})),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",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"})),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",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"})),_s=({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"}})),As=({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"})),Rs=({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"})),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",{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"})),Ts=({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"})),Is=({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"})),Ps=({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"})),Ms={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 Ds({item:t}){return(0,e.createElement)("span",null,t.label)}function Ns({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=Ds}){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}=hs(v),C=w({id:n,"aria-describedby":s&&n?`${n}__help`:void 0}),_="icon"===u;return(0,e.createElement)(o.BaseControl,{className:g(Ms.control,l),label:t,id:C.id,help:s},(0,e.createElement)("div",{className:Ms.header},t&&(0,e.createElement)("div",{...k({className:Ms.label})},t),(0,e.createElement)("button",{className:g(Ms.button,y&&Ms.open),...C},c?(0,e.createElement)(b,{item:c}):p,(0,e.createElement)("span",{className:Ms.icon},(0,e.createElement)(ws,{size:"12"})))),(0,e.createElement)("ul",{"aria-labelledby":h,"aria-label":f,className:g(Ms.dropdown,!y&&Ms.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&&Ms.highlighted,!_&&n&&Ms.selected,Ms.item,_&&Ms["has-icon"]),...x({item:t,index:r})},(0,e.createElement)(b,{item:t}),_&&n&&(0,e.createElement)(d,{icon:Zn,size:"18"}))}))))}const Ls=(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"})),zs=(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"})),Bs={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};var js,Fs=new Uint8Array(16);function Vs(){if(!js&&!(js="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 js(Fs)}for(var $s=[],Ws=0;Ws<256;++Ws)$s.push((Ws+256).toString(16).slice(1));const Us=function(e,t,r){if(Bs.randomUUID&&!t&&!e)return Bs.randomUUID();var n=(e=e||{}).random||(e.rng||Vs)();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($s[e[t+0]]+$s[e[t+1]]+$s[e[t+2]]+$s[e[t+3]]+"-"+$s[e[t+4]]+$s[e[t+5]]+"-"+$s[e[t+6]]+$s[e[t+7]]+"-"+$s[e[t+8]]+$s[e[t+9]]+"-"+$s[e[t+10]]+$s[e[t+11]]+$s[e[t+12]]+$s[e[t+13]]+$s[e[t+14]]+$s[e[t+15]]).toLowerCase()}(n)},Hs=(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"})),qs=window.wp.hooks,Gs=window.wp.blockEditor,Zs=window.wp.htmlEntities;var Ys=r(2895);const Ks=Ys;Ys.stringify,Ys.fromJSON,Ys.plugin,Ys.parse,Ys.list,Ys.document,Ys.comment,Ys.atRule,Ys.rule,Ys.decl,Ys.root,Ys.CssSyntaxError,Ys.Declaration,Ys.Container,Ys.Processor,Ys.Document,Ys.Comment,Ys.Warning,Ys.AtRule,Ys.Result,Ys.Input,Ys.Rule,Ys.Root,Ys.Node;var Xs=r(3268),Qs=r.n(Xs),Js=r(691),ea=r.n(Js),ta=r(7307),ra=r.n(ta);const na={a:"a:where(:not(.components-external-link))",button:"button:where(:not(.components-button))"};function oa(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 sa(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 aa=e=>/^([-]?\d|[-]?\.)/.test(e);function la(e){var t;return e?(null!==(t=generateBlocksEditor?.wpContentUrl)&&void 0!==t?t:location.origin+"/wp-content")+e:""}function ia(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 ca(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}const ua=/(?:#(?:[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,da=/(linear-gradient|radial-gradient)\([^)]*\)(?:\s*\d+%?,\s*(?:rgba?\([^)]*\)|#[0-9a-fA-F]+)\s*\d*%?)+\s*\)|url\([^)]*\)[^,)]*/g;function pa(e=""){const t=la("/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 ha(){const e="rgba(0, 0, 0, .25)",t=`linear-gradient(to right, ${e} 0%, ${e} 100%)`;return{...pa(),type:"overlay",backgroundBlendMode:"normal",backgroundImage:t,overlayColor:e}}function fa(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=Ma(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=Da({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(Ks.decl({prop:"background",value:ia(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 ga=/(!?\(\s*min(-device)?-width)(.|\n)+\(\s*max(-device)?-width|\(\s*width\s*>(=)?(.|\n)+\(\s*width\s*<(=)?|(!?\(.*<(=)?\s*width\s*<(=)?)/i,ba=/(!?\(\s*max(-device)?-width)(.|\n)+\(\s*min(-device)?-width|\(\s*width\s*<(=)?(.|\n)+\(\s*width\s*>(=)?|(!?\(.*>(=)?\s*width\s*>(=)?)/i,va=Ra(ga,ba,/\(\s*min(-device)?-width|\(\s*width\s*>(=)?/i),ya=Ra(ba,ga,/\(\s*max(-device)?-width|\(\s*width\s*<(=)?/i),wa=/(!?\(\s*min(-device)?-height)(.|\n)+\(\s*max(-device)?-height|\(\s*height\s*>(=)?(.|\n)+\(\s*height\s*<(=)?|(!?\(.*<(=)?\s*height\s*<(=)?)/i,ka=/(!?\(\s*max(-device)?-height)(.|\n)+\(\s*min(-device)?-height|\(\s*height\s*<(=)?(.|\n)+\(\s*height\s*>(=)?|(!?\(.*>(=)?\s*height\s*>(=)?)/i,Ea=Ra(wa,ka,/\(\s*min(-device)?-height|\(\s*height\s*>(=)?/i),Sa=Ra(ka,wa,/\(\s*max(-device)?-height|\(\s*height\s*<(=)?/i),xa=/print/i,Ca=/^print$/i,_a=Number.MAX_VALUE;function Aa(e){let t=/(-?\d*\.?\d+)(ch|em|ex|px|rem)/.exec(e);if(null===t&&(va(e)||Ea(e))&&(t=/(\d)/.exec(e)),"0"===t)return 0;if(null===t)return _a;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 Ra(e,t,r){return function(n){return!!e.test(n)||!t.test(n)&&r.test(n)}}const Oa=!0;function Ta(e,t){const r=function(e,t){const r=xa.test(e),n=Ca.test(e),o=xa.test(t),s=Ca.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=va(e)||Ea(e),o=ya(e)||Sa(e),s=va(t)||Ea(t),a=ya(t)||Sa(t);if(Oa&&(!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=Aa(e),i=Aa(t);return l===_a&&i===_a?e.localeCompare(t):l===_a?1:i===_a?-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(Ta).forEach((e=>{t.append(n[e])}))}}}function Pa(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 Ma(e){return v(e)}function Da({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=Ma(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 Na(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 Va||"object"!=typeof r||null===r||Array.isArray(r)||r instanceof Va);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 La(e){return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()}function za(e,t,r){e+=`${t} {`;const n=r&&"object"==typeof r?Object.entries(r):[];for(let[t,r]of n)"settings"!==t&&(t=La(t),C(t)&&null!=r&&(e+=`${t}:${Pa(r.toString())};`));return e+"}"}function Ba(e,t=""){const r=(0,Zs.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 ja(e,t,r="frontend"){var n;const o=(0,qs.applyFilters)("generateStylesBuilder.rawCss",function(e,t){if(!e)return"";let r="";if((t=Na(t)).propertyRules&&Object.keys(t.propertyRules).length>0&&(r=za(r,Ba(e),t.propertyRules)),t.nestedRules&&Object.keys(t.nestedRules).length>0)for(const n in t.nestedRules)r=za(r,Ba(e,n),t.nestedRules[n]);if(t.atRules&&Object.keys(t.atRules).length>0)for(const n in t.atRules){const o=Na(t.atRules[n]);if(r+=`${n} {`,o.propertyRules&&Object.keys(o.propertyRules).length>0&&(r=za(r,e,o.propertyRules)),o.nestedRules&&Object.keys(o.nestedRules).length>0)for(const t in o.nestedRules)r=za(r,Ba(e,t),o.nestedRules[t]);r+="}"}return r}(e,t)),s=[{css:o}],a="editor"===r?(0,Gs.transformStyles)(s,".editor-styles-wrapper")?.[0]:o;let l=[{postcssPlugin:"gb-editor-transforms",Rule(e){let t=e.selector;Object.keys(na).forEach((e=>{const r=new RegExp(`(^|\\s|>|\\+|~)(${e})(\\s|$|>|\\+|~)(?!:where)`,"g");t=t.replace(r,`$1${na[e]}$3`)})),e.selector=t}},ra()({"properties-order":"alphabetical"})];"frontend"===r&&(l=[Qs()(),ra()({"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=oa(n);i&&(r.push(oa(n)),l.top=!0);const c=oa(o);c&&(r.push(oa(o)),l.right=!0);const u=oa(s);u&&(r.push(oa(s)),l.bottom=!0);const d=oa(a);d&&(r.push(oa(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=sa(n);e.append({prop:"margin",value:t}),n.forEach((e=>e.remove()))}if(4===o.length){const t=sa(o);e.append({prop:"padding",value:t}),o.forEach((e=>e.remove()))}})),e.rawCache={beforeDecl:"",beforeRule:"",colon:":",indent:"",after:"",semicolon:!0}}},ma(),Ia(),ea()()]);const i=await Ks(l).process(a,{from:void 0}).catch((e=>{console.error(e.message)}));return null!==(n=i?.css)&&void 0!==n?n:a}function Fa(e){return"object"!=typeof e||null===e?{}:Object.entries(e).reduce(((e,[t,r])=>{if(r instanceof Va)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=Fa(r);Object.keys(n).length>0&&(e[t]=n)}return e}),{})}class Va{constructor({value:e,settings:t=[]}){this.value=e,this.settings=t}toString(){return this.value}}function $a(e,t,r,n,o){let s={};const a="object"==typeof r&&null!==r?new Va(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 Fa(s)}function Wa(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 Ua(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 Ha(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 qa(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 Ga({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",(()=>Ga({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=qa(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 Za({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=Ga({element:e,properties:i,computedStyles:r,deviceAttributes:n,atRule:o,nestedRule:s,sources:a});return l?c[t]:c}));const c=Ga({element:e,properties:i,computedStyles:r,deviceAttributes:n,atRule:o,nestedRule:s,sources:a});return l?c[t]:c}const Ya={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)"},Ka=(0,qs.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:Ya.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:Ya.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:Ya.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:Ya.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:Ya.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 Xa(e="object"){return"object"===e?Ka.reduce(((e,t)=>(e[t.id]=t,e)),{}):Ka}function Qa(e){const t=Ka.find((t=>t.id===e)),r=Ya[e];return t?.value||r}const Ja=["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"],el=["width","height","minWidth","minHeight","maxWidth","maxHeight","aspectRatio"],tl=["paddingTop","paddingRight","paddingBottom","paddingLeft","marginTop","marginRight","marginBottom","marginLeft"],rl=["borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],nl=["color","fontSize","fontWeight","fontStyle","textAlign","textTransform","textDecoration","lineHeight","letterSpacing","fontFamily","whiteSpace","textWrap"],ol=["background","backgroundColor","backgroundClip","backgroundOrigin","backgroundBlendMode","backgroundAttachment","backgroundImage","backgroundPosition","backgroundSize","backgroundRepeat"],sl=["position","overflowX","overflowY","zIndex","top","right","bottom","left"],al=["backdropFilter","boxShadow","filter","mixBlendMode","opacity","transform","transformOrigin","transition","visibility","textShadow"],ll=["objectFit","objectPosition"],il=["listStyleType","listStyleImage","listStylePosition"],cl=["content","pointerEvents","fill","stroke","cursor"],ul=[...Ja,...el,...tl,...rl,...nl,...ol,...sl,...al,...ll,...il,...cl],dl=window.wp.editPost,pl={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"},hl=(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 fl({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(pl.rules,p&&pl.indent)},t.map((({property:t,valueRaw:p,source:g,atRule:v,selector:y})=>(0,e.createElement)("div",{key:t,className:pl.rule,tabIndex:"0"},(0,e.createElement)("span",{"data-property":t},La(t)),": ",(0,e.createElement)("span",{"data-value":!0},p),";",u&&(0,e.createElement)(o.Button,{className:pl.button,variant:"link",label:(0,a.__)("Go to style source","generateblocks-pro"),showTooltip:!0,size:"small",iconSize:"18",icon:hl,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:pl.group,"data-at-rule-declaration":!0},(0,e.createElement)("div",{"data-at-rule":y},y," ","{"),(0,e.createElement)("div",{className:pl.indent},(0,e.createElement)("span",{"data-selector":!0},k())," ",(0,e.createElement)("span",{"data-bracket":"open"},"{")),w,(0,e.createElement)("div",{className:pl.indent,"data-bracket":"close"},"}"),(0,e.createElement)("div",{"data-bracket":"close"},"}")):(0,e.createElement)("div",{"data-declaration":!0,className:pl.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 ml({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)(dl.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(pl.popover,pl[r]),contentClassName:pl.popoverContent,renderToggle:({onToggle:t})=>(0,e.createElement)(o.Button,{className:g(pl.dot,pl[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:pl.close,onClick:t}),(0,e.createElement)("div",{className:pl.css},Object.values(b).map(((r,n)=>(0,e.createElement)(fl,{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 gl=(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:pl.options},d,p&&(0,e.createElement)(o.DropdownMenu,{className:pl.dropdown,icon:i,label:(0,a.__)("More options","generateblocks-pro"),controls:t,popoverProps:{className:pl.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?Zn:""},(0,a.__)("Enter Custom Value","generateblocks-pro"))),c&&u&&(0,e.createElement)(o.MenuGroup,null,(0,e.createElement)(o.MenuItem,{icon:zs,iconSize:10,onClick:()=>{window.open(c,"_blank"),t()}},u))))))})),bl={control:"Y_SZocKPG8xUe9IfpF4w",multiRow:"lPEoVnH96M3UNpOX8P6E",button:"cPJ3wQ9eQxECE0Z1y_mg",fallback:"gzcUop1fr5T1KjhxdpZX"};function vl({buttons:t,value:r,placeholder:n="",onChange:s,className:a,multiRow:l}){return(0,e.createElement)(o.ButtonGroup,{className:g("gb-button-icon-control",bl.control,a,l&&bl.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(bl.button,!r&&n===t.value&&bl.fallback)},t.icon?t.icon:t.label))))}const yl=["label","hideLabelFromVision","value","help","id","className","onChange","type"],wl=(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-${Us()}`,V=n||`control-${Us()}`,[$,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=Pa(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:pl.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=>{yl.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===vl){const{buttons:e=[]}=ee;oe.push(...e.map((e=>e.value)))}if(oe=Array.from(new Set([...oe,...oe.map((e=>La(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,qs.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",pl.control,!i&&pl.inline,ie?"visible":"hidden",_),id:te?V:F,ref:Q,style:h},i&&(0,e.createElement)("div",{className:g("gb-styles-builder-control__header",pl.header)},(0,e.createElement)("div",{className:g(pl.labelWrap,"gb-styles-builder-control__header--label")},(0,e.createElement)("label",{...re}," ",i),m,j.length>0&&(0,e.createElement)("div",{className:pl.indicatorDots},j.map((t=>(0,e.createElement)(ml,{key:t,controlInheritedSources:D,matchType:t}))))),(0,e.createElement)(gl,{...ce})),!l&&U&&(0,e.createElement)(U,{...ae}),l,!i&&(0,e.createElement)(gl,{...ce}))}));wl.Description=function({label:t,children:r,onClick:n}){return r&&(0,e.createElement)(o.MenuGroup,{label:t},(0,e.createElement)("div",{className:pl.description},r,n&&(0,e.createElement)(o.Button,{className:pl.close,variant:"none",onClick:n,label:(0,a.__)("Close","generateblocks-pro"),icon:Hs})))};const kl={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 El({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-${Us()}`;return(0,e.createElement)(wl,{label:r,beforeDropdownMenu:(0,e.createElement)("div",{className:kl.icons},u?(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.Button,{variant:"primary",size:"small",icon:Zn,onClick:i,label:(0,a.__)("Done","generateblocks-pro"),showTooltip:!0}),(0,e.createElement)(o.Button,{variant:"tertiary",size:"small",isDestructive:!0,icon:Ls,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 ${kl.control}`,dropdownControls:n,dropdownChildren:s,popoverProps:{className:kl["dropdown-popover"]},searchKeywords:f,cssProp:p,value:g.length>0?g.length:""},(0,e.createElement)("div",{className:kl.body,style:{display:g.length>0?"block":"none"}},t))}function Sl({children:t}){return(0,e.createElement)(b.Stack,{className:kl.edit,gap:"12px","data-component":"EffectEdit"},t)}El.LearnMore=({learnMoreLabel:t,learnMoreURL:r,onClose:n})=>t&&r&&(0,e.createElement)(o.MenuGroup,null,(0,e.createElement)(o.MenuItem,{icon:zs,iconSize:10,onClick:()=>{window.open(r,"_blank"),n()}},t)),El.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:kl["dropdown-content"]},r,(0,e.createElement)("div",{className:kl["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:Ls,onClick:()=>{s.length>0&&l(!0)},className:g(0===s.length&&kl["is-disabled"]),tabIndex:s.length>0?0:-1},t)))},El.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:kl["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:kl["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:kl["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 xl=(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"})),Cl=(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"})),_l=(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"})),Al=(0,s.forwardRef)((({items:t,className:r,...n},o)=>(0,e.createElement)(b.SortableList,{...n,items:t,className:g("gb-effect-list",kl.list,r),ref:o})));Al.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 ${kl.item}`},c&&(0,e.createElement)("div",{className:kl["swatch-wrapper"]},(0,e.createElement)("div",{className:kl.swatch},(0,e.createElement)("div",{className:kl.circle,style:{backgroundColor:c}}))),(0,e.createElement)("div",{title:l,className:kl.css,style:t?{opacity:"0.4"}:{}},(0,e.createElement)("span",null,i.length?i:l)),(0,e.createElement)("div",{className:kl.options},u&&(0,e.createElement)(o.Button,{label:(0,a.__)("Duplicate","generateblocks-pro"),showTooltip:!0,variant:"tertiary",size:"small",icon:xl,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?Cl:_l,onClick:n}),p&&(0,e.createElement)(o.Button,{label:(0,a.__)("Edit","generateblocks-pro"),showTooltip:!0,variant:"tertiary",size:"small",icon:hl,onClick:s})))};const Rl=(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"})),Ol=(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"})),Tl={alignItems:"zaM5rUtG4Gg27nF90BH7",flexColumn:"A0HlCF3cLZLW0qHXcnXD",justifyContent:"fbzKTZ2t8ssUGTMSe0BP",flexReverse:"oq1EmoOocVOgcqOGcter",buttonGroup:"eZDoLX5oqxWC87AGQe7d",isInherited:"zOPpqELSb9VPv1nRyOs2",presets:"Ux91JIyGwAvlSfU5cGA1",presetButton:"yahMeNjMMJdPa8RXL84s",preview:"o4WseA5e5RYL8wKL5tuq",gridTemplateColumns:"I3Y2fphQELks0YSnM2u2"},Il=[{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 Pl({value:t,onChange:r,flexDirection:n}){const o=(0,s.useMemo)((()=>Il.every((e=>e.value!==t))),[t]);return(0,e.createElement)(wl,{as:vl,allowCustomValue:!0,hasCustomValue:o,label:"Align Items",id:"gblocks-align-items",value:t,onChange:r,buttons:Il,cssProp:"alignItems",className:g(Tl.alignItems,n.includes("column")&&Tl.flexColumn,n.includes("reverse")&&Tl.flexReverse),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/align-items"})}function Ml({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)(wl,{as:vl,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 Dl=[{label:"No Wrap",value:"nowrap"},{label:"Wrap",value:"wrap"},{label:"Reverse Wrap",value:"wrap-reverse"}];function Nl({value:t,onChange:r}){const n=(0,s.useMemo)((()=>Dl.every((e=>e.value!==t))),[t]);return(0,e.createElement)(wl,{as:vl,allowCustomValue:!0,hasCustomValue:n,label:"Flex Wrap",id:"gblocks-flex-wrap",value:t,onChange:r,buttons:Dl,cssProp:"flexWrap",learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap"})}function Ll({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:Tl.presets},Object.keys(n).map((s=>(0,e.createElement)(o.Button,{label:s,showTooltip:!0,key:`layout-${s}`,className:Tl.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:Tl.preview})))))))}function zl({value:t,onChange:r,onShortcutChange:n}){const[l,i]=(0,s.useState)(!1);return(0,e.createElement)(wl,{label:"Grid Template Columns",id:"grid-template-columns",value:t,cssProp:"gridTemplateColumns"},(0,e.createElement)("div",{className:Tl.gridTemplateColumns},(0,e.createElement)(wl,{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)(Ll,{value:t,onClick:n}))}const Bl=[{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 jl({value:t,onChange:r,flexDirection:n}){const o=(0,s.useMemo)((()=>Bl.every((e=>e.value!==t))),[t]);return(0,e.createElement)(wl,{as:vl,allowCustomValue:!0,hasCustomValue:o,label:"Justify Content",id:"gblocks-justify-content",value:t,onChange:r,buttons:Bl,cssProp:"justifyContent",className:g(Tl.justifyContent,n.includes("column")&&Tl.flexColumn,n.includes("reverse")&&Tl.flexReverse),learnMoreUrl:"https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content"})}const Fl=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)},Vl={wrapper:"Tamw_DXL_RTGVdO76M6G",action:"PJ04dXqqfciw2I8gsIhV",overrideAction:"ihQLlqhvkEDznp554jxD",units:"YCW8afC5xbRDyhRcSfWa",popover:"C1sMRQWzWYZKO76qnDPm",disabled:"h9LfZfsyqxzX_NERwneg"};function $l({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:Vl.units,label:(0,a.__)("Select a unit","generateblocks-pro"),icon:null,toggleProps:{children:t||String.fromCharCode(8212),disabled:s},popoverProps:{className:Vl.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 Wl=["px","em","%","rem","vw","vh","ch"],Ul=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 Hl(e,t=""){var r,n;if(""===e)return{value:"",unit:t};if(0===e||"0"===e)return{value:"0",unit:""};if(!aa(e)&&"-"!==e)return{value:e,unit:"none"};const o=e?e.toString().toLowerCase().split(Ul).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 ql(t){var r,n;const{label:a,units:l=Wl,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)((()=>Hl(E,C)),[E,C]),R=(0,s.useMemo)((()=>E?{value:"",unit:""}:Hl(S,C)),[E,S,C]),[O,T]=(0,s.useState)(_),[I,P]=(0,s.useState)(E?A:Hl(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=""}=Hl(e.toString());if(T(t),""===t){if(k(""),S&&""!==S){const{unit:e}=Hl(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=""}=Hl(E,C);O!==e&&T(e),E&&I!==t&&P(t)}),[E]),Fl((()=>{if(E||!S)return;const{unit:e}=Hl(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&&Vl.disabled),__nextHasNoMarginBottom:!0},(0,e.createElement)("div",{className:Vl.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:Vl.action},!!y&&(0,e.createElement)("div",{className:Vl.overrideAction},y(L)),"none"!==I&&(0,e.createElement)($l,{value:I,disabled:h||1===l.length||""===O,units:l,onChange:z}))))}ql.defaultUnits=Wl;const Gl=(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"})),Zl=(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"})),Yl={details:"wVjjTdvPGdIxqFn48zqu",summary:"anUKSZGKh4woAlhsgmuk",filtersActive:"HCu7v87YZzvnN5U_sc3M",summaryIcon:"NEmU6LKIKPKNuZq1AV_p",separator:"LexWJoT7vrxJHuvbI0am"},Kl={panel:"lEDHzMIb7xESVsaytp_g",filtersActive:"w3DBngPVzz7jHmCpYBYw",indicatorDots:"eVjspRaQMttxMSEfv1zL",dot:"rHGAMvaQEoXJwEgnbftW",local:"YoOSOFEcl_kcJ1aUlh_V",current:"CjZXBdTpVNPRTOG0JPDg",shorthand:"uZIXuc4X0PxLVuHuYa_w"};function Xl({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:Kl.indicatorDots},!!i&&(0,e.createElement)("div",{title:(0,a.__)("Has local styles","generateblocks-pro"),className:g(Kl.dot,Kl.current)}),!!l&&(0,e.createElement)("div",{title:(0,a.__)("Has inherited local styles","generateblocks-pro"),className:g(Kl.dot,Kl.local)}),!!s&&(0,e.createElement)("div",{title:(0,a.__)("Has inherited global styles","generateblocks-pro"),className:Kl.dot}),!!c&&(0,e.createElement)("div",{title:(0,a.__)("Value from CSS shorthand","generateblocks-pro"),className:g(Kl.dot,Kl.shorthand)})):null}function Ql({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(Kl.panel,(t||o)&&Kl.filtersActive,Kl[`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 Jl({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",Yl.details,(i||c)&&Yl.filtersActive),open:h,onToggle:()=>{if(n){const e=p.current?.hasAttribute("open");n(e)}}},(0,e.createElement)("summary",{className:Yl.summary},r,(0,e.createElement)(o.VisuallyHidden,null,(0,a.__)("style controls","generateblocks-pro")),!!u.length>0&&(0,e.createElement)(Xl,{cssProps:u}),(0,e.createElement)("div",{className:Yl.summaryIcon},(0,e.createElement)(d,{icon:l?Gl:Zl,size:"18"}))),!!h&&(0,e.createElement)(b.Stack,{gap:"10px",className:g(Yl.children,"gb-styles-builder-panel__content")},t))}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)(wl,{as:vl,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 ti({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)(wl,{as:vl,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 ri({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)(wl,{as:vl,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 ni=[{label:"inherit",value:"inherit"},{label:"initial",value:"initial"},{label:"revert",value:"revert"},{label:"revert-layer",value:"revert-layer"},{label:"unset",value:"unset"}],oi=(e=[],t={})=>{const{exclude:r=[],includeSeparator:n=!0}=t,o=ni.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},si="gbp-panel-state-layout";function ai(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(si),[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:si});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)(Es,{size:"20"}),(0,e.createElement)(Xl,{cssProps:Ja})),scrollAfterOpen:u,onToggle:d},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(wl,{as:o.SelectControl,allowCustomValue:!0,label:"Display",value:y,options:oi([{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)(Jl,{title:"Alignment",onClick:e=>H("alignment",e),open:W.alignment,filtersActive:l,search:i,cssProps:["alignItems","justifyContent","justifyItems","justifySelf","alignSelf"]},(0,e.createElement)(Pl,{flexDirection:k,value:f,onChange:e=>n("alignItems",e)}),(0,e.createElement)(jl,{flexDirection:k,value:D,onChange:e=>n("justifyContent",e)}),(0,e.createElement)(ei,{value:j,onChange:e=>n("justifyItems",e)}),(0,e.createElement)(ti,{value:F,onChange:e=>n("justifySelf",e)}),(0,e.createElement)(ri,{value:V,onChange:e=>n("alignSelf",e)})),(0,e.createElement)(Jl,{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)(zl,{value:P,onShortcutChange:e=>{n("gridTemplateColumns",e!==P?e:"")},onChange:e=>{n("gridTemplateColumns",e)}}),(0,e.createElement)(wl,{as:o.TextControl,label:"Grid Template Rows",value:M,onChange:e=>n("gridTemplateRows",e),cssProp:"gridTemplateRows"}),(0,e.createElement)(wl,{as:o.TextareaControl,label:"Grid Template Areas",value:R,onChange:e=>n("gridTemplateAreas",e),cssProp:"gridTemplateAreas",rows:3}),(0,e.createElement)(wl,{as:o.TextControl,label:"Grid Auto Columns",id:"gblocks-grid-auto-columns",value:_,onChange:e=>n("gridAutoColumns",e),cssProp:"gridAutoColumns"}),(0,e.createElement)(wl,{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)(wl,{as:ql,label:"Column Gap",id:"gblocks-column-gap",value:m,onChange:e=>n("columnGap",e),cssProp:"columnGap"}),(0,e.createElement)(wl,{as:ql,label:"Row Gap",id:"gblocks-row-gap",value:L,onChange:e=>n("rowGap",e),cssProp:"rowGap"})),(0,e.createElement)(wl,{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)(wl,{as:o.TextControl,label:"Grid Column",id:"gblocks-grid-column",value:O,onChange:e=>n("gridColumn",e),cssProp:"gridColumn"}),(0,e.createElement)(wl,{as:o.TextControl,label:"Grid Row",id:"gblocks-grid-row",value:T,onChange:e=>n("gridRow",e),cssProp:"gridRow"})),(0,e.createElement)(wl,{as:o.TextControl,label:"Grid Area",value:I,onChange:e=>n("gridArea",e),cssProp:"gridArea"}),(0,e.createElement)(wl,{as:ql,value:N,cssProp:"order",units:[],onChange:e=>n("order",e),label:(0,a.__)("Order","generateblocks-pro")})),(0,e.createElement)(Jl,{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)(Ml,{value:k,onChange:e=>{n("flexDirection",e!==k?e:"")}}),(0,e.createElement)(Nl,{value:x,onChange:e=>n("flexWrap",e!==x?e:"")}),(0,e.createElement)(o.Flex,null,(0,e.createElement)(wl,{as:ql,label:"Column Gap",id:"gblocks-column-gap",value:m,onChange:e=>n("columnGap",e),cssProp:"columnGap"}),(0,e.createElement)(wl,{as:ql,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)(wl,{as:o.TextControl,label:"Flex Grow",id:"gblocks-flex-grow",value:E,onChange:e=>n("flexGrow",e),cssProp:"flexGrow"}),(0,e.createElement)(wl,{as:o.TextControl,label:"Flex Shrink",id:"gblocks-flex-shrink",value:S,onChange:e=>n("flexShrink",e),cssProp:"flexShrink"})),(0,e.createElement)(wl,{as:ql,label:"Flex Basis",id:"gblocks-flex-basis",value:w,onChange:e=>n("flexBasis",e),cssProp:"flexBasis"}),(0,e.createElement)(wl,{as:ql,value:N,cssProp:"order",units:[],onChange:e=>n("order",e),label:(0,a.__)("Order","generateblocks-pro")})),!!h&&(0,e.createElement)(Jl,{title:"Container Queries",onClick:e=>H("containerQueries",e),open:W.containerQueries,filtersActive:l,search:i,cssProps:["containerType","containerName"]},(0,e.createElement)(wl,{as:o.SelectControl,allowCustomValue:!0,label:"Container Type",value:v,options:oi([{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)(wl,{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)(Jl,{title:"Floats",onClick:e=>H("floats",e),open:W.floats,filtersActive:l,search:i,cssProps:["float","clear"]},(0,e.createElement)(wl,{as:o.SelectControl,allowCustomValue:!0,label:"Float",value:z,options:oi([{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)(wl,{as:o.SelectControl,allowCustomValue:!0,label:"Clear",value:B,options:oi([{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 li={panel:"sqnVycrGODNTfAhpXG3l",filtersActive:"X4NnPSZdu27R6QVtzp3w"};function ii(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)(Ss,{size:"20"}),(0,e.createElement)(Xl,{cssProps:el})),opened:!!s||void 0,scrollAfterOpen:l,className:g(li.panel,(c||i)&&li.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)(wl,{as:ql,label:"Width",id:"width",value:p,onChange:e=>n("width",e),cssProp:"width"}),(0,e.createElement)(wl,{as:ql,label:"Height",id:"height",value:h,onChange:e=>n("height",e),cssProp:"height"}),(0,e.createElement)(wl,{as:ql,label:"Min Width",id:"min-width",value:f,onChange:e=>n("minWidth",e),cssProp:"minWidth"}),(0,e.createElement)(wl,{as:ql,label:"Min Height",id:"min-height",value:m,onChange:e=>n("minHeight",e),cssProp:"minHeight"}),(0,e.createElement)(wl,{as:ql,label:"Max Width",id:"max-width",value:v,onChange:e=>n("maxWidth",e),cssProp:"maxWidth"}),(0,e.createElement)(wl,{as:ql,label:"Max Height",id:"max-height",value:y,onChange:e=>n("maxHeight",e),cssProp:"maxHeight"})),(0,e.createElement)(wl,{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 ci=(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"})),ui=(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"})),di={component:"JMPhp6ekKLmvoGwaZcBa"};function pi({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:di.component},i&&(0,e.createElement)(o.Button,{icon:ci,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:ui,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 hi={control:"DuwdPu36nb6NATzhJc6f",inputs:"wrpRndoV9gQREMmp3iiA",circle:"eoeSswtzaSZXfVpWHYcT",syncActive:"veC012SPNrfZ2Bl2RxxQ",top:"tNxOxbjvZGNTCB3YYva1",left:"n5GwnP76u50n8vJpQjw2",right:"JNulxcMTfF9gRfsZwl8P",bottom:"M43bIBDvJYieaNVas_Jr",label:"AhEl_6LWT09RnxcGVg1L",syncItems:"oPjMLifBYlwA2yq0LCm3"};function fi(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 mi(e){return Object.values(e).reduce(((e,{prop:t,value:r})=>(e[t]=r,e)),{})}function gi(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 bi(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?fi(v.map((e=>e[1].value))):""),[v,d]),w=(0,s.useMemo)((()=>m&&"axis"===d?gi(v,["top","bottom"]):""),[v,m,d]),k=(0,s.useMemo)((()=>m&&"axis"===d?gi(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=mi(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)(wl,{id:n,value:Object.values(E).filter(Boolean).join(","),searchKeywords:Object.keys(i),cssProp:S,className:g(hi.control),label:l,beforeDropdownMenu:(0,e.createElement)(pi,{sync:d,setSync:p,syncTypes:u,onClick:e=>{if("axis"===e){const e=gi(v,["top","bottom"]),t=gi(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=mi(n);r(o)}if("all"===e){const e=fi(v.map((e=>e[1].value)));if(!e)return;const t={...i};for(const r in t)t[r].value=e;const n=mi(t);r(n)}}})},(0,e.createElement)("div",{className:g(hi.inputs,hi[c],d&&hi.syncActive)},"all"===d&&(0,e.createElement)(wl,{as:ql,id:`${n}-all-control`,value:y,units:o,onChange:e=>{const t={...i};for(const r in t)t[r].value=e;const n=mi(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)(wl,{as:ql,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=mi(t);r(n)},onFocus:()=>f(`${n}-vertical-control`),cssProp:x,searchKeywords:[l]}),(0,e.createElement)(wl,{as:ql,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=mi(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)(wl,{key:a,className:g(hi[i]),as:ql,id:a,value:n,units:o,onChange:e=>{r({[s]:e})},onFocus:()=>f(a),label:t[0],cssProp:s,searchKeywords:[l]})}))))}function vi(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)(xs,{size:"20"}),(0,e.createElement)(Xl,{cssProps:tl})),opened:!!l||void 0,scrollAfterOpen:i,onToggle:c},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(bi,{id:"padding",label:"Padding",cssProps:w,onChange:n}),(0,e.createElement)(bi,{id:"margin",label:"Margin",cssProps:k,onChange:n})))}var yi={grad:.9,turn:360,rad:360/(2*Math.PI)},wi=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},ki=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r+0},Ei=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=1),e>r?r:e>t?e:t},Si=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},xi=function(e){return{r:Ei(e.r,0,255),g:Ei(e.g,0,255),b:Ei(e.b,0,255),a:Ei(e.a)}},Ci=function(e){return{r:ki(e.r),g:ki(e.g),b:ki(e.b),a:ki(e.a,3)}},_i=/^#([0-9a-f]{3,8})$/i,Ai=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Ri=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}},Oi=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}},Ti=function(e){return{h:Si(e.h),s:Ei(e.s,0,100),l:Ei(e.l,0,100),a:Ei(e.a)}},Ii=function(e){return{h:ki(e.h),s:ki(e.s),l:ki(e.l),a:ki(e.a,3)}},Pi=function(e){return Oi((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},Mi=function(e){return{h:(t=Ri(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},Di=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ni=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Li=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,zi=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Bi={string:[[function(e){var t=_i.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?ki(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?ki(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Li.exec(e)||zi.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:xi({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=Di.exec(e)||Ni.exec(e);if(!t)return null;var r,n,o=Ti({h:(r=t[1],n=t[2],void 0===n&&(n="deg"),Number(r)*(yi[n]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return Pi(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 wi(t)&&wi(r)&&wi(n)?xi({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(!wi(t)||!wi(r)||!wi(n))return null;var a=Ti({h:Number(t),s:Number(r),l:Number(n),a:Number(s)});return Pi(a)},"hsl"],[function(e){var t=e.h,r=e.s,n=e.v,o=e.a,s=void 0===o?1:o;if(!wi(t)||!wi(r)||!wi(n))return null;var a=function(e){return{h:Si(e.h),s:Ei(e.s,0,100),v:Ei(e.v,0,100),a:Ei(e.a)}}({h:Number(t),s:Number(r),v:Number(n),a:Number(s)});return Oi(a)},"hsv"]]},ji=function(e,t){for(var r=0;r=.5},e.prototype.toHex=function(){return t=(e=Ci(this.rgba)).r,r=e.g,n=e.b,s=(o=e.a)<1?Ai(ki(255*o)):"","#"+Ai(t)+Ai(r)+Ai(n)+s;var e,t,r,n,o,s},e.prototype.toRgb=function(){return Ci(this.rgba)},e.prototype.toRgbString=function(){return t=(e=Ci(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 Ii(Mi(this.rgba))},e.prototype.toHslString=function(){return t=(e=Ii(Mi(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=Ri(this.rgba),{h:ki(e.h),s:ki(e.s),v:ki(e.v),a:ki(e.a,3)};var e},e.prototype.invert=function(){return Ui({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),Ui(Fi(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Ui(Fi(this.rgba,-e))},e.prototype.grayscale=function(){return Ui(Fi(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Ui($i(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Ui($i(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?Ui({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):ki(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Mi(this.rgba);return"number"==typeof e?Ui({h:e,s:t.s,l:t.l,a:t.a}):ki(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Ui(e).toHex()},e}(),Ui=function(e){return e instanceof Wi?e:new Wi(e)};const Hi=[];function qi(){return(qi=Object.assign||function(e){for(var t=1;t=0||(o[r]=e[r]);return o}function Zi(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 Yi=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(Qi(s.current,e,i.current)):r(!1)},t=function(){return r(!1)};function r(r){var n=c.current,o=Xi(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&&(Ji(t),!function(e,t){return t&&!Ki(e)}(t,c.current)&&n)){if(Ki(t)){c.current=!0;var o=t.changedTouches||[];o.length&&(i.current=o[0].identifier)}n.focus(),a(Qi(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",qi({},o,{onTouchStart:d,onMouseDown:d,className:"react-colorful__interactive",ref:s,onKeyDown:p,tabIndex:0,role:"slider"}))})),tc=function(e){return e.filter(Boolean).join(" ")},rc=function(t){var r=t.color,n=t.left,o=t.top,s=void 0===o?.5:o,a=tc(["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}}))},nc=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Math.pow(10,t)),Math.round(r*e)/r},oc=(Math.PI,function(e){var t=e.s,r=e.v,n=e.a,o=(200-t)*r/100;return{h:nc(e.h),s:nc(o>0&&o<200?t*r/100/(o<=100?o:200-o)*100:0),l:nc(o/2),a:nc(n,2)}}),sc=function(e){var t=oc(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},ac=function(e){var t=oc(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},lc=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:nc(60*(l<0?l+6:l)),s:nc(s?a/s*100:0),v:nc(s/255*100),a:o}},ic=e.memo((function(t){var r=t.hue,n=t.onChange,o=tc(["react-colorful__hue",t.className]);return e.createElement("div",{className:o},e.createElement(ec,{onMove:function(e){n({h:360*e.left})},onKey:function(e){n({h:Yi(r+360*e.left,0,360)})},"aria-label":"Hue","aria-valuenow":nc(r),"aria-valuemax":"360","aria-valuemin":"0"},e.createElement(rc,{className:"react-colorful__hue-pointer",left:r/360,color:sc({h:r,s:100,v:100,a:1})})))})),cc=e.memo((function(t){var r=t.hsva,n=t.onChange,o={backgroundColor:sc({h:r.h,s:100,v:100,a:1})};return e.createElement("div",{className:"react-colorful__saturation",style:o},e.createElement(ec,{onMove:function(e){n({s:100*e.left,v:100-100*e.top})},onKey:function(e){n({s:Yi(r.s+100*e.left,0,100),v:Yi(r.v-100*e.top,0,100)})},"aria-label":"Color","aria-valuetext":"Saturation "+nc(r.s)+"%, Brightness "+nc(r.v)+"%"},e.createElement(rc,{className:"react-colorful__saturation-pointer",top:1-r.v/100,left:r.s/100,color:sc(r)})))}));var uc="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,dc=new Map,pc=function(t){var r=t.className,n=t.hsva,o=t.onChange,s={backgroundImage:"linear-gradient(90deg, "+ac(Object.assign({},n,{a:0}))+", "+ac(Object.assign({},n,{a:1}))+")"},a=tc(["react-colorful__alpha",r]),l=nc(100*n.a);return e.createElement("div",{className:a},e.createElement("div",{className:"react-colorful__alpha-gradient",style:s}),e.createElement(ec,{onMove:function(e){o({a:e.left})},onKey:function(e){o({a:Yi(n.a+e.left)})},"aria-label":"Alpha","aria-valuetext":l+"%","aria-valuenow":l,"aria-valuemin":"0","aria-valuemax":"100"},e.createElement(rc,{className:"react-colorful__alpha-pointer",left:n.a,color:ac(n)})))},hc=function(t){var n,o=t.className,s=t.colorModel,a=t.color,l=void 0===a?s.defaultColor:a,i=t.onChange,c=Gi(t,["className","colorModel","color","onChange"]),u=(0,e.useRef)(null);n=u,uc((function(){var e=n.current?n.current.ownerDocument:document;if(void 0!==e&&!dc.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}',dc.set(e,t);var o=r.nc;o&&t.setAttribute("nonce",o),e.head.appendChild(t)}}),[]);var d=function(t,r,n){var o=Zi(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=tc(["react-colorful",o]);return e.createElement("div",qi({},c,{ref:u,className:f}),e.createElement(cc,{hsva:p,onChange:h}),e.createElement(ic,{hue:p.h,onChange:h}),e.createElement(pc,{hsva:p,onChange:h,className:"react-colorful__last-control"}))},fc={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?lc({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:nc(255*[n,l,a,a,i,n][c]),g:nc(255*[i,n,n,l,a,a][c]),b:nc(255*[a,a,i,n,n,l][c]),a:nc(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,"")}},mc=function(t){return e.createElement(hc,qi({},t,{colorModel:fc}))};const gc=({color:t,onChange:r,rgbColor:n})=>{const[o,a]=(0,s.useState)(t);return((t,r=0,n=Hi)=>{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)(mc,{color:n,onChange:a})},bc={control:"VRVGQpI3zaaudCXO9pfb",toggleButton:"XrISJIngb2x9EtcYAzMU",toggleIndicator:"Ouj472tQv3blob0sqmH6",fallback:"zkAvCiYqWBX4cAy33wxh",content:"J62xAdJErvGbqxOlNbW7",inputWrapper:"J30BF_9MPB5F7qf3L8al",input:"Vw12WmPhE7aPUCHBLLEL",clear:"XbAJl6cbZMlX7GBgAzs5",palette:"z6nZBcaVAN7pqDiQoXQT",opacity:"Suqn3en4cxHuOZ8Uu2D7"},vc="gb-color-picker-palettes";function yc(e){return e?.color?.startsWith("var(")?{...e,color:e.color}:{...e,color:`var(--wp--preset--color--${e.slug}, ${e.color})`}}function wc(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 Ui(t).toRgbString()}function kc(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=wc(m),t=Ui(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)((()=>wc(r)),[r]),w=function(){const[e=[],t=[]]=(0,Gs.useSettings)("color.palette.custom","color.palette.theme");return(0,s.useMemo)((()=>[...e.map(yc),...t.map(yc)]),[e,t])}(),k=(0,qs.applyFilters)("generateblocks.components.colorPalettes",d||w,t,w);(0,s.useEffect)((()=>{sessionStorage.setItem(vc,JSON.stringify(k))}),[k]);const E=Us();return(0,e.createElement)(o.BaseControl,{id:E,label:i,className:g("gb-color-picker",bc.control),"data-gb-control":"ColorPickerControl"},(0,e.createElement)(o.Dropdown,{className:bc.toggle,contentClassName:bc.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:bc.toggleButton,onClick:()=>{r(),h&&h()},"aria-expanded":t,"aria-label":u},(0,e.createElement)("span",{className:g(bc.toggleIndicator,f&&bc.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(vc),s=sessionStorage?JSON.parse(t):k;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(gc,{color:r,rgbColor:y,onChange:e=>{Ui(e).isValid()&&(e=1===Ui(e).alpha()?Ui(e).toHex():e),l(e)}}),(0,e.createElement)("div",{className:bc.inputWrapper},(0,e.createElement)(o.TextControl,{ref:v,className:bc.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:()=>{Ui(r).isValid()&&1===Ui(r).alpha()&&l(Ui(r).toHex())}}),(0,e.createElement)(o.Button,{size:"small",variant:"secondary",className:bc.clear,onClick:()=>{l("")}},(0,a.__)("Clear","generateblocks"))),(0,e.createElement)(o.BaseControl,{className:bc.palette},(0,e.createElement)(Gs.ColorPalette,{colors:s,value:r||"",onChange:e=>{l(e)},disableCustomColors:!0,clearable:!1})))}}))}const Ec=[{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 Sc({value:t,onChange:r,cssProp:n}){const o=(0,s.useMemo)((()=>Ec.every((e=>e.value!==t))),[t]);return(0,e.createElement)(wl,{allowCustomValue:!0,hasCustomValue:o,as:vl,label:"Text Alignment",id:"text-align",buttons:Ec,value:t,onChange:r,cssProp:n})}const xc=window.wp.apiFetch;var Cc=r.n(xc);const _c={preview:"ZGQCNoUr2ZjtbpQO28Va",fallback:"Bo5sw1e4yZI2xQ7LAYgH"},Ac=(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:_c.preview},s&&c?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("img",{className:_c.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:_c.fallback,style:{fontFamily:d?`var(${d})`:u}},l," ",i&&`(${i})`))})),Rc="undefined"==typeof AbortController?void 0:new AbortController,Oc="generatepress-font-library";let Tc=null;const Ic=(0,s.memo)(Ns),Pc=(0,s.memo)((function({item:t}){return t?(0,e.createElement)(Ac,{font:t}):null}));function Mc(){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 Dc({onStyleChange:t,fontFamily:r="",cssProp:n=""}){var o;const[l,i]=(0,s.useState)((()=>Tc||Mc())),[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&&!Tc&&async function(){try{const e=await Cc()({path:"/generatepress-font-library/v1/get-fonts",method:"GET"});if(!e.response)throw new Error("Request failed");const t=[...Mc(),...e.response];Tc=t,i(t)}catch(e){"AbortError"===e.name&&console.error("Request has been aborted"),Rc?.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)(wl,{className:"gb-styles-builder__font-family",as:Ic,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:Pc,allowCustomValue:!0,hasCustomValue:d,selectedItem:h,setSelectedItem:f,dropdownChildren:({onClose:t})=>(0,e.createElement)(wl.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=${Oc}`,cssProp:n,selectedStyle:"icon"})}const Nc=(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"})),Lc=(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"})),zc=(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"})),Bc=[{label:"None",value:"none",icon:(0,e.createElement)(ks,null)},{label:"Uppercase",value:"uppercase",icon:Nc},{label:"Lowercase",value:"lowercase",icon:Lc},{label:"Capitalize",value:"capitalize",icon:zc}];function jc({value:t,onChange:r,cssProp:n}){const o=(0,s.useMemo)((()=>Bc.every((e=>e.value!==t))),[t]);return(0,e.createElement)(wl,{as:vl,allowCustomValue:!0,hasCustomValue:o,label:"Text Transform",id:"gblocks-text-transform",value:t,buttons:Bc,onChange:r,cssProp:n})}const Fc=(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"})),Vc=(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"})),$c=[{label:"None",value:"none",icon:(0,e.createElement)(ks,null)},{label:"Underline",value:"underline",icon:Fc},{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:Vc}];function Wc({value:t,onChange:r,cssProp:n}){return(0,e.createElement)(wl,{as:vl,allowCustomValue:!0,label:"Text Decoration",id:"gblocks-text-decoration",value:t,onChange:r,buttons:$c,cssProp:n})}const Uc=(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"})),Hc=[{label:"None",value:"none",icon:(0,e.createElement)(ks,null)},{label:"Normal",value:"normal",icon:zc},{label:"Italic",value:"italic",icon:Uc}];function qc({value:t,onChange:r,cssProp:n}){const o=(0,s.useMemo)((()=>Hc.every((e=>e.value!==t))),[t]);return(0,e.createElement)(wl,{as:vl,allowCustomValue:!0,hasCustomValue:o,label:"Font Style",id:"gblocks-font-style",value:t,onChange:r,buttons:Hc,cssProp:n})}function Gc({value:t,onChange:r,cssProp:n}){return(0,e.createElement)(wl,{as:o.SelectControl,allowCustomValue:!0,label:"Text Wrap",id:"gblocks-text-wrap",value:t,onChange:r,cssProp:n,options:oi([{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 Zc(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)(_s,{size:"20"}),(0,e.createElement)(Xl,{cssProps:nl})),opened:!!s||void 0,scrollAfterOpen:l,onToggle:i},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(wl,{as:kc,label:"Text Color",value:d,onChange:e=>n("color",e),cssProp:"color"}),(0,e.createElement)(wl,{as:ql,label:"Font Size",id:"gblocks-font-size",value:u,onChange:e=>n("fontSize",e),fallbackProp:!0,cssProp:"fontSize"}),(0,e.createElement)(wl,{as:o.SelectControl,allowCustomValue:!0,label:"Font Weight",id:"gblocks-font-weight",value:m,options:oi([{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)(qc,{value:g,onChange:e=>n("fontStyle",e),cssProp:"fontStyle"}),(0,e.createElement)(Sc,{value:f,onChange:e=>n("textAlign",e),cssProp:"textAlign"}),(0,e.createElement)(jc,{value:w,onChange:e=>n("textTransform",e),cssProp:"textTransform"}),(0,e.createElement)(Wc,{value:v,onChange:e=>n("textDecoration",e),cssProp:"textDecoration"}),(0,e.createElement)(o.Flex,null,(0,e.createElement)(wl,{as:ql,label:"Line Height",id:"gblocks-line-height",value:p,onChange:e=>n("lineHeight",e),cssProp:"lineHeight",units:[...ql.defaultUnits,""],defaultUnit:""}),(0,e.createElement)(wl,{as:ql,label:"Letter Spacing",id:"gblocks-letter-spacing",value:h,onChange:e=>n("letterSpacing",e),cssProp:"letterSpacing"})),(0,e.createElement)(Dc,{fontFamily:y,onStyleChange:n,cssProp:"fontFamily"}),(0,e.createElement)(wl,{id:"gblocks-white-space",as:o.SelectControl,allowCustomValue:!0,label:"White Space",cssProp:"whiteSpace",value:k,onChange:e=>n("whiteSpace",e),options:oi([{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)(Gc,{value:E,onChange:e=>n("textWrap",e),cssProp:"textWrap"})))}const Yc={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 Kc({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)(wl,{as:kc,"aria-label":"Color",value:u,onChange:d,cssProp:!1}),(0,e.createElement)("div",{style:{flexGrow:1}},(0,e.createElement)(wl,{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:Yc.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 Xc({onChange:t,value:r="",presets:n=[],selectingPreset:l,setSelectingPreset:i=!1}){const[c,u]=(0,s.useState)(fa(r)),{type:d,angle:p,colorStops:h=[]}=c,f=(0,qs.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:Yc.gradient},(0,e.createElement)(b.Stack,{gap:"12px"},(0,e.createElement)("div",{className:Yc.preview},(0,e.createElement)("div",{className:Yc.bar,style:{backgroundImage:r}})),l&&f?(0,e.createElement)(e.Fragment,null,f.map((t=>(0,e.createElement)("div",{className:Yc.preset,key:t.name},(0,e.createElement)("span",{className:pl.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(fa(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:Yc.settings},(0,e.createElement)(b.Stack,{layout:"flex",direction:"horizontal",wrap:!1},(0,e.createElement)(wl,{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)(wl,{as:o.AnglePickerControl,label:"Angle",value:p?parseFloat(p):0,onChange:e=>{u((t=>({...t,angle:`${e}deg`})))}}))),(0,e.createElement)("ul",{className:Yc.stops,role:"list"},h.map(((t,r)=>(0,e.createElement)("li",{key:r,style:{marginBottom:0}},(0,e.createElement)(Kc,{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 Qc={left:0,center:.5,top:0,right:1,bottom:1};function Jc(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 Qc&&(c=Qc[l]),i.endsWith("%")?u=parseFloat(i)/100:i.endsWith("px")?u=parseFloat(i)/t:i in Qc&&(u=Qc[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 eu={control:"S_cDmslMmM_T8hmDHcBb",selectButton:"NycH4LLYToN_mjyxoQ43",url:"_AAylWX06i7jVP_6zJmF",flex:"HbiGF2bjGrx5ssezTmA2"};function tu({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=la("/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)((()=>Jc(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(Jc(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]),Fl((()=>{r&&r(x)}),[_]),(0,e.createElement)("div",{className:g("gb-image-control",eu.control),ref:f},(0,e.createElement)(b.Stack,{gap:"12px"},(0,e.createElement)("div",{className:eu.flex},(0,e.createElement)(wl,{as:o.TextControl,className:eu.url,type:"text",value:O,onChange:F,label:c,help:!I&&(0,a.__)("Could not load image.","generateblocks-pro")}),(0,e.createElement)(Gs.MediaUploadCheck,null,(0,e.createElement)(Gs.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:eu.selectButton},(0,a.__)("Select","generateblocks-pro"))))}))),"none"!==O&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Gs.MediaUploadCheck,null,(0,e.createElement)(wl,{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)(wl,{as:o.TextControl,label:"Background Position",value:x,help:E,onChange:j}))))}const ru=[{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"}],nu={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")},ou="linear-gradient(to right, rgba(0, 0, 0, 1) 0%,rgba(10, 10, 10, 0.5) 100%)";function su({currentOption:t,findBackgroundIndex:r,setSettings:n}){const l=(0,Gs.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:ou)),[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:ou)):"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)(Sl,null,(0,e.createElement)(wl,{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)(wl.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,nu.image),(0,e.createElement)("dt",null,(0,a.__)("Gradient","generateblocks-pro")," ","gradient"===h&&(0,a.__)("(Current)","generateblocks-pro")),(0,e.createElement)("dd",null,nu.gradient),(0,e.createElement)("dt",null,(0,a.__)("Overlay","generateblocks-pro")," ","overlay"===h&&(0,a.__)("(Current)","generateblocks-pro")),(0,e.createElement)("dd",null,nu.overlay))),value:h}),"overlay"===h&&(0,e.createElement)(wl,{alwaysVisible:!0,as:kc,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)(wl.Description,{label:(0,a.__)("About Background Overlay","generateblocks-pro"),onClick:t},nu.overlay)}),"image"===h&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(wl,{alwaysVisible:!0,as:tu,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)(wl.Description,{label:(0,a.__)("About Background Image","generateblocks-pro"),onClick:t},nu.image)}),"none"!==f&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(wl,{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)(wl.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)(wl,{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)(wl,{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)(wl.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)(wl,{alwaysVisible:!0,as:Xc,selectingPreset:i,setSelectingPreset:c,presets:u,label:"Gradient",onChange:x,value:f.includes("gradient")?f:ou,dropdownChildren:({onClose:t})=>(0,e.createElement)(e.Fragment,null,(0,e.createElement)(wl.Description,{label:(0,a.__)("About Gradients","generateblocks-pro"),onClick:t},nu.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)(wl,{alwaysVisible:!0,as:o.SelectControl,allowCustomValue:!0,label:"Blend Mode",value:v,options:ru,onChange:(e=0)=>{d[p].backgroundBlendMode=e,n(d)},dropdownChildren:({onClose:t})=>(0,e.createElement)(wl.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 au(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(da)||[]).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(ua);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 Da({backgroundBlendMode:r,backgroundAttachment:n,backgroundImage:o,backgroundPosition:s,backgroundSize:a,backgroundRepeat:l})}const lu=({onStyleChange:t,value:r,atRule:n})=>{var l;const[i,c]=(0,s.useState)(!1),[u,d]=(0,s.useState)((()=>au(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(au(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)(El,{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)(El.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)(El.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?ha():pa(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:Yc.control},(0,e.createElement)("div",{className:Yc.wrapper},!b&&(0,e.createElement)("div",null,(0,e.createElement)(Al,{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${ca(t)}: ${r};`:`${ca(t)}: ${r};`:e),"")}(t),o=n.length>0?n:(0,a.__)("Empty","generateblocks-pro");return(0,e.createElement)(Al.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)(su,{isEditing:b,currentOption:g,findBackgroundIndex:w,setSettings:y})))))};function iu(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)(As,{size:"20"}),(0,e.createElement)(Xl,{cssProps:ol})),opened:!!c||void 0,scrollAfterOpen:u,onToggle:d},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(lu,{value:x,onStyleChange:n,nestedRule:l,atRule:i}),(0,e.createElement)(wl,{as:kc,label:"Background Color",value:f,cssProp:"backgroundColor",onChange:e=>n("backgroundColor",e),searchKeywords:["bg"]}),(0,e.createElement)(wl,{allowCustomValue:!0,as:o.SelectControl,label:"Background Clip",value:m,cssProp:"backgroundClip",options:oi([{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)(wl,{allowCustomValue:!0,as:o.SelectControl,label:"Background Origin",value:g,cssProp:"backgroundOrigin",options:oi([{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 cu=window.lodash,uu={parentControl:"gHGfHBQP2C81NWCZwcnN",control:"EniC23tEnw6w8g9DWTFR",dropdown:"e6ezWqom3L7Tmh5dVC5E",fallback:"H1Q7u0ti2sm6ebVl62oO",colors:"WwmfJitInBLetqwKtfQ0",sync:"BbSvFj3yOxLBpu_v_AbE",flexShrink:"Ax6Yv9sD57Z1rKvYHJI_"};function du({icon:t}){return"border-none"===t?(0,e.createElement)(fs,null):"border-solid"===t?(0,e.createElement)(ms,null):"border-dashed"===t?(0,e.createElement)(gs,null):"border-dotted"===t?(0,e.createElement)(bs,null):"border-default"===t?(0,e.createElement)(vs,null):"borders"===t?(0,e.createElement)(ys,null):void 0}function pu({value:t,placeholder:r="",onChange:n}){const s={none:(0,e.createElement)(du,{icon:"border-none"}),solid:(0,e.createElement)(du,{icon:"border-solid"}),dashed:(0,e.createElement)(du,{icon:"border-dashed"}),dotted:(0,e.createElement)(du,{icon:"border-dotted"})},l=t||r,i=!t&&!!r;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(o.DropdownMenu,{className:g(uu.dropdown,i&&uu.fallback),icon:s[l]||(0,e.createElement)(du,{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)(du,{icon:"border-default"}),onClick:()=>{n(""),t()}},(0,a.__)("Default","generateblocks-pro")),(0,e.createElement)(o.MenuItem,{icon:(0,e.createElement)(du,{icon:"border-none"}),onClick:()=>{n("none"),t()}},"None"),(0,e.createElement)(o.MenuItem,{icon:(0,e.createElement)(du,{icon:"border-solid"}),onClick:()=>{n("solid"),t()}},"Solid"),(0,e.createElement)(o.MenuItem,{icon:(0,e.createElement)(du,{icon:"border-dashed"}),onClick:()=>{n("dashed"),t()}},"Dashed"),(0,e.createElement)(o.MenuItem,{icon:(0,e.createElement)(du,{icon:"border-dotted"}),onClick:()=>{n("dotted"),t()}},"Dotted"))))))}const hu=["borderTop","borderRight","borderBottom","borderLeft"],fu=new Set(["borderTopWidth","borderTopStyle","borderTopColor","borderRightWidth","borderRightStyle","borderRightColor","borderBottomWidth","borderBottomStyle","borderBottomColor","borderLeftWidth","borderLeftStyle","borderLeftColor"]);function mu(e){return null==e||""===e?"":String(e)}function gu(e,t=[]){const r=hu.map((t=>({width:mu(e[t+"Width"]),style:mu(e[t+"Style"]),color:mu(e[t+"Color"])}))),n=r.every((e=>""===e.width&&""===e.style&&""===e.color));if(n&&!function(e){return!!Array.isArray(e)&&e.some((e=>fu.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,cu.isEqual)(e,r[0])));return!(!s||o)&&"all"}const bu=["borderTop","borderRight","borderBottom","borderLeft"];function vu(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)((()=>gu(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=bu.map((t=>({width:e(z[t+"Width"]),style:e(z[t+"Style"]),color:e(z[t+"Color"])}))),r=t.every((e=>(0,cu.isEqual)(e,t[0])));!v||r?v||"all"===gu(z,m)&&y("all"):y(!1)}),[h,f,JSON.stringify(z),JSON.stringify(m)]);const j=(0,s.useCallback)((function(){const e=bu.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?(bu.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)(Cs,{size:"20"}),(0,e.createElement)(Xl,{cssProps:rl})),opened:!!i||void 0,scrollAfterOpen:c,onToggle:u},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(wl,{label:"Border",id:"gblocks-border",className:g("gb-borders",uu.parentControl),beforeDropdownMenu:(0,e.createElement)(pi,{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"},bu.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)(wl,{key:i,label:n,searchKeywords:o,value:s,cssProp:c},(0,e.createElement)("div",{className:uu.control,"data-border-area":i},(0,e.createElement)(wl,{as:ql,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)(wl,{as:pu,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:uu.flexShrink}),(0,e.createElement)(wl,{as:kc,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)(bi,{id:"border-radius",label:"Border Radius",onChange:l,cssProps:F,syncTypes:["all"],layout:"corners",className:"border-radius"})))}function yu(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=oi([{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)(Os,{size:"20"}),(0,e.createElement)(Xl,{cssProps:sl})),opened:!!l||void 0,scrollAfterOpen:i,onToggle:c},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(wl,{allowCustomValue:!0,as:o.SelectControl,label:"position",value:d,options:oi([{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)(bi,{id:"inset",cssProps:k,onChange:n,syncTypes:["all"],label:"Inset"}),(0,e.createElement)(wl,{allowCustomValue:!0,as:o.SelectControl,label:"Overflow-X",value:p,options:w,onChange:e=>n("overflowX",e),cssProp:"overflowX"}),(0,e.createElement)(wl,{allowCustomValue:!0,as:o.SelectControl,label:"Overflow-Y",value:h,options:w,onChange:e=>n("overflowY",e),cssProp:"overflowY"}),(0,e.createElement)(wl,{as:o.TextControl,label:"z-index",value:f,cssProp:"zIndex",onChange:e=>{n("zIndex",e),d||n("position","relative")}})))}function wu({opacity:t,onStyleChange:r}){let n=100*parseFloat(t);return isNaN(n)&&(n=t),(0,e.createElement)(wl,{as:ql,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 ku=e=>e.replace(/-webkit-box-shadow:[^;]+;|-moz-box-shadow:[^;]+;/g,""),Eu=e=>e.replace(/box-shadow/g,"").replace(/webkit/g,"").replace(/\r?\n|\r/g,"").replace(/;/g,"").replace(/:/g,"").trim(),Su=(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(),xu=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(", "):""}}(),Cu=["px","em","rem","vw","vh","ch"];function _u({findBoxShadowIndex:t,setSettings:r,currentOption:n=null}){const{styles:s,index:a}=t();return n&&(0,e.createElement)(Sl,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)(wl,{alwaysVisible:!0,as:kc,value:n?.color||"rgba(0,0,0,.1)",tooltip:"Box Shadow Color",onChange:e=>{s[a].color=e,r(s)}})),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,label:"x-Offset",units:Cu,value:n.offsetX,onChange:e=>{s[a].offsetX=e,r(s)}}),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,label:"y-Offset",units:Cu,value:n.offsetY,onChange:e=>{s[a].offsetY=e,r(s)}}),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,label:"blur",units:Cu,value:n?.blur,onChange:e=>{s[a].blur=e,r(s)}}),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,label:"spread",units:Cu,value:n?.spread,onChange:e=>{s[a].spread=e,r(s)}}))}function Au({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)((()=>xu.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(xu.parse(r))}),[r]);const w=(0,$e.useDebounce)(t,0),k=(0,s.useCallback)((function(e){b.current=!0,f(e),w("boxShadow",Su(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)(El,{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)(El.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)(El.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)(Al,{items:h,dragHandleLabel:(0,a.__)("Reorder Box Shadow","generateblocks-pro"),setItems:e=>{k(e)},itemComponent:function({item:t,index:r}){const n=Su([t]),o=n.length>0?n:(0,a.__)("Invalid box shadow","generateblocks-pro");return(0,e.createElement)(Al.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)(_u,{isEditing:y,currentOption:v,findBoxShadowIndex:E,setSettings:k}))),(0,e.createElement)(El.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=xu.parse(Eu(ku(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 Ru(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 Ou=e=>e.replace(/transition/g,"").replace(/webkit/g,"").replace(/\r?\n|\r/g,"").replace(/;/g,"").replace(/:/g,"").trim(),Tu=(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(),Iu=(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")]},Pu=["s"];function Mu({currentOption:t,findTransitionIndex:r,setSettings:n,cssPropertyError:s,cssTimingError:l}){const{styles:i,index:c}=r();if(t){var u;let e=!1;mn.all.includes(null!==(u=t.transitionProperty)&&void 0!==u?u:"")||(i[c].transitionProperty="all",e=!0),Iu(t.transitionTimingFunction)||(i[c].transitionTimingFunction="ease",e=!0),e&&n(i)}return t&&(0,e.createElement)(Sl,null,(0,e.createElement)(wl,{as:ql,label:"Duration",units:Pu,value:t.transitionDuration,defaultUnitValue:"s",onChange:e=>{i[c].transitionDuration=e,n(i)},alwaysVisible:!0,allowOtherUnits:!1}),(0,e.createElement)(wl,{as:ql,label:"Delay",units:Pu,value:t.transitionDelay,defaultUnitValue:"s",onChange:e=>{i[c].transitionDelay=e,n(i)},alwaysVisible:!0,allowOtherUnits:!1}),(0,e.createElement)(wl,{as:o.TextControl,label:"Transition Property",value:t.transitionProperty,onChange:e=>{i[c].transitionProperty=e,n(i)},help:s,alwaysVisible:!0}),(0,e.createElement)(wl,{alwaysVisible:!0,as:o.SelectControl,allowCustomValue:!0,label:"Timing Function",value:t.transitionTimingFunction,options:oi([{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 Du({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)((()=>Ru(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(Ru(r))}),[r]);const x=(0,$e.useDebounce)(t,0),C=(0,s.useCallback)((function(e){k.current=!0,f(e),x("transition",Tu(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)(El,{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=Iu(E.transitionTimingFunction);let t=!1;g(null),v(null),mn.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)(El.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)(El.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)(Al,{items:h,dragHandleLabel:(0,a.__)("Reorder Transition","generateblocks-pro"),setItems:e=>{C(e)},itemComponent:function({item:t,index:r}){const n=Tu([t]),o=n.length>0?n:(0,a.__)("Invalid transition","generateblocks-pro");return(0,e.createElement)(Al.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)(Mu,{currentOption:E,findTransitionIndex:_,setSettings:C,cssPropertyError:m,cssTimingError:b}))),(0,e.createElement)(El.PasteModal,{property:"transition",errorMessage:c,showPasteStyles:l,setShowPasteStyles:i,onAddStyles:({pastedValue:e,replaceStyles:t})=>{if(!e||0===e.length)return!1;try{const r=Ru(Ou(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 Nu(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 Lu(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 zu={blur:["px"],brightness:["%"],contrast:["%"],"drop-shadow":["px","em","rem","vw","vh","ch"],grayscale:["%"],"hue-rotate":["deg"],invert:["%"],opacity:["%"],saturate:["%"],sepia:["%"]},Bu={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%"},ju={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 Fu({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)(Sl,null,(0,e.createElement)(wl,{as:o.SelectControl,label:(0,a.__)("Filter type","generateblocks-pro"),value:l.type,options:[{label:ju.blur,value:"blur"},{label:ju.brightness,value:"brightness"},{label:ju.contrast,value:"contrast"},{label:ju["drop-shadow"],value:"drop-shadow"},{label:ju.grayscale,value:"grayscale"},{label:ju["hue-rotate"],value:"hue-rotate"},{label:ju.invert,value:"invert"},{label:ju.opacity,value:"opacity"},{label:ju.saturate,value:"saturate"},{label:ju.sepia,value:"sepia"}],onChange:e=>{i[c].type=e,i[c].value=Bu[e],r(i)},alwaysVisible:!0}),"blur"===l.type&&(0,e.createElement)(wl,{as:ql,label:ju.blur,units:zu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"brightness"===l.type&&(0,e.createElement)(wl,{as:ql,label:ju.brightness,units:zu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"contrast"===l.type&&(0,e.createElement)(wl,{as:ql,label:ju.contrast,units:zu[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)(wl,{as:ql,allowCustomValue:!0,label:"X-Offset",units:zu[l.type],value:l.dropShadow.xOffset[0],onChange:e=>{i[c].dropShadow.xOffset=e,r(i)},alwaysVisible:!0}),(0,e.createElement)(wl,{as:ql,allowCustomValue:!0,label:"Y-Offset",units:zu[l.type],value:l.dropShadow.yOffset[0],onChange:e=>{i[c].dropShadow.yOffset=e,r(i)},alwaysVisible:!0}),(0,e.createElement)(wl,{as:ql,allowCustomValue:!0,label:"Blur",units:zu[l.type],value:l.dropShadow.blur[0],onChange:e=>{i[c].dropShadow.blur=e,r(i)},alwaysVisible:!0}),(0,e.createElement)(wl,{as:kc,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)(wl,{as:ql,label:ju.grayscale,allowCustomValue:!0,units:zu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"hue-rotate"===l.type&&(0,e.createElement)(wl,{as:ql,label:ju["hue-rotate"],allowCustomValue:!0,units:zu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"invert"===l.type&&(0,e.createElement)(wl,{as:ql,label:ju.invert,units:zu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"opacity"===l.type&&(0,e.createElement)(wl,{as:ql,label:ju.opacity,units:zu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"saturate"===l.type&&(0,e.createElement)(wl,{as:ql,label:ju.saturate,units:zu[l.type],value:l.value,onChange:e=>{i[c].value=e,r(i)},alwaysVisible:!0}),"sepia"===l.type&&(0,e.createElement)(wl,{as:ql,label:ju.sepia,units:zu[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",Tu(e),e)}},"Transition"))}function Vu({onStyleChange:t,value:r="",transition:n=""}){var l;const i=(0,s.useMemo)((()=>Ru(n)),[n]),[c,u]=(0,s.useState)(!1),[d,p]=(0,s.useState)(""),[h,f]=(0,s.useState)(!1),[m,g]=(0,s.useState)((()=>Lu(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(Lu(r))}),[r]);const E=(0,$e.useDebounce)(t,0),S=(0,s.useCallback)((function(e){y.current=!0,g(e),E("filter",Nu(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)(El,{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)(El.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)(El.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)(Al,{items:m,dragHandleLabel:(0,a.__)("Reorder Filter","generateblocks-pro"),setItems:e=>{S(e)},itemComponent:function({item:t,index:r}){const n=Nu([t]),o=n.length>0?n:(0,a.__)("Invalid transform","generateblocks-pro");return(0,e.createElement)(Al.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)(Fu,{currentOption:w,findFilterIndex:x,settings:m,setSettings:S,transitionSettings:i,onStyleChange:t}))),(0,e.createElement)(El.PasteModal,{property:"filter",errorMessage:d,showPasteStyles:c,setShowPasteStyles:u,onAddStyles:({pastedValue:e,replaceStyles:t})=>{if(!e||0===e.length)return!1;try{const r=Lu(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 $u=e=>e.replace(/-webkit-text-shadow:[^;]+;|-moz-text-shadow:[^;]+;/g,""),Wu=e=>e.replace(/text-shadow/g,"").replace(/webkit/g,"").replace(/\r?\n|\r/g,"").replace(/;/g,"").replace(/:/g,"").trim(),Uu=(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(),Hu=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(", "):""}}(),qu=["px","em","rem","vw","vh","ch"];function Gu({findTextShadowIndex:t,setSettings:r,currentOption:n=null}){const{styles:o,index:s}=t();return n&&(0,e.createElement)(Sl,null,(0,e.createElement)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"}},(0,e.createElement)(wl,{alwaysVisible:!0,as:kc,value:n?.color||"rgba(0,0,0,1)",tooltip:"Text Shadow Color",onChange:e=>{o[s].color=e,r(o)}})),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,label:"x-Offset",units:qu,value:n.offsetX,onChange:e=>{o[s].offsetX=e,r(o)}}),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,label:"y-Offset",units:qu,value:n.offsetY,onChange:e=>{o[s].offsetY=e,r(o)}}),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,label:"blur",units:qu,value:n?.blur,onChange:e=>{o[s].blur=e,r(o)}}))}function Zu({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)((()=>Hu.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(Hu.parse(r))}),[r]);const w=(0,$e.useDebounce)(t,0),k=(0,s.useCallback)((function(e){b.current=!0,f(e),w("textShadow",Uu(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)(El,{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)(El.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)(El.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)(Al,{items:h,dragHandleLabel:(0,a.__)("Reorder Text Shadow","generateblocks-pro"),setItems:e=>{k(e)},itemComponent:function({item:t,index:r}){const n=Uu([t]),o=n.length>0?n:(0,a.__)("Invalid text shadow","generateblocks-pro");return(0,e.createElement)(Al.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)(Gu,{isEditing:y,currentOption:v,findTextShadowIndex:E,setSettings:k}))),(0,e.createElement)(El.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=Hu.parse(Wu($u(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 Yu=["perspective","rotate","rotate3d","scale","scale3d","skew","translate3d"];function Ku(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 Xu(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 Qu={perspective:["px","em","%","vh","vw"],rotate:["deg"],rotate3d:["deg"],scale:[],scale3d:[],skew:["deg"],translate3d:["px","em","%","vh","vw"]},Ju={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:[""]}},ed={perspective:"Perspective",translate3d:"Translate",rotate:"Rotate",rotate3d:"Rotate (3d)",scale:"Scale",scale3d:"Scale (3d)",skew:"Skew",custom:(0,a.__)("Custom","generateblocks-pro")},td=(0,a.__)("Enter any valid transform value here.","generateblocks-pro");function rd({findTransformIndex:t,setSettings:r,settings:n,onStyleChange:l,setNextEditIndex:i,currentOption:c=null,transitionSettings:u=[]}){var d,p;const[f,m]=(0,s.useState)(td),{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=!Yu.includes(w);return E&&"custom"!==w&&(w="custom"),c&&(0,e.createElement)(Sl,null,(0,e.createElement)(wl,{alwaysVisible:!0,as:o.SelectControl,label:(0,a.__)("Transform type","generateblocks-pro"),value:w,options:[{label:ed.perspective,value:"perspective",disabled:n.some((e=>"perspective"===e.type))},{label:ed.rotate,value:"rotate"},{label:ed.rotate3d,value:"rotate3d"},{label:ed.translate3d,value:"translate3d"},{label:ed.scale,value:"scale"},{label:ed.scale3d,value:"scale3d"},{label:ed.skew,value:"skew"},{label:ed.custom,value:"custom"}],onChange:e=>{g[b].type=e,"custom"!==e&&(g[b]={...g[b],...Ju[e]}),"perspective"===e&&b>0&&(g.unshift(g.splice(b,1)[0]),i(0)),r(g)}}),E&&(0,e.createElement)(wl,{alwaysVisible:!0,as:o.TextControl,label:ed[w],help:f||td,placeholder:"e.g. rotate(45deg)",onChange:(e="")=>{if(""===e)return g[b].values=[""],g[b].cssText="",r(g),void m(td);const t=Xu(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!==td&&m(td);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)(wl,{alwaysVisible:!0,as:ql,units:Qu[w],label:`${ed[w]} X`,value:v[0],onChange:e=>{g[b].values[0]=e,r(g)}}),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,units:Qu[w],label:`${ed[w]} Y`,value:v[1],onChange:e=>{g[b].values[1]=e,r(g)}}),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,units:Qu[w],label:`${ed[w]} Z`,value:v[2],onChange:e=>{g[b].values[2]=e,r(g)}})),["rotate","skew"].includes(w)&&(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,units:Qu[w],label:ed[w],value:v[0],onChange:(e=0)=>{g[b].values[0]=e,r(g)}}),"scale"===w&&(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,units:Qu[w],label:ed[w],value:v[0],onChange:e=>{g[b].values[0]=e,r(g)}}),"perspective"===w&&(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,units:Qu[w],label:ed[w],value:v[0],onChange:e=>{g[b].values[0]=e,r(g)}}),"rotate3d"===w&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,units:[],label:`${ed[w]} X`,value:v[0],onChange:e=>{g[b].values[0]=e,r(g)}}),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,units:[],label:`${ed[w]} Y`,value:v[1],onChange:e=>{g[b].values[1]=e,r(g)}}),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,units:[],label:`${ed[w]} Z`,value:v[2],onChange:e=>{g[b].values[2]=e,r(g)}}),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,units:Qu[w],label:`${ed[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)(wl,{alwaysVisible:!0,as:ql,units:Qu[w],label:`${ed[w]} X`,value:v[0],onChange:e=>{g[b].values[0]=e,r(g)}}),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,units:Qu[w],label:`${ed[w]} Y`,value:v[1],onChange:e=>{g[b].values[1]=e,r(g)}}),(0,e.createElement)(wl,{alwaysVisible:!0,as:ql,units:Qu[w],label:`${ed[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=Tu(e);l("transition",t)}},"Transition"))}function nd(e){if(!e)return[];const t=Xu(e);return null===t?[]:Object.entries(t).map((([e,t])=>{const{disabled:r=!1}=t;return{type:e,...t,id:Us(),disabled:"perspective"===e||r}}))}function od({onStyleChange:t,value:r="",transition:n=""}){var l;const i=(0,s.useMemo)((()=>Ru(n)),[n]),[c,u]=(0,s.useState)((()=>nd(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(nd(r))}),[r]);const E=(0,$e.useDebounce)(t,0),S=(0,s.useCallback)((function(e){y.current=!0,u(e),E("transform",Ku(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)(El,{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)(El.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)(El.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)(Al,{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=Ku([t]),o=n.length>0?n:(0,a.__)("Invalid transform","generateblocks-pro"),{type:s,color:l}=t;return(0,e.createElement)(Al.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)(rd,{isEditing:k,currentOption:w,findTransformIndex:x,settings:c,setSettings:S,transitionSettings:i,onStyleChange:t,setNextEditIndex:v}))),(0,e.createElement)(El.PasteModal,{property:"transform",errorMessage:h,showPasteStyles:d,setShowPasteStyles:p,onAddStyles:({pastedValue:e,replaceStyles:t})=>{if(!e||0===e.length)return!1;try{const r=nd(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 sd(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)(Rs,{size:"20"}),(0,e.createElement)(Xl,{cssProps:al})),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)(Au,{value:h,onStyleChange:n,atRule:s,nestedRule:l}),(0,e.createElement)(Du,{value:w,onStyleChange:n,atRule:s,nestedRule:l}),(0,e.createElement)(Vu,{value:f,transition:w,onStyleChange:n,atRule:s,nestedRule:l}),(0,e.createElement)(Zu,{value:E,onStyleChange:n,atRule:s,nestedRule:l}),(0,e.createElement)(od,{value:v,transformOrigin:y,transition:w,onStyleChange:n,atRule:s,nestedRule:l}),(0,e.createElement)(wl,{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)(wu,{onStyleChange:n,opacity:g}),(0,e.createElement)(wl,{allowCustomValue:!0,as:o.SelectControl,label:"Visibility",value:k,cssProp:"visibility",options:oi([{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)(wl,{as:o.SelectControl,allowCustomValue:!0,label:"Mix Blend Mode",value:m,cssProp:"mixBlendMode",options:oi([{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)(wl,{as:o.TextControl,label:"Backdrop Filter",value:p,cssProp:"backdropFilter",onChange:e=>n("backdropFilter",e)})))}function ad(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)(Ts,{size:"20"}),(0,e.createElement)(Xl,{cssProps:ll})),opened:!!s||void 0,scrollAfterOpen:l,onToggle:i},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(wl,{as:o.SelectControl,label:"Object Fit",id:"gblocks-object-fit",allowCustomValue:!0,options:oi([{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)(wl,{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 ld=(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 id(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:ld,size:"20"}),(0,e.createElement)(Xl,{cssProps:il})),opened:!!s||void 0,scrollAfterOpen:l,onToggle:i},(0,e.createElement)(b.Stack,{gap:"12px",className:"gb-styles-builder-panel__content"},(0,e.createElement)(wl,{as:o.SelectControl,label:"List Style Type",id:"gblocks-list-style-type",options:oi([{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)(wl,{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)(wl,{id:"gblocks-list-style-position",label:"List Style Position",as:o.SelectControl,options:oi([{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 cd(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)(Ps,{size:"20"}),(0,e.createElement)(Xl,{cssProps:cl})),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)(wl,{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)(wl,{as:o.SelectControl,label:"Pointer Events",id:"gblocks-pointer-events",allowCustomValue:!0,options:oi([{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)(wl.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)(wl,{as:o.SelectControl,label:"Cursor",id:"gblocks-cursor",allowCustomValue:!0,options:oi([{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)(wl,{as:kc,label:"Fill Color",id:"gblocks-fill",allowCustomValue:!0,value:h,cssProp:"fill",onChange:e=>n("fill",e),dropdownChildren:({onClose:t})=>(0,e.createElement)(wl.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)(wl,{as:kc,label:"Stroke Color",id:"gblocks-stroke",allowCustomValue:!0,value:f,cssProp:"stroke",onChange:e=>n("stroke",e),dropdownChildren:({onClose:t})=>(0,e.createElement)(wl.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 ud({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()?Sn(gn,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 dd={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"},pd=150;function hd({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)(hd);(0,s.useEffect)((()=>()=>{m.current&&clearTimeout(m.current)}),[]);const{isOpen:w,suggestions:k,highlightedIndex:E,showAutocomplete:S,hideAutocomplete:x,selectSuggestion:C,handleKeyDown:_,setHighlightedIndex:A}=ud({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())}),pd)}),[x,n]),I=(0,s.useCallback)((()=>{b.current=!0,h.current?.select(),i&&i()}),[i]);return(0,e.createElement)("div",{ref:f,className:dd.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(dd.input,dd.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:dd.autocompletePopover},(0,e.createElement)("div",{id:`property-listbox-${y}`,className:dd.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(dd.autocompleteItem,E>=0&&r===E&&dd.highlighted),onMouseDown:e=>{e.preventDefault(),C(t)},onMouseEnter:()=>A(r)},t))))))}function fd(e){return xn(e)}function md({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)(md);(0,s.useEffect)((()=>()=>{v.current&&clearTimeout(v.current)}),[]);const k=fd(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 Sn(Cn(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:fd(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())}),pd)}),[_,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(dd.inputWrapper,dd.valueInputWrapper)},k&&(0,e.createElement)(kc,{value:r,onChange:D,renderToggle:({isOpen:t,onToggle:n})=>(0,e.createElement)("button",{type:"button",tabIndex:-1,className:dd.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(dd.input,dd.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:dd.autocompletePopover},(0,e.createElement)("div",{id:`value-listbox-${w}`,className:dd.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(dd.autocompleteItem,x>=0&&r===x&&dd.highlighted),onMouseDown:e=>{e.preventDefault(),A(t)},onMouseEnter:()=>O(r)},t))))))}function gd({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)(gd);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(dd.propertyRow,!k&&dd.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)(hd,{value:d,onChange:p,onCommit:A,onCancel:R,onFocus:I,onTab:D,onDelete:M}),(0,e.createElement)("span",{className:dd.separator},":"),(0,e.createElement)(md,{property:t,value:h,onChange:C,onCommit:_,onCancel:O,onFocus:P,onTab:N,onShiftTab:L}))}function bd({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())}),pd)}),[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(dd.addProperty,(l||c)&&dd.active),onBlur:_},(0,e.createElement)(hd,{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:dd.separator},":"),(0,e.createElement)(md,{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:dd.validationWarning},h))}function vd(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)(Is,{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:dd.panel},(0,e.createElement)("div",{ref:p,className:dd.propertyList,role:"list","aria-label":(0,a.__)("CSS properties","generateblocks-pro")},0===v.length?(0,e.createElement)("div",{className:dd.emptyState},(0,a.__)("No styles defined. Add a property to get started.","generateblocks-pro")):v.map(((t,r)=>(0,e.createElement)(gd,{key:t.key,property:t.property,value:t.value,onPropertyChange:y,onValueChange:w,onDelete:k,onFocusPreviousValue:r>0?E:void 0}))),(0,e.createElement)(bd,{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:dd.editFullStylesheet},(0,a.__)("Enable CSS Mode","generateblocks-pro"))))}const yd={controls:"M2tce9CYmar_SaRfGDX4",noResults:"K4d6zHrYGGMqx2tHymDN",filtersActive:"vp1WYiEC_A5yOD05azTr",addMargin:"kTu1tFTn2rKREMXAJXQj",vertical:"XtAYx8ZKvqUBbv4KiKga",isSearching:"E5rfTBAoCUgE1l42TSkQ"};class wd 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 kd({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",yd.controls,(d.search||E)&&"gb-inspector-controls--filtering")},(0,e.createElement)(wd,{fallback:(0,a.__)("An error has occured, please reload and try again","generateblocks-pro")},!!d.search&&(0,e.createElement)(o.Notice,{className:g(yd.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)(Ql,{id:"layout",panel:ai,...S}),(0,e.createElement)(Ql,{id:"sizing",panel:ii,...S}),(0,e.createElement)(Ql,{id:"spacing",panel:vi,...S}),(0,e.createElement)(Ql,{id:"typography",panel:Zc,...S}),(0,e.createElement)(Ql,{id:"backgrounds",panel:iu,...S}),(0,e.createElement)(Ql,{id:"borders",panel:vu,...S}),(0,e.createElement)(Ql,{id:"position",panel:yu,...S}),(0,e.createElement)(Ql,{id:"effects",panel:sd,...S}),(0,e.createElement)(Ql,{id:"media",panel:ad,...S}),(0,e.createElement)(Ql,{id:"lists",panel:id,...S}),(0,e.createElement)(Ql,{id:"more",panel:cd,...S}),!!m&&(0,e.createElement)(Ql,{id:"dev-tools",panel:vd,...S,onOpenCssEditor:v}),!k&&"show-with-value"===d.activeFilter&&(0,e.createElement)(o.Notice,{className:g(yd.addMargin,yd.vertical),isDismissible:!1},(0,a.__)("No styles set.","generateblocks-pro")," ",(0,e.createElement)(o.Button,{className:yd.resetButton,variant:"link",onClick:()=>{p({type:"RESET"})}},(0,a.__)("Reset filters","generateblocks-pro"))),k&&(0,e.createElement)(o.Notice,{className:g(yd.addMargin,yd.vertical,yd.noResults,(E||d.search)&&yd.filtersActive),isDismissible:!1},(0,a.__)("No results found.","generateblocks-pro"))))}const Ed=r(8907);function Sd(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 xd=["color","font","fontFamily","fontSize","fontStyle","fontWeight","lineHeight","textAlign","textIndent","textTransform","visibility","whiteSpace","wordSpacing","letterSpacing","direction","cursor"];function Cd(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 _d=e=>{if("string"!=typeof e)return{value:e,important:!1};const t=e.trim(),r=t.endsWith("!important");return{value:t,important:r}};function Ad(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 Rd(e){return"string"==typeof e&&/^@media(?:\s|\()/i.test(e)}function Od(e,t){if(!Rd(e))return!1;try{return Ed.match(function(e){return e.replace(/^@media\s*/i,"").trim()}(e),{width:`${t}px`})}catch{return!1}}const Td="edge22/styles-builder/css-mode",Id="generateblocks-css-mode-enabled";function Pd(){const e="undefined"!=typeof window?window:null;if(!e)return null;try{return e.localStorage||null}catch{return null}}function Md(){const e=Pd();if(!e)return!1;try{return"true"===e.getItem(Id)}catch{return!1}}function Dd(e){const t=Pd();if(t)try{e?t.setItem(Id,"true"):t.removeItem(Id)}catch{}}function Nd(e="local"){return e||"local"}function Ld(e){return e?`selector:${e}`:"__all__"}function zd(){return{enabled:Md(),focusRequestIdsByScope:{},nextFocusRequestId:0}}function Bd(e={}){return Object.keys(e).length>0}const jd=(0,Fe.createReduxStore)(Td,{reducer:function(e=zd(),t){switch(t.type){case"SET_CSS_MODE_ENABLED":return e.enabled!==t.enabled||!t.enabled&&Bd(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=Nd(t),o=Ld(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||Bd(e.focusRequestIdsByScope)?{...e,enabled:!1,focusRequestIdsByScope:{}}:e;case"CONSUME_CSS_MODE_FOCUS_REQUEST":{const r=e.focusRequestIdsByScope[Nd(t.scope)];return t.requestId&&r?.[Ld(t.selector)]===t.requestId?function(e,{scope:t="local",selector:r}={}){const n=Nd(t),o=Ld(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 Dd(t),{type:"SET_CSS_MODE_ENABLED",enabled:t}},enableCssMode:({scope:e="local",selector:t,focus:r=!1}={})=>(Dd(!0),{type:"ENABLE_CSS_MODE",scope:e,selector:t,focus:!!r}),disableCssMode:()=>(Dd(!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:zd()})},selectors:{isCssModeEnabled:e=>!!e?.enabled,getCssModeFocusRequest(e,t="local",r){const n=e?.focusRequestIdsByScope?.[Nd(t)];return n?.[Ld(r)]||0}},initialState:zd()});function Fd(){try{return(0,Fe.select)(Td)}catch{return}}function Vd(){const e=Fd();return"function"==typeof e?.isCssModeEnabled}function $d(){if(Vd())return!0;try{(0,Fe.register)(jd)}catch{return Vd()}return Vd()}function Wd(){if(!$d())return{};try{return(0,Fe.dispatch)(Td)||{}}catch{return{}}}function Ud(){return $d(),!!Fd()?.isCssModeEnabled?.()}function Hd(e){Wd().setCssModeEnabled?.(e)}function qd(e="local",t){return $d(),Fd()?.getCssModeFocusRequest?.(e,t)||0}function Gd({scope:e="local",selector:t,requestId:r}={}){Wd().consumeCssModeFocusRequest?.({scope:e,selector:t,requestId:r})}function Zd({scope:e="local",selector:t,focus:r=!1}={}){Wd().enableCssMode?.({scope:e,selector:t,focus:r})}function Yd(){Wd().disableCssMode?.()}function Kd(e){return"function"==typeof e&&$d()?(0,Fe.subscribe)(e,Td):()=>{}}function Xd(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 Qd(e,t){return Array.isArray(e)?e.some((e=>Qd(e,t))):"string"==typeof e?e.toLowerCase().includes(t.toLowerCase()):!!(0,s.isValidElement)(e)&&Jd(e,t)}function Jd(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)&&Jd(e,t)))}function ep(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=Nd(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)(Kd,Ud),$=(0,s.useCallback)((()=>qd(z,f)),[z,f]),W=(0,s.useSyncExternalStore)(Kd,$),U=O&&!!I,H=U&&V,q=(0,s.useCallback)((()=>{U&&Zd({scope:z,selector:f,focus:!0})}),[U,z,f]),G=(0,s.useCallback)((()=>{var e;Yd(),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=>{Gd({scope:z,selector:f,requestId:e})}),[z,f]),Y=(0,s.useMemo)((()=>D(h)),[h]),K=w.length>0?w:Ka,[X,Q]=(0,s.useReducer)(Xd,{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=>Qd([r,...n],e.trim()))):Qd([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||Rd(r),c=Rd(r)?Math.min(Ad(r).maxWidth,Math.max(Ad(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(Cd(t,o)){if(e[o]?.[n]){const{value:t,important:r}=_d(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(Rd);for(const r of t)if(Od(r,c)&&e[o][r]?.[n]){const{value:t,important:l}=_d(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(Cd(t,l)&&e[r][l]?.[n]){const{value:t,important:o}=_d(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}=_d(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(Cd(t,l)&&e[r][l]?.[n]){const{value:t,important:o}=_d(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}=_d(e[r][n]);return a={nest:"",at:r,val:t,important:o},f.set(s,a),a}}const u=Object.keys(e).filter(Rd).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&&Rd(r))for(const r of u)if(Od(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(Cd(t,l)&&e[r][l]?.[n]){const{value:t,important:o}=_d(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}=_d(e[r][n]);if(o)return a={nest:"",at:r,val:t,important:o},f.set(s,a),a}}if(r&&Rd(r))for(const r of u)if(Od(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(Cd(t,l)&&e[r][l]?.[n]){const{value:t,important:o}=_d(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}=_d(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}=_d(e[n]);if(l&&(!t||xd.includes(n)||o))return a={nest:"",at:"",val:r,important:l},f.set(s,a),a}if(!r)for(const r of u)if(Od(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(Cd(t,l)&&e[r][l]?.[n]){const{value:t,important:o}=_d(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}=_d(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}=_d(e[n]);(!t||xd.includes(n)||o&&!t)&&(a={nest:"",at:"",val:r,important:s})}if(!a.val&&!r)for(const r of u)if(Od(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(Cd(t,l)&&e[r][l]?.[n]){const{value:t,important:o}=_d(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}=_d(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}=_d(l[e]),s=i?Sd(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}=_d(l[e]),o=i?Sd(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,ul,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)(Hn,{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:Rl}))),(0,e.createElement)(o.DropdownMenu,{variant:"link",size:"small",icon:Ol,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)(Is,{size:"16"}),iconSize:16,label:(0,a.__)("Enable CSS Mode","generateblocks-pro"),onClick:q,className:c.cssModeButton,showTooltip:!0}))),!N&&!P&&(0,e.createElement)(kd,{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 tp(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}$d();const rp={data:{},settings:{}},np={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}})},op={getStyles:(e,t="",r="")=>Ha(e.data,t,r)};function sp(e=rp,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=$a(a,e,t,o,s)})):Array.isArray(r)?r.forEach((e=>{a=$a(a,e.property,e.value,o,s)})):a=$a(e.data,r,n,o,s),{...e,data:a}}if("UPDATE_KEY"===t.type){const{oldKey:r,newKey:n,nestedRule:o}=t.payload,s=Wa(e.data,r,n,o);return{...e,data:s}}if("DELETE_STYLE"===t.type){const{key:r,nestedRule:n}=t.payload,o=Ua(e.data,r,n);return{...e,data:o}}return{...e}}const ap="",lp={setNestedRule:e=>({type:"SET_DATA",payload:e})},ip={getNestedRule:e=>e};function cp(e=ap,t){return"SET_DATA"===t.type?t.payload:e}const up={data:{}},dp={setCurrentStyle:e=>({type:"SET_DATA",payload:e})},pp={currentStyle:e=>e.data};function hp(e=up,t){return"SET_DATA"===t.type?Object.assign({},e,{data:t.payload}):{...e}}const fp="",mp={setAtRule:e=>({type:"SET_DATA",payload:e})},gp={getAtRule:e=>e};function bp(e=fp,t){return"SET_DATA"===t.type?t.payload:e}const vp="",yp={setFilters:e=>({type:"SET_DATA",payload:e})},wp={getFilters:e=>e};function kp(e=vp,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}(555);(window.gb=window.gb||{}).stylesBuilder=r})();