2021-06-28 18:01:36 +02:00
|
|
|
this.wp=this.wp||{},this.wp.widgets=function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i:i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s="4g8P")}({"1ZqX":function(e,t){e.exports=window.wp.data},"4g8P":function(e,t,n){"use strict";n.r(t),n.d(t,"MoveToWidgetArea",(function(){return Q})),n.d(t,"getWidgetIdFromBlock",(function(){return R})),n.d(t,"addWidgetIdToBlock",(function(){return G})),n.d(t,"registerLegacyWidgetBlock",(function(){return q})),n.d(t,"registerLegacyWidgetVariations",(function(){return U}));var i={};n.r(i),n.d(i,"metadata",(function(){return N})),n.d(i,"name",(function(){return V})),n.d(i,"settings",(function(){return A}));var r=n("HSyU"),a=n("GRId"),o=n("Tqx9");var s=Object(a.createElement)(o.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},Object(a.createElement)(o.Path,{d:"M7 11h2v2H7v-2zm14-5v14l-2 2H5l-2-2V6l2-2h1V2h2v2h8V2h2v2h1l2 2zM5 8h14V6H5v2zm14 12V10H5v10h14zm-4-7h2v-2h-2v2zm-4 0h2v-2h-2v2z"})),c=n("TSYQ"),l=n.n(c),d=n("axFQ"),u=n("tI+e");var h=Object(a.createElement)(o.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},Object(a.createElement)(o.Path,{d:"M4 20h8v-1.5H4V20zM18.9 3.5c-.6-.6-1.5-.6-2.1 0l-7.2 7.2c-.4-.1-.7 0-1.1.1-.5.2-1.5.7-1.9 2.2-.4 1.7-.8 2.2-1.1 2.7-.1.1-.2.3-.3.4l-.6 1.1H6c2 0 3.4-.4 4.7-1.4.8-.6 1.2-1.4 1.3-2.3 0-.3 0-.5-.1-.7L19 5.7c.5-.6.5-1.6-.1-2.2zM9.7 14.7c-.7.5-1.5.8-2.4 1 .2-.5.5-1.2.8-2.3.2-.6.4-1 .8-1.1.5-.1 1 .1 1.3.3.2.2.3.5.2.8 0 .3-.1.9-.7 1.3z"})),m=n("l3Sj"),w=n("1ZqX"),g=n("jZUy");function b({selectedId:e,onSelect:t}){const n=Object(w.useSelect)(e=>{var t,n,i;const r=null!==(t=null===(n=e(d.store).getSettings())||void 0===n?void 0:n.widgetTypesToHideFromLegacyWidgetBlock)&&void 0!==t?t:[];return null===(i=e(g.store).getWidgetTypes({per_page:-1}))||void 0===i?void 0:i.filter(e=>!r.includes(e.id))},[]);return n?0===n.length?Object(m.__)("There are no widgets available."):Object(a.createElement)(u.SelectControl,{label:Object(m.__)("Select a legacy widget to display:"),value:null!=e?e:"",options:[{value:"",label:Object(m.__)("Select widget")},...n.map(e=>({value:e.id,label:e.name}))],onChange:e=>{if(e){const i=n.find(t=>t.id===e);t({selectedId:i.id,isMulti:i.is_multi})}else t({selectedId:null})}}):Object(a.createElement)(u.Spinner,null)}function p({name:e,description:t}){return Object(a.createElement)("div",{className:"wp-block-legacy-widget-inspector-card"},Object(a.createElement)("h3",{className:"wp-block-legacy-widget-inspector-card__name"},e),Object(a.createElement)("span",null,t))}var f=n("onLe"),v=n("K9lf"),y=n("YLtl"),j=n("ywyh"),O=n.n(j);class _{constructor({id:e,idBase:t,instance:n,onChangeInstance:i,onChangeHasPreview:r,onError:a}){this.id=e,this.idBase=t,this._instance=n,this._hasPreview=null,this.onChangeInstance=i,this.onChangeHasPreview=r,this.onError=a,this.number=++E,this.handleFormChange=Object(y.debounce)(this.handleFormChange.bind(this),200),this.handleFormSubmit=this.handleFormSubmit.bind(this),this.initDOM(),this.bindEvents(),this.loadContent()}destroy(){this.unbindEvents(),this.element.remove()}initDOM(){var e,t;this.element=k("div",{class:"widget open"},[k("div",{class:"widget-inside"},[this.form=k("form",{class:"form",method:"post"},[k("input",{class:"widget-id",type:"hidden",name:"widget-id",value:null!==(e=this.id)&&
|