File: /home/dfwparty/candytheclown.com/wp-content/plugins/wordpress-seo/js/dist/elementor-v4.js
(()=>{"use strict";const e=window.lodash,t=()=>!0;class n extends $e.modules.hookUI.Base{constructor(e,n,o,r=t){super(),this.command=e,this.id=n,this.callback=o,this.conditions=r}getCommand(){return this.command}getId(){return this.id}getConditions(...e){return this.conditions(...e)}apply(...e){return this.callback(...e)}}function o(e,o,r,i=t){return $e.hooks.registerUIAfter(new n(e,o,r,i))}function r(e,o,r,i=t){return $e.hooks.registerUIBefore(new n(e,o,r,i))}$e.modules.hookData.Base;const i=e=>{return parseInt(null===(t=document.getElementById("post_ID"))||void 0===t?void 0:t.value,10)===e;var t},s=()=>{var e;return i(null===(e=elementor.documents.getCurrent())||void 0===e?void 0:e.id)},a=window.wp.data,c=window.yoast.analysis,d=window.wp.sanitize,l=window.yoast.helpers;window.wp.i18n,window.wp.element,window.ReactJSXRuntime;const{stripHTMLTags:u}=l.strings;function m(e,t){if(!e.id)return{content:"",widgets:[]};const n=function(e,t){var n;return null!==(n=null==t?void 0:t.find(`[data-id="${e.id}"], [data-interaction-id="${e.id}"]`).get(0))&&void 0!==n?n:null}(e,t);if(!n)return{content:"",widgets:[]};const o=function(e){if(!e.classList.contains("elementor-element"))return e.outerHTML;const t=e.cloneNode(!0);return t.querySelectorAll(".elementor-element-overlay, .elementor-background-overlay, .ui-resizable-handle").forEach(e=>e.remove()),t.outerHTML}(n).replace(/[\n\t]/g,"");return o?{content:o,widgets:[{id:e.id,widgetType:e.widgetType,start:0,end:o.length}]}:{content:"",widgets:[]}}function g(e,t){if(e=function(e){return"function"==typeof(null==e?void 0:e.toJSON)?e.toJSON():e}(e),!Array.isArray(e))return{content:"",widgets:[]};let n="";const o=[];for(const r of e){if(!r||"object"!=typeof r)continue;const e="widget"===r.elType?m(r,t):g(r.elements,t),i=n.length;o.push(...e.widgets.map(e=>({...e,start:e.start+i,end:e.end+i}))),n+=e.content}return{content:n,widgets:o}}function p(e){var t;if(!e)return[];const n=function(e){var t,n;const o=null===(t=e.container)||void 0===t||null===(n=t.model)||void 0===n?void 0:n.get("elements");return o&&"function"==typeof o.toJSON?o.toJSON():null}(e);return n||(Array.isArray(null===(t=e.config)||void 0===t?void 0:t.elements)?e.config.elements:[])}function f(t,n=!1){let o=elementor.settings.page.model.get("post_excerpt");return n?o||"":(o||(o=function(e,t=156){return(e=(e=(0,d.stripTags)(e)).trim()).length<=t||(e=e.substring(0,t),/\s/.test(e)&&(e=e.substring(0,e.lastIndexOf(" ")))),e}(t,"ja"===function(){const t=(0,e.get)(window,"wpseoScriptData.metabox",{intl:{},isRtl:!1});return(0,e.get)(t,"contentLocale","en_US")}()?80:156)),o)}const w={content:"",title:"",excerpt:"",imageUrl:"",featuredImage:"",contentImage:"",excerptOnly:""};function y(){const t=elementor.documents.getCurrent();if(!s())return;if(!["wp-post","wp-page"].includes(t.config.type))return;if((0,a.select)("yoast-seo/editor").getActiveMarker())return;const n=(t=>{const{content:n}=g(p(t),t.$element),o=(0,e.get)(elementor.settings.page.model.get("post_featured_image"),"url",""),r=function(e){const t=c.languageProcessing.imageInText(e);if(0===t.length)return"";const n=jQuery.parseHTML(t.join(""));for(const e of n)if(e.src)return e.src;return""}(n);return{content:n,title:elementor.settings.page.model.get("post_title"),excerpt:f(n),excerptOnly:f(n,!0),imageUrl:o||r,featuredImage:o,contentImage:r,status:elementor.settings.page.model.get("post_status")}})(t);n.content!==w.content&&(w.content=n.content,(0,a.dispatch)("yoast-seo/editor").setEditorDataContent(w.content)),n.title!==w.title&&(w.title=n.title,(0,a.dispatch)("yoast-seo/editor").setEditorDataTitle(w.title)),n.excerpt!==w.excerpt&&(w.excerpt=n.excerpt,w.excerptOnly=n.excerptOnly,(0,a.dispatch)("yoast-seo/editor").setEditorDataExcerpt(w.excerpt),(0,a.dispatch)("yoast-seo/editor").updateReplacementVariable("excerpt",w.excerpt),(0,a.dispatch)("yoast-seo/editor").updateReplacementVariable("excerpt_only",w.excerptOnly)),n.imageUrl!==w.imageUrl&&(w.imageUrl=n.imageUrl,(0,a.dispatch)("yoast-seo/editor").setEditorDataImageUrl(w.imageUrl)),n.contentImage!==w.contentImage&&(w.contentImage=n.contentImage,(0,a.dispatch)("yoast-seo/editor").setContentImage(w.contentImage)),n.featuredImage!==w.featuredImage&&(w.featuredImage=n.featuredImage,(0,a.dispatch)("yoast-seo/editor").updateData({snippetPreviewImageURL:w.featuredImage}))}const v=(0,e.debounce)(y,500);function h(){(0,a.dispatch)("yoast-seo/editor").setActiveMarker(null),(0,a.dispatch)("yoast-seo/editor").setMarkerPauseStatus(!1),YoastSEO.analysis.applyMarks(new c.Paper("",{}),[])}function I(){let t=e.noop;o("editor/documents/attach-preview","yoast-seo/v4/content-walker/start-observer",()=>{var e,n;t();const o=null===(e=elementor.documents.getCurrent())||void 0===e||null===(n=e.$element)||void 0===n?void 0:n.get(0),r=new MutationObserver(v);o&&r.observe(o,{attributes:!0,childList:!0,subtree:!0,characterData:!0}),elementor.channels.editor.on("change",v),elementor.settings.page.model.on("change",v),t=()=>{r.disconnect(),elementor.channels.editor.off("change",v),elementor.settings.page.model.off("change",v)},v()},s),r("panel/editor/open","yoast-seo/v4/marks/reset-on-edit",(0,e.debounce)(h,500),s),r("document/save/save","yoast-seo/v4/marks/reset-on-save",h,({document:e})=>i((null==e?void 0:e.id)||elementor.documents.getCurrent().id)),o("editor/documents/close","yoast-seo/v4/content-walker/stop",()=>{t(),t=e.noop,v.cancel()},({id:e})=>i(e)),o("document/save/set-is-modified","yoast-seo/v4/content-walker/on-modified",v,({document:e})=>i((null==e?void 0:e.id)||elementor.documents.getCurrent().id)),y()}window.yoastElementorV4={getWidgetMap:function(e=elementor.documents.getCurrent()){return g(p(e),e.$element).widgets}},jQuery(window).on("elementor:init",()=>{window.elementor.on("panel:init",()=>{setTimeout(I)})})})();