📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: LiteSpeed
2026-06-28 19:55:01
📂
/ (Root)
/
home
/
apkbfjox
/
2jbet.net.pk
/
wp-content
/
plugins
/
generateblocks
/
dist
📍 /home/apkbfjox/2jbet.net.pk/wp-content/plugins/generateblocks/dist
🔄 Refresh
✏️
Editing: pattern-library.js
Writable
(()=>{var e={137(e){var t,r;t="undefined"!=typeof window?window:this,r=function(){function e(){}let t=e.prototype;return t.on=function(e,t){if(!e||!t)return this;let r=this._events=this._events||{},n=r[e]=r[e]||[];return n.includes(t)||n.push(t),this},t.once=function(e,t){if(!e||!t)return this;this.on(e,t);let r=this._onceEvents=this._onceEvents||{};return(r[e]=r[e]||{})[t]=!0,this},t.off=function(e,t){let r=this._events&&this._events[e];if(!r||!r.length)return this;let n=r.indexOf(t);return-1!=n&&r.splice(n,1),this},t.emitEvent=function(e,t){let r=this._events&&this._events[e];if(!r||!r.length)return this;r=r.slice(0),t=t||[];let n=this._onceEvents&&this._onceEvents[e];for(let a of r)n&&n[a]&&(this.off(e,a),delete n[a]),a.apply(this,t);return this},t.allOff=function(){return delete this._events,delete this._onceEvents,this},e},e.exports?e.exports=r():t.EvEmitter=r()},943(e,t,r){!function(t,n){e.exports?e.exports=n(t,r(137)):t.imagesLoaded=n(t,t.EvEmitter)}("undefined"!=typeof window?window:this,(function(e,t){let r=e.jQuery,n=e.console;function a(e,t,s){if(!(this instanceof a))return new a(e,t,s);let i=e;var l;"string"==typeof e&&(i=document.querySelectorAll(e)),i?(this.elements=(l=i,Array.isArray(l)?l:"object"==typeof l&&"number"==typeof l.length?[...l]:[l]),this.options={},"function"==typeof t?s=t:Object.assign(this.options,t),s&&this.on("always",s),this.getImages(),r&&(this.jqDeferred=new r.Deferred),setTimeout(this.check.bind(this))):n.error(`Bad element for imagesLoaded ${i||e}`)}a.prototype=Object.create(t.prototype),a.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)};const s=[1,9,11];a.prototype.addElementImages=function(e){"IMG"===e.nodeName&&this.addImage(e),!0===this.options.background&&this.addElementBackgroundImages(e);let{nodeType:t}=e;if(!t||!s.includes(t))return;let r=e.querySelectorAll("img");for(let e of r)this.addImage(e);if("string"==typeof this.options.background){let t=e.querySelectorAll(this.options.background);for(let e of t)this.addElementBackgroundImages(e)}};const i=/url\((['"])?(.*?)\1\)/gi;function l(e){this.img=e}function o(e,t){this.url=e,this.element=t,this.img=new Image}return a.prototype.addElementBackgroundImages=function(e){let t=getComputedStyle(e);if(!t)return;let r=i.exec(t.backgroundImage);for(;null!==r;){let n=r&&r[2];n&&this.addBackground(n,e),r=i.exec(t.backgroundImage)}},a.prototype.addImage=function(e){let t=new l(e);this.images.push(t)},a.prototype.addBackground=function(e,t){let r=new o(e,t);this.images.push(r)},a.prototype.check=function(){if(this.progressedCount=0,this.hasAnyBroken=!1,!this.images.length)return void this.complete();let e=(e,t,r)=>{setTimeout((()=>{this.progress(e,t,r)}))};this.images.forEach((function(t){t.once("progress",e),t.check()}))},a.prototype.progress=function(e,t,r){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount===this.images.length&&this.complete(),this.options.debug&&n&&n.log(`progress: ${r}`,e,t)},a.prototype.complete=function(){let e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){let e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}},l.prototype=Object.create(t.prototype),l.prototype.check=function(){this.getIsImageComplete()?this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.img.crossOrigin&&(this.proxyImage.crossOrigin=this.img.crossOrigin),this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.proxyImage.src=this.img.currentSrc||this.img.src)},l.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},l.prototype.confirm=function(e,t){this.isLoaded=e;let{parentNode:r}=this.img,n="PICTURE"===r.nodeName?r:this.img;this.emitEvent("progress",[this,n,t])},l.prototype.handleEvent=function(e){let t="on"+e.type;this[t]&&this[t](e)},l.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},l.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},l.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},o.prototype=Object.create(l.prototype),o.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url,this.getIsImageComplete()&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},o.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},o.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},a.makeJQueryPlugin=function(t){(t=t||e.jQuery)&&(r=t,r.fn.imagesLoaded=function(e,t){return new a(this,e,t).jqDeferred.promise(r(this))})},a.makeJQueryPlugin(),a}))},942(e,t){var r;!function(){"use strict";var n={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var r=arguments[t];r&&(e=i(e,s(r)))}return e}function s(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var r in e)n.call(e,r)&&e[r]&&(t=i(t,r));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(a.default=a,e.exports=a):void 0===(r=function(){return a}.apply(t,[]))||(e.exports=r)}()}},t={};function r(n){var a=t[n];if(void 0!==a)return a.exports;var s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.React,t=window.wp.components,n=window.wp.element,a=window.wp.i18n,s=window.wp.apiFetch;var i=r.n(s);const l=window.wp.url;function o(e){return Array.isArray(e)?e.map((e=>{if(e.attributes&&e.attributes.uniqueId){const t=e.clientId.substr(2,9).replace("-","");e.attributes.uniqueId=t}return e.innerBlocks&&e.innerBlocks.length>0&&(e.innerBlocks=o(e.innerBlocks)),e})):[]}function c(e){if("core/paragraph"===e?.name){const t=e?.attributes?.content;if("string"==typeof t)return!t.trim();if("object"==typeof t)return"string"==typeof t?.text&&!t.text.trim()}return!1}function d(e={},t=0){const r=e=>"string"==typeof e,n=e=>Array.isArray(e)?e.filter(r):[],a=r(e?.id)||"number"==typeof e?.id?String(e.id):`pattern-${t}`;return{...e,id:a,label:r(e?.label)?e.label:a,pattern:r(e?.pattern)?e.pattern:"",preview:r(e?.preview)?e.preview:"",categories:Array.isArray(e?.categories)?e.categories:[],scripts:n(e?.scripts),styles:n(e?.styles),globalStyleSelectors:n(e?.globalStyleSelectors)}}const u=(0,n.createContext)(void 0);async function m(e=!0){return await i()({path:(0,l.addQueryArgs)("/generateblocks/v1/pattern-library/libraries",{is_enabled:e}),method:"GET"})}function p({children:t}){const[r,a]=(0,n.useState)([]),[s,o]=(0,n.useState)([]),[c,p]=(0,n.useState)([]),[g,h]=(0,n.useState)(""),[b,y]=(0,n.useState)(""),[f,v]=(0,n.useState)(""),[E,w]=(0,n.useState)(!1),[k,_]=(0,n.useState)(""),[S,C]=(0,n.useState)(""),[L,P]=(0,n.useState)(""),[I,x]=(0,n.useState)(!1),[A,B]=(0,n.useState)("100%"),[M,N]=(0,n.useState)(15),[V,D]=(0,n.useState)(0),T=b?.id||"",O=(0,n.useRef)(""),R=(0,n.useRef)(0),H=(0,n.useRef)(0);O.current=T;const[z,F]=(0,n.useReducer)((function(e,t){switch(t.type){case"ADD":return[...e,t.pattern];case"REMOVE":return e.filter((e=>e.id!==t.pattern.id));case"SET":return t.patterns;default:return e}}),[]),q={libraries:r,search:g,setSearch:h,activeLibrary:b,setActiveLibrary:y,activeCategory:k,setActiveCategory:_,activePatternId:S,setActivePatternId:C,selectedPatterns:z,selectedPatternsDispatch:F,categories:s,hoverPattern:L,setHoverPattern:P,patterns:c,isLocal:E,setIsLocal:w,setPublicKey:v,loading:I,setLoading:x,previewIframeWidth:A,setPreviewIframeWidth:B,setLibraryCategories:G,setLibraryPatterns:j,setLibraries:W,itemsPerPage:15,itemCount:M,setItemCount:N,scrollPosition:V,setScrollPosition:D};async function G(){var e,t;const r=H.current+1;H.current=r;const n=b?.id,{data:a}=await async function(e,t,r){const n=t?"-pro":"";try{var a;const s=await i()({path:(0,l.addQueryArgs)(`/generateblocks${n}/v1/pattern-library/categories`,{libraryId:e,isLocal:t}),method:"GET",headers:{"X-GB-Public-Key":r}});return null!==(a=s?.response)&&void 0!==a?a:[]}catch(e){return[]}}(n,E,f);if(r!==H.current||n!==O.current)return;const s=Array.isArray(a)?a:[],d=new Set(c.flatMap((e=>e.categories))),u=s.filter((e=>e&&d.has(e.id))).map((e=>({...e,name:"string"==typeof e.name?e.name:String(e.id)})));o(null!=u?u:[]);const m=null!==(e=u.find((e=>generateBlocksPatternLibrary.defaultOpenCategory===e.name)))&&void 0!==e?e:"";_(null!==(t=m?.id)&&void 0!==t?t:"")}async function j(){const e=R.current+1;R.current=e;const t=b?.id,r=E,n=f;x(!0),p([]);const{data:a}=await async function(e,t,r,n,a){const s=n?"-pro":"";try{var o;const t=await i()({path:(0,l.addQueryArgs)(`/generateblocks${s}/v1/pattern-library/patterns`,{libraryId:e,categoryId:"",search:"",isLocal:n}),method:"GET",headers:{"X-GB-Public-Key":a}});return null!==(o=t?.response)&&void 0!==o?o:[]}catch(e){return[]}}(t,0,0,r,n);if(e!==R.current||t!==O.current)return;const s=Array.isArray(a)?a.map(d):[];p(s),N(15),D(0),x(!1)}async function W(){var e,t,r,n;let s=[];try{const e=await m();s=Array.isArray(e?.data)?e.data:[]}catch(e){s=[]}a(s);const i=null!==(e=null!==(t=s.find((e=>generateBlocksPatternLibrary.defaultOpenLibrary===e.id)))&&void 0!==t?t:s[0])&&void 0!==e?e:{};y(null!=i&&i),v(null!==(r=i?.publicKey)&&void 0!==r?r:""),w(null!==(n=i?.isLocal)&&void 0!==n&&n)}return(0,n.useEffect)((()=>{!async function(){W()}()}),[]),(0,n.useEffect)((()=>{b.id?G():o([])}),[b?.id,c]),(0,n.useEffect)((()=>{b.id?j():(p([]),x(!1))}),[b?.id,f]),(0,e.createElement)(u.Provider,{value:q},t)}function g(){const e=(0,n.useContext)(u);if(!e)throw new Error((0,a.__)("useLibrary hook must be wrapped by a LibraryProvider.","generateblocks"));return e}const h=window.wp.primitives,b=(0,e.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(h.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"})),y=(0,e.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(h.Path,{d:"M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z"})),f=window.wp.htmlEntities,v=window.wp.hooks;var E=r(942),w=r.n(E);const k=(0,e.createElement)(h.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)(h.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),_=(0,e.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(h.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"}));function S({bulkInsertEnabled:r}){const{categories:n,activeCategory:s,setActiveCategory:i}=g();return(0,e.createElement)("div",{className:"pattern-category-list",style:{background:r?"none":""}},r?(0,e.createElement)(t.DropdownMenu,{className:"pattern-category-dropdown",icon:k,toggleProps:{variant:"secondary",children:(0,a.sprintf)(/* translators: %s: category name */ /* translators: %s: category name */ (0,a.__)("Category: %s","generateblocks"),(e=>{const t=n.find((t=>t.id===e));return t?(0,f.decodeEntities)(t.name):null})(s)||(0,a.__)("All","generateblocks"))}},(({onClose:r})=>(0,e.createElement)(t.MenuGroup,null,(0,e.createElement)(t.MenuItem,{isPressed:""===s,onClick:()=>{i(""),r()}},(0,a.__)("All","generateblocks")),n&&n.map((n=>(0,e.createElement)(t.MenuItem,{key:n.id,icon:n.id===s?_:null,onClick:()=>{i(n.id),r()}},(0,f.decodeEntities)(n.name))))))):(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t.Button,{id:"pattern-category-all",isPressed:""===s,onClick:()=>i("")},(0,a.__)("All","generateblocks")),n&&n.map((r=>(0,e.createElement)(t.Button,{id:`pattern-category-${r.id}`,key:r.id,isPressed:r.id===s,onClick:()=>i(r.id)},(0,f.decodeEntities)(r.name))))))}const C=(0,e.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(h.Path,{d:"M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z"}));function L({setShowAddLibrary:t,setLibraries:r}){const n=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("p",null,(0,a.__)("This feature requires GenerateBlocks Pro.","generateblocks")));return(0,v.applyFilters)("generateblocks.patternLibrary.addLibraryContent",n,{setShowAddLibrary:t,setLibraries:r})}function P(){const[r,s]=(0,n.useState)(!1),{setLibraries:i}=g();return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t.Button,{variant:"secondary",icon:C,onClick:()=>s(!0),label:(0,a.__)("Add Library","generateblocks")}),!!r&&(0,e.createElement)(t.Modal,{title:(0,a.__)("Add Library","generateblocks"),onRequestClose:()=>s(!1),className:"gblocks-patterns-add-library"},(0,e.createElement)(L,{setShowAddLibrary:s,setLibraries:i})))}function I({readOnly:r}){const{libraries:n,activeLibrary:a,setActiveLibrary:s,setIsLocal:i,setPublicKey:l,setActiveCategory:o,loading:c}=g(),d=(0,v.applyFilters)("generateblocks.patternLibrary.libraries",n);return(0,e.createElement)("div",{className:"pattern-library-selector"},(0,e.createElement)(t.ButtonGroup,null,d.map((r=>(0,e.createElement)(t.Button,{key:r.id,isPressed:r.id===a.id,variant:"secondary",onClick:()=>{s(r),i(!!r.isLocal),l(r.publicKey),o("")},style:{pointerEvents:c?"none":""}},r.name))),!r&&(0,e.createElement)(P,null)))}var x=r(943),A=r.n(x);function B({pattern:r,isLoading:a,isActive:s=!1,globalStyleCSS:i}){const{id:l,preview:o,label:c,scripts:d,styles:u}=r,m="string"==typeof o?o:"",p="string"==typeof c?c:String(null!=l?l:""),h=(0,n.useMemo)((()=>Array.isArray(d)?d.filter((e=>"string"==typeof e)):[]),[d]),b=(0,n.useMemo)((()=>Array.isArray(u)?u.filter((e=>"string"==typeof e)):[]),[u]),y=(0,n.useRef)(),f=(0,n.useRef)(),v=(0,n.useRef)(),[E,w]=(0,n.useState)(0),[k,_]=(0,n.useState)(!1),[S,C]=(0,n.useState)({}),[L,P]=(0,n.useState)(!1),[I,x]=(0,n.useState)(0),[B,M]=(0,n.useState)(!1),{previewIframeWidth:N}=g(),[V,D]=function({disabled:e=!1,rootMargin:t="300px"}={}){const r=(0,n.useRef)(),[a,s]=(0,n.useState)(e);return(0,n.useEffect)((()=>{if(e)return void s(!0);if(a)return;const n=r.current;if(!n)return;const i="function"==typeof n.closest?n.closest(".gb-pattern-library__content"):null;if("undefined"==typeof IntersectionObserver)return void s(!0);const l=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&s(!0)}))}),{root:i,rootMargin:t,threshold:.01});return l.observe(n),()=>l.disconnect()}),[e,a,t]),[r,a]}({disabled:s}),T=1280,O=I||T,R=(s||D)&&(s||I>0),H=h.join("\n"),z=b.join("\n"),F="string"==typeof i?i:"",q=(0,n.useRef)(F),G=document?.querySelector(".editor-styles-wrapper");(0,n.useEffect)((()=>{let e;const t=()=>{M(!0),clearTimeout(e),e=setTimeout((()=>{M(!1)}),500)};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[]),(0,n.useEffect)((()=>{v.current?.clientWidth&&!B&&x(v.current?.clientWidth)}),[v.current?.clientWidth,B]),(0,n.useEffect)((()=>{f.current=void 0,_(!1),P(!1),w(0)}),[l]),(0,n.useEffect)((()=>{P(!1),w(0)}),[l,m,H,z]),(0,n.useEffect)((()=>{if(!k||f.current!==l||!R)return;const e=y.current?.contentWindow?.document;if(!e?.head||!e?.body)return;let t,r,n=!1;const a=()=>{!n&&e.body&&w(e.body.scrollHeight)},i=()=>{r&&cancelAnimationFrame(r),r=requestAnimationFrame(a)};e.querySelectorAll("[data-gb-pattern-preview]").forEach((e=>{e.remove()})),P(!1),h.forEach((t=>{const r=e.createElement("script");r.defer=!0,r.src=t,r.dataset.gbPatternPreview="true",e.head.appendChild(r)})),b.forEach((t=>{const r=e.createElement("link");r.rel="stylesheet",r.href=t,r.dataset.gbPatternPreview="true",e.head.appendChild(r)})),e.body.innerHTML=m,e.body.style.padding="";const o=e.createElement("style");o.id="global-style-css",o.dataset.gbPatternPreview="true",o.textContent=q.current;const c=e.querySelector("head style");c?e.head.insertBefore(o,c):e.head.appendChild(o),["block-active","pattern-styles"].forEach((t=>{const r=e.createElement("style");r.id=t,r.dataset.gbPatternPreview="true",e.head.appendChild(r)}));const d=e=>{const t="function"==typeof e.target?.closest?e.target.closest("a"):e.target;if("A"===t?.tagName){const r=t.getAttribute("href");r&&!r.startsWith("#")&&(e.preventDefault(),e.stopPropagation())}s&&setTimeout(i,500)};e.addEventListener("click",d);const u=e.defaultView?.ResizeObserver||window.ResizeObserver;return u&&(t=new u(i),t.observe(e.body)),A()(e.body,(()=>{n||(i(),P(!0))})),()=>{n=!0,e.removeEventListener("click",d),t?.disconnect(),r&&cancelAnimationFrame(r)}}),[l,k,R,m,h,b,s]),(0,n.useEffect)((()=>{if(!G)return;const e=getComputedStyle(G);e&&C({background:e.backgroundColor,text:e.color})}),[G?.style]),(0,n.useLayoutEffect)((()=>{q.current=F;const e=y.current?.contentWindow?.document,t=e?.querySelector?.("#global-style-css");t&&(t.textContent=F)}),[F,k,L]),(0,n.useLayoutEffect)((()=>{const e=y.current?.contentWindow?.document;e&&e.querySelector&&e.querySelector("#pattern-styles")&&(e.querySelector("#pattern-styles").innerHTML=`body{background-color:${S?.background};color:${S?.text};}`)}),[S,E]),(0,n.useEffect)((()=>{if(!s)return;const e=y?.current?.contentWindow?.document;if(!e?.body)return;let t,r=!1;return A()(e.body,(()=>{r||(t=requestAnimationFrame((()=>{w(e.body.scrollHeight)})))})),()=>{r=!0,t&&cancelAnimationFrame(t)}}),[s,N]),(0,n.useEffect)((()=>{const e=y.current?.contentWindow?.document;if(!e)return;const t=e.body;if(!t)return;let r;const n=Array.from(t.querySelectorAll("*")),a=n?.find((e=>{const{display:t}=getComputedStyle(e);return"none"!==t}));if(a){const e=a.parentElement.clientWidth;a.offsetWidth===e||(t.style.padding="100px",a.style.marginLeft="auto",a.style.marginRight="auto",r&&cancelAnimationFrame(r),r=requestAnimationFrame((()=>{t&&w(t.scrollHeight)})))}return()=>{r&&cancelAnimationFrame(r)}}),[I,k]);const j=Math.round(E*(O/T)),W={opacity:a?0:1,height:"350px",display:"flex",flexDirection:"column",justifyContent:j+40<350?"center":""},$=["allow-same-origin"];return s&&$.push("allow-scripts"),(0,e.createElement)("div",{ref:V,className:"gb-pattern-frame",style:s?{backgroundColor:"none",padding:0}:{}},(0,e.createElement)("div",{ref:v,className:"gb-pattern",style:s?{minHeight:"200px"}:W},!L&&(0,e.createElement)(t.Spinner,null),(0,e.createElement)("div",{style:s?{}:{width:I?`${O}px`:"100%",height:`${j}px`}},(0,e.createElement)("div",{style:s?{}:{height:E+"px",width:I?T/O*100+"%":"100%",transformOrigin:"0 0",transform:I?`scale( ${O/T} )`:"scale( 1 )"}},R&&(0,e.createElement)("iframe",{key:l,id:l,onLoad:()=>{f.current=l,_(!0)},title:p,src:generateBlocksPatternLibrary.patternPreviewUrl,ref:y,style:{height:E+"px",border:"0",pointerEvents:s?"":"none",width:s?N:"1280px",opacity:L?1:0,display:s&&"100%"!==N?"block":"",margin:s&&"100%"!==N?"0 auto":""},tabIndex:"-1",sandbox:$.join(" ")})))))}const M=(0,e.createElement)(h.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)(h.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"})),N=window.wp.data,V=window.wp.blockEditor,D=window.wp.blocks;function T({label:r,onClick:n,patterns:a,globalStyleData:s,className:i,disabled:l}){return(0,v.applyFilters)("generateblocks.patterns.insertPatternButton",(0,e.createElement)(t.Button,{className:i,variant:"primary",icon:C,onClick:n,disabled:l},r),{label:r,onClick:n,patterns:a,globalStyleData:s,className:i,disabled:l})}function O({pattern:r,patternRef:n=null,children:s,showPreview:i=!0,bulkInsertEnabled:l,showTitle:d=!0,globalStyleData:u,closeModal:m,readOnly:p}){const{setActivePatternId:h,setScrollPosition:b}=g(),{insertBlocks:y,replaceBlock:v}=(0,N.useDispatch)(V.store),{getBlockInsertionPoint:E,getSelectedBlock:w}=(0,N.useSelect)((e=>e(V.store)),[]),{updateBlockAttributes:k}=(0,N.useDispatch)(V.store);return(0,e.createElement)("div",{className:"gb-pattern-details"},!!d&&(0,e.createElement)("h3",null,(0,f.decodeEntities)(r.label)),(0,e.createElement)("div",{className:"gb-pattern-details__actions"},!l&&!p&&(0,e.createElement)(T,{label:(0,a.__)("Insert","generateblocks"),onClick:async e=>{e.stopPropagation();let t=[];try{t=(0,D.parse)(r.pattern||"")}catch(e){t=[]}if(!t.length)return;const n=E(),a=w(),s=o(t);var i,l;s.forEach((e=>{e.attributes&&e.clientId&&k(e.clientId,e.attributes)})),c(a)?await v(a.clientId,s):await y(s,null!==(i=n?.index)&&void 0!==i?i:0,null!==(l=n.rootClientId)&&void 0!==l?l:""),m()},patterns:[r],globalStyleData:u,disabled:!r?.pattern}),i&&!l&&(0,e.createElement)(t.Button,{variant:"tertiary",icon:M,label:(0,a.__)("Preview","generateblocks"),showTooltip:!0,onClick:e=>{if(e.stopPropagation(),h(r.id),n){const e=n.current.closest(".gb-pattern-library__content");e&&b(e.scrollTop)}}}),s))}const R=(0,n.memo)(O),H="600px 0px";function z({bulkInsertEnabled:r=!1,patterns:s=[],closeModal:i,globalStyleCSS:l,globalStyleData:o,readOnly:c=!1}){const d=(0,n.useRef)(),u=(0,n.useRef)(),{activePatternId:m,loading:p,itemsPerPage:h,itemCount:b,setItemCount:y,scrollPosition:f,selectedPatterns:v,selectedPatternsDispatch:E}=g(),k=(0,n.useMemo)((()=>s.filter((e=>e.id===m))[0]||void 0),[m,s]),_=p?{opacity:0}:{},[S,C]=(0,n.useState)([]),[L,P]=(0,n.useState)(!1),I=b<s.length;return(0,n.useEffect)((()=>{C(s.slice(0,b))}),[b,s]),(0,n.useEffect)((()=>{if(!I||k)return;if("undefined"==typeof IntersectionObserver)return void y(s.length);const e=u.current,t=e?.closest(".gb-pattern-library__content");if(!e)return;const r=new IntersectionObserver((e=>{e.forEach((e=>{e.isIntersecting&&P(!0)}))}),{root:t||null,rootMargin:H,threshold:0});return r.observe(e),()=>{r&&r.disconnect()}}),[k,I,b,s.length,y]),(0,n.useEffect)((()=>{L&&(!k&&I?(y((e=>Math.min(e+h,s.length))),P(!1)):P(!1))}),[k,I,h,L,s.length,y]),(0,n.useEffect)((()=>{if(d.current&&!k){const e=d.current.closest(".gb-pattern-library__content");e&&(e.scrollTop=f)}}),[f,k]),(0,e.createElement)(e.Fragment,null,p&&!m&&(0,e.createElement)("div",{className:"loading-library"},(0,e.createElement)(t.Spinner,null),(0,a.__)("Loading library","generateblocks")),!p&&!s.length&&!m&&(0,e.createElement)("div",{className:"loading-library"},(0,a.__)("No patterns found.","generateblocks")),!!k&&(0,e.createElement)(B,{isLoading:p,isActive:!0,pattern:k,globalStyleCSS:l}),(0,e.createElement)("ul",{ref:d,className:w()("patterns-wrapper",r&&"gb-bulk-insert"),style:{..._,display:k?"none":""}},S.map((n=>{var s;const u=null!==(s=v.some((({id:e})=>e===n.id)))&&void 0!==s&&s;return(0,e.createElement)("li",{key:n.id,className:w()("gb-pattern-wrapper","gb-selectable",u&&r&&"is-selected")},r&&(0,e.createElement)(t.Button,{className:"gb-selectable__toggle",label:u?(0,a.__)("Deselect this pattern","generateblocks"):(0,a.__)("Select this pattern","generate-blocks"),onClick:e=>{e.stopPropagation(),E({type:u?"REMOVE":"ADD",pattern:n})}}),(r||u)&&(0,e.createElement)(t.Button,{className:"check",onClick:e=>{e.stopPropagation(),E({type:"REMOVE",pattern:n})},onBlur:e=>e.stopPropagation(),tabIndex:"-1"},(0,e.createElement)("span",{className:"media-modal-icon"}),(0,e.createElement)("span",{className:"screen-reader-text"},(0,a.__)("Deselect","generateblocks"))),(0,e.createElement)(B,{isLoading:p,pattern:n,globalStyleCSS:l}),(0,e.createElement)(R,{pattern:n,patternRef:d,bulkInsertEnabled:r,globalStyleData:o,closeModal:i,readOnly:c}))}))),(0,e.createElement)("div",{ref:u,style:{height:"1px",marginTop:"10px"},className:"gblocks-patterns-load-more"}))}const F=window.wp.compose;function q({onChange:r}){const{setSearch:a,activeLibrary:s}=g(),[i,l]=(0,n.useState)(""),o=(0,F.useDebounce)(a,500);return(0,n.useEffect)((()=>{o(i)}),[i]),(0,n.useEffect)((()=>{l("")}),[s?.id]),(0,e.createElement)(t.SearchControl,{value:i,onChange:e=>{r(e),l(e)}})}const G=(0,e.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(h.Path,{d:"M5 11.25h14v1.5H5z"})),j=window.gb.components;function W({closeModal:r,globalStyleData:s,setBulkInsertEnabled:i,filteredPatterns:l}){const{insertBlocks:d,replaceBlock:u}=(0,N.useDispatch)(V.store),{selectedPatterns:m=[],selectedPatternsDispatch:p,setActivePatternId:h,setScrollPosition:b}=g(),{getBlockInsertionPoint:y,getSelectedBlock:f}=(0,N.useSelect)((e=>e(V.store)),[]),{updateBlockAttributes:v}=(0,N.useDispatch)(V.store),E=()=>(0,e.createElement)(e.Fragment,null,"");return(0,e.createElement)("aside",{className:"gb-selected-patterns"},(0,e.createElement)("h3",{className:"gb-selected-patterns__headline"},(0,a.__)("Bulk Insert","generateblocks")),!m.length&&(0,e.createElement)("p",null,(0,a.__)("Select patterns to insert.","generateblocks")),(0,e.createElement)(j.SortableList,{className:"gb-selected-patterns__list",items:m,dragHandleLabel:(0,a.__)("Reorder Pattern","generateblocks"),setItems:e=>{p({type:"SET",patterns:e})},itemComponent:function({item:r}){const s=(0,n.useRef)(null);return(0,e.createElement)("div",{id:`selected-pattern-${r.id}`,className:"gb-selected-pattern",ref:s},(0,e.createElement)("span",{className:"gb-selected-pattern__label",title:r.label},r.label),(0,e.createElement)("div",{className:"gb-selected-pattern__actions"},(0,e.createElement)(E,null),(0,e.createElement)(t.Button,{variant:"tertiary",icon:G,label:(0,a.__)("Remove Pattern","generateblocks"),onClick:()=>{p({type:"REMOVE",pattern:r})}}),(0,e.createElement)(t.Button,{variant:"tertiary",icon:M,label:(0,a.__)("Preview Pattern","generateblocks"),showTooltip:!0,disabled:!l.find((({id:e})=>e===r.id)),onClick:()=>{h(r.id);const e=s.current.closest(".gb-pattern-library__content");e&&b(e.scrollTop)}})))},dragHandle:!0}),(0,e.createElement)("div",{style:{display:"flex",gap:"5px",justifyContent:"space-between",marginTop:"1em"}},(0,e.createElement)(T,{label:(0,a.__)("Insert All","generateblocks"),patterns:m,globalStyleData:s,disabled:!m.length,onClick:async()=>{const e=m.reduce(((e,t)=>e+("string"==typeof t.pattern?t.pattern:"")),"");let t=[];try{t=(0,D.parse)(e)}catch(e){t=[]}if(!t.length)return;const n=y(),a=o(t),s=f();var i,l;a.forEach((e=>{e.attributes&&e.clientId&&v(e.clientId,e.attributes)})),c(s)?await u(s.clientId,a):await d(a,null!==(i=n?.index)&&void 0!==i?i:0,null!==(l=n.rootClientId)&&void 0!==l?l:""),r()}}),(0,e.createElement)(t.Button,{variant:"secondary",onClick:()=>i(!1),isDestructive:!0},(0,a.__)("Cancel","generateblocks"))))}const $=(0,e.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(h.Path,{d:"M20.5 16h-.7V8c0-1.1-.9-2-2-2H6.2c-1.1 0-2 .9-2 2v8h-.7c-.8 0-1.5.7-1.5 1.5h20c0-.8-.7-1.5-1.5-1.5zM5.7 8c0-.3.2-.5.5-.5h11.6c.3 0 .5.2.5.5v7.6H5.7V8z"})),Q=(0,e.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(h.Path,{d:"M17 4H7c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h10c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H7c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h10c.3 0 .5.2.5.5v12zm-7.5-.5h4V16h-4v1.5z"})),K=(0,e.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(h.Path,{d:"M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z"}));function Z({pattern:r,isSelected:n,bulkInsertEnabled:s,globalStyleData:i,closeModal:l,readOnly:o}){const{activePatternId:c,previewIframeWidth:d,setPreviewIframeWidth:u}=g();return(0,e.createElement)(O,{pattern:r,showPreview:!1,isSelected:n,showTitle:!1,bulkInsertEnabled:s,globalStyleData:i,closeModal:l,readOnly:o},!!c&&(0,e.createElement)(t.ButtonGroup,null,(0,e.createElement)(t.Button,{isPressed:"100%"===d,variant:"tertiary",icon:$,label:(0,a.__)("Desktop","generateblocks"),showTooltip:!0,onClick:()=>u("100%")}),(0,e.createElement)(t.Button,{isPressed:"900px"===d,variant:"tertiary",icon:Q,label:(0,a.__)("Tablet","generateblocks"),showTooltip:!0,onClick:()=>u("900px")}),(0,e.createElement)(t.Button,{isPressed:"400px"===d,variant:"tertiary",icon:K,label:(0,a.__)("Mobile","generateblocks"),showTooltip:!0,onClick:()=>u("400px")})))}const J=window.lodash,U=(0,e.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(h.Path,{d:"M5.5 12h1.75l-2.5 3-2.5-3H4a8 8 0 113.134 6.35l.907-1.194A6.5 6.5 0 105.5 12zm9.53 1.97l-2.28-2.28V8.5a.75.75 0 00-1.5 0V12a.747.747 0 00.218.529l1.282-.84-1.28.842 2.5 2.5a.75.75 0 101.06-1.061z"}));function X({setCacheIsClearing:r,cacheIsClearing:s}){const{activeLibrary:o,setLibraryCategories:c,setLibraryPatterns:d,isLocal:u}=g(),[m,p]=(0,n.useState)(!1);async function h(){if(u)return void p({});const e=await i()({path:(0,l.addQueryArgs)("/generateblocks/v1/pattern-library/get-cache-data",{id:o.id}),method:"GET"});var t;e.success?p(null!==(t=e?.response?.data)&&void 0!==t?t:{}):p({})}return(0,n.useEffect)((()=>{!async function(){o?.id&&h()}()}),[o?.id]),(0,J.isEmpty)(m)?null:(0,e.createElement)(t.Button,{className:"has-icon",variant:"tertiary",size:"compact",disabled:!m.can_clear||s,label:(0,a.__)("Refresh patterns","generateblocks"),showTooltip:!0,onClick:async()=>{r(!0),(await i()({path:"/generateblocks/v1/pattern-library/clear-cache",data:{id:o?.id},method:"POST"})).success&&(await c(),await d(),await h()),r(!1)}},s?(0,e.createElement)(t.Spinner,null):(0,e.createElement)(t.Icon,{icon:U}))}const Y=(0,e.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(h.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"})),ee=(0,e.createElement)(h.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,e.createElement)(h.Path,{d:"m19 7.5h-7.628c-.3089-.87389-1.1423-1.5-2.122-1.5-.97966 0-1.81309.62611-2.12197 1.5h-2.12803v1.5h2.12803c.30888.87389 1.14231 1.5 2.12197 1.5.9797 0 1.8131-.62611 2.122-1.5h7.628z"}),(0,e.createElement)(h.Path,{d:"m19 15h-2.128c-.3089-.8739-1.1423-1.5-2.122-1.5s-1.8131.6261-2.122 1.5h-7.628v1.5h7.628c.3089.8739 1.1423 1.5 2.122 1.5s1.8131-.6261 2.122-1.5h2.128z"}));async function te(e){return await i()({path:"generateblocks/v1/pattern-library/libraries/save",method:"POST",data:{data:e}})}function re({library:r,librariesToManage:n,setLibrariesToManage:s,isRemote:i}){const{setLibraries:l}=g();return(0,e.createElement)("div",{key:r.id,className:"gblocks-manage-libraries__library"},(0,e.createElement)("div",{className:"gblocks-manage-libraries__library-name"},i?(0,e.createElement)(t.Tooltip,{text:r.domain},(0,e.createElement)("span",null,r.name)):r.name,!!i&&(0,e.createElement)(t.Button,{size:"small",isDestructive:!0,variant:"secondary",onClick:async()=>{const e=[...n],t=e.findIndex((e=>e.id===r.id));e.splice(t,1),s(e);const a=await te(e);a.success&&a?.response?.data.length&&l(a?.response?.data.length)},icon:Y,label:(0,a.__)("Delete library","generateblocks"),showTooltip:!0})),(0,e.createElement)("div",{className:"gblocks-manage-libraries__library-actions"},(0,e.createElement)(t.ToggleControl,{checked:!!r.isEnabled,label:(0,a.__)("Enabled","generateblocks"),onChange:async()=>{const e=[...n],t=e.findIndex((e=>e.id===r.id));e[t]={...e[t],isEnabled:!n[t].isEnabled},s(e);const a=await te(e);a.success&&a?.response?.data.length&&l()}})))}function ne(){const[r,s]=(0,n.useState)(!1),[i,l]=(0,n.useState)([]);(0,n.useEffect)((()=>{!async function(){if(r)try{const{data:e}=await m(!1);l(Array.isArray(e)?e:[])}catch(e){l([])}}()}),[r]);const o=i.filter((e=>e.isDefault)),c=i.filter((e=>e.isLocal)),d=i.filter((e=>!e.isLocal&&!e.isDefault));return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t.Button,{variant:"tertiary",size:"compact",icon:ee,label:(0,a.__)("Manage Libraries","generateblocks"),showTooltip:!0,onClick:s}),!!r&&(0,e.createElement)(t.Modal,{title:(0,a.__)("Manage Libraries","generateblocks"),onRequestClose:()=>s(!1)},(0,e.createElement)("div",{className:"gblocks-manage-libraries"},!!o.length&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h4",null,(0,a.__)("Default","generateblocks")),(0,e.createElement)("div",{className:"gblocks-manage-libraries__table"},o.map((t=>(0,e.createElement)(re,{key:t.id,library:t,librariesToManage:i,setLibrariesToManage:l}))))),!!c.length&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h4",null,(0,a.__)("Local","generateblocks")),(0,e.createElement)("div",{className:"gblocks-manage-libraries__table"},c.map((t=>(0,e.createElement)(re,{key:t.id,library:t,librariesToManage:i,setLibrariesToManage:l}))))),!!d.length&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h4",null,(0,a.__)("Remote","generateblocks")),(0,e.createElement)("div",{className:"gblocks-manage-libraries__table"},d.map((t=>(0,e.createElement)(re,{key:t.id,library:t,librariesToManage:i,setLibrariesToManage:l,isRemote:!0}))))))))}wp.element.createElement;const ae={};function se({closeModal:r,readOnly:s}){var i;const{activePatternId:l,setActivePatternId:o,patterns:c,setScrollPosition:d,scrollPosition:u,activeCategory:m,search:p,setSearch:h,isLocal:E,activeLibrary:k,selectedPatterns:_}=g(),[C,L]=(0,n.useState)(!1),[P,x]=(0,n.useState)(c),[A,B]=(0,n.useState)(""),[M,N]=(0,n.useState)([]),[V,D]=(0,n.useState)(!1),T=c.find((e=>l===e.id)),O=null!==(i=T?.label)&&void 0!==i?i:(0,a.__)("Pattern preview","generateblocks"),R=(0,n.useRef)();function H(e){return c.filter((t=>{const r=""===m,n="string"==typeof t?.label?t.label:"",a=Array.isArray(t?.categories)?t.categories:[],s=n.toLowerCase().includes(e.toLowerCase()),i=a.includes(m);return r?s:s&&i}))}(0,n.useEffect)((()=>{x(""===m?c:H(p)),R.current&&(R.current.scrollTop=0)}),[c,m]);const F={};return l&&(F.gridColumn="1 / -1"),(0,v.doAction)("generateblocks.patterns.patternsList",{activeLibrary:k,setGlobalStyleCSS:B,setGlobalStyleData:N,isLocal:E,cacheIsClearing:V}),(0,e.createElement)("div",{className:"gb-pattern-library"},(0,e.createElement)("div",{className:"gb-pattern-library__header"},(0,e.createElement)("div",{className:"gb-pattern-library__header-title"},l?(0,e.createElement)("h1",null,(0,f.decodeEntities)(O)):(0,e.createElement)("h1",null,"headline"=="generateblocks"?(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"gblocks-block-icon"},(0,e.createElement)("path",{style:{fill:"none"},d:"M0 0h24v24H0z"}),(0,e.createElement)("path",{d:"M21.375 22h-5.769a.625.625 0 0 1-.625-.625v-6.042H9.019v6.042a.625.625 0 0 1-.625.625H2.625A.625.625 0 0 1 2 21.375V2.625C2 2.28 2.28 2 2.625 2h5.769c.346 0 .625.28.625.625v6.041h5.961V2.625A.626.626 0 0 1 15.606 2h5.769c.345 0 .625.28.625.625v18.75c0 .345-.28.625-.625.625zm-5.144-1.25h4.519V3.25h-4.519v6.041c0 .345-.28.625-.625.625H8.394a.625.625 0 0 1-.625-.625V3.25H3.25v17.5h4.519v-6.042c0-.345.28-.625.625-.625h7.212c.345 0 .625.28.625.625v6.042z"})):(0,e.createElement)("svg",{viewBox:"0 0 50 60.12",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("path",{d:"M6.686 31.622V18.918a.077.077 0 0 1 .05-.072l6.5-2.313 6.5-2.313 9.682-3.445L39.1 7.33a.067.067 0 0 0 .036-.028.074.074 0 0 0 .014-.044V.076a.077.077 0 0 0-.032-.062.076.076 0 0 0-.069-.009l-13 4.625-13 4.625-6.5 2.313-6.5 2.313a.067.067 0 0 0-.036.028.097.097 0 0 0-.013.046V52.067c0 .026.013.048.032.062s.044.018.069.009l3.267-1.163 3.267-1.163c.015-.005.028-.015.036-.028s.014-.028.014-.044V37.999l.001-6.377c-.001 0 0 0 0 0z"}),(0,e.createElement)("path",{d:"m23.949 29.976 13-4.625 13-4.625c.015-.005.028-.015.036-.028s.015-.028.015-.044V8.056a.077.077 0 0 0-.032-.062.076.076 0 0 0-.069-.009l-13 4.625-13 4.625-6.5 2.313-6.5 2.313a.067.067 0 0 0-.036.028.074.074 0 0 0-.014.044V60.045c0 .026.013.048.032.062a.076.076 0 0 0 .069.009l6.475-2.304 6.475-2.304 6.525-2.322 6.525-2.322 6.5-2.313 6.5-2.313c.015-.005.028-.015.036-.028s.014-.025.014-.041V27.193a.077.077 0 0 0-.032-.062.076.076 0 0 0-.069-.009l-6.45 2.295L37 31.711a.067.067 0 0 0-.036.028.074.074 0 0 0-.014.044v6.272a.077.077 0 0 1-.05.072l-6.45 2.295L24 42.715a.075.075 0 0 1-.101-.071V30.046c0-.016.005-.031.014-.044a.08.08 0 0 1 .036-.026z"}))," ",(0,a.__)("Pattern Library","generateblocks"))),(0,e.createElement)("div",{className:"gb-pattern-library__header-action"},l?!!T&&(0,e.createElement)(Z,{pattern:T,bulkInsertEnabled:C,globalStyleData:M,closeModal:r,readOnly:s}):(0,e.createElement)(I,{readOnly:s})),(0,e.createElement)("div",{className:"gb-pattern-library__header-close"},l?(0,e.createElement)(t.Button,{icon:y,onClick:()=>{o(""),d(u)}},(0,a.__)("Return to library")):(0,e.createElement)(e.Fragment,null,!s&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(X,{setCacheIsClearing:D,cacheIsClearing:V}),(0,e.createElement)(ne,null)),"function"==typeof r&&(0,e.createElement)(t.Button,{variant:"tertiary",icon:b,label:(0,a.__)("Close Pattern Library","generateblocks"),showTooltip:!0,onClick:r})))),(0,e.createElement)("div",{className:"gb-pattern-library__sidebar"},!l&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(q,{onChange:e=>{h(e);const t=""===m?"all":m,r=function(e){const t=""===m?"all":m,r=k?.id||"";return ae[r]&&ae[r][t]||(ae[r]=ae[r]||{},ae[r][t]=ae[r][t]||{}),!!ae[r][t][e]&&ae[r][t][e]}(e);if(r)return void x(r);const n=H(e),a=k?.id;a&&(ae[a][t][e]=n),x(n)}}),(0,e.createElement)(S,{bulkInsertEnabled:C,selectedPatterns:_}),!s&&(0,e.createElement)(e.Fragment,null,C?(0,e.createElement)(W,{closeModal:r,globalStyleData:M,setBulkInsertEnabled:L,filteredPatterns:P}):(0,e.createElement)(t.Button,{variant:"primary",onClick:()=>L(!0)},(0,a.__)("Bulk Insert","generateblocks"))))),(0,e.createElement)("div",{className:w()({"gb-pattern-library__content":!0,"gb-pattern-library__content--active":l}),style:F,ref:R},(0,e.createElement)(z,{patterns:P,bulkInsertEnabled:C,closeModal:r,globalStyleCSS:A,globalStyleData:M,readOnly:s})))}(0,v.addFilter)("generateblocks.editor.sidebar","generateblocks/pattern-library",(function(r,{activePanel:s}){const[i,l]=(0,n.useState)(!1);return s?r:(0,e.createElement)(e.Fragment,null,(0,e.createElement)(t.PanelBody,null,(0,e.createElement)("h2",{className:"gblocks-editor-sidebar__panel-title"},(0,a.__)("Pattern Library","generateblocks")),(0,e.createElement)(t.Button,{className:"gblocks-pattern-library-button",variant:"secondary",onClick:()=>l(!0),isPressed:i},(0,a.__)("Open Pattern Library","generateblocks"))),r,!!i&&(0,e.createElement)(t.Modal,{className:"gblocks-pattern-library-modal",isFullScreen:!0,onRequestClose:()=>l(!1)},(0,e.createElement)(p,null,(0,e.createElement)(se,{closeModal:()=>l(!1),readOnly:!1}))))}))})()})();
💾 Save Changes
❌ Cancel