HEX
Server: Apache
System: Linux sxb1plzcpnl489831.prod.sxb1.secureserver.net 4.18.0-553.52.1.lve.el8.x86_64 #1 SMP Wed May 21 15:31:29 UTC 2025 x86_64
User: j2d7uhbqfejh (10030402)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/j2d7uhbqfejh/public_html/zorgosso.nl/wp-content/plugins/foogallery/gutenberg/assets/blocks.js
!function(){var e={184:function(e,t){var l;!function(){"use strict";var o={}.hasOwnProperty;function n(){for(var e=[],t=0;t<arguments.length;t++){var l=arguments[t];if(l){var r=typeof l;if("string"===r||"number"===r)e.push(l);else if(Array.isArray(l)){if(l.length){var a=n.apply(null,l);a&&e.push(a)}}else if("object"===r){if(l.toString!==Object.prototype.toString&&!l.toString.toString().includes("[native code]")){e.push(l.toString());continue}for(var s in l)o.call(l,s)&&l[s]&&e.push(s)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):void 0===(l=function(){return n}.apply(t,[]))||(e.exports=l)}()}},t={};function l(o){var n=t[o];if(void 0!==n)return n.exports;var r=t[o]={exports:{}};return e[o](r,r.exports,l),r.exports}l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var o in t)l.o(t,o)&&!l.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){"use strict";var e=window.wp.element,t=window.wp.blocks,o=window.wp.blockEditor;function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var o in l)Object.prototype.hasOwnProperty.call(l,o)&&(e[o]=l[o])}return e},n.apply(this,arguments)}const r=[];class a{static get array(){return r}static add(e,t){return-1===r.findIndex((t=>t.id===e))&&(r.push({id:e,clientId:t}),!0)}static remove(e){let t=r.findIndex((t=>t.clientId===e));return-1!==t?(r.splice(t,1),!0):-1===t||!1}static update(e,t){return!!this.remove(t)&&this.add(e,t)}static ids(){return r.map((e=>e.id))}static contains(e,t){return-1!==r.findIndex((l=>l.id===e&&l.clientId!==t))}}var s=l(184),i=l.n(s),c=window.wp.components;class d extends e.Component{render(){const{data:t,className:l,isSelected:o,isDisabled:n,onSelected:r}=this.props;let a={className:i()("foogallery-modal__item",l,{"is-selected":o,"is-disabled":n})};if(!n){let e={onClick:e=>{e.stopPropagation(),r(t.id)},onKeyPress:e=>{e.stopPropagation(),32!==e.which&&13!==e.which||r(t.id)},tabIndex:0};a={...a,...e}}let s=t.thumbnail?(0,e.createElement)("img",{className:"foogallery-modal__item-thumbnail",src:t.thumbnail,alt:t.name}):(0,e.createElement)(c.Dashicon,{className:"foogallery-modal__item-thumbnail",icon:"format-image"});return(0,e.createElement)("figure",a,s,(0,e.createElement)("figcaption",{className:"foogallery-modal__item-caption"},t.name),o?(0,e.createElement)(c.Dashicon,{className:"foogallery-modal__icon-selected",icon:"yes"}):null,n?(0,e.createElement)(c.Dashicon,{className:"foogallery-modal__icon-disabled",icon:"no"}):null)}}d.defaultProps={data:{},className:"",isSelected:!1,isDisabled:!1,onSelected:_.noop};var u=window.wp.i18n;class p extends e.Component{constructor(){super(...arguments),this.state={id:this.props.currentId,data:null,isLoading:!1,query:""},this.onReloadClick=this.onReloadClick.bind(this),this.onInsertClick=this.onInsertClick.bind(this),this.onQueryChange=this.onQueryChange.bind(this)}async fetchGalleries(){this.setState({data:null,isLoading:!0});let e=await wp.apiFetch({path:"/foogallery/v1/galleries/"});e.forEach((e=>{e.lowerName="string"==typeof e.name?e.name.toLowerCase():""})),this.setState({data:e,isLoading:!1})}componentDidMount(){const{data:e,isLoading:t}=this.state;null!==e||t||this.fetchGalleries()}onReloadClick(e){e.stopPropagation(),this.fetchGalleries()}onInsertClick(e){e.stopPropagation();const{onRequestModalClose:t,onRequestGalleryInsert:l}=this.props,{id:o}=this.state;0!==o&&(l(o),t())}onQueryChange(e){this.setState({query:e.target.value})}render(){const{isModalOpen:t,className:l,title:o,insert:n,reload:r,search:a,onRequestModalClose:s}=this.props;if(!t)return null;const{id:d,isLoading:u,query:p}=this.state;return(0,e.createElement)(c.Modal,{className:i()("foogallery-modal",l),title:o,onRequestClose:s},(0,e.createElement)("div",{className:"foogallery-modal__content"},(0,e.createElement)("div",{className:"foogallery-modal__content-container"},this.renderContent())),(0,e.createElement)("div",{className:"foogallery-modal__footer"},(0,e.createElement)("input",{type:"text",className:"foogallery-modal__footer-search",placeholder:a,value:p,onChange:this.onQueryChange}),(0,e.createElement)("div",{className:"foogallery-modal__footer-buttons"},(0,e.createElement)(c.Button,{isSecondary:!0,icon:"update",label:r,onClick:this.onReloadClick,disabled:u}),(0,e.createElement)(c.Button,{isPrimary:!0,onClick:this.onInsertClick,disabled:0===d},n))))}renderContent(){const{disable:t,empty:l,loading:o}=this.props,{id:n,data:r,isLoading:a,query:s}=this.state;if(null===r&&!a)return null;if(a)return(0,e.createElement)(c.Placeholder,{className:"foogallery-modal__content-placeholder",label:o},(0,e.createElement)(c.Spinner,null));if(null===r||!r.length)return(0,e.createElement)(c.Placeholder,{className:"foogallery-modal__content-placeholder",label:l});let i=this,u=s&&s.length>2,p=u?s.toLowerCase():"";return(u?r.filter((e=>-1!==e.lowerName.indexOf(p))):r).map((l=>(0,e.createElement)(d,{key:l.id,data:l,isSelected:n===l.id,isDisabled:-1!==t.indexOf(l.id),onSelected:e=>{i.setState({id:n===e?0:e})}})))}}p.defaultProps={currentId:0,isModalOpen:!1,className:"",title:(0,u.__)("Select a gallery"),empty:(0,u.__)("No galleries found!"),insert:(0,u.__)("Insert Gallery"),reload:(0,u.__)("Reload Galleries"),loading:(0,u.__)("Loading galleries please wait..."),search:(0,u.__)("Search..."),disable:[],onRequestGalleryInsert:_.noop,onRequestModalClose:_.noop};class m extends e.Component{render(){const{select:t,onRequestModalOpen:l,canEdit:n,edit:r,onRequestGalleryEdit:a,canReload:s,reload:i,onRequestGalleryReload:d,remove:u,onRequestBlockRemove:p,children:m}=this.props;return(0,e.createElement)(o.BlockControls,null,(0,e.createElement)(c.ToolbarGroup,{className:"foogallery__toolbar-group"},(0,e.createElement)(c.ToolbarButton,{icon:"trash",label:u,onClick:p})),(0,e.createElement)(c.ToolbarGroup,{className:"foogallery__toolbar-group"},(0,e.createElement)(c.ToolbarButton,{icon:"format-gallery",label:t,onClick:l}),n?(0,e.createElement)(c.ToolbarButton,{icon:"edit",label:r,onClick:a}):null,s?(0,e.createElement)(c.ToolbarButton,{icon:"update",label:i,onClick:d}):null),m)}}m.defaultProps={canEdit:!1,canReload:!1,select:(0,u.__)("Select gallery","foogallery"),remove:(0,u.__)("Remove gallery","foogallery"),reload:(0,u.__)("Reload gallery","foogallery"),edit:(0,u.__)("Edit gallery","foogallery"),onRequestModalOpen:_.noop,onRequestBlockRemove:_.noop,onRequestGalleryEdit:_.noop,onRequestGalleryReload:_.noop};class y extends e.Component{render(){const{select:t,onRequestModalOpen:l,canEdit:n,edit:r,onRequestGalleryEdit:a,children:s}=this.props;return(0,e.createElement)(o.InspectorControls,null,(0,e.createElement)("div",{className:"foogallery-inspector-controls__button-container"},n?(0,e.createElement)(c.Button,{isSecondary:!0,onClick:a,icon:"edit",label:r}):null," ",(0,e.createElement)(c.Button,{isPrimary:!0,onClick:l},t)),s)}}y.defaultProps={canEdit:!1,edit:(0,u.__)("Edit Gallery","foogallery"),select:(0,u.__)("Select Gallery","foogallery"),onRequestGalleryEdit:_.noop,onRequestModalOpen:_.noop};class h extends e.Component{render(){const{className:t,children:l,...o}=this.props;return(0,e.createElement)(c.Placeholder,n({className:i()("editor-media-placeholder foogallery__placeholder",t)},o),l)}}var f=window.wp.serverSideRender;function g(t){let{block:l="fooplugins/foogallery",attributes:o={},urlQueryArgs:n={},reload:r=!1,loading:a=(0,u.__)("Loading gallery...","foogallery"),error:s=(0,u.__)("Error loading gallery: %s","foogallery"),empty:i=(0,u.__)("No gallery was found.","foogallery")}=t;const d=(0,e.useRef)(null),p={...n,_foogalleryReload:r?"1":"0"},{status:m,content:y,error:g}=(0,f.useServerSideRender)({block:l,attributes:o,urlQueryArgs:p});if((0,e.useEffect)((()=>{if("success"!==m||!y||!d.current)return;if("undefined"==typeof jQuery||"undefined"==typeof FooGallery)return;const e=d.current?.ownerDocument?.defaultView;e?.FooGallery&&e?.FooGallery.$&&e.FooGallery.$(d.current).children(".foogallery").foogallery(e.FooGallery.autoDefaults)}),[m,y]),"loading"===m||"idle"===m)return(0,e.createElement)(h,{instructions:a},(0,e.createElement)(c.Spinner,null));if("error"===m){const t=(0,u.sprintf)(s,g);return(0,e.createElement)(h,{instructions:t})}return y?(0,e.createElement)("div",{dangerouslySetInnerHTML:{__html:y},ref:d}):(0,e.createElement)(h,{instructions:i})}class b extends e.Component{render(){const{icon:t,label:l,instructions:o,button:n,...r}=this.props;let a={icon:t,label:l,instructions:o};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(m,r),(0,e.createElement)(h,a,(0,e.createElement)(c.Button,{isSecondary:!0,onClick:r.onRequestModalOpen},n)),(0,e.createElement)(p,r),(0,e.createElement)(y,r))}}b.defaultProps={icon:"format-gallery",label:(0,u.__)("FooGallery","foogallery"),instructions:(0,u.__)("Select the gallery you want to insert.","foogallery"),button:(0,u.__)("Select Gallery","foogallery"),onRequestModalOpen:_.noop};class E extends e.Component{render(){const{icon:t,label:l,instructions:o,button:n,...r}=this.props;let a={icon:t,label:l,instructions:o};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(m,r),(0,e.createElement)(h,a,(0,e.createElement)(c.Button,{isSecondary:!0,onClick:r.onRequestModalOpen},n)),(0,e.createElement)(p,r),(0,e.createElement)(y,r))}}E.defaultProps={icon:"format-gallery",label:(0,u.__)("FooGallery","foogallery"),instructions:(0,u.__)("Duplicate gallery, please select another to insert.","foogallery"),button:(0,u.__)("Select Gallery","foogallery"),onRequestModalOpen:_.noop};class v extends e.Component{render(){const{block:t,attributes:l,reload:o,...n}=this.props;return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(m,n),(0,e.createElement)(g,{block:t,attributes:l,reload:o}),(0,e.createElement)(p,n),(0,e.createElement)(y,n))}}v.defaultProps={block:"fooplugins/foogallery",attributes:{},reload:!1,canEdit:!0,canReload:!0};var R=window.wp.data;const{editGalleryUrl:w}=window.FOOGALLERY_BLOCK;class C extends e.Component{constructor(){super(...arguments),this.state={isModalOpen:!1,reload:!1},this.showModal=this.showModal.bind(this),this.closeModal=this.closeModal.bind(this),this.insertGallery=this.insertGallery.bind(this),this.editGallery=this.editGallery.bind(this),this.reloadGallery=this.reloadGallery.bind(this),this.removeBlock=this.removeBlock.bind(this)}componentDidMount(){const{clientId:e,attributes:{id:t}}=this.props;0!==t&&a.add(t,e)}componentWillUnmount(){const{clientId:e,attributes:{id:t}}=this.props;0!==t&&a.remove(e)}showModal(){this.setState({isModalOpen:!0})}closeModal(){this.setState({isModalOpen:!1})}insertGallery(e){const{clientId:t,setAttributes:l}=this.props;a.update(e,t),l({id:e})}editGallery(){const{attributes:{id:e}}=this.props;let t=(0,u.sprintf)(w,e);window.open(t,"_blank")}reloadGallery(){const{reload:e}=this.state;this.setState({reload:!e})}removeBlock(){const{clientId:e}=this.props;(0,R.dispatch)("core/editor").removeBlock(e)}render(){const{attributes:t,clientId:l}=this.props,{isModalOpen:o,reload:r}=this.state;let s={disable:a.ids(),isModalOpen:o,onRequestModalOpen:this.showModal,onRequestModalClose:this.closeModal,onRequestBlockRemove:this.removeBlock,onRequestGalleryInsert:this.insertGallery,onRequestGalleryEdit:this.editGallery,onRequestGalleryReload:this.reloadGallery};return a.contains(t.id,l)?(0,e.createElement)(E,s):t.id?(0,e.createElement)(v,n({attributes:t,reload:r},s)):(0,e.createElement)(b,s)}}C.defaultProps={};var G=JSON.parse('{"$schema":"https://schemas.wp.org/trunk/block.json","apiVersion":3,"name":"fooplugins/foogallery","title":"FooGallery","description":"Insert a FooGallery into your content","category":"media","icon":"format-gallery","keywords":["foogallery","gallery"],"textdomain":"foogallery","attributes":{"id":{"type":"number","default":0},"className":{"type":"string"}},"supports":{"multiple":true,"html":false}}');const k=t=>{const l=(0,o.useBlockProps)();return(0,e.createElement)("div",l,(0,e.createElement)(C,t))};(0,t.registerBlockType)(G.name,{...G,edit(t){return(0,e.createElement)(k,t)},save(){return null}})}()}();