here.',"wp-parsely"):s.code===$.ParselySuggestionsApiOpenAiError||s.code===$.ParselySuggestionsApiOpenAiUnavailable?s.message=(0,_.__)("The Parse.ly API returned an internal server error. Please retry with a different input, or try again later.","wp-parsely"):s.code===$.HttpRequestFailed&&s.message.includes("cURL error 28")?s.message=(0,_.__)("The Parse.ly API did not respond in a timely manner. Please try again later.","wp-parsely"):s.code===$.ParselySuggestionsApiSchemaError?s.message=(0,_.__)("The Parse.ly API returned a validation error. Please try again with different parameters.","wp-parsely"):s.code===$.ParselySuggestionsApiNoData?s.message=(0,_.__)("The Parse.ly API couldn't find any relevant data to fulfill the request. Please retry with a different input.","wp-parsely"):s.code===$.ParselySuggestionsApiOpenAiSchema?s.message=(0,_.__)("The Parse.ly API returned an incorrect response. Please try again later.","wp-parsely"):s.code===$.ParselySuggestionsApiAuthUnavailable&&(s.message=(0,_.__)("The Parse.ly API is currently unavailable. Please try again later.","wp-parsely")),s}return re(t,e),t.prototype.Message=function(e){return void 0===e&&(e=null),[$.PluginCredentialsNotSetMessageDetected,$.PluginSettingsSiteIdNotSet,$.PluginSettingsApiSecretNotSet].includes(this.code)?K(e):(this.code===$.FetchError&&(this.hint=this.Hint((0,_.__)("This error can sometimes be caused by ad-blockers or browser tracking protections. Please add this site to any applicable allow lists and try again.","wp-parsely"))),this.code!==$.ParselyApiForbidden&&this.code!==$.ParselySuggestionsApiNoAuthentication||(this.hint=this.Hint((0,_.__)("Please ensure that the Site ID and API Secret given in the plugin's settings are correct.","wp-parsely"))),this.code===$.HttpRequestFailed&&(this.hint=this.Hint((0,_.__)("The Parse.ly API cannot be reached. Please verify that you are online.","wp-parsely"))),(0,p.jsx)(W,{className:null==e?void 0:e.className,testId:"error",children:"".concat(this.message,"
").concat(this.hint?this.hint:"")}))},t.prototype.Hint=function(e){return''.concat((0,_.__)("Hint:","wp-parsely")," ").concat(e,"
")},t.prototype.createErrorSnackbar=function(){//.test(this.message)||(0,h.dispatch)("core/notices").createNotice("error",this.message,{type:"snackbar"})},t}(Error),se=function(e){var t=e.isDetectingEnabled,n=e.onLinkChange,r=e.onLinkRemove,i=e.onLinkAdd,s=e.debounceValue,o=void 0===s?500:s,a=(0,h.useSelect)((function(e){return{blocks:(0,e("core/block-editor").getBlocks)()}}),[]).blocks,l=(0,b.useRef)(a),c=(0,b.useRef)(t);return(0,b.useEffect)((function(){var e=(0,z.debounce)((function(){for(var t=[],s=0;s0)return r(e.innerBlocks,t[s].innerBlocks);if(JSON.stringify(e)!==JSON.stringify(t[s])){var o=t[s],a=i.parseFromString(e.attributes.content||"","text/html"),l=i.parseFromString((null==o?void 0:o.attributes.content)||"","text/html"),c=Array.from(a.querySelectorAll("a[data-smartlink]")),u=Array.from(l.querySelectorAll("a[data-smartlink]")),d=c.filter((function(e){return!u.some((function(t){return t.dataset.smartlink===e.dataset.smartlink}))})),p=u.filter((function(e){return!c.some((function(t){return t.dataset.smartlink===e.dataset.smartlink}))})),f=c.filter((function(e){var t=u.find((function(t){return t.dataset.smartlink===e.dataset.smartlink}));return t&&t.outerHTML!==e.outerHTML}));(d.length>0||p.length>0||f.length>0)&&n.push({block:e,prevBlock:o,addedLinks:d,removedLinks:p,changedLinks:f})}}}))};return r(e,t),n}(a,l.current);o.length>0&&(o.forEach((function(e){e.changedLinks.length>0&&n&&n(e),e.addedLinks.length>0&&i&&i(e),e.removedLinks.length>0&&r&&r(e)})),l.current=a)}),o);return e(t),function(){e.cancel()}}),[a,o,t,i,n,r]),null},oe=function(e){var t=e.value,n=e.onChange,r=e.max,i=e.min,s=e.suffix,o=e.size,a=e.label,l=e.initialPosition,c=e.disabled,u=e.className;return(0,p.jsxs)("div",{className:"parsely-inputrange-control ".concat(u||""),children:[(0,p.jsx)(f.__experimentalHeading,{className:"parsely-inputrange-control__label",level:3,children:a}),(0,p.jsxs)("div",{className:"parsely-inputrange-control__controls",children:[(0,p.jsx)(f.__experimentalNumberControl,{disabled:c,value:t,suffix:(0,p.jsx)(f.__experimentalInputControlSuffixWrapper,{children:s}),size:null!=o?o:"__unstable-large",min:i,max:r,onChange:function(e){var t=parseInt(e,10);isNaN(t)||n(t)}}),(0,p.jsx)(f.RangeControl,{disabled:c,value:t,showTooltip:!1,initialPosition:l,onChange:function(e){n(e)},withInputField:!1,min:i,max:r})]})]})},ae=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))},le=function(e,t){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]