Plugin Directory

Changeset 3390422

Timestamp:
11/05/2025 12:06:14 PM (4 months ago)
Author:
paulkevan
Message:

Update to version 1.4.2 from GitHub

Location:
remote-data-blocks
Files:
509 added
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • remote-data-blocks/trunk/build/blocks/remote-data-container/index.asset.php

    r3388907 r3390422  
    1 <?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '8acc8ed8d23c91461daf');
     1<?php return array('dependencies' => array('react-jsx-runtime', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-data', 'wp-editor', 'wp-element', 'wp-i18n', 'wp-primitives'), 'version' => '');
  • remote-data-blocks/trunk/build/blocks/remote-data-container/index.js

    r3388907 r3390422  
    1 (()=>{var e,t={9545:(e,t)=>{"use strict";t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},o=e.length;if(o<2)return n;var i=t&&t.decode||u,s=0,a=0,p=0;do{if(-1===(a=e.indexOf("=",s)))break;if(-1===(p=e.indexOf(";",s)))p=o;else if(a>p){s=e.lastIndexOf(";",a-1)+1;continue}var f=l(e,s,a),h=c(e,a,f),v=e.slice(f,h);if(!r.call(n,v)){var g=l(e,a+1,p),m=c(e,p,g);34===e.charCodeAt(g)&&34===e.charCodeAt(m-1)&&(g++,m--);var b=e.slice(g,m);n[v]=d(b,i)}s=p+1}while(s<o);return n},t.serialize=function(e,t,r){var l=r&&r.encode||encodeURIComponent;if("function"!=typeof l)throw new TypeError("option encode is invalid");if(!o.test(e))throw new TypeError("argument name is invalid");var c=l(t);if(!i.test(c))throw new TypeError("argument val is invalid");var u=e+"="+c;if(!r)return u;if(null!=r.maxAge){var d=Math.floor(r.maxAge);if(!isFinite(d))throw new TypeError("option maxAge is invalid");u+="; Max-Age="+d}if(r.domain){if(!s.test(r.domain))throw new TypeError("option domain is invalid");u+="; Domain="+r.domain}if(r.path){if(!a.test(r.path))throw new TypeError("option path is invalid");u+="; Path="+r.path}if(r.expires){var p=r.expires;if(!function(e){return"[object Date]"===n.call(e)}(p)||isNaN(p.valueOf()))throw new TypeError("option expires is invalid");u+="; Expires="+p.toUTCString()}if(r.httpOnly&&(u+="; HttpOnly"),r.secure&&(u+="; Secure"),r.partitioned&&(u+="; Partitioned"),r.priority)switch("string"==typeof r.priority?r.priority.toLowerCase():r.priority){case"low":u+="; Priority=Low";break;case"medium":u+="; Priority=Medium";break;case"high":u+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;case"none":u+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return u};var n=Object.prototype.toString,r=Object.prototype.hasOwnProperty,o=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,i=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,s=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/;function l(e,t,n){do{var r=e.charCodeAt(t);if(32!==r&&9!==r)return t}while(++t<n);return n}function c(e,t,n){for(;t>n;){var r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return n}function u(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function d(e,t){try{return t(e)}catch(t){return e}}},1510:(e,t,n)=>{"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.getCallbacksMap=s,t.isLoading=a,t.addScriptCallback=function(e,t){var n=s();a(e)?(o('Adding a callback for an existing script from "'.concat(e,'"')),n.get(e).add(t)):(o('Adding a callback for a new script from "'.concat(e,'"')),n.set(e,new Set([t])))},t.removeScriptCallback=function(e,t){if(o('Removing a known callback for a script from "'.concat(e,'"')),a(e)){var n=s(),r=n.get(e);r.delete(t),0===r.size&&n.delete(e)}},t.removeScriptCallbacks=function(e){o('Removing all callbacks for a script from "'.concat(e,'"')),s().delete(e)},t.removeAllScriptCallbacks=function(){o("Removing all callbacks for scripts from all URLs"),s().clear()},t.executeCallbacks=l,t.handleRequestSuccess=function(){var e=this.getAttribute("src");o('Handling successful request for "'.concat(e,'"')),l(e),this.onload=null},t.handleRequestError=function(){var e=this.getAttribute("src");o('Handling failed request for "'.concat(e,'"')),l(e,new Error('Failed to load script "'.concat(e,'"'))),this.onerror=null};var o=(0,r(n(2769)).default)("lib/load-script/callback-handler"),i=new Map;function s(){return i}function a(e){return s().has(e)}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(),r=n.get(e);if(r){var i='Executing callbacks for "'.concat(e,'"')+(null===t?" with success":' with error "'.concat(t,'"'));o(i),r.forEach((function(e){"function"==typeof e&&e(t)})),n.delete(e)}}},8469:(e,t,n)=>{"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.createScriptElement=function(e){s('Creating script element for "'.concat(e,'"'));var t=document.createElement("script");return t.src=e,t.type="text/javascript",t.async=!0,t.onload=i.handleRequestSuccess,t.onerror=i.handleRequestError,t},t.attachToHead=function(e){s("Attaching element to head"),document.head.appendChild(e)};var o=r(n(2769)),i=n(1510),s=(0,o.default)("lib/load-script/dom-operations")},1050:(e,t,n)=>{"use strict";var r=n(4994);t.k0=function(e,t){if(!(0,i.isLoading)(e)&&(0,s.attachToHead)((0,s.createScriptElement)(e)),"function"!=typeof t)return new Promise((function(t,n){(0,i.addScriptCallback)(e,(function(e){null===e?t():n(e)}))}));(0,i.addScriptCallback)(e,t)};var o=r(n(2769)),i=n(1510),s=n(8469);(0,o.default)("package/load-script")},2769:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}t.log=function(){var e;return"object"===("undefined"==typeof console?"undefined":r(console))&&console.log&&(e=console).log.apply(e,arguments)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),this.useColors){var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)}},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=n(2632)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2632:(e,t,n)=>{"use strict";e.exports=function(e){function t(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return r.colors[Math.abs(t)%r.colors.length]}function r(e){var n;function s(){if(s.enabled){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var i=s,a=Number(new Date),l=a-(n||a);i.diff=l,i.prev=n,i.curr=a,n=a,t[0]=r.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");var c=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(function(e,n){if("%%"===e)return e;c++;var o=r.formatters[n];if("function"==typeof o){var s=t[c];e=o.call(i,s),t.splice(c,1),c--}return e})),r.formatArgs.call(i,t),(i.log||r.log).apply(i,t)}}return s.namespace=e,s.enabled=r.enabled(e),s.useColors=r.useColors(),s.color=t(e),s.destroy=o,s.extend=i,"function"==typeof r.init&&r.init(s),r.instances.push(s),s}function o(){var e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}function i(e,t){return r(this.namespace+(void 0===t?":":t)+e)}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){r.enable("")},r.enable=function(e){var t;r.save(e),r.names=[],r.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(t=0;t<o;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")));for(t=0;t<r.instances.length;t++){var i=r.instances[t];i.enabled=r.enabled(i.namespace)}},r.enabled=function(e){if("*"===e[e.length-1])return!0;var t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=n(6585),Object.keys(e).forEach((function(t){r[t]=e[t]})),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=t,r.enable(r.load()),r}},6540:(e,t,n)=>{"use strict";const r=window.wp.blocks,o=window.ReactJSXRuntime,i=window.wp.blockEditor,s=window.wp.components,a=window.wp.data,l=window.wp.element,c=window.wp.i18n;function u(e){var t,n;return null===(n=null===(t=window.REMOTE_DATA_BLOCKS)||void 0===t?void 0:t.config)||void 0===n?void 0:n[e]}function d(e){var t,n;return e&&null!==(n=null===(t=u(e))||void 0===t?void 0:t.dataSourceType)&&void 0!==n?n:""}function p(e){var t,n,r;return e?null!==(r=null===(n=null===(t=u(e))||void 0===t?void 0:t.settings)||void 0===n?void 0:n.title)&&void 0!==r?r:e.replace("remote-data-blocks/",""):""}function f(e,t){return function(...e){return e.filter(Boolean).join(" ")}(t,`rdb-${n=e,n.replace(/[^a-zA-Z\d\u00C0-\u00FF]/g,"-").toLowerCase()}`);var n}const h="display",v=null!==(m=null===(g=window.REMOTE_DATA_BLOCKS)||void 0===g?void 0:g.rest_url)&&void 0!==m?m:"http://127.0.0.1:9999";var g,m;const b=f("container"),y="ui:search_input",_=["id","id:list"],C=["image_url"];function w({onUpdateQueryInputs:e,remoteData:t,selectors:n}){var r,i;const{queryInputs:a=[],queryKey:u=h}=t,[d,p]=(0,l.useState)(a),f=null!==(i=null===(r=null==n?void 0:n.find((e=>e.query_key===u)))||void 0===r?void 0:r.inputs)&&void 0!==i?i:[];return(0,o.jsx)(s.PanelBody,{title:(0,c.__)("Query Inputs","remote-data-blocks"),children:(0,o.jsxs)("form",{onSubmit:t=>{t.preventDefault();const n=d.map((e=>{const t=Object.entries(e).map((([e,t])=>[e,"string"==typeof t&&t.includes(",")?t.split(",").map((e=>e.trim())).filter(Boolean):t]));return Object.fromEntries(t)}));e(u,n)},children:[d.map(((t,n)=>Object.entries(t).map((([t,r])=>{var i;const a=Array.isArray(r)?r.join(","):r,l=f.find((e=>e.slug===t));return(0,o.jsx)(s.TextControl,{label:null!==(i=null==l?void 0:l.name)&&void 0!==i?i:t,value:a,onChange:e=>{p(d.map(((r,o)=>o===n?Object.assign(Object.assign({},r),{[t]:e}):r)))},onBlur:()=>{e(u,d)},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0},`${n}-${t}`)})))),(0,o.jsx)(s.Button,{variant:"primary",type:"submit",children:(0,c.__)("Update","remote-data-blocks")})]})})}const k=window.wp.primitives,x=(0,o.jsx)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"})});function j({blockTitle:e,error:t,onRetry:n}){const[r,i]=(0,l.useState)(!1);return(0,o.jsxs)(s.Placeholder,{className:"remote-data-container-error",icon:x,label:(0,c.sprintf)((0,c.__)("Remote data source error (%s)"),e),children:[(0,o.jsx)(s.Icon,{className:"remote-data-container-error__icon-overlay",icon:x}),(0,o.jsxs)(s.__experimentalHStack,{justify:"flex-start",children:[(0,o.jsx)(s.Button,{variant:"secondary",onClick:n,children:(0,c.__)("Try again")}),(0,o.jsx)(s.Button,{variant:"tertiary",onClick:()=>i(!r),children:(0,c.sprintf)((0,c.__)("%s error details"),r?"Hide":"Show")})]}),r&&(0,o.jsx)("code",{className:"remote-data-container-error__content is-"+(r?"open":"closed"),children:t.message})]})}class O extends l.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,o.jsx)(j,{blockTitle:this.props.blockTitle,error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function S(){return(0,o.jsx)(i.InnerBlocks,{renderAppender:i.InnerBlocks.DefaultBlockAppender})}var F=n(7833);const P=n.n(F)()("calypso:analytics");let E;n(2287);let I=null;"undefined"!=typeof window&&window.addEventListener("popstate",(function(){I=null}));var A=n(9545);const B=["AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GR","HR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK","GB","CH","IS","LI","NO"],L=["california","colorado","connecticut","utah","virginia","texas","tennessee","oregon","new jersey","montana","iowa","indiana","delaware"],N="sensitive_pixel_option",T="sensitive_pixel_options",R={ok:!1,buckets:{essential:!0,analytics:!1,advertising:!1}},D={ok:!1,buckets:{essential:!0,analytics:!0,advertising:!1}},M={ok:!0,buckets:{essential:!0,analytics:!0,advertising:!0}},q=(e,t,n=R)=>{const{ok:r,buckets:o}=e?JSON.parse(e):{};return"boolean"==typeof r?{ok:r,buckets:{...n.buckets,...o}}:t&&["yes","no"].includes(t)?{ok:"yes"===t,buckets:M.buckets}:n};var z=n(7007),H=n(1050);const $=["calypso","jetpack","remotedatablocks","wpcom_dsp_widget"],U=["a8c_cookie_banner_ok","a8c_cookie_banner_view","a8c_ccpa_optout","wcadmin_storeprofiler_create_jetpack_account","wcadmin_storeprofiler_connect_store","wcadmin_storeprofiler_login_jetpack_account","wcadmin_storeprofiler_payment_login","wcadmin_storeprofiler_payment_create_account","calypso_checkout_switch_to_p_24","calypso_checkout_composite_p24_submit_clicked","wpcom_launchbar_button_click","wpcom_support_free_migration_request_click"];let V,K=Promise.resolve();"undefined"!=typeof document&&(K=(0,H.k0)("//stats.wp.com/w.js?67"));const G=new z.EventEmitter;function J(e,t){t=t||{};const n=E;n?.localeSlug&&(t.user_lang=n.localeSlug);const r=function(){if("undefined"==typeof document)return M;const e=A.parse(document.cookie),t="unknown"===(n=e.country_code)||void 0!==n&&B.includes(n);var n;const r=function(e,t){return"US"===e&&("unknown"===t||void 0!==t&&L.includes(t.toLowerCase()))}(e.country_code,e.region);if(!t&&!r)return M;const o=t?D:M,{ok:i,buckets:s}=q(e[T],e[N],o);return r?{ok:i,buckets:{...M.buckets,advertising:s.advertising}}:{ok:i,buckets:s}}();if(r?.buckets.analytics)if(P('Record event "%s" called with props %o',e,t),function(e){return $.some((t=>e.startsWith(`${t}_`)))}(e)||U.includes(e)){if(V){const e=V(t);t={...t,...e}}t=Object.fromEntries(Object.entries(t).filter((([,e])=>void 0!==e))),P('Recording event "%s" with actual props %o',e,t),o=["recordEvent",e,t],"undefined"!=typeof window&&(window._tkq=window._tkq||[],window._tkq.push(o)),G.emit("record-event",e,t)}else P("- Event name must be prefixed by a known source or added to `EVENT_NAME_EXCEPTIONS`");else P('Analytics has been disabled - Ignoring event "%s" with actual props %o',e,t);var o}const Z="remotedatablocks_";function Q(e,t){const n=function(){var e;return null===(e=window.REMOTE_DATA_BLOCKS)||void 0===e?void 0:e.tracks_global_properties}();n&&"local"!==n.vip_env&&J(`${Z}${e}`,Object.assign(Object.assign({},n),t))}function W(e){const{refreshRemoteData:t,remoteData:n,resetRemoteData:r}=e,[i,a]=(0,l.useState)(!1);return n?(0,o.jsx)(s.PanelBody,{title:(0,c.__)("Remote data management","remote-data-blocks"),children:(0,o.jsxs)(s.__experimentalToggleGroupControl,{className:"remote-data-blocks-button-group",label:(0,c.__)(""),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,children:[(0,o.jsx)(s.Button,{onClick:function(){t(),Q("remote_data_container_actions",{action:"refresh_block_data",data_source_type:d(n.blockName)})},style:{marginRight:"10px"},variant:"primary",children:(0,c.__)("Refresh","remote-data-blocks")}),(0,o.jsx)(s.Button,{isDestructive:!0,onClick:()=>a(!0),variant:"secondary",children:(0,c.__)("Reset Block","remote-data-blocks")}),i&&(0,o.jsx)(s.__experimentalConfirmDialog,{isOpen:i,confirmButtonText:(0,c.__)("Reset Block","remote-data-blocks"),onCancel:()=>a(!1),onConfirm:function(){r(),a(!1),Q("remote_data_container_actions",{action:"reset_block_data",data_source_type:d(n.blockName)})},style:{maxWidth:"20em"},children:(0,c.__)("Are you sure you want to reset the block? This will remove all remote data and reset the block to its initial state.","remote-data-blocks")})]})}):null}function X(e){const{blockConfig:t,remoteData:n,updateRemoteData:r}=e,{availableOverrides:i}=t;if(!(null==i?void 0:i.length))return null;const a=new Set(n.enabledOverrides);return(0,o.jsxs)(s.PanelBody,{title:(0,c.__)("Remote data overrides","remote-data-blocks"),children:[(0,o.jsx)("p",{children:(0,c.__)("Overrides potentially alter the behavior of this block based on custom logic. If you have questions about what these overrides do, please contact your site administrator.","remote-data-blocks")}),i.map((e=>{var t;return(0,o.jsx)(s.CheckboxControl,{checked:null===(t=n.enabledOverrides)||void 0===t?void 0:t.includes(e.name),help:e.help_text,label:e.display_name||e.name,onChange:t=>function(e,t){t?(a.add(e),Q("remote_data_container_override",{data_source_type:d(n.blockName),override_type:"unknown",override_target:"unknown"})):a.delete(e),r(Object.assign(Object.assign({},n),{enabledOverrides:Array.from(a)}))}(e.name,t),__nextHasNoMarginBottom:!0},e.name)}))]})}const Y=(0,o.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(k.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})});function ee(e){return(0,o.jsx)(s.Modal,{overlayClassName:"remote-data-blocks-pattern__selection-modal",title:(0,c.__)("Choose a pattern"),onRequestClose:e.onClose,isFullScreen:!0,children:(0,o.jsx)("div",{className:"remote-data-blocks-pattern__selection-content",children:(0,o.jsx)(i.__experimentalBlockPatternsList,{blockPatterns:e.supportedPatterns,shownPatterns:e.supportedPatterns,onClickPattern:e.onClickPattern})})})}function te(e){const[t,n]=(0,l.useState)(!1);return t?(0,o.jsx)(ee,{supportedPatterns:e.supportedPatterns,onClickPattern:function(t){e.onSelectPattern(t),n(!1),Q("add_block",{action:"select_pattern",selected_option:"select_from_list",data_source_type:d(e.blockName)})},onClose:function(){n(!1)}}):(0,o.jsxs)(s.Placeholder,{icon:Y,label:(0,c.__)("Choose a pattern to display your data"),children:[(0,o.jsx)(s.Button,{onClick:()=>n(!0),variant:"primary",children:(0,c.__)("Choose a pattern")}),(0,o.jsx)(s.Button,{onClick:function(){e.onCancel(),Q("add_block",{action:"select_pattern",selected_option:"manual_edit",data_source_type:d(e.blockName)})},variant:"secondary",children:(0,c.__)("Edit manually")})]})}const ne=(0,o.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(k.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"})});var re=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function oe(e){return e.map((e=>Object.fromEntries(Object.entries(e.result).map((([e,t])=>[e,t.value])))))}function ie(e,t,n=""){var r,o,i;return null!==(i=null===(o=null===(r=null==e?void 0:e.result[t])||void 0===r?void 0:r.value)||void 0===o?void 0:o.toString())&&void 0!==i?i:n}function se(e){var t;if(!e)return;const{queryInput:n,results:r}=e,o=re(e,["queryInput","results"]),i=null==r?void 0:r.map(((e,t)=>{var n;const r=null!==(n=e.result)&&void 0!==n?n:{};return function(e){return Object.prototype.hasOwnProperty.call(e,"result")&&Object.prototype.hasOwnProperty.call(e,"uuid")}(e)?e:(o=r,i=`${t}`,{result:Object.fromEntries(Object.entries(o).map((([e,t])=>[e,{name:e,type:"string",value:t}]))),uuid:i});var o,i}));return Object.assign(Object.assign({},o),{queryInputs:null!==(t=e.queryInputs)&&void 0!==t?t:n?[n]:[{}],results:i})}function ae(e){const{blockName:t,field:n,item:r,mediaField:i,onSelectField:a}=e,l=ie(r,n);if(n===i){const e=function(e,t,n=""){var r,o,i;return null!==(i=null===(o=null===(r=Object.values(e.result).find((e=>e.type===t)))||void 0===r?void 0:r.value)||void 0===o?void 0:o.toString())&&void 0!==i?i:n}(r,"image_alt");return(0,o.jsx)("img",{alt:e,src:l})}return a?(0,o.jsx)(s.Button,{onClick:()=>{a(function(e,t,n){return{action:"add_field_shortcode",remoteData:{blockName:n,queryInputs:oe([t]),metadata:{}},selectedField:e,selectionPath:"select_new_tab",type:"field"}}(n,r,t),l)},variant:"link",children:l}):l}function le(e){var t,n,r,i;const{blockName:s,hasNextPage:a,loading:u,onSelect:d,onSelectField:p,page:f,perPage:h,results:v=[],searchInput:g,selectionIds:m,setPage:b,setPerPage:y,setSearchInput:w,setSelectionIds:k,supportsSearch:x,totalItems:j,totalPages:O}=e,{DataViews:S}=window.LockedPrivateDataViews,F=null!==(n=null===(t=null==v?void 0:v[0])||void 0===t?void 0:t.result)&&void 0!==n?n:{},P=Object.entries(F).filter((([e,t])=>!_.includes(t.type))).map((([e])=>e)),E=null===(r=Object.entries(F).find((([e,t])=>"title"===t.type)))||void 0===r?void 0:r[0],I=null===(i=Object.entries(F).find((([e,t])=>C.includes(t.type))))||void 0===i?void 0:i[0],A=P.map((e=>{var t,n;return{id:e,label:null!==(n=null===(t=F[e])||void 0===t?void 0:t.name)&&void 0!==n?n:e,enableGlobalSearch:!0,getValue:({item:t})=>ie(t,e),render:({item:t})=>(0,o.jsx)(ae,{blockName:s,field:e,item:t,mediaField:I,onSelectField:p}),enableSorting:e!==I}})),B=null!=h?h:Math.max(v.length,10),L=P.filter((e=>e!==I&&e!==E)),[N,T]=(0,l.useState)({type:"table",perPage:B,page:f,search:g,fields:L,filters:[],layout:{},titleField:E,mediaField:I});(0,l.useEffect)((()=>{T((e=>Object.assign(Object.assign({},e),{fields:L,mediaField:I,titleField:E})))}),[[I,E,...L].join(";")]);const R=I?{table:{},grid:{}}:{table:{}},D={id:"choose",icon:(0,o.jsx)(o.Fragment,{children:(0,c.__)("Choose")}),isPrimary:!0,label:"",callback:e=>{null==d||d(e)},supportsBulk:!0};let M=[];return d&&(null==v?void 0:v.length)&&(M=[D]),(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(S,{actions:M,data:v,defaultLayouts:R,fields:A,getItemId:e=>e.uuid,isLoading:u||!v,isItemClickable:()=>!0,onChangeSelection:k,onChangeView:function(e){var t,n,r;b(null!==(t=e.page)&&void 0!==t?t:1),y(null!==(n=e.perPage)&&void 0!==n?n:B),w(null!==(r=e.search)&&void 0!==r?r:""),T(e)},paginationInfo:{totalItems:null!=j?j:v.length,totalPages:null!=O?O:a?f+1:Math.max(1,f)},search:x,selection:m,view:N})})}function ce(e,t){const[n,r]=(0,l.useState)(!1);return{close:function(){null==t||t(),r(!1)},isOpen:n,open:function(){null==e||e(),r(!0)}}}const ue=window.wp.apiFetch;var de=n.n(ue);const pe=window.wp.editor;class fe extends Error{}function he(e){return e instanceof Error?e:null==e?new Error("An unknown error occurred"):"string"==typeof e?new Error(e):"object"==typeof e&&"message"in e?new Error(String(e.message)):new Error(String(e))}var ve;!function(e){e.MissingRequiredInput="missing_required_input"}(ve||(ve={}));class ge extends fe{constructor(e,t,n){super(e),this.type=t,this.affectedInputVariables=n}toString(){return`${this.type}: ${this.message}\n\n\t${this.affectedInputVariables.map((e=>e.slug)).join(", ")}`}}function me(e,t){const n=t.filter((e=>e.required)).filter((t=>{var n;return null===(null!==(n=e[t.slug])&&void 0!==n?n:null)}));if(n.length)throw new ge("Missing required query input variables",ve.MissingRequiredInput,n);return!0}var be=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))},ye=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};const _e=function(){const e=new Map,t=e=>{try{return JSON.stringify(e)}catch(t){return String(e)}};return(...n)=>{const r=Array.from(n).map(t).join(",");if(e.has(r))return e.get(r);const o=function(e){return be(this,void 0,void 0,(function*(){var t,n;const{body:r,status:o}=yield de()({url:v,method:"POST",data:e});if(200!==o||!r)throw new Error(String(null!==(n=null!==(t=null==r?void 0:r.message)&&void 0!==t?t:null==r?void 0:r.code)&&void 0!==n?n:"Request for remote data failed"));return{blockName:r.block_name,metadata:r.metadata,pagination:r.pagination,queryKey:r.query_key,queryInputs:r.query_inputs,resultId:r.result_id,results:r.results}}))}(...n);return o instanceof Promise?o.then((()=>(e.set(r,o),o))):(e.set(r,o),o)}}();function Ce({blockName:e,externallyManagedRemoteData:t,externallyManagedUpdateRemoteData:n,fetchOnMount:r=!1,initialPage:o,initialPerPage:i,initialSearchInput:s,onSuccess:c,queryKey:d}){var p,f;const[h,v]=(0,l.useState)(),[g,m]=(0,l.useState)(),[b,_]=(0,l.useState)(!1),C=null!=t?t:h,w=null!=n?n:v,k=Boolean(C),x=u(e),j=null===(p=null==x?void 0:x.selectors)||void 0===p?void 0:p.find((e=>e.query_key===d));if(!j)throw new Error(`Query not found for block "${e}" and key "${d}".`);const O=null!==(f=null==t?void 0:t.enabledOverrides)&&void 0!==f?f:[],S=j.inputs,F=function({initialPage:e=1,initialPerPage:t,paginationData:n}){var r,o,i,s,a,c;const[u,d]=(0,l.useState)(e),[p,f]=(0,l.useState)(null!=t?t:null),[h,v]=(0,l.useState)(),g=null===(r=null==n?void 0:n.input_variables)||void 0===r?void 0:r.next_page,m=null===(o=null==n?void 0:n.input_variables)||void 0===o?void 0:o.previous_page,b=null===(i=null==n?void 0:n.input_variable_targets)||void 0===i?void 0:i.offset,y=null===(s=null==n?void 0:n.input_variable_targets)||void 0===s?void 0:s.page,_=null===(a=null==n?void 0:n.input_variable_targets)||void 0===a?void 0:a.per_page,C=null!==(c=null!=p?p:null==n?void 0:n.per_page)&&void 0!==c?c:10,w=Boolean(g),k=Boolean((null==n?void 0:n.type)&&"NONE"!==(null==n?void 0:n.type)),x=null==n?void 0:n.total_items,j=x?Math.ceil(x/C):void 0;return{hasNextPage:w,page:u,paginationQueryInput:h,perPage:null!=p?p:null==n?void 0:n.per_page,setPage:function(e){if(!k)return;const t=e>u,r=e<u&&e>0,o=t?Math.min(null!=j?j:u+1,e):Math.max(1,e);if(t||r)switch(null==n?void 0:n.type){case"CURSOR":case"CURSOR_SIMPLE":if(t){d(u+1),v(g);break}d(u-1),v(m);break;case"OFFSET":if(!b)break;if(d(o),t){v(Object.assign(Object.assign({},g),{[b]:C*(o-1)}));break}v(Object.assign(Object.assign({},m),{[b]:C*(o-1)}));break;case"PAGE":if(!y)break;if(d(o),t){v(Object.assign(Object.assign({},g),{[y]:o}));break}v(Object.assign(Object.assign({},m),{[y]:o}))}},setPerPage:function(e){_&&C!==e&&(f(e),v(Object.assign(Object.assign({},h),{[_]:e})))},supportsPagination:k,supportsPerPage:Boolean(_),totalItems:x,totalPages:j}}({initialPage:o,initialPerPage:i,paginationData:null==C?void 0:C.pagination}),{hasNextPage:P,page:E,perPage:I,paginationQueryInput:A,supportsPagination:B,totalItems:L,totalPages:N}=F,T=ye(F,["hasNextPage","page","perPage","paginationQueryInput","supportsPagination","totalItems","totalPages"]),{hasSearchInput:R,searchQueryInput:D,searchInput:M,setSearchInput:q,supportsSearch:z}=function({initialSearchInput:e="",inputVariables:t,searchInputDelayInMs:n=500}){var r;const[o,i]=function(e,t){const n=(0,l.useRef)(null),[r,o]=(0,l.useState)(t);return[r,(0,l.useCallback)((t=>{n.current&&clearTimeout(n.current),n.current=setTimeout((()=>{o(t)}),e)}),[])]}(n,e),s=null==t?void 0:t.find((e=>e.type===y)),a=Boolean(s),c=a&&!(null==s?void 0:s.required),u=a&&Boolean(o||c);return{hasSearchInput:u,searchInput:o,searchQueryInput:a?{[null!==(r=null==s?void 0:s.slug)&&void 0!==r?r:""]:u?o:null}:{},setSearchInput:a?i:()=>{},supportsSearch:a}}({initialSearchInput:s,inputVariables:S}),H=Object.assign(Object.assign({},A),D),$=!g&&(k||R),U=k&&z&&!R;if((0,l.useEffect)((()=>{var e;U?w(void 0):$&&V(null!==(e=null==C?void 0:C.queryInputs)&&void 0!==e?e:[{}])}),[U,$,E,I,M]),(0,l.useEffect)((()=>{r&&function(e,t){try{return me(e,t),!0}catch(e){return!1}}(H,S)&&V([{}])}),[]),g&&!b)throw g;function V(t){return be(this,void 0,void 0,(function*(){const{getCurrentPostId:n}=(0,a.select)(pe.store),r=n();if(0===t.length)return void K(new Error("Query input is empty"));1===t.length&&(t[0]=Object.assign(Object.assign({},t[0]),H));const o={block_name:e,post_id:null!=r?r:null,query_key:d,query_inputs:t};try{t.forEach((e=>me(e,S)))}catch(e){return void K(he(e))}_(!0);const i=yield _e(o).catch((e=>{K(he(e))}));i&&(w(Object.assign({enabledOverrides:O},i)),_(!1),null==c||c())}))}function K(e){w(void 0),m(e),_(!1)}return Object.assign({data:C,error:g,fetch:V,hasNextPage:null!=P?P:N?E<N:B,hasPreviousPage:E>1,loading:b,page:E,perPage:I,reset:K,searchInput:M,setSearchInput:q,supportsPagination:B,supportsSearch:z,totalPages:N},T)}const we=e=>{var t,n,r,i;const{className:a,blockName:p,onSelect:f,onSelectField:h,queryKey:v,renderTrigger:g,title:m}=e,b=u(p),[y,_]=(0,l.useState)([]),{close:C,isOpen:w,open:k}=ce(),{data:x,hasNextPage:j,loading:O,page:S,perPage:F,searchInput:P,setPage:E,setPerPage:I,setSearchInput:A,supportsSearch:B,totalItems:L,totalPages:N}=Ce({blockName:p,fetchOnMount:!0,queryKey:v}),T=y.map((e=>e.uuid)),R=null!==(n=null===(t=null==x?void 0:x.results)||void 0===t?void 0:t.map((e=>e.uuid)))&&void 0!==n?n:[],D=Boolean(f);function M(e){const t=T.filter((e=>!R.includes(e))),n=Array.from(new Set([...t,...e])).map((e=>{var t,n,r;return null!==(r=null!==(n=null===(t=null==x?void 0:x.results)||void 0===t?void 0:t.find((t=>e===t.uuid)))&&void 0!==n?n:y.find((t=>e===t.uuid)))&&void 0!==r?r:null})).filter((e=>null!==e));_(n)}function q(e){D&&e.length&&(null==f||f(oe(e)),Q("add_block",{action:"select_item",selected_option:"search_from_list",data_source_type:d(p)}),C())}const z=g?g({onClick:k}):(0,o.jsx)(s.Button,{variant:"primary",onClick:k,__next40pxDefaultSize:!0,children:(0,c.__)("Select items")});return(0,o.jsxs)(o.Fragment,{children:[z,w&&(0,o.jsxs)(s.Modal,{className:D?`${a} rdb-dataviews-bulk-actions-modal`:a,isFullScreen:!0,onRequestClose:C,title:null!==(i=null===(r=null==b?void 0:b.settings)||void 0===r?void 0:r.title)&&void 0!==i?i:m,children:[(0,o.jsx)(le,{blockName:p,hasNextPage:null!=j&&j,loading:O,onSelect:D?q:void 0,onSelectField:h,page:S,perPage:F,results:O||null==x?void 0:x.results,searchInput:P,selectionIds:T,setPage:E,setPerPage:I,setSearchInput:A,setSelectionIds:M,supportsSearch:B,totalItems:L,totalPages:N}),D&&!O&&(0,o.jsxs)(s.__experimentalHStack,{className:"rdb-dataviews-bulk-actions-footer__selection-total",justify:"flex-end",spacing:3,children:[(0,o.jsx)(s.Button,{disabled:0===y.length,onClick:()=>M([]),variant:"tertiary",isDestructive:!0,__next40pxDefaultSize:!0,children:(0,c.__)("Clear selection")}),(0,o.jsx)(s.Button,{disabled:0===y.length,onClick:()=>q(y),variant:"primary",__next40pxDefaultSize:!0,children:(0,c.__)("Select items")})]})]})]})},ke="remote-data/binding",xe="remote-data-blocks";function __(e){return(0,c.__)(e,xe)}var je=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Oe(e){var t;return(0,o.jsx)(s.Modal,Object.assign({className:`${e.className} remote-data-blocks-modal`,headerActions:(0,o.jsxs)(o.Fragment,{children:[e.headerImage&&(0,o.jsx)("img",{alt:e.title,src:e.headerImage,style:{marginRight:"2em",objectFit:"contain"}}),e.headerActions]}),onRequestClose:e.onClose,size:null!==(t=e.size)&&void 0!==t?t:"fill"},e,{children:e.children}))}function Se(e){const{buttonText:t,buttonVariant:n="primary",isOpen:r,onOpen:i}=e,a=je(e,["buttonText","buttonVariant","isOpen","onOpen"]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.Button,{variant:n,onClick:i,__next40pxDefaultSize:!0,children:__(e.buttonText)}),r&&(0,o.jsx)(Oe,Object.assign({},a))]})}function Fe(e){const t=e.inputs.reduce(((e,t)=>{var n;return Object.assign(Object.assign({},e),{[t.slug]:null!==(n=t.default_value)&&void 0!==n?n:""})}),{}),[n,r]=(0,l.useState)(t),{close:i,isOpen:a,open:c}=ce();return(0,o.jsx)(Se,{buttonText:"Provide manual input",buttonVariant:"secondary",isOpen:a,onClose:i,onOpen:c,title:e.title,size:"medium",children:(0,o.jsxs)("form",{style:{marginTop:"1rem"},onSubmit:t=>{t.preventDefault(),e.onSelect([n]),i(),Q("add_block",{action:"select_item",selected_option:"manual_input",data_source_type:d(e.blockName)})},children:[e.inputs.map((e=>{var t,i;return(0,o.jsx)(s.TextControl,{label:e.name,required:e.required,value:null!==(i=null===(t=n[e.slug])||void 0===t?void 0:t.toString())&&void 0!==i?i:"",onChange:t=>function(e,t){r(Object.assign(Object.assign({},n),{[e]:t}))}(e.slug,t),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,style:{marginBottom:"8px"}},e.slug)})),(0,o.jsx)(s.__experimentalSpacer,{marginTop:4}),(0,o.jsx)(s.__experimentalHStack,{justify:"flex-end",children:(0,o.jsx)(s.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:__("Save")})})]})})}const Pe=(0,o.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(k.Path,{d:"m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734Z"})});function Ee(e){var t,n;const{input:r,onSelect:i,title:a}=e,c=d(e.blockName),u={[r.slug]:""},[p,f]=(0,l.useState)(u),{close:h,isOpen:v,open:g}=ce();function m(e){return"airtable"===e?{buttonText:__("Enter record ID"),helpText:(0,o.jsx)(s.ExternalLink,{href:"https://support.airtable.com/docs/finding-airtable-ids#finding-record-ids",children:__("How do I get the Record ID?")})}:{buttonText:__("Provide")+" "+a}}return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.Button,{variant:"secondary",onClick:g,__next40pxDefaultSize:!0,children:m(c).buttonText}),v&&(0,o.jsx)(s.Popover,{onClose:h,offset:16,position:"bottom right",children:(0,o.jsx)("form",{className:"remote-data-blocks-edit__input-popover-form",onSubmit:t=>{t.preventDefault(),i([p]),h(),Q("add_block",{action:"select_item",selected_option:"manual_input",data_source_type:d(e.blockName)})},children:(0,o.jsx)(s.__experimentalInputControl,{className:"remote-data-blocks-edit__input",label:r.name,required:r.required,value:null!==(n=null===(t=p[r.slug])||void 0===t?void 0:t.toString())&&void 0!==n?n:"",onChange:e=>function(e,t){f(Object.assign(Object.assign({},p),{[e]:t}))}(r.slug,null!=e?e:""),help:m(c).helpText,suffix:(0,o.jsx)(s.Button,{icon:Pe,label:__("Save"),type:"submit"}),__next40pxDefaultSize:!0})})})]})}function Ie(e){const{blockConfig:{name:t,selectors:n},onSelect:r}=e;return(0,o.jsx)(o.Fragment,{children:n.map((e=>{var n;const i=e.name,a={blockName:t,headerImage:e.image_url,inputVariables:e.inputs,onSelect:r,queryKey:e.query_key,title:i};switch(e.type){case"search":case"list":return(0,o.jsx)(we,Object.assign({className:"rdb-editor_dataviews-modal-item-select"},a),i);case"load-without-input":return(0,o.jsx)(s.Button,{onClick:()=>r([{}]),variant:"primary",children:e.name},i);case"manual-input":return 1===e.inputs.length&&e.inputs[0]?(0,o.jsx)(Ee,Object.assign({input:e.inputs[0]},a,{title:null!==(n=e.inputs[0].name)&&void 0!==n?n:e.name}),i):(0,o.jsx)(Fe,Object.assign({inputs:e.inputs},a),i)}return null}))})}function Ae(e){var t;const{blockConfig:n,onSelect:r}=e,{instructions:i,settings:a}=n,l=null!==(t=a.icon)&&void 0!==t?t:ne;return(0,o.jsx)(s.Placeholder,{icon:l,label:a.title,instructions:null!=i?i:(0,c.__)("This block requires selection of one or more items for display."),children:(0,o.jsx)(Ie,{blockConfig:n,onSelect:r})})}var Be=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Le(e,t,n){var o,i;const s=null===(o=e.innerBlocks)||void 0===o?void 0:o.map((e=>Le(e,t,n))),a=Object.assign(Object.assign({},e.attributes),{metadata:Object.assign(Object.assign({},e.attributes.metadata),{bindings:Object.assign(Object.assign({},null===(i=e.attributes.metadata)||void 0===i?void 0:i.bindings),Object.fromEntries(Te(e.attributes,n).map((([e,n])=>[e,Object.assign(Object.assign({},n),{args:Object.assign(Object.assign({},n.args),{isPreview:!0,previewValue:Ne(t,n.args)})})]))))})});return(0,r.cloneBlock)(e,a,s)}function Ne(e,t){var n;if(!(null==t?void 0:t.field)||!(null===(n=null==e?void 0:e.result)||void 0===n?void 0:n[t.field]))return;let r=ie(e,t.field);return t.label&&(r=`<span class="${f("block-label")}">${t.label}</span> ${r}`),r}function Te(e,t){var n,r;return Object.entries(null!==(r=null===(n=e.metadata)||void 0===n?void 0:n.bindings)&&void 0!==r?r:{}).filter((([e,n])=>{var r;return n.source===ke&&(null===(r=n.args)||void 0===r?void 0:r.block)===t}))}function Re(e,t){var n,r;return Te(e.attributes,t).length>0||null!==(r=null===(n=e.innerBlocks)||void 0===n?void 0:n.some((e=>Re(e,t))))&&void 0!==r&&r}function De(e,t="",n=!1){var o;const{patterns:s}=null!==(o=u(e))&&void 0!==o?o:{},{replaceInnerBlocks:c}=(0,a.useDispatch)(i.store),{getPatternsByBlockTypes:d,allowedPatterns:p}=(0,a.useSelect)((e=>{var n;const r=e(i.store);return{getBlocks:r.getBlocks,getPatternsByBlockTypes:r.getPatternsByBlockTypes,allowedPatterns:null!==(n=r.__experimentalGetAllowedPatterns(t))&&void 0!==n?n:[]}}),[e,t]),[f,h]=(0,l.useState)(!1),v=d(e).find((({name:e})=>e===(null==s?void 0:s.inner_blocks))),g=p.filter((t=>{var n;return(null===(n=null==t?void 0:t.blockTypes)||void 0===n?void 0:n.includes(e))||t.blocks.some((t=>Re(t,e)))}));function m(o){const i=function(t){var n;if(function(e){return Boolean(e.id&&"unsynced"!==e.syncStatus)}(t)){const e=(0,r.createBlock)("core/block",{ref:t.id});return[(0,r.createBlock)("remote-data-blocks/template",{},[e])]}const o=null!==(n=t.blocks.map((t=>Te(t.attributes,e).length?(0,r.cloneBlock)(t):t)))&&void 0!==n?n:[];return[(0,r.createBlock)("remote-data-blocks/template",{},o)]}(o);n&&i.push((0,r.createBlock)("remote-data-blocks/pagination")),i.push((0,r.createBlock)("remote-data-blocks/no-results",{mode:"empty"})),c(t,i).catch((()=>{}))}return{getSupportedPatterns:t=>t?g.map((n=>Object.assign(Object.assign({},n),{blocks:n.blocks.map((n=>Le(n,t,e)))}))):g,onReadyForPatternSelection:function(){v?m(v):h(!0)},onSelectPattern:function(e){const t=g.find((t=>t.id===e.id));console.log({pattern:e,realPattern:t,supportedPatterns:g}),m(null!=t?t:e),h(!1)},resetPatternSelection:function(){c(t,[]).catch((()=>{})),h(!1)},showPatternSelection:f}}function Me(e){const t=e.name,n=u(t);if(!n)throw new Error(`Block configuration not found for block: ${t}`);const r=e.clientId,l=se(e.attributes.remoteData),{data:c,fetch:d,loading:p,reset:f,supportsPagination:v}=Ce({blockName:t,externallyManagedRemoteData:l,externallyManagedUpdateRemoteData:x,queryKey:h}),{getSupportedPatterns:g,onSelectPattern:m,onReadyForPatternSelection:b,resetPatternSelection:y,showPatternSelection:_}=De(t,r,v),{hasMultiSelection:C}=(0,a.useSelect)(i.store);function k(){var e;d(null!==(e=null==l?void 0:l.queryInputs)&&void 0!==e?e:[{}])}function x(t){(function(e,t){if(!e||!t)return!0;const{metadata:n,resultId:r,results:o}=e,i=Be(e,["metadata","resultId","results"]),{metadata:s,resultId:a,results:l}=t,c=Be(t,["metadata","resultId","results"]),u=o.map((e=>{var{uuid:t}=e;return Be(e,["uuid"])})),d=l.map((e=>{var{uuid:t}=e;return Be(e,["uuid"])}));return JSON.stringify(u)!==JSON.stringify(d)||JSON.stringify(i)!==JSON.stringify(c)})(l,t)&&e.setAttributes({remoteData:t})}function j(e=!1){return(0,o.jsx)("div",{className:"remote-data-blocks-loading-overlay",style:e?{pointerEvents:"auto"}:void 0,children:(0,o.jsx)(s.Spinner,{style:{height:"50px",width:"50px"}})})}if(!c)return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Ae,{blockConfig:n,onSelect:function(e){d(e).then((()=>{b()}))}}),p&&j(!0)]});if(_){const e=g(c.results[0]);return(0,o.jsx)(te,{blockName:t,onCancel:y,onSelectPattern:m,supportedPatterns:e})}return(0,o.jsxs)(o.Fragment,{children:[!C()&&(0,o.jsxs)(i.InspectorControls,{children:[(0,o.jsx)(X,{blockConfig:n,remoteData:c,updateRemoteData:x}),(0,o.jsx)(W,{refreshRemoteData:k,remoteData:c,resetRemoteData:function(){f(),y()}}),(0,o.jsx)(w,{onUpdateQueryInputs:function(e,t){l&&(x(Object.assign(Object.assign({},l),{queryInputs:t,queryKey:e})),k())},remoteData:c,selectors:n.selectors})]}),p&&j(),(0,o.jsx)(S,{})]})}function qe(e){const t=(0,i.useBlockProps)({className:b});return(0,o.jsx)("div",Object.assign({},t,{children:(0,o.jsx)(O,{blockTitle:p(e.name),children:(0,o.jsx)(Me,Object.assign({},e))})}))}function ze(){const e=i.useBlockProps.save({className:b});return(0,o.jsx)("div",Object.assign({},e,{children:(0,o.jsx)(i.InnerBlocks.Content,{})}))}Object.values(function(){var e,t;return null!==(t=null===(e=window.REMOTE_DATA_BLOCKS)||void 0===e?void 0:e.config)&&void 0!==t?t:{}}()).forEach((e=>{(0,r.registerBlockType)(e.name,Object.assign(Object.assign({},e.settings),{attributes:{remoteData:{type:"object"}},edit:qe,save:ze}))}))},7833:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(736)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},736:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,i,s=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];n=i.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e,t){let n=0,r=0,o=-1,i=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(o=r,i=n,r++):(n++,r++);else{if(-1===o)return!1;r=o+1,i++,n=i}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(o(e,n))return!1;for(const n of t.names)if(o(e,n))return!0;return!1},t.humanize=n(6585),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},7007:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}v(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var o,i,s,c;if(a(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]),void 0===s)s=i[t]=n,++e._eventsCount;else if("function"==typeof s?s=i[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=l(e))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=u.bind(r);return o.listener=n,r.wrapFn=o,o}function p(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):h(o,o.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function v(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return l(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var c=l.length,u=h(l,c);for(n=0;n<c;++n)r(u[n],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,o,i,s;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return p(this,e,!0)},i.prototype.rawListeners=function(e){return p(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},6166:(e,t,n)=>{"use strict";var r=n(7426),o=n(3349);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=i,i.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var o=0;o<e.length;o+=this._delta32)this._update(e,o,o+this._delta32)}return this},i.prototype.digest=function(e){return this.update(this._pad()),o(null===this.pending),this._digest(e)},i.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var o=1;o<n;o++)r[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[o++]=0;r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=e>>>24&255,r[o++]=e>>>16&255,r[o++]=e>>>8&255,r[o++]=255&e}else for(r[o++]=255&e,r[o++]=e>>>8&255,r[o++]=e>>>16&255,r[o++]=e>>>24&255,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,i=8;i<this.padLength;i++)r[o++]=0;return r}},2287:(e,t,n)=>{"use strict";var r=n(7426),o=n(6166),i=n(6225),s=n(3349),a=r.sum32,l=r.sum32_4,c=r.sum32_5,u=i.ch32,d=i.maj32,p=i.s0_256,f=i.s1_256,h=i.g0_256,v=i.g1_256,g=o.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}r.inherits(b,g),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=l(v(n[r-2]),n[r-7],h(n[r-15]),n[r-16]);var o=this.h[0],i=this.h[1],g=this.h[2],m=this.h[3],b=this.h[4],y=this.h[5],_=this.h[6],C=this.h[7];for(s(this.k.length===n.length),r=0;r<n.length;r++){var w=c(C,f(b),u(b,y,_),this.k[r],n[r]),k=a(p(o),d(o,i,g));C=_,_=y,y=b,b=a(m,w),m=g,g=i,i=o,o=a(w,k)}this.h[0]=a(this.h[0],o),this.h[1]=a(this.h[1],i),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],b),this.h[5]=a(this.h[5],y),this.h[6]=a(this.h[6],_),this.h[7]=a(this.h[7],C)},b.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},6225:(e,t,n)=>{"use strict";var r=n(7426).rotr32;function o(e,t,n){return e&t^~e&n}function i(e,t,n){return e&t^e&n^t&n}function s(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?o(t,n,r):1===e||3===e?s(t,n,r):2===e?i(t,n,r):void 0},t.ch32=o,t.maj32=i,t.p32=s,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},7426:(e,t,n)=>{"use strict";var r=n(3349),o=n(6698);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function l(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)n.push(parseInt(e[o]+e[o+1],16))}else for(var r=0,o=0;o<e.length;o++){var s=e.charCodeAt(o);s<128?n[r++]=s:s<2048?(n[r++]=s>>6|192,n[r++]=63&s|128):i(e,o)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++o)),n[r++]=s>>18|240,n[r++]=s>>12&63|128,n[r++]=s>>6&63|128,n[r++]=63&s|128):(n[r++]=s>>12|224,n[r++]=s>>6&63|128,n[r++]=63&s|128)}else for(o=0;o<e.length;o++)n[o]=0|e[o];return n},t.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=a(e[n].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e[r];"little"===t&&(o=s(o)),n+=l(o.toString(16))}return n},t.zero2=a,t.zero8=l,t.join32=function(e,t,n,o){var i=n-t;r(i%4==0);for(var s=new Array(i/4),a=0,l=t;a<s.length;a++,l+=4){var c;c="big"===o?e[l]<<24|e[l+1]<<16|e[l+2]<<8|e[l+3]:e[l+3]<<24|e[l+2]<<16|e[l+1]<<8|e[l],s[a]=c>>>0}return s},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,o=0;r<e.length;r++,o+=4){var i=e[r];"big"===t?(n[o]=i>>>24,n[o+1]=i>>>16&255,n[o+2]=i>>>8&255,n[o+3]=255&i):(n[o+3]=i>>>24,n[o+2]=i>>>16&255,n[o+1]=i>>>8&255,n[o]=255&i)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,o){return e+t+n+r+o>>>0},t.sum64=function(e,t,n,r){var o=e[t],i=r+e[t+1]>>>0,s=(i<r?1:0)+n+o;e[t]=s>>>0,e[t+1]=i},t.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,o,i,s,a){var l=0,c=t;return l+=(c=c+r>>>0)<t?1:0,l+=(c=c+i>>>0)<i?1:0,e+n+o+s+(l+=(c=c+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,n,r,o,i,s,a){return t+r+i+a>>>0},t.sum64_5_hi=function(e,t,n,r,o,i,s,a,l,c){var u=0,d=t;return u+=(d=d+r>>>0)<t?1:0,u+=(d=d+i>>>0)<i?1:0,u+=(d=d+a>>>0)<a?1:0,e+n+o+s+l+(u+=(d=d+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,n,r,o,i,s,a,l,c){return t+r+i+a+c>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},3349:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},6585:e=>{var t=1e3,n=60*t,r=60*n,o=24*r,i=7*o;function s(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,a){a=a||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(s){var a=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*i;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===u&&isFinite(e))return a.long?(l=e,(c=Math.abs(l))>=o?s(l,c,o,"day"):c>=r?s(l,c,r,"hour"):c>=n?s(l,c,n,"minute"):c>=t?s(l,c,t,"second"):l+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},4994:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,n,o,i)=>{if(!n){var s=1/0;for(u=0;u<e.length;u++){for(var[n,o,i]=e[u],a=!0,l=0;l<n.length;l++)(!1&i||s>=i)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(a=!1,i<s&&(s=i));if(a){e.splice(u--,1);var c=o();void 0!==c&&(t=c)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[n,o,i]},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),(()=>{var e={508:0,172:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var o,i,[s,a,l]=n,c=0;if(s.some((t=>0!==e[t]))){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(l)var u=l(r)}for(t&&t(n);c<s.length;c++)i=s[c],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return r.O(u)},n=globalThis.webpackChunkremote_data_blocks=globalThis.webpackChunkremote_data_blocks||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var o=r.O(void 0,[172],(()=>r(6540)));o=r.O(o)})();
     1(()=>{var e,t={9545:(e,t)=>{"use strict";t.parse=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},o=e.length;if(o<2)return n;var i=t&&t.decode||u,s=0,a=0,p=0;do{if(-1===(a=e.indexOf("=",s)))break;if(-1===(p=e.indexOf(";",s)))p=o;else if(a>p){s=e.lastIndexOf(";",a-1)+1;continue}var f=l(e,s,a),h=c(e,a,f),v=e.slice(f,h);if(!r.call(n,v)){var g=l(e,a+1,p),m=c(e,p,g);34===e.charCodeAt(g)&&34===e.charCodeAt(m-1)&&(g++,m--);var b=e.slice(g,m);n[v]=d(b,i)}s=p+1}while(s<o);return n},t.serialize=function(e,t,r){var l=r&&r.encode||encodeURIComponent;if("function"!=typeof l)throw new TypeError("option encode is invalid");if(!o.test(e))throw new TypeError("argument name is invalid");var c=l(t);if(!i.test(c))throw new TypeError("argument val is invalid");var u=e+"="+c;if(!r)return u;if(null!=r.maxAge){var d=Math.floor(r.maxAge);if(!isFinite(d))throw new TypeError("option maxAge is invalid");u+="; Max-Age="+d}if(r.domain){if(!s.test(r.domain))throw new TypeError("option domain is invalid");u+="; Domain="+r.domain}if(r.path){if(!a.test(r.path))throw new TypeError("option path is invalid");u+="; Path="+r.path}if(r.expires){var p=r.expires;if(!function(e){return"[object Date]"===n.call(e)}(p)||isNaN(p.valueOf()))throw new TypeError("option expires is invalid");u+="; Expires="+p.toUTCString()}if(r.httpOnly&&(u+="; HttpOnly"),r.secure&&(u+="; Secure"),r.partitioned&&(u+="; Partitioned"),r.priority)switch("string"==typeof r.priority?r.priority.toLowerCase():r.priority){case"low":u+="; Priority=Low";break;case"medium":u+="; Priority=Medium";break;case"high":u+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(r.sameSite)switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:u+="; SameSite=Strict";break;case"lax":u+="; SameSite=Lax";break;case"strict":u+="; SameSite=Strict";break;case"none":u+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return u};var n=Object.prototype.toString,r=Object.prototype.hasOwnProperty,o=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,i=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,s=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,a=/^[\u0020-\u003A\u003D-\u007E]*$/;function l(e,t,n){do{var r=e.charCodeAt(t);if(32!==r&&9!==r)return t}while(++t<n);return n}function c(e,t,n){for(;t>n;){var r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return n}function u(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function d(e,t){try{return t(e)}catch(t){return e}}},1510:(e,t,n)=>{"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.getCallbacksMap=s,t.isLoading=a,t.addScriptCallback=function(e,t){var n=s();a(e)?(o('Adding a callback for an existing script from "'.concat(e,'"')),n.get(e).add(t)):(o('Adding a callback for a new script from "'.concat(e,'"')),n.set(e,new Set([t])))},t.removeScriptCallback=function(e,t){if(o('Removing a known callback for a script from "'.concat(e,'"')),a(e)){var n=s(),r=n.get(e);r.delete(t),0===r.size&&n.delete(e)}},t.removeScriptCallbacks=function(e){o('Removing all callbacks for a script from "'.concat(e,'"')),s().delete(e)},t.removeAllScriptCallbacks=function(){o("Removing all callbacks for scripts from all URLs"),s().clear()},t.executeCallbacks=l,t.handleRequestSuccess=function(){var e=this.getAttribute("src");o('Handling successful request for "'.concat(e,'"')),l(e),this.onload=null},t.handleRequestError=function(){var e=this.getAttribute("src");o('Handling failed request for "'.concat(e,'"')),l(e,new Error('Failed to load script "'.concat(e,'"'))),this.onerror=null};var o=(0,r(n(2769)).default)("lib/load-script/callback-handler"),i=new Map;function s(){return i}function a(e){return s().has(e)}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=s(),r=n.get(e);if(r){var i='Executing callbacks for "'.concat(e,'"')+(null===t?" with success":' with error "'.concat(t,'"'));o(i),r.forEach((function(e){"function"==typeof e&&e(t)})),n.delete(e)}}},8469:(e,t,n)=>{"use strict";var r=n(4994);Object.defineProperty(t,"__esModule",{value:!0}),t.createScriptElement=function(e){s('Creating script element for "'.concat(e,'"'));var t=document.createElement("script");return t.src=e,t.type="text/javascript",t.async=!0,t.onload=i.handleRequestSuccess,t.onerror=i.handleRequestError,t},t.attachToHead=function(e){s("Attaching element to head"),document.head.appendChild(e)};var o=r(n(2769)),i=n(1510),s=(0,o.default)("lib/load-script/dom-operations")},1050:(e,t,n)=>{"use strict";var r=n(4994);t.k0=function(e,t){if(!(0,i.isLoading)(e)&&(0,s.attachToHead)((0,s.createScriptElement)(e)),"function"!=typeof t)return new Promise((function(t,n){(0,i.addScriptCallback)(e,(function(e){null===e?t():n(e)}))}));(0,i.addScriptCallback)(e,t)};var o=r(n(2769)),i=n(1510),s=n(8469);(0,o.default)("package/load-script")},2769:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}t.log=function(){var e;return"object"===("undefined"==typeof console?"undefined":r(console))&&console.log&&(e=console).log.apply(e,arguments)},t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),this.useColors){var n="color: "+this.color;t.splice(1,0,n,"color: inherit");var r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)}},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.exports=n(2632)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},2632:(e,t,n)=>{"use strict";e.exports=function(e){function t(e){for(var t=0,n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return r.colors[Math.abs(t)%r.colors.length]}function r(e){var n;function s(){if(s.enabled){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];var i=s,a=Number(new Date),l=a-(n||a);i.diff=l,i.prev=n,i.curr=a,n=a,t[0]=r.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");var c=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(function(e,n){if("%%"===e)return e;c++;var o=r.formatters[n];if("function"==typeof o){var s=t[c];e=o.call(i,s),t.splice(c,1),c--}return e})),r.formatArgs.call(i,t),(i.log||r.log).apply(i,t)}}return s.namespace=e,s.enabled=r.enabled(e),s.useColors=r.useColors(),s.color=t(e),s.destroy=o,s.extend=i,"function"==typeof r.init&&r.init(s),r.instances.push(s),s}function o(){var e=r.instances.indexOf(this);return-1!==e&&(r.instances.splice(e,1),!0)}function i(e,t){return r(this.namespace+(void 0===t?":":t)+e)}return r.debug=r,r.default=r,r.coerce=function(e){return e instanceof Error?e.stack||e.message:e},r.disable=function(){r.enable("")},r.enable=function(e){var t;r.save(e),r.names=[],r.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(t=0;t<o;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?r.skips.push(new RegExp("^"+e.substr(1)+"$")):r.names.push(new RegExp("^"+e+"$")));for(t=0;t<r.instances.length;t++){var i=r.instances[t];i.enabled=r.enabled(i.namespace)}},r.enabled=function(e){if("*"===e[e.length-1])return!0;var t,n;for(t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},r.humanize=n(6585),Object.keys(e).forEach((function(t){r[t]=e[t]})),r.instances=[],r.names=[],r.skips=[],r.formatters={},r.selectColor=t,r.enable(r.load()),r}},6540:(e,t,n)=>{"use strict";const r=window.wp.blocks,o=window.ReactJSXRuntime,i=window.wp.blockEditor,s=window.wp.components,a=window.wp.data,l=window.wp.element,c=window.wp.i18n;function u(e){var t,n;return null===(n=null===(t=window.REMOTE_DATA_BLOCKS)||void 0===t?void 0:t.config)||void 0===n?void 0:n[e]}function d(e){var t,n;return e&&null!==(n=null===(t=u(e))||void 0===t?void 0:t.dataSourceType)&&void 0!==n?n:""}function p(e){var t,n,r;return e?null!==(r=null===(n=null===(t=u(e))||void 0===t?void 0:t.settings)||void 0===n?void 0:n.title)&&void 0!==r?r:e.replace("remote-data-blocks/",""):""}function f(e,t){return function(...e){return e.filter(Boolean).join(" ")}(t,`rdb-${n=e,n.replace(/[^a-zA-Z\d\u00C0-\u00FF]/g,"-").toLowerCase()}`);var n}const h="display",v=null!==(m=null===(g=window.REMOTE_DATA_BLOCKS)||void 0===g?void 0:g.rest_url)&&void 0!==m?m:"http://127.0.0.1:9999";var g,m;const b=f("container"),y="ui:search_input",_=["id","id:list"],C=["image_url"];function w({onUpdateQueryInputs:e,remoteData:t,selectors:n}){var r,i;const{queryInputs:a=[],queryKey:u=h}=t,[d,p]=(0,l.useState)(a),f=null!==(i=null===(r=null==n?void 0:n.find((e=>e.query_key===u)))||void 0===r?void 0:r.inputs)&&void 0!==i?i:[];return(0,o.jsx)(s.PanelBody,{title:(0,c.__)("Query Inputs","remote-data-blocks"),children:(0,o.jsxs)("form",{onSubmit:t=>{t.preventDefault();const n=d.map((e=>{const t=Object.entries(e).map((([e,t])=>[e,"string"==typeof t&&t.includes(",")?t.split(",").map((e=>e.trim())).filter(Boolean):t]));return Object.fromEntries(t)}));e(u,n)},children:[d.map(((t,n)=>Object.entries(t).map((([t,r])=>{var i;const a=Array.isArray(r)?r.join(","):r,l=f.find((e=>e.slug===t));return(0,o.jsx)(s.TextControl,{label:null!==(i=null==l?void 0:l.name)&&void 0!==i?i:t,value:a,onChange:e=>{p(d.map(((r,o)=>o===n?Object.assign(Object.assign({},r),{[t]:e}):r)))},onBlur:()=>{e(u,d)},__next40pxDefaultSize:!0,__nextHasNoMarginBottom:!0},`${n}-${t}`)})))),(0,o.jsx)(s.Button,{variant:"primary",type:"submit",children:(0,c.__)("Update","remote-data-blocks")})]})})}const k=window.wp.primitives,x=(0,o.jsx)(k.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,o.jsx)(k.Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z"})});function j({blockTitle:e,error:t,onRetry:n}){const[r,i]=(0,l.useState)(!1);return(0,o.jsxs)(s.Placeholder,{className:"remote-data-container-error",icon:x,label:(0,c.sprintf)((0,c.__)("Remote data source error (%s)"),e),children:[(0,o.jsx)(s.Icon,{className:"remote-data-container-error__icon-overlay",icon:x}),(0,o.jsxs)(s.__experimentalHStack,{justify:"flex-start",children:[(0,o.jsx)(s.Button,{variant:"secondary",onClick:n,children:(0,c.__)("Try again")}),(0,o.jsx)(s.Button,{variant:"tertiary",onClick:()=>i(!r),children:(0,c.sprintf)((0,c.__)("%s error details"),r?"Hide":"Show")})]}),r&&(0,o.jsx)("code",{className:"remote-data-container-error__content is-"+(r?"open":"closed"),children:t.message})]})}class O extends l.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}render(){return this.state.error?(0,o.jsx)(j,{blockTitle:this.props.blockTitle,error:this.state.error,onRetry:()=>this.setState({error:null})}):this.props.children}}function S(){return(0,o.jsx)(i.InnerBlocks,{renderAppender:i.InnerBlocks.DefaultBlockAppender})}var F=n(7833);const P=n.n(F)()("calypso:analytics");let E;n(2287);let I=null;"undefined"!=typeof window&&window.addEventListener("popstate",(function(){I=null}));var A=n(9545);const B=["AT","BE","BG","CY","CZ","DE","DK","EE","ES","FI","FR","GR","HR","HU","IE","IT","LT","LU","LV","MT","NL","PL","PT","RO","SE","SI","SK","GB","CH","IS","LI","NO"],L=["california","colorado","connecticut","utah","virginia","texas","tennessee","oregon","new jersey","montana","iowa","indiana","delaware"],N="sensitive_pixel_option",T="sensitive_pixel_options",R={ok:!1,buckets:{essential:!0,analytics:!1,advertising:!1}},D={ok:!1,buckets:{essential:!0,analytics:!0,advertising:!1}},M={ok:!0,buckets:{essential:!0,analytics:!0,advertising:!0}},q=(e,t,n=R)=>{const{ok:r,buckets:o}=e?JSON.parse(e):{};return"boolean"==typeof r?{ok:r,buckets:{...n.buckets,...o}}:t&&["yes","no"].includes(t)?{ok:"yes"===t,buckets:M.buckets}:n};var z=n(7007),H=n(1050);const $=["calypso","jetpack","remotedatablocks","wpcom_dsp_widget"],U=["a8c_cookie_banner_ok","a8c_cookie_banner_view","a8c_ccpa_optout","wcadmin_storeprofiler_create_jetpack_account","wcadmin_storeprofiler_connect_store","wcadmin_storeprofiler_login_jetpack_account","wcadmin_storeprofiler_payment_login","wcadmin_storeprofiler_payment_create_account","calypso_checkout_switch_to_p_24","calypso_checkout_composite_p24_submit_clicked","wpcom_launchbar_button_click","wpcom_support_free_migration_request_click"];let V,K=Promise.resolve();"undefined"!=typeof document&&(K=(0,H.k0)("//stats.wp.com/w.js?67"));const G=new z.EventEmitter;function J(e,t){t=t||{};const n=E;n?.localeSlug&&(t.user_lang=n.localeSlug);const r=function(){if("undefined"==typeof document)return M;const e=A.parse(document.cookie),t="unknown"===(n=e.country_code)||void 0!==n&&B.includes(n);var n;const r=function(e,t){return"US"===e&&("unknown"===t||void 0!==t&&L.includes(t.toLowerCase()))}(e.country_code,e.region);if(!t&&!r)return M;const o=t?D:M,{ok:i,buckets:s}=q(e[T],e[N],o);return r?{ok:i,buckets:{...M.buckets,advertising:s.advertising}}:{ok:i,buckets:s}}();if(r?.buckets.analytics)if(P('Record event "%s" called with props %o',e,t),function(e){return $.some((t=>e.startsWith(`${t}_`)))}(e)||U.includes(e)){if(V){const e=V(t);t={...t,...e}}t=Object.fromEntries(Object.entries(t).filter((([,e])=>void 0!==e))),P('Recording event "%s" with actual props %o',e,t),o=["recordEvent",e,t],"undefined"!=typeof window&&(window._tkq=window._tkq||[],window._tkq.push(o)),G.emit("record-event",e,t)}else P("- Event name must be prefixed by a known source or added to `EVENT_NAME_EXCEPTIONS`");else P('Analytics has been disabled - Ignoring event "%s" with actual props %o',e,t);var o}const Z="remotedatablocks_";function Q(e,t){const n=function(){var e;return null===(e=window.REMOTE_DATA_BLOCKS)||void 0===e?void 0:e.tracks_global_properties}();n&&"local"!==n.vip_env&&J(`${Z}${e}`,Object.assign(Object.assign({},n),t))}function W(e){const{refreshRemoteData:t,remoteData:n,resetRemoteData:r}=e,[i,a]=(0,l.useState)(!1);return n?(0,o.jsx)(s.PanelBody,{title:(0,c.__)("Remote data management","remote-data-blocks"),children:(0,o.jsxs)(s.__experimentalToggleGroupControl,{className:"remote-data-blocks-button-group",label:(0,c.__)(""),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,children:[(0,o.jsx)(s.Button,{onClick:function(){t(),Q("remote_data_container_actions",{action:"refresh_block_data",data_source_type:d(n.blockName)})},style:{marginRight:"10px"},variant:"primary",children:(0,c.__)("Refresh","remote-data-blocks")}),(0,o.jsx)(s.Button,{isDestructive:!0,onClick:()=>a(!0),variant:"secondary",children:(0,c.__)("Reset Block","remote-data-blocks")}),i&&(0,o.jsx)(s.__experimentalConfirmDialog,{isOpen:i,confirmButtonText:(0,c.__)("Reset Block","remote-data-blocks"),onCancel:()=>a(!1),onConfirm:function(){r(),a(!1),Q("remote_data_container_actions",{action:"reset_block_data",data_source_type:d(n.blockName)})},style:{maxWidth:"20em"},children:(0,c.__)("Are you sure you want to reset the block? This will remove all remote data and reset the block to its initial state.","remote-data-blocks")})]})}):null}function X(e){const{blockConfig:t,remoteData:n,updateRemoteData:r}=e,{availableOverrides:i}=t;if(!(null==i?void 0:i.length))return null;const a=new Set(n.enabledOverrides);return(0,o.jsxs)(s.PanelBody,{title:(0,c.__)("Remote data overrides","remote-data-blocks"),children:[(0,o.jsx)("p",{children:(0,c.__)("Overrides potentially alter the behavior of this block based on custom logic. If you have questions about what these overrides do, please contact your site administrator.","remote-data-blocks")}),i.map((e=>{var t;return(0,o.jsx)(s.CheckboxControl,{checked:null===(t=n.enabledOverrides)||void 0===t?void 0:t.includes(e.name),help:e.help_text,label:e.display_name||e.name,onChange:t=>function(e,t){t?(a.add(e),Q("remote_data_container_override",{data_source_type:d(n.blockName),override_type:"unknown",override_target:"unknown"})):a.delete(e),r(Object.assign(Object.assign({},n),{enabledOverrides:Array.from(a)}))}(e.name,t),__nextHasNoMarginBottom:!0},e.name)}))]})}const Y=(0,o.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(k.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})});function ee(e){return(0,o.jsx)(s.Modal,{overlayClassName:"remote-data-blocks-pattern__selection-modal",title:(0,c.__)("Choose a pattern"),onRequestClose:e.onClose,isFullScreen:!0,children:(0,o.jsx)("div",{className:"remote-data-blocks-pattern__selection-content",children:(0,o.jsx)(i.__experimentalBlockPatternsList,{blockPatterns:e.supportedPatterns,shownPatterns:e.supportedPatterns,onClickPattern:e.onClickPattern})})})}function te(e){const[t,n]=(0,l.useState)(!1);return t?(0,o.jsx)(ee,{supportedPatterns:e.supportedPatterns,onClickPattern:function(t){e.onSelectPattern(t),n(!1),Q("add_block",{action:"select_pattern",selected_option:"select_from_list",data_source_type:d(e.blockName)})},onClose:function(){n(!1)}}):(0,o.jsxs)(s.Placeholder,{icon:Y,label:(0,c.__)("Choose a pattern to display your data"),children:[(0,o.jsx)(s.Button,{onClick:()=>n(!0),variant:"primary",children:(0,c.__)("Choose a pattern")}),(0,o.jsx)(s.Button,{onClick:function(){e.onCancel(),Q("add_block",{action:"select_pattern",selected_option:"manual_edit",data_source_type:d(e.blockName)})},variant:"secondary",children:(0,c.__)("Edit manually")})]})}const ne=(0,o.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(k.Path,{d:"M17.3 10.1c0-2.5-2.1-4.4-4.8-4.4-2.2 0-4.1 1.4-4.6 3.3h-.2C5.7 9 4 10.7 4 12.8c0 2.1 1.7 3.8 3.7 3.8h9c1.8 0 3.2-1.5 3.2-3.3.1-1.6-1.1-2.9-2.6-3.2zm-.5 5.1h-9c-1.2 0-2.2-1.1-2.2-2.3s1-2.4 2.2-2.4h1.3l.3-1.1c.4-1.3 1.7-2.2 3.2-2.2 1.8 0 3.3 1.3 3.3 2.9v1.3l1.3.2c.8.1 1.4.9 1.4 1.8-.1 1-.9 1.8-1.8 1.8z"})});var re=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function oe(e){return e.map((e=>Object.fromEntries(Object.entries(e.result).map((([e,t])=>[e,t.value])))))}function ie(e,t,n=""){var r,o,i;return null!==(i=null===(o=null===(r=null==e?void 0:e.result[t])||void 0===r?void 0:r.value)||void 0===o?void 0:o.toString())&&void 0!==i?i:n}function se(e){var t;if(!e)return;const{queryInput:n,results:r}=e,o=re(e,["queryInput","results"]),i=null==r?void 0:r.map(((e,t)=>{var n;const r=null!==(n=e.result)&&void 0!==n?n:{};return function(e){return Object.prototype.hasOwnProperty.call(e,"result")&&Object.prototype.hasOwnProperty.call(e,"uuid")}(e)?e:(o=r,i=`${t}`,{result:Object.fromEntries(Object.entries(o).map((([e,t])=>[e,{name:e,type:"string",value:t}]))),uuid:i});var o,i}));return Object.assign(Object.assign({},o),{queryInputs:null!==(t=e.queryInputs)&&void 0!==t?t:n?[n]:[{}],results:i})}function ae(e){const{blockName:t,field:n,item:r,mediaField:i,onSelectField:a}=e,l=ie(r,n);if(n===i){const e=function(e,t,n=""){var r,o,i;return null!==(i=null===(o=null===(r=Object.values(e.result).find((e=>e.type===t)))||void 0===r?void 0:r.value)||void 0===o?void 0:o.toString())&&void 0!==i?i:n}(r,"image_alt");return(0,o.jsx)("img",{alt:e,src:l})}return a?(0,o.jsx)(s.Button,{onClick:()=>{a(function(e,t,n){return{action:"add_field_shortcode",remoteData:{blockName:n,queryInputs:oe([t]),metadata:{}},selectedField:e,selectionPath:"select_new_tab",type:"field"}}(n,r,t),l)},variant:"link",children:l}):l}function le(e){var t,n,r,i;const{blockName:s,hasNextPage:a,loading:u,onSelect:d,onSelectField:p,page:f,perPage:h,results:v=[],searchInput:g,selectionIds:m,setPage:b,setPerPage:y,setSearchInput:w,setSelectionIds:k,supportsSearch:x,totalItems:j,totalPages:O}=e,{DataViews:S}=window.LockedPrivateDataViews,F=null!==(n=null===(t=null==v?void 0:v[0])||void 0===t?void 0:t.result)&&void 0!==n?n:{},P=Object.entries(F).filter((([e,t])=>!_.includes(t.type))).map((([e])=>e)),E=null===(r=Object.entries(F).find((([e,t])=>"title"===t.type)))||void 0===r?void 0:r[0],I=null===(i=Object.entries(F).find((([e,t])=>C.includes(t.type))))||void 0===i?void 0:i[0],A=P.map((e=>{var t,n;return{id:e,label:null!==(n=null===(t=F[e])||void 0===t?void 0:t.name)&&void 0!==n?n:e,enableGlobalSearch:!0,getValue:({item:t})=>ie(t,e),render:({item:t})=>(0,o.jsx)(ae,{blockName:s,field:e,item:t,mediaField:I,onSelectField:p}),enableSorting:e!==I}})),B=null!=h?h:Math.max(v.length,10),L=P.filter((e=>e!==I&&e!==E)),[N,T]=(0,l.useState)({type:"table",perPage:B,page:f,search:g,fields:L,filters:[],layout:{},titleField:E,mediaField:I});(0,l.useEffect)((()=>{T((e=>Object.assign(Object.assign({},e),{fields:L,mediaField:I,titleField:E})))}),[[I,E,...L].join(";")]);const R=I?{table:{},grid:{}}:{table:{}},D={id:"choose",icon:(0,o.jsx)(o.Fragment,{children:(0,c.__)("Choose")}),isPrimary:!0,label:"",callback:e=>{null==d||d(e)},supportsBulk:!0};let M=[];return d&&(null==v?void 0:v.length)&&(M=[D]),(0,o.jsx)(o.Fragment,{children:(0,o.jsx)(S,{actions:M,data:v,defaultLayouts:R,fields:A,getItemId:e=>e.uuid,isLoading:u||!v,isItemClickable:()=>!0,onChangeSelection:k,onChangeView:function(e){var t,n,r;b(null!==(t=e.page)&&void 0!==t?t:1),y(null!==(n=e.perPage)&&void 0!==n?n:B),w(null!==(r=e.search)&&void 0!==r?r:""),T(e)},paginationInfo:{totalItems:null!=j?j:v.length,totalPages:null!=O?O:a?f+1:Math.max(1,f)},search:x,selection:m,view:N})})}function ce(e,t){const[n,r]=(0,l.useState)(!1);return{close:function(){null==t||t(),r(!1)},isOpen:n,open:function(){null==e||e(),r(!0)}}}const ue=window.wp.apiFetch;var de=n.n(ue);const pe=window.wp.editor;class fe extends Error{}function he(e){return e instanceof Error?e:null==e?new Error("An unknown error occurred"):"string"==typeof e?new Error(e):"object"==typeof e&&"message"in e?new Error(String(e.message)):new Error(String(e))}var ve;!function(e){e.MissingRequiredInput="missing_required_input"}(ve||(ve={}));class ge extends fe{constructor(e,t,n){super(e),this.type=t,this.affectedInputVariables=n}toString(){return`${this.type}: ${this.message}\n\n\t${this.affectedInputVariables.map((e=>e.slug)).join(", ")}`}}function me(e,t){const n=t.filter((e=>e.required)).filter((t=>{var n;return null===(null!==(n=e[t.slug])&&void 0!==n?n:null)}));if(n.length)throw new ge("Missing required query input variables",ve.MissingRequiredInput,n);return!0}var be=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function s(e){try{l(r.next(e))}catch(e){i(e)}}function a(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}l((r=r.apply(e,t||[])).next())}))},ye=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};const _e=function(){const e=new Map,t=e=>{try{return JSON.stringify(e)}catch(t){return String(e)}};return(...n)=>{const r=Array.from(n).map(t).join(",");if(e.has(r))return e.get(r);const o=function(e){return be(this,void 0,void 0,(function*(){var t,n;const{body:r,status:o}=yield de()({url:v,method:"POST",data:e});if(200!==o||!r)throw new Error(String(null!==(n=null!==(t=null==r?void 0:r.message)&&void 0!==t?t:null==r?void 0:r.code)&&void 0!==n?n:"Request for remote data failed"));return{blockName:r.block_name,metadata:r.metadata,pagination:r.pagination,queryKey:r.query_key,queryInputs:r.query_inputs,resultId:r.result_id,results:r.results}}))}(...n);return o instanceof Promise?o.then((()=>(e.set(r,o),o))):(e.set(r,o),o)}}();function Ce({blockName:e,externallyManagedRemoteData:t,externallyManagedUpdateRemoteData:n,fetchOnMount:r=!1,initialPage:o,initialPerPage:i,initialSearchInput:s,onSuccess:c,queryKey:d}){var p,f;const[h,v]=(0,l.useState)(),[g,m]=(0,l.useState)(),[b,_]=(0,l.useState)(!1),C=null!=t?t:h,w=null!=n?n:v,k=Boolean(C),x=u(e),j=null===(p=null==x?void 0:x.selectors)||void 0===p?void 0:p.find((e=>e.query_key===d));if(!j)throw new Error(`Query not found for block "${e}" and key "${d}".`);const O=null!==(f=null==t?void 0:t.enabledOverrides)&&void 0!==f?f:[],S=j.inputs,F=function({initialPage:e=1,initialPerPage:t,paginationData:n}){var r,o,i,s,a,c;const[u,d]=(0,l.useState)(e),[p,f]=(0,l.useState)(null!=t?t:null),[h,v]=(0,l.useState)(),g=null===(r=null==n?void 0:n.input_variables)||void 0===r?void 0:r.next_page,m=null===(o=null==n?void 0:n.input_variables)||void 0===o?void 0:o.previous_page,b=null===(i=null==n?void 0:n.input_variable_targets)||void 0===i?void 0:i.offset,y=null===(s=null==n?void 0:n.input_variable_targets)||void 0===s?void 0:s.page,_=null===(a=null==n?void 0:n.input_variable_targets)||void 0===a?void 0:a.per_page,C=null!==(c=null!=p?p:null==n?void 0:n.per_page)&&void 0!==c?c:10,w=Boolean(g),k=Boolean((null==n?void 0:n.type)&&"NONE"!==(null==n?void 0:n.type)),x=null==n?void 0:n.total_items,j=x?Math.ceil(x/C):void 0;return{hasNextPage:w,page:u,paginationQueryInput:h,perPage:null!=p?p:null==n?void 0:n.per_page,setPage:function(e){if(!k)return;const t=e>u,r=e<u&&e>0,o=t?Math.min(null!=j?j:u+1,e):Math.max(1,e);if(t||r)switch(null==n?void 0:n.type){case"CURSOR":case"CURSOR_SIMPLE":if(t){d(u+1),v(g);break}d(u-1),v(m);break;case"OFFSET":if(!b)break;if(d(o),t){v(Object.assign(Object.assign({},g),{[b]:C*(o-1)}));break}v(Object.assign(Object.assign({},m),{[b]:C*(o-1)}));break;case"PAGE":if(!y)break;if(d(o),t){v(Object.assign(Object.assign({},g),{[y]:o}));break}v(Object.assign(Object.assign({},m),{[y]:o}))}},setPerPage:function(e){_&&C!==e&&(f(e),v(Object.assign(Object.assign({},h),{[_]:e})))},supportsPagination:k,supportsPerPage:Boolean(_),totalItems:x,totalPages:j}}({initialPage:o,initialPerPage:i,paginationData:null==C?void 0:C.pagination}),{hasNextPage:P,page:E,perPage:I,paginationQueryInput:A,supportsPagination:B,totalItems:L,totalPages:N}=F,T=ye(F,["hasNextPage","page","perPage","paginationQueryInput","supportsPagination","totalItems","totalPages"]),{hasSearchInput:R,searchQueryInput:D,searchInput:M,setSearchInput:q,supportsSearch:z}=function({initialSearchInput:e="",inputVariables:t,searchInputDelayInMs:n=500}){var r;const[o,i]=function(e,t){const n=(0,l.useRef)(null),[r,o]=(0,l.useState)(t);return[r,(0,l.useCallback)((t=>{n.current&&clearTimeout(n.current),n.current=setTimeout((()=>{o(t)}),e)}),[])]}(n,e),s=null==t?void 0:t.find((e=>e.type===y)),a=Boolean(s),c=a&&!(null==s?void 0:s.required),u=a&&Boolean(o||c);return{hasSearchInput:u,searchInput:o,searchQueryInput:a?{[null!==(r=null==s?void 0:s.slug)&&void 0!==r?r:""]:u?o:null}:{},setSearchInput:a?i:()=>{},supportsSearch:a}}({initialSearchInput:s,inputVariables:S}),H=Object.assign(Object.assign({},A),D),$=!g&&(k||R),U=k&&z&&!R;if((0,l.useEffect)((()=>{var e;U?w(void 0):$&&V(null!==(e=null==C?void 0:C.queryInputs)&&void 0!==e?e:[{}])}),[U,$,E,I,M]),(0,l.useEffect)((()=>{r&&function(e,t){try{return me(e,t),!0}catch(e){return!1}}(H,S)&&V([{}])}),[]),g&&!b)throw g;function V(t){return be(this,void 0,void 0,(function*(){const{getCurrentPostId:n}=(0,a.select)(pe.store),r=n();if(0===t.length)return void K(new Error("Query input is empty"));1===t.length&&(t[0]=Object.assign(Object.assign({},t[0]),H));const o={block_name:e,post_id:null!=r?r:null,query_key:d,query_inputs:t};try{t.forEach((e=>me(e,S)))}catch(e){return void K(he(e))}_(!0);const i=yield _e(o).catch((e=>{K(he(e))}));i&&(w(Object.assign({enabledOverrides:O},i)),_(!1),null==c||c())}))}function K(e){w(void 0),m(e),_(!1)}return Object.assign({data:C,error:g,fetch:V,hasNextPage:null!=P?P:N?E<N:B,hasPreviousPage:E>1,loading:b,page:E,perPage:I,reset:K,searchInput:M,setSearchInput:q,supportsPagination:B,supportsSearch:z,totalPages:N},T)}const we=e=>{var t,n,r,i;const{className:a,blockName:p,onSelect:f,onSelectField:h,queryKey:v,renderTrigger:g,title:m}=e,b=u(p),[y,_]=(0,l.useState)([]),{close:C,isOpen:w,open:k}=ce(),{data:x,hasNextPage:j,loading:O,page:S,perPage:F,searchInput:P,setPage:E,setPerPage:I,setSearchInput:A,supportsSearch:B,totalItems:L,totalPages:N}=Ce({blockName:p,fetchOnMount:!0,queryKey:v}),T=y.map((e=>e.uuid)),R=null!==(n=null===(t=null==x?void 0:x.results)||void 0===t?void 0:t.map((e=>e.uuid)))&&void 0!==n?n:[],D=Boolean(f);function M(e){const t=T.filter((e=>!R.includes(e))),n=Array.from(new Set([...t,...e])).map((e=>{var t,n,r;return null!==(r=null!==(n=null===(t=null==x?void 0:x.results)||void 0===t?void 0:t.find((t=>e===t.uuid)))&&void 0!==n?n:y.find((t=>e===t.uuid)))&&void 0!==r?r:null})).filter((e=>null!==e));_(n)}function q(e){D&&e.length&&(null==f||f(oe(e)),Q("add_block",{action:"select_item",selected_option:"search_from_list",data_source_type:d(p)}),C())}const z=g?g({onClick:k}):(0,o.jsx)(s.Button,{variant:"primary",onClick:k,__next40pxDefaultSize:!0,children:(0,c.__)("Select items")});return(0,o.jsxs)(o.Fragment,{children:[z,w&&(0,o.jsxs)(s.Modal,{className:D?`${a} rdb-dataviews-bulk-actions-modal`:a,isFullScreen:!0,onRequestClose:C,title:null!==(i=null===(r=null==b?void 0:b.settings)||void 0===r?void 0:r.title)&&void 0!==i?i:m,children:[(0,o.jsx)(le,{blockName:p,hasNextPage:null!=j&&j,loading:O,onSelect:D?q:void 0,onSelectField:h,page:S,perPage:F,results:O||null==x?void 0:x.results,searchInput:P,selectionIds:T,setPage:E,setPerPage:I,setSearchInput:A,setSelectionIds:M,supportsSearch:B,totalItems:L,totalPages:N}),D&&!O&&(0,o.jsxs)(s.__experimentalHStack,{className:"rdb-dataviews-bulk-actions-footer__selection-total",justify:"flex-end",spacing:3,children:[(0,o.jsx)(s.Button,{disabled:0===y.length,onClick:()=>M([]),variant:"tertiary",isDestructive:!0,__next40pxDefaultSize:!0,children:(0,c.__)("Clear selection")}),(0,o.jsx)(s.Button,{disabled:0===y.length,onClick:()=>q(y),variant:"primary",__next40pxDefaultSize:!0,children:(0,c.__)("Select items")})]})]})]})},ke="remote-data/binding",xe="remote-data-blocks";function __(e){return(0,c.__)(e,xe)}var je=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Oe(e){var t;return(0,o.jsx)(s.Modal,Object.assign({className:`${e.className} remote-data-blocks-modal`,headerActions:(0,o.jsxs)(o.Fragment,{children:[e.headerImage&&(0,o.jsx)("img",{alt:e.title,src:e.headerImage,style:{marginRight:"2em",objectFit:"contain"}}),e.headerActions]}),onRequestClose:e.onClose,size:null!==(t=e.size)&&void 0!==t?t:"fill"},e,{children:e.children}))}function Se(e){const{buttonText:t,buttonVariant:n="primary",isOpen:r,onOpen:i}=e,a=je(e,["buttonText","buttonVariant","isOpen","onOpen"]);return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.Button,{variant:n,onClick:i,__next40pxDefaultSize:!0,children:__(e.buttonText)}),r&&(0,o.jsx)(Oe,Object.assign({},a))]})}function Fe(e){const t=e.inputs.reduce(((e,t)=>{var n;return Object.assign(Object.assign({},e),{[t.slug]:null!==(n=t.default_value)&&void 0!==n?n:""})}),{}),[n,r]=(0,l.useState)(t),{close:i,isOpen:a,open:c}=ce();return(0,o.jsx)(Se,{buttonText:"Provide manual input",buttonVariant:"secondary",isOpen:a,onClose:i,onOpen:c,title:e.title,size:"medium",children:(0,o.jsxs)("form",{style:{marginTop:"1rem"},onSubmit:t=>{t.preventDefault(),e.onSelect([n]),i(),Q("add_block",{action:"select_item",selected_option:"manual_input",data_source_type:d(e.blockName)})},children:[e.inputs.map((e=>{var t,i;return(0,o.jsx)(s.TextControl,{label:e.name,required:e.required,value:null!==(i=null===(t=n[e.slug])||void 0===t?void 0:t.toString())&&void 0!==i?i:"",onChange:t=>function(e,t){r(Object.assign(Object.assign({},n),{[e]:t}))}(e.slug,t),__nextHasNoMarginBottom:!0,__next40pxDefaultSize:!0,style:{marginBottom:"8px"}},e.slug)})),(0,o.jsx)(s.__experimentalSpacer,{marginTop:4}),(0,o.jsx)(s.__experimentalHStack,{justify:"flex-end",children:(0,o.jsx)(s.Button,{variant:"primary",type:"submit",__next40pxDefaultSize:!0,children:__("Save")})})]})})}const Pe=(0,o.jsx)(k.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,o.jsx)(k.Path,{d:"m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734Z"})});function Ee(e){var t,n;const{input:r,onSelect:i,title:a}=e,c=d(e.blockName),u={[r.slug]:""},[p,f]=(0,l.useState)(u),{close:h,isOpen:v,open:g}=ce();function m(e){return"airtable"===e?{buttonText:__("Enter record ID"),helpText:(0,o.jsx)(s.ExternalLink,{href:"https://support.airtable.com/docs/finding-airtable-ids#finding-record-ids",children:__("How do I get the Record ID?")})}:{buttonText:__("Provide")+" "+a}}return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.Button,{variant:"secondary",onClick:g,__next40pxDefaultSize:!0,children:m(c).buttonText}),v&&(0,o.jsx)(s.Popover,{onClose:h,offset:16,position:"bottom right",children:(0,o.jsx)("form",{className:"remote-data-blocks-edit__input-popover-form",onSubmit:t=>{t.preventDefault(),i([p]),h(),Q("add_block",{action:"select_item",selected_option:"manual_input",data_source_type:d(e.blockName)})},children:(0,o.jsx)(s.__experimentalInputControl,{className:"remote-data-blocks-edit__input",label:r.name,required:r.required,value:null!==(n=null===(t=p[r.slug])||void 0===t?void 0:t.toString())&&void 0!==n?n:"",onChange:e=>function(e,t){f(Object.assign(Object.assign({},p),{[e]:t}))}(r.slug,null!=e?e:""),help:m(c).helpText,suffix:(0,o.jsx)(s.Button,{icon:Pe,label:__("Save"),type:"submit"}),__next40pxDefaultSize:!0})})})]})}function Ie(e){const{blockConfig:{name:t,selectors:n},onSelect:r}=e;return(0,o.jsx)(o.Fragment,{children:n.map((e=>{var n;const i=e.name,a={blockName:t,headerImage:e.image_url,inputVariables:e.inputs,onSelect:r,queryKey:e.query_key,title:i};switch(e.type){case"search":case"list":return(0,o.jsx)(we,Object.assign({className:"rdb-editor_dataviews-modal-item-select"},a),i);case"load-without-input":return(0,o.jsx)(s.Button,{onClick:()=>r([{}]),variant:"primary",children:e.name},i);case"manual-input":return 1===e.inputs.length&&e.inputs[0]?(0,o.jsx)(Ee,Object.assign({input:e.inputs[0]},a,{title:null!==(n=e.inputs[0].name)&&void 0!==n?n:e.name}),i):(0,o.jsx)(Fe,Object.assign({inputs:e.inputs},a),i)}return null}))})}function Ae(e){var t;const{blockConfig:n,onSelect:r}=e,{instructions:i,settings:a}=n,l=null!==(t=a.icon)&&void 0!==t?t:ne;return(0,o.jsx)(s.Placeholder,{icon:l,label:a.title,instructions:null!=i?i:(0,c.__)("This block requires selection of one or more items for display."),children:(0,o.jsx)(Ie,{blockConfig:n,onSelect:r})})}var Be=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};function Le(e,t,n){var o,i;const s=null===(o=e.innerBlocks)||void 0===o?void 0:o.map((e=>Le(e,t,n))),a=Object.assign(Object.assign({},e.attributes),{metadata:Object.assign(Object.assign({},e.attributes.metadata),{bindings:Object.assign(Object.assign({},null===(i=e.attributes.metadata)||void 0===i?void 0:i.bindings),Object.fromEntries(Te(e.attributes,n).map((([e,n])=>[e,Object.assign(Object.assign({},n),{args:Object.assign(Object.assign({},n.args),{isPreview:!0,previewValue:Ne(t,n.args)})})]))))})});return(0,r.cloneBlock)(e,a,s)}function Ne(e,t){var n;if(!(null==t?void 0:t.field)||!(null===(n=null==e?void 0:e.result)||void 0===n?void 0:n[t.field]))return;let r=ie(e,t.field);return t.label&&(r=`<span class="${f("block-label")}">${t.label}</span> ${r}`),r}function Te(e,t){var n,r;return Object.entries(null!==(r=null===(n=e.metadata)||void 0===n?void 0:n.bindings)&&void 0!==r?r:{}).filter((([e,n])=>{var r;return n.source===ke&&(null===(r=n.args)||void 0===r?void 0:r.block)===t}))}function Re(e,t){var n,r;return Te(e.attributes,t).length>0||null!==(r=null===(n=e.innerBlocks)||void 0===n?void 0:n.some((e=>Re(e,t))))&&void 0!==r&&r}function De(e,t="",n=!1){var o;const{patterns:s}=null!==(o=u(e))&&void 0!==o?o:{},{replaceInnerBlocks:c}=(0,a.useDispatch)(i.store),{getPatternsByBlockTypes:d,allowedPatterns:p}=(0,a.useSelect)((e=>{var n;const r=e(i.store);return{getBlocks:r.getBlocks,getPatternsByBlockTypes:r.getPatternsByBlockTypes,allowedPatterns:null!==(n=r.__experimentalGetAllowedPatterns(t))&&void 0!==n?n:[]}}),[e,t]),[f,h]=(0,l.useState)(!1),v=d(e).find((({name:e})=>e===(null==s?void 0:s.inner_blocks))),g=p.filter((t=>{var n;return(null===(n=null==t?void 0:t.blockTypes)||void 0===n?void 0:n.includes(e))||t.blocks.some((t=>Re(t,e)))}));function m(o){const i=function(t){var n;if(function(e){return Boolean(e.id&&"unsynced"!==e.syncStatus)}(t)){const e=(0,r.createBlock)("core/block",{ref:t.id});return[(0,r.createBlock)("remote-data-blocks/template",{},[e])]}const o=null!==(n=t.blocks.map((t=>Te(t.attributes,e).length?(0,r.cloneBlock)(t):t)))&&void 0!==n?n:[];return[(0,r.createBlock)("remote-data-blocks/template",{},o)]}(o);n&&i.push((0,r.createBlock)("remote-data-blocks/pagination")),i.push((0,r.createBlock)("remote-data-blocks/no-results",{mode:"empty"})),c(t,i).catch((()=>{}))}return{getSupportedPatterns:t=>t?g.map((n=>Object.assign(Object.assign({},n),{blocks:n.blocks.map((n=>Le(n,t,e)))}))):g,onReadyForPatternSelection:function(){v?m(v):h(!0)},onSelectPattern:function(e){const t=g.find((t=>t.m(null!=t?t:e),h(!1)},resetPatternSelection:function(){c(t,[]).catch((()=>{})),h(!1)},showPatternSelection:f}}function Me(e){const t=e.name,n=u(t);if(!n)throw new Error(`Block configuration not found for block: ${t}`);const r=e.clientId,l=se(e.attributes.remoteData),{data:c,fetch:d,loading:p,reset:f,supportsPagination:v}=Ce({blockName:t,externallyManagedRemoteData:l,externallyManagedUpdateRemoteData:x,queryKey:h}),{getSupportedPatterns:g,onSelectPattern:m,onReadyForPatternSelection:b,resetPatternSelection:y,showPatternSelection:_}=De(t,r,v),{hasMultiSelection:C}=(0,a.useSelect)(i.store);function k(){var e;d(null!==(e=null==l?void 0:l.queryInputs)&&void 0!==e?e:[{}])}function x(t){(function(e,t){if(!e||!t)return!0;const{metadata:n,resultId:r,results:o}=e,i=Be(e,["metadata","resultId","results"]),{metadata:s,resultId:a,results:l}=t,c=Be(t,["metadata","resultId","results"]),u=o.map((e=>{var{uuid:t}=e;return Be(e,["uuid"])})),d=l.map((e=>{var{uuid:t}=e;return Be(e,["uuid"])}));return JSON.stringify(u)!==JSON.stringify(d)||JSON.stringify(i)!==JSON.stringify(c)})(l,t)&&e.setAttributes({remoteData:t})}function j(e=!1){return(0,o.jsx)("div",{className:"remote-data-blocks-loading-overlay",style:e?{pointerEvents:"auto"}:void 0,children:(0,o.jsx)(s.Spinner,{style:{height:"50px",width:"50px"}})})}if(!c)return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(Ae,{blockConfig:n,onSelect:function(e){d(e).then((()=>{b()}))}}),p&&j(!0)]});if(_){const e=g(c.results[0]);return(0,o.jsx)(te,{blockName:t,onCancel:y,onSelectPattern:m,supportedPatterns:e})}return(0,o.jsxs)(o.Fragment,{children:[!C()&&(0,o.jsxs)(i.InspectorControls,{children:[(0,o.jsx)(X,{blockConfig:n,remoteData:c,updateRemoteData:x}),(0,o.jsx)(W,{refreshRemoteData:k,remoteData:c,resetRemoteData:function(){f(),y()}}),(0,o.jsx)(w,{onUpdateQueryInputs:function(e,t){l&&(x(Object.assign(Object.assign({},l),{queryInputs:t,queryKey:e})),k())},remoteData:c,selectors:n.selectors})]}),p&&j(),(0,o.jsx)(S,{})]})}function qe(e){const t=(0,i.useBlockProps)({className:b});return(0,o.jsx)("div",Object.assign({},t,{children:(0,o.jsx)(O,{blockTitle:p(e.name),children:(0,o.jsx)(Me,Object.assign({},e))})}))}function ze(){const e=i.useBlockProps.save({className:b});return(0,o.jsx)("div",Object.assign({},e,{children:(0,o.jsx)(i.InnerBlocks.Content,{})}))}Object.values(function(){var e,t;return null!==(t=null===(e=window.REMOTE_DATA_BLOCKS)||void 0===e?void 0:e.config)&&void 0!==t?t:{}}()).forEach((e=>{(0,r.registerBlockType)(e.name,Object.assign(Object.assign({},e.settings),{attributes:{remoteData:{type:"object"}},edit:qe,save:ze}))}))},7833:(e,t,n)=>{t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r++,"%c"===e&&(o=r))})),t.splice(o,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(736)(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},736:(e,t,n)=>{e.exports=function(e){function t(e){let n,o,i,s=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];n=i.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function o(e,t){let n=0,r=0,o=-1,i=0;for(;n<e.length;)if(r<t.length&&(t[r]===e[n]||"*"===t[r]))"*"===t[r]?(o=r,i=n,r++):(n++,r++);else{if(-1===o)return!1;r=o+1,i++,n=i}for(;r<t.length&&"*"===t[r];)r++;return r===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(o(e,n))return!1;for(const n of t.names)if(o(e,n))return!0;return!1},t.humanize=n(6585),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((n=>{t[n]=e[n]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t}},7007:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(n,r){function o(n){e.removeListener(t,i),r(n)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),n([].slice.call(arguments))}v(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var o,i,s,c;if(a(n),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),s=i[t]),void 0===s)s=i[t]=n,++e._eventsCount;else if("function"==typeof s?s=i[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(o=l(e))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=u.bind(r);return o.listener=n,r.wrapFn=o,o}function p(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):h(o,o.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function h(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function v(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){r.once&&e.removeEventListener(t,o),n(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return l(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var c=l.length,u=h(l,c);for(n=0;n<c;++n)r(u[n],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},i.prototype.removeListener=function(e,t){var n,r,o,i,s;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){s=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},i.prototype.listeners=function(e){return p(this,e,!0)},i.prototype.rawListeners=function(e){return p(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},6166:(e,t,n)=>{"use strict";var r=n(7426),o=n(3349);function i(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=i,i.prototype.update=function(e,t){if(e=r.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=r.join32(e,0,e.length-n,this.endian);for(var o=0;o<e.length;o+=this._delta32)this._update(e,o,o+this._delta32)}return this},i.prototype.digest=function(e){return this.update(this._pad()),o(null===this.pending),this._digest(e)},i.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,n=t-(e+this.padLength)%t,r=new Array(n+this.padLength);r[0]=128;for(var o=1;o<n;o++)r[o]=0;if(e<<=3,"big"===this.endian){for(var i=8;i<this.padLength;i++)r[o++]=0;r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=e>>>24&255,r[o++]=e>>>16&255,r[o++]=e>>>8&255,r[o++]=255&e}else for(r[o++]=255&e,r[o++]=e>>>8&255,r[o++]=e>>>16&255,r[o++]=e>>>24&255,r[o++]=0,r[o++]=0,r[o++]=0,r[o++]=0,i=8;i<this.padLength;i++)r[o++]=0;return r}},2287:(e,t,n)=>{"use strict";var r=n(7426),o=n(6166),i=n(6225),s=n(3349),a=r.sum32,l=r.sum32_4,c=r.sum32_5,u=i.ch32,d=i.maj32,p=i.s0_256,f=i.s1_256,h=i.g0_256,v=i.g1_256,g=o.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}r.inherits(b,g),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var n=this.W,r=0;r<16;r++)n[r]=e[t+r];for(;r<n.length;r++)n[r]=l(v(n[r-2]),n[r-7],h(n[r-15]),n[r-16]);var o=this.h[0],i=this.h[1],g=this.h[2],m=this.h[3],b=this.h[4],y=this.h[5],_=this.h[6],C=this.h[7];for(s(this.k.length===n.length),r=0;r<n.length;r++){var w=c(C,f(b),u(b,y,_),this.k[r],n[r]),k=a(p(o),d(o,i,g));C=_,_=y,y=b,b=a(m,w),m=g,g=i,i=o,o=a(w,k)}this.h[0]=a(this.h[0],o),this.h[1]=a(this.h[1],i),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],b),this.h[5]=a(this.h[5],y),this.h[6]=a(this.h[6],_),this.h[7]=a(this.h[7],C)},b.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h,"big"):r.split32(this.h,"big")}},6225:(e,t,n)=>{"use strict";var r=n(7426).rotr32;function o(e,t,n){return e&t^~e&n}function i(e,t,n){return e&t^e&n^t&n}function s(e,t,n){return e^t^n}t.ft_1=function(e,t,n,r){return 0===e?o(t,n,r):1===e||3===e?s(t,n,r):2===e?i(t,n,r):void 0},t.ch32=o,t.maj32=i,t.p32=s,t.s0_256=function(e){return r(e,2)^r(e,13)^r(e,22)},t.s1_256=function(e){return r(e,6)^r(e,11)^r(e,25)},t.g0_256=function(e){return r(e,7)^r(e,18)^e>>>3},t.g1_256=function(e){return r(e,17)^r(e,19)^e>>>10}},7426:(e,t,n)=>{"use strict";var r=n(3349),o=n(6698);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function l(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=o,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var n=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)n.push(parseInt(e[o]+e[o+1],16))}else for(var r=0,o=0;o<e.length;o++){var s=e.charCodeAt(o);s<128?n[r++]=s:s<2048?(n[r++]=s>>6|192,n[r++]=63&s|128):i(e,o)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++o)),n[r++]=s>>18|240,n[r++]=s>>12&63|128,n[r++]=s>>6&63|128,n[r++]=63&s|128):(n[r++]=s>>12|224,n[r++]=s>>6&63|128,n[r++]=63&s|128)}else for(o=0;o<e.length;o++)n[o]=0|e[o];return n},t.toHex=function(e){for(var t="",n=0;n<e.length;n++)t+=a(e[n].toString(16));return t},t.htonl=s,t.toHex32=function(e,t){for(var n="",r=0;r<e.length;r++){var o=e[r];"little"===t&&(o=s(o)),n+=l(o.toString(16))}return n},t.zero2=a,t.zero8=l,t.join32=function(e,t,n,o){var i=n-t;r(i%4==0);for(var s=new Array(i/4),a=0,l=t;a<s.length;a++,l+=4){var c;c="big"===o?e[l]<<24|e[l+1]<<16|e[l+2]<<8|e[l+3]:e[l+3]<<24|e[l+2]<<16|e[l+1]<<8|e[l],s[a]=c>>>0}return s},t.split32=function(e,t){for(var n=new Array(4*e.length),r=0,o=0;r<e.length;r++,o+=4){var i=e[r];"big"===t?(n[o]=i>>>24,n[o+1]=i>>>16&255,n[o+2]=i>>>8&255,n[o+3]=255&i):(n[o+3]=i>>>24,n[o+2]=i>>>16&255,n[o+1]=i>>>8&255,n[o]=255&i)}return n},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,n){return e+t+n>>>0},t.sum32_4=function(e,t,n,r){return e+t+n+r>>>0},t.sum32_5=function(e,t,n,r,o){return e+t+n+r+o>>>0},t.sum64=function(e,t,n,r){var o=e[t],i=r+e[t+1]>>>0,s=(i<r?1:0)+n+o;e[t]=s>>>0,e[t+1]=i},t.sum64_hi=function(e,t,n,r){return(t+r>>>0<t?1:0)+e+n>>>0},t.sum64_lo=function(e,t,n,r){return t+r>>>0},t.sum64_4_hi=function(e,t,n,r,o,i,s,a){var l=0,c=t;return l+=(c=c+r>>>0)<t?1:0,l+=(c=c+i>>>0)<i?1:0,e+n+o+s+(l+=(c=c+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,n,r,o,i,s,a){return t+r+i+a>>>0},t.sum64_5_hi=function(e,t,n,r,o,i,s,a,l,c){var u=0,d=t;return u+=(d=d+r>>>0)<t?1:0,u+=(d=d+i>>>0)<i?1:0,u+=(d=d+a>>>0)<a?1:0,e+n+o+s+l+(u+=(d=d+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,n,r,o,i,s,a,l,c){return t+r+i+a+c>>>0},t.rotr64_hi=function(e,t,n){return(t<<32-n|e>>>n)>>>0},t.rotr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0},t.shr64_hi=function(e,t,n){return e>>>n},t.shr64_lo=function(e,t,n){return(e<<32-n|t>>>n)>>>0}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},3349:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}},6585:e=>{var t=1e3,n=60*t,r=60*n,o=24*r,i=7*o;function s(e,t,n,r){var o=t>=1.5*n;return Math.round(e/n)+" "+r+(o?"s":"")}e.exports=function(e,a){a=a||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(s){var a=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*i;case"days":case"day":case"d":return a*o;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===u&&isFinite(e))return a.long?(l=e,(c=Math.abs(l))>=o?s(l,c,o,"day"):c>=r?s(l,c,r,"hour"):c>=n?s(l,c,n,"minute"):c>=t?s(l,c,t,"second"):l+" ms"):function(e){var i=Math.abs(e);return i>=o?Math.round(e/o)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},4994:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.m=t,e=[],r.O=(t,n,o,i)=>{if(!n){var s=1/0;for(u=0;u<e.length;u++){for(var[n,o,i]=e[u],a=!0,l=0;l<n.length;l++)(!1&i||s>=i)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(a=!1,i<s&&(s=i));if(a){e.splice(u--,1);var c=o();void 0!==c&&(t=c)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[n,o,i]},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),(()=>{var e={508:0,172:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var o,i,[s,a,l]=n,c=0;if(s.some((t=>0!==e[t]))){for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(l)var u=l(r)}for(t&&t(n);c<s.length;c++)i=s[c],r.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return r.O(u)},n=globalThis.webpackChunkremote_data_blocks=globalThis.webpackChunkremote_data_blocks||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var o=r.O(void 0,[172],(()=>r(6540)));o=r.O(o)})();
  • remote-data-blocks/trunk/package.json

    r3389562 r3390422  
    1010    "inc/",
    1111    "vendor/",
     12
    1213    "functions.php",
    1314    "remote-data-blocks.php",
  • remote-data-blocks/trunk/readme.txt

    r3389562 r3390422  
    11=== Remote Data Blocks ===
    2 Contributors: czarate, maxschmeling, hew.
     2Contributors: czarate, maxschmeling, hew
    33Tested up to: 6.8
    4 Stable tag: 1.4.0
     4Stable tag: 1.4.
    55License: GPLv2 or later
    66License URI: http://www.gnu.org/licenses/gpl-2.0.html
  • remote-data-blocks/trunk/remote-data-blocks.php

    r3388907 r3390422  
    88 * Author URI: https://automattic.com
    99 * Text Domain: remote-data-blocks
    10  * Version: 1.4.0
     10 * Version: 1.4.
    1111 * Requires at least: 6.7
    1212 * Requires PHP: 8.1
     
    2727define( 'REMOTE_DATA_BLOCKS__PLUGIN_ROOT', __FILE__ );
    2828define( 'REMOTE_DATA_BLOCKS__PLUGIN_DIRECTORY', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
    29 define( 'REMOTE_DATA_BLOCKS__PLUGIN_VERSION', '1.4.0' );
     29define( 'REMOTE_DATA_BLOCKS__PLUGIN_VERSION', '1.4.' );
    3030
    3131define( 'REMOTE_DATA_BLOCKS__REST_NAMESPACE', 'remote-data-blocks/v1' );
  • remote-data-blocks/trunk/vendor/composer/installed.php

    r3388907 r3390422  
    44        'pretty_version' => 'dev-trunk',
    55        'version' => 'dev-trunk',
    6         'reference' => '18600845f0215f50f18e43767eb7e149d0e755b5',
     6        'reference' => '',
    77        'type' => 'library',
    88        'install_path' => __DIR__ . '/../../',
     
    1414            'pretty_version' => 'dev-trunk',
    1515            'version' => 'dev-trunk',
    16             'reference' => '18600845f0215f50f18e43767eb7e149d0e755b5',
     16            'reference' => '',
    1717            'type' => 'library',
    1818            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.