').replace(/\s*<\/p>/g,""),children:JSON.parse((null===(a=t.querySelector("children"))||void 0===a?void 0:a.innerHTML)||"{}")})})),PN.setSessionData(JSON.stringify(this.data[e.key]),e.key),[2]}}))}))})),[4,Promise.all(e)]);case 1:return a.sent(),[2,this.data]}}))}))},e}(),RN=function(){function e(e){this.RSS=e,this.createTriggerButton(),this.createFlyOut()}return e.prototype.getTriggerButtonID=function(){return"whats-new-rss-btn-".concat(this.RSS.getID())},e.prototype.getFlyoutID=function(){return"whats-new-rss-flyout-".concat(this.RSS.getID())},e.prototype.getFlyoutCloseBtnID=function(){return"whats-new-rss-flyout-close-".concat(this.RSS.getID())},e.prototype.getFlyoutMultiFeedNavID=function(){return"whats-new-rss-flyout-multi-feed-nav-".concat(this.RSS.getID())},e.prototype.setIsLoading=function(e){void 0===e&&(e=!1);var t=document.getElementById(this.getFlyoutID());e?t.classList.add("is-loading"):t.classList.remove("is-loading")},e.prototype.setNotification=function(e){var t=document.querySelector("#".concat(this.getTriggerButtonID()," .whats-new-rss-notification-badge"));e?(this.RSS.isMultiFeedRSS()?(t.innerHTML="",t.classList.add("is-multi-feed")):t.innerHTML=e>9?"9+":e.toString(),t.classList.remove("hide")):t.classList.add("hide")},e.prototype.createTriggerButton=function(){var e,t=this.RSS.getArgs().triggerButton.label;e=t?"\n\t\t\t".concat(this.RSS.getArgs().triggerButton.beforeBtn,'\n\t\t\t\n\t\t\t").concat(this.RSS.getArgs().triggerButton.afterBtn,"\n\t\t\t"):"\n\t\t\t".concat(this.RSS.getArgs().triggerButton.beforeBtn,'\n\t\t\t\n\t\t\t').concat(this.RSS.getArgs().triggerButton.afterBtn,"\n\t\t\t"),this.RSS.getElement().innerHTML+=e},e.prototype.createFlyOut=function(){var e=["whats-new-rss-flyout","closed"];this.RSS.getArgs().flyout.className&&e.push(this.RSS.getArgs().flyout.className);var t=[];this.RSS.isMultiFeedRSS()&&(t.push('"));var a=document.createElement("div");a.setAttribute("id",this.getFlyoutID()),a.setAttribute("class",e.join(" ")),a.setAttribute("role","dialog"),a.innerHTML='\n\t\t
\n\n\t\t\n\t\t'),document.body.appendChild(a)},e.prototype.setMultiFeedTabNotificationCount=function(e,t){void 0===t&&(t=0);var a=document.querySelector("#".concat(this.getFlyoutMultiFeedNavID(),' button[data-feed-key="').concat(e,'"]'));if(a){var r=a.querySelector(".new-notification-count");if(t){var n=t>9?"9+":t;r.innerHTML=n.toString()}else r.innerHTML=""}},e.prototype.innerContentWrapper=function(e,t,a){void 0===t&&(t=!1),void 0===a&&(a="");var r=["whats-new-rss-flyout-inner-content-item"];return t&&r.push("rss-new-post"),a&&r.push(a),'\n\t\t\n\t\t\t').concat(t?'New ✨':"","\n\t\t\t").concat(e,"\n\t\t
\n\t\t")},e.prototype.createExcerpt=function(e,t,a){var r=a.wordLimit,n=a.moreSymbol,i=a.readMore;if(!r)return e;var s=e.replace(/<[^>]*>/g,"").split(/\s+/),o=s.slice(0,r).join(" ");return n&&(o+=n),r>s.length?e:t&&(null==i?void 0:i.label)?"".concat(o,' ').concat(i.label,"
"):"".concat(o,"
")},e.prototype.listChildrenPosts=function(e){var t=this,a=Object.values(e);if(!a.length)return"";var r=document.createElement("details"),n=document.createElement("summary"),i=document.createElement("div");return a.forEach((function(e){var a=(new DOMParser).parseFromString(e.post_content,"text/html"),r=document.createElement("div");r.classList.add("sub-version-item"),r.innerHTML='\n\t\t\t\t\n\t\t\t\t').concat(a.documentElement.textContent,"
\n\t\t\t"),i.appendChild(r)})),n.innerHTML='See More
See Less
',r.appendChild(n),r.appendChild(i),i.classList.add("sub-version-items-wrapper"),r.classList.add("whats-new-rss-sub-version-details"),r.outerHTML},e.prototype.formatDate=function(e){if("function"==typeof this.RSS.getArgs().flyout.formatDate)return this.RSS.getArgs().flyout.formatDate(e);var t=new Date,a=e.getTime(),r=t.getTime()-a,n=36e5,i=24*n,s=7*i,o=30*i;if(r<6e4)return"Just now";if(r1?"s":""," ago")}if(r1?"s":""," ago")}if(r1?"s":""," ago")}if(r1?"s":""," ago")}var m=Math.floor(r/o);return"".concat(m," month").concat(m>1?"s":""," ago")},e}();const HN=function(){const a=cartflows_admin?.whats_new_rss_feed;return function({selector:e,...a}){const r=(0,t.useRef)(null);(0,t.useEffect)((()=>{var t;return async function(){const e="whats-new-rss-styles";if(!document.getElementById(e)){const t=document.createElement("style");t.id=e,t.innerHTML=await async function(){return'.whats-new-rss-is-active{overflow:hidden}.whats-new-rss-trigger-button{display:flex;align-items:center;position:relative;width:auto;padding:5px;cursor:pointer}.whats-new-rss-trigger-button.has-label{align-items:end;gap:10px}.whats-new-rss-trigger-button.has-label .icon-badge{position:relative;line-height:1}.whats-new-rss-trigger-button.has-label .icon-badge .whats-new-rss-notification-badge{top:-12px;right:-10px}.whats-new-rss-trigger-button .whats-new-rss-notification-badge{position:absolute;top:-8px;right:-5px;width:20px;font-size:10px;line-height:20px;text-align:center;border-radius:10px;color:#fff;background:red;transition:transform .2s ease-in-out}.whats-new-rss-trigger-button .whats-new-rss-notification-badge.is-multi-feed{top:-2px;right:-2px;font-size:0;width:10px;height:10px}.whats-new-rss-trigger-button .whats-new-rss-notification-badge.hide{display:none}.whats-new-rss-trigger-button:hover .whats-new-rss-notification-badge{transform:scale(1.2)}.whats-new-rss-flyout{position:fixed;top:0;right:0;bottom:0;width:100%;z-index:99999;transition:visibility .3s ease-in-out;font-family:Arial,Helvetica,sans-serif}.whats-new-rss-flyout .lightbox-trigger,.whats-new-rss-flyout.hidden{display:none}.whats-new-rss-flyout.is-loading .whats-new-rss-flyout-inner-header__loading-icon{display:block;margin:auto}.whats-new-rss-flyout.is-loading .whats-new-rss-flyout-inner-header__loading-icon svg{display:block;background:0 0;width:25px;height:25px}.whats-new-rss-flyout .whats-new-rss-flyout-contents{position:fixed;display:flex;right:0;width:30%;height:100%;flex-direction:column;background-color:#fff;transition:transform .3s ease-in-out;z-index:9999}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header{display:flex;justify-content:space-between;align-items:center;padding:16px 20px 16px 24px;border-bottom:1px solid #ccc}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header button{border:none;background:0 0;font-size:30px;cursor:pointer;color:#94a3b8;padding:0;margin:0;box-shadow:none}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header .whats-new-rss-flyout-inner-header__title-icon-wrapper{display:flex;gap:10px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header .whats-new-rss-flyout-inner-header__title-icon-wrapper h3{margin:0;padding:0;color:#0f172a;font-weight:600;font-size:16px;line-height:24px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav{display:flex;padding:0 30px;border-bottom:1px solid #ccc;gap:2em;overflow:auto;white-space:nowrap}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button{position:relative;background:0 0;color:inherit;padding:15px 0;border-bottom:2px solid transparent}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button:focus,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button:hover{border-color:inherit}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button.selected{border-color:#5d5d5d}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav button .new-notification-count{position:absolute;top:0;right:-10px;width:20px;font-size:10px;line-height:20px;text-align:center;border-radius:10px;color:#fff;background:red}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content{flex:1;overflow-y:auto}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .skeleton-container{margin:30px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item{border-bottom:1px solid #d8dfe9;padding:30px 24px;color:#475569;font-weight:400;font-size:14px;line-height:20px;display:flex;flex-direction:column;gap:13px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>*{margin:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item.skeleton-row{height:25vh;margin:40px 0;background:linear-gradient(90deg,#eee 25%,#ddd 50%,#eee 75%);background-size:200% 100%;animation:shimmer 1.5s infinite}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item.rss-new-post{position:relative}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item.rss-new-post .new-post-badge{background:#ff3d3d;border-radius:5px;position:absolute;right:45px;padding:0 5px;color:#fff}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item .rss-content-header{display:flex;flex-direction:column;gap:15px;padding:0 0 8px 0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item .rss-content-header p{color:#94a3b8;margin:0;padding:0;font-weight:600;font-size:14px;line-height:16px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item .rss-content-header h2{margin:0;color:#0f172a;font-weight:700;line-height:28px;font-size:20px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h2{font-weight:700;font-size:18px;line-height:24px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h3{font-weight:700;font-size:16px;line-height:22px;margin-top:12px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h4{font-weight:700;font-size:15px;line-height:20px;margin-top:12px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h5{font-weight:700;font-size:14px;line-height:18px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h6{font-weight:700;font-size:13px;line-height:16px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item p{padding:0;font-size:14px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item p:last-child{margin-bottom:0;padding-bottom:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item a{color:#1170ff;text-decoration:none}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item figure{margin:10px 0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item figure.wp-block-embed.is-type-video{position:relative;width:100%;height:0;padding-bottom:56.25%}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item figure iframe{position:absolute;top:0;left:0;width:100%;height:100%;border:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item img{box-sizing:border-box;height:auto;max-width:100%;vertical-align:bottom}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item video{vertical-align:middle;width:100%}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item strong{font-weight:600}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ol,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ul{padding-inline-start:20px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ol li,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ul li{margin-bottom:5px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ul{list-style-type:disc}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ol{list-style-type:decimal}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details{line-height:20px;font-size:.9em;margin:10px 0;background:#f9fafb}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details summary{display:flex;justify-content:space-between;cursor:pointer;padding:20px 15px;height:1em;line-height:20px;font-weight:800}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details summary::after{content:"⌃";font-size:20px;transform:rotateX(180deg);font-weight:800}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details summary .text-see-more{display:block}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details summary .text-see-less{display:none}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details[open] summary{border-bottom:1px solid #e2e8f0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details[open] summary::after{transform:rotateX(45deg)}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details[open] summary .text-see-more{display:none}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details[open] summary .text-see-less{display:block}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details .sub-version-item{position:relative;padding:1em;border-bottom:1px solid #e2e8f0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details .sub-version-item .sub-version-header{display:flex;justify-content:space-between}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-sub-version-details .sub-version-item .sub-version-content{margin-top:1em}.whats-new-rss-flyout .whats-new-rss-flyout-overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.5);transition:all .3s ease-in-out}.whats-new-rss-flyout.closed{visibility:hidden}.whats-new-rss-flyout.closed .whats-new-rss-flyout-overlay{opacity:0;visibility:hidden}.whats-new-rss-flyout.closed .whats-new-rss-flyout-contents{transform:translateX(100%)}.whats-new-rss-flyout .whats-new-rss-flyout-inner-header__loading-icon{display:none}@keyframes shimmer{0%{background-position:-200% 0}100%{background-position:200% 0}}@media screen and (max-width:1024px){.whats-new-rss-flyout .whats-new-rss-flyout-contents{width:40%}}@media screen and (max-width:768px){.whats-new-rss-flyout .whats-new-rss-flyout-contents{width:85%}}'}(),document.head.appendChild(t)}}(),r.current||(r.current=(t={selector:e,...a},new QN(t))),()=>{r.current&&"function"==typeof r.current.destroy&&r.current.destroy()}}),[e,...Object.values(a)]),r.current}({uniqueKey:"cartflows",rssFeedURL:1'},flyout:{title:(0,z.__)("What's New?","cartflows"),formatDate:e=>`${e.toLocaleDateString("en-US",{weekday:"long"})} ${e.toLocaleDateString("en-US",{month:"long"})} ${e.getDate()}, ${e.getFullYear()}`}}),(0,e.createElement)("span",{className:"bg-white lg:p-3 sm:p-2 text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-offset-2 cursor-pointer relative"},(0,e.createElement)("div",{id:"wcf-whats-new-content"}))};function BN({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const WN=t.forwardRef(BN),ZN=function(){const a=cartflows_admin?.cf_pro_status,r=(0,z.__)("upgrading to PRO","cartflows"),n=!wcfCartflowsPro()&&"inactive"===a,[i,s]=(0,t.useState)(!1),o=getUpgradeToProUrl(cartflows_admin?.utm_param_pro_plans);let l="";return n?l=(0,z.__)("activating CartFlows Pro","cartflows"):wcfCartflowsPro()||(l=r),(0,e.createElement)("div",{className:"bg-primary-50 p-3"},(0,e.createElement)("p",{className:"wcf-main-upgrade-pro-notice text-sm flex justify-center"},(0,z.__)("You're using","cartflows")," ",(0,e.createElement)("span",{className:"font-semibold"},(0,z.__)("CartFlows Free","cartflows")," "),(0,z.__)("To unlock more features, consider","cartflows")," ",n?(0,e.createElement)("span",{className:"text-primary-600 hover:text-primary-800 font-semibold flex items-center gap-1 cursor-pointer",onClick:()=>{s(!0),Sy({slug:"cartflows-pro",init:"cartflows-pro/cartflows-pro.php",name:"cartflows-pro"}).then((e=>{console.log(e),s(!0)})).catch((e=>{console.log(e),s(!1)}))}},i&&(0,e.createElement)(Sr,{className:`w-4 h-4 stroke-2 ${i?"wcf-processing animate-spin":""} `}),i?(0,z.__)("Activating","cartflows"):l):(0,e.createElement)("a",{href:o,target:"_blank",className:"text-primary-600 hover:text-primary-800 font-semibold flex items-center gap-1",rel:"noreferrer"},l,(0,e.createElement)(WN,{className:"w-4 h-[18px] stroke-2 text-primary-500"}))))},VN=function({finalMenus:t,isEditorApp:a,activePath:r,activePage:n}){return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(vt,{className:"wcf-mobile-menu sm:hidden bg-white absolute top-16 w-full left-0"},(0,e.createElement)("div",{className:"space-y-1 pb-3 pt-2 px-8"},t.map((t=>a?(0,e.createElement)(Dt,{as:"div",href:"#",className:"block py-2 pl-3 pr-4",key:t.name},(0,e.createElement)("a",{href:`admin.php?page=${t.slug}${""!==t.path?"&path="+t.path:""}${t.url}`,className:r===t.path?"border-b-2 border-orange-500 text-gray-900 hover:text-gray-900 inline-flex items-center p-2 text-sm font-medium w-full":"border-b-2 border-white hover:border-b-2 hover:border-orange-500 text-gray-500 hover:text-gray-700 inline-flex items-center p-2 text-sm font-medium w-full",key:t.name,"data-app":a?"edditor":""},t.name)):(0,e.createElement)(Dt,{as:"div",href:"#",className:"block py-2 pl-3 pr-4",key:t.name},(0,e.createElement)(I,{id:t.slug,key:`?page=${t.slug}&path=${t.path}`,to:{pathname:"admin.php",search:`?page=${t.slug}${""!==t.path?"&path="+t.path:""}${t.url}`},className:n===t.slug&&r===t.path?"border-b-2 border-orange-500 text-gray-900 hover:text-gray-900 inline-flex items-center p-2 text-sm font-medium w-full":"border-b-2 border-white hover:border-b-2 hover:border-orange-500 text-gray-500 hover:text-gray-700 inline-flex items-center p-2 text-sm font-medium w-full"},t.name)))))))},GN=[{label:(0,z.__)("Funnels","cartflows"),type:"flows"},{label:(0,z.__)("Conversions","cartflows"),type:"conversion"},{label:(0,z.__)("Opt-in","cartflows"),type:"optin"}],XN=function({menu:t,isEditorApp:a,activePage:r,activePath:n}){const i="h-full "+(r===t.slug&&n===t.path?"border-b-2 border-orange-500 text-gray-900 hover:text-gray-900 inline-flex items-center px-1 pt-1 text-sm font-medium":"border-b border-gray-200 hover:border-b-2 hover:border-orange-500 text-gray-500 hover:text-gray-700 inline-flex items-center px-1 pt-1 text-sm font-medium"),s="block px-4 py-2 text-gray-700 hover:bg-primary-25 hover:text-primary-600 text-sm",o="absolute left-0 z-10 hidden group-hover:block bg-white border border-gray-200 rounded shadow-lg mt-0 min-w-[180px]",l=(0,e.createElement)("svg",{className:"ml-1 w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})),c=(e=null)=>{const a=`admin.php?page=${t.slug}&path=${t.path}`;return e?`${a}&type=${e}`:a},u=(e=null)=>({pathname:"admin.php",search:e?`?page=${t.slug}&path=${t.path}&type=${e}`:`?page=${t.slug}&path=${t.path}`});return a?(0,e.createElement)("div",{className:"relative group !ml-4",key:t.name},(0,e.createElement)("a",{href:c(),className:i},t.name,l),(0,e.createElement)("div",{className:o},GN.map((t=>(0,e.createElement)("a",{key:t.type,href:c(t.type),className:s},t.label))))):(0,e.createElement)("div",{className:"relative group !ml-4",key:t.name},(0,e.createElement)(I,{id:t.slug,to:u(),className:i},t.name,l),(0,e.createElement)("div",{className:o},GN.map((t=>(0,e.createElement)(I,{key:t.type,to:u(t.type),className:s},t.label)))))};function JN({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const qN=t.forwardRef(JN),$N=function(){const[{license_status:a}]=g(),r=cartflows_admin?.current_user_can_manage_cartflows,[n,i]=(0,t.useState)({isProcessing:!1,buttonText:""}),{isProcessing:s,buttonText:o}=n,l=[{name:(0,z.__)("Dashboard","cartflows"),slug:cartflows_admin.home_slug,path:"",url:"",visible:!0},{name:(0,z.__)("Funnels","cartflows"),slug:cartflows_admin.home_slug,path:"flows",url:"",visible:!0},{name:(0,z.__)("Store Checkout","cartflows"),slug:cartflows_admin.home_slug,path:"store-checkout",url:""!==cartflows_admin.global_checkout_id?"&action=wcf-edit-flow&flow_id="+cartflows_admin.global_checkout_id:"",visible:!0},{name:(0,z.__)("Analytics","cartflows"),slug:cartflows_admin.home_slug,path:"analytics",url:"",visible:r},{name:(0,z.__)("Automations","cartflows"),slug:cartflows_admin.home_slug,path:"automations",url:"",visible:r},{name:(0,z.__)("Modern Cart","cartflows"),slug:cartflows_admin.home_slug,path:"modern-cart",url:"",visible:r&&"active"!==cartflows_admin.moderncart_status},{name:(0,z.__)("Add-ons","cartflows"),slug:cartflows_admin.home_slug,path:"addons",url:"",visible:r&&"1"!==cartflows_admin.is_file_mod_disabled},{name:(0,z.__)("Learn","cartflows"),slug:cartflows_admin.home_slug,path:"learn",url:"",visible:!0},{name:(0,z.__)("Free vs Pro","cartflows"),slug:cartflows_admin.home_slug,path:"free-vs-pro",url:"",visible:!wcfCartflowsPro()}].filter((e=>e.visible)),c=new URLSearchParams((0,f.useLocation)()?.search),u=c.get("page")?c.get("page"):cartflows_admin.home_slug,d=c.get("settings"),m=c.get("tab");let p=c.get("path")?c.get("path"):"";"store-checkout-library"===p&&(p="store-checkout");const[h,M]=(0,t.useState)(!!d),[y,N]=(0,t.useState)("license"===m?"license":m),w=["wcf-edit-flow","wcf-edit-step"].includes(c.get("action")),x=function(){M(!h)};let b="",D="",v="",j="",_="";const E=cartflows_admin?.cf_pro_status;return wcfCartflowsPro()||"inactive"!==E?wcfCartflowsPro()?wcfCartflowsPro()&&"Activated"!==a?(b=(0,z.__)("Unlicensed","cartflows"),v="text-red-500 active:text-red-500 hover:text-red-500 focus:text-red-500 cursor-pointer",j=cartflows_admin.cf_pro_type):(b=(0,z.__)("Licensed","cartflows"),v="text-green-500 hover:text-green-600 focus:text-green-600 pointer-events-none disabled",j=cartflows_admin.cf_pro_type):(b=(0,z.__)("Upgrade to Pro","cartflows"),v="text-cartflows hover:text-cartflows focus:text-cartflows",D=getUpgradeToProUrl(cartflows_admin?.utm_param_pro_plans)):(b=(0,z.__)("Activate CartFlows Pro","cartflows"),v="text-cartflows hover:text-cartflows focus:text-cartflows",_="activate"),(0,e.createElement)(e.Fragment,null,!wcfCartflowsPro()&&(0,e.createElement)(ZN,null),(0,e.createElement)("div",{className:"wcf-main--nav-menu sticky top-0 sm:top-8 z-20"},(0,e.createElement)(jt,{as:"nav",className:"wcf-main-menu-wrapper"},(0,e.createElement)("div",{className:"flex gap-3 sm:gap-3 h-full"},(0,e.createElement)("div",{className:"wcf-main--nav-menu-navbar flex"},(0,e.createElement)("div",{className:"wcf-main--nav-menu__logo flex items-center"},(0,e.createElement)("img",{className:"block h-8 w-auto",src:_t,alt:"CartFlows"})),(0,e.createElement)("div",{className:"wcf-main--nav-menu__items desktop-menu hidden sm:-my-px sm:ml-6 sm:flex sm:space-x-8"},l.map((t=>"analytics"===t.path?(0,e.createElement)(XN,{key:t.name,menu:t,isEditorApp:w,activePage:u,activePath:p}):w&&t.visible?(0,e.createElement)("a",{href:`admin.php?page=${t.slug}${""!==t.path?"&path="+t.path:""}${t.url}`,className:p===t.path?"border-b-2 border-primary-500 text-gray-900 hover:text-gray-900 active:text-gray-900 inline-flex items-center px-1 pt-1 text-sm font-medium !ml-4":"border-b border-gray-200 hover:border-b-2 hover:border-primary-500 text-gray-500 hover:text-gray-700 inline-flex items-center px-1 pt-1 text-sm font-medium !ml-4",key:t.name},t.name):t.visible?(0,e.createElement)(I,{id:t.slug,key:`?page=${t.slug}&path=${t.path}`,to:{pathname:"admin.php",search:`?page=${t.slug}${""!==t.path?"&path="+t.path:""}${t.url}`},className:u===t.slug&&p===t.path?"border-b-2 border-orange-500 text-gray-900 hover:text-gray-900 inline-flex items-center px-1 pt-1 text-sm font-medium !ml-4":"border-b border-gray-200 hover:border-b-2 hover:border-orange-500 text-gray-500 hover:text-gray-700 inline-flex items-center px-1 pt-1 text-sm font-medium !ml-4"},t.name):null)))),(0,e.createElement)("div",{className:"wcf-mobile-menu-toggle sm:ml-6 flex items-center sm:hidden"},(0,e.createElement)(Dt,{className:"group relative inline-flex items-center justify-center rounded-md p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-500 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-indigo-500"},(0,e.createElement)("span",{className:"absolute -inset-0.5"}),(0,e.createElement)("span",{className:"sr-only"},"Open main menu"),(0,e.createElement)(qN,{"aria-hidden":"true",className:"block size-6 group-data-[open]:hidden"}),(0,e.createElement)(Cr,{"aria-hidden":"true",className:"hidden size-6 group-data-[open]:block"})))),(0,e.createElement)(VN,{finalMenus:l,isEditorApp:w,activePath:p,activePage:u})),(0,e.createElement)("div",{className:"wcf-main--nav-menu__action-bar md:ml-6 flex flex-wrap items-center justify-center md:justify-start"},b&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("a",{href:D||"#",target:D?"_blank":"#",className:`${v} text-sm cursor-pointer font-normal mr-4 hidden md:block ${s?"md:flex md:items-center md:gap-1":""}`,onClick:D?()=>{}:function(e){if(e.preventDefault(),"activate"===_){const e="cartflows-pro",t="cartflows-pro/cartflows-pro.php",a="cartflows-pro";i({isProcessing:!0,buttonText:(0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */
(0,z.__)("Activating %s","cartflows"),cartflows_admin.cf_pro_type_inactive)}),Sy({slug:e,init:t,name:a}).then((e=>{console.log(e),i({isProcessing:!0,buttonText:(0,z.__)("Successfully Activated","cartflows")}),setTimeout((()=>{i({isProcessing:!1,buttonText:(0,z.__)("Activated","cartflows")})}),3e3)})).catch((e=>{console.log(e),i({isProcessing:!1,buttonText:(0,z.__)("Activation Failed","cartflows")})}))}D||_||(x(),N("license"))},rel:"noreferrer"},s&&(0,e.createElement)(Sr,{className:`w-4 h-4 stroke-2 ${s?"wcf-processing animate-spin":""} `}),s?o:b),(0,e.createElement)("div",{className:"border-r border-gray-200 py-2.5"})),""!==j&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-badge bg-primary-25 border border-primary-300 text-primary-600 rounded text-[11px] leading-4 cursor-default font-normal lg:mx-4 sm:mx-0 uppercase"},j),(0,e.createElement)("div",{className:"border-r border-gray-200 py-2.5"})),function(){if(r)return(0,e.createElement)("a",{className:"bg-white p-4 text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-offset-2 cursor-pointer relative wcf-inline-tooltip",id:"wcf-global-settings-popup",onClick:x,"data-tooltip":(0,z.__)("Open Global Settings","cartflows")},(0,e.createElement)(Bl,{className:"w-6 h-6 stroke-1","aria-hidden":"true"}))}(),(0,e.createElement)(I,{to:"//youtube.com/c/CartFlows/",target:"_blank",className:"bg-white lg:p-4 sm:p-3 text-gray-400 hover:text-gray-500 focus:outline-none focus:ring-offset-2 cursor-pointer relative wcf-inline-tooltip","data-tooltip":(0,z.__)("Tutorial Videos","cartflows")},(0,e.createElement)(AN,{className:"w-6 h-6 stroke-1","aria-hidden":"true"})),(0,e.createElement)(SN,null),(0,e.createElement)("div",{className:"wcf-divider border-r border-gray-200 py-2.5"}),0i(!1),title:(0,z.__)("Close the window","cartflows")},(0,e.createElement)(Cr,{className:"h-18 w-18 stroke-2","aria-hidden":"true"}))),(0,e.createElement)("div",{className:"mt-3 text-center sm:mt-0 sm:text-left"},(0,e.createElement)(gr.Title,{as:"h3",className:"wcf-welcome-box--title text-base font-medium text-gray-800"},(0,z.__)("Getting Started","cartflows"))),(0,e.createElement)("div",{className:"wcf-welcome-box--body mt-5 text-center"},(0,e.createElement)("iframe",{width:"100%",height:"400",src:"https://www.youtube.com/embed/tCm60PWOd0M",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:"",className:"rounded-md !h-[200px] sm:!h-[400px]",title:(0,z.__)("Introduction to CartFlows","cartflows")}),(0,e.createElement)("p",{className:"text-sm font-normal mt-5"},(0,z.__)("Modernizing WordPress eCommerce!","cartflows"))),(0,e.createElement)("div",{className:"wcf-welcome-box--footer mt-5 flex gap-3 sm:mt-6 sm:grid sm:grid-flow-row-dense sm:grid-cols-2 sm:gap-3"},(0,e.createElement)(I,{key:`?page=${cartflows_admin.home_slug}&path=flows`,to:{pathname:"admin.php",search:`?page=${cartflows_admin.home_slug}&path=library`},className:"wcf-button wcf-welcome--button wcf-primary-button !p-4",title:(0,z.__)("Create Your First Flow","cartflows")},(0,e.createElement)("span",{className:""},(0,z.__)("Create Your First Flow","cartflows"))),(0,e.createElement)("a",{className:"wcf-button wcf-welcome--button wcf-secondary-button !p-4",href:cartflows_admin.admin_base_url+"index.php?page=cartflow-setup"},(0,e.createElement)("span",{className:""},(0,z.__)("Go To Setup Wizard","cartflows"))))))))))},ew=(0,Ay.compose)((0,zy.withDispatch)((e=>{const{updateWooCommerceStatus:t}=e("wcf/importer");return{updateWooCommerceStatus(e){t(e)}}})))((({title:a,updateWooCommerceStatus:r})=>{const n=a||(0,z.__)("Activate WooCommerce","cartflows"),[i,s]=(0,t.useState)({isProcessing:!1,buttonText:n}),{isProcessing:o,buttonText:l}=i;return(0,e.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,e.createElement)("div",{className:"wcf-flow-import__button"},(0,e.createElement)("button",{className:"wcf-button wcf-primary-button",onClick:e=>{e.preventDefault(),s({isProcessing:!0,buttonText:(0,z.__)("Activating WooCommerce..","cartflows")}),Sy({slug:"woocommerce",init:"woocommerce/woocommerce.php",name:"WooCommerce"},!1).then((()=>{s({isProcessing:!1,buttonText:(0,z.__)("Successfully Activated!","cartflows")}),setTimeout((()=>{r("active")}),3e3)})).catch((e=>{console.log(e),s({isProcessing:!1,buttonText:(0,z.__)("Failed! Activation!","cartflows")})}))}},o?(0,e.createElement)(ky,null):""," ",l)))})),tw=(0,Ay.compose)((0,zy.withDispatch)((e=>{const{updateWooCommerceStatus:t}=e("wcf/importer");return{updateWooCommerceStatus(e){t(e)}}})))((({updateWooCommerceStatus:a})=>{const r=(0,z.__)("Install WooCommerce","cartflows"),[n,i]=(0,t.useState)({isProcessing:!1,buttonText:r}),{isProcessing:s,buttonText:o}=n;return(0,e.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,e.createElement)("div",{className:"wcf-flow-import__button"},(0,e.createElement)("button",{className:"wcf-button wcf-primary-button",onClick:e=>{var t;e.preventDefault(),i({isProcessing:!0,buttonText:(0,z.__)("Installing WooCommerce..","cartflows")}),(t={slug:"woocommerce",init:"woocommerce/woocommerce.php",name:"woocommerce"},new Promise(((e,a)=>{console.log("plugin.slug",t.slug),wp.updates.queue.push({action:"install-plugin",data:{slug:t.slug,init:t.init,name:t.name,success(a){console.log("Installed Successfully! Activating plugin ",t.slug),e(a,t)},error(e){a(e,t)}}}),wp.updates.queueChecker()}))).then((()=>{i({isProcessing:!1,buttonText:(0,z.__)("Successfully Installed!","cartflows")}),a("inactive")})).catch((e=>{console.log(e),i({isProcessing:!1,buttonText:(0,z.__)("Installation Failed!","cartflows")}),setTimeout((()=>{i({isProcessing:!1,buttonText:r})}),3e3)}))}},s?(0,e.createElement)(ky,null):""," ",o)))})),aw=(0,Ay.compose)((0,zy.withSelect)((e=>{const{getFlowsCount:t,getCFProStatus:a,getWooCommerceStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:a(),woocommerce_status:r()}})))((({preview:a,cf_pro_status:r,woocommerce_status:n,flowName:i,setInputFieldVisibility:s,setErrorDesc:o})=>{const[l,c]=(0,t.useState)({cta:"",error_msg:""}),[{license_status:u}]=g(),{cta:d,error_msg:m}=l,[p,f]=(0,t.useState)({isProcessing:!1,buttonText:(0,z.__)("Import Funnel","cartflows")}),{isProcessing:h,buttonText:M}=p,[y,N]=(0,t.useState)(!1),w=function(){N(!0),document.addEventListener("click",x)},x=function(){N(!1),document.removeEventListener("click",x)};if(d)return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-message wcf-message--error",dangerouslySetInnerHTML:{__html:d}}),y&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("a",{className:"wcf-error-message--toggle",onClick:function(e){e.preventDefault(),y?x():w()}},(0,z.__)("Click for more info","cartflows")),(0,e.createElement)("div",{className:"wcf-error--info",dangerouslySetInnerHTML:{__html:m}})));if("active"!==n)return"inactive"===n?(s("hidden"),o((0,z.__)("You need WooCommerce plugin installed and activated to import this funnel.","cartflows")),(0,e.createElement)(ew,null)):(s("hidden"),o((0,z.__)("You need WooCommerce plugin installed and activated to import this funnel.","cartflows")),(0,e.createElement)(tw,null));if("active"===n&&(s("visible"),o("")),"pro"===a.type){if(!wcfCartflowsTypePro())return"inactive"===r&&"pro"===wcfInactivepluginType()?(s("hidden"),o((0,z.__)("Access all of our pro templates by activating CartFlows Pro.","cartflows")),(0,e.createElement)(Oy,{description:(0,z.__)("Access all of our pro templates by activating CartFlows Pro.","cartflows")})):(s("hidden"),o((0,z.__)("Access all of our pro templates when you upgrade your plan to CartFlows Pro today.","cartflows")),(0,e.createElement)(Cy,{title:(0,z.__)("Get CartFlows Pro","cartflows"),desc:(0,z.__)("Access all of our pro templates when you upgrade your plan to CartFlows Pro today.","cartflows")}));if(wcfCartflowsTypePro()&&"Activated"!==u)return s("hidden"),o((0,z.__)("Access all of our pro templates when you activate CartFlows Pro license.","cartflows")),(0,e.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,e.createElement)("div",{className:"wcf-flow-import__button"},(0,e.createElement)(Yy,null)))}return(0,e.createElement)("div",{className:"wcf-flow-import__button"},(0,e.createElement)("button",{className:"wcf-button "+(h?"wcf-disabled":"wcf-primary-button"),onClick:e=>{e.preventDefault(),jQuery(e.target).closest(".wcf-name-your-flow__inner").find(".input-field").attr("disabled","disabled"),h||(f({isProcessing:!0,buttonText:(0,z.__)("Importing Complete Funnel..","cartflows")}),((e,t,a,r)=>{console.log(e);const n=new window.FormData;n.append("action","cartflows_import_flow"),n.append("flow_name",r),n.append("security",cartflows_admin.import_flow_nonce),n.append("flow",JSON.stringify(e)),n.append("creation_method","ready_made_template"),A()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((e=>{console.log(e),e.success?(t({isProcessing:!1,buttonText:(0,z.__)("Imported! Redirecting…","cartflows")}),setTimeout((()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e.data.new_flow_id}`}),3e3)):"call_to_action"in e.data?a({cta:e.data.call_to_action,error_msg:e.data.message}):t({isProcessing:!1,buttonText:e.data.message})}))})(a,f,c,i))}},h?(0,e.createElement)(ky,null):""," ",M))})),rw=(0,Ay.compose)((0,zy.withSelect)((e=>{const{getFlowsCount:t,getCFProStatus:a,getLicenseStatus:r,getWooCommerceStatus:n}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:a(),license_status:r(),woocommerce_status:n()}})))((({flowName:a,isStoreCheckout:r})=>{const[n,i]=(0,t.useState)((0,z.__)("Design Your Funnel","cartflows")),[s,o]=(0,t.useState)(!1);return(0,e.createElement)("div",{className:"wcf-name-your-flow__actions"},(0,e.createElement)("div",{className:"wcf-flow-import__button"},(0,e.createElement)("button",{className:"wcf-button wcf-primary-button",onClick:e=>{e.preventDefault(),jQuery(e.target).closest(".wcf-name-your-flow__inner").find(".input-field").attr("disabled","disabled"),((e,t,a,r,n)=>{if(a)return;e("Creating Flow.."),r(!0);const i=new window.FormData;i.append("action","cartflows_create_flow"),i.append("security",cartflows_admin.create_flow_nonce),i.append("flow_name",t),i.append("store_checkout",n),i.append("creation_method","scratch"),A()({url:cartflows_admin.ajax_url,method:"POST",body:i}).then((t=>{console.log(t),t.success?(e((0,z.__)("Created! Redirecting…","cartflows")),r(!1),setTimeout((()=>{let e=`admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t.data.flow_id}`;n&&(e="admin.php?page=cartflows&action=wcf-edit-store-checkout"),window.location=`${cartflows_admin.admin_base_url+e}`}),3e3)):e((0,z.__)("Failed to Create Flow!","cartflows"))}))})(i,a,s,o,r)}},n)))})),nw=({preview:a,type:r,flowName:n,setInputFieldVisibility:i,cancelButtonRef:s,setVisibility:o,setErrorDesc:l})=>(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-flow--footer bg-primary-25 p-4 mt-6 flex justify-end sm:px-6 gap-4"},"import"===r&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("button",{type:"button",className:"wcf-button wcf-secondary-button",onClick:()=>o("hide"),ref:s},(0,z.__)("Cancel","cartflows")),(0,e.createElement)(aw,{preview:a,flowName:n,setInputFieldVisibility:i,setErrorDesc:l})),"blank"===r&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("button",{type:"button",className:"wcf-button wcf-secondary-button",onClick:()=>o("hide"),ref:s},(0,z.__)("Cancel","cartflows")),(0,e.createElement)(rw,{flowName:n,setInputFieldVisibility:i,isStoreCheckout:!1})))),iw=a=>{const{cf_pro_status:r,setVisibility:n,preview:i,type:s,flowName:o,setFlowName:l,cancelButtonRef:c}=a,[u,d]=(0,t.useState)(""),[m,p]=(0,t.useState)(""),[{flows_limit_over:f}]=g(),[h,M]=(0,t.useState)(0);return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-flow--body fixed inset-0 z-30 overflow-y-auto"},(0,e.createElement)("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:items-center sm:p-0"},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},(0,e.createElement)(gr.Panel,{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg"},(0,e.createElement)("div",{className:"wcf-name-your-flow--content bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4"},(0,e.createElement)("div",{className:"wcf-name-your-flow--header absolute right-0 top-0 hidden pr-4 pt-4 sm:block"},(0,e.createElement)("button",{type:"button",className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none ",onClick:()=>{n("hide")},title:(0,z.__)("Close the window","cartflows")},(0,e.createElement)(Cr,{className:"h-18 w-18 stroke-2","aria-hidden":"true"}))),(0,e.createElement)("div",{className:"mt-3 text-center sm:mt-0 sm:text-left"},(0,e.createElement)(gr.Title,{as:"h3",className:"wcf-name-your-flow--title text-base font-medium text-gray-800"},f?(0,z.__)("Upgrade To CartFlows Pro","cartflows"):(0,z.__)("Name Your Funnel","cartflows")),(0,e.createElement)("div",{className:`mt-5 ${u}`},(0,e.createElement)("div",{className:"flex justify-between py-2"},(0,e.createElement)("div",{className:"wcf-name-your-flow--field-title"},(0,e.createElement)("label",{className:"flex gap-1 text-base font-normal text-gray-800"},(0,z.__)("Funnel Name","cartflows"))),(0,e.createElement)("div",{className:"wcf-name-your-flow--word-count"},(0,e.createElement)("span",{className:"text-xs font-normal "+(40===h?"text-primary-500":"text-gray-400")},h,"/40"))),(0,e.createElement)("input",{type:"text",className:"input-field w-full !px-4 !py-2 text-sm font-normal !rounded-md text-gray-400 !border-gray-200 focus:ring focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none",value:o,onChange:e=>{const{value:t}=e.target;t.length<=40&&(M(t.length),l(t))},placeholder:(0,z.__)("Enter Funnel Name","cartflows")})),""!==m&&(0,e.createElement)("div",{className:"mt-5"},(0,e.createElement)("p",{className:"text-sm font-regular text-gray-600"},m)))),(0,e.createElement)(nw,{cf_pro_status:r,setVisibility:n,preview:i,type:s,flowName:o,setFlowName:l,setInputFieldVisibility:d,cancelButtonRef:c,setErrorDesc:p}))))))},sw=(0,Ay.compose)((0,zy.withSelect)((e=>{const{getFlowsCount:t,getCFProStatus:a,getLicenseStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:a(),license_status:r()}})))((({visibility:a,setVisibility:r,preview:n,type:i,flowName:s,setFlowName:o,cf_pro_status:l})=>{const c=(0,t.useRef)(null);return(0,e.createElement)(Pt.Root,{show:"show"===a,as:t.Fragment},(0,e.createElement)(gr,{as:"div",className:"relative z-20",initialFocus:"",onClose:r},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},(0,e.createElement)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:()=>{r("hide")}})),(0,e.createElement)("div",{className:"wcf-name-your-flow__inner"},(0,e.createElement)(iw,{cf_pro_status:l,setVisibility:r,preview:n,type:i,flowName:s,setFlowName:o,cancelButtonRef:c}))))})),ow=function(){return(0,e.createElement)("div",{role:"status",className:"wcf-onboarding-stats-loader space-y-4 animate-pulse"},(0,e.createElement)("div",{className:"flex items-center justify-between"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"w-32 h-2.5 bg-gray-300 rounded-full mb-2.5"}),(0,e.createElement)("div",{className:"w-44 h-2 bg-gray-200 rounded-full"})),(0,e.createElement)("div",{className:"h-2.5 w-24 bg-gray-300 rounded-full"})),Array(3).fill().map(((t,a)=>(0,e.createElement)("div",{key:a,className:"flex items-center justify-between pt-4"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"}),(0,e.createElement)("div",{className:"w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"})),(0,e.createElement)("div",{className:"h-2.5 w-24 bg-gray-300 rounded-full dark:bg-gray-700"})))))};function lw({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const cw=t.forwardRef(lw);function uw(e){const t="undefined"!=typeof cartflows_admin&&"active"===cartflows_admin.woocommerce_status,a=cartflows_admin?.global_checkout_id,r="undefined"!=typeof cartflows_admin&&!!cartflows_admin.is_pro,n=e?.flow_exists,i=e?.flow_have_order_bump,s=e?.flow_have_upsell;return[{woocommerce_setup:{completed:t}},{global_checkout_added:{completed:null!=a&&""!==a}},{funnel_created:{completed:n>0}},{order_bump_created:{completed:i&&r}},{upsell_created:{completed:s&&r}}]}const dw=function({page_builder:a}){const[{setup_checklist_data:r},n]=l(),[i,s]=(0,t.useState)(!1),o=!!cartflows_admin?.is_pro,c=r?.flow_exists,u=r?.checkout_flow_id,d=r?.checkout_step_id,m=[{id:"woocommerce_setup",label:(0,z.__)("Finish Setup","cartflows"),actionLabel:(0,z.__)("Setup CartFlows","cartflows"),url:"admin.php?page=cartflows&path=learn",pro:!1},{id:"global_checkout_added",label:(0,z.__)("Setup Store Checkout","cartflows"),actionLabel:(0,z.__)("Create","cartflows"),url:"index.php?page=cartflows&path=store-checkout",pro:!1},{id:"funnel_created",label:(0,z.__)("Build Your Funnel","cartflows"),actionLabel:"bricks-builder"===a||"other"===a?(0,z.__)("Start From Scratch","cartflows"):(0,z.__)("Go To Library","cartflows"),url:"index.php?page=cartflows&path=library",pro:!1},{id:"order_bump_created",label:(0,z.__)("Offer add-ons with Order Bump.","cartflows"),actionLabel:(0,z.__)("Create","cartflows"),url:c&&u&&d?`admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${u}&step_id=${d}&tab=order_bumps`:"index.php?page=cartflows&path=library",pro:!0},{id:"upsell_created",label:(0,z.__)("Increase Revenue with Upsells.","cartflows"),actionLabel:(0,z.__)("Create","cartflows"),url:c&&u?`admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${u}`:"index.php?page=cartflows&path=library",pro:!0}],g=uw(r);let p=0;return g.forEach((e=>{Object.values(e).forEach((e=>{e.completed&&p++}))})),(0,t.useEffect)((()=>{let e=!0;if(null===r){const t=new window.FormData;(async()=>{s(!0),A()({path:"/cartflows/v1/admin/setup-checklist/",method:"POST",body:t}).then((t=>{e&&(n({type:"SET_SETUP_CHECKLIST_DATA",setup_checklist:t}),s(!1))}))})()}return()=>{e=!1}}),[]),(0,e.createElement)("div",{className:"wcf-onboarding-stats-box p-[24px] border bg-primary-25 border-orange-500 rounded-lg col-span-2"},!r&&i&&(0,e.createElement)(ow,null),r&&!i&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"flex justify-between items-center"},(0,e.createElement)("h4",{className:"text-lg font-semibold text-gray-800"},(0,z.__)("Almost There! Let's Go Live.","cartflows")),(0,e.createElement)("span",{className:"text-sm text-gray-500 text-right"},(0,z.sprintf)(/* translators: %d is the number of completed steps. */ /* translators: %d is the number of completed steps. */
(0,z.__)("%d out of 5 completed","cartflows"),p))),(0,e.createElement)("div",{className:"wcf-col--row flex flex-col w-full mt-3 space-y-3"},(0,e.createElement)("ul",{className:"wcf-steps-checklist list-none p-0 m-0 space-y-2"},m.map((({id:t,label:a,actionLabel:r,url:n,pro:i})=>{const s=(e=>{const t=g.find((t=>t[e]));return!!t&&t[e]?.completed})(t),l=i&&!o,c=`${cartflows_admin?.admin_base_url}${n}`,u="text-primary-500 text-sm font-medium hover:underline hover:text-primary-600 text-right";return(0,e.createElement)("li",{key:t,className:"wcf-checklist-item flex justify-between items-center py-[3px]"},(0,e.createElement)("div",{className:"flex items-center gap-2 cursor-default"},s?(0,e.createElement)(cw,{className:"h-5 w-5 text-primary-500"}):(0,e.createElement)("span",{className:"wcf-setup-step--not-complete border border-gray-300 rounded-full w-[17px] h-[17px] ml-0.5"}),(0,e.createElement)("span",{className:"inline-block text-sm align-middle"},a),i&&!o&&(0,e.createElement)("span",{className:"bg-primary-25 text-[10px] uppercase cursor-default flex items-center rounded-[17px] border border-primary-300 px-[6px] text-primary-500 shadow-[0px_6px_16px_-2px_#F0643466]"},(0,z.__)("PRO","cartflows"))),l&&(0,e.createElement)("a",{href:"https://cartflows.com/pricing?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=pricing",className:u},(0,z.__)("Upgrade to PRO","cartflows")),!l&&!s&&(0,e.createElement)("a",{href:c,className:u},r),!l&&s&&(0,e.createElement)("span",{className:"text-green-600 text-sm cursor-default pointer-events-none text-right"},(0,z.__)("Completed","cartflows")))}))))))},mw=function(){const[{page_builder:a}]=g(),[r,n]=(0,t.useState)(!1),[i,s]=(0,t.useState)("hide"),[o,l]=(0,t.useState)(""),c=e=>{e.preventDefault(),n(!r)};return(0,e.createElement)("div",{className:"wcf-metabox wcf-user-info -mt-8 -mx-8 p-8 bg-white"},(0,e.createElement)("div",{className:"wcf-metabox__header mb-8"},(0,e.createElement)("div",{className:"wcf-metabox__title"},(0,e.createElement)("h1",{className:"text-2xl font-semibold text-gray-800"},(0,z.__)("Welcome to CartFlows ","cartflows"))),(0,e.createElement)("p",{className:"mt-1 text-sm font-regular text-gray-600"},(0,z.__)("Sales funnel builder turns your WordPress website into an optimized selling machine.","cartflows"))),(0,e.createElement)("div",{className:"wcf-metabox__body flex flex-col sm:grid sm:grid-flow-row sm:auto-rows-min gap-6 sm:grid-cols-5 lg:grid-cols-5 pt-6"},(0,e.createElement)("div",{className:"wcf-intro-box flex flex-col-reverse sm:flex-row gap-6 items-center justify-between bg-gray-50 border border-gray-300 rounded-lg p-7 col-span-1 sm:col-span-3 lg:col-span-3"},(0,e.createElement)("div",{className:"wcf-intro-content flex flex-col justify-center"},(0,e.createElement)("h3",{className:"text-xl font-semibold text-gray-800"},(0,z.__)("Create Your First Funnel","cartflows")),(0,e.createElement)("div",{className:"mt-2 lg:mt-5 sm:max-w-sm lg:max-w-[564px]"},(0,e.createElement)("p",{className:"font-regular lg:text-sm xl:text-base text-gray-600"},(0,z.__)("A sales funnel is the sequence of steps a buyer takes to make a purchase. CartFlows helps optimize funnels to turn visitors into customers.","cartflows"))),(0,e.createElement)("div",{className:"mt-5 lg:mt-6"},(0,e.createElement)(I,{key:`?page=${cartflows_admin.home_slug}&path=settings`,to:{pathname:"admin.php",search:"?page=cartflows&path=library"},className:"wcf-button wcf-primary-button",onClick:e=>{"bricks-builder"===a&&(e.preventDefault(),s("show"))}},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:2.5,stroke:"currentColor",className:"w-5 h-5 text-white"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})),(0,z.__)("Create New Funnel","cartflows")))),(0,e.createElement)("div",{className:"wcf-intro-video flex justify-center items-center bg-cover bg-center rounded-md shadow-custom cursor-pointer w-full h-48 sm:w-72 lg:w-72 sm:h-full lg:h-full",style:{backgroundImage:"url(https://img.youtube.com/vi/SlE0moPKjMY/maxresdefault.jpg)"},onClick:c},(0,e.createElement)("div",{className:"flex justify-center items-center w-10 h-7 border-0 rounded-md bg-red-600 cursor-pointer",onClick:c},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-8 h-6 fill-white stroke-0 p-1"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z"})))),r&&(0,e.createElement)(KN,{showModel:r,setOpenVideoModel:n})),(0,e.createElement)(dw,{page_builder:a}),(0,e.createElement)(sw,{visibility:i,setVisibility:s,type:"blank",flowName:o,setFlowName:l})))};var gw=n(7242);const pw=({title:t="",containerClass:a="",innerContainerClass:r=""})=>(0,e.createElement)("div",{className:`wcf-upgrade-to-pro-notice-container ${a}`},(0,e.createElement)("div",{className:`wcf-upgrade-to-pro-notice-inner-container ${r} `},(0,e.createElement)("span",{className:"wcf-pro-badge px-2 py-0.5 text-xs text-primary-600 rounded-[14px] shadow-[0px_6px_16px_-2px_rgba(240,100,52,0.4)] mb-5 ml-auto mr-auto block w-max"},(0,z.__)("PRO","cartflows")),(0,e.createElement)("p",{className:"text-base font-medium text-gray-800 mb-1"},t),(0,e.createElement)("p",{className:"mb-5 text-sm font-normal text-gray-600"},(0,z.__)("Upgrade your plan anytime and get more detailed analytics data.","cartflows")),(0,e.createElement)("a",{href:getUpgradeToProUrl(cartflows_admin?.utm_param_pro_plans),className:"border border-primary-300 bg-primary-25 px-3 py-2 rounded-lg text-sm font-medium !text-primary-600 block w-max m-auto ",target:"_blank",rel:"noreferrer"},(0,z.__)("Upgrade to PRO","cartflows")))),fw=function(t){const[{analyticsData:a}]=l(),r=a&&a.flow_stats.visits_by_date?a.flow_stats.visits_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t?.total_visits:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},xaxis:{categories:i},stroke:{curve:"smooth"},tooltip:{x:{format:"dd MMM"}},colors:["#F06434"]},o=[{name:"Total Visits",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Total Page Views","cartflows"))),(0,e.createElement)("div",{className:"mt-4 relative"},!wcfCartflowsTypePro()&&(0,e.createElement)(pw,{title:(0,z.__)("Total Page Views is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305}))))},hw=function(t){const[{analyticsData:a}]=l(),r=a&&a.flow_stats.revenue_by_date?a.flow_stats.revenue_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.Revenue:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",toolbar:{show:!1}},dataLabels:{enabled:!0,formatter:e=>cartflows_admin.woo_currency+e.toLocaleString()},xaxis:{categories:i},yaxis:{labels:{formatter:e=>cartflows_admin.woo_currency+e.toLocaleString()}},stroke:{curve:"smooth"},tooltip:{x:{format:"dd MMM"}},colors:["#F06434"]},o=[{name:"Total Revenue",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Total Revenue","cartflows"))),(0,e.createElement)("div",{className:"mt-4"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305})))},Mw=function(t){const[{analyticsData:a}]=l(),r=a&&a.flow_stats.orders_by_date?a.flow_stats.orders_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.OrderCount:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},xaxis:{categories:i},stroke:{curve:"smooth"},tooltip:{x:{format:"dd MMM"}},colors:["#F06434"]},o=[{name:"Total Orders",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Total Orders","cartflows"))),(0,e.createElement)("div",{className:"mt-4"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305})))},yw=function(t){const[{analyticsData:a}]=l(),r=a&&a.flow_stats.offer_revenue_by_date?a.flow_stats.offer_revenue_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.offer_revenue:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},dataLabels:{enabled:!0,formatter:e=>cartflows_admin.woo_currency+e.toLocaleString()},xaxis:{categories:i},yaxis:{labels:{formatter:e=>cartflows_admin.woo_currency+e.toLocaleString()}},stroke:{curve:"smooth"},tooltip:{x:{format:"dd/MM/yy HH:mm"}},colors:["#F06434"]},o=[{name:"Total Offer Revenue",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Offer Revenue","cartflows"))),(0,e.createElement)("div",{className:"mt-4 relative"},!wcfCartflowsTypePro()&&(0,e.createElement)(pw,{title:(0,z.__)("Offer Revenue is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305}))))},Nw=function(){return(0,e.createElement)("div",{className:"wcf-analytics--tabs-wrapper border border-gray-200 rounded-lg min-h-fit h-full"},(0,e.createElement)("div",{className:"animate-pulse"},(0,e.createElement)("div",{className:"flex justify-center items-baseline p-6 gap-5"},(0,e.createElement)("div",{className:"p-5 h-24 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"p-5 h-36 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"p-5 h-48 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"p-5 h-64 bg-gray-300 rounded"}),(0,e.createElement)("div",{className:"p-5 h-72 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"p-5 h-64 bg-gray-300 rounded"}),(0,e.createElement)("div",{className:"p-5 h-48 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"p-5 h-36 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"p-5 h-72 bg-gray-300 rounded"}),(0,e.createElement)("div",{className:"p-5 h-36 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"p-5 h-48 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"p-5 h-64 bg-gray-300 rounded"}),(0,e.createElement)("div",{className:"p-5 h-72 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"p-5 h-64 bg-gray-300 rounded"}),(0,e.createElement)("div",{className:"p-5 h-48 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"p-5 h-36 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"p-5 h-24 bg-gray-200 rounded"}))))},ww=function(){const[{analyticsData:a},r]=l(),[n,i]=(0,t.useState)("total_revenue"),[s,o]=(0,t.useState)("hide"),[c,u]=(0,t.useState)(""),[{page_builder:d}]=g(),[m,p]=(0,t.useState)(),[f,h]=(0,t.useState)(),[M,y]=(0,t.useState)(),[N,w]=(0,t.useState)(),[x,b]=(0,t.useState)(),[D,v]=(0,t.useState)(!0),j=new Date,_=j.toISOString().slice(0,10);j.setDate(j.getDate()-7);const E=j.toISOString().slice(0,10),L="active"===cartflows_admin.woocommerce_status,T=function(e){p(void 0!==e?.total_revenue?e?.total_revenue:0),h(void 0!==e?.total_offers_revenue?e?.total_offers_revenue:0),y(void 0!==e?.total_orders?e?.total_orders:0),w(void 0!==e?.total_visits?e?.total_visits:0),v(!1)};function k(e,t){const a=new Date(e.getTime()),r=[];for(;a<=t;)r.push(new Date(a).toISOString().slice(0,10)),a.setDate(a.getDate()+1);return r}(0,t.useEffect)((()=>{let e=!0;return a?T(a?.flow_stats):(async()=>{const t=new window.FormData;let a=new Date,n=new Date;n.setDate(n.getDate()-7),b(k(n,a)),n=yr(n),a=yr(a),t.append("date_to",a),t.append("date_from",n),t.append("action","cartflows_get_all_flows_stats"),t.append("security",cartflows_admin.get_all_flows_stats_nonce),A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((t=>{e&&(r({type:"SET_ANALYTICS_DATA",analyticsData:t.data}),T(t?.data?.flow_stats))}))})(),()=>{e=!1}}),[]);const S=[{name:(0,z.__)("Total Revenue","cartflows"),tooltip:(0,z.__)("This shows the total amount of money earned from all your funnels combined.","cartflows"),slug:"total_revenue",value:m},{name:(0,z.__)("Total Orders","cartflows"),tooltip:(0,z.__)("This shows the total number of orders placed through your CartFlows checkout pages.","cartflows"),slug:"total_orders",value:M},{name:(0,z.__)("Total Views","cartflows"),tooltip:(0,z.__)("This shows the total number of times people visited any step in your funnel.","cartflows"),slug:"total_views",value:N},{name:(0,z.__)("Offer Revenue","cartflows"),tooltip:(0,z.__)("This shows the total amount of money earned from your Upsell and Downsell offers.","cartflows"),slug:"offer_revenue",value:f}],O=function(e){let t="";return"total_revenue"===e&&(t="rounded-tl-lg "),"total_views"===e&&(t="rounded-bl-lg "),t+function(...e){return e.filter(Boolean).join(" ")}(e===n?"bg-primary-25 border-orange-500 border-r":"bg-white border-r border-white hover:bg-primary-25 hover:border-primary-500 focus:border-primary-500","focus:text-slate-900 hover:text-slate-900 group cursor-pointer p-5 block items-center text-base font-medium")};return(0,e.createElement)("div",{className:"bg-white px-6 py-7 border border-solid border-gray-200 md:rounded-lg mb-5 wcf-analytics"},(0,e.createElement)("div",{className:"wcf-metabox--heading sm:flex sm:items-center mb-7 gap-6"},(0,e.createElement)("div",{className:"wcf-metabox--heading-wrapper sm:flex-auto flex items-center justify-between"},(0,e.createElement)("h1",{className:"wcf-metabox--heading-text text-xl font-semibold text-gray-900"},(0,z.__)("Overview","cartflows")),(0,e.createElement)(I,{key:"importer",to:{pathname:"admin.php",search:"?page=cartflows&path=library"},onClick:e=>{"bricks-builder"===d&&(e.preventDefault(),o("show"))},className:"wcf-button wcf-primary-button sm:hidden visible"},(0,e.createElement)(zr,{className:"w-5 h-5 text-white stroke-2","aria-hidden":"true"}),(0,z.__)("Create New Funnel","cartflows"))),(0,e.createElement)("div",{className:"wcf-metabox--filters-wrapper flex gap-3 flex-col md:flex-row mt-3"},(0,e.createElement)("div",{className:"flex flex-col sm:flex-row items-start gap-2"},(0,e.createElement)("label",{className:"sm:hidden visible font-medium"},(0,z.__)("Custom Filter:","cartflows")),(0,e.createElement)(cM,{classNames:"wcf-custom-filter-input !w-72 !h-full date-picker-field !pl-4 !px-4 !py-3 !pr-7 text-sm font-normal text-gray-400 !rounded-md !border-gray-200 focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none",value:{endDate:_,startDate:E},onChangeCB:function(e){let t=new Date(e.startDate),a=new Date(e.endDate);p(),h(),y(),w(),v(!0),b(k(t,a)),t=yr(t),a=yr(a);const n=new window.FormData;n.append("date_to",a),n.append("date_from",t),n.append("action","cartflows_get_all_flows_stats"),n.append("security",cartflows_admin.get_all_flows_stats_nonce),(async()=>{A()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((e=>{r({type:"SET_ANALYTICS_DATA",analyticsData:e.data}),T(e?.data?.flow_stats)}))})()}})),(0,e.createElement)("div",{className:"hidden lg:flex sm:mt-0 lg:mt-0 mt-0 ml-0"},(0,e.createElement)(I,{key:"importer",to:{pathname:"admin.php",search:"?page=cartflows&path=library"},onClick:e=>{"bricks-builder"===d&&(e.preventDefault(),o("show"))},className:"wcf-button wcf-primary-button"},(0,e.createElement)(zr,{className:"w-5 h-5 text-white stroke-2","aria-hidden":"true"}),(0,z.__)("Create New Funnel","cartflows"))))),(!a||D)&&(0,e.createElement)(Nw,null),a&&!D&&(0,e.createElement)("div",{className:`wcf-analytics--tabs-wrapper border border-gray-200 rounded-lg ${L?"lg:grid lg:grid-cols-12":""} min-h-fit h-full`},L?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("aside",{className:"wcf-analytics--tabs col-span-3"},(0,e.createElement)("nav",{className:""},S.map((t=>(0,e.createElement)("a",{id:t.slug,key:t.slug,className:O(t.slug),onClick:()=>i(t.slug)},(0,e.createElement)("div",{className:"text-sm font-medium text-gray-600 flex items-center gap-1 mb-2"},(0,e.createElement)("span",{className:"wcf-nav-title"},t.name),t.tooltip&&(0,e.createElement)(MM,{text:t.tooltip}),["total_views","offer_revenue"].includes(t.slug)&&!wcfCartflowsTypePro()&&(0,e.createElement)("span",{className:"wcf-pro-badge px-2 py-0.5 text-xs text-primary-600 ml-auto rounded-[14px] shadow-[0px_6px_16px_-2px_rgba(240,100,52,0.4)]"},(0,z.__)("PRO","cartflows"))),(0,e.createElement)("div",{className:"wcf-analytics-page-view-count-wrapper flex justify-between items-baseline"},(0,e.createElement)("div",{className:"wcf-analytics-page-view-count"},(0,e.createElement)("span",{className:(0!==parseInt(t.value)?"text-3xl":"")+" font-semibold text-gray-800"},0!==parseInt(t.value)?wr(t.value.toString()):"-")))))))),(0,e.createElement)("div",{className:"wcf-analytics--tab-content lg:col-span-9 border-l"},function(){let t="";switch(x||function(){const e=new Date,t=new Date;t.setDate(t.getDate()-7),b(k(t,e))}(),n){case"total_views":default:t=(0,e.createElement)(fw,{dateRange:x});break;case"total_revenue":t=(0,e.createElement)(hw,{dateRange:x});break;case"total_orders":t=(0,e.createElement)(Mw,{dateRange:x});break;case"offer_revenue":t=(0,e.createElement)(yw,{dateRange:x})}return t}())):(0,e.createElement)("div",{className:"text-center px-8 py-12"},(0,e.createElement)("div",{className:"flex justify-center mb-3"},(0,e.createElement)(vy,{className:"h-10 w-10 text-primary-500"})),(0,e.createElement)("h3",{className:"mt-2 text-base font-medium text-gray-900"},(0,z.__)("WooCommerce plugin is required.","cartflows")),(0,e.createElement)("p",{className:"mt-1 text-sm text-gray-500"},(0,z.__)("You need WooCommerce plugin installed and activated to view the overview","cartflows")))),(0,e.createElement)(sw,{visibility:s,setVisibility:o,type:"blank",flowName:c,setFlowName:u}))};function xw({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const bw=t.forwardRef(xw);function Dw({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const vw=t.forwardRef(Dw),jw=function(){const[{analyticsData:t}]=l(),a=t&&t.recent_orders?t.recent_orders:[],r="active"===cartflows_admin.woocommerce_status;return(0,e.createElement)("div",{className:"wcf-recent-orders h-full bg-white overflow-hidden border border-solid border-gray-200 md:rounded-lg wcf-metabox"},(0,e.createElement)("div",{className:"wcf-metabox--heading"},(0,e.createElement)("div",{className:"wcf-metabox--heading-wrapper p-6 sm:flex-auto border-b border-solid border-gray-200 flex justify-between items-center"},(0,e.createElement)("h1",{className:"wcf-metabox--heading-text text-xl font-semibold text-gray-900"},(0,z.__)("Recent Orders","cartflows")),a.length>0&&(0,e.createElement)("a",{className:"wcf-button wcf-secondary-button hover:text-primary-500 focus:text-primary-500",href:cartflows_admin.woo_order_url,target:"_blank",rel:"noreferrer"},(0,e.createElement)(bw,{className:"h-18 w-18 text-primary-500"}),(0,z.__)("View All","cartflows")))),r?(0,e.createElement)(e.Fragment,null,a.length>0&&(0,e.createElement)("div",{className:"flex flex-col"},(0,e.createElement)("div",{className:"overflow-x-auto"},(0,e.createElement)("div",{className:"inline-block min-w-full align-middle"},(0,e.createElement)("div",{className:"overflow-hidden"},(0,e.createElement)("table",{className:"min-w-full divide-y divide-gray-300"},(0,e.createElement)("thead",{className:"bg-gray-50"},(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6"},(0,z.__)("Customer","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},(0,z.__)("Date","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},(0,z.__)("Status","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},(0,z.__)("Payment Method","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900"},(0,z.__)("Value","cartflows")))),(0,e.createElement)("tbody",{className:"divide-y divide-gray-200 bg-white"},a.map((t=>{const a=t.order_id;let r="text-yellow-800",n="bg-yellow-100";switch(t.order_status){case"Processing":case"Completed":r="text-green-800",n="bg-green-100";break;case"Failed":r="text-red-800",n="bg-red-100";break;case"Refunded":r="text-gray-800",n="bg-gray-100"}return(0,e.createElement)("tr",{key:a,"data-order_id":"wcf_order_"+a,className:"group"},(0,e.createElement)("td",{className:"whitespace-nowrap py-4 pl-4 pr-3 text-sm sm:pl-6"},(0,e.createElement)("div",{className:""},(0,e.createElement)("div",{className:"font-medium text-gray-900 flex"},t.customer_name,(0,e.createElement)(I,{key:"wcf-quick-action-create-funnel",to:{pathname:"post.php",search:`?post=${a}&action=edit`},target:"_blank",className:"recent_order_view_link ml-3"},(0,e.createElement)(NN,{className:"invisible group-hover:visible h-18 w-18 text-primary-500"}))),(0,e.createElement)("div",{className:"text-gray-500"},t.customer_email))),(0,e.createElement)("td",{className:"whitespace-nowrap px-3 py-4 text-sm text-gray-500"},(0,e.createElement)("div",{className:"text-gray-500"},(0,e.createElement)("div",{className:"wcf-recent-orders--order-date"},t.order_date),(0,e.createElement)("div",{className:"wcf-recent-orders--order-time"},(0,z.__)("at","cartflows")," ",t.order_time))),(0,e.createElement)("td",{className:"whitespace-nowrap px-3 py-4 text-sm text-gray-500"},(0,e.createElement)("span",{className:`inline-flex rounded-full ${n} px-2 text-xs font-semibold leading-5 ${r}`},t.order_status)),(0,e.createElement)("td",{className:"whitespace-nowrap px-3 py-4 text-sm text-gray-500"},t.payment_method),(0,e.createElement)("td",{className:"relative whitespace-nowrap py-4 pl-3 pr-4 text-left text-sm font-medium sm:pr-6"},wr(t.order_total)))})))))))),0===a.length&&(0,e.createElement)("div",{className:"text-center px-8 py-12"},(0,e.createElement)("div",{className:"flex justify-center mb-3"},(0,e.createElement)(vw,{className:"h-6 w-6 text-primary-500"})),(0,e.createElement)("h3",{className:"mt-2 text-base font-medium text-gray-900"},(0,z.__)("Find recent order here","cartflows")),(0,e.createElement)("p",{className:"mt-1 text-sm text-gray-500"},(0,z.__)("Once you have received orders, come back here to find it again easily","cartflows")))):(0,e.createElement)("div",{className:"text-center px-8 py-12"},(0,e.createElement)("div",{className:"flex justify-center mb-3"},(0,e.createElement)(vy,{className:"h-10 w-10 text-primary-500"})),(0,e.createElement)("h3",{className:"mt-2 text-base font-medium text-gray-900"},(0,z.__)("WooCommerce plugin is required.","cartflows")),(0,e.createElement)("p",{className:"mt-1 text-sm text-gray-500"},(0,z.__)("You need WooCommerce plugin installed and activated to view the recent orders","cartflows"))))},_w=({dummy_data_type:t="funnel"})=>(0,e.createElement)("div",{className:"flex flex-col"},(0,e.createElement)("div",{className:"overflow-x-auto"},(0,e.createElement)("div",{className:"inline-block min-w-full align-middle"},(0,e.createElement)("div",{className:"overflow-auto"},(0,e.createElement)("table",{className:"min-w-full divide-y divide-gray-300"},(0,e.createElement)("thead",{className:"bg-gray-50"},(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6"},"step"===t?(0,z.__)("Step Name","cartflows"):(0,z.__)("Funnel Name","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-sm font-semibold text-gray-900"},(0,z.__)("Total Visits","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-sm font-semibold text-gray-900"},(0,z.__)("Unique Visits","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-sm font-semibold text-gray-900"},(0,z.__)("Conversions","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-sm font-semibold text-gray-900"},(0,z.__)("Conversion Rate","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-sm font-semibold text-gray-900"},(0,z.__)("Revenue","cartflows")))),(0,e.createElement)("tbody",{className:"divide-y divide-gray-200 bg-white"},[{id:1,flow_title:"Summer Sale Funnel",step_title:"Summer Sale Landing",total_visits:1245,unique_visits:892,conversions:156,conversion_rate:"17.5",revenue:"$15,600.00"},{id:2,flow_title:"Black Friday Special",step_title:"Summer Sale Checkout",total_visits:2150,unique_visits:1678,conversions:284,conversion_rate:"16.9",revenue:"$28,400.00"},{id:3,flow_title:"Product Launch Campaign",step_title:"Summer Sale One-click Upsell",total_visits:987,unique_visits:745,conversions:142,conversion_rate:"19.1",revenue:"$21,300.00"},{id:4,flow_title:"New Customer Welcome",step_title:"Summer Sale Optin",total_visits:1567,unique_visits:1234,conversions:198,conversion_rate:"16.0",revenue:"$9,900.00"},{id:5,flow_title:"Spring Collection",step_title:"Summer Sale Thank You",total_visits:845,unique_visits:623,conversions:87,conversion_rate:"14.0",revenue:"$8,700.00"}].map((a=>(0,e.createElement)("tr",{key:a.id},(0,e.createElement)("td",{className:"px-6 py-4 whitespace-wrap text-sm font-medium text-gray-900"},"step"===t?a.step_title:a.flow_title),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},a.total_visits),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},a.unique_visits),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},a.conversions),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},a.conversion_rate+"%"),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},wr(a.revenue))))))))))),Iw=()=>(0,e.createElement)("table",{className:"min-w-full divide-y divide-gray-200 border border-gray-200 rounded-md"},(0,e.createElement)("thead",{className:"bg-gray-50"},(0,e.createElement)("tr",null,(0,e.createElement)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Product Name","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("No. of Orders","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Conversions","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Conversion Rate","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Revenue","cartflows")))),(0,e.createElement)("tbody",{className:"bg-white divide-y divide-gray-200"},[{id:1,product_title:"Premium Membership",product_type:"checkout",total_orders:245,conversions:198,conversion_rate:"80.8",revenue:"$24,500.00"},{id:2,product_title:"Business Course Bundle",product_type:"bump",total_orders:156,conversions:134,conversion_rate:"85.9",revenue:"$31,200.00"},{id:3,product_title:"eBook Collection",product_type:"upsell",total_orders:389,conversions:312,conversion_rate:"80.2",revenue:"$7,800.00"},{id:4,product_title:"Advanced Training Package",product_type:"downsell",total_orders:178,conversions:145,conversion_rate:"81.5",revenue:"$21,750.00"},{id:5,product_title:"Starter Kit",product_type:"optin",total_orders:423,conversions:367,conversion_rate:"86.8",revenue:"$18,350.00"}].map((t=>{return(0,e.createElement)("tr",{key:t.id},(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},(0,e.createElement)("div",{className:"flex items-center gap-2"},(0,e.createElement)("span",null,t.product_title),t.product_type&&((a=t.product_type)?(0,e.createElement)("span",{className:"wcf-badge bg-primary-25 border border-primary-300 text-primary-600 rounded-2xl text-[11px] leading-4 cursor-default font-normal ml-2 capitalize"},a||""):null))),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t.total_orders),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t.conversions),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t.conversion_rate+" %"),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},wr(t.revenue)));var a})))),Ew=()=>(0,e.createElement)("table",{className:"min-w-full divide-y divide-gray-200 border border-gray-200 rounded-md"},(0,e.createElement)("thead",{className:"bg-gray-50"},(0,e.createElement)("tr",null,(0,e.createElement)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Funnel Name","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Opt-in Step","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Opt-in Form","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider !hidden"},(0,z.__)("Popup","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider !hidden"},(0,z.__)("Lead Magnets","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Conversion Rate","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider !hidden"},(0,z.__)("Date & Time","cartflows")))),(0,e.createElement)("tbody",{className:"bg-white divide-y divide-gray-200"},[{id:1,flow_title:"Newsletter Signup Flow",step_title:"Welcome Newsletter",optin_form:"23",conversion_rate:"68.5"},{id:2,flow_title:"Free eBook Download",step_title:"Download Landing Page",optin_form:"45",conversion_rate:"72.3"},{id:3,flow_title:"Webinar Registration",step_title:"Webinar Signup",optin_form:"12",conversion_rate:"65.8"},{id:4,flow_title:"Free Trial Access",step_title:"Trial Registration",optin_form:"20",conversion_rate:"78.2"},{id:5,flow_title:"Course Preview Access",step_title:"Preview Optin",optin_form:"67",conversion_rate:"61.4"}].map((t=>(0,e.createElement)("tr",{key:t.id},(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},t.flow_title),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t.step_title),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t.optin_form),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900 !hidden"}),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900 !hidden"}),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t.conversion_rate+"%"),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900 !hidden"})))))),Lw=function(){const[{analyticsData:a}]=l(),r="active"===cartflows_admin.woocommerce_status,n=a?.flow_stats?.top_performing_funnels,i=(0,t.useMemo)((()=>n&&Object.values(n).map(((t,a)=>(0,e.createElement)("tr",{key:t?.flow_id||a},(0,e.createElement)("td",{className:"px-6 py-4 whitespace-wrap text-sm font-medium text-gray-900"},t?.flow_title||"(no title)"),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t?.total_visits),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t?.unique_visits),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t?.conversions),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t?.conversion_rate+"%"),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},wr(t?.revenue)))))),[n]);return(0,e.createElement)("div",{className:"wcf-top-performing-funnels h-full bg-white overflow-hidden border border-solid border-gray-200 md:rounded-lg wcf-metabox"},(0,e.createElement)("div",{className:"wcf-metabox--heading"},(0,e.createElement)("div",{className:"wcf-metabox--heading-wrapper p-6 sm:flex-auto border-b border-solid border-gray-200 flex justify-between items-center"},(0,e.createElement)("h1",{className:"wcf-metabox--heading-text text-xl font-semibold text-gray-900"},(0,z.__)("Top Performing Funnels","cartflows")),n?.length>0&&(0,e.createElement)("a",{className:"wcf-button wcf-secondary-button hover:text-primary-500 focus:text-primary-500",href:cartflows_admin.admin_url+"?page=cartflows&path=analytics&type=flows",target:"_blank",rel:"noreferrer"},(0,e.createElement)(bw,{className:"h-18 w-18 text-primary-500"}),(0,z.__)("View All","cartflows")))),r?wcfCartflowsTypePro()?(0,e.createElement)("div",{className:"flex flex-col"},(0,e.createElement)("div",{className:"overflow-x-auto"},(0,e.createElement)("div",{className:"inline-block min-w-full align-middle"},(0,e.createElement)("div",{className:"overflow-hidden"},(0,e.createElement)("table",{className:"min-w-full divide-y divide-gray-300"},(0,e.createElement)("thead",{className:"bg-gray-50"},(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"col",className:"py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-6"},(0,z.__)("Funnel Name","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-sm font-semibold text-gray-900"},(0,z.__)("Total Visits","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-sm font-semibold text-gray-900"},(0,z.__)("Unique Visits","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-sm font-semibold text-gray-900"},(0,z.__)("Conversions","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-sm font-semibold text-gray-900"},(0,z.__)("Conversion Rate","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-sm font-semibold text-gray-900"},(0,z.__)("Revenue","cartflows")))),(0,e.createElement)("tbody",{className:"divide-y divide-gray-200 bg-white"},n&&0!==Object.keys(n).length?i:(0,e.createElement)("tr",null,(0,e.createElement)("td",{colSpan:"6",className:"text-center px-8 py-12"},(0,e.createElement)("div",{className:"flex justify-center mb-3"},(0,e.createElement)(vw,{className:"h-6 w-6 text-primary-500"})),(0,e.createElement)("h3",{className:"mt-2 text-base font-medium text-gray-900"},(0,z.__)("Find top performing funnels here","cartflows")),(0,e.createElement)("p",{className:"mt-1 text-sm text-gray-500"},(0,z.__)("Once you set up funnels, come back here to top performing funnels","cartflows")))))))))):(0,e.createElement)("div",{className:"overflow-x-auto relative min-h-[360px]"},(0,e.createElement)(pw,{title:(0,z.__)("Top Performing Funnels is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full inset-0 flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:"blur-[2px]"},(0,e.createElement)(_w,null))):(0,e.createElement)("div",{className:"text-center px-8 py-12"},(0,e.createElement)("div",{className:"flex justify-center mb-3"},(0,e.createElement)(vy,{className:"h-10 w-10 text-primary-500"})),(0,e.createElement)("h3",{className:"mt-2 text-base font-medium text-gray-900"},(0,z.__)("WooCommerce plugin is required.","cartflows")),(0,e.createElement)("p",{className:"mt-1 text-sm text-gray-500"},(0,z.__)("You need WooCommerce plugin installed and activated to view the recent orders","cartflows"))))},Tw=function(){return(0,e.createElement)("div",{className:"wcf-quick-actions bg-white overflow-hidden border border-solid border-gray-200 md:rounded-lg wcf-metabox"},(0,e.createElement)("div",{className:"wcf-metabox--heading sm:flex sm:items-center"},(0,e.createElement)("div",{className:"wcf-metabox--heading-wrapper p-6 sm:flex-auto"},(0,e.createElement)("h1",{className:"wcf-metabox--heading-text text-xl font-semibold text-gray-900"},(0,z.__)("Quick Actions","cartflows")))),(0,e.createElement)("div",{className:"flex flex-col"},(0,e.createElement)("div",{className:"inline-block min-w-full align-middle"},(0,e.createElement)("nav",{className:"","aria-label":"Sidebar"},(0,e.createElement)(I,{key:"wcf-quick-action-create-funnel",to:{pathname:"admin.php",search:`?page=${cartflows_admin.home_slug}&path=library`},className:"wcf-quick-action-nav-item cursor-pointer group bg-primary-25 hover:bg-primary-25 border-primary-25 hover:border-primary-25 group flex items-center px-5 py-4 text-sm border-y border-solid"},(0,e.createElement)("div",{className:"wcf-nav-icon p-4 mr-2.5 rounded-full bg-white shadow-custom"},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-6 h-6 text-primary-500"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z"}))),(0,e.createElement)("div",{className:"wcf-nav-title"},(0,e.createElement)("div",{className:"font-medium text-gray-900"},(0,z.__)("Create a Funnel","cartflows")),(0,e.createElement)("div",{className:"text-gray-500"},(0,z.__)("Create a Funnel","cartflows"))),(0,e.createElement)("div",{className:"wcf-nav-icon-link ml-auto"},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 text-gray-400 group-hover:text-primary-500"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})))),(0,e.createElement)(I,{key:"wcf-quick-action-show-funnel",to:{pathname:"admin.php",search:`?page=${cartflows_admin.home_slug}&path=analytics`},className:"wcf-quick-action-nav-item cursor-pointer group hover:bg-primary-25 hover:border-primary-25 group flex items-center px-5 py-4 text-sm"},(0,e.createElement)("div",{className:"wcf-nav-icon p-4 mr-2.5 rounded-full bg-white shadow-custom"},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-6 h-6 text-primary-500"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 17.9999L9 11.2499L13.3064 15.5564C14.5101 13.188 16.5042 11.2022 19.1203 10.0375L21.8609 8.81726M21.8609 8.81726L15.9196 6.53662M21.8609 8.81726L19.5802 14.7585"}))),(0,e.createElement)("div",{className:"wcf-nav-title"},(0,e.createElement)("div",{className:"font-medium text-gray-900"},(0,z.__)("Analytics","cartflows")),(0,e.createElement)("div",{className:"text-gray-500"},(0,z.__)("View sales analytics","cartflows"))),(0,e.createElement)("div",{className:"wcf-nav-icon-link ml-auto"},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 text-gray-400 group-hover:text-primary-500"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})))),"active"===cartflows_admin.woocommerce_status&&(0,e.createElement)("a",{href:cartflows_admin.create_product_src,target:"_blank",className:"wcf-quick-action-nav-item cursor-pointer group hover:bg-primary-25 hover:border-primary-25 group flex items-center px-5 py-4 text-sm border-b border-solid border-gray-200",rel:"noreferrer"},(0,e.createElement)("div",{className:"wcf-nav-icon p-4 mr-2.5 rounded-full bg-white shadow-custom"},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-6 h-6 text-primary-500"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 7.5l-9-5.25L3 7.5m18 0l-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"}))),(0,e.createElement)("div",{className:"wcf-nav-title"},(0,e.createElement)("div",{className:"font-medium text-gray-900"},(0,z.__)("Create a Product","cartflows")),(0,e.createElement)("div",{className:"text-gray-500"},(0,z.__)("Create new Product","cartflows"))),(0,e.createElement)("div",{className:"wcf-nav-icon-link ml-auto"},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 text-gray-400 group-hover:text-primary-500"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})))),(0,e.createElement)(I,{key:"wcf-quick-action-show-funnel",to:{pathname:"admin.php",search:`?page=${cartflows_admin.home_slug}&path=flows`},className:"wcf-quick-action-nav-item cursor-pointer group hover:bg-primary-25 hover:border-primary-25 group flex items-center px-5 py-4 text-sm"},(0,e.createElement)("div",{className:"wcf-nav-icon p-4 mr-2.5 rounded-full bg-white shadow-custom"},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-6 h-6 text-primary-500"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}))),(0,e.createElement)("div",{className:"wcf-nav-title"},(0,e.createElement)("div",{className:"font-medium text-gray-900"},(0,z.__)("All Funnels","cartflows")),(0,e.createElement)("div",{className:"text-gray-500"},(0,z.__)("View all funnels","cartflows"))),(0,e.createElement)("div",{className:"wcf-nav-icon-link ml-auto"},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-4 h-4 text-gray-400 group-hover:text-primary-500"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"}))))))))},Aw=function(){const[a,r]=(0,t.useState)({errorFor:!1,errorMsg:!1}),{errorFor:n,errorMsg:i}=a,s=(e,t="plugin")=>"activated"===e?"":"installed"===e||"inactive"===e?"cartflows_recommended_"+t+"_activate":"cartflows_recommended_"+t+"_install",o=e=>{e.preventDefault();const t=e.target.dataset.action,a=e.target.dataset.is_pro,r=e.target.dataset.page_link,n=e.target.dataset.status;if("true"!==a.toLowerCase()||"not-installed"!==n)switch(t){case"cartflows_recommended_plugin_activate":c(e);break;case"cartflows_recommended_plugin_install":e.target.innerText=(0,z.__)("Installing…","cartflows"),l(e,"install-plugin")}else window.open(r,"_blank","noopener,noreferrer")},l=(e,t)=>new Promise(((a,n)=>{wp.updates.queue.push({action:t,data:{slug:e.target.dataset.slug,success(t){e.target.innerText=(0,z.__)("Installed","cartflows"),a(t,e.target.dataset),c(e)},error(t){n(t,e.target.dataset),e.target.innerText=(0,z.__)("Failed","cartflows"),r({errorFor:`${e.target.dataset.slug}_error`,errorMsg:t?.errorMessage}),setTimeout((function(){e.target.innerText=(0,z.__)("Install","cartflows"),r({errorFor:!1,errorMsg:!1})}),1500)}}}),wp.updates.queueChecker()})),c=e=>{const t=new window.FormData;t.append("action","cartflows_activate_plugin"),t.append("init",e.target.dataset.init),t.append("security",cartflows_admin.activate_plugin_nonce),e.target.innerText=(0,z.__)("Activating…","cartflows"),A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{e.target.className="",e.target.className="text-green-600 pointer-events-none capitalize text-xs !px-0",e.target.innerText=(0,z.__)("Activated","cartflows"),e.target.dataset.redirection&&(window.location=e.target.dataset.redirection)}))},u={"modern-cart":{id:0,subtitle:(0,z.__)("Fast and customizable cart for your website.","cartflows")},"woo-cart-abandonment-recovery":{id:1,subtitle:(0,z.__)("Recover abandonded carts with ease.","cartflows")},suretriggers:{id:2,subtitle:(0,z.__)("Automate your repititive tasks, effortlessly!","cartflows")},"variation-swatches-woo":{id:3,subtitle:(0,z.__)("Product choices made visual and clickable.","cartflows")}},d=Object.keys(u),m=cartflows_admin.integrations.plugins.filter((e=>d.includes(e.slug))).sort(((e,t)=>u[e.slug].id-u[t.slug].id)),g=m.map(((t,a)=>(0,e.createElement)("div",{key:a,className:"box-border bg-white relative border rounded-md px-4 py-4 flex items-start gap-x-4 snap-start"},(0,e.createElement)("div",{className:"w-full flex items-center justify-between"},(0,e.createElement)("div",{className:"flex flex-col"},(0,e.createElement)("div",{className:"flex gap-2 items-center"},t.logoPath&&(0,e.createElement)("img",{src:t.logoPath.icon_path,className:"w-6 h-6 min-w-[24px] min-h-[24px]",alt:t.title}),(0,e.createElement)("div",{className:"text-sm font-[600] text-[#111827]"},t.title)),(0,e.createElement)("div",{className:""},(0,e.createElement)("p",{className:"text-[13px] whitespace-break-spaces font-normal text-gray-600 flex mt-2"},u[t.slug]?.subtitle||t.subtitle))),(0,e.createElement)("div",{className:"flex items-center gap-3"},(0,e.createElement)("button",{"data-slug":t.slug,"data-redirection":t.redirection,"data-action":s(t.status,"plugin"),"data-status":t.status,"data-is_pro":t.isPro,"data-page_link":t.link,"data-init":t.path,onClick:o,className:br()("active"===t.status?"text-green-600 pointer-events-none !px-0 text-xs":"wcf-button wcf-secondary-button","text-[10px] px-2 py-1")},t.isPro&&"not-installed"===t.status?(0,z.__)("Let's Go","cartflows"):function(e){let t="";switch(e){case"active":t=(0,z.__)("Active","cartflows");break;case"inactive":t=(0,z.__)("Activate","cartflows");break;default:t=(0,z.__)("Install","cartflows")}return t}(t.status)),n===`${t.slug}_error`&&i&&(0,e.createElement)("p",{id:`${t.slug}_error`,className:"text-[10px] text-primary-500"},i))))));return(0,e.createElement)("div",{className:"wcf-quick-actions bg-white overflow-hidden border border-solid border-gray-200 md:rounded-lg wcf-metabox"},(0,e.createElement)("div",{className:"wcf-metabox--heading sm:flex sm:items-center"},(0,e.createElement)("div",{className:"wcf-metabox--heading-wrapper p-6 sm:flex-auto"},(0,e.createElement)("h1",{className:"wcf-metabox--heading-text text-xl font-semibold text-gray-900"},(0,z.__)("Extend Your Store","cartflows")))),(0,e.createElement)("div",{className:"flex flex-col"},(0,e.createElement)("div",{className:"inline-block min-w-full align-middle"},(0,e.createElement)("nav",{className:"","aria-label":"Sidebar"},g))))},zw=function(){const[{setup_checklist_data:t}]=l(),a=!function(e){return uw(e).every((e=>Object.values(e).every((e=>e.completed))))}(t);return(0,e.createElement)("div",{className:"wcf-home-page-wrapper"},a&&(0,e.createElement)("div",{className:"wcf-col--row mb-8"},(0,e.createElement)("div",{className:"wcf-col w-full"},(0,e.createElement)(mw,null))),(0,e.createElement)("div",{className:"wcf-col--row mb-8"},(0,e.createElement)("div",{className:"wcf-col w-full"},(0,e.createElement)(ww,null))),(0,e.createElement)("div",{className:"wcf-col--row flex flex-col md:flex-row w-full gap-8 justify-between"},(0,e.createElement)("div",{className:"wcf-col w-full flex flex-col gap-8 md:w-[70%]"},(0,e.createElement)(jw,null),(0,e.createElement)(Lw,null)),(0,e.createElement)("div",{className:"wcf-col w-full flex flex-col gap-8 md:w-[30%]"},(0,e.createElement)(Tw,null),(0,e.createElement)(Aw,null))))};function kw({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"}))}const Sw=t.forwardRef(kw),Ow=function({currentPage:t,maxPages:a}){const[{},r]=l(),n=new URLSearchParams((0,f.useLocation)().search),i=n.get("post_status"),s=n.get("s"),o=n.get("from"),c=n.get("to");let u="",d="",m="";i&&(u="&post_status="+i),s&&(d="&s="+s),o&&c&&(m="&filter=date&from="+o+"&to="+c);const g=function(){const e=t,r=a,n=[e-2,e-1,e,e+1,e+2].filter((e=>e>1&&e4&&n.unshift("..."),i&&n.push("..."),[1,...n,r]}(),p=function(){r({type:"SET_FLOWS",flows:null})};return 1===a?"":(0,e.createElement)("div",{className:"wcf-flows--pagination-actions bg-white p-5 rounded-b-xl"},(0,e.createElement)("div",{className:"wcf-flows-pagination flex items-center justify-between"},(0,e.createElement)("div",{className:"wcf-next-previous-buttons-mobile flex flex-1 justify-between sm:hidden"},(0,e.createElement)("a",{href:"#",className:"relative inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50"},(0,z.__)("Previous","cartflows")),(0,e.createElement)("a",{href:"#",className:"relative ml-3 inline-flex items-center rounded-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50"},(0,z.__)("Next","cartflows"))),(0,e.createElement)("div",{className:"wcf-pagination-pages-button hidden sm:flex sm:flex-1 sm:items-center sm:justify-end"},(0,e.createElement)("div",null,(0,e.createElement)("nav",{className:"isolate inline-flex -space-x-px rounded-md shadow-sm gap-3","aria-label":"Pagination"},(0,e.createElement)("div",{className:"wcf-pagination-page-buttons border border-gray-200 rounded"},function(){const a=[];return g&&g.map(((r,n)=>(a.push((0,e.createElement)(I,{key:n,to:{pathname:"admin.php",search:`?page=cartflows&path=flows${u}${d}&paged=${r}${m}`},className:`wcf-flows-pagination__num relative z-10 inline-flex items-center px-4 py-2 text-sm font-semibold text-gray-600 hover:text-primary-500 focus:text-primary-500 focus:z-20 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 ${t===r&&"bg-primary-25 border border-primary-300 rounded text-primary-600"}`,onClick:p},r)),""))),a}()),(0,e.createElement)("div",{className:"wcf-pagination-action-buttons flex border border-gray-200 rounded"},(0,e.createElement)(I,{key:"first",to:{pathname:"admin.php",search:`?page=cartflows&path=flows${u}`},className:"relative inline-flex items-center rounded-l-md px-2 py-2 text-gray-400 hover:bg-primary-50 hover:text-primary-500 focus:z-20 focus:outline-offset-0",onClick:p},(0,e.createElement)("span",{className:"sr-only"},(0,z.__)("First","cartflows")),(0,e.createElement)(MM,{text:(0,z.__)("First","cartflows"),classes:"!ml-0",icon:(0,e.createElement)(Sw,{className:"h-18 w-18","aria-hidden":"true"})})),(0,e.createElement)(I,{key:"last",to:{pathname:"admin.php",search:`?page=cartflows&path=flows${u}${d}&paged=${a}${m}`},className:"relative inline-flex items-center rounded-r-md px-2 py-2 text-gray-400 hover:bg-primary-50 hover:text-primary-500 focus:z-20 focus:outline-offset-0",onClick:p},(0,e.createElement)("span",{className:"sr-only"},(0,z.__)("Last","cartflows")),(0,e.createElement)(MM,{text:(0,z.__)("Last","cartflows"),classes:"!ml-0",icon:(0,e.createElement)(MN,{className:"h-18 w-18","aria-hidden":"true"})}))))))))};function Cw({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 16.5V9.75m0 0 3 3m-3-3-3 3M6.75 19.5a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const Yw=t.forwardRef(Cw);function Uw({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"}))}const Qw=t.forwardRef(Uw),Pw=({importBtnString:a=""})=>{const[n,i]=(0,t.useState)(!1),[s,o]=(0,t.useState)(!1),[l,c]=(0,t.useState)(null),u=(0,t.useRef)(null),[d,m]=(0,t.useState)({selectedFile:"",processText:(0,z.__)("Import Funnel","cartflows"),process:!1}),{selectedFile:g,process:p}=d;function f(){m({...d,selectedFile:""}),o(!1),c(null),i(!1)}const[h,M]=r().useState(!1),y=function(e){e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?M(!0):"dragleave"===e.type&&M(!1)};return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("span",{className:"wcf-button wcf-secondary-button wcf-flows-sub-header__import px-3",onClick:()=>{i(!n)}},(0,e.createElement)(Yw,{className:"w-18 h-18 stroke-2 stroke-primary-500 fill-none","aria-hidden":"true"}),(0,e.createElement)("span",{className:"wcf-flows-header__text hidden md:inline"},a||(0,z.__)("Import","cartflows"))),(0,e.createElement)(Pt.Root,{show:n,as:t.Fragment},(0,e.createElement)(gr,{as:"div",className:"relative z-20",initialFocus:u,onClose:i},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},(0,e.createElement)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})),(0,e.createElement)("div",{className:"fixed inset-0 z-10 overflow-y-auto"},(0,e.createElement)("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:items-center sm:p-0"},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},(0,e.createElement)(gr.Panel,{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg"},(0,e.createElement)("div",{className:"absolute top-0 right-0 hidden pt-4 pr-4 sm:block"},(0,e.createElement)("button",{type:"button",className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none",onClick:f},(0,e.createElement)("span",{className:"sr-only"},"Close"),(0,e.createElement)(Cr,{className:"h-6 w-6","aria-hidden":"true"}))),(0,e.createElement)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},(0,e.createElement)("div",{className:"sm:flex sm:items-start"},(0,e.createElement)("div",{className:"mt-3 text-center sm:mt-0 sm:text-left"},(0,e.createElement)(gr.Title,{as:"h3",className:"text-lg font-medium leading-6 text-gray-900"},(0,z.__)("Import Funnel","cartflows")),(0,e.createElement)("div",{className:"mt-4"},(0,e.createElement)("p",{className:"text-sm text-gray-500"},(0,z.__)("You can specify a file to import by either dragging it into the drag and drop area.(Maximum file size of 5MB; .json file extensions only.)","cartflows")))))),(0,e.createElement)("form",{method:"post",encType:"multipart/form-data",onDragEnter:y},(0,e.createElement)("div",{className:"p-6 pt-0"},(0,e.createElement)("div",{className:"flex items-center justify-center w-full"},(0,e.createElement)("label",{htmlFor:"dropzone-file",className:br()("flex flex-col items-center justify-center w-full border-2 border-gray-300 border-dashed rounded-lg cursor-pointer hover:border-gray-400",h?"bg-white":"")},(0,e.createElement)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6"},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",className:"w-6 h-6 text-gray-400","aria-hidden":"true"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})),(0,e.createElement)("p",{className:"mt-2 block text-sm font-medium text-gray-800"},(0,e.createElement)("span",{className:"font-semibold"},g?(0,z.__)("Change a file","cartflows"):(0,z.__)("Upload a file","cartflows"))," ",(0,z.__)("or drag and drop","cartflows")),(0,e.createElement)("p",{className:"mt-2 block text-xs font-normal text-gray-600"},(0,z.__)("JSON file up to 5MB","cartflows"))),(0,e.createElement)("input",{id:"dropzone-file",type:"file",className:"hidden",accept:"application/JSON",name:"file",onChange:function(e){m({...d,selectedFile:e.target.files[0]})}}))),g&&(0,e.createElement)("div",{className:"rounded-md bg-green-50 p-4 mt-5"},(0,e.createElement)("div",{className:"flex items-center justify-between"},(0,e.createElement)("div",{className:"wcf-import-flow--file-info flex items-center gap-1"},(0,e.createElement)("div",{className:"flex-shrink-0"},(0,e.createElement)(Qw,{className:"w-6 h-6 text-gray-400","aria-hidden":"true"})),(0,e.createElement)("div",{className:"wcf-import-flow--message"},(0,e.createElement)("p",{className:"text-sm font-medium text-green-800"},(0,z.sprintf)(/* translators: %s is replaced with the file name. */ /* translators: %s is replaced with the file name. */
(0,z.__)("File Selected: %s","cartflows"),g.name)))),(0,e.createElement)("div",{className:"wcf-import-flow--close-btn"},(0,e.createElement)("div",{className:"-mx-1.5 -my-1.5"},(0,e.createElement)("button",{type:"button",className:"inline-flex rounded-md bg-green-50 p-1.5 text-green-500 hover:bg-green-100 focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2 focus:ring-offset-green-50",onClick:()=>{document.getElementById("dropzone-file").value=null,m({...d,selectedFile:null})}},(0,e.createElement)("span",{className:"sr-only"},"Dismiss"),(0,e.createElement)(Cr,{className:"h-5 w-5","aria-hidden":"true"}))))))),s?(0,e.createElement)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},(0,e.createElement)("div",{className:"sm:flex sm:items-start"},(0,e.createElement)("div",{className:"mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10"},(0,e.createElement)(vy,{className:"h-6 w-6 text-primary-600","aria-hidden":"true"})),(0,e.createElement)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},(0,e.createElement)("h3",{className:"text-lg font-medium leading-6 text-gray-900"},(0,z.__)("Replace Store Checkout Funnel?","cartflows")),(0,e.createElement)("div",{className:"mt-2"},(0,e.createElement)("p",{className:"text-sm text-gray-500"},l?.message||(0,z.__)("A Store Checkout funnel already exists. Importing will replace the current Store Checkout funnel.","cartflows")))))):null,(0,e.createElement)("div",{className:"bg-gray-50 px-4 py-3 flex sm:flex sm:px-6 gap-3 justify-end"},(0,e.createElement)("button",{type:"button",className:"wcf-button wcf-secondary-button",onClick:f},(0,z.__)("Cancel","cartflows")),(0,e.createElement)("button",{type:"button",className:"wcf-button "+(p?"wcf-disabled":"wcf-primary-button"),onClick:s?function(){if(!l)return;m({...d,process:!0,processText:(0,z.__)("Importing..","cartflows")});const e=new window.FormData;e.append("action","cartflows_import_json_flow"),e.append("security",cartflows_admin.import_json_flow_nonce),e.append("flow_data",JSON.stringify(l.flow_data)),e.append("check_store_checkout","yes"),e.append("force_import","yes"),A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((e=>{console.log(e),m({...d,processText:"Redirecting..",process:!1}),cartflows_admin.admin_base_url?window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=store-checkout`:window.location=e.data.redirect_url}))}:function(){if(!g||p)return;if("application/json"!==g.type)return void alert((0,z.__)("Please select the valid json file.","cartflows"));m({...d,process:!0,processText:(0,z.__)("Importing..","cartflows")}),console.log(g);const e=new FileReader;e.readAsText(g,"UTF-8"),e.onload=e=>{console.log("e.target.result",e.target.result);let t=e.target.result;if("string"==typeof t)try{t=JSON.parse(t),console.log("Data is a valid JSON string:",t)}catch(e){console.error("Error parsing JSON:",e)}const a=function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return console.error("Error parsing JSON in checkForStoreCheckout:",e),!1}return Array.isArray(e)?e.some((e=>"store-checkout"===e.flow_type)):!(!e||"object"!=typeof e)&&"store-checkout"===e.flow_type}(t),r=new window.FormData;r.append("action","cartflows_import_json_flow"),r.append("security",cartflows_admin.import_json_flow_nonce),r.append("flow_data",t),r.append("check_store_checkout",a?"yes":"no"),A()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((e=>{console.log(e),e.data.requires_confirmation?(c(e.data),o(!0),m({...d,process:!1,processText:(0,z.__)("Import Funnel","cartflows")})):(m({...d,processText:"Redirecting..",process:!1}),a&&cartflows_admin.admin_base_url?window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=store-checkout`:window.location=e.data.redirect_url)}))}}},p&&(0,e.createElement)(ny,null),s?(0,z.__)("Replace & Import","cartflows"):d.processText)),h&&(0,e.createElement)("div",{className:"absolute w-full h-full rounded-2xl inset-0",onDragEnter:y,onDragLeave:y,onDragOver:y,onDrop:function(e){e.preventDefault(),e.stopPropagation(),M(!1),e.dataTransfer.files&&e.dataTransfer.files[0]&&m({...d,selectedFile:e.dataTransfer.files[0]})}})))))))))};function Fw({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9.75v6.75m0 0-3-3m3 3 3-3m-8.25 6a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"}))}const Rw=t.forwardRef(Fw),Hw=function(a){const{flows_count:r}=a,[n,i]=(0,t.useState)("hide"),[s,o]=(0,t.useState)(""),[{page_builder:l}]=g(),[c,u]=(0,t.useState)({isProcessing:!1,buttonText:(0,z.__)("Export All","cartflows")}),{isProcessing:d,buttonText:m}=c;return(0,e.createElement)("div",{className:"bg-white px-8 py-6 flex justify-between items-center mb-9 -m-8"},(0,e.createElement)("h2",{className:"text-base md:text-2xl font-bold text-grey-800"},(0,z.__)("Funnels","cartflows")),(0,e.createElement)("div",{className:"wcf-flows-header__action-buttons flex gap-4"},(0,e.createElement)(Pw,null),(0,e.createElement)("span",{className:br()("wcf-button wcf-flows-sub-header__export px-3",r>0?"wcf-secondary-button":"wcf-disabled",d?"wcf-button--processing":""),onClick:r>0?function(e){e.preventDefault(),u({isProcessing:!0,buttonText:(0,z.__)("Exporting…","cartflows")});const t=new window.FormData;t.append("action","cartflows_export_all_flows"),t.append("security",cartflows_admin.export_all_flows_nonce),A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{if(e.success){const t=new Date,a="cartflows-flows-export-"+t.getDate()+"-"+(t.getMonth()+1)+"-"+t.getFullYear()+".json";if(e.data.export){const t=JSON.stringify(e.data.flows),r=new Blob([t],{type:"application/json"});if(document.documentMode)window.navigator.msSaveOrOpenBlob(r,a);else{const e=document.createElement("a");e.href=URL.createObjectURL(r),e.download=a,e.click()}u({isProcessing:!1,buttonText:(0,z.__)("Export All","cartflows")})}}}))}:()=>{}},(0,e.createElement)(Rw,{className:"w-18 h-18 stroke-2"}),(0,e.createElement)("span",{className:"wcf-flows-header__text"},d?m:(0,e.createElement)("span",{className:"hidden md:inline"},(0,z.__)("Export All","cartflows"))," ","("+r+")")),(0,e.createElement)("span",{className:"divider w-px bg-gray-200"}),(0,e.createElement)(I,{key:"importer",to:{pathname:"admin.php",search:"?page=cartflows&path=library"},onClick:e=>{"bricks-builder"===l&&(e.preventDefault(),i("show"))},className:"wcf-flows-header__library wcf-button wcf-primary-button px-3"},(0,e.createElement)(zr,{className:"w-18 h-18 stroke-2"}),(0,e.createElement)("span",{className:"wcf-flows-header__text hidden md:inline"},(0,z.__)("Create New Funnel","cartflows")),(0,e.createElement)("span",{className:"wcf-flows-header__text inline md:hidden text-xs"},(0,z.__)("Add New","cartflows")))),(0,e.createElement)(sw,{visibility:n,setVisibility:i,type:"blank",flowName:s,setFlowName:o}))};function Bw(e,a=!1){let[r,n]=(0,t.useReducer)((()=>({})),{}),i=(0,t.useMemo)((()=>function(e){if(null===e)return{width:0,height:0};let{width:t,height:a}=e.getBoundingClientRect();return{width:t,height:a}}(e)),[e,r]);return De((()=>{if(!e)return;let t=new ResizeObserver(n);return t.observe(e),()=>{t.disconnect()}}),[e]),a?{width:`${i.width}px`,height:`${i.height}px`}:i}let Ww=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Zw(e){var t,a;let r=null!=(t=e.innerText)?t:"",n=e.cloneNode(!0);if(!(n instanceof HTMLElement))return r;let i=!1;for(let e of n.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))e.remove(),i=!0;let s=i?null!=(a=n.innerText)?a:"":r;return Ww.test(s)&&(s=s.replace(Ww,"")),s}function Vw(e){return[e.screenX,e.screenY]}var Gw="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function Xw(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let a,r,n;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(a=e.length,a!==t.length)return!1;for(r=a;0!=r--;)if(!Xw(e[r],t[r]))return!1;return!0}if(n=Object.keys(e),a=n.length,a!==Object.keys(t).length)return!1;for(r=a;0!=r--;)if(!{}.hasOwnProperty.call(t,n[r]))return!1;for(r=a;0!=r--;){const a=n[r];if(!("_owner"===a&&e.$$typeof||Xw(e[a],t[a])))return!1}return!0}return e!=e&&t!=t}function Jw(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qw(e,t){const a=Jw(e);return Math.round(t*a)/a}function $w(e){const a=t.useRef(e);return Gw((()=>{a.current=e})),a}const Kw=(e,t)=>({...As(e),options:[e,t]}),ex=(e,t)=>({...ks(e),options:[e,t]}),tx=(e,t)=>({...Ss(e),options:[e,t]}),ax={...a},rx=ax.useInsertionEffect||(e=>e());function nx(e){const a=t.useRef((()=>{}));return rx((()=>{a.current=e})),t.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r"floating-ui-"+Math.random().toString(36).slice(2,6)+ox++,cx=ax.useId||function(){const[e,a]=t.useState((()=>sx?lx():void 0));return ix((()=>{null==e&&a(lx())}),[]),t.useEffect((()=>{sx=!0}),[]),e};const ux=t.createContext(null),dx=t.createContext(null),mx="data-floating-ui-focusable";function gx(e){void 0===e&&(e={});const{nodeId:a}=e,r=function(e){const{open:a=!1,onOpenChange:r,elements:n}=e,i=cx(),s=t.useRef({}),[o]=t.useState((()=>function(){const e=new Map;return{emit(t,a){var r;null==(r=e.get(t))||r.forEach((e=>e(a)))},on(t,a){e.set(t,[...e.get(t)||[],a])},off(t,a){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter((e=>e!==a)))||[])}}}())),l=null!=((null==(p=t.useContext(ux))?void 0:p.id)||null),[c,u]=t.useState(n.reference),d=nx(((e,t,a)=>{s.current.openEvent=e?t:void 0,o.emit("openchange",{open:e,event:t,reason:a,nested:l}),null==r||r(e,t,a)})),m=t.useMemo((()=>({setPositionReference:u})),[]),g=t.useMemo((()=>({reference:c||n.reference||null,floating:n.floating||null,domReference:n.reference})),[c,n.reference,n.floating]);var p;return t.useMemo((()=>({dataRef:s,open:a,onOpenChange:d,elements:g,events:o,floatingId:i,refs:m})),[a,d,g,o,i,m])}({...e,elements:{reference:null,floating:null,...e.elements}}),n=e.rootContext||r,i=n.elements,[s,o]=t.useState(null),[l,c]=t.useState(null),u=(null==i?void 0:i.domReference)||s,d=t.useRef(null),m=t.useContext(dx);ix((()=>{u&&(d.current=u)}),[u]);const g=function(e){void 0===e&&(e={});const{placement:a="bottom",strategy:r="absolute",middleware:n=[],platform:i,elements:{reference:s,floating:o}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,m]=t.useState({x:0,y:0,strategy:r,placement:a,middlewareData:{},isPositioned:!1}),[g,p]=t.useState(n);Xw(g,n)||p(n);const[f,h]=t.useState(null),[M,y]=t.useState(null),N=t.useCallback((e=>{e!==D.current&&(D.current=e,h(e))}),[]),w=t.useCallback((e=>{e!==v.current&&(v.current=e,y(e))}),[]),x=s||f,b=o||M,D=t.useRef(null),v=t.useRef(null),j=t.useRef(d),_=null!=c,I=$w(c),E=$w(i),L=$w(u),T=t.useCallback((()=>{if(!D.current||!v.current)return;const e={placement:a,strategy:r,middleware:g};E.current&&(e.platform=E.current),((e,t,a)=>{const r=new Map,n={platform:Is,...a},i={...n.platform,_c:r};return(async(e,t,a)=>{const{placement:r="bottom",strategy:n="absolute",middleware:i=[],platform:s}=a,o=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:n}),{x:u,y:d}=Wi(c,r,l),m=r,g={},p=0;for(let a=0;a{const t={...e,isPositioned:!1!==L.current};A.current&&!Xw(j.current,t)&&(j.current=t,Za.flushSync((()=>{m(t)})))}))}),[g,a,r,E,L]);Gw((()=>{!1===u&&j.current.isPositioned&&(j.current.isPositioned=!1,m((e=>({...e,isPositioned:!1}))))}),[u]);const A=t.useRef(!1);Gw((()=>(A.current=!0,()=>{A.current=!1})),[]),Gw((()=>{if(x&&(D.current=x),b&&(v.current=b),x&&b){if(I.current)return I.current(x,b,T);T()}}),[x,b,T,I,_]);const z=t.useMemo((()=>({reference:D,floating:v,setReference:N,setFloating:w})),[N,w]),k=t.useMemo((()=>({reference:x,floating:b})),[x,b]),S=t.useMemo((()=>{const e={position:r,left:0,top:0};if(!k.floating)return e;const t=qw(k.floating,d.x),a=qw(k.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+a+"px)",...Jw(k.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:a}}),[r,l,k.floating,d.x,d.y]);return t.useMemo((()=>({...d,update:T,refs:z,elements:k,floatingStyles:S})),[d,T,z,k,S])}({...e,elements:{...i,...l&&{reference:l}}}),p=t.useCallback((e=>{const t=$i(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),g.refs.setReference(t)}),[g.refs]),f=t.useCallback((e=>{($i(e)||null===e)&&(d.current=e,o(e)),($i(g.refs.reference.current)||null===g.refs.reference.current||null!==e&&!$i(e))&&g.refs.setReference(e)}),[g.refs]),h=t.useMemo((()=>({...g.refs,setReference:f,setPositionReference:p,domReference:d})),[g.refs,f,p]),M=t.useMemo((()=>({...g.elements,domReference:u})),[g.elements,u]),y=t.useMemo((()=>({...g,...n,refs:h,elements:M,nodeId:a})),[g,h,M,a,n]);return ix((()=>{n.dataRef.current.floatingContext=y;const e=null==m?void 0:m.nodesRef.current.find((e=>e.id===a));e&&(e.context=y)})),t.useMemo((()=>({...g,context:y,refs:h,elements:M})),[g,h,M,y])}const px="active",fx="selected";function hx(e,t,a){const r=new Map,n="item"===a;let i=e;if(n&&e){const{[px]:t,[fx]:__,...a}=e;i=a}return{..."floating"===a&&{tabIndex:-1,[mx]:""},...i,...t.map((t=>{const r=t?t[a]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[a,i]=t;var s;n&&[px,fx].includes(a)||(0===a.indexOf("on")?(r.has(a)||r.set(a,[]),"function"==typeof i&&(null==(s=r.get(a))||s.push(i),e[a]=function(){for(var e,t=arguments.length,n=new Array(t),i=0;ie(...n))).find((e=>void 0!==e))})):e[a]=i)})),e):e),{})}}function Mx(e,t){return{...e,rects:{...e.rects,floating:{...e.rects.floating,height:t}}}}let yx=(0,t.createContext)({styles:void 0,setReference:()=>{},setFloating:()=>{},getReferenceProps:()=>({}),getFloatingProps:()=>({}),slot:{}});yx.displayName="FloatingContext";let Nx=(0,t.createContext)(null);function wx({children:e,enabled:a=!0}){let[r,n]=(0,t.useState)(null),[i,s]=(0,t.useState)(0),o=(0,t.useRef)(null),[l,c]=(0,t.useState)(null);!function(e){De((()=>{if(!e)return;let t=new MutationObserver((()=>{let t=window.getComputedStyle(e).maxHeight,a=parseFloat(t);if(isNaN(a))return;let r=parseInt(t);isNaN(r)||a!==r&&(e.style.maxHeight=`${Math.ceil(a)}px`)}));return t.observe(e,{attributes:!0,attributeFilter:["style"]}),()=>{t.disconnect()}}),[e])}(l);let u=a&&null!==r&&null!==l,{to:d="bottom",gap:m=0,offset:g=0,padding:p=0,inner:f}=function(e,t){var a,r,n;let i=xx(null!=(a=null==e?void 0:e.gap)?a:"var(--anchor-gap, 0)",t),s=xx(null!=(r=null==e?void 0:e.offset)?r:"var(--anchor-offset, 0)",t),o=xx(null!=(n=null==e?void 0:e.padding)?n:"var(--anchor-padding, 0)",t);return{...e,gap:i,offset:s,padding:o}}(r,l),[h,M="center"]=d.split(" ");De((()=>{u&&s(0)}),[u]);let{refs:y,floatingStyles:N,context:w}=gx({open:u,placement:"selection"===h?"center"===M?"bottom":`bottom-${M}`:"center"===M?`${h}`:`${h}-${M}`,strategy:"absolute",transform:!1,middleware:[Kw({mainAxis:"selection"===h?0:m,crossAxis:g}),(v={padding:p},{...zs(v),options:[v,undefined]}),"selection"!==h&&ex({padding:p}),"selection"===h&&f?(D={...f,padding:p,overflowRef:o,offset:i,minItemsVisible:4,referenceOverflowThreshold:p,onFallbackChange(e){var t,a;if(!e)return;let r=w.elements.floating;if(!r)return;let n=parseFloat(getComputedStyle(r).scrollPaddingBottom)||0,i=Math.min(4,r.childElementCount),o=0,l=0;for(let e of null!=(a=null==(t=w.elements.floating)?void 0:t.childNodes)?a:[])if(e instanceof HTMLElement){let t=e.offsetTop,a=t+e.clientHeight+n,s=r.scrollTop,c=s+r.clientHeight;if(!(t>=s&&a<=c)){l=Math.max(0,Math.min(a,c)-Math.max(t,s)),o=e.clientHeight;break}i--}i>=1&&s((e=>{let t=o*i-l+n;return e>=t?e:t}))}},{name:"inner",options:D,async fn(e){const{listRef:t,overflowRef:a,onFallbackChange:r,offset:n=0,index:i=0,minItemsVisible:s=4,referenceOverflowThreshold:o=0,scrollRef:l,...c}=Oi(D,e),{rects:u,elements:{floating:d}}=e,m=t.current[i],g=(null==l?void 0:l.current)||d,p=d.clientTop||g.clientTop,f=0!==d.clientTop,h=0!==g.clientTop,M=d===g;if(!m)return{};const y={...e,...await Kw(-m.offsetTop-d.clientTop-u.reference.height/2-m.offsetHeight/2-n).fn(e)},N=await Ts(Mx(y,g.scrollHeight+p+d.clientTop),c),w=await Ts(y,{...c,elementContext:"reference"}),x=Ei(0,N.top),b=y.y+x,v=(g.scrollHeight>g.clientHeight?e=>e:Li)(Ei(0,g.scrollHeight+(f&&M||h?2*p:0)-x-Ei(0,N.bottom)));if(g.style.maxHeight=v+"px",g.scrollTop=x,r){const e=g.offsetHeight=-o||w.bottom>=-o;Za.flushSync((()=>r(e)))}return a&&(a.current=await Ts(Mx({...y,y:b},g.offsetHeight+p+d.clientTop),c)),{y:b}}}):null,tx({padding:p,apply({availableWidth:e,availableHeight:t,elements:a}){Object.assign(a.floating.style,{overflow:"auto",maxWidth:`${e}px`,maxHeight:`min(var(--anchor-max-height, 100vh), ${t}px)`})}})].filter(Boolean),whileElementsMounted:Ls}),[x=h,b=M]=w.placement.split("-");var D,v;"selection"===h&&(x="selection");let j=(0,t.useMemo)((()=>({anchor:[x,b].filter(Boolean).join(" ")})),[x,b]),_=function(e,a){const{open:r,elements:n}=e,{enabled:i=!0,overflowRef:s,scrollRef:o,onChange:l}=a,c=nx(l),u=t.useRef(!1),d=t.useRef(null),m=t.useRef(null);t.useEffect((()=>{if(!i)return;function e(e){if(e.ctrlKey||!t||null==s.current)return;const a=e.deltaY,r=s.current.top>=-.5,n=s.current.bottom>=-.5,i=t.scrollHeight-t.clientHeight,o=a<0?-1:1,l=a<0?"max":"min";t.scrollHeight<=t.clientHeight||(!r&&a>0||!n&&a<0?(e.preventDefault(),Za.flushSync((()=>{c((e=>e+Math[l](a,i*o)))}))):/firefox/i.test(function(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:a}=e;return t+"/"+a})).join(" "):navigator.userAgent}())&&(t.scrollTop+=a))}const t=(null==o?void 0:o.current)||n.floating;return r&&t?(t.addEventListener("wheel",e),requestAnimationFrame((()=>{d.current=t.scrollTop,null!=s.current&&(m.current={...s.current})})),()=>{d.current=null,m.current=null,t.removeEventListener("wheel",e)}):void 0}),[i,r,n.floating,s,o,c]);const g=t.useMemo((()=>({onKeyDown(){u.current=!0},onWheel(){u.current=!1},onPointerMove(){u.current=!1},onScroll(){const e=(null==o?void 0:o.current)||n.floating;if(s.current&&e&&u.current){if(null!==d.current){const t=e.scrollTop-d.current;(s.current.bottom<-.5&&t<-1||s.current.top<-.5&&t>1)&&Za.flushSync((()=>c((e=>e+t))))}requestAnimationFrame((()=>{d.current=e.scrollTop}))}}})),[n.floating,c,s,o]);return t.useMemo((()=>i?{floating:g}:{}),[i,g])}(w,{overflowRef:o,onChange:s}),{getReferenceProps:I,getFloatingProps:E}=function(e){void 0===e&&(e=[]);const a=e.map((e=>null==e?void 0:e.reference)),r=e.map((e=>null==e?void 0:e.floating)),n=e.map((e=>null==e?void 0:e.item)),i=t.useCallback((t=>hx(t,e,"reference")),a),s=t.useCallback((t=>hx(t,e,"floating")),r),o=t.useCallback((t=>hx(t,e,"item")),n);return t.useMemo((()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:o})),[i,s,o])}([_]),L=je((e=>{c(e),y.setFloating(e)}));return t.createElement(Nx.Provider,{value:n},t.createElement(yx.Provider,{value:{setFloating:L,setReference:y.setReference,styles:N,getReferenceProps:I,getFloatingProps:E,slot:j}},e))}function xx(e,a,r=void 0){let n=be(),i=je(((e,t)=>{if(null==e)return[r,null];if("number"==typeof e)return[e,null];if("string"==typeof e){if(!t)return[r,null];let a=Dx(e,t);return[a,r=>{let i=bx(e);{let s=i.map((e=>window.getComputedStyle(t).getPropertyValue(e)));n.requestAnimationFrame((function o(){n.nextFrame(o);let l=!1;for(let[e,a]of i.entries()){let r=window.getComputedStyle(t).getPropertyValue(a);if(s[e]!==r){s[e]=r,l=!0;break}}if(!l)return;let c=Dx(e,t);a!==c&&(r(c),a=c)}))}return n.dispose}]}return[r,null]})),s=(0,t.useMemo)((()=>i(e,a)[0]),[e,a]),[o=s,l]=(0,t.useState)();return De((()=>{let[t,r]=i(e,a);if(l(t),r)return r(l)}),[e,a]),o}function bx(e){let t=/var\((.*)\)/.exec(e);if(t){let e=t[1].indexOf(",");if(-1===e)return[t[1]];let a=t[1].slice(0,e).trim(),r=t[1].slice(e+1).trim();return r?[a,...bx(r)]:[a]}return[]}function Dx(e,t){let a=document.createElement("div");t.appendChild(a),a.style.setProperty("margin-top","0px","important"),a.style.setProperty("margin-top",e,"important");let r=parseFloat(window.getComputedStyle(a).marginTop)||0;return t.removeChild(a),r}Nx.displayName="PlacementContext";var vx,jx=((vx=jx||{})[vx.First=0]="First",vx[vx.Previous=1]="Previous",vx[vx.Next=2]="Next",vx[vx.Last=3]="Last",vx[vx.Specific=4]="Specific",vx[vx.Nothing=5]="Nothing",vx);function Ix(e,t){let a=t.resolveItems();if(a.length<=0)return null;let r=t.resolveActiveIndex(),n=null!=r?r:-1;switch(e.focus){case 0:for(let e=0;e=0;--e)if(!t.resolveDisabled(a[e],e,a))return e;return r;case 2:for(let e=n+1;e=0;--e)if(!t.resolveDisabled(a[e],e,a))return e;return r;case 4:for(let r=0;r(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ex||{}),Lx=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(Lx||{}),Tx=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e[e.SetButtonElement=7]="SetButtonElement",e[e.SetItemsElement=8]="SetItemsElement",e))(Tx||{});function Ax(e,t=e=>e){let a=null!==e.activeItemIndex?e.items[e.activeItemIndex]:null,r=ma(t(e.items.slice()),(e=>e.dataRef.current.domRef.current)),n=a?r.indexOf(a):null;return-1===n&&(n=null),{items:r,activeItemIndex:n}}let zx={1:e=>1===e.menuState?e:{...e,activeItemIndex:null,menuState:1},0:e=>0===e.menuState?e:{...e,__demoMode:!1,menuState:0},2:(e,t)=>{var a,r,n,i,s;if(1===e.menuState)return e;let o={...e,searchQuery:"",activationTrigger:null!=(a=t.trigger)?a:1,__demoMode:!1};if(t.focus===jx.Nothing)return{...o,activeItemIndex:null};if(t.focus===jx.Specific)return{...o,activeItemIndex:e.items.findIndex((e=>e.id===t.id))};if(t.focus===jx.Previous){let a=e.activeItemIndex;if(null!==a){let i=e.items[a].dataRef.current.domRef,s=Ix(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});if(null!==s){let t=e.items[s].dataRef.current.domRef;if((null==(r=i.current)?void 0:r.previousElementSibling)===t.current||null===(null==(n=t.current)?void 0:n.previousElementSibling))return{...o,activeItemIndex:s}}}}else if(t.focus===jx.Next){let a=e.activeItemIndex;if(null!==a){let r=e.items[a].dataRef.current.domRef,n=Ix(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});if(null!==n){let t=e.items[n].dataRef.current.domRef;if((null==(i=r.current)?void 0:i.nextElementSibling)===t.current||null===(null==(s=t.current)?void 0:s.nextElementSibling))return{...o,activeItemIndex:n}}}}let l=Ax(e),c=Ix(t,{resolveItems:()=>l.items,resolveActiveIndex:()=>l.activeItemIndex,resolveId:e=>e.id,resolveDisabled:e=>e.dataRef.current.disabled});return{...o,...l,activeItemIndex:c}},3:(e,t)=>{let a=""!==e.searchQuery?0:1,r=e.searchQuery+t.value.toLowerCase(),n=(null!==e.activeItemIndex?e.items.slice(e.activeItemIndex+a).concat(e.items.slice(0,e.activeItemIndex+a)):e.items).find((e=>{var t;return(null==(t=e.dataRef.current.textValue)?void 0:t.startsWith(r))&&!e.dataRef.current.disabled})),i=n?e.items.indexOf(n):-1;return-1===i||i===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:i,activationTrigger:1}},4:e=>""===e.searchQuery?e:{...e,searchQuery:"",searchActiveItemIndex:null},5:(e,t)=>{let a=Ax(e,(e=>[...e,{id:t.id,dataRef:t.dataRef}]));return{...e,...a}},6:(e,t)=>{let a=Ax(e,(e=>{let a=e.findIndex((e=>e.id===t.id));return-1!==a&&e.splice(a,1),e}));return{...e,...a,activationTrigger:1}},7:(e,t)=>e.buttonElement===t.element?e:{...e,buttonElement:t.element},8:(e,t)=>e.itemsElement===t.element?e:{...e,itemsElement:t.element}},kx=(0,t.createContext)(null);function Sx(e){let a=(0,t.useContext)(kx);if(null===a){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Sx),t}return a}function Ox(e,t){return Ze(t.type,zx,e,t)}kx.displayName="MenuContext";let Cx=t.Fragment,Yx=Je.RenderStrategy|Je.Static,Ux=t.Fragment,Qx=rt((function(e,a){let{__demoMode:r=!1,...n}=e,i=(0,t.useReducer)(Ox,{__demoMode:r,menuState:r?0:1,buttonElement:null,itemsElement:null,items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:s,itemsElement:o,buttonElement:l},c]=i,u=Te(a);Ma(0===s,[l,o],((e,t)=>{c({type:1}),oa(t,sa.Loose)||(e.preventDefault(),null==l||l.focus())}));let d=je((()=>{c({type:1})})),m=(0,t.useMemo)((()=>({open:0===s,close:d})),[s,d]),g={ref:u},p=$e();return t.createElement(wx,null,t.createElement(kx.Provider,{value:i},t.createElement(He,{value:Ze(s,{0:Fe.Open,1:Fe.Closed})},p({ourProps:g,theirProps:n,slot:m,defaultTag:Cx,name:"Menu"}))))})),Px=rt((function(e,a){var r;let n=(0,t.useId)(),{id:i=`headlessui-menu-button-${n}`,disabled:s=!1,autoFocus:o=!1,...l}=e,[c,u]=Sx("Menu.Button"),d=(0,t.useContext)(yx).getReferenceProps,m=Te(a,(0,t.useContext)(yx).setReference,je((e=>u({type:7,element:e})))),g=je((e=>{switch(e.key){case ut.Space:case ut.Enter:case ut.ArrowDown:e.preventDefault(),e.stopPropagation(),(0,Za.flushSync)((()=>u({type:0}))),u({type:2,focus:jx.First});break;case ut.ArrowUp:e.preventDefault(),e.stopPropagation(),(0,Za.flushSync)((()=>u({type:0}))),u({type:2,focus:jx.Last})}})),p=je((e=>{e.key===ut.Space&&e.preventDefault()})),f=je((e=>{var t;if(We(e.currentTarget))return e.preventDefault();s||(0===c.menuState?((0,Za.flushSync)((()=>u({type:1}))),null==(t=c.buttonElement)||t.focus({preventScroll:!0})):(e.preventDefault(),u({type:0})))})),{isFocusVisible:h,focusProps:M}=ce({autoFocus:o}),{isHovered:y,hoverProps:N}=fe({isDisabled:s}),{pressed:w,pressProps:x}=_e({disabled:s}),b=(0,t.useMemo)((()=>({open:0===c.menuState,active:w||0===c.menuState,disabled:s,hover:y,focus:h,autofocus:o})),[c,y,h,w,s,o]),D=at(d(),{ref:m,id:i,type:Ie(e,c.buttonElement),"aria-haspopup":"menu","aria-controls":null==(r=c.itemsElement)?void 0:r.id,"aria-expanded":0===c.menuState,disabled:s||void 0,autoFocus:o,onKeyDown:g,onKeyUp:p,onClick:f},M,N,x);return $e()({ourProps:D,theirProps:l,slot:b,defaultTag:"button",name:"Menu.Button"})})),Fx=rt((function(e,a){var r,n;let i=(0,t.useId)(),{id:s=`headlessui-menu-items-${i}`,anchor:o,portal:l=!1,modal:c=!0,transition:u=!1,...d}=e,m=function(e){return(0,t.useMemo)((()=>e?"string"==typeof e?{to:e}:e:null),[e])}(o),[g,p]=Sx("Menu.Items"),[f,h]=function(e=null){!1===e&&(e=null),"string"==typeof e&&(e={to:e});let a=(0,t.useContext)(Nx),r=(0,t.useMemo)((()=>e),[JSON.stringify(e,((e,t)=>{var a;return null!=(a=null==t?void 0:t.outerHTML)?a:t}))]);De((()=>{null==a||a(null!=r?r:null)}),[a,r]);let n=(0,t.useContext)(yx);return(0,t.useMemo)((()=>[n.setFloating,e?n.styles:{}]),[n.setFloating,e,n.styles])}(m),M=function(){let{getFloatingProps:e,slot:a}=(0,t.useContext)(yx);return(0,t.useCallback)(((...t)=>Object.assign({},e(...t),{"data-anchor":a.anchor})),[e,a])}(),[y,N]=(0,t.useState)(null),w=Te(a,m?f:null,je((e=>p({type:8,element:e}))),N),x=ya(g.itemsElement);m&&(l=!0);let b=Re(),[D,v]=Ce(u,y,null!==b?(b&Fe.Open)===Fe.Open:0===g.menuState);qt(D,g.buttonElement,(()=>{p({type:1})})),Ia(!g.__demoMode&&c&&0===g.menuState,x),Jt(!g.__demoMode&&c&&0===g.menuState,{allowed:(0,t.useCallback)((()=>[g.buttonElement,g.itemsElement]),[g.buttonElement,g.itemsElement])});let j=!function(e,a){let r=(0,t.useRef)({left:0,top:0});if(De((()=>{if(!a)return;let e=a.getBoundingClientRect();e&&(r.current=e)}),[e,a]),null==a||!e||a===document.activeElement)return!1;let n=a.getBoundingClientRect();return n.top!==r.current.top||n.left!==r.current.left}(0!==g.menuState,g.buttonElement)&&D;(0,t.useEffect)((()=>{let e=g.itemsElement;e&&0===g.menuState&&e!==(null==x?void 0:x.activeElement)&&e.focus({preventScroll:!0})}),[g.menuState,g.itemsElement,x]),function(e,{container:a,accept:r,walk:n}){let i=(0,t.useRef)(r),s=(0,t.useRef)(n);(0,t.useEffect)((()=>{i.current=r,s.current=n}),[r,n]),De((()=>{if(!a||!e)return;let t=Ne(a);if(!t)return;let r=i.current,n=s.current,o=Object.assign((e=>r(e)),{acceptNode:r}),l=t.createTreeWalker(a,NodeFilter.SHOW_ELEMENT,o,!1);for(;l.nextNode();)n(l.currentNode)}),[a,e,i,s])}(0===g.menuState,{container:g.itemsElement,accept:e=>"menuitem"===e.getAttribute("role")?NodeFilter.FILTER_REJECT:e.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT,walk(e){e.setAttribute("role","none")}});let _=be(),I=je((e=>{var t,a,r;switch(_.dispose(),e.key){case ut.Space:if(""!==g.searchQuery)return e.preventDefault(),e.stopPropagation(),p({type:3,value:e.key});case ut.Enter:if(e.preventDefault(),e.stopPropagation(),p({type:1}),null!==g.activeItemIndex){let{dataRef:e}=g.items[g.activeItemIndex];null==(a=null==(t=e.current)?void 0:t.domRef.current)||a.click()}la(g.buttonElement);break;case ut.ArrowDown:return e.preventDefault(),e.stopPropagation(),p({type:2,focus:jx.Next});case ut.ArrowUp:return e.preventDefault(),e.stopPropagation(),p({type:2,focus:jx.Previous});case ut.Home:case ut.PageUp:return e.preventDefault(),e.stopPropagation(),p({type:2,focus:jx.First});case ut.End:case ut.PageDown:return e.preventDefault(),e.stopPropagation(),p({type:2,focus:jx.Last});case ut.Escape:e.preventDefault(),e.stopPropagation(),(0,Za.flushSync)((()=>p({type:1}))),null==(r=g.buttonElement)||r.focus({preventScroll:!0});break;case ut.Tab:e.preventDefault(),e.stopPropagation(),(0,Za.flushSync)((()=>p({type:1}))),function(e,t){ga(ia(),t,{relativeTo:e})}(g.buttonElement,e.shiftKey?aa.Previous:aa.Next);break;default:1===e.key.length&&(p({type:3,value:e.key}),_.setTimeout((()=>p({type:4})),350))}})),E=je((e=>{e.key===ut.Space&&e.preventDefault()})),L=(0,t.useMemo)((()=>({open:0===g.menuState})),[g.menuState]),T=at(m?M():{},{"aria-activedescendant":null===g.activeItemIndex||null==(r=g.items[g.activeItemIndex])?void 0:r.id,"aria-labelledby":null==(n=g.buttonElement)?void 0:n.id,id:s,onKeyDown:I,onKeyUp:E,role:"menu",tabIndex:0===g.menuState?0:void 0,ref:w,style:{...d.style,...h,"--button-width":Bw(g.buttonElement,!0).width},...Oe(v)}),A=$e();return t.createElement(er,{enabled:!!l&&(e.static||D)},A({ourProps:T,theirProps:d,slot:L,defaultTag:"div",features:Yx,visible:j,name:"Menu.Items"}))})),Rx=rt((function(e,a){let r=(0,t.useId)(),{id:n=`headlessui-menu-item-${r}`,disabled:i=!1,...s}=e,[o,l]=Sx("Menu.Item"),c=null!==o.activeItemIndex&&o.items[o.activeItemIndex].id===n,u=(0,t.useRef)(null),d=Te(a,u);De((()=>{if(!o.__demoMode&&0===o.menuState&&c&&0!==o.activationTrigger)return xe().requestAnimationFrame((()=>{var e,t;null==(t=null==(e=u.current)?void 0:e.scrollIntoView)||t.call(e,{block:"nearest"})}))}),[o.__demoMode,u,c,o.menuState,o.activationTrigger,o.activeItemIndex]);let m=function(e){let a=(0,t.useRef)(""),r=(0,t.useRef)("");return je((()=>{let t=e.current;if(!t)return"";let n=t.innerText;if(a.current===n)return r.current;let i=function(e){let t=e.getAttribute("aria-label");if("string"==typeof t)return t.trim();let a=e.getAttribute("aria-labelledby");if(a){let e=a.split(" ").map((e=>{let t=document.getElementById(e);if(t){let e=t.getAttribute("aria-label");return"string"==typeof e?e.trim():Zw(t).trim()}return null})).filter(Boolean);if(e.length>0)return e.join(", ")}return Zw(e).trim()}(t).trim().toLowerCase();return a.current=n,r.current=i,i}))}(u),g=(0,t.useRef)({disabled:i,domRef:u,get textValue(){return m()}});De((()=>{g.current.disabled=i}),[g,i]),De((()=>(l({type:5,id:n,dataRef:g}),()=>l({type:6,id:n}))),[g,n]);let p=je((()=>{l({type:1})})),f=je((e=>{if(i)return e.preventDefault();l({type:1}),la(o.buttonElement)})),h=je((()=>{if(i)return l({type:2,focus:jx.Nothing});l({type:2,focus:jx.Specific,id:n})})),M=function(){let e=(0,t.useRef)([-1,-1]);return{wasMoved(t){let a=Vw(t);return(e.current[0]!==a[0]||e.current[1]!==a[1])&&(e.current=a,!0)},update(t){e.current=Vw(t)}}}(),y=je((e=>{M.update(e),!i&&(c||l({type:2,focus:jx.Specific,id:n,trigger:0}))})),N=je((e=>{M.wasMoved(e)&&(i||c||l({type:2,focus:jx.Specific,id:n,trigger:0}))})),w=je((e=>{M.wasMoved(e)&&(i||c&&l({type:2,focus:jx.Nothing}))})),[x,b]=UM(),[D,v]=Sa(),j=(0,t.useMemo)((()=>({active:c,focus:c,disabled:i,close:p})),[c,i,p]),_={id:n,ref:d,role:"menuitem",tabIndex:!0===i?void 0:-1,"aria-disabled":!0===i||void 0,"aria-labelledby":x,"aria-describedby":D,disabled:void 0,onClick:f,onFocus:h,onPointerEnter:y,onMouseEnter:y,onPointerMove:N,onMouseMove:N,onPointerLeave:w,onMouseLeave:w},I=$e();return t.createElement(b,null,t.createElement(v,null,I({ourProps:_,theirProps:s,slot:j,defaultTag:Ux,name:"Menu.Item"})))})),Hx=rt((function(e,a){let[r,n]=UM(),i=e,s={ref:a,"aria-labelledby":r,role:"group"},o=$e();return t.createElement(n,null,o({ourProps:s,theirProps:i,slot:{},defaultTag:"div",name:"Menu.Section"}))})),Bx=rt((function(e,a){let r=(0,t.useId)(),{id:n=`headlessui-menu-heading-${r}`,...i}=e,s=CM();De((()=>s.register(n)),[n,s.register]);let o={id:n,ref:a,role:"presentation",...s.props};return $e()({ourProps:o,theirProps:i,slot:{},defaultTag:"header",name:"Menu.Heading"})})),Wx=rt((function(e,t){let a=e,r={ref:t,role:"separator"};return $e()({ourProps:r,theirProps:a,slot:{},defaultTag:"div",name:"Menu.Separator"})})),Zx=Object.assign(Qx,{Button:Px,Items:Fx,Item:Rx,Section:Hx,Heading:Bx,Separator:Wx});function Vx({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"}))}const Gx=t.forwardRef(Vx),Xx=function(){const[{active_flows_count:a,trash_flows_count:r,draft_flows_count:n},i]=l(),s=(0,f.useHistory)(),o=new URLSearchParams((0,f.useLocation)().search);let c=o.get("post_status");const u=o.get("paged"),d=o.get("s"),m=o.get("mode");let g="",p="";o.has("mode")&&o.delete("mode"),c||(c="active_flow"),u&&(g="&paged="+u),d&&(p="&s="+d);const h=function(){i({type:"SET_FLOWS",flows:null})};return(0,e.createElement)("div",{className:"wcf-flows-sub-header bg-white p-5 rounded-t-xl"},(0,e.createElement)("div",{className:"wcf-flows-sub-header__content-right flex justify-between gap-2"},(0,e.createElement)("div",{className:"wcf-flows-sub-header__search md:w-1/5 w-2/5"},(0,e.createElement)("form",{className:"wcf-search__form relative"},(0,e.createElement)(_r,{label:"",placeholder:(0,z.__)("Search Funnels","cartflows"),tooltip:"",class:"input-field !leading-none !pl-10 !px-4 !py-3 text-sm font-normal !rounded-md text-gray-400 !border-gray-200 focus:ring focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none text-ellipsis",id:"wcf-funnel-search-input",inputvalue:"",handleChange:"",desc:"",onChangeCB:function(){const e=document.getElementById("wcf-funnel-search-input").value;0!==e.length&&e.length<3||(0===e.length?s.push(`admin.php?page=cartflows&path=flows${g}`):s.push(`admin.php?page=cartflows&path=flows&s=${e}`),i({type:"SET_FLOWS",flows:null}))}}),(0,e.createElement)("button",{className:"absolute p-2 top-1/2 -translate-y-1/2 left-1 bg-transparent text-gray-400 cursor-pointer hover:text-primary-500 m-0"},(0,e.createElement)(DN,{className:"w-18 h-18 stroke-2"})))),(0,e.createElement)("span",{className:"wcf-flows-sub-header__date_filter flex gap-2 md:gap-4 justify-end items-center"},(0,e.createElement)(cM,{classNames:"wcf-custom-filter-input date-picker-field !w-full !h-full !pl-4 !px-4 !py-3 md:!pr-7 !pr-8 text-sm font-normal text-gray-400 !rounded-md !border-gray-200 focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none !text-ellipsis",sectionClass:"",wrapperClass:"",fieldParentWrapperClass:"",value:{endDate:null,startDate:null},onChangeCB:function(e){if(null===e.startDate)s.push(`admin.php?page=cartflows&path=flows${g}`);else{const t=e.startDate.toISOString(),a=e.endDate.toISOString();s.push(`admin.php?page=cartflows&path=flows${p}${g}&filter=date&from=${t}&to=${a}`)}i({type:"SET_FLOWS",flows:null})},placeholder:(0,z.__)("Filter Funnels by Date","cartflows")}),(0,e.createElement)("span",{className:"divider w-px bg-gray-200 h-full"}),(0,e.createElement)(Zx,{as:"div",className:"wcf-flow-row__actions-menu relative inline-block text-left"},(0,e.createElement)("div",null,(0,e.createElement)(Px,{className:"inline-flex w-full md:px-3 px-2 py-2 text-sm font-semibold text-gray-400 bg-gray-50 rounded-md"},(0,e.createElement)(Gx,{className:"h-5 w-5","aria-hidden":"true"}))),(0,e.createElement)(Pt,{as:t.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95"},(0,e.createElement)(Zx.Items,{className:"wcf-actions-menu__dropdown_menu absolute right-0 z-10 mt-2 w-56 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"},(({})=>(0,e.createElement)("div",{className:"py-1 "},(0,e.createElement)("div",{className:"py-2 px-4 font-medium bg-gray-50 text-xs"},(0,z.__)("Status","cartflows")),(0,e.createElement)(Zx.Item,null,(0,e.createElement)(I,{key:"published_flows",to:{pathname:"admin.php",search:"?page=cartflows&path=flows"},onClick:h,className:"wcf-flow-export px-4 py-2 text-gray-700 text-sm flex gap-1.5 hover:bg-primary-25 hover:text-primary-500"},(0,e.createElement)(ty,{checked:"active_flow"===c?"checked":""}),(0,e.createElement)("span",{className:"wcf-flow-row__btn-text"},(0,z.__)("Publish ","cartflows"),"(",a,")"))),(0,e.createElement)(Zx.Item,null,(0,e.createElement)(I,{key:"draft_flows",to:{pathname:"admin.php",search:"?page=cartflows&path=flows&post_status=draft"},onClick:h,className:"wcf-flow-export px-4 py-2 text-gray-700 text-sm flex gap-1.5 hover:bg-primary-25 hover:text-primary-500"},(0,e.createElement)(ty,{checked:"draft"===c?"checked":""}),(0,e.createElement)("span",{className:"wcf-flow-row__btn-text"},(0,z.__)("Draft ","cartflows"),"(",n,")"))),(0,e.createElement)(Zx.Item,null,(0,e.createElement)(I,{key:"trash_flows",to:{pathname:"admin.php",search:"?page=cartflows&path=flows&post_status=trash"},onClick:h,className:"wcf-flow-export px-4 py-2 text-gray-700 text-sm flex gap-1.5 hover:bg-primary-25 hover:text-primary-500"},(0,e.createElement)(ty,{checked:"trash"===c?"checked":""}),(0,e.createElement)("span",{className:"wcf-flow-row__btn-text"},(0,z.__)("Trash ","cartflows"),"(",r,")"))),(0,e.createElement)("div",{className:"py-2 px-4 font-medium bg-gray-50 text-xs"},(0,z.__)("Mode","cartflows")),(0,e.createElement)(Zx.Item,null,(0,e.createElement)(I,{key:"Live",to:{pathname:"admin.php",search:`${o}`},onClick:h,className:"wcf-flow-export px-4 py-2 text-gray-700 text-sm flex gap-1.5 hover:bg-primary-25 hover:text-primary-500"},(0,e.createElement)(ty,{checked:null===m?"checked":""}),(0,e.createElement)("span",{className:"wcf-flow-row__btn-text"},(0,z.__)("All","cartflows")))),(0,e.createElement)(Zx.Item,null,(0,e.createElement)(I,{key:"Live",to:{pathname:"admin.php",search:`${o}&mode=live`},onClick:h,className:"wcf-flow-export px-4 py-2 text-gray-700 text-sm flex gap-1.5 hover:bg-primary-25 hover:text-primary-500"},(0,e.createElement)(ty,{checked:"live"===m?"checked":""}),(0,e.createElement)("span",{className:"wcf-flow-row__btn-text"},(0,z.__)("Live","cartflows")))),(0,e.createElement)(Zx.Item,null,(0,e.createElement)(I,{key:"sandbox",to:{pathname:"admin.php",search:`${o}&mode=sandbox`},onClick:h,className:"wcf-flow-export px-4 py-2 text-gray-700 text-sm flex gap-1.5 hover:bg-primary-25 hover:text-primary-500"},(0,e.createElement)(ty,{checked:"sandbox"===m?"checked":""}),(0,e.createElement)("span",{className:"wcf-flow-row__btn-text"},(0,z.__)("SandBox","cartflows")))),(0,e.createElement)(Zx.Item,null,(0,e.createElement)(I,{key:"Reset",to:{pathname:"admin.php",search:"?page=cartflows&path=flows"},onClick:h,className:"wcf-flow-export px-4 py-2 text-gray-700 text-sm flex gap-1.5 hover:bg-primary-25 hover:text-primary-500 border-t-2 border-t-gray-100"},(0,e.createElement)("span",{className:"wcf-flow-row__btn-text text-primary-500 "},(0,z.__)("Reset Filters","cartflows"))))))))))))},Jx=function(a){const{bulk_actions:r,selected_flows:n}=a,[{},i]=l(),[s,o]=(0,t.useState)(!1);let c=new URLSearchParams((0,f.useLocation)().search).get("paged");c||(c=1);const u=Iy(),d=async function(e){e.preventDefault();const t=e.target.getAttribute("data-action"),r=document.getElementsByName("wcf-flow[]");let n="",s="";const l=[];for(const e of r)"checkbox"===e.type&&!0===e.checked&&l.push(e.getAttribute("id"));if(0===l.length||"-1"===t)return;if(!await u({title:(0,z.sprintf)(
// translators: %s: action name.
// translators: %s: action name.
(0,z.__)("%s This Flow","cartflows"),t.replace("_"," ")),description:(0,z.sprintf)(
// translators: %s: action status name.
// translators: %s: action status name.
(0,z.__)("Do you want to %s this flow? Are you sure?","cartflows"),t.replace("_"," ")),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")}))return;const c=new window.FormData;switch(o(!0),t){case"trash":n="cartflows_trash_flows_in_bulk",s=cartflows_admin.trash_flows_in_bulk_nonce,c.append("new_status","trash");break;case"restore":case"publish":n="cartflows_update_flow_post_status",s=cartflows_admin.update_flow_post_status_nonce,c.append("new_status","publish");break;case"delete_permanently":n="cartflows_delete_flows_permanently",s=cartflows_admin.delete_flows_permanently_nonce;break;case"draft":n="cartflows_update_flow_post_status",s=cartflows_admin.update_flow_post_status_nonce,c.append("new_status","draft");break;case"export":n="cartflows_export_flows_in_bulk",s=cartflows_admin.export_flows_in_bulk_nonce}c.append("action",n),c.append("security",s),c.append("flow_ids",[l]),A()({url:cartflows_admin.ajax_url,method:"POST",body:c}).then((e=>{if("export"===t&&e.success){const t=new Date,a="cartflows-flows-export-"+t.getDate()+"-"+(t.getMonth()+1)+"-"+t.getFullYear()+".json",r=JSON.stringify(e.data.flows),n=new Blob([r],{type:"application/json"});if(document.documentMode)window.navigator.msSaveOrOpenBlob(n,a);else{const e=document.createElement("a");e.href=URL.createObjectURL(n),e.download=a,e.click()}}o(!1),a.selectedFlowsCall(0),i({type:"SET_FLOWS",flows:null})}))};return(0,e.createElement)(Pt,{as:"div",enter:"transition ease-in duration-1000",enterFrom:"transform opacity-0 scale-100",enterTo:"transform opacity-100 scale-100",leave:"transition ease-out duration-1000",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-100",show:!0},(0,e.createElement)("div",{className:"wcf-flows--bulk-action bg-primary-25 p-4 sm:p-6 flex flex-col sm:flex-row sm:justify-between gap-4 border-b border-primary-200"},(0,e.createElement)("div",{className:"wcf-flows-action-buttons flex flex-wrap gap-3 sm:gap-5 cursor-pointer"},r.map((t=>(0,e.createElement)("a",{key:t.label,className:`wcf-flows--bulk-action-btn wcf-flows--bulk-action__${t.value} flex gap-1.5 text-primary-500 hover:text-primary-600`,onClick:d,"data-action":t.value},t.icon,(0,e.createElement)("span",{"data-action":t.value},t.label)))),(0,e.createElement)("span",{className:"divider w-px bg-gray-200"}),(0,e.createElement)("a",{className:"wcf-flows--bulk-action-btn wcf-flows--bulk-action__cancel flex text-primary-500 hover:text-primary-600",onClick:a.closeCallback},(0,z.__)("Cancel","cartflows"))),(0,e.createElement)("div",{className:"wcf-total-flows-found flex flex-col sm:flex-row sm:justify-between gap-2 sm:gap-4"},n," ",(0,z.__)("items selected","cartflows"),s&&(0,e.createElement)("div",{className:"wcf-action flex gap-6"},(0,e.createElement)("div",{className:"flex"},(0,e.createElement)("div",{className:"relative"},(0,e.createElement)("div",{className:"w-18 h-18 rounded-full absolute border-2 border-solid border-primary-200"}),(0,e.createElement)("div",{className:"w-18 h-18 rounded-full animate-spin absolute border-2 border-solid border-primary-500 border-t-transparent"}))),(0,z.__)("Applying changes…","cartflows")))))},qx=window.moment;var $x=n.n(qx),Kx=n(4601);function eb({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14"}))}const tb=t.forwardRef(eb);function ab({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"}))}const rb=t.forwardRef(ab);function nb({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 15 6-6m0 0-6-6m6 6H9a6 6 0 0 0 0 12h3"}))}const ib=t.forwardRef(nb);function sb({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"}))}const ob=t.forwardRef(sb);function lb({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))}const cb=t.forwardRef(lb),ub=function({flow:a,selected_flows:r,openCallback:n}){const i=a.ID,s=a.post_title,o=a.actions,c="Publish"===a.post_status?(0,z.__)(" Published ","cartflows"):a.post_status,u=a.post_modified_gmt,d=a.flow_test_mode,m=void 0!==a.revenue?a.revenue:cartflows_admin.woo_currency+"0",[{active_flows_count:g},p]=l(),h=new URLSearchParams((0,f.useLocation)().search).get("post_status"),M=Iy(),N=async e=>{if(e.preventDefault(),!wcfCartflowsPro()&&g>=3)return null;if(!await M({title:(0,z.__)("Duplicate Funnel","cartflows"),description:(0,z.__)("Do you really want to duplicate this funnel?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")}))return;const t=new window.FormData;t.append("action","cartflows_clone_flow"),t.append("security",cartflows_admin.clone_flow_nonce),t.append("id",i),window.wcfAction="cloneFlow",(0,Kx.$h)(A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{p({type:"SET_FLOWS",flows:null})})))},w=async e=>{if(console.log("***** Delete Flow *****"),e.preventDefault(),!await M({title:(0,z.__)("Trash Funnel","cartflows"),description:(0,z.__)("Do you really want to trash this funnel?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")}))return;const t=new window.FormData;t.append("action","cartflows_delete_flow"),t.append("security",cartflows_admin.delete_flow_nonce),t.append("flow_id",i),window.wcfAction="deleteFlow",(0,Kx.$h)(A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{p({type:"SET_FLOWS",flows:null})})))},x=e=>{console.log("***** Export Flow *****"),e.preventDefault();const t=new window.FormData;t.append("action","cartflows_export_flow"),t.append("security",cartflows_admin.export_flow_nonce),t.append("flow_id",i),window.wcfAction="exportFlow",(0,Kx.$h)(A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{if(e.success){const t=e.data.flow_name||`flow-${i}.json`,a=JSON.stringify(e.data.flows),r=new Blob([a],{type:"application/json"});if(document.documentMode)window.navigator.msSaveOrOpenBlob(r,t);else{const e=document.createElement("a");e.href=URL.createObjectURL(r),e.download=t,e.click()}}})))},b=async e=>{if(e.preventDefault(),!await M({title:(0,z.__)("Trash Funnel","cartflows"),description:(0,z.__)("Do you really want to trash this Funnel?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")}))return;const t=new window.FormData;t.append("action","cartflows_trash_flow"),t.append("security",cartflows_admin.trash_flow_nonce),t.append("flow_id",i),window.wcfAction="deleteFlow",(0,Kx.$h)(A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{e.success&&p({type:"SET_FLOWS",flows:null})})))},D=async e=>{if(console.log("***** Restore Flow *****"),e.preventDefault(),!await M({title:(0,z.__)("Restore Funnel","cartflows"),description:(0,z.__)("Do you really want to restore this funnel?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")}))return;const t=new window.FormData;t.append("action","cartflows_restore_flow"),t.append("security",cartflows_admin.restore_flow_nonce),t.append("flow_id",i),window.wcfAction="restoreFlow",(0,Kx.$h)(A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{e.success&&p({type:"SET_FLOWS",flows:null})})))},v=function(){const e=new window.FormData;e.append("new_status","publish"),e.append("action","cartflows_update_flow_post_status"),e.append("security",cartflows_admin.update_flow_post_status_nonce),e.append("flow_ids",[i]),A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((()=>{p({type:"SET_FLOWS",flows:null})}))};let j=!1;return 0!==r&&(j=r.includes(i.toString())),(0,e.createElement)("tr",{key:i},(0,e.createElement)("td",{className:"whitespace-nowrap py-7 pl-4 pr-3 text-sm font-medium text-gray-900 sm:pl-6"},(0,e.createElement)(Dr,{class:"wcf-flow_row__checkbox",name:"wcf-flow[]",id:i,value:j?"yes":"no",onClick:e=>{n(e)}})),(0,e.createElement)("td",{className:"whitespace-nowrap px-3 py-7"},(0,e.createElement)("a",{className:"wcf-flow-row__link text-sm text-gray-800 hover:text-primary-500",href:o?.edit.link,title:s},(0,e.createElement)("span",{className:"block text-xs sm:text-sm font-semibold"},function(){let t=hr(s,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length);return""===s&&(t=(0,z.__)("(no title)","cartflows")),"Draft"===c&&(t=(0,e.createElement)("span",{className:"wcf-draft-flow-title"},(0,e.createElement)("span",{className:"flex"},t,(0,e.createElement)(tb,{className:"h-5 w-5"}),(0,e.createElement)("span",{className:"wcf-draft-flow-status"},(0,z.__)("Draft","cartflows"))))),t}()),(0,e.createElement)("span",{className:"block text-sm sm:text-sm font-normal text-gray-400",title:(0,z.sprintf)(/* translators: %s date */ /* translators: %s date */
(0,z.__)("Last Modified: %s","cartflows"),u)},(0,z.__)("Updated ","cartflows"),$x().utc(u).local().startOf("seconds").fromNow()))),(0,e.createElement)("td",{className:"whitespace-nowrap text-center px-3 py-7"},(0,e.createElement)("span",{className:br()("wcf-badge text-xs sm:text-sm",d?"wcf-badge--warning":"wcf-badge--success")},d?(0,z.__)("Sandbox","cartflows"):(0,z.__)("Live","cartflows"))),(0,e.createElement)("td",{className:"whitespace-nowrap text-base text-center px-3 py-7"},"active"===cartflows_admin.woocommerce_status&&m?(0,e.createElement)("span",{className:"text-xs sm:text-sm"},wr(m)):(0,e.createElement)(MM,{text:(0,z.__)("WooCommerce Required to display the revenue.","cartflows"),icon:(0,e.createElement)(rb,{className:"w-18 h-18 stroke-2 text-red-400 hover:text-red-600","aria-hidden":"true"})})),(0,e.createElement)("td",{className:"whitespace-nowrap px-3 py-7 pr-4 sm:pr-6 text-sm text-gray-400"},(0,e.createElement)("div",{className:"wcf-flow-row__action-btns flex relative"},(0,e.createElement)("div",{className:"wcf-flow-row__basic-action-btns flex"},"trash"!==h&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("a",(0,y.A)({href:o?.view.link},o?.view.attr,{className:"wcf-flow-view wcf-flow-row__action-btn px-3 py-2 cursor-pointer group"}),(0,e.createElement)(MM,{text:(0,z.__)("View Funnel","cartflows"),icon:(0,e.createElement)(bw,{className:"w-18 h-18 stroke-1 group-hover:text-primary-500","aria-hidden":"true"})})),(0,e.createElement)("a",{href:o?.edit.link,className:"wcf-flow-edit wcf-flow-row__action-btn px-3 py-2 cursor-pointer group"},(0,e.createElement)(MM,{text:(0,z.__)("Edit Funnel","cartflows"),icon:(0,e.createElement)(by,{className:"w-18 h-18 stroke-1 group-hover:text-primary-500","aria-hidden":"true"})}))),"trash"===h&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("a",{className:"wcf-flow-view wcf-flow-row__action-btn px-3 py-2 cursor-pointer group",title:(0,z.__)("Restore","cartflows"),onClick:D},(0,e.createElement)(MM,{text:(0,z.__)("Restore Flow","cartflows"),icon:(0,e.createElement)(ib,{className:"w-18 h-18 stroke-1 group-hover:text-primary-500","aria-hidden":"true"})})),(0,e.createElement)("a",{className:"wcf-flow-view wcf-flow-row__action-btn px-3 py-2 cursor-pointer group",title:(0,z.__)("Delete","cartflows"),onClick:w},(0,e.createElement)(MM,{text:(0,z.__)("Delete Flow","cartflows"),icon:(0,e.createElement)(Zl,{className:"w-18 h-18 stroke-1 group-hover:text-primary-500","aria-hidden":"true"})})))),"trash"!==h&&(0,e.createElement)(Zx,{as:"div",id:`flow_more_options_${i}`,className:"wcf-flow-row__actions-menu relative inline-block text-left"},(0,e.createElement)("div",null,(0,e.createElement)(Zx.Button,{className:"inline-flex w-full px-3 py-2 text-sm font-semibold cursor-pointer group"},(0,e.createElement)(MM,{text:(0,z.__)("More Options","cartflows"),icon:(0,e.createElement)(Rl,{className:"-mr-1 h-5 w-5 group-hover:text-primary-500","aria-hidden":"true"})}))),(0,e.createElement)(Pt,{as:t.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95"},(0,e.createElement)(Zx.Items,{className:"wcf-actions-menu__dropdown_menu absolute right-0 z-10 mt-2 w-56 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"},(({})=>(0,e.createElement)("div",{className:"py-1"},("draft"===h||"Draft"===c)&&(0,e.createElement)(Zx.Item,null,(0,e.createElement)("a",{href:"#",className:"wcf-flow-publish px-4 py-2 text-gray-600 text-sm flex gap-1.5 hover:bg-primary-25 hover:text-primary-500",title:(0,z.__)("Publish","cartflows"),onClick:v},(0,e.createElement)(Qy,{className:"h-5 w-5"}),(0,e.createElement)("span",{className:"wcf-flow-row__btn-text"},(0,z.__)("Publish","cartflows")))),(0,e.createElement)(Zx.Item,null,(0,e.createElement)("a",{href:"#",className:"wcf-flow-clone px-4 py-2 text-gray-600 text-sm flex gap-1.5 hover:bg-primary-25 hover:text-primary-500",title:wcfCartflowsPro()||g<3?(0,z.__)("Duplicate Funnel","cartflows"):(0,z.__)("Upgrade to Pro for this feature.","cartflows"),"data-id":i,onClick:N,style:wcfCartflowsPro()||g<3?{}:{cursor:"not-allowed",opacity:" 0.65"}},(0,e.createElement)(ob,{className:"h-5 w-5"}),(0,e.createElement)("span",{className:"wcf-flow-row__btn-text"},wcfCartflowsPro()||g<3?(0,z.__)("Duplicate","cartflows"):(0,z.__)("Duplicate (Pro)","cartflows")))),(0,e.createElement)(Zx.Item,null,(0,e.createElement)("a",{href:"#",className:"wcf-flow-export px-4 py-2 text-gray-600 text-sm flex gap-1.5 hover:bg-primary-25 hover:text-primary-500",title:(0,z.__)("Export Flow","cartflows"),"data-id":i,onClick:x},(0,e.createElement)(cb,{className:"h-5 w-5"}),(0,e.createElement)("span",{className:"wcf-flow-row__btn-text"},(0,z.__)("Export","cartflows")))),"trash"!==h?(0,e.createElement)(Zx.Item,null,(0,e.createElement)("a",{href:"#",className:"wcf-flow-trash px-4 py-2 text-gray-600 text-sm flex gap-1.5 hover:bg-primary-25 hover:text-primary-500",title:(0,z.__)("Trash Flow","cartflows"),onClick:b},(0,e.createElement)(Zl,{className:"h-5 w-5"}),(0,e.createElement)("span",{className:"wcf-flow-row__btn-text"},(0,z.__)("Trash","cartflows")))):(0,e.createElement)(Zx.Item,null,(0,e.createElement)("a",{href:"#",className:"wcf-flow-restore px-4 py-2 text-gray-600 text-sm flex gap-1.5 hover:bg-primary-25 hover:text-primary-500",title:(0,z.__)("Restore Flow","cartflows"),onClick:D},(0,e.createElement)(ib,{className:"h-5 w-5"}),(0,e.createElement)("span",{className:"wcf-flow-row__btn-text"},(0,z.__)("Restore","cartflows")))),"trash"===h&&(0,e.createElement)(Zx.Item,null,(0,e.createElement)("a",{href:"#",className:"wcf-flow-delete px-4 py-2 text-gray-600 text-sm flex gap-1.5 hover:bg-primary-25 hover:text-primary-500",title:(0,z.__)("Delete Flow","cartflows"),onClick:w},(0,e.createElement)(Zl,{className:"h-5 w-5"}),(0,e.createElement)("span",{className:"wcf-flow-row__btn-text"},(0,z.__)("Delete","cartflows"))))))))))))},db=function(){return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("table",{className:"min-w-full border-b border-gray-200 animate-pulse"},(0,e.createElement)("thead",{className:"bg-gray-50"},(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"col",className:"w-16 py-3.5 pl-4 pr-3 text-left sm:pl-6"},(0,e.createElement)("input",{type:"checkbox",className:"wcf-select-all__flows !h-5 !w-5 !rounded !border-gray-300 !text-primary-600 focus:!ring-primary-600 !shadow-none before:!content-none !outline-none"})),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-left text-base font-medium text-gray-800"},(0,z.__)("Name","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-center text-base font-medium text-gray-800"},(0,z.__)("Status","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-center text-base font-medium text-gray-800"},(0,z.__)("Sales","cartflows")),(0,e.createElement)("th",{scope:"col",className:"w-36 px-3 py-3.5 pr-4 sm:pr-6 text-left text-base font-medium text-gray-800"}," "))),(0,e.createElement)("tbody",{className:"divide-y divide-gray-200 bg-white"},Array(9).fill().map(((t,a)=>(0,e.createElement)("tr",{key:a},(0,e.createElement)("td",{className:"whitespace-nowrap py-7 pl-4 pr-3 sm:pl-6 text-center"},(0,e.createElement)("div",{className:"h-5 w-5 bg-gray-200 rounded-md"})),(0,e.createElement)("td",{className:"whitespace-nowrap px-3 py-7"},(0,e.createElement)("div",{className:"h-5 w-full bg-gray-200 rounded-md"})),(0,e.createElement)("td",{className:"whitespace-nowrap px-3 py-7"},(0,e.createElement)("div",{className:"h-5 w-4/6 bg-gray-200 rounded-md mx-auto"})),(0,e.createElement)("td",{className:"whitespace-nowrap px-3 py-7"},(0,e.createElement)("div",{className:"h-5 w-3/6 bg-gray-200 rounded-md mx-auto"})),(0,e.createElement)("td",{className:"whitespace-nowrap px-3 py-7 pr-4 sm:pr-6"},(0,e.createElement)("div",{className:"h-5 w-full bg-gray-200 rounded-md mx-auto"}))))))))};function mb({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))}const gb=t.forwardRef(mb),pb=function(){const[{flows_data:a,active_flows_count:r,draft_flows_count:n,trash_flows_count:i,flows_pagination:s},o]=l(),c=new URLSearchParams((0,f.useLocation)().search);let u=c.get("paged"),d=0;const m=c.get("post_status"),p=c.get("s"),h=c.get("filter"),M=c.get("mode"),[y,N]=(0,t.useState)(!1),[w,x]=(0,t.useState)(0),[b,D]=(0,t.useState)(!1),[v,j]=(0,t.useState)("hide"),[_,E]=(0,t.useState)(""),[{page_builder:L}]=g();let T=!0;(a||y)&&(T=!1),u||(u=1);const k=[{value:"draft",label:(0,z.__)("Draft","cartflows"),icon:(0,e.createElement)(My,{className:"w-18 h-18 stroke-2","data-action":"draft"})},{value:"trash",label:(0,z.__)("Trash","cartflows"),icon:(0,e.createElement)(Zl,{className:"w-18 h-18 stroke-2","data-action":"trash"})},{value:"export",label:(0,z.__)("Export","cartflows"),icon:(0,e.createElement)(Rw,{className:"w-18 h-18 stroke-2","data-action":"export"})}],S=[{value:"restore",label:(0,z.__)("Restore","cartflows"),icon:(0,e.createElement)(ib,{className:"w-18 h-18 stroke-2","data-action":"restore"})},{value:"delete_permanently",label:(0,z.__)("Delete","cartflows"),icon:(0,e.createElement)(Zl,{className:"w-18 h-18 stroke-2","data-action":"delete_permanently"})}],O=[{value:"export",label:(0,z.__)("Export","cartflows"),icon:(0,e.createElement)(Rw,{className:"w-18 h-18 stroke-2","data-action":"export"})},{value:"trash",label:(0,z.__)("Move to Trash","cartflows"),icon:(0,e.createElement)(Zl,{className:"w-18 h-18 stroke-2","data-action":"trash"})},{value:"delete_permanently",label:(0,z.__)("Delete","cartflows"),icon:(0,e.createElement)(Zl,{className:"w-18 h-18 stroke-2","data-action":"delete_permanently"})}];let C=[];"Publish"===m||null===m?C=k:"trash"===m?C=S:"draft"===m&&(C=O),(0,t.useEffect)((()=>{let e=!0;if(null===a){const t=new window.FormData;if(t.append("paged",u),m&&t.append("post_status",m),p&&t.append("s",p),M&&t.append("mode",M),"date"===h){const e=new Date(c.get("from")),a=new Date(c.get("to"));t.append("start_date",yr(e)),t.append("end_date",yr(a))}N(!1),(async()=>{A()({path:"/cartflows/v1/admin/flows/",method:"POST",body:t}).then((t=>{e&&o({type:"SET_FLOWS_DATA",flows:t.items,pagination:t.pagination,found_posts:t.found_posts,active_flows_count:t.active_flows_count,trash_flows_count:t.trash_flows_count,draft_flows_count:t.draft_flows_count}),!1===t.status?N(!0):N(!1)}))})()}return()=>{e=!1}}),[a]);const Y=function(e){e.target.checked?D(b>0?b+1:1):(D(b>0?b-1:0),0==b-1&&(document.getElementById("wcf-select-all__flows").checked=!1))};return T||0!==r||0!==n||0!==i?(0,e.createElement)("div",{className:"wcf-flows-page-wrapper"},(0,e.createElement)(Hw,{flows_count:r+n}),(0,e.createElement)(Xx,null),T&&(0,e.createElement)(db,null),a&&0===a.length&&(0,e.createElement)("div",{className:"wcf-no-flows-found text-center bg-white p-20"},(0,e.createElement)("div",{className:"wcf-no-flows--content-block mx-auto max-w-2xl"},null!==p?(0,e.createElement)(DN,{className:"mx-auto w-7 h-7 stroke-2 text-primary-500"}):(0,e.createElement)(gb,{className:"mx-auto w-7 h-7 stroke-2 text-primary-500"}),(0,e.createElement)("h3",{className:"wcf-no-flows--heading mt-4 text-xl font-medium text-gray-800"},null!==p?(0,z.sprintf)(/* translators: %d Search term */ /* translators: %d Search term */
(0,z.__)('No matching results found for the search term "%s".',"cartflows"),p):(0,z.__)("No flows found for the selected filter.","cartflows")),(0,e.createElement)("p",{className:"wcf-no-flows--message mt-1 text-sm font-normal text-gray-600"},(0,z.__)("Please try using different keywords, date range, or filters to refine your results.","cartflows")),(0,e.createElement)("div",{className:"wcf-no-flows--divider relative mt-6 mx-auto max-w-xs"},(0,e.createElement)("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true"},(0,e.createElement)("div",{className:"w-full border-t border-gray-300"})),(0,e.createElement)("div",{className:"relative flex justify-center"},(0,e.createElement)("span",{className:"bg-white px-2 text-sm text-gray-600"},(0,z.__)("OR","cartflows")))),(0,e.createElement)("div",{className:"mt-6"},(0,e.createElement)(I,{key:"importer",to:{pathname:"admin.php",search:"?page=cartflows&path=library"},className:"wcf-button wcf-primary-button"},(0,e.createElement)(zr,{className:"w-18 h-18 stroke-2 text-white"}),(0,e.createElement)("span",null,(0,z.__)("Create New","cartflows")))))),a&&00&&(0,e.createElement)(Jx,{position:"before_flows",bulk_actions:C,selected_flows:b,selectedFlowsCall:D,closeCallback:function(){document.getElementById("wcf-select-all__flows").checked=!1,x([]),D(0)}}),(0,e.createElement)("div",{className:"wcf-flows-table rounded-b-xl bg-white "+("trash"===m?"wcf-flows-table-trash":"")},!T&&(0,e.createElement)("div",{className:"flex flex-col"},(0,e.createElement)("div",{className:"overflow-x-auto sm:overflow-visible"},(0,e.createElement)("div",{className:"inline-block min-w-full align-middle"},(0,e.createElement)("table",{className:"min-w-full border-b border-gray-200 !m-0"},(0,e.createElement)("thead",{className:"bg-gray-50"},(0,e.createElement)("tr",null,(0,e.createElement)("th",{scope:"col",className:"w-16 py-3.5 pl-4 pr-3 text-left sm:pl-6"},(0,e.createElement)("input",{type:"checkbox",id:"wcf-select-all__flows",className:"wcf-select-all__flows !h-5 !w-5 !rounded !border-gray-300 !text-primary-600 focus:!ring-primary-600 !shadow-none before:!content-none !outline-none",title:"Select all",onClick:function(e){const t=e.target.checked,a=document.getElementsByName("wcf-flow[]"),r=[];for(const e of a)if("checkbox"===e.type)if(t)e.checked=!0,r.push(e.id);else{e.checked=!1;const t=r.indexOf(e.id);t>-1&&r.splice(t,1)}x(r),D(r.length)}})),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-left text-base font-medium text-gray-800"},(0,z.__)("Name","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-center text-base font-medium text-gray-800"},(0,z.__)("Sandbox Mode","cartflows")),(0,e.createElement)("th",{scope:"col",className:"px-3 py-3.5 text-center text-base font-medium text-gray-800"},(0,z.__)("Sales","cartflows")),(0,e.createElement)("th",{scope:"col",className:"w-36 px-3 py-3.5 pr-4 sm:pr-6 text-left text-base font-medium text-gray-800"}," "))),(0,e.createElement)("tbody",{className:"divide-y divide-gray-200 bg-white"},!T&&a&&a.map((t=>(d++,(0,e.createElement)(ub,{key:t.id,flow:t,loading:T,selected_flows:w,openCallback:Y})))))))))),(0,e.createElement)("div",{className:"wcf-funnel-footer flex justify-between bg-white"},(0,e.createElement)("div",{className:"p-5 align-center block text-sm font-normal text-gray-400 self-center"},(0,z.sprintf)(/* translators: %d flow count */ /* translators: %d flow count */
(0,z.__)(" %d items","cartflows"),d)),(0,e.createElement)(Ow,{currentPage:parseInt(u),maxPages:parseInt(s?.max_pages)})))):(0,e.createElement)("main",{className:"wcf-no-flows-found-screen"},(0,e.createElement)("div",{className:"grid grid-cols-1 gap-4 items-start lg:grid-cols-5 lg:gap-10 xl:gap-10 rounded-md bg-white overflow-hidden shadow-sm px-10 py-10"},(0,e.createElement)("div",{className:"grid grid-cols-1 gap-4 lg:col-span-2 h-full"},(0,e.createElement)("div",{className:"wcf-video-container"},(0,e.createElement)("iframe",{className:"wcf-video rounded-md",src:"https://www.youtube.com/embed/SlE0moPKjMY?showinfo=0&autoplay=0&mute=0&rel=0",allow:"autoplay",title:"YouTube video player",frameBorder:"0",allowFullScreen:!0}))),(0,e.createElement)("div",{className:"grid grid-cols-1 gap-4 lg:col-span-3 h-full"},(0,e.createElement)("section",{"aria-labelledby":"section-1-title h-full"},(0,e.createElement)("div",{className:"flex flex-col justify-center h-full"},(0,e.createElement)("div",{className:""},(0,e.createElement)("div",{className:"flex"},(0,e.createElement)("h2",{className:"text-gray-800 text-2xl pb-3 font-semibold text-left"},(0,z.__)("Create your first funnel","cartflows"))),(0,e.createElement)("p",{className:"text-base text-gray-600 pb-7"},(0,z.__)("Build a sales funnel with everything you need to generate leads and grow sales.","cartflows"),(0,e.createElement)("div",{className:"flex mt-3"},(0,e.createElement)("div",null,(0,e.createElement)("li",null,(0,z.__)("One Click Upsells","cartflows")),(0,e.createElement)("li",null,(0,z.__)("Order Bumps","cartflows")),(0,e.createElement)("li",null,(0,z.__)("A/B Split Testing","cartflows")),(0,e.createElement)("li",null,(0,z.__)("Conversion Templates","cartflows"))),(0,e.createElement)("div",{className:"ml-10"},(0,e.createElement)("li",null,(0,z.__)("Checkout Editor","cartflows")),(0,e.createElement)("li",null,(0,z.__)("Dynamic Offers","cartflows")),(0,e.createElement)("li",null,(0,z.__)("Cart Abandonment","cartflows")),(0,e.createElement)("li",null,(0,z.__)("Insights","cartflows"))))),(0,e.createElement)("span",{className:"relative z-0 inline-flex flex-col sm:flex-row justify-start items-center w-full gap-4"},(0,e.createElement)(I,{key:"importer",to:{pathname:"admin.php",search:"?page=cartflows&path=library"},onClick:e=>{"bricks-builder"===L&&(e.preventDefault(),j("show"))},className:"inline-flex gap-1.5 wcf-button wcf-primary-button"},(0,e.createElement)(zr,{className:"w-18 h-18 stroke-2"}),(0,e.createElement)("span",null,(0,z.__)("Create Funnel","cartflows"))),(0,e.createElement)("span",{className:"divider w-px sm:h-9 bg-gray-200"}),(0,e.createElement)(Pw,{importBtnString:(0,z.__)("Import from JSON file","cartflows")}))))))),(0,e.createElement)(sw,{visibility:v,setVisibility:j,type:"blank",flowName:_,setFlowName:E}))},fb=function(){const a=(0,t.useRef)(null),r="not-installed"===cartflows_admin.woocommerce_status?(0,z.__)("Install WooCommerce","cartflows"):(0,z.__)("Activate WooCommerce","cartflows"),[n,i]=(0,t.useState)(r),[s,o]=(0,t.useState)(!1);return setTimeout((function(){!function(){const e=document.getElementById("wpwrap");e&&e.removeAttribute("inert")}()}),1e3),(0,e.createElement)(Pt.Root,{show:!0,as:t.Fragment},(0,e.createElement)(gr,{as:"div",className:"relative z-10",initialFocus:a,onClose:()=>{}},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},(0,e.createElement)("div",{className:"fixed inset-x-0 top-24 bottom-0 bg-gray-500 bg-opacity-75 transition-opacity"})),(0,e.createElement)("div",{className:"fixed inset-x-0 top-24 bottom-0 z-10 overflow-y-auto"},(0,e.createElement)("div",{className:"flex min-h-full items-end justify-center p-4 text-center sm:items-center sm:p-0"},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},(0,e.createElement)(gr.Panel,{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg"},(0,e.createElement)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},(0,e.createElement)("div",{className:"absolute top-0 right-0 hidden pt-4 pr-4 sm:block"}),(0,e.createElement)("div",{className:"sm:flex sm:items-start"},(0,e.createElement)("div",{className:"mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10"},(0,e.createElement)(vy,{className:"h-6 w-6 text-red-600","aria-hidden":"true"})),(0,e.createElement)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},(0,e.createElement)(gr.Title,{as:"h3",className:"text-base font-semibold leading-6 text-gray-900"},(0,z.__)("Plugin Required","cartflows")),(0,e.createElement)("div",{className:"mt-2"},(0,e.createElement)("p",{className:"text-sm text-gray-500"},(0,z.__)("You need WooCommerce plugin installed and activated to access this page.","cartflows")))))),(0,e.createElement)("div",{className:"bg-gray-50 px-4 py-3 sm:flex gap-3 justify-end sm:px-6"},(0,e.createElement)("button",{type:"button",className:"wcf-button wcf-primary-button",onClick:e=>{if(e.preventDefault(),"not-installed"===cartflows_admin.woocommerce_status)i((0,z.__)("Installing","cartflows")),o(!0),wp.updates.queue.push({action:"install-plugin",data:{slug:"woocommerce"}}),wp.updates.queueChecker();else{i((0,z.__)("Activating","cartflows")),o(!0);const e=new window.FormData;e.append("action","cartflows_activate_plugin"),e.append("init","woocommerce/woocommerce.php"),e.append("security",cartflows_admin.activate_plugin_nonce),A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((e=>{e.data&&e.data.success?i((0,z.__)("Activated","cartflows")):i((0,z.__)("Failed","cartflows")),i((0,z.__)("Redirecting","cartflows")),window.location.reload()}))}}},s&&(0,e.createElement)(Sr,{className:"w-18 h-18 stroke-2 animate-spin"}),n))))))))},hb=({setVisibility:a})=>(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-flow--footer bg-primary-25 p-4 mt-6 flex justify-end sm:px-6 gap-4"},(0,e.createElement)("button",{type:"button",className:"wcf-button wcf-secondary-button",onClick:()=>a("hide")},(0,z.__)("Close","cartflows")))),Mb=a=>{const{setVisibility:r,errorMessage:n,title:i}=a,s=i||(0,z.__)("Error","cartflows");return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-flow--body fixed inset-0 z-30 overflow-y-auto"},(0,e.createElement)("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:items-center sm:p-0"},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},(0,e.createElement)(gr.Panel,{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg"},(0,e.createElement)("div",{className:"wcf-name-your-flow--content bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4"},(0,e.createElement)("div",{className:"wcf-name-your-flow--header absolute right-0 top-0 hidden pr-4 pt-4 sm:block"},(0,e.createElement)("button",{type:"button",className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none ",onClick:()=>{r("hide")},title:(0,z.__)("Close the window","cartflows")},(0,e.createElement)(Cr,{className:"h-18 w-18 stroke-2","aria-hidden":"true"}))),(0,e.createElement)("div",{className:"mt-3 text-center sm:mt-0 sm:text-left"},(0,e.createElement)(gr.Title,{as:"h3",className:"wcf-name-your-flow--title text-base font-medium text-gray-800"},s),(0,e.createElement)("div",{className:"wcf-name-your-flow__body mt-5"},(0,e.createElement)("p",null,n)))),(0,e.createElement)(hb,{setVisibility:r}))))))},yb=(0,Ay.compose)((0,zy.withSelect)((e=>{const{getFlowsCount:t,getCFProStatus:a,getLicenseStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:a(),license_status:r()}})))((({visibility:a,setVisibility:r,errorMessage:n,title:i})=>(0,Za.createPortal)((0,e.createElement)("div",{className:`wcf-name-your-flow ${a}`},(0,e.createElement)(Pt.Root,{show:"show"===a,as:t.Fragment},(0,e.createElement)(gr,{as:"div",className:"relative z-20",initialFocus:"",onClose:r},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},(0,e.createElement)("div",{className:"wcf-name-your-flow__overlay fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:()=>{r("hide")}})),(0,e.createElement)("div",{className:"wcf-name-your-flow__inner"},(0,e.createElement)(Mb,{setVisibility:r,errorMessage:n,title:i}))))),document.getElementById("wcf-json-importer")))),Nb=(0,Ay.compose)((0,zy.withSelect)((e=>{const{getFlowsCount:t,getCFProStatus:a,getWooCommerceStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:a(),woocommerce_status:r()}})))((({preview:a,cf_pro_status:r,woocommerce_status:n,flowName:i,isStoreCheckout:s})=>{const[{license_status:o}]=g(),[l,c]=(0,t.useState)({isProcessing:!1,buttonText:"Import Funnel"}),{isProcessing:u,buttonText:d}=l,[m,p]=(0,t.useState)(!1),[f,h]=(0,t.useState)("hide"),[M,y]=(0,t.useState)(""),[N,w]=(0,t.useState)(""),x=function(e){e.preventDefault(),m?D():b()},b=function(){p(!0),document.addEventListener("click",D)},D=function(){p(!1),document.removeEventListener("click",D)};if("pro"===a.type){if(!wcfCartflowsTypePro())return"inactive"===r&&"pro"===wcfInactivepluginType()?(0,e.createElement)(Oy,null):(0,e.createElement)(Cy,null);if(wcfCartflowsTypePro()&&"Activated"!==o)return(0,e.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,e.createElement)("div",{className:"wcf-flow-import__button"},(0,e.createElement)(Yy,null)))}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(yb,{visibility:f,setVisibility:h,errorMessage:M,title:N}),(0,e.createElement)("div",{className:"wcf-flow-import__button wcf-store-checkout-import__button"},(0,e.createElement)("button",{className:"wcf-button "+(u?"wcf-disabled":"wcf-primary-button"),onClick:t=>{t.preventDefault(),jQuery(t.target).closest(".wcf-name-your-flow__inner").find(".input-field").attr("disabled","disabled"),((t,a,r,n,i,s,o,l,c,u,d)=>{if("active"!==s)return"inactive"===s?(l((0,e.createElement)(ew,null)),void o("show ")):(l((0,e.createElement)(tw,null)),void o("show "));a({isProcessing:!0,buttonText:"Importing Complete Funnel.."});const m=new window.FormData;m.append("action","cartflows_import_flow"),m.append("flow_name",r),m.append("security",cartflows_admin.import_flow_nonce),m.append("flow",JSON.stringify(t)),m.append("store_checkout",n),m.append("creation_method","ready_made_template"),A()({url:cartflows_admin.ajax_url,method:"POST",body:m}).then((t=>{console.log(t),t.success?(a({isProcessing:!1,buttonText:"Imported! Redirecting..."}),setTimeout((()=>{let e=`admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t.data.new_flow_id}`;n&&(e=`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t.data.new_flow_id}`),window.location=`${cartflows_admin.admin_base_url+e}`}),3e3)):"call_to_action"in t.data?(l((0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-message wcf-message--error",dangerouslySetInnerHTML:{__html:t.data.call_to_action}}),d&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("a",{className:"wcf-error-message--toggle",onClick:u},(0,z.__)("Click for more info","cartflows")),(0,e.createElement)("div",{className:"wcf-error--info",dangerouslySetInnerHTML:{__html:t.data.message}})))),o("show ")):a({isProcessing:!1,buttonText:t.data.message})}))})(a,c,i,s,0,n,h,y,0,x,m)}},u?(0,e.createElement)(ny,null):""," ",d)))})),wb=(0,Ay.compose)((0,zy.withSelect)((e=>{const{getFlowsCount:t,getCFProStatus:a,getLicenseStatus:r,getWooCommerceStatus:n}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:a(),license_status:r(),woocommerce_status:n()}})))((({flowName:a,isStoreCheckout:r})=>{const[n,i]=(0,t.useState)((0,z.__)("Create Store Checkout","cartflows")),[s,o]=(0,t.useState)(!1);return(0,e.createElement)("div",{className:"wcf-name-your-flow__actions"},(0,e.createElement)("div",{className:"wcf-flow-import__button"},(0,e.createElement)("button",{className:"wcf-button wcf-primary-button",onClick:e=>{e.preventDefault(),jQuery(e.target).closest(".wcf-name-your-flow__inner").find(".input-field").attr("disabled","disabled"),((e,t,a,r,n)=>{if(a)return;e("Creating Flow.."),r(!0);const i=new window.FormData;i.append("action","cartflows_create_flow"),i.append("security",cartflows_admin.create_flow_nonce),i.append("flow_name",t),i.append("store_checkout",n),i.append("creation_method","scratch"),A()({url:cartflows_admin.ajax_url,method:"POST",body:i}).then((t=>{console.log(t),t.success?(e((0,z.__)("Created! Redirecting…","cartflows")),r(!1),setTimeout((()=>{let e=`admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t.data.flow_id}`;n&&(e=`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t.data.flow_id}`),window.location=`${cartflows_admin.admin_base_url+e}`}),3e3)):e((0,z.__)("Failed to Create Flow!","cartflows"))}))})(i,a,s,o,r)}},n)))})),xb=({preview:a,type:r,flowName:n,setInputFieldVisibility:i,cancelButtonRef:s,setErrorDesc:o,setVisibility:l})=>(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-flow--footer bg-primary-25 p-4 mt-6 flex justify-end sm:px-6 gap-4"},"import"===r&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("button",{type:"button",className:"wcf-button wcf-secondary-button",onClick:()=>l("hide"),ref:s},(0,z.__)("Cancel","cartflows")),(0,e.createElement)(Nb,{preview:a,flowName:n,setInputFieldVisibility:i,setErrorDesc:o})),"blank"===r&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("button",{type:"button",className:"wcf-button wcf-secondary-button",onClick:()=>l("hide"),ref:s},(0,z.__)("Cancel","cartflows")),(0,e.createElement)(wb,{flowName:n,setInputFieldVisibility:i,isStoreCheckout:!0})))),bb=a=>{const{cf_pro_status:r,setVisibility:n,preview:i,type:s,flowName:o,setFlowName:l,cancelButtonRef:c}=a,[u,d]=(0,t.useState)(""),[{flows_limit_over:m}]=g(),[p,f]=(0,t.useState)(""),[h,M]=(0,t.useState)(0);return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-flow--body fixed inset-0 z-30 overflow-y-auto"},(0,e.createElement)("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:items-center sm:p-0"},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},(0,e.createElement)(gr.Panel,{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg"},(0,e.createElement)("div",{className:"wcf-name-your-flow--content bg-white px-4 pb-4 pt-5 sm:p-6 sm:pb-4"},(0,e.createElement)("div",{className:"wcf-name-your-flow--header absolute right-0 top-0 hidden pr-4 pt-4 sm:block"},(0,e.createElement)("button",{type:"button",className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none ",onClick:()=>{n("hide")},title:(0,z.__)("Close the window","cartflows")},(0,e.createElement)(Cr,{className:"h-18 w-18 stroke-2","aria-hidden":"true"}))),(0,e.createElement)("div",{className:"mt-3 text-center sm:mt-0 sm:text-left"},(0,e.createElement)(gr.Title,{as:"h3",className:"wcf-name-your-flow--title text-base font-medium text-gray-800"},m?(0,z.__)("Upgrade To CartFlows Pro","cartflows"):(0,z.__)("Name Your Store Checkout","cartflows"))),m?(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-flow__footer"},(0,e.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required wcf-upgrade-pro"},(0,e.createElement)("div",{className:"wcf-flow-import__message"},(0,e.createElement)("p",null,(0,z.__)("You can't create more than 3 flows in free version. Upgrade to CartFlows Pro for adding more flows and other features.","cartflows"))),(0,e.createElement)("div",{className:"wcf-flow-import__button"},(0,e.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,e.createElement)("div",{className:"wcf-flow-import__button"},(0,e.createElement)("a",{href:"https://cartflows.com/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs",target:"_blank",className:"wcf-button wcf-button--primary",rel:"noreferrer"},(0,z.__)("Upgrade To Cartflows Pro","cartflows")))))))):(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:`mt-5 ${u}`},(0,e.createElement)("div",{className:"flex justify-between py-2"},(0,e.createElement)("div",{className:"wcf-name-your-flow--field-title"},(0,e.createElement)("label",{className:"flex gap-1 text-base font-normal text-gray-800"},(0,z.__)("Store Checkout Name","cartflows"))),(0,e.createElement)("div",{className:"wcf-name-your-flow--word-count"},(0,e.createElement)("span",{className:"text-xs font-normal "+(40===h?"text-primary-500":"text-gray-400")},h,"/40"))),(0,e.createElement)("input",{type:"text",className:"input-field w-full !px-4 !py-2 text-sm font-normal !rounded-md text-gray-400 !border-gray-200 focus:ring focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none",value:o,onChange:e=>{const{value:t}=e.target;t.length<=40&&(M(t.length),l(t))},placeholder:(0,z.__)("Enter Store Checkout Name","cartflows")})),""!==p&&(0,e.createElement)("div",{className:"mt-5"},(0,e.createElement)("p",{className:"text-sm font-regular text-gray-600"},p)))),(0,e.createElement)(xb,{cf_pro_status:r,setVisibility:n,preview:i,type:s,flowName:o,setFlowName:l,setInputFieldVisibility:d,setErrorDesc:f,cancelButtonRef:c}))))))},Db=(0,Ay.compose)((0,zy.withSelect)((e=>{const{getFlowsCount:t,getCFProStatus:a,getLicenseStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:a(),license_status:r()}})))((({visibility:a,setVisibility:r,preview:n,type:i,flowName:s,setFlowName:o,cf_pro_status:l})=>{const c=(0,t.useRef)(null);return(0,e.createElement)(Pt.Root,{show:"show"===a,as:t.Fragment},(0,e.createElement)(gr,{as:"div",className:"relative z-20",initialFocus:"",onClose:r},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},(0,e.createElement)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:()=>{r("hide")}})),(0,e.createElement)("div",{className:"wcf-name-your-flow__inner"},(0,e.createElement)(bb,{cf_pro_status:l,setVisibility:r,preview:n,type:i,flowName:s,setFlowName:o,cancelButtonRef:c}))))})),vb=function(){const[a,r]=(0,t.useState)("hide"),[n,i]=(0,t.useState)(""),[{page_builder:s}]=g();return(0,e.createElement)("main",{className:"wcf-no-flows-found-screen"},(0,e.createElement)("div",{className:"grid grid-cols-1 gap-4 items-start lg:grid-cols-5 lg:gap-10 xl:gap-10 rounded-md bg-white overflow-hidden shadow-sm px-10 py-10"},(0,e.createElement)("div",{className:"grid grid-cols-1 gap-4 lg:col-span-2 h-full"},(0,e.createElement)("div",{className:"wcf-video-container"},(0,e.createElement)("iframe",{className:"wcf-video rounded-md",src:"https://www.youtube.com/embed/SlE0moPKjMY?showinfo=0&autoplay=0&mute=0&rel=0",allow:"autoplay",title:"YouTube video player",frameBorder:"0",allowFullScreen:!0}))),(0,e.createElement)("div",{className:"grid grid-cols-1 gap-4 lg:col-span-3 h-full"},(0,e.createElement)("section",{"aria-labelledby":"section-1-title h-full"},(0,e.createElement)("div",{className:"flex flex-col justify-center h-full"},(0,e.createElement)("div",{className:""},(0,e.createElement)("div",{className:"flex"},(0,e.createElement)("h2",{className:"text-gray-800 text-2xl pb-3 font-semibold text-left"},(0,z.__)("Create a global store checkout","cartflows"))),(0,e.createElement)("p",{className:"text-base text-gray-600 pb-7"},(0,z.__)("A well-designed checkout page can help streamline the checkout process, reduce cart abandonment rates and increase conversions.","cartflows"),(0,e.createElement)("div",{className:"flex mt-3"},(0,e.createElement)("div",null,(0,e.createElement)("li",null,(0,z.__)("Improved user experience","cartflows")),(0,e.createElement)("li",null,(0,z.__)("Brand consistency","cartflows")),(0,e.createElement)("li",null,(0,z.__)("Increased trust and credibility","cartflows"))),(0,e.createElement)("div",{className:"ml-10"},(0,e.createElement)("li",null,(0,z.__)("Flexibility and customization","cartflows")),(0,e.createElement)("li",null,(0,z.__)("Competitive advantage","cartflows"))))),(0,e.createElement)("span",{className:"relative z-0 inline-flex flex-col sm:flex-row justify-start w-full"},(0,e.createElement)(I,{key:"importer",to:{pathname:"admin.php",search:"?page=cartflows&path=store-checkout-library"},onClick:e=>{"bricks-builder"===s&&(e.preventDefault(),r("show"))},className:"inline-flex gap-1.5 wcf-button wcf-primary-button"},(0,e.createElement)(zr,{className:"w-18 h-18 stroke-2"}),(0,e.createElement)("span",null,(0,z.__)("Create Store Checkout","cartflows"))))))))),(0,e.createElement)(Db,{visibility:a,setVisibility:r,type:"blank",flowName:n,setFlowName:i}))},jb=function(){return(0,e.createElement)("div",{className:"wcf-flows-page-wrapper"},(0,e.createElement)(vb,null))};function _b({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 18.72a9.094 9.094 0 0 0 3.741-.479 3 3 0 0 0-4.682-2.72m.94 3.198.001.031c0 .225-.012.447-.037.666A11.944 11.944 0 0 1 12 21c-2.17 0-4.207-.576-5.963-1.584A6.062 6.062 0 0 1 6 18.719m12 0a5.971 5.971 0 0 0-.941-3.197m0 0A5.995 5.995 0 0 0 12 12.75a5.995 5.995 0 0 0-5.058 2.772m0 0a3 3 0 0 0-4.681 2.72 8.986 8.986 0 0 0 3.74.477m.94-3.197a5.971 5.971 0 0 0-.94 3.197M15 6.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm6 3a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Zm-13.5 0a2.25 2.25 0 1 1-4.5 0 2.25 2.25 0 0 1 4.5 0Z"}))}const Ib=t.forwardRef(_b);function Eb({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 0 0-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 0 0-16.536-1.84M7.5 14.25 5.106 5.272M6 20.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm12.75 0a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z"}))}const Lb=t.forwardRef(Eb);function Tb({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18.75a60.07 60.07 0 0 1 15.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 0 1 3 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 0 0-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 0 1-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 0 0 3 15h-.75M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm3 0h.008v.008H18V10.5Zm-12 0h.008v.008H6V10.5Z"}))}const Ab=t.forwardRef(Tb);function zb({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15m0-3-3-3m0 0-3 3m3-3V15"}))}const kb=t.forwardRef(zb);function Sb({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 16.875h3.375m0 0h3.375m-3.375 0V13.5m0 3.375v3.375M6 10.5h2.25a2.25 2.25 0 0 0 2.25-2.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v2.25A2.25 2.25 0 0 0 6 10.5Zm0 9.75h2.25A2.25 2.25 0 0 0 10.5 18v-2.25a2.25 2.25 0 0 0-2.25-2.25H6a2.25 2.25 0 0 0-2.25 2.25V18A2.25 2.25 0 0 0 6 20.25Zm9.75-9.75H18a2.25 2.25 0 0 0 2.25-2.25V6A2.25 2.25 0 0 0 18 3.75h-2.25A2.25 2.25 0 0 0 13.5 6v2.25a2.25 2.25 0 0 0 2.25 2.25Z"}))}const Ob=t.forwardRef(Sb);function Cb({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18 7.5v3m0 0v3m0-3h3m-3 0h-3m-2.25-4.125a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0ZM3 19.235v-.11a6.375 6.375 0 0 1 12.75 0v.109A12.318 12.318 0 0 1 9.374 21c-2.331 0-4.512-.645-6.374-1.766Z"}))}const Yb=t.forwardRef(Cb),Ub=function(t){const[{analyticsData:a}]=l(),r=a&&a.flow_stats.avg_order_value_by_date?a.flow_stats.avg_order_value_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.avg_order_value:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},dataLabels:{enabled:!0,formatter:e=>cartflows_admin.woo_currency+e.toLocaleString()},xaxis:{categories:i},yaxis:{labels:{formatter:e=>cartflows_admin.woo_currency+e.toLocaleString()}},stroke:{curve:"smooth"},tooltip:{x:{format:"dd/MM/yy HH:mm"}},colors:["#F06434"]},o=[{name:"Total Average Order Value",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Average Order Value","cartflows"))),(0,e.createElement)("div",{className:"mt-4 relative"},!wcfCartflowsTypePro()&&(0,e.createElement)(pw,{title:(0,z.__)("Average Order Value is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305}))))},Qb=function(t){const[{analyticsData:a}]=l(),r=a&&a.flow_stats.bump_revenue_by_date?a.flow_stats.bump_revenue_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.bump_revenue:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},dataLabels:{enabled:!0,formatter:e=>cartflows_admin.woo_currency+e.toLocaleString()},xaxis:{categories:i},yaxis:{labels:{formatter:e=>cartflows_admin.woo_currency+e.toLocaleString()}},stroke:{curve:"smooth"},tooltip:{x:{format:"dd/MM/yy HH:mm"}},colors:["#F06434"]},o=[{name:"Total Bump Offer Revenue",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Bump Offer Revenue","cartflows"))),(0,e.createElement)("div",{className:"mt-4 relative"},!wcfCartflowsTypePro()&&(0,e.createElement)(pw,{title:(0,z.__)("Bump Offer Revenue is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305}))))},Pb=function(t){const[{analyticsData:a}]=l(),r=a&&a.flow_stats.revenue_per_visit_by_date?a.flow_stats.revenue_per_visit_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.revenue_per_visit:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},dataLabels:{enabled:!0,formatter:e=>cartflows_admin.woo_currency+e.toLocaleString()},xaxis:{categories:i},yaxis:{labels:{formatter:e=>cartflows_admin.woo_currency+e.toLocaleString()}},stroke:{curve:"smooth"},tooltip:{x:{format:"dd/MM/yy HH:mm"}},colors:["#F06434"]},o=[{name:"Revenue Per Visit",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Revenue Per Visit","cartflows"))),(0,e.createElement)("div",{className:"mt-4 relative"},!wcfCartflowsTypePro()&&(0,e.createElement)(pw,{title:(0,z.__)("Revenue Per Visit is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305}))))},Fb=function(t){const[{analyticsData:a}]=l(),r=a&&a.flow_stats.revenue_per_unique_visitor_by_date?a.flow_stats.revenue_per_unique_visitor_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.revenue_per_unique_visitor:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},dataLabels:{enabled:!0,formatter:e=>cartflows_admin.woo_currency+e.toLocaleString()},xaxis:{categories:i},yaxis:{labels:{formatter:e=>cartflows_admin.woo_currency+e.toLocaleString()}},stroke:{curve:"smooth"},tooltip:{x:{format:"dd/MM/yy HH:mm"}},colors:["#F06434"]},o=[{name:"RPUV",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("RPUV","cartflows"))),(0,e.createElement)("div",{className:"mt-4 relative"},!wcfCartflowsTypePro()&&(0,e.createElement)(pw,{title:(0,z.__)("Revenue Per Unique Visitor is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305}))))};function Rb({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 18 9 11.25l4.306 4.306a11.95 11.95 0 0 1 5.814-5.518l2.74-1.22m0 0-5.94-2.281m5.94 2.28-2.28 5.941"}))}const Hb=t.forwardRef(Rb);function Bb({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6 9 12.75l4.286-4.286a11.948 11.948 0 0 1 4.306 6.43l.776 2.898m0 0 3.182-5.511m-3.182 5.51-5.511-3.181"}))}const Wb=t.forwardRef(Bb),Zb=function({trend:t}){if(!t||t.percentage<0)return null;const a=`${t.isIncrease?"+":"-"}${t.percentage}%`;return(0,e.createElement)("div",{className:"flex items-center gap-1"},t.isIncrease?(0,e.createElement)(Hb,{className:"w-4 h-4 text-green-500"}):(0,e.createElement)(Wb,{className:"w-4 h-4 text-red-500"}),(0,e.createElement)("span",{className:"text-xs leading-5 font-normal "+(t.isIncrease?"text-green-500":"text-red-500")},a))},Vb=function({item:t,isActive:a,onClick:r,trend:n,showProBadge:i=!1,statSuffix:s=""}){let o="-";return 0!==t.stat&&(o=wr(t.stat.toString()),s&&(o+=s)),(0,e.createElement)("div",{className:"wcf-analytics--stats-tab flex items-center justify-between gap-3 px-4 py-4 rounded-lg border border-[#FFD9C2] bg-white shadow-none hover:shadow-md transition-shadow duration-200 relative cursor-pointer "+(a?"border-primary-500 bg-primary-25 shadow-md":"hover:border-primary-300 hover:shadow-sm"),onClick:r},(0,e.createElement)("div",{className:"flex items-center justify-center w-8 h-8 rounded-full bg-white shadow-custom"},t.icon),(0,e.createElement)("div",{className:"flex-1 min-w-0"},(0,e.createElement)("div",{className:"flex items-center justify-between gap-2 mb-1"},(0,e.createElement)("div",{className:"flex items-center"},(0,e.createElement)("span",{className:"text-[12px] font-semibold text-gray-600 "+("per_unique_visitor_revenue"===t.graphType?"flex-[5_5_0%]":"")},t.name),(0,e.createElement)(MM,{text:t.tooltip,classes:"text-gray-400 sm:block lg:block "+("per_unique_visitor_revenue"===t.graphType?"flex-[3_3_0%]":"")})),(0,e.createElement)(Zb,{trend:n}),i&&(0,e.createElement)("span",{className:"wcf-pro-badge px-2 py-0.5 text-xs text-primary-600 ml-auto rounded-[14px] shadow-[0px_6px_16px_-2px_rgba(240,100,52,0.4)]"},(0,z.__)("PRO","cartflows"))),(0,e.createElement)("div",{className:"mt-1 text-xl font-semibold tracking-tight text-gray-400"},o)))},Gb=function({title:t,selectedFlow:a,onFlowChange:r,flowOptions:n,flowsLoading:i,dateValue:s,onDateChange:o,comparisonPeriod:l,onComparisonPeriodChange:c,comparisonPeriodOptions:u}){const d={control:(e,t)=>({...e,border:t.menuIsOpen?"1px solid #f06434":"1px solid #e5e7eb",borderRadius:"6px",boxShadow:"none",outline:"none","&:hover":{border:t.menuIsOpen?"1px solid #f06434":"1px solid #e5e7eb"}}),valueContainer:e=>({...e,padding:"10px 16px"}),indicatorSeparator:()=>({display:"none"})};return(0,e.createElement)("div",{className:"bg-white px-8 py-6 flex justify-between items-center mb-9 -m-8"},(0,e.createElement)("h2",{className:"text-base md:text-2xl font-bold text-grey-800"},t),(0,e.createElement)("div",{className:"wcf-metabox--filters-wrapper flex gap-3 flex-col md:flex-row max-h-[40px]"},(0,e.createElement)("div",{className:"min-w-48"},(0,e.createElement)(ay,{value:a,onChange:r,options:n,className:"wcf-metabox--filter-flows-input",isSearchable:!1,isDisabled:i,isLoading:i,placeholder:i?(0,z.__)("Loading flows…","cartflows"):(0,z.__)("Select Flow","cartflows"),styles:d})),(0,e.createElement)("div",{className:"flex flex-col sm:flex-row items-start gap-2"},(0,e.createElement)("label",{className:"sm:hidden visible font-medium"},(0,z.__)("Custom Filter:","cartflows")),(0,e.createElement)(cM,{classNames:"wcf-custom-filter-input !w-72 !h-full date-picker-field !pl-4 !px-4 !py-3 !pr-7 text-sm font-normal text-gray-400 !rounded-md !border-gray-200 focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none",value:s,onChangeCB:o})),(0,e.createElement)("div",{className:"min-w-48"},(0,e.createElement)(ay,{value:u.find((e=>e.value===l)),onChange:e=>c(e.value),options:u,className:"wcf-analytics-comparison-period-select",isSearchable:!1,styles:d}))))},Xb=function({flowsConversions:a}){const r=(0,t.useMemo)((()=>a&&Object.values(a).map(((t,a)=>(0,e.createElement)("tr",{key:t?.flow_id||a},(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},t?.flow_title||"(no title)"),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t?.total_visits),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t?.unique_visits),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t?.conversions),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t?.conversion_rate+"%"),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},wr(t?.revenue)))))),[a]);return(0,e.createElement)("div",{className:"mt-8 bg-white rounded-lg shadow-sm p-6"},(0,e.createElement)("h2",{className:"text-lg font-semibold mb-4"},(0,z.__)("All Funnels","cartflows")),wcfCartflowsTypePro()?(0,e.createElement)("div",{className:"overflow-x-auto"},(0,e.createElement)("table",{className:"min-w-full divide-y divide-gray-200 border border-gray-200 rounded-md"},(0,e.createElement)("thead",{className:"bg-gray-50"},(0,e.createElement)("tr",null,(0,e.createElement)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Funnel Name","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Total Visits","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Unique Visits","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Conversions","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Conversion Rate","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Revenue","cartflows")))),(0,e.createElement)("tbody",{className:"bg-white divide-y divide-gray-200"},a&&0!==Object.keys(a).length?r:(0,e.createElement)("tr",null,(0,e.createElement)("td",{colSpan:"6",className:"px-6 py-4 text-center text-sm text-gray-500"},(0,z.__)("No data available","cartflows")))))):(0,e.createElement)("div",{className:"overflow-x-auto relative min-h-[320px]"},(0,e.createElement)(pw,{title:(0,z.__)("All Funnels is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full inset-0 flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:"blur-[2px]"},(0,e.createElement)(_w,null))))},Jb=()=>{const[{publishedFlows:e},a]=l();return(0,t.useEffect)((()=>{e&&(e.data||e.loading)||(async()=>{a({type:"SET_PUBLISHED_FLOWS",publishedFlows:{data:null,loading:!0,error:null}});try{const e=new window.FormData;e.append("action","cartflows_get_published_flows"),e.append("security",cartflows_admin.get_published_flows_nonce);const t=await A()({url:cartflows_admin.ajax_url,method:"POST",body:e});if(t&&t.data&&t.data.flows){const e=[{value:"",label:(0,z.__)("All Flows","cartflows")},...t.data.flows.map((e=>({value:e.flow_id,label:e.flow_title})))];a({type:"SET_PUBLISHED_FLOWS",publishedFlows:{data:e,loading:!1,error:null}})}}catch(e){console.error("Error fetching flows:",e),a({type:"SET_PUBLISHED_FLOWS",publishedFlows:{data:[{value:"",label:(0,z.__)("All Flows","cartflows")}],loading:!1,error:e}})}})()}),[a,e]),{flows:e?.data||[{value:"",label:(0,z.__)("All Flows","cartflows")}],loading:e?.loading||!1,error:e?.error||null}},qb=(e,t)=>{if(t===e||!t||0===t||"0.00"===t)return{percentage:0,isIncrease:!0};const a=(e-t)/t*100;return{percentage:Math.ceil(Math.abs(a)),isIncrease:a>=0}},$b=(e,t)=>{const a=new Date(e.getTime()),r=[];for(;a<=t;)r.push(new Date(a).toISOString().slice(0,10)),a.setDate(a.getDate()+1);return r},Kb=__=>[{value:"previous-period",label:__("Previous Period","cartflows")},{value:"previous-year",label:__("Previous Year","cartflows")}],eD=function(){var a,r,n,i,s,o,c,u,d,m,g,p,f,h;const[{analyticsData:M},y]=l(),N=M?.flow_stats||{},w=N?.comparison||[],x=M?.flow_stats?.flows_conversions,[b,D]=(0,t.useState)("total_views"),[v,j]=(0,t.useState)(),[_,I]=(0,t.useState)(!0),[E,L]=(0,t.useState)({value:"",label:(0,z.__)("All Flows","cartflows")}),[T,k]=(0,t.useState)("previous-period"),[S,O]=(0,t.useState)({from:null,to:null}),{flows:C,loading:Y}=Jb(),U=(0,t.useCallback)((e=>({total_visitors:"total_visits",total_orders:"total_orders",total_revenue:"total_revenue_raw",avg_revenue:"avg_order_value_raw",bump_revenue:"total_bump_revenue_raw",offer_revenue:"total_offers_revenue_raw",per_visit_revenue:"revenue_per_visit_raw",per_unique_visitor_revenue:"revenue_per_unique_visitor_raw"}[e])),[]),Q=(e,t,a="",r="previous-period")=>{I(!0);const n=new window.FormData;n.append("date_to",t),n.append("date_from",e),a&&n.append("flow_id",a),n.append("comparison_range_type",r),n.append("screen_type","funnels"),n.append("action","cartflows_get_all_flows_stats"),n.append("security",cartflows_admin.get_all_flows_stats_nonce),A()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((e=>{y({type:"SET_ANALYTICS_DATA",analyticsData:e.data}),I(!1)}))},P=[{name:(0,z.__)("Total Visitors","cartflows"),stat:null!==(a=N?.total_visits)&&void 0!==a?a:0,stat_raw:null,tooltip:(0,z.__)("This shows the total number of times people visited any step in your funnel.","cartflows"),icon:(0,e.createElement)(Ib,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"total_visitors"},{name:(0,z.__)("Total Orders","cartflows"),stat:null!==(r=N?.total_orders)&&void 0!==r?r:0,stat_raw:null,tooltip:(0,z.__)("This shows the total number of orders placed through your CartFlows checkout pages.","cartflows"),icon:(0,e.createElement)(Lb,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"total_orders"},{name:(0,z.__)("Total Revenue","cartflows"),stat:null!==(n=N?.total_revenue)&&void 0!==n?n:0,stat_raw:null!==(i=N?.total_revenue_raw)&&void 0!==i?i:0,tooltip:(0,z.__)("This shows the total amount of money earned from all steps combined.","cartflows"),icon:(0,e.createElement)(Pl,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"total_revenue"},{name:(0,z.__)("Avg. Order Value","cartflows"),stat:null!==(s=N?.avg_order_value)&&void 0!==s?s:0,stat_raw:null!==(o=N?.avg_order_value_raw)&&void 0!==o?o:0,tooltip:(0,z.__)("Average value of each order (Total Revenue / Total Orders).","cartflows"),icon:(0,e.createElement)(Ab,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"avg_revenue"},{name:(0,z.__)("Bump Revenue","cartflows"),stat:null!==(c=N?.total_bump_revenue)&&void 0!==c?c:0,stat_raw:null!==(u=N?.total_bump_revenue_raw)&&void 0!==u?u:0,tooltip:(0,z.__)("This shows the total amount of money earned from all order bump offers.","cartflows"),icon:(0,e.createElement)(kb,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"bump_revenue"},{name:(0,z.__)("Offer Revenue","cartflows"),stat:null!==(d=N?.total_offers_revenue)&&void 0!==d?d:0,stat_raw:null!==(m=N?.total_offers_revenue_raw)&&void 0!==m?m:0,tooltip:(0,z.__)("This shows the total amount of money earned from your Upsell and Downsell offers.","cartflows"),icon:(0,e.createElement)(Ob,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"offer_revenue"},{name:(0,z.__)("Revenue Per Visit","cartflows"),stat:null!==(g=N?.revenue_per_visit)&&void 0!==g?g:0,stat_raw:null!==(p=N?.revenue_per_visit_raw)&&void 0!==p?p:0,tooltip:(0,z.__)("Revenue per each visit (Total Revenue / Total Visitors).","cartflows"),icon:(0,e.createElement)(Yb,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"per_visit_revenue"},{name:(0,z.__)("RPUV","cartflows"),stat:null!==(f=N?.revenue_per_unique_visitor)&&void 0!==f?f:0,stat_raw:null!==(h=N?.revenue_per_unique_visitor_raw)&&void 0!==h?h:0,tooltip:(0,z.__)("This shows average revenue generated per individual visitor.","cartflows"),icon:(0,e.createElement)(Yb,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"per_unique_visitor_revenue"}];(0,t.useEffect)((()=>{const e=new Date,t=new Date;t.setDate(t.getDate()-7),j($b(t,e));const a=t.toISOString().slice(0,10),r=e.toISOString().slice(0,10);O({from:a,to:r}),Q(a,r,"",T)}),[y]),(0,t.useEffect)((()=>{S.from&&S.to&&Q(S.from,S.to,E.value,T)}),[E]),(0,t.useEffect)((()=>{S.from&&S.to&&Q(S.from,S.to,E.value,T)}),[T]);const F=new Date,R=F.toISOString().slice(0,10);F.setDate(F.getDate()-7);const H=F.toISOString().slice(0,10),B=Kb(z.__);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Gb,{title:(0,z.__)("Funnels","cartflows"),selectedFlow:E,onFlowChange:L,flowOptions:C,flowsLoading:Y,dateValue:{endDate:R,startDate:H},onDateChange:function(e){const t=new Date(e.startDate),a=new Date(e.endDate);j($b(t,a));const r=t.toISOString().slice(0,10),n=a.toISOString().slice(0,10);O({from:r,to:n}),Q(r,n,E.value,T)},comparisonPeriod:T,onComparisonPeriodChange:k,comparisonPeriodOptions:B}),(0,e.createElement)("section",{"aria-labelledby":"section-1-title h-full"},(0,e.createElement)("div",{className:"p-8 rounded-t-xl bg-white overflow-hidden shadow-sm flex flex-col justify-center h-full"},(0,e.createElement)("div",{className:"wcf-analytics--stats-tabs-container"},(0,e.createElement)("div",{className:"wcf-analytics--stats-tabs m-0"},(0,e.createElement)("div",{className:"gap-5 grid sm:grid-cols-4 grid-cols-2 w-full"},P.map((t=>{const a=U(t.graphType),r=w?.[a]||0,n=qb(null!==t?.stat_raw?t?.stat_raw:t?.stat,r),i=!["total_orders","total_revenue"].includes(t.graphType)&&!wcfCartflowsTypePro();return(0,e.createElement)(Vb,{key:t.name,item:t,isActive:b===t.graphType,onClick:()=>D(t.graphType),trend:n,showProBadge:i})}))))),(0,e.createElement)("div",{className:"mt-8 bg-white rounded-lg shadow-sm"},(_||!M)&&(0,e.createElement)("div",{className:"animate-pulse"},(0,e.createElement)("div",{className:"h-64 bg-gray-200 rounded"})),M&&!_&&(0,e.createElement)("div",{className:"wcf-analytics--tab-content"},function(){let t="";switch(v||function(){const e=new Date,t=new Date;t.setDate(t.getDate()-7),j($b(t,e))}(),b){case"total_views":default:t=(0,e.createElement)(fw,{dateRange:v});break;case"total_revenue":t=(0,e.createElement)(hw,{dateRange:v});break;case"total_orders":t=(0,e.createElement)(Mw,{dateRange:v});break;case"offer_revenue":t=(0,e.createElement)(yw,{dateRange:v});break;case"avg_revenue":t=(0,e.createElement)(Ub,{dateRange:v});break;case"bump_revenue":t=(0,e.createElement)(Qb,{dateRange:v});break;case"per_visit_revenue":t=(0,e.createElement)(Pb,{dateRange:v});break;case"per_unique_visitor_revenue":t=(0,e.createElement)(Fb,{dateRange:v})}return t}()))),(0,e.createElement)(Xb,{flowsConversions:x})))},tD=function(t){const[{analyticsData:a}]=l(),r=a&&a?.flow_stats?.submissions_by_date?a?.flow_stats?.submissions_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.submissions:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},xaxis:{categories:i},stroke:{curve:"smooth"},tooltip:{x:{format:"dd MMM"}},colors:["#F06434"]},o=[{name:"Total Submissions",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Total Submissions","cartflows"))),(0,e.createElement)("div",{className:"mt-4 relative"},!wcfCartflowsTypePro()&&(0,e.createElement)(pw,{title:(0,z.__)("Total Submissions is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305}))))},aD=function(t){const[{analyticsData:a}]=l(),r=a&&a?.flow_stats?.conversion_rate_by_date?a?.flow_stats?.conversion_rate_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.conversions:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},xaxis:{categories:i},stroke:{curve:"smooth"},tooltip:{x:{format:"dd MMM"}},colors:["#F06434"]},o=[{name:"Conversion Rate",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Conversion Rate","cartflows"))),(0,e.createElement)("div",{className:"mt-4 relative"},!wcfCartflowsTypePro()&&(0,e.createElement)(pw,{title:(0,z.__)("Conversion Rate is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305}))))},rD=function(t){const[{analyticsData:a}]=l(),r=a&&a.flow_stats.optin_conversion_rate_by_date?a.flow_stats.optin_conversion_rate_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.conversions:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},xaxis:{categories:i},stroke:{curve:"smooth"},tooltip:{x:{format:"dd MMM"}},colors:["#F06434"]},o=[{name:"List Growth",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("List Growth","cartflows"))),(0,e.createElement)("div",{className:"mt-4"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305})))},nD=function({optinFlowConversions:a}){const r=(0,t.useMemo)((()=>a&&Object.values(a).map(((t,a)=>(0,e.createElement)("tr",{key:t?.step_id||a},(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},t?.flow_title||"(no title)"),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t?.step_title||"(no title)"),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t?.optin_form),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900 !hidden"},t?.popup),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900 !hidden"},t?.lead_magnets),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900"},t?.conversion_rate+"%"),(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900 !hidden"},t?.date_time))))),[a]);return(0,e.createElement)("div",{className:"mt-8 bg-white rounded-lg shadow-sm p-6"},(0,e.createElement)("h2",{className:"text-lg font-semibold mb-4"},(0,z.__)("Overview","cartflows")),wcfCartflowsTypePro()?(0,e.createElement)("div",{className:"overflow-x-auto"},(0,e.createElement)("table",{className:"min-w-full divide-y divide-gray-200 border border-gray-200 rounded-md"},(0,e.createElement)("thead",{className:"bg-gray-50"},(0,e.createElement)("tr",null,(0,e.createElement)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Funnel Name","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Opt-in Step","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Opt-in Form","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider !hidden"},(0,z.__)("Popup","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider !hidden"},(0,z.__)("Lead Magnets","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Conversion Rate","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider !hidden"},(0,z.__)("Date & Time","cartflows")))),(0,e.createElement)("tbody",{className:"bg-white divide-y divide-gray-200"},a&&0!==Object.keys(a).length?r:(0,e.createElement)("tr",null,(0,e.createElement)("td",{colSpan:"6",className:"px-6 py-4 text-center text-sm text-gray-500"},(0,z.__)("No data available","cartflows")))))):(0,e.createElement)("div",{className:"overflow-x-auto relative min-h-[320px]"},(0,e.createElement)(pw,{title:(0,z.__)("Optin Overview is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full inset-0 flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:"blur-[2px]"},(0,e.createElement)(Ew,null))))},iD=function(){var a,r;const[{analyticsData:n},i]=l(),s=n?.flow_stats,o=n?.flow_stats?.optin_flow_conversions,c=n?.flow_stats?.comparison||[],[u,d]=(0,t.useState)("total_submissions"),[m,g]=(0,t.useState)(),[p,f]=(0,t.useState)(!0),[h,M]=(0,t.useState)({value:"",label:(0,z.__)("All Flows","cartflows")}),[y,N]=(0,t.useState)("previous-period"),[w,x]=(0,t.useState)({from:null,to:null}),{flows:b,loading:D}=Jb(),v=(0,t.useCallback)((e=>({total_submissions:"total_submissions",conversion_rate:"conversion_rate"}[e])),[]),j=(e,t,a="",r="previous-period")=>{f(!0);const n=new window.FormData;n.append("date_to",t),n.append("date_from",e),a&&n.append("flow_id",a),n.append("comparison_range_type",r),n.append("screen_type","optins"),n.append("action","cartflows_get_all_flows_stats"),n.append("security",cartflows_admin.get_all_flows_stats_nonce),A()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((e=>{i({type:"SET_ANALYTICS_DATA",analyticsData:e.data}),f(!1)}))},_=[{name:(0,z.__)("Total Submissions","cartflows"),stat:null!==(a=s?.total_submissions)&&void 0!==a?a:0,tooltip:(0,z.__)("This shows the total opt-in form submissions.","cartflows"),icon:(0,e.createElement)(Lb,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"total_submissions"},{name:(0,z.__)("Conversion Rate","cartflows"),stat:null!==(r=s?.conversion_rate)&&void 0!==r?r:0,tooltip:(0,z.__)("This shows the percentage of visitors who completed the opt-in.","cartflows"),icon:(0,e.createElement)(Pl,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"conversion_rate"}];(0,t.useEffect)((()=>{const e=new Date,t=new Date;t.setDate(t.getDate()-7),g($b(t,e));const a=t.toISOString().slice(0,10),r=e.toISOString().slice(0,10);x({from:a,to:r}),j(a,r,"",y)}),[i]),(0,t.useEffect)((()=>{w.from&&w.to&&j(w.from,w.to,h.value,y)}),[h]),(0,t.useEffect)((()=>{w.from&&w.to&&j(w.from,w.to,h.value,y)}),[y]);const I=new Date,E=I.toISOString().slice(0,10);I.setDate(I.getDate()-7);const L=I.toISOString().slice(0,10),T=Kb(z.__);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Gb,{title:(0,z.__)("Opt-in","cartflows"),selectedFlow:h,onFlowChange:M,flowOptions:b,flowsLoading:D,dateValue:{endDate:E,startDate:L},onDateChange:function(e){const t=new Date(e.startDate),a=new Date(e.endDate);g($b(t,a));const r=t.toISOString().slice(0,10),n=a.toISOString().slice(0,10);x({from:r,to:n}),j(r,n,h.value,y)},comparisonPeriod:y,onComparisonPeriodChange:N,comparisonPeriodOptions:T}),(0,e.createElement)("section",{"aria-labelledby":"section-1-title h-full"},(0,e.createElement)("div",{className:"p-8 rounded-t-xl bg-white overflow-hidden shadow-sm flex flex-col justify-center h-full"},(0,e.createElement)("div",{className:"wcf-analytics--stats-tabs-container"},(0,e.createElement)("div",{className:"wcf-analytics--stats-tabs m-0"},(0,e.createElement)("div",{className:"gap-5 grid sm:grid-cols-4 grid-cols-2 w-full"},_.map((t=>{const a=v(t.graphType),r=c?.[a]||0,n=qb(t.stat,r),i="conversion_rate"===t.graphType?"%":"";return(0,e.createElement)(Vb,{key:t.name,item:t,isActive:u===t.graphType,onClick:()=>d(t.graphType),trend:n,showProBadge:!wcfCartflowsTypePro(),statSuffix:i})}))))),(0,e.createElement)("div",{className:"mt-8 bg-white rounded-lg shadow-sm"},(p||!n)&&(0,e.createElement)("div",{className:"animate-pulse"},(0,e.createElement)("div",{className:"h-64 bg-gray-200 rounded"})),n&&!p&&(0,e.createElement)("div",{className:"wcf-analytics--tab-content"},function(){let t="";switch(m||function(){const e=new Date,t=new Date;t.setDate(t.getDate()-7),g($b(t,e))}(),u){case"total_submissions":default:t=(0,e.createElement)(tD,{dateRange:m});break;case"conversion_rate":t=(0,e.createElement)(aD,{dateRange:m});break;case"list_growth":t=(0,e.createElement)(rD,{dateRange:m})}return t}()))),(0,e.createElement)(nD,{optinFlowConversions:o})))};function sD({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z"}))}const oD=t.forwardRef(sD),lD=function(t){const[{analyticsData:a}]=l(),r=a&&a?.flow_stats?.desktop_conversions_by_date?a?.flow_stats?.desktop_conversions_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.desktop_conversions:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},xaxis:{categories:i},stroke:{curve:"smooth"},tooltip:{x:{format:"dd MMM"}},colors:["#F06434"]},o=[{name:"Laptop Conversions",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Laptop Conversions","cartflows"))),(0,e.createElement)("div",{className:"mt-4 relative"},!wcfCartflowsTypePro()&&(0,e.createElement)(pw,{title:(0,z.__)("Laptop Conversions is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305}))))},cD=function(t){const[{analyticsData:a}]=l(),r=a&&a?.flow_stats?.mobile_conversions_by_date?a?.flow_stats?.mobile_conversions_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.mobile_conversions:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},xaxis:{categories:i},stroke:{curve:"smooth"},tooltip:{x:{format:"dd MMM"}},colors:["#F06434"]},o=[{name:"Mobile Conversions",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Mobile Conversions","cartflows"))),(0,e.createElement)("div",{className:"mt-4 relative"},!wcfCartflowsTypePro()&&(0,e.createElement)(pw,{title:(0,z.__)("Mobile Conversions is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305}))))},uD=function(t){const[{analyticsData:a}]=l(),r=a&&a?.flow_stats?.conversions_by_date?a?.flow_stats?.conversions_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.conversions:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},xaxis:{categories:i},stroke:{curve:"smooth"},tooltip:{x:{format:"dd MMM"}},colors:["#F06434"]},o=[{name:"Total Conversions",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Total Conversions","cartflows"))),(0,e.createElement)("div",{className:"mt-4 relative"},!wcfCartflowsTypePro()&&(0,e.createElement)(pw,{title:(0,z.__)("Total Conversions is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305}))))},dD=function(t){const[{analyticsData:a}]=l(),r=a&&a?.flow_stats?.bump_conversions_by_date?a?.flow_stats?.bump_conversions_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.bump_conversions:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},xaxis:{categories:i},stroke:{curve:"smooth"},tooltip:{x:{format:"dd MMM"}},colors:["#F06434"]},o=[{name:"Bump Conversions",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Bump Conversions","cartflows"))),(0,e.createElement)("div",{className:"mt-4 relative"},!wcfCartflowsTypePro()&&(0,e.createElement)(pw,{title:(0,z.__)("Bump Conversions is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305}))))},mD=function(t){const[{analyticsData:a}]=l(),r=a&&a?.flow_stats?.offer_conversions_by_date?a?.flow_stats?.offer_conversions_by_date:[],n=[];t.dateRange.map((e=>{const t=r.find((t=>t.OrderDate===e));return n.push(t?t.offer_conversions:0),null}));const i=[];t.dateRange.map((e=>{const t=new Date(e);return i.push(t.toLocaleDateString("en-US",{month:"short",day:"numeric"})),null}));const s={chart:{id:"wcf-analytics-graphs",type:"area",toolbar:{show:!1}},xaxis:{categories:i},stroke:{curve:"smooth"},tooltip:{x:{format:"dd MMM"}},colors:["#F06434"]},o=[{name:"Offer Conversions",data:n}];return(0,e.createElement)("section",{className:"block p-6 justify-between"},(0,e.createElement)("div",{className:"mr-16 w-full flex items-center"},(0,e.createElement)("h3",{className:"flex-1 text-xl font-semibold text-gray-800"},(0,z.__)("Offer Conversions","cartflows"))),(0,e.createElement)("div",{className:"mt-4 relative"},!wcfCartflowsTypePro()&&(0,e.createElement)(pw,{title:(0,z.__)("Offer Conversions is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,e.createElement)(gw.A,{options:s,series:o,type:"area",height:305}))))},gD=function({flowStats:a,selectedFlow:r}){const n=a?.steps_conversion?.visits||[],i=(0,t.useMemo)((()=>n&&n.map(((t,a)=>{const r=t?.visits,n=[r?.total_visits,r?.unique_visits,"thankyou"!==t?.type?r?.conversions:"-","thankyou"!==t?.type?r?.conversion_rate+" %":"-",["thankyou","optin","landing"].includes(t?.type)?"-":wr(r?.revenue)];return(0,e.createElement)("tr",{key:t?.id||a},(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},t?.title||t?.name||"-"),n.map(((t,a)=>(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900",key:a},t))))}))),[n]);return(0,e.createElement)("div",{className:"mt-8 bg-white rounded-lg shadow-sm p-6"},(0,e.createElement)("h2",{className:"text-lg font-semibold mb-4"},a?.steps_conversion?.flow_name||(0,z.__)("Funnel Name","cartflows")),wcfCartflowsTypePro()?(0,e.createElement)("div",{className:"overflow-x-auto"},(0,e.createElement)("table",{className:"min-w-full divide-y divide-gray-200 border border-gray-200 rounded-md"},(0,e.createElement)("thead",{className:"bg-gray-50"},(0,e.createElement)("tr",null,(0,e.createElement)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Steps","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Total Visits","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Unique Visits","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Conversions","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Conversion Rate","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Revenue","cartflows")))),(0,e.createElement)("tbody",{className:"bg-white divide-y divide-gray-200"},r.value?n&&0!==n.length?i:(0,e.createElement)("tr",null,(0,e.createElement)("td",{colSpan:"6",className:"px-6 py-4 text-center text-sm text-gray-500"},(0,z.__)("No data available","cartflows"))):(0,e.createElement)("tr",null,(0,e.createElement)("td",{colSpan:"6",className:"text-center px-8 py-12"},(0,e.createElement)("div",{className:"flex flex-col w-full items-center"},(0,e.createElement)("div",{className:"flex justify-center mb-3"},(0,e.createElement)(Gx,{className:"h-6 w-6 text-primary-500"})),(0,e.createElement)("h3",{className:"mt-2 text-base font-medium text-gray-900"},(0,z.__)("This section lists funnel conversion data.","cartflows")),(0,e.createElement)("p",{className:"mt-1 text-sm text-gray-500"},(0,z.__)("This is where your funnel drop-off statistics will appear","cartflows")))))))):(0,e.createElement)("div",{className:"overflow-x-auto relative min-h-[320px]"},(0,e.createElement)(pw,{title:(0,z.__)("Step Drop-off is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full inset-0 flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:"blur-[2px]"},(0,e.createElement)(_w,{dummy_data_type:"step"}))))},pD=function({flowStats:a,selectedFlow:r}){const n=a?.products||[],i=(0,t.useMemo)((()=>n&&n.map(((t,a)=>{const r=[t?.total_orders?t?.total_orders:"0",t?.conversions?t?.conversions:"0",t?.conversion_rate?t?.conversion_rate+" %":"0 %",wr(t?.revenue)];return(0,e.createElement)("tr",{key:t?.product_id||a},(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900"},(0,e.createElement)("div",{className:"flex items-center gap-2"},(0,e.createElement)("span",null,t?.product_title||t?.name||"-"),t?.product_type&&((n=t.product_type)?(0,e.createElement)("span",{className:"wcf-badge bg-primary-25 border border-primary-300 text-primary-600 rounded-2xl text-[11px] leading-4 cursor-default font-normal ml-2 capitalize"},n||""):null))),r.map(((t,a)=>(0,e.createElement)("td",{className:"px-6 py-4 whitespace-nowrap text-center text-sm text-gray-900",key:a},t))));var n}))),[n]);return(0,e.createElement)("div",{className:"mt-8 bg-white rounded-lg shadow-sm p-6"},(0,e.createElement)("h2",{className:"text-lg font-semibold mb-4"},(0,z.__)("Product Details","cartflows")),wcfCartflowsTypePro()?(0,e.createElement)("div",{className:"overflow-x-auto"},(0,e.createElement)("table",{className:"min-w-full divide-y divide-gray-200 border border-gray-200 rounded-md"},(0,e.createElement)("thead",{className:"bg-gray-50"},(0,e.createElement)("tr",null,(0,e.createElement)("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Product Name","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("No. of Orders","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Conversions","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Conversion Rate","cartflows")),(0,e.createElement)("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider"},(0,z.__)("Revenue","cartflows")))),(0,e.createElement)("tbody",{className:"bg-white divide-y divide-gray-200"},r.value?n&&0!==n.length?i:(0,e.createElement)("tr",null,(0,e.createElement)("td",{colSpan:"5",className:"px-6 py-4 text-center text-sm text-gray-500"},(0,z.__)("No data available","cartflows"))):(0,e.createElement)("tr",null,(0,e.createElement)("td",{colSpan:"5",className:"text-center px-8 py-12"},(0,e.createElement)("div",{className:"flex flex-col w-full items-center"},(0,e.createElement)("div",{className:"flex justify-center mb-3"},(0,e.createElement)(Gx,{className:"h-6 w-6 text-primary-500"})),(0,e.createElement)("h3",{className:"mt-2 text-base font-medium text-gray-900"},(0,z.__)("This section lists product conversion data.","cartflows")),(0,e.createElement)("p",{className:"mt-1 text-sm text-gray-500"},(0,z.__)("This is where your funnel drop-off statistics will appear","cartflows")))))))):(0,e.createElement)("div",{className:"overflow-x-auto relative min-h-[320px]"},(0,e.createElement)(pw,{title:(0,z.__)("Product Drop-off is a Premium Feature","cartflows"),containerClass:"bg-[#1d29390d] bg-opacity-25 absolute z-10 w-full h-full inset-0 flex border border-gray-200",innerContainerClass:"border border-gray-200 shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-white"}),(0,e.createElement)("div",{className:"blur-[2px]"},(0,e.createElement)(Iw,null))))},fD=function(){const[{analyticsData:a},r]=l(),n=a?.flow_stats||{},i=n?.comparison||[],[s,o]=(0,t.useState)(),[c,u]=(0,t.useState)(!0),[d,m]=(0,t.useState)("total_visitors"),[g,p]=(0,t.useState)({value:"",label:(0,z.__)("All Flows","cartflows")}),[f,h]=(0,t.useState)("previous-period"),[M,y]=(0,t.useState)({from:null,to:null}),[N,w]=(0,t.useState)(!1),{flows:x,loading:b}=Jb(),D=(0,t.useCallback)((e=>({total_visitors:"total_visits",total_conversions:"total_conversions",total_bump_conversions:"total_bump_conversions",offer_conversions:"total_offer_conversions",laptop_conversion_rate:"total_desktop_conversions",mobile_conversion_rate:"total_mobile_conversions"}[e])),[]),v=(0,t.useCallback)(((e,t,a,n="previous-period")=>{u(!0);const i=new window.FormData;i.append("date_to",t),i.append("date_from",e),a&&i.append("flow_id",a),i.append("comparison_range_type",n),i.append("screen_type","conversions"),i.append("action","cartflows_get_all_flows_stats"),i.append("security",cartflows_admin.get_all_flows_stats_nonce),A()({url:cartflows_admin.ajax_url,method:"POST",body:i}).then((e=>{r({type:"SET_ANALYTICS_DATA",analyticsData:e.data}),u(!1)})).catch((e=>{console.error("API Error:",e),u(!1)}))}),[r]),j=(0,t.useCallback)((({startDate:e,endDate:t})=>{const a=e.toISOString().split("T")[0],r=t.toISOString().split("T")[0];o($b(e,t)),y({from:a,to:r}),v(a,r,g.value,f)}),[g.value,v,f]);(0,t.useEffect)((()=>{const e=new Date,t=new Date;t.setDate(t.getDate()-7),o($b(t,e));const a=t.getFullYear()+"-"+String(t.getMonth()+1).padStart(2,"0")+"-"+String(t.getDate()).padStart(2,"0"),r=e.getFullYear()+"-"+String(e.getMonth()+1).padStart(2,"0")+"-"+String(e.getDate()).padStart(2,"0");y({from:a,to:r}),v(a,r,"",f),w(!0)}),[]),(0,t.useEffect)((()=>{N&&M.from&&M.to&&v(M.from,M.to,g.value,f)}),[g.value,N]),(0,t.useEffect)((()=>{N&&M.from&&M.to&&v(M.from,M.to,g.value,f)}),[f]);const _=new Date,I=_.toISOString().slice(0,10);_.setDate(_.getDate()-7);const E=_.toISOString().slice(0,10),L=Kb(z.__),T=(0,t.useMemo)((()=>[{name:(0,z.__)("Total Visitors","cartflows"),stat:n?.total_visits?n?.total_visits:0,tooltip:(0,z.__)("This shows the total number of visitors for the selected funnel/s.","cartflows"),icon:(0,e.createElement)(oD,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"total_visitors"},{name:(0,z.__)("Total Conversions","cartflows"),stat:n?.total_conversions?n?.total_conversions:0,tooltip:(0,z.__)("This shows the total conversions for the selected funnel.","cartflows"),icon:(0,e.createElement)(Hb,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"total_conversions"},{name:(0,z.__)("Bump Conversions","cartflows"),stat:n?.total_bump_conversions?n?.total_bump_conversions:0,tooltip:(0,z.__)("This shows the order bump conversions for the selected funnel.","cartflows"),icon:(0,e.createElement)(kb,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"total_bump_conversions"},{name:(0,z.__)("Offer Conversions","cartflows"),stat:n?.total_offer_conversions?n?.total_offer_conversions:0,tooltip:(0,z.__)("This shows the total offer conversions from Upsell and Downsell combined for the selected funnel.","cartflows"),icon:(0,e.createElement)(Ob,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"offer_conversions"},{name:(0,z.__)("Laptop Conversions","cartflows"),stat:n?.total_desktop_conversions?n?.total_desktop_conversions:0,tooltip:(0,z.__)("This shows the orders completed on large-screen devices (over 1024px).","cartflows"),icon:(0,e.createElement)(bw,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"laptop_conversion_rate"},{name:(0,z.__)("Mobile Conversions","cartflows"),stat:n?.total_mobile_conversions?n?.total_mobile_conversions:0,tooltip:(0,z.__)("This shows orders completed on mobile and small-screen devices (under 1024px).","cartflows"),icon:(0,e.createElement)(bw,{className:"w-8 h-8 sm:w-8 sm:h-8 stroke-1 text-primary-500 hover:text-primary-600"}),graphType:"mobile_conversion_rate"}]),[g.value,n]),k=(0,t.useCallback)((function(){if(!s)return null;switch(d){case"total_visitors":return(0,e.createElement)(fw,{dateRange:s});case"total_conversions":return(0,e.createElement)(uD,{dateRange:s});case"total_bump_conversions":return(0,e.createElement)(dD,{dateRange:s});case"offer_conversions":return(0,e.createElement)(mD,{dateRange:s});case"laptop_conversion_rate":return(0,e.createElement)(lD,{dateRange:s});case"mobile_conversion_rate":return(0,e.createElement)(cD,{dateRange:s});default:return(0,e.createElement)(Mw,{dateRange:s})}}),[d,s]);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Gb,{title:(0,z.__)("Conversions","cartflows"),selectedFlow:g,onFlowChange:p,flowOptions:x,flowsLoading:b,dateValue:{endDate:I,startDate:E},onDateChange:j,comparisonPeriod:f,onComparisonPeriodChange:h,comparisonPeriodOptions:L}),(0,e.createElement)("section",{"aria-labelledby":"section-1-title h-full"},(0,e.createElement)("div",{className:"p-8 rounded-t-xl bg-white overflow-hidden shadow-sm flex flex-col justify-center h-full"},(0,e.createElement)("div",{className:"wcf-analytics--stats-tabs-container"},(0,e.createElement)("div",{className:"wcf-analytics--stats-tabs m-0"},(0,e.createElement)("div",{className:"gap-5 grid sm:grid-cols-4 grid-cols-2 w-full"},T.map((t=>{const a=D(t.graphType),r=i?.[a]||0,n=qb(t.stat,r);return(0,e.createElement)(Vb,{key:t.name,item:t,isActive:d===t.graphType,onClick:()=>m(t.graphType),trend:n,showProBadge:!wcfCartflowsTypePro()})}))))),(0,e.createElement)("div",{className:"mt-8 bg-white rounded-lg shadow-sm"},(c||!a)&&(0,e.createElement)("div",{className:"animate-pulse"},(0,e.createElement)("div",{className:"h-64 bg-gray-200 rounded"})),a&&!c&&(0,e.createElement)("div",{className:"wcf-analytics--tab-content"},k()))),(0,e.createElement)(gD,{flowStats:n,selectedFlow:g}),(0,e.createElement)(pD,{flowStats:n,selectedFlow:g})))},hD=function(){const t=(0,f.useLocation)();let a;switch(new URLSearchParams(t.search).get("type")||"flows"){case"flows":default:a=(0,e.createElement)(eD,null);break;case"optin":a=(0,e.createElement)(iD,null);break;case"conversion":a=(0,e.createElement)(fD,null)}return(0,e.createElement)("div",null,a)},MD=function(){const[a,r]=(0,t.useState)({errorFor:!1,errorMsg:!1}),{errorFor:n,errorMsg:i}=a,s=(e,t="plugin")=>"activated"===e?"":"installed"===e||"inactive"===e?"cartflows_recommended_"+t+"_activate":"cartflows_recommended_"+t+"_install",o=function(e){let t="";switch(e){case"active":t=(0,z.__)("Active","cartflows");break;case"inactive":t=(0,z.__)("Activate","cartflows");break;default:t=(0,z.__)("Install","cartflows")}return t},l=e=>{e.preventDefault();const t=e.target.dataset.action,a=e.target.dataset.is_pro,r=e.target.dataset.page_link,n=e.target.dataset.status;if("true"!==a.toLowerCase()||"not-installed"!==n)switch(t){case"cartflows_recommended_plugin_activate":d(e);break;case"cartflows_recommended_plugin_install":e.target.innerText=(0,z.__)("Installing…","cartflows"),u(e,"install-plugin")}else window.open(r,"_blank","noopener,noreferrer")},c=e=>{switch(e.target.dataset.action){case"cartflows_recommended_theme_activate":m(e);break;case"cartflows_recommended_theme_install":e.target.innerText=(0,z.__)("Installing…","cartflows"),u(e,"install-theme"),m(e)}},u=(e,t)=>new Promise(((a,n)=>{wp.updates.queue.push({action:t,data:{slug:e.target.dataset.slug,success(t){e.target.innerText=(0,z.__)("Installed","cartflows"),a(t,e.target.dataset),d(e)},error(t){n(t,e.target.dataset),e.target.innerText=(0,z.__)("Failed","cartflows"),r({errorFor:`${e.target.dataset.slug}_error`,errorMsg:t?.errorMessage}),setTimeout((function(){e.target.innerText=(0,z.__)("Install","cartflows"),r({errorFor:!1,errorMsg:!1})}),1500)}}}),wp.updates.queueChecker()})),d=e=>{const t=new window.FormData;t.append("action","cartflows_activate_plugin"),t.append("init",e.target.dataset.init),t.append("security",cartflows_admin.activate_plugin_nonce),e.target.innerText=(0,z.__)("Activating…","cartflows"),A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{e.target.className="",e.target.className="text-green-600 pointer-events-none capitalize text-sm leading-[0.875rem] font-medium rounded-md py-[0.5625rem]",e.target.innerText=(0,z.__)("Activated","cartflows"),e.target.dataset.redirection&&(window.location=e.target.dataset.redirection)}))},m=e=>{const t=new window.FormData;t.append("action","cartflows_activate_theme"),t.append("theme_slug",e.target.dataset.slug),t.append("security",cartflows_admin.activate_theme_nonce),e.target.innerText=(0,z.__)("Activating…","cartflows"),A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{e.target.classList.add("wcf-activated-theme","text-green-600","pointer-events-none","!px-0"),e.target.classList.remove("wcf-button","wcf-secondary-button"),e.target.innerText=(0,z.__)("Activated","cartflows");const t=document.querySelectorAll(".recommended-themes-wrapper .wcf-activated-theme");Array.from(t).forEach((function(t){t!==e.target&&(t.innerText=(0,z.__)("Activate","cartflows"),t.classList.remove("wcf-activated-theme","text-green-600","pointer-events-none"),t.classList.remove("!px-0"),t.classList.add("wcf-button","wcf-secondary-button"))}))}))},g=cartflows_admin.integrations.plugins.map(((t,a)=>(0,e.createElement)("div",{key:a,className:"box-border bg-white relative border rounded-md px-4 py-4 flex items-start gap-x-4 snap-start"},(0,e.createElement)("div",{className:"flex w-full justify-start gap-1.5"},(0,e.createElement)("div",{className:""},t.logoPath&&(0,e.createElement)("img",{src:t.logoPath.icon_path,className:"w-10 h-10 min-w-[40px] min-h-[40px]",alt:t.title})),(0,e.createElement)("div",{className:"w-full sm:ml-3 ml-0"},(0,e.createElement)("div",{className:"text-base flex justify-between gap-2 font-semibold text-gray-900"},t.title,t.hot_badge&&(0,e.createElement)("span",{className:"bg-[#faeddb] py-[4px] px-[10px] self-center text-xs text-primary-600 rounded-3xl"},(0,e.createElement)("span",null,(0,z.__)("Hot","cartflows")))),(0,e.createElement)("p",{className:"text-sm whitespace-break-spaces font-normal text-gray-600 flex mt-2"},t.subtitle),(0,e.createElement)("div",{className:"mt-4 flex items-center gap-3"},(0,e.createElement)("button",{"data-slug":t.slug,"data-redirection":t.redirection,"data-action":s(t.status,"plugin"),"data-status":t.status,"data-is_pro":t.isPro,"data-page_link":t.link,"data-init":t.path,onClick:l,className:br()("active"===t.status?"text-green-600 pointer-events-none !px-0":"wcf-button wcf-secondary-button px-[0.8125rem]","text-sm py-1.5")},t.isPro&&"not-installed"===t.status?(0,z.__)("Let's Go","cartflows"):o(t.status)),n===`${t.slug}_error`&&i&&(0,e.createElement)("p",{id:`${t.slug}_error`,className:"text-xs text-primary-500"},i))))))),p=cartflows_admin.integrations.themes.map(((t,a)=>(0,e.createElement)("div",{key:a,className:br()(t.isPro?"bg-slate-50":"bg-white","box-border relative border rounded-md px-5 py-4 flex items-start gap-x-4 snap-start")},(0,e.createElement)("div",{className:"flex justify-between gap-1.5"},(0,e.createElement)("div",{className:""},t.logoPath&&(0,e.createElement)("img",{src:t.logoPath.icon_path,className:"w-10 h-10 min-w-[40px] min-h-[40px]",alt:t.title})),(0,e.createElement)("div",{className:"ml-3"},(0,e.createElement)("div",{className:"text-base font-semibold text-gray-900"},t.title),(0,e.createElement)("p",{className:"text-sm font-normal text-gray-600 flex mt-2"},t.subtitle),(0,e.createElement)("div",{className:"mt-4 flex items-center gap-3"},(0,e.createElement)("button",{"data-slug":t.slug,"data-redirection":t.redirection,"data-action":s(t.status,"theme"),onClick:c,className:br()("active"===t.status?"wcf-activated-theme text-green-600 pointer-events-none !px-0":"wcf-button wcf-secondary-button px-[0.8125rem]","text-sm py-1.5")},o(t.status)),n===`${t.slug}_error`&&i&&(0,e.createElement)("p",{id:`${t.slug}_error`,className:"text-xs text-primary-500"},i)))))));return(0,e.createElement)("section",{"aria-labelledby":"section-1-title h-full"},(0,e.createElement)("div",{className:"p-8 rounded-md bg-white overflow-hidden shadow-sm flex flex-col justify-center h-full"},(0,e.createElement)("div",{className:"recommended-plugins-block"},(0,e.createElement)("div",{className:"relative w-full lg:flex lg:items-center lg:justify-between"},(0,e.createElement)("span",{className:"font-semibold text-xl leading-6 text-slate-800"},(0,z.__)("Recommended Plugins","cartflows"))),(0,e.createElement)("div",{className:"grid grid-flow-row auto-rows-min grid-cols-1 gap-8 sm:grid-cols-2 lg:grid-cols-3 py-6"},g)),(0,e.createElement)("div",{className:"recommended-themes-block mt-8"},(0,e.createElement)("div",{className:"relative w-full lg:flex lg:items-center lg:justify-between"},(0,e.createElement)("span",{className:"font-semibold text-xl leading-6 text-slate-800"},(0,z.__)("Recommended Themes","cartflows"))),(0,e.createElement)("div",{className:"grid grid-flow-row auto-rows-min grid-cols-1 gap-8 sm:grid-cols-2 lg:grid-cols-3 py-6"},p))))},yD=function(){return(0,e.createElement)("div",{className:"wcf-recommended-plugins-wrapper"},(0,e.createElement)(MD,null))},ND=cartflows_admin.default_page_builder,wD=cartflows_admin.required_plugins,xD=cartflows_admin.required_plugins[ND],bD={};bD[ND]=Object.values(cartflows_admin.flows_and_steps);const DD={};DD[ND]=Object.values(cartflows_admin.store_checkout_flows_and_steps);const vD={default_page_builder:ND,page_builder_group_data:wD,page_builder_group:xD,preview:{},woocommerce_status:cartflows_admin.woocommerce_status,requiredPluginsData:cartflows_admin.required_plugins_data,missingPlugins:cartflows_admin.is_any_required_plugins_missing,flow_count:4,cf_pro_status:cartflows_admin.cf_pro_status,all_flows:{...bD},store_checkout_flows:{...DD},all_step_templates:(()=>{const e=[],t=cartflows_admin.flows_and_steps;return t&&t.forEach((t=>{t.steps.forEach((a=>{a.template_ID=t.ID,a.template_type=t.type,e.push(a)}))})),e})(),currentFlowSteps:Object.values(cartflows_admin.currentFlowSteps).length?cartflows_admin.currentFlowSteps["wcf-steps"]:[],flowsCount:(()=>{if(!Object.values(cartflows_admin.flows_count).length)return 0;let e=0;for(status in cartflows_admin.flows_count)"publish"===status&&(e+=parseInt(cartflows_admin.flows_count[status]));return e})(),currentFlowId:cartflows_admin.flow_id,selectedStep:"",license_status:cartflows_admin.license_status,stepTypes:{landing:"Landing",checkout:"Checkout",upsell:"Upsell",downsell:"Downsell",thankyou:"Thank You",optin:"Optin"},storeStepTypes:{upsell:"Upsell",downsell:"Downsell",thankyou:"Thank You"}},{registerStore:jD}=wp.data;jD("wcf/importer",{reducer:(e=vD,t)=>"SET_MISSING_PLUGINS"===t.type?(console.log("SET_MISSING_PLUGINS",t),{...e,missingPlugins:t.missingPlugins}):"UPDATE_WOOCOMMERCE_STATUS"===t.type?(console.log("UPDATE_WOOCOMMERCE_STATUS",t),{...e,woocommerce_status:t.woocommerce_status}):"UPDATE_CF_PRO_STATUS"===t.type?(console.log("UPDATE_CF_PRO_STATUS",t),{...e,cf_pro_status:t.cf_pro_status}):"SET_SELECTED_STEP"===t.type?(console.log("SET_SELECTED_STEP",t),{...e,selectedStep:t.selectedStep}):"SET_PREVIEW"===t.type?(console.log("SET_PREVIEW",t),{...e,preview:t.preview}):"SET_REQUIRED_PLUGINS"===t.type?(e.requiredPluginsData[t.page_builder]=t.value,{...e}):"SET_ALL_FLOWS"===t.type?(e.all_flows[t.page_builder]=t.flows,{...e}):e,actions:{updateWooCommerceStatus:e=>({type:"UPDATE_WOOCOMMERCE_STATUS",woocommerce_status:e}),updateCFProStatus:e=>({type:"UPDATE_CF_PRO_STATUS",cf_pro_status:e}),setMissingPlugins:e=>({type:"SET_MISSING_PLUGINS",missingPlugins:e}),setPreview:e=>({type:"SET_PREVIEW",preview:e}),setSelectedStep:e=>({type:"SET_SELECTED_STEP",selectedStep:e}),setRequiredPlugins:(e,t)=>({type:"SET_REQUIRED_PLUGINS",page_builder:e,value:t}),setAllFlows:(e,t)=>({type:"SET_ALL_FLOWS",flows:e,page_builder:t})},selectors:{getCount:({age:e})=>e,getAllFlows:({all_flows:e})=>e,getStoreCheckoutFlows:({store_checkout_flows:e})=>e,getFlowsList:({all_flows:e},t)=>e[t]?e[t]:[],getStoreCheckoutFlowsList:({store_checkout_flows:e},t)=>e[t]?e[t]:[],getAllStepTemplates:({all_step_templates:e})=>e,isLimitReached:({cf_pro_status:e,flow_count:t})=>("not-installed"===e||"inactive"===e)&&t>=3,getFlowsCount:({})=>0,getcurrentFlowId:({currentFlowId:e})=>e,getLicenseStatus:({license_status:e})=>e,getselectedStepTitle:({stepTypes:e,selectedStep:t})=>e[t]||"",getselectedStep:({selectedStep:e})=>e,getstepTypes:({stepTypes:e})=>e,getStoreStepTypes:({storeStepTypes:e})=>e,getcurrentFlowSteps:({currentFlowSteps:e})=>e,getMissingPlugins:({missingPlugins:e})=>e,getPreview:({preview:e})=>e,getWooCommerceStatus:({woocommerce_status:e})=>e,getDefaultPageBuilder:({default_page_builder:e})=>e,getPageBuilderGroup:({page_builder_group:e})=>e,getFlowCount:({flow_count:e})=>e,getCFProStatus:({cf_pro_status:e})=>e,getCurrentPageBuilderData:({page_builder_group_data:e},t)=>e[t],getRequiredPluginsData:({requiredPluginsData:e})=>e}});const _D=(0,Ay.compose)((0,zy.withDispatch)((e=>{const{setPreview:t}=e("wcf/importer");return{setPreview(e){t(e)}}})))((function({item:t,setPreview:a}){const{thumbnail_image_url:r,title:n,type:i}=t;return(0,e.createElement)("div",{className:"wcf-flow-template--item group relative cursor-pointer transition ease-in-out delay-150",onClick:()=>a(t)},"pro"===i?(0,e.createElement)("div",{className:`z-10 wcf-badge wcf-badge--info absolute top-5 right-5 text-xs uppercase font-medium py-px px-2 shadow-custom-2 wcf-item__type--${i}`},(0,e.createElement)("span",null,i," ")):"",(0,e.createElement)("div",{className:"wcf-item__inner bg-white border border-gray-200 rounded-lg"},(0,e.createElement)("div",{className:"wcf-item__thumbnail-wrap sm:max-h-96 max-h-56 overflow-hidden relative"},(0,e.createElement)("div",{className:"wcf-item__thumbnail overflow-hidden"},(0,e.createElement)("img",{className:"wcf-flow-template--thumbnail-image",src:r,title:n,alt:n})),(0,e.createElement)("div",{className:"wcf-item__view invisible group-hover:visible absolute backdrop-brightness-50 top-0 w-full h-full transition ease-in-out delay-150"},(0,e.createElement)("div",{className:"mx-auto my-0 text-center flex flex-col gap-4 relative top-1/2"},(0,e.createElement)("div",{className:"wcf-item__btn"},(0,e.createElement)("span",{className:"wcf-button wcf-primary-button"},(0,e.createElement)(NN,{className:"h-18 w-18 stroke-2"}),(0,z.__)("View All Steps","cartflows")))))),(0,e.createElement)("div",{className:"wcf-item__heading-wrap border-t border-gray-200"},(0,e.createElement)("div",{className:"wcf-item__heading text-base text-gray-800 font-medium p-4 text-center"},n))))}));function ID({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 12h-15m0 0 6.75 6.75M4.5 12l6.75-6.75"}))}const ED=t.forwardRef(ID);function LD({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15M9 12l3 3m0 0 3-3m-3 3V2.25"}))}const TD=t.forwardRef(LD),AD=function({item:t,setPreviewImageURL:a,currentPreviewID:r,setCurrentPreviewID:n}){const{ID:i,title:s,type:o,thumbnail_image_url:l,featured_image_url:c}=t,u="wcf-item__inner rounded-lg cursor-pointer "+(r===i?"wcf-item__inner--active border border-primary-500":"");return(0,e.createElement)("div",{className:"wcf-item wcf-item--preview mb-8"},"pro"===o?(0,e.createElement)("span",{className:`wcf-item__type wcf-item__type--${o}`},o):"",(0,e.createElement)("div",{className:u,onClick:()=>{a(c),n(i)}},(0,e.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,e.createElement)("div",{className:"wcf-item__thumbnail max-h-[200px] overflow-hidden"},(0,e.createElement)("img",{className:"wcf-item__thumbnail-image rounded-lg",src:`${l}`,alt:(0,z.__)("Funnel thumbnail image","cartflows")}))),(0,e.createElement)("div",{className:"wcf-item__heading-wrap p-4 bg-white border-t border-gray-200 rounded-bl-lg rounded-br-lg"},(0,e.createElement)("div",{className:"wcf-item__heading text-gray-800 text-sm font-medium"},s))))},zD=(0,Ay.compose)((0,zy.withSelect)((e=>{const{getPreview:t}=e("wcf/importer");return{preview:t()}})),(0,zy.withDispatch)((e=>{const{setPreview:t}=e("wcf/importer");return{setPreview:t}})))((function({preview:a,setPreview:r}){const{featured_image_url:n,steps:i}=a,s=cartflows_admin.template_library_url+"preview/?flow="+a.ID,o=Object.values(i),l=o.length?o[0].ID:"",[c,u]=(0,t.useState)(n),[d,m]=(0,t.useState)(l),[g,p]=(0,t.useState)("hide"),[f,h]=(0,t.useState)("");return window.scrollTo(0,0),(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-flow-preview-wrap sm:mx-24 mx-0"},(0,e.createElement)("div",{className:"wcf-flow-preview--header flex justify-between items-center mb-8 sm:px-6 p-0 sm:flex-row flex-col gap-4"},(0,e.createElement)("div",{className:"wcf-flow-preview--left-section flex justify-between items-center gap-4"},(0,e.createElement)("span",{className:"wcf-button--back cursor-pointer",onClick:()=>r({})},(0,e.createElement)(ED,{className:"w-6 h-6 stroke-2 text-gray-400"}),(0,e.createElement)("span",{className:"wcf-flows-header__text sr-only"},(0,z.__)("Back","cartflows"))),(0,e.createElement)("h3",{className:"text-2xl text-gray-800 font-semibold"},(0,z.__)("Funnel Preview","cartflows"))),(0,e.createElement)("div",{className:"wcf-flow-preview--right-section"},(0,e.createElement)("div",{className:"wcf-flow-preview__actions flex justify-between items-center gap-4"},(0,e.createElement)("a",{className:"wcf-button wcf-secondary-button",href:s,target:"_blank",rel:"noreferrer"},(0,e.createElement)(NN,{className:"w-18 h-18 stroke-2"}),(0,z.__)("Live Preview","cartflows")),(0,e.createElement)("button",{type:"button",className:"wcf-button wcf-primary-button",onClick:()=>{p("hide"===g?"show":"hide")}},(0,e.createElement)(TD,{className:"w-18 h-18 stroke-2"}),(0,z.__)("Import Funnel","cartflows")),(0,e.createElement)(sw,{visibility:g,setVisibility:p,preview:a,type:"import",flowName:f,setFlowName:h})))),(0,e.createElement)("div",{className:"wcf-flow-preview flex sm:flex-row flex-col-reverse"},(0,e.createElement)("div",{className:"wcf-flow-preview__item w-full sm:w-4/5 sm:px-6 p-0"},(0,e.createElement)("div",{className:"wcf-window--header bg-white p-2 flex items-center rounded-tl-lg rounded-tr-lg"},(0,e.createElement)("div",{className:"wcf-window--buttons flex justify-start gap-1 items-center w-2/4"},(0,e.createElement)("span",{className:"bg-gray-200 rounded-full p-1"}),(0,e.createElement)("span",{className:"bg-gray-200 rounded-full p-1"}),(0,e.createElement)("span",{className:"bg-gray-200 rounded-full p-1"})),(0,e.createElement)("div",{className:"wcf-window--title capitalize text-xs font-medium text-gray-600 w-2/4 -ml-12"},`${o.find((e=>e.ID===d)).type} Page`)),(0,e.createElement)("div",{className:"wcf-flow-preview__inner max-h-screen overflow-y-scroll"},(0,e.createElement)("div",{className:"wcf-flow-preview__thumbnail-wrap"},(0,e.createElement)("img",{className:"wcf-flow-preview__thumbnail w-full",src:c,alt:(0,z.__)("Funnel Preview","cartflows")})))),(0,e.createElement)("div",{className:"wcf-flow-preview__list w-full sm:w-[20%] sm:px-6 p-0"},o.map((t=>(0,e.createElement)(AD,{key:t.ID,item:t,setPreviewImageURL:u,currentPreviewID:d,setCurrentPreviewID:m})))))))})),kD=(0,Ay.compose)((0,zy.withSelect)((()=>({page_builder_group:cartflows_admin.required_plugins[cartflows_admin?.page_builder],default_page_builder:cartflows_admin?.page_builder}))),(0,zy.withDispatch)((e=>{const{setRequiredPlugins:t,setAllFlows:a}=e("wcf/importer");return{setRequiredPlugins:t,setAllFlows:a}})))((({setRequiredPlugins:a,setAllFlows:r,default_page_builder:n,page_builder_group:i})=>{const[{page_builder:s}]=g(),[o,l]=(0,t.useState)(!1),c=new URLSearchParams((0,f.useLocation)()?.search);let u=c.get("path")?c.get("path"):"";"store-checkout-library"===u&&(u="store-checkout");const d=i.title;let m=`Please click here and activate ${d}`,p="";if("divi"===n){p=i["theme-status"];const e=i["plugin-status"];"deactivate"===p||"install"===e?m=`Please activate ${d}`:"deactivate"!==p&&"not-installed"!==p||"install"!==e||(m=`Please install and activate ${d}`)}function h(e){const t=new window.FormData;t.append("action","cartflows_activate_plugin"),t.append("init",e.init),t.append("security",cartflows_admin.activate_plugin_nonce),A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{l(!1),a(s,"no"),r([]),window.location.reload()}))}const[M,y]=(0,t.useState)("hide"),[N,w]=(0,t.useState)("");return(0,e.createElement)("div",{className:"wcf-flow-importer wcf-flow-library--other"},(0,e.createElement)("div",{className:"wcf-flow-library-importer__header bg-white px-8 py-6 flex justify-between items-center border-b border-gray-200"},(0,e.createElement)("h3",{className:"wcf-flow-importer__header-title text-2xl font-semibold text-gray-800"},(0,z.__)("Funnel Templates","cartflows"))),(0,e.createElement)("div",{className:"wcf-flow-library-importer__list bg-white px-10 py-14"},(0,e.createElement)(sw,{visibility:M,setVisibility:y,type:"blank",flowName:N,setFlowName:w}),(0,e.createElement)("div",{className:"wcf-item wcf-item--start-from-blank flex gap-6 mx-auto max-w-4xl"},(0,e.createElement)("div",{className:"wcf-item__inner relative cursor-pointer group bg-gray-25 p-5 text-center flex flex-col border border-gray-200 hover:border-primary-300 rounded-md items-center justify-center h-72 w-2/3",onClick:()=>{y("hide"===M?"show":"hide")}},(0,e.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,e.createElement)("div",{className:"wcf-item__thumbnail"},(0,e.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon bg-white p-6 rounded-full"},(0,e.createElement)(zr,{className:"wcf-icon-start-from-blank w-7 h-7 stroke-1 text-gray-400 group-hover:text-primary-300"})))),(0,e.createElement)("div",{className:"wcf-item__heading-wrap border-t border-gray-200 absolute bottom-0 w-full"},(0,e.createElement)("div",{className:"wcf-item__heading text-base text-gray-800 font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows")))),(0,e.createElement)("div",{className:"wcf_item__info flex flex-col gap-6 justify-center w-3/4"},(0,e.createElement)("h3",{className:"wcf_item__info--title text-2xl text-gray-800 font-semibold"},(0,z.__)("It seems that the page builder you selected is inactive.","cartflows")),(0,e.createElement)("p",{className:"wcf_item__info--notice text-base text-gray-600 font-normal"},o?(0,e.createElement)(ky,null):"",(0,e.createElement)("a",{href:"#",onClick:function(e){e.preventDefault(),console.log("clicked"),l(!0);const t=cartflows_admin.required_plugins[n].plugins;let a=0,r=0;for(const e of t)"install"===e.status&&a++,"activate"===e.status&&r++;a?function(e){console.log("Installing all plugins",e);for(const t of e)"install"===t.status&&(console.log("plugin.slug",t.slug),wp.updates.queue.push({action:"install-plugin",data:{slug:t.slug,init:t.init,name:t.name,success(){console.log("Installed Successfully! Activating plugin ",t.slug),h(t)},error(){}}}));wp.updates.queueChecker()}(t):r&&(console.log("remaining_active_plugins",r),function(e){for(const t of e)"activate"===t.status&&h(t)}(t))},className:"text-primary-500 hover:text-primary-600"},m),(0,z.__)(" to see CartFlows templates. If you prefer another page builder tool, you can ","cartflows"),(0,e.createElement)(I,{key:`?page=${cartflows_admin.home_slug}&path=${u}&settings=1`,to:{pathname:"admin.php",search:`?page=${cartflows_admin.home_slug}&path=${u}&settings=1`},onClick:function(e){e.preventDefault(),window.location=e.target.href},className:"text-primary-500 hover:text-primary-600"},(0,z.__)("select it here","cartflows")),"."),(0,e.createElement)("span",{className:"wcf_item__info--desc text-base text-gray-600 font-normal"},(0,z.__)("Are you using any other page builder? No worries. CartFlows works well with every other page builder. Right now we do not have ready templates for every page builder but we are planning to add it very soon.","cartflows")),(0,e.createElement)("a",{className:"wcf_item__info--doc text-gray-600 hover:text-primary-500 flex items-center gap-2 text-sm",href:"https://cartflows.com/docs/how-to-use-cartflows-with-your-own-template/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs",target:"_blank",rel:"noreferrer"},(0,z.__)("Learn How ","cartflows"),(0,e.createElement)("i",{className:"dashicons dashicons-external"}))))))})),SD=({text:t})=>(0,e.createElement)("span",{className:"wcf-sync__title"}," ",t),OD=(0,t.memo)((a=>{const r=(0,z.__)("Sync Library","cartflows"),{template:n}=a,i=n||"",[s,o]=(0,t.useState)({isProcessing:!1,buttonText:r}),{isProcessing:l,buttonText:c}=s,u=async(e,t)=>{const a=new window.FormData;a.append("action","cartflows_import_sites"),a.append("page_no",e),a.append("template",i),a.append("security",cartflows_admin.import_sites_nonce),await A()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then((a=>{console.log(a),a.success?(console.log("SUCCESS: processImportSites"),o({isProcessing:!0,buttonText:(0,z.sprintf)(/* translators: %d is replaced with the condition number */ /* translators: %d is replaced with the condition number */
(0,z.__)("Importing page %d","cartflows"),e)}),console.log("i === total"),console.log(`${e} === ${t}`),console.log(e===t),e===t&&(async()=>{const e=new window.FormData;e.append("action","cartflows_update_library_complete"),e.append("template",i),e.append("security",cartflows_admin.update_library_complete_nonce),o({isProcessing:!0,buttonText:(0,z.__)("Sync Complete","cartflows")}),await A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((e=>{console.log(e),e.success?(console.log("SUCCESS: processupdateLibraryComplete"),console.log("=== SYNC COMPLETE ==="),o({isProcessing:!1,buttonText:(0,z.__)("Sync Complete","cartflows")})):console.log("FAILED: processupdateLibraryComplete")})).catch((e=>{console.log(e),console.log("ERROR: processupdateLibraryComplete")}))})()):console.log("FAILED: processImportSites")})).catch((e=>{console.log(e),console.log("ERROR: processImportSites")}))};return(0,e.createElement)("span",{className:"wcf-sync wcf-button wcf-secondary-button whitespace-nowrap sm:whitespace-normal",onClick:e=>{e.preventDefault(),o({isProcessing:!0,buttonText:(0,z.__)("Syncing Library…","cartflows")}),(async()=>{console.log("Started");try{console.log("=== SYNC STARTED ===");const e=new window.FormData;e.append("action","cartflows_sync_library"),e.append("template",i),e.append("security",cartflows_admin.sync_library_nonce),await A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((e=>{console.log(e),e.success?(console.log("SUCCESS: processSyncLibrary"),"updated"===e.data?(o({isProcessing:!1,buttonText:(0,z.__)("Library Synced","cartflows")}),setTimeout((()=>{o({isProcessing:!1,buttonText:r})}),5e3)):(async()=>{const e=new window.FormData;e.append("action","cartflows_request_count"),e.append("template",i),e.append("security",cartflows_admin.request_count_nonce),await A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((async e=>{if(console.log(e),e.success){console.log("SUCCESS: processRequestCount"),console.log(e),o({isProcessing:!0,buttonText:"Importing Pages.."});const t=e.data.count;console.log("total",t);for(let e=1;e<=t;e++)console.log("i",e),u(e,t)}else console.log("FAILED: processRequestCount"),o({isProcessing:!1,buttonText:r})})).catch((e=>{console.log(e),console.log("ERROR: processRequestCount")}))})()):(console.log(e),console.log("FAILED: processSyncLibrary"))})).catch((e=>{console.log(e),console.log("ERROR: processSyncLibrary")}))}catch(e){console.log("Complete: Failed"),console.log(e)}})()}},l?(0,e.createElement)(ky,null):(0,e.createElement)(Sr,{className:"w-18 h-18 stroke-1"}),(0,e.createElement)(SD,{text:c}))})),CD=()=>{const[a,r]=(0,t.useState)("hide"),[n,i]=(0,t.useState)("");return(0,e.createElement)("div",{className:"wcf-flow-library-importer wcf-flow-library--other"},(0,e.createElement)("div",{className:"wcf-flow-library-importer__list bg-white px-10 py-14"},(0,e.createElement)(sw,{visibility:a,setVisibility:r,type:"blank",flowName:n,setFlowName:i}),(0,e.createElement)("div",{className:"wcf-item wcf-item--start-from-blank flex gap-6 mx-auto max-w-4xl"},(0,e.createElement)("div",{className:"wcf-item__inner relative cursor-pointer group bg-gray-25 p-5 text-center flex flex-col border border-gray-200 hover:border-primary-300 rounded-md items-center justify-center h-72 w-2/3",onClick:()=>{r("hide"===a?"show":"hide")}},(0,e.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,e.createElement)("div",{className:"wcf-item__thumbnail"},(0,e.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon bg-white p-6 rounded-full"},(0,e.createElement)(zr,{className:"w-7 h-7 stroke-1 text-gray-400 group-hover:text-primary-300"})))),(0,e.createElement)("div",{className:"wcf-item__heading-wrap border-t border-gray-200 absolute bottom-0 w-full"},(0,e.createElement)("div",{className:"wcf-item__heading text-base text-gray-800 font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows")))),(0,e.createElement)("div",{className:"wcf_item__info flex flex-col gap-6 justify-center w-3/4"},(0,e.createElement)("h3",{className:"wcf_item__info--title text-2xl text-gray-800 font-semibold"},(0,e.createElement)("h3",{className:"wcf_item__info--title"},(0,z.__)("No Results Found.","cartflows"))),(0,e.createElement)("span",{className:"wcf_item__info--desc text-base text-gray-600 font-normal mt-2"},(0,z.__)("Don't see a funnel that you would like to import?","cartflows")),(0,e.createElement)("a",{className:"wcf_item__info--doc text-sm text-gray-600 font-normal hover:text-primary-300 flex gap-1",href:"https://cartflows.com/funnel-suggestions/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=suggestions",target:"_blank",rel:"noreferrer"},(0,z.__)("Please suggest us ","cartflows"),(0,e.createElement)(NN,{className:"w-5 h-5 stroke-1 text-gray-400 hover:text-primary-300"}))))))},YD=function(){return(0,e.createElement)("div",{className:"wcf-flow-importer__list wcf-items-list grid grid-cols-2 sm:grid-cols-4 gap-6 is-placeholder"},(()=>{const t=[];for(let a=0;a<12;a++)t.push((0,e.createElement)("div",{className:"wcf-item"},(0,e.createElement)("div",{className:"relative p-4 w-full bg-white overflow-hidden shadow hover:shadow-md rounded-lg"},(0,e.createElement)("div",{className:"animate-pulse flex flex-col"},(0,e.createElement)("div",{className:"rounded w-full h-52 bg-gray-200"}),(0,e.createElement)("div",{className:"flex flex-col mt-5"},(0,e.createElement)("div",{className:"w-full h-5 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"mt-2 w-10/12 h-3 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"mt-2 w-8/12 h-3 bg-gray-200 rounded"})),(0,e.createElement)("div",{className:"grid grid-cols-2 mt-5 gap-x-2 gap-y-1"},(0,e.createElement)("div",{className:"mt-2 w-full h-3 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"mt-2 w-full h-3 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"mt-2 w-full h-3 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"mt-2 w-full h-3 bg-gray-200 rounded"})),(0,e.createElement)("div",{className:"flex items-center mt-5"},(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"rounded-full bg-gray-200 w-10 h-10"})),(0,e.createElement)("div",{className:"flex justify-between w-full ml-3"},(0,e.createElement)("div",{className:"w-5/12 h-3 bg-gray-200 rounded"}),(0,e.createElement)("div",{className:"w-2/12 h-3 bg-gray-200 rounded"})))))));return t})())},UD=(0,Ay.compose)((0,zy.withDispatch)((e=>{const{setAllFlows:t}=e("wcf/importer");return{setAllFlows:t}})))((function({setAllFlows:a}){let r="no";const[{page_builder:n}]=g(),[i,s]=(0,t.useState)(""),[o,l]=(0,t.useState)(!1),{currentPageBuilderData:c,requiredPluginsData:u,preview:d,all_flows:m,flows_list:p}=(0,zy.useSelect)((e=>({currentPageBuilderData:e("wcf/importer").getCurrentPageBuilderData(n),requiredPluginsData:e("wcf/importer").getRequiredPluginsData(),preview:e("wcf/importer").getPreview(),all_flows:e("wcf/importer").getAllFlows(),flows_list:e("wcf/importer").getFlowsList(n)})));if("yes"===u[n]&&c&&c?.plugins&&c?.plugins.map((function(e){return"install"!==e.status&&"activate"!==e.status||(r="yes"),""})),"yes"===r)return(0,e.createElement)(kD,null);(0,t.useEffect)((()=>{let e=!0;if(!m[n]){const t=new window.FormData;t.append("action","cartflows_get_flows_list"),t.append("security",cartflows_admin.get_flows_list_nonce),l(!0),(async()=>{A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((t=>{if(l(!1),e&&t?.data?.flows){const e=Object.values(t.data.flows);M(e),a(e,n)}}))})()}return()=>{e=!1}}),[m]);const f=(0,t.createRef)(),[h,M]=(0,t.useState)(p),[y,N]=(0,t.useState)("search"),w=function(e){if(e&&e.length>=3){N("cancel");const t=e.toLowerCase(),a=p.filter((function(e){return(e.title&&e.title.toLowerCase()||"").includes(t)}));s(e),M(a)}else N("search"),M(p)},[x,b]=(0,t.useState)("hide"),[D,v]=(0,t.useState)("");return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-flow-importer"},Object.keys(d).length?(0,e.createElement)(zD,null):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-flow-importer__header bg-white px-8 py-6 flex justify-between items-start sm:items-center mb-9 -m-8 sm:flex-row flex-col gap-3"},(0,e.createElement)("h3",{className:"wcf-flow-importer__header-title text-2xl font-semibold text-gray-800"},(0,z.__)("Choose a Funnel Templates","cartflows")),(0,e.createElement)("div",{className:"wcf-flow-importer__actions gap-4 flex justify-between items-center"},(0,e.createElement)("div",{className:"wcf-flow-importer__actions-content-left"},(0,e.createElement)("div",{className:"wcf-flow-importer__actions-search"},(0,e.createElement)("form",{className:"wcf-search-flows--form relative",onSubmit:function(e){e.preventDefault(),"cancel"===y&&(f.current.value="",w(""),s(""))}},(0,e.createElement)(_r,{attr:{ref:f},label:"",placeholder:(0,z.__)("Search Templates","cartflows"),class:"input-field !pl-8 !px-4 !py-3 text-sm font-normal !rounded-md text-gray-400 !border-gray-200 focus:ring focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none",id:"s",value:i,onChangeCB:w}),(0,e.createElement)("button",{className:"wcf-search__button absolute inset-y-0 left-0 flex items-center pl-3 bg-transparent cursor-pointer m-0 "+("cancel"===y?"top-1":"top-px")},"search"===y&&(0,e.createElement)(DN,{className:"w-18 h-18 stroke-2 text-gray-400"}),"cancel"===y&&(0,e.createElement)(Cr,{className:"w-18 h-18 stroke-2 text-gray-400"}))))),(0,e.createElement)("div",{className:"divider w-px bg-gray-200 h-7"}),(0,e.createElement)("div",{className:"wcf-flow-importer__actions-content-right"},(0,e.createElement)("div",{className:"wcf-flow-importer__actions-buttons"},(0,e.createElement)(OD,null))))),o&&(0,e.createElement)(YD,null),p.length>0&&0===h.length&&(0,e.createElement)(CD,null),(0,e.createElement)("div",{className:"wcf-flow-importer__list wcf-items-list grid grid-cols-1 sm:grid-cols-4 gap-6"},(0,e.createElement)(sw,{visibility:x,setVisibility:b,type:"blank",flowName:D,setFlowName:v}),(0,e.createElement)("div",{className:"wcf-item wcf-item__start-from-blank sm:h-full lg:h-full sm:min-h-full lg:min-h-full min-h-72 bg-white rounded-lg relative start-scratch"},(0,e.createElement)("div",{className:"wcf-item__inner relative cursor-pointer bg-gray-50 text-center h-full flex flex-col gap-4 items-center justify-center",onClick:()=>{b("hide"===x?"show":"hide")}},(0,e.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,e.createElement)("div",{className:"wcf-item__thumbnail"},(0,e.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon bg-white p-6 rounded-full"},(0,e.createElement)(zr,{className:"w-7 h-7 stroke-2 text-gray-400"})))),(0,e.createElement)("div",{className:"wcf-item__heading-wrap border-t border-gray-200 absolute bottom-0 w-full"},(0,e.createElement)("div",{className:"wcf-item__heading text-base text-gray-800 font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows"))))),p.length>0&&0(0,e.createElement)(_D,{key:t.ID,item:t})))))))})),QD=a=>{const[r,n]=(0,t.useState)("hide"),[i,s]=(0,t.useState)(""),o=a.page_builder;return(0,e.createElement)("div",{className:"wcf-flow-library-importer wcf-flow-library--other"},(0,e.createElement)("div",{className:"wcf-flow-library-importer__header bg-white px-8 py-6 flex justify-between items-center border-b border-gray-200"},(0,e.createElement)("h3",{className:"wcf-flow-importer__header-title text-2xl font-semibold text-gray-800"},(0,z.__)("Start from Scratch","cartflows"))),(0,e.createElement)("div",{className:"wcf-flow-library-importer__list bg-white px-10 py-14"},(0,e.createElement)(sw,{visibility:r,setVisibility:n,type:"blank",flowName:i,setFlowName:s}),(0,e.createElement)("div",{className:"wcf-item wcf-item--start-from-blank flex gap-6 mx-auto max-w-4xl"},(0,e.createElement)("div",{className:"wcf-item__inner relative cursor-pointer group bg-gray-25 p-5 text-center flex flex-col border border-gray-200 hover:border-primary-300 rounded-md items-center justify-center h-72 w-2/3",onClick:()=>{n("hide"===r?"show":"hide")}},(0,e.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,e.createElement)("div",{className:"wcf-item__thumbnail"},(0,e.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon bg-white p-6 rounded-full"},(0,e.createElement)(zr,{className:"w-7 h-7 stroke-1 text-gray-400 group-hover:text-primary-300"})))),(0,e.createElement)("div",{className:"wcf-item__heading-wrap border-t border-gray-200 absolute bottom-0 w-full"},(0,e.createElement)("div",{className:"wcf-item__heading text-base text-gray-800 font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows")))),(0,e.createElement)("div",{className:"wcf_item__info flex flex-col gap-6 justify-center w-3/4"},(0,e.createElement)("h3",{className:"wcf_item__info--title text-2xl text-gray-800 font-semibold"},"bricks-builder"===o&&(0,z.__)("It seems that you are using the Bricks Builder.","cartflows"),"other"===o&&(0,z.__)("It seems that you are using the page builder other than Elementor, Beaver Builder, Block Builder.","cartflows")),(0,e.createElement)("span",{className:"wcf_item__info--desc text-base text-gray-600 font-normal mt-2"},"bricks-builder"===o&&(0,z.__)("Are you using Bricks Builder? No worries. CartFlows works well with Bricks Builder. Right now we do not have ready templates for Bricks Builder but we are planning to add it very soon.","cartflows"),"other"===o&&(0,z.__)("Are you using any other page builder? No worries. CartFlows works well with every other page builder. Right now we do not have ready templates for every page builder but we are planning to add it very soon.","cartflows")),(0,e.createElement)("span",{className:"mt-2"},(0,e.createElement)("a",{className:"wcf_item__info--doc text-gray-600 hover:text-primary-500 flex items-center gap-2 text-sm",href:"https://cartflows.com/docs/how-to-use-cartflows-with-your-own-template/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs",target:"_blank",rel:"noreferrer"},(0,z.__)("Learn How ","cartflows"),(0,e.createElement)(NN,{className:"w-18 h-18 stroke-1"})))))))},PD=()=>{const[{page_builder:t}]=g();return"bricks-builder"!==t&&"other"!==t?(0,e.createElement)(UD,null):(0,e.createElement)(QD,{page_builder:t})},FD=function({item:t,setPreviewImageURL:a,currentPreviewID:r,setCurrentPreviewID:n}){const{ID:i,title:s,type:o,thumbnail_image_url:l,featured_image_url:c}=t,u="wcf-item__inner rounded-lg cursor-pointer "+(r===i?"wcf-item__inner--active border border-primary-500":"");return(0,e.createElement)("div",{className:"wcf-item wcf-item--preview mb-8"},"pro"===o?(0,e.createElement)("span",{className:`wcf-item__type wcf-item__type--${o}`},o):"",(0,e.createElement)("div",{className:u,onClick:()=>{a(c),n(i)}},(0,e.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,e.createElement)("div",{className:"wcf-item__thumbnail max-h-[200px] overflow-hidden"},(0,e.createElement)("img",{className:"wcf-item__thumbnail-image rounded-lg",src:`${l}`,alt:(0,z.__)("Funnel thumbnail image","cartflows")}))),(0,e.createElement)("div",{className:"wcf-item__heading-wrap p-4 bg-white border-t border-gray-200 rounded-bl-lg rounded-br-lg"},(0,e.createElement)("div",{className:"wcf-item__heading text-gray-800 text-sm font-medium"},s))))},RD=(0,Ay.compose)((0,zy.withSelect)((e=>{const{getPreview:t}=e("wcf/importer");return{preview:t()}})),(0,zy.withDispatch)((e=>{const{setPreview:t}=e("wcf/importer");return{setPreview:t}})))((function({preview:a,setPreview:r}){const{featured_image_url:n,steps:i}=a,s=cartflows_admin.template_library_url+"preview/?flow="+a.ID,o=[];Object.values(i).forEach((function(e){["checkout","thankyou"].includes(e.type)&&o.push(e)}));const l=o.length?o[0].ID:"",[c,u]=(0,t.useState)(n),[d,m]=(0,t.useState)(l),[g,p]=(0,t.useState)("");return window.scrollTo(0,0),(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-flow-preview-wrap sm:mx-24 mx-0"},(0,e.createElement)("div",{className:"wcf-flow-preview--header flex justify-between items-center mb-8 sm:px-6 p-0 sm:flex-row flex-col gap-4"},(0,e.createElement)("div",{className:"wcf-flow-preview--left-section flex justify-between items-center gap-4"},(0,e.createElement)("span",{className:"wcf-button--back cursor-pointer",onClick:()=>r({})},(0,e.createElement)(ED,{className:"w-6 h-6 stroke-2 text-gray-400"}),(0,e.createElement)("span",{className:"wcf-flows-header__text sr-only"}," ",(0,z.__)("Back","cartflows")," ")),(0,e.createElement)("h3",{className:"text-2xl text-gray-800 font-semibold"},(0,z.__)("Funnel Preview","cartflows"))),(0,e.createElement)("div",{className:"wcf-flow-preview--right-section"},(0,e.createElement)("div",{className:"wcf-flow-preview__actions flex justify-between items-center gap-4"},(0,e.createElement)("a",{className:"wcf-button wcf-secondary-button",href:s,target:"_blank",rel:"noreferrer"},(0,e.createElement)(NN,{className:"w-18 h-18 stroke-2"}),(0,z.__)("Live Preview","cartflows")),(0,e.createElement)(Nb,{preview:a,flowName:(0,z.__)("Store Checkout","cartflows"),inputFieldVisibility:g,setInputFieldVisibility:p,isStoreCheckout:!0})))),(0,e.createElement)("div",{className:"wcf-flow-preview flex sm:flex-row flex-col-reverse"},(0,e.createElement)("div",{className:"wcf-flow-preview__item w-full sm:w-4/5 sm:px-6 p-0"},(0,e.createElement)("div",{className:"wcf-window--header bg-white p-2 flex items-center rounded-tl-lg rounded-tr-lg"},(0,e.createElement)("div",{className:"wcf-window--buttons flex justify-start gap-1 items-center w-2/4"},(0,e.createElement)("span",{className:"bg-gray-200 rounded-full p-1"}),(0,e.createElement)("span",{className:"bg-gray-200 rounded-full p-1"}),(0,e.createElement)("span",{className:"bg-gray-200 rounded-full p-1"})),(0,e.createElement)("div",{className:"wcf-window--title capitalize text-xs font-medium text-gray-600 w-2/4"},`${o.find((e=>e.ID===d)).type} Page`)),(0,e.createElement)("div",{className:"wcf-flow-preview__inner max-h-screen overflow-y-scroll"},(0,e.createElement)("div",{className:"wcf-flow-preview__thumbnail-wrap"},(0,e.createElement)("img",{className:"wcf-flow-preview__thumbnail",src:c,alt:(0,z.__)("Funnel Preview","cartflows")})))),(0,e.createElement)("div",{className:"wcf-flow-preview__list w-full sm:w-[20%] sm:px-6 p-0"},o.map((t=>(0,e.createElement)(FD,{key:t.ID,item:t,setPreviewImageURL:u,currentPreviewID:d,setCurrentPreviewID:m})))))))})),HD=({preview:a,type:r,flowName:n,setInputFieldVisibility:i,cancelButtonRef:s,setVisibility:o})=>(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-flow--footer bg-primary-25 p-4 flex justify-end sm:px-4 gap-4"},"import"===r&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("button",{type:"button",className:"wcf-button wcf-secondary-button",onClick:()=>o("hide"),ref:s},(0,z.__)("Cancel","cartflows")),(0,e.createElement)(Nb,{preview:a,flowName:n,setInputFieldVisibility:i})),"blank"===r&&(0,e.createElement)(t.Fragment,null,(0,e.createElement)("button",{type:"button",className:"wcf-button wcf-secondary-button",onClick:()=>o("hide"),ref:s},(0,z.__)("Cancel","cartflows")),(0,e.createElement)(wb,{flowName:n,setInputFieldVisibility:i,isStoreCheckout:!0})))),BD=a=>{const{cf_pro_status:r,setVisibility:n,preview:i,type:s,setFlowName:o,cancelButtonRef:l}=a,[c,u]=(0,t.useState)("");return(0,e.createElement)(t.Fragment,null,(0,e.createElement)("div",{className:"wcf-name-your-flow--body fixed inset-0 z-30 overflow-y-auto"},(0,e.createElement)("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:items-center sm:p-0"},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},(0,e.createElement)(gr.Panel,{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full sm:max-w-lg"},(0,e.createElement)("div",{className:"wcf-name-your-flow--content bg-white px-4 pb-4 pt-5 sm:pt-4 sm:px-5 sm:pb-5"},(0,e.createElement)("div",{className:"wcf-name-your-flow--header absolute right-0 top-0 hidden pr-5 pt-4 sm:block"},(0,e.createElement)("button",{type:"button",className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none ",onClick:()=>{n("hide")},title:(0,z.__)("Close the window","cartflows")},(0,e.createElement)(Cr,{className:"h-18 w-18 stroke-2","aria-hidden":"true"}))),(0,e.createElement)("div",{className:"mt-3 text-center sm:mt-0 sm:text-left"},(0,e.createElement)(gr.Title,{as:"h3",className:"wcf-name-your-flow--title text-base font-medium text-gray-800"},(0,z.__)("Create Store Checkout","cartflows")),(0,e.createElement)("div",{className:"mt-4"},(0,e.createElement)("div",{className:"wcf-name-your-store-flow--content"},(0,e.createElement)("p",{className:"text-sm font-medium leading-6 text-gray-800 mb-4"},(0,z.__)("Set up a Store Checkout in just one click:","cartflows")),(0,e.createElement)("ul",{className:"text-sm text-gray-600 mb-4 list-inside"},(0,e.createElement)("li",{className:"flex gap-2 items-center"},(0,e.createElement)(Qy,{className:"h-18 w-18 text-primary-600","aria-hidden":"true"}),(0,z.__)("Checkout Page","cartflows")),(0,e.createElement)("li",{className:"flex gap-2 items-center"},(0,e.createElement)(Qy,{className:"h-18 w-18 text-primary-600","aria-hidden":"true"}),(0,z.__)("Thank You Page","cartflows"))),(0,e.createElement)("p",{className:"text-sm text-gray-500"},(0,z.__)("Use ready-made templates from the CartFlows Library, our custom widget, or shortcodes on each page to set this up easily—no coding needed!","cartflows")))))),(0,e.createElement)(HD,{cf_pro_status:r,setVisibility:n,preview:i,type:s,flowName:"Store Checkout",setFlowName:o,inputFieldVisibility:c,setInputFieldVisibility:u,cancelButtonRef:l}))))))},WD=(0,Ay.compose)((0,zy.withSelect)((e=>{const{getFlowsCount:t,getCFProStatus:a,getLicenseStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:a(),license_status:r()}})))((({visibility:a,setVisibility:r,preview:n,type:i,flowName:s,setFlowName:o,cf_pro_status:l})=>{const c=(0,t.useRef)(null);return"show"!==a?"":(0,Za.createPortal)((0,e.createElement)("div",{className:`wcf-name-your-store-flow ${a}`},(0,e.createElement)(Pt.Root,{show:"show"===a,as:t.Fragment},(0,e.createElement)(gr,{as:"div",className:"relative z-20",initialFocus:"",onClose:r},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},(0,e.createElement)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:()=>{r("hide")}})),(0,e.createElement)("div",{className:"wcf-name-your-flow__inner"},(0,e.createElement)(BD,{cf_pro_status:l,setVisibility:r,preview:n,type:i,flowName:s,setFlowName:o,cancelButtonRef:c}))))),document.getElementById("wcf-json-importer"))})),ZD=()=>{const[a,r]=(0,t.useState)("hide"),[n,i]=(0,t.useState)("");return(0,e.createElement)("div",{className:"wcf-flow-library-importer wcf-flow-library--other"},(0,e.createElement)("div",{className:"wcf-flow-library-importer__list bg-white px-10 py-14"},(0,e.createElement)(WD,{visibility:a,setVisibility:r,type:"blank",flowName:n,setFlowName:i}),(0,e.createElement)("div",{className:"wcf-item wcf-item--start-from-blank flex gap-6 mx-auto max-w-4xl"},(0,e.createElement)("div",{className:"wcf-item__inner relative cursor-pointer group bg-gray-25 p-5 text-center flex flex-col border border-gray-200 hover:border-primary-300 rounded-md items-center justify-center h-72 w-2/3",onClick:()=>{r("hide"===a?"show":"hide")}},(0,e.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,e.createElement)("div",{className:"wcf-item__thumbnail"},(0,e.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon bg-white p-6 rounded-full"},(0,e.createElement)(zr,{className:"w-7 h-7 stroke-1 text-gray-400 group-hover:text-primary-300"})))),(0,e.createElement)("div",{className:"wcf-item__heading-wrap border-t border-gray-200 absolute bottom-0 w-full"},(0,e.createElement)("div",{className:"wcf-item__heading text-base text-gray-800 font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows")))),(0,e.createElement)("div",{className:"wcf_item__info flex flex-col gap-6 justify-center w-3/4"},(0,e.createElement)("h3",{className:"wcf_item__info--title text-2xl text-gray-800 font-semibold"},(0,e.createElement)("h3",{className:"wcf_item__info--title"},(0,z.__)("No Results Found.","cartflows"))),(0,e.createElement)("span",{className:"wcf_item__info--desc text-base text-gray-600 font-normal mt-2"},(0,z.__)("Don't see a funnel that you would like to import?","cartflows")),(0,e.createElement)("a",{className:"wcf_item__info--doc text-sm text-gray-600 font-normal hover:text-primary-300 flex gap-1",href:"https://cartflows.com/funnel-suggestions/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=suggestions",target:"_blank",rel:"noreferrer"},(0,z.__)("Please suggest us ","cartflows"),(0,e.createElement)(NN,{className:"w-5 h-5 stroke-1 text-gray-400 hover:text-primary-300"}))))))},VD=()=>{const[a,r]=(0,t.useState)("hide"),[n,i]=(0,t.useState)("");return(0,e.createElement)("div",{className:"wcf-flow-importer wcf-search-404"},(0,e.createElement)("div",{className:"wcf-flow-importer__list wcf-items-list wcf-row wcf-flow-row"},(0,e.createElement)(WD,{visibility:a,setVisibility:r,type:"blank",flowName:n,setFlowName:i}),(0,e.createElement)("div",{className:"wcf-item wcf-item__start-from-blank"},(0,e.createElement)("div",{className:"wcf-item__inner",onClick:()=>{r("hide"===a?"show":"hide")}},(0,e.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,e.createElement)("div",{className:"wcf-item__thumbnail"},(0,e.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon"},(0,e.createElement)("span",{className:"wcf-icon dashicons dashicons-plus wcf-icon-start-from-blank"})))),(0,e.createElement)("div",{className:"wcf-item__heading-wrap"},(0,e.createElement)("div",{className:"wcf-item__heading"},(0,z.__)("Start from scratch","cartflows")))),(0,e.createElement)("div",{className:"wcf_item__info"},(0,e.createElement)("h3",{className:"wcf_item__info--title"},(0,z.__)("Oops!!! No template Found.","cartflows")),(0,e.createElement)("span",{className:"wcf_item__info--desc"},(0,z.__)("Seems like no template is available for chosen editor.","cartflows"))))))},GD=(0,Ay.compose)((0,zy.withDispatch)((e=>{const{setAllFlows:t}=e("wcf/importer");return{setAllFlows:t}})))((function({setAllFlows:a}){let r="no";const[{page_builder:n}]=l(),[i,s]=(0,t.useState)(""),{currentPageBuilderData:o,requiredPluginsData:c,preview:u,store_checkout_flows:d,flows_list:m}=(0,zy.useSelect)((e=>({currentPageBuilderData:e("wcf/importer").getCurrentPageBuilderData(n),requiredPluginsData:e("wcf/importer").getRequiredPluginsData(),preview:e("wcf/importer").getPreview(),store_checkout_flows:e("wcf/importer").getStoreCheckoutFlows(),flows_list:e("wcf/importer").getFlowsList(n)})));"yes"===c[n]&&o&&o?.plugins&&o?.plugins.map((function(e){return"install"!==e.status&&"activate"!==e.status||(r="yes"),""}));const[g,p]=(0,t.useState)(!0);if("yes"===r)return(0,e.createElement)(kD,null);(0,t.useEffect)((()=>{let e=!0;if(!d[n]){const t=new window.FormData;t.append("action","cartflows_get_flows_list"),t.append("security",cartflows_admin.get_flows_list_nonce),(async()=>{A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((t=>{if(e&&t?.data?.flows){const e=Object.values(t.data.flows);M(e),a(e,n)}}))})()}return p(!1),()=>{e=!1}}),[d]);const f=(0,t.createRef)(),[h,M]=(0,t.useState)(m),[y,N]=(0,t.useState)("search"),w=function(e){if(e&&e.length>=3){N("cancel");const t=e.toLowerCase(),a=m.filter((function(e){return(e.title&&e.title.toLowerCase()||"").includes(t)}));s(e),M(a)}else N("search"),M(m)},[x,b]=(0,t.useState)("hide"),[D,v]=(0,t.useState)("");return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-flow-importer"},Object.keys(u).length?(0,e.createElement)(RD,null):(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-flow-importer__header bg-white px-8 py-6 flex justify-between items-start sm:items-center mb-9 -m-8 sm:flex-row flex-col gap-3"},(0,e.createElement)("h3",{className:"wcf-flow-importer__header-title text-2xl font-semibold text-gray-800"},(0,z.__)("Store Checkout Templates","cartflows")),(0,e.createElement)("div",{className:"wcf-flow-importer__actions gap-4 flex justify-between items-center"},(0,e.createElement)("div",{className:"wcf-flow-importer__actions-content-left"},(0,e.createElement)("div",{className:"wcf-flow-importer__actions-search"},(0,e.createElement)("form",{className:"wcf-search-flows--form relative",onSubmit:function(e){e.preventDefault(),"cancel"===y&&(f.current.value="",w(""),s(""))}},(0,e.createElement)(_r,{attr:{ref:f},label:"",placeholder:(0,z.__)("Search Templates","cartflows"),class:"input-field !pl-8 !px-4 !py-3 text-sm font-normal !rounded-md text-gray-400 !border-gray-200 focus:ring focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none",id:"s",value:i,onChangeCB:w}),(0,e.createElement)("button",{className:"wcf-search__button absolute inset-y-0 left-0 flex items-center pl-3 bg-transparent cursor-pointer m-0 "+("cancel"===y?"top-1":"top-px")},"search"===y&&(0,e.createElement)(DN,{className:"w-18 h-18 stroke-2 text-gray-400"}),"cancel"===y&&(0,e.createElement)(Cr,{className:"w-18 h-18 stroke-2 text-gray-400"}))))),(0,e.createElement)("div",{className:"divider w-px bg-gray-200 h-7"}),(0,e.createElement)("div",{className:"wcf-flow-importer__actions-content-right"},(0,e.createElement)("div",{className:"wcf-flow-importer__actions-buttons"},(0,e.createElement)(OD,{template:"store-checkout"}))))),m.length<1&&h.length<1&&(g?(0,e.createElement)(YD,null):(0,e.createElement)(VD,null)),m.length>0&&0===h.length&&(0,e.createElement)(ZD,null),m.length>0&&0{b("hide"===x?"show":"hide")}},(0,e.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,e.createElement)("div",{className:"wcf-item__thumbnail"},(0,e.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon bg-white p-6 rounded-full"},(0,e.createElement)(zr,{className:"w-7 h-7 stroke-2 text-gray-400"})))),(0,e.createElement)("div",{className:"wcf-item__heading-wrap border-t border-gray-200 absolute bottom-0 w-full"},(0,e.createElement)("div",{className:"wcf-item__heading text-base text-gray-800 font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows"))))),h.map((t=>(0,e.createElement)(_D,{key:t.ID,item:t})))))))})),XD=a=>{const[r,n]=(0,t.useState)("hide"),[i,s]=(0,t.useState)(""),o=a.page_builder;return(0,e.createElement)("div",{className:"wcf-store-library-importer wcf-store-library--other"},(0,e.createElement)("div",{className:"wcf-store-library-importer__header bg-white px-8 py-6 flex justify-between items-center border-b border-gray-200"},(0,e.createElement)("div",{className:"wcf-store-importer__header-title text-2xl font-semibold text-gray-800"},(0,z.__)("Start from Scratch","cartflows"))),(0,e.createElement)("div",{className:"wcf-store-library-importer__list bg-white px-10 py-14"},(0,e.createElement)(Db,{visibility:r,setVisibility:n,type:"blank",flowName:i,setFlowName:s}),(0,e.createElement)("div",{className:"wcf-item wcf-item--start-from-blank flex gap-6 mx-auto max-w-4xl"},(0,e.createElement)("div",{className:"wcf-item__inner relative cursor-pointer group bg-gray-25 p-5 text-center flex flex-col border border-gray-200 hover:border-primary-300 rounded-md items-center justify-center h-72 w-2/3",onClick:()=>{n("hide"===r?"show":"hide")}},(0,e.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,e.createElement)("div",{className:"wcf-item__thumbnail"},(0,e.createElement)("div",{className:"wcf-store-importer__start-from-blank-icon bg-white p-6 rounded-full"},(0,e.createElement)(zr,{className:"w-7 h-7 stroke-1 text-gray-400 group-hover:text-primary-300"})))),(0,e.createElement)("div",{className:"wcf-item__heading-wrap border-t border-gray-200 absolute bottom-0 w-full"},(0,e.createElement)("div",{className:"wcf-item__heading text-base text-gray-800 font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows")))),(0,e.createElement)("div",{className:"wcf_item__info flex flex-col gap-6 justify-center w-3/4"},(0,e.createElement)("h3",{className:"wcf_item__info--title text-2xl text-gray-800 font-semibold"},"bricks-builder"===o&&(0,z.__)("It seems that you are using the Bricks Builder.","cartflows"),"other"===o&&(0,z.__)("It seems that you are using the page builder other than Elementor, Beaver Builder, Block Builder.","cartflows")),(0,e.createElement)("span",{className:"wcf_item__info--desc text-base text-gray-600 font-normal mt-2"},"bricks-builder"===o&&(0,z.__)("Are you using Bricks Builder? No worries. CartFlows works well with Bricks Builder. Right now we do not have ready templates for Bricks Builder but we are planning to add it very soon.","cartflows"),"other"===o&&(0,z.__)("Are you using any other page builder? No worries. CartFlows works well with every other page builder. Right now we do not have ready templates for every page builder but we are planning to add it very soon.","cartflows")),(0,e.createElement)("span",{className:"mt-2"},(0,e.createElement)("a",{className:"wcf_item__info--doc text-gray-600 hover:text-primary-500 flex items-center gap-2 text-sm",href:"https://cartflows.com/docs/how-to-use-cartflows-with-your-own-template/?utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=docs",target:"_blank",rel:"noreferrer"},(0,z.__)("Learn How ","cartflows"),(0,e.createElement)(NN,{className:"w-18 h-18 stroke-1"})))))))},JD=()=>{const[{page_builder:t}]=l();return"other"!==t&&"bricks-builder"!==t?(0,e.createElement)(GD,null):(0,e.createElement)(XD,{page_builder:t})},qD={flow_id:cartflows_admin?.flow_id?cartflows_admin?.flow_id:0,is_cf_pro:!!cartflows_admin?.is_pro&&cartflows_admin.is_pro,page_slug:cartflows_admin?.home_slug?cartflows_admin.home_slug:"cartflows",page_builder:cartflows_admin?.page_builder?cartflows_admin.page_builder:"other",global_checkout:parseInt(cartflows_admin.global_checkout),flows:[],flow_analytics:{},flow_settings:{},title:!1,flow_title:"",flow_slug:"",flow_link:"#",is_flow_instant_checkout:!1,emptySteps:!1,steps:[],options:null,current_step:null,flow_type:"flows",status:null,step_id:0,admin_url:"test_url",page_builder_name:cartflows_admin?.page_builder_name?cartflows_admin.page_builder_name:"",step_data:{},view_url:"#",edit_url:"#",edit_builder_url:"#",settings_data:{},step_title:!1,step_slug:"",design_settings:null,page_settings:null,billing_fields:null,shipping_fields:null,ob_id:null,current_ob:null,suretriggers_config:[]},$D=(e,t)=>{switch(t.type){case"SET_FLOW_DATA":return t.data.options.post_title=t.data.title,t.data.options.post_name=t.data.slug,{...e,title:t.data.title,flow_title:t.data.title,flow_slug:t.data.slug,flow_link:t.data.link,status:t.data.status,steps:t.data.steps,flow_settings:t.data.settings_data,emptySteps:t.data.steps.length<1,options:{...e.options,...t.data.options},flow_analytics:t.data.flow_analytics,is_flow_instant_checkout:t?.data?.options["instant-layout-style"]||!1};case"SET_FLOW_ANALYTICS":return{...e,flow_analytics:t.flow_analytics.data};case"SET_OPTION":const a=e.options;return a[t.name]=t.value,{...e,options:a};case"SET_FLOW_TITLE":return e.options.post_title=t.title,{...e,title:t.title};case"SET_STEPS":return{...e,steps:t.steps};case"SET_GLOBAL_CHECKOUT":return{...e,global_checkout:t.global_checkout};case"SET_STORE_STEPS":const r=[],n=[];e.steps.map((function(e){return"checkout"===e.type&&r.push(e),"landing"===e.type&&n.push(e),""}));let i=[];return i=i.concat(r,n),t.steps.map((function(e){return void 0!==e.type&&i.push(e),""})),i=[...new Map(i.map((e=>[e.id,e]))).values()],{...e,steps:i};case"SET_STEP_DATA":return t.data.options.post_title=t.data.title,t.data.options.post_name=t.data.step_post_name,{...e,flow_title:t.data.flow_title,view_url:t.data.view,edit_url:t.data.edit?t.data.edit.replace(/&/g,"&"):"",edit_builder_url:t.data.page_builder_edit?t.data.page_builder_edit.replace(/&/g,"&"):"",step_data:t.data,settings_data:t.data.settings_data,design_settings:t.data.design_settings,page_settings:t.data.page_settings,custom_fields:t.data.custom_fields,billing_fields:t.data.billing_fields,shipping_fields:t.data.shipping_fields,options:{...e.options,...t.data.options},step_title:t.data.title,step_slug:t.data.step_post_name,step_id:t.data.id};case"SET_STEP_TITLE":return e.options.post_title=t.title,{...e,step_title:t.title};case"SET_OB_TITLE":const s=e.options[t.name].findIndex((e=>e.id===t.ob_id));return e.options[t.name][s].title=t.title,{...e};case"SET_OB_STATUS":const o=e.options[t.name].findIndex((e=>e.id===t.ob_id));return e.options[t.name][o].status=t.newStatus,{...e};case"SET_STEP_VIEW_URL":return{...e,view_url:t.step_view_url};case"SET_FIELDS":return"billing"===t.field_type?{...e,billing_fields:t.fields}:{...e,shipping_fields:t.fields};case"SET_OB_OPTION":const l=e.current_ob;return l[t.name]=t.value,{...e,current_ob:l};case"UPDATE_OPTIONS":return{...e,options:t.options};case"ADD_CHECKOUT_PRODUCT":const c=e.options[t.field_name];return c&&(c.push(t.product_data),e.options[t.field_name]=c),{...e};case"ADD_OPTIN_PRODUCT":case"ADD_OFFER_PRODUCT":return e.options[t.field_name]=t.product_data,{...e};case"ADD_OB_PRODUCT":return{...e,current_ob:{...e.current_ob,product:t.product.product,product_image:t.product.product_image,desc_text:t.product.desc_text}};case"REMOVE_OB_PRODUCT":const u=e.current_ob;return u.product="",u.product_image=cartflows_admin.image_placeholder,u.desc_text="Lorem Ipsum has been the industry standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.",e.current_ob=u,{...e};case"REMOVE_OFFER_PRODUCT":case"REMOVE_OPTIN_PRODUCT":return e.options[t.field_name]&&(e.options[t.field_name]=""),{...e};case"REMOVE_CHECKOUT_PRODUCT":const d=t.unique_id,m=e.options[t.field_name];return d&&m&&(e.options[t.field_name]=m.filter((function(e){return e.unique_id!==d}))),{...e};case"UPDATE_CHECKOUT_PRODUCTS":return e.options[t.field_name]=t.products,{...e};case"UPDATE_ORDER_BUMP":return e.options[t.name]=t.order_bumps,{...e};case"REMOVE_ORDER_BUMP":const g=t.ob_id,p=e.options[t.name];return e.options[t.name]=p.filter((function(e){return e.id!==g})),{...e};case"SET_CURRENT_OB":const f=e.options["wcf-order-bumps"].findIndex((e=>e.id===t.ob_id));return e.options["wcf-order-bumps"][f]=t.current_ob,{...e,ob_id:t.ob_id,current_ob:t.current_ob};case"ADD_NEW_OB_GROUP":const h=e.current_ob[t.name];return h&&(h.push(t.newGroup),e.current_ob[t.name]=h),{...e};case"ADD_NEW_GROUP":const M=e.options[t.name];return M&&(M.push(t.newGroup),e.options[t.name]=M),{...e};case"ADD_NEW_OB_RULE":const y=e.current_ob[t.name],N=t.group_id;if(y&&N){for(const e of y)if(N===e.group_id){e.rules.push(t.newRule);break}e.current_ob[t.name]=y}return{...e};case"ADD_NEW_RULE":const w=e.options[t.name],x=t.group_id;if(w&&x){for(const e of w)if(x===e.group_id){e.rules.push(t.newRule);break}e.options[t.name]=w}return{...e};case"REMOVE_OB_RULE":const b=e.current_ob[t.name];for(let e=0;e{}}=a,[{license_status:c}]=g();return(0,e.createElement)(t.Fragment,null,(0,e.createElement)(Zx,{as:"div",id:`step_more_options_${r}`,className:"wcf-step-row__actions-menu relative inline-block text-left"},(0,e.createElement)("div",null,(0,e.createElement)(Zx.Button,{className:"inline-flex w-full p-1 text-sm font-semibold text-gray-900 hover:text-primary-500"},(0,e.createElement)(MM,{text:(0,z.__)("More Options","cartflows"),classes:"!ml-0",descClass:"!z-20",icon:(0,e.createElement)(Rl,{className:"-mr-1 h-5 w-5","aria-hidden":"true"})}))),(0,e.createElement)(Pt,{as:t.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95"},(0,e.createElement)(Zx.Items,{className:"wcf-step-actions-menu__dropdown_menu absolute right-0 z-10 mt-2 w-56 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"},(0,e.createElement)("div",{className:"py-1"},s.map((t=>{const a=t.class,s=t.text;let u=!1,d=!1;if((!wcfCartflowsPro()&&t?.pro||"abtest"===t.slug&&!wcfCartflowsTypePro())&&(u=!0),wcfCartflowsPro()&&t?.pro&&"Activated"!==c&&(d=!0),"automation"===t.slug&&"downsell"!==o&&"upsell"!==o&&"checkout"!==o)return null;let m="";return m=u||d?"abtest"===t.slug?"wcf-pro hover:!bg-gray-100 hover:!text-gray-700":"wcf-pro pointer-events-none":"text-gray-700",(0,e.createElement)(Zx.Item,{key:t?.text},(0,e.createElement)("a",{href:t?.link,className:`wcf-step__action-btn ${a} ${m} px-4 py-2 text-sm flex gap-1.5 hover:text-primary-500`,title:t?.text,"data-id":r,"data-control-id":n,onClick:e=>{u&&"abtest"===t.slug?l("show"):"#"===t?.link&&i[t.slug]&&i[t.slug](e)},"data-action":t.ajaxcall,key:t.slug},function(t){let a="";switch(t){case"clone":a=(0,e.createElement)(ob,{className:"h-5 w-5"});break;case"delete":a=(0,e.createElement)(Zl,{className:"h-5 w-5"});break;case"abtest":a=(0,e.createElement)(ev,{className:"h-5 w-5"});break;case"archived":a=(0,e.createElement)(av,{className:"h-5 w-5"});break;case"winner":a=(0,e.createElement)(nv,{className:"h-5 w-5"});break;case"automation":a=(0,e.createElement)(sv,{className:"h-5 w-5"});break;default:a=(0,e.createElement)(lv,{className:"h-5 w-5"})}return a}(t.slug),(0,e.createElement)("span",{className:"wcf-step-row__btn-text "+(u?" w-full flex justify-between ":""),"data-action":t.ajaxcall},s," ",u||d?(0,e.createElement)("span",{className:"wcf-pro-badge px-2 py-0.5 text-xs text-primary-600 ml-auto rounded-[14px] shadow-[0px_6px_16px_-2px_rgba(240,100,52,0.4)]"},(0,e.createElement)("span",null,(0,z.__)("PRO","cartflows"))):"",t?.tag&&(0,e.createElement)("span",{className:"wcf-step-row__btn-text--tag text-primary-500"}," ",t?.tag," "))))})))))))},uv="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+DQo8cmVjdCB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgZmlsbD0iI0QxRDVEQiIvPg0KPGcgZmlsdGVyPSJ1cmwoI2ZpbHRlcjBfZF83MjdfMjM3MSkiPg0KPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjExMiIgaGVpZ2h0PSIxMTIiIHJ4PSI2IiBmaWxsPSIjRjlGQUZCIi8+DQo8L2c+DQo8Y2lyY2xlIGN4PSIxNyIgY3k9IjE2IiByPSIzIiBmaWxsPSIjRDFENURCIi8+DQo8cGF0aCBkPSJNMTQgMjkuNEMxNCAyNy4xNTk4IDE0IDI2LjAzOTcgMTQuNDM2IDI1LjE4NEMxNC44MTk1IDI0LjQzMTQgMTUuNDMxNCAyMy44MTk1IDE2LjE4NCAyMy40MzZDMTcuMDM5NyAyMyAxOC4xNTk4IDIzIDIwLjQgMjNIMTA3LjZDMT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GVyPg0KPC9kZWZzPg0KPC9zdmc+DQo=";function hv({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const Mv=t.forwardRef(hv);var yv=n(9296);const Nv=function(a){var r;const{is_cf_pro:n,global_checkout:i,flow_id:s,control_id:o,step_id:l,title:c,type:u,actions:d,menu_actions:m,ab_test_ui:p,offer_no_next_step:f,offer_yes_next_step:h,setShowAbtestUpgradePopup:M=()=>{},step_disabled:y}=a,N=l;let{has_product_assigned:w,is_variation:x}=a;const[{flow_type:b,flow_analytics:D,is_flow_instant_checkout:v}]=Sl(),[{license_status:j}]=g(),[_,E]=(0,t.useState)(!1),L=(0,t.useRef)(),T=D?D.all_steps:"",k=x?a.control_id:l,S=T?T.find((e=>e.id===k)):[],O=Iy(),C=(0,yv.W6)();"landing"!==u&&"thankyou"!==u||(w=!0);const Y="yes"===v&&["checkout","thankyou","upsell","downsell"].includes(u);return(0,e.createElement)("div",{className:`wcf-step-wrap--container w-full p-4 flex items-center gap-2 ${p?"border-b border-gray-200":""} ${y?"invalid-step step-disabled touch-none !bg-gray-50 !text-gray-300 !border-0 rounded-lg":""}`},!p&&(0,e.createElement)("div",{className:"wcf-steps--sortable-toggle flex cursor-move text-gray-400"},(0,e.createElement)(Rl,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}),(0,e.createElement)(Rl,{className:"w-5 h-5 stroke-1 -ml-3.5","aria-hidden":"true"})),(0,e.createElement)("div",{className:br()("wcf-step flex gap-6 items-start flex-col sm:items-center sm:flex-row w-full",p?"ml-8":"",_?"step-overlay":"",w||N===i?"":"wcf-step__no-product")},(0,e.createElement)("div",{className:"wcf-step--content flex items-center gap-4 w-full sm:w-[50%]"},(0,e.createElement)("img",{src:function(){let e="";switch(u){case"landing":e=uv;break;case"checkout":e=dv;break;case"optin":e=pv;break;case"thankyou":e=fv;break;case"upsell":e=mv;break;case"downsell":e=gv}return e}(),alt:u,className:"sm:block lg:block hidden rounded-lg sm:w-[72px] sm:h-[72px] w-[62px] h-[62px]"}),(0,e.createElement)("div",{className:"wcf-steps--title-wrap flex flex-col gap-1"},(0,e.createElement)("div",{className:"wcf-step__col-tags sm:flex items-center gap-2 grid grid-cols-2"},(0,e.createElement)("span",{className:"sm:text-base text-sm font-normal text-gray-400 capitalize"},"thankyou"===u?(0,z.__)("Thank You","cartflows"):u),("upsell"!==u&&"downsell"!==u||wcfCartflowsTypePlusPro())&&y?(0,e.createElement)("span",{className:"wcf-flow-badge wcf-badge wcf-badge--error !text-[10px] !px-2 !py-px wcf-disabled-step-badge"},(0,e.createElement)(rb,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"}),(0,z.__)("Disabled","cartflows")):null,function(){let t="";if(p)if(o===l)t=(0,e.createElement)("span",{className:"wcf-step-badge bg-primary-500 text-white text-xs px-2.5 py-1 rounded-full"},(0,z.__)("Control","cartflows"));else{const{var_badge_count:r}=a;t=(0,e.createElement)("span",{className:"wcf-step-badge bg-gray-800 text-white text-xs px-2.5 py-1 rounded-full"},(0,z.sprintf)(/* translators: %d is replaced with the count */ /* translators: %d is replaced with the count */
(0,z.__)("Variation-%d","cartflows"),r))}return t}(),!w&&"storeCheckout"!==b&&(0,e.createElement)("span",{className:"wcf-badge wcf-badge--error !text-[10px] !px-2 !py-px wcf-no-product-badge"},(0,e.createElement)(rb,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"}),(0,z.__)("No Product Assigned","cartflows")),!w&&"storeCheckout"===b&&"checkout"!==u&&(0,e.createElement)("span",{className:"wcf-badge wcf-badge--error !text-[10px] !px-2 !py-px wcf-no-product-badge"},(0,e.createElement)(rb,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"}),(0,z.__)("No Product Assigned","cartflows")),w&&"storeCheckout"===b&&"checkout"===u&&(0,e.createElement)("span",{className:"wcf-global-checkout-error-badge wcf-flow-badge wcf-badge wcf-badge--error !text-[10px] !px-2 !py-px"},(0,e.createElement)(rb,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"}),(0,z.__)("Store Checkout - Remove selected checkout product","cartflows")),function(){let t="";return!wcfCartflowsTypePlusPro()||"upsell"!==u&&"downsell"!==u?wcfCartflowsTypePlusPro()||"upsell"!==u&&"downsell"!==u||(t=(0,e.createElement)("span",null,(0,e.createElement)("span",{className:"wcf-pro-badge px-2 py-0.5 text-xs !text-primary-600 ml-auto rounded-[14px] shadow-[0px_6px_16px_-2px_rgba(240,100,52,0.4)] !opacity-100"},(0,z.__)("PRO","cartflows")))):t=h&&f?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-flow-badge wcf-badge wcf-badge--success !text-[10px] !px-2 !py-px wcf-yes-offer-badge relative wcf-inline-tooltip after:top-8 cursor-pointer","data-tooltip":hr(h,35,25)},(0,e.createElement)(Qy,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"}),(0,z.__)("Offer Accepted","cartflows")),(0,e.createElement)("span",{className:"wcf-flow-badge wcf-badge wcf-badge--warning !text-[10px] !px-2 !py-px wcf-no-offer-badge relative wcf-inline-tooltip after:top-8 cursor-pointer","data-tooltip":hr(f,35,25)},(0,e.createElement)(Mv,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"}),(0,z.__)("Offer Rejected","cartflows"))):(0,e.createElement)("span",{className:"wcf-flow-badge wcf-badge wcf-badge--error !text-[10px] !px-2 !py-px wcf-invalid-sequence-badge"},(0,e.createElement)(rb,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"}),(0,z.__)("Invalid Position","cartflows")),t}()),(0,e.createElement)("div",{className:"wcf-step__title"},(0,e.createElement)("a",{className:`\n\t\t\t\t\t\t\t\t\tfont-semibold text-base sm:text-lg text-gray-800 hover:text-primary-500\n\t\t\t\t\t\t\t\t\t${Y?"disabled pointer-events-none":""}\n\t\t\t\t\t\t\t\t`,href:null!==(r=d[1]?.link)&&void 0!==r?r:"#","aria-disabled":Y,tabIndex:Y?-1:0},hr(c,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))))),(0,e.createElement)("div",{className:"wcf-divider border-l border-gray-100 h-12 hidden sm:visible"}),(0,e.createElement)("div",{className:"wcf-step--stats-content w-full sm:w-2/3 relative"},(0,e.createElement)("div",{className:"wcf-step--stats-content__info flex text-center justify-around items-center "+(D?"":"blur-sm relative")},(0,e.createElement)("div",{className:"wcf-step--stats-content__stat"},(0,e.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,z.__)("Views","cartflows")),(0,e.createElement)("div",{className:"font-semibold text-base text-gray-800"},function(){let e=0;return D&&S&&(e=x?S["visits-ab"][l].total_visits:S.visits.total_visits),e}())),(0,e.createElement)("div",{className:"wcf-step--stats-content__stat"},(0,e.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,z.__)("Conversions","cartflows")),(0,e.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==u?function(){let e=0;return D&&S&&(e=x?S["visits-ab"][l].conversions:S.visits.conversions),e}():"-")),(0,e.createElement)("div",{className:"wcf-step--stats-content__stat"},(0,e.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,z.__)("Revenue","cartflows")),(0,e.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==u&&"landing"!==u?function(){let e=0;return D&&S&&(e=x?S["visits-ab"][l].revenue:S.visits.revenue),0!==e?wr(e):e}():"-"))),!D&&(wcfCartflowsPro()?wcfCartflowsPro()&&"Activated"!==j?(0,e.createElement)("a",{href:cartflows_admin?.license_popup_url,target:"_blank",className:"wcf-step--stats-content__upgrade-to-pro--badge absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",rel:"noreferrer"},(0,e.createElement)("span",{className:"wcf-badge wcf-badge--error hover:text-red-600 focus:text-red-600 rounded text-xs cursor-pointer font-normal mr-4"},(0,z.__)("Activate License","cartflows"))):void 0:(0,e.createElement)("a",{href:getUpgradeToProUrl(cartflows_admin?.utm_param_pro_plans),target:"_blank",className:"wcf-step--stats-content__upgrade-to-pro--badge absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2",rel:"noreferrer"},(0,e.createElement)("span",{className:"wcf-badge wcf-badge--warning hover:text-amber-600 focus:text-amber-600 rounded text-xs cursor-pointer font-normal mr-4"},(0,z.__)("Upgrade to Pro","cartflows"))))),(0,e.createElement)("div",{className:"wcf-divider border-l border-gray-100 h-12 hidden sm:visible"}),(0,e.createElement)("div",{className:"wcf-step--actions-col w-full sm:w-[15%]"},(0,e.createElement)("div",{className:"wcf-step--actions",ref:L},(0,e.createElement)("div",{className:"wcf-step--action-btns"},(0,e.createElement)("div",{className:"wcf-step--action__basic-btns flex items-center sm:justify-evenly justify-between"},d.map((t=>{var a;return(0,e.createElement)("a",{href:!Y&&"edit"===t.slug||"view"===t.slug?t?.link:"#!",className:`wcf-step__action-btn group flex relative hover:text-primary-500 group p-1 ${null!==(a=t.class)&&void 0!==a?a:""} ${Y&&"edit"===t.slug?"disabled !text-gray-300":"text-gray-400"}`,target:"view"===t?.slug?"_blank":"",rel:"noreferrer",key:t?.link},t.slug&&"view"===t.slug&&(0,e.createElement)(MM,{classes:"capitalize",text:(0,z.sprintf)(
// translators: %s: step slug
// translators: %s: step slug
(0,z.__)("%s Step","cartflows"),t?.slug),icon:(0,e.createElement)(bw,{className:"w-5 h-5 stroke-1","aria-hidden":"true"})}),t.slug&&"edit"===t.slug&&(0,e.createElement)(MM,{classes:"capitalize",text:Y?(0,e.createElement)("div",null,(0,e.createElement)("span",{className:"wcf-tooltip-heading text-xs font-semibold mb-1 block"},(0,z.__)("Step Editing is Disabled","cartflows")),(0,e.createElement)("div",{className:"wcf-tooltip-desc text-xs font-normal normal-case"},(0,z.__)("You can't edit this step directly because Instant Layout is turned on in the funnel settings. To make design changes, go to the Design tab inside this step's settings.","cartflows"))):(0,z.sprintf)(
// translators: %s: step slug
// translators: %s: step slug
(0,z.__)("%s Step","cartflows"),t?.slug),icon:(0,e.createElement)(by,{className:"w-5 h-5 stroke-1","aria-hidden":"true"})}))})),(0,e.createElement)(I,{to:{pathname:"admin.php",search:"storeCheckout"===b?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${s}&step_id=${l}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${s}&step_id=${l}`},className:"wcf-step__action-btn group flex relative text-gray-400 hover:text-primary-500 p-1"},(0,e.createElement)(MM,{classes:"capitalize",text:(0,z.__)("Open Settings","cartflows"),icon:(0,e.createElement)(Bl,{className:"w-5 h-5 stroke-1","aria-hidden":"true"})})),(0,e.createElement)(cv,{id:N,control_id:o,onClickEvents:{clone:async function(e){if(e.preventDefault(),!wcfCartflowsPro())return null;if(await O({title:(0,z.__)("Duplicate Step","cartflows"),description:(0,z.__)("Do you want to duplicate this step? Are you sure?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})){E(!0);const t=e.target.getAttribute("data-action");let a=cartflows_admin.clone_step_nonce;const r=new window.FormData;"cartflows_clone_ab_test_step"===t&&(a=cartflows_admin.wcf_clone_ab_test_step_nonce,r.append("control_id",o)),r.append("action",t),r.append("security",a),r.append("step_id",N),r.append("post_id",s),window.wcfAction="cloneStep",(0,Kx.$h)(A()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((()=>{window.location.reload(),E(!1)})))}},delete:async function(e){if(e.preventDefault(),await O({title:(0,z.__)("Delete Step","cartflows"),description:(0,z.__)("Do you want to delete this step? Are you sure?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})){E(!0);const t=e.target.getAttribute("data-action");let a=cartflows_admin.delete_step_nonce;const r=new window.FormData;"cartflows_delete_ab_test_step"===t&&(a=cartflows_admin.wcf_delete_ab_test_step_nonce,r.append("control_id",o)),r.append("action",t),r.append("security",a),r.append("step_id",N),r.append("post_id",s),window.wcfAction="deleteStep",(0,Kx.$h)(A()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((()=>{window.location.reload(),E(!1)})))}},abtest:function(e){if(e.preventDefault(),!wcfCartflowsTypePro())return null;E(!0);const t=new window.FormData;t.append("action","cartflows_create_ab_test_variation"),t.append("security",cartflows_admin.wcf_create_ab_test_variation_nonce),t.append("step_id",N),t.append("flow_id",s),window.wcfAction="abtestStep",(0,Kx.$h)(A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{window.location.reload(),E(!1)})))},winner:async function(e){if(e.preventDefault(),await O({title:(0,z.__)("Declare Winner","cartflows"),description:(0,z.__)("Do you want to declare this step as winner? Are you sure?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})){E(!0);const e=new window.FormData;e.append("action","cartflows_declare_ab_test_winner"),e.append("security",cartflows_admin.wcf_declare_ab_test_winner_nonce),e.append("step_id",N),e.append("flow_id",s),window.wcfAction="winnerStep",(0,Kx.$h)(A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((()=>{window.location.reload(),E(!1)})))}},archived:async function(e){if(e.preventDefault(),await O({title:(0,z.__)("Archive Step","cartflows"),description:(0,z.__)("Do you want to archive this step? Are you sure?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})){E(!0);const e=new window.FormData;e.append("action","cartflows_archive_ab_test_step"),e.append("security",cartflows_admin.wcf_archive_ab_test_step_nonce),e.append("step_id",N),e.append("post_id",s),window.wcfAction="archiveStep",(0,Kx.$h)(A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((()=>{window.location.reload(),E(!1)})))}},automation:()=>{C.push({pathname:"admin.php",search:"storeCheckout"===b?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${s}&automation=${l}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${s}&automation=${l}`})}},is_cf_pro:n,actions:m,type:u,setShowAbtestUpgradePopup:M})))))))},wv=function(a){const{abVariations:r}=a,n={};r.map((e=>(n[e.id]=parseInt(e.traffic),"")));const[i,s]=(0,t.useState)(n),o=function(e,t){e=parseInt(e),t=parseInt(t);let a=i[e]-t;const n={};r.map((r=>{const s=parseInt(r.id);if(e===s)n[s]=t;else{let e=i[s]+a;e<0?(a=e,e=0):e>100?(a=e-100,e=100):a=0,n[s]=e}return""})),s(n)};return(0,e.createElement)(e.Fragment,null,r&&r.map((t=>{const a=t.id,r=t.title;return(0,e.createElement)("div",{className:"wcf-traffic-field border-b border-b-gray-300 last:border-b-0 px-4 py-5","data-id":t.id,key:t.id},(0,e.createElement)("div",{className:"wcf-step-name",title:r},hr(r,20,15)),(0,e.createElement)("div",{className:"wcf-traffic-slider-wrap","data-variation-id":t.id},(0,e.createElement)("div",{className:`wcf-traffic-range wcf-traffic-range-${t.id}`},(0,e.createElement)("input",{type:"range",value:i[a],onChange:e=>{o(a,e.target.value)}})),(0,e.createElement)("div",{className:`wcf-traffic-value wcf-traffic-value-${t.id}`},(0,e.createElement)("input",{type:"number",name:`wcf_ab_settings[traffic][${t.id}][value]`,value:i[a],className:"wcf-traffic-input-field",onChange:e=>{o(a,e.target.value)}}),(0,e.createElement)("span",{className:"ml-2"},"%"))))})))};function xv({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{d:"M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z"}))}const bv=t.forwardRef(xv),Dv=function(a){const{flow_id:r,step_id:n,abvariations:i,closeCallback:s}=a,[o,l]=(0,t.useState)((0,z.__)("Save Settings","cartflows")),c=(0,t.useRef)(null);return(0,e.createElement)(Pt.Root,{show:!0,as:t.Fragment},(0,e.createElement)(gr,{as:"div",className:"relative z-20",initialFocus:c,onClose:s},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},(0,e.createElement)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})),(0,e.createElement)("div",{className:"fixed inset-0 z-10 overflow-y-auto"},(0,e.createElement)("div",{className:"flex min-h-full items-center justify-center p-4 sm:p-0 text-center"},(0,e.createElement)(Pt.Child,{as:t.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},(0,e.createElement)(gr.Panel,{className:"relative transform overflow-hidden rounded-lg bg-white text-left shadow-xl transition-all sm:my-8 sm:w-full max-w-xl"},(0,e.createElement)("div",{className:"absolute top-0 right-0 hidden pt-4 pr-4 sm:block"},(0,e.createElement)("button",{type:"button",className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none",onClick:s},(0,e.createElement)("span",{className:"sr-only"},"Close"),(0,e.createElement)(bv,{className:"h-6 w-6","aria-hidden":"true"}))),(0,e.createElement)("form",{onSubmit:function(e){e.preventDefault(),l((0,z.__)("Saving..","cartflows"));const t=new window.FormData(e.target),a={};t.forEach((function(e,t){a[t]=e}));const i=JSON.stringify(a);t.append("formdata",i),t.append("action","cartflows_save_ab_test_setting"),t.append("security",cartflows_admin.save_ab_test_setting_nonce),t.append("step_id",n),t.append("flow_id",r),A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{l((0,z.__)("Saved","cartflows")),l((0,z.__)("Reloading..","cartflows")),window.location.reload()}))}},(0,e.createElement)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},(0,e.createElement)("div",{className:"sm:items-start"},(0,e.createElement)("div",{className:"mt-3 text-center sm:mt-0 sm:text-left"},(0,e.createElement)(gr.Title,{as:"h3",className:"text-lg font-medium leading-6 text-gray-900 mb-4"},(0,z.__)("Split Test Testing","cartflows")),(0,e.createElement)("div",{className:"text-sm text-gray-900 mb-4"},"Traffic"),(0,e.createElement)("div",{className:"mt-2"},(0,e.createElement)("p",{className:"text-sm text-gray-500"},(0,e.createElement)("div",{className:"relative items-center rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 sm:rounded-md"},(0,e.createElement)(wv,{abVariations:i}))))))),(0,e.createElement)("div",{className:"bg-gray-50 px-4 py-3 sm:flex gap-3 justify-end sm:px-6"},(0,e.createElement)("button",{type:"button",className:"wcf-button wcf-secondary-button",onClick:s},(0,z.__)("Cancel","cartflows")),(0,e.createElement)("button",{className:"wcf-button wcf-primary-button"},o)))))))))},vv=function(a){const{flow_id:r,control_id:n,step_id:i,abvariations:s,ab_test_start:o}=a,[l,c]=(0,t.useState)(!1),[u,d]=(0,t.useState)(o?(0,z.__)("Stop Split Test","cartflows"):(0,z.__)("Start Split Test","cartflows")),[m,g]=(0,t.useState)(o?"wcf-stop-split-test text-primary-500 hover:text-primary-700 cursor-pointer":"wcf-start-split-test text-green-600 hover:text-green-700"),[p,f]=(0,t.useState)(!1);return(0,e.createElement)("div",{className:"wcf-ab-test-head w-full p-4 bg-white flex justify-between items-center border-b border-gray-200 rounded-t-lg"},(0,e.createElement)("div",{className:"wcf-step-left-content flex items-center gap-3"},(0,e.createElement)("div",{className:"wcf-steps--sortable-toggle flex cursor-move text-gray-400"},(0,e.createElement)(Rl,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}),(0,e.createElement)(Rl,{className:"w-5 h-5 stroke-1 -ml-3.5","aria-hidden":"true"})),(0,e.createElement)("span",{className:"wcf-ab-test-title font-bold text-base"},(0,z.__)("Split Test","cartflows"))),(0,e.createElement)("div",{className:"wcf-steps-action-buttons flex gap-3 items-center"},(0,e.createElement)("a",{href:"#",className:`wcf-action-button font-normal ${m}`,title:u,"data-id":n,onClick:function(e){if(e.preventDefault(),p)return void console.log("One process of A/B split test is ongoing.");o?(g("wcf-start-split-test"),d((0,z.__)("Stopping…","cartflows"))):(g("wcf-stop-split-test"),d((0,z.__)("Starting…","cartflows"))),f(!0);const t=new window.FormData;t.append("action","cartflows_start_ab_test"),t.append("security",cartflows_admin.wcf_start_ab_test_nonce),t.append("step_id",i),t.append("flow_id",r),A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((()=>{f(!1),d((0,z.__)("Reloading…","cartflows")),window.location.reload()}))}},(0,e.createElement)("span",null,u)),(0,e.createElement)("a",{href:"#",className:"wcf-settings-split-test wcf-action-button text-gray-400 hover:text-primary-500",title:`${(0,z.__)("Split Test Settings","cartflows")}`,onClick:function(e){e.preventDefault(),c(!l)}},(0,e.createElement)(Bl,{className:"w-5 h-5 stroke-1 "+(p?"animate-spin text-primary-500":""),"aria-hidden":"true"}))),l&&(0,e.createElement)(Dv,{abvariations:s,flow_id:r,step_id:i,control_id:n,closeCallback:function(){c(!1)}}))};function jv({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))}const _v=t.forwardRef(jv),Iv=function(a){const{step_id:r,flow_id:n,control_id:i,title:s,deleted:o,hide:l,date:c,actions:u,type:d}=a,[m,g]=(0,t.useState)(!1),p=Iy(),f=async function(e){if(e.preventDefault(),await p({title:(0,z.__)("Restore Archived Variation","cartflows"),description:(0,z.__)("Do you want to restore this archived variation? Are you sure?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})){g(!0);const e=new window.FormData;e.append("action","cartflows_restore_archive_ab_test_variation"),e.append("security",cartflows_admin.wcf_restore_archive_ab_test_variation_nonce),e.append("step_id",r),e.append("flow_id",n),e.append("control_id",i),A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((()=>{window.location.reload(),g(!1)}))}},h=async function(e){if(e.preventDefault(),await p({title:(0,z.__)("Trash Archived Variation","cartflows"),description:(0,z.sprintf)(/* translators: %1$s is replaced with the HTML tag */ /* translators: %1$s is replaced with the HTML tag */
(0,z.__)("This action will trash this archived variation and its analytics data permanently. %1$s Do you want to delete this archived variation?","cartflows"),"\n"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})){g(!0);const e=new window.FormData;e.append("action","cartflows_delete_archive_ab_test_variation"),e.append("security",cartflows_admin.wcf_delete_archive_ab_test_variation_nonce),e.append("step_id",r),e.append("flow_id",n),e.append("control_id",i),A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((()=>{window.location.reload(),g(!1)}))}},M=async function(e){if(e.preventDefault(),await p({title:(0,z.__)("Hide Archived Variation","cartflows"),description:(0,z.sprintf)(/* translators: %1$s is replaced with the HTML tag */ /* translators: %1$s is replaced with the HTML tag */
(0,z.__)("This action will hide this archived variation from the list of steps, but its analytics will be visible. %1$s Do you want to hide this archived variation?","cartflows"),"\n"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})){g(!0);const e=new window.FormData;e.append("action","cartflows_hide_archive_ab_test_variation"),e.append("security",cartflows_admin.hide_archive_ab_test_variation_nonce),e.append("step_id",r),A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((()=>{window.location.reload(),g(!1)}))}},y=async function(e){if(e.preventDefault(),await p({title:(0,z.__)("Trash Archived Variation","cartflows"),description:(0,z.sprintf)(/* translators: %1$s is replaced with the HTML tag */ /* translators: %1$s is replaced with the HTML tag */
(0,z.__)("This action will delete this archived variation and its analytics data permanently. %1$s Do you want to delete this archived variation?","cartflows"),"\n"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})){g(!0);const e=new window.FormData;e.append("action","cartflows_permanent_delete_archive_ab_test_variation"),e.append("security",cartflows_admin.permanent_delete_archive_ab_test_variation_nonce),e.append("step_id",r),e.append("flow_id",n),e.append("control_id",i),A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((()=>{window.location.reload(),g(!1)}))}};return"1"===l?null:(0,e.createElement)("div",{className:"wcf-archived-step flex items-center gap-2 py-4","data-id":r},(0,e.createElement)("div",{className:"wcf-archive-step--sortable-toggle flex text-gray-300 disabled pointer-events-none"},(0,e.createElement)(Rl,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}),(0,e.createElement)(Rl,{className:"w-5 h-5 stroke-1 -ml-3.5","aria-hidden":"true"})),(0,e.createElement)("div",{className:"wcf-step flex justify-between items-center w-full "+(m?"step-overlay":"")},(0,e.createElement)("div",{className:"wcf-archive-step--content flex items-center gap-4 w-[55%]"},(0,e.createElement)("img",{src:function(){let e="";switch(d){case"landing":e=uv;break;case"checkout":e=dv;break;case"optin":e=pv;break;case"thankyou":e=fv;break;case"upsell":e=mv;break;case"downsell":e=gv}return e}(),alt:d,className:"rounded-lg w-[72px] h-[72px]"}),(0,e.createElement)("div",{className:"wcf-archive-step--title-wrap flex flex-col gap-1"},(0,e.createElement)("div",{className:"wcf-archive-step--col-tags flex items-center gap-2"},(0,e.createElement)("span",{className:"text-base font-normal text-gray-400 capitalize mr-2"},"thankyou"===d?(0,z.__)("Thank You","cartflows"):d),function(){let t="",a="";return o?(t=(0,z.__)("Deleted On: ","cartflows"),a="bg-red-500"):(t=(0,z.__)("Archived On: ","cartflows"),a="bg-gray-800"),(0,e.createElement)("span",{className:`wcf-step-badge text-white text-xs px-2.5 py-1 rounded-full ${a}`},t+c)}()),(0,e.createElement)("div",{className:"wcf-archive-step--title"},(0,e.createElement)("span",{className:"font-semibold text-lg text-gray-800 cursor-default"},hr(s,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))))),(0,e.createElement)("div",{className:"wcf-archive-step--col"},(0,e.createElement)("div",{className:"wcf-archive-step--actions"},(0,e.createElement)("div",{className:"wcf-archive-step--action__btns-wrapper"},(0,e.createElement)("div",{className:"wcf-archive-step--basic-action__btns flex items-center gap-3"},u.map((t=>{let a,r;switch(t.slug){case"restore":a=f,r=(0,e.createElement)(ib,{className:"w-18 h-18 stroke-2"});break;case"delete":a=h,r=(0,e.createElement)(Zl,{className:"w-18 h-18 stroke-2"});break;case"hide":a=M,r=(0,e.createElement)(_v,{className:"w-18 h-18 stroke-2"});break;case"deleteArch":a=y,r=(0,e.createElement)(Zl,{className:"w-18 h-18 stroke-2"})}return(0,e.createElement)(e.Fragment,null,t?.before_text&&(0,e.createElement)("span",{className:"wcf-step__action-before-text"},t?.before_text),(0,e.createElement)("a",{href:t?.link,className:`wcf-step__action-btn text-gray-400 hover:text-primary-500 p-1 flex gap-2 ${t?.class}`,title:t?.text,onClick:a},r,t?.text))}))))))))},Ev=function(a){const{flow_id:r,control_id:n,archived_variations:i,type:s}=a,[o,l]=(0,t.useState)(!1);return(0,e.createElement)("div",{className:"wcf-archived-wrapper p-4 bg-white w-full rounded-b-lg"},(0,e.createElement)("span",{id:"wcf-archived-button",onClick:function(){l(!o)},className:`text-gray-800 text-sm flex items-center gap-1 cursor-pointer p-1 ${o?"is-active":""} `},(0,z.__)("Archived Steps","cartflows"),o?(0,e.createElement)(fN,{className:"w-4 h-4 stroke-1 mt-0.5","aria-hidden":"true"}):(0,e.createElement)(MN,{className:"w-4 h-4 stroke-1 mt-0.5","aria-hidden":"true"})),o&&(0,e.createElement)("div",{className:"wcf-archived-steps divide-y divide-gray-200"},i.map((t=>{const a={step_id:t.id,flow_id:r,control_id:n,title:t.title,note:t.note,deleted:t.deleted,hide:t.hide,date:t.date,type:s,actions:Object.values(t.actions)};return(0,e.createElement)(Iv,(0,y.A)({},a,{key:t.id}))}))))},Lv=function(t){const[{is_cf_pro:a,global_checkout:r,flow_id:n,flow_type:i}]=Sl(),{id:s,title:o,type:l,actions:c,menu_actions:u,ajaxcall:d,offer_yes_next_step:m,offer_no_next_step:g,invalid:p=!1,step_disabled:f=!1,setShowAbtestUpgradePopup:h=()=>{}}=t,M=!!p,N=s;"storeCheckout"===i&&(["checkout"].includes(l)&&(delete u.clone,M||delete u.delete),M&&(delete u.clone,delete u.abtest));let w=!1,x=!1,b=[],D=[],v=0;wcfCartflowsTypePro()&&(w=!!t["ab-test-ui"]&&t["ab-test-ui"],x=!!t["ab-test-start"]&&t["ab-test-start"],b=t["ab-test-variations"]?t["ab-test-variations"]:[],D=t["ab-test-archived-variations"]?t["ab-test-archived-variations"]:[],v=b.length,v<2&&(w=!1));let j="";"storeCheckout"===i&&M&&(j+=" invalid-step wcf-store-checkout pointer-events-none touch-none"),w&&(j+=" wcf-ab-test flex flex-col items-center"),wcfCartflowsTypePlusPro()||"upsell"!==l&&"downsell"!==l||(j+=" invalid-step pro-inactive pointer-events-none touch-none !bg-gray-50 !text-gray-300 !border-0"),f&&!w&&(j+=" invalid-step step-disabled touch-none !bg-gray-50 !text-gray-300 !border-0");const _={is_cf_pro:a,global_checkout:r,flow_id:n,ab_test_ui:w,control_id:N,step_id:s,type:l,title:o,actions:Object.values(c),menu_actions:Object.values(u),has_product_assigned:t.is_product_assigned,offer_yes_next_step:m,offer_no_next_step:g,ab_test_archived_variations:D,invalidStep:M,setShowAbtestUpgradePopup:h,step_disabled:f};return(0,e.createElement)("div",{className:"wcf-step-wrap bg-white border shadow-sm rounded-lg mb-4"+j,id:s,onDragEnd:d},w&&(0,e.createElement)(vv,{flow_id:n,control_id:N,step_id:s,abvariations:b,ab_test_start:x}),function(){let t="";if(_.step_id=s,w&&v>1){let a=0;t=b.map((t=>(N!==t.id&&++a,_.is_variation=!0,_.control_id=N,_.step_id=t.id,_.title=t.title,_.actions=Object.values(t.actions),_.menu_actions=Object.values(t.menu_actions),_.has_product_assigned=t.is_product_assigned,_.var_badge_count=a,_.step_disabled=t.step_disabled,(0,e.createElement)(Nv,(0,y.A)({},_,{key:t.id})))))}else t=(0,e.createElement)(Nv,_);return t}(),function(){if(w&&D.length>0){const t={flow_id:n,control_id:N,type:l,archived_variations:D};return(0,e.createElement)(Ev,t)}}())},Tv=function(){return(0,e.createElement)("div",{className:"w-11/12"},Array(3).fill().map(((t,a)=>(0,e.createElement)("div",{key:a,className:"wcf-step-wrap animate-pulse bg-white border shadow-sm rounded-lg mb-4 p-4 flex items-center gap-2"},(0,e.createElement)("div",{className:"wcf-steps--sortable-toggle flex cursor-move text-gray-400"},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true",className:"w-5 h-5 stroke-1"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z"})),(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor","aria-hidden":"true",className:"w-5 h-5 stroke-1 -ml-3.5"},(0,e.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 12.75a.75.75 0 110-1.5.75.75 0 010 1.5zM12 18.75a.75.75 0 110-1.5.75.75 0 010 1.5z"}))),(0,e.createElement)("div",{className:"wcf-step flex justify-between items-center w-full wcf-step__no-product"},(0,e.createElement)("div",{className:"wcf-step--content flex items-center gap-4 w-[55%]"},(0,e.createElement)("div",{className:"image bg-gray-200 p-11 rounded-md"}),(0,e.createElement)("div",{className:"wcf-steps--title-wrap flex flex-col gap-4 w-full"},(0,e.createElement)("div",{className:"wcf-step__col-tags flex items-center gap-2"},(0,e.createElement)("span",{className:"h-3 w-full bg-gray-200 rounded-md px-10 block mr-2"}),(0,e.createElement)("span",{className:"h-3 w-full bg-gray-200 rounded-md px-10 block"})),(0,e.createElement)("div",{className:"wcf-step__title"},(0,e.createElement)("span",{className:"h-3 w-4/5 bg-gray-200 rounded-md px-10 block mr-2"})))),(0,e.createElement)("div",{className:"wcf-step--stats-content flex text-center justify-between items-center w-1/4 "},(0,e.createElement)("div",{className:"wcf-step--stats-content__stat"},(0,e.createElement)("div",{className:"h-3 w-full bg-gray-200 rounded-md px-10 block"}),(0,e.createElement)("div",{className:"h-3 w-8 bg-gray-200 rounded-md px-4 block mx-auto mt-2"})),(0,e.createElement)("div",{className:"wcf-step--stats-content__stat"},(0,e.createElement)("div",{className:"h-3 w-full bg-gray-200 rounded-md px-10 block"}),(0,e.createElement)("div",{className:"h-3 w-8 bg-gray-200 rounded-md px-4 block mx-auto mt-2"})),(0,e.createElement)("div",{className:"wcf-step--stats-content__stat"},(0,e.createElement)("div",{className:"h-3 w-full bg-gray-200 rounded-md px-10 block"}),(0,e.createElement)("div",{className:"h-3 w-8 bg-gray-200 rounded-md px-4 block mx-auto mt-2"}))),(0,e.createElement)("div",{className:"wcf-step--actions-col"},(0,e.createElement)("div",{className:"wcf-step--actions"},(0,e.createElement)("div",{className:"wcf-step--action-btns flex items-center"},(0,e.createElement)("div",{className:"wcf-step--action__basic-btns flex items-center gap-3"},(0,e.createElement)("span",{className:"wcf-step__action-btn h-3 w-full bg-gray-200 rounded-md p-3 block"}),(0,e.createElement)("span",{className:"wcf-step__action-btn h-3 w-full bg-gray-200 rounded-md p-3 block"}),(0,e.createElement)("span",{className:"wcf-step__action-btn h-3 w-full bg-gray-200 rounded-md p-3 block"}),(0,e.createElement)("span",{className:"wcf-step__action-btn h-3 w-full bg-gray-200 rounded-md p-3 block"}))))))))))};function Av({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"}))}const zv=t.forwardRef(Av);function kv({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 7.5-9-5.25L3 7.5m18 0-9 5.25m9-5.25v9l-9 5.25M3 7.5l9 5.25M3 7.5v9l9 5.25m0-9v9"}))}const Sv=t.forwardRef(kv);function Ov({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.53 16.122a3 3 0 0 0-5.78 1.128 2.25 2.25 0 0 1-2.4 2.245 4.5 4.5 0 0 0 8.4-2.245c0-.399-.078-.78-.22-1.128Zm0 0a15.998 15.998 0 0 0 3.388-1.62m-5.043-.025a15.994 15.994 0 0 1 1.622-3.395m3.42 3.42a15.995 15.995 0 0 0 4.764-4.648l3.876-5.814a1.151 1.151 0 0 0-1.597-1.597L14.146 6.32a15.996 15.996 0 0 0-4.649 4.763m3.42 3.42a6.776 6.776 0 0 0-3.42-3.42"}))}const Cv=t.forwardRef(Ov);function Yv({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"}))}const Uv=t.forwardRef(Yv),Qv=function(){const[{step_id:a,flow_id:r},n]=Sl();let[{step_title:i}]=Sl();(0,t.useEffect)((()=>{let e=!0;return e&&A()({path:`/cartflows/v1/admin/flow-data/${r}`}).then((t=>{e&&n({type:"SET_FLOW_DATA",data:t})})),()=>{e=!1}}),[i]);const[s,o]=(0,t.useState)(!1),[l,c]=(0,t.useState)(""),u=(0,t.createRef)(),d=function(e){e.preventDefault(),o(!0)},m=function(e){e.preventDefault(),c("wcf-button-loading");const t=u.current.value,r=new window.FormData;r.append("action","cartflows_update_step_title"),r.append("security",cartflows_admin.update_step_title_nonce),r.append("step_id",a),r.append("new_step_title",t),A()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((()=>{n({type:"SET_STEP_TITLE",title:t}),c(""),o(!1)}))},g=function(e){e.preventDefault(),o(!1)};return!1===i?"":(0,e.createElement)("div",{className:"wcf-edit-step__title-wrap"},(0,e.createElement)("div",{className:"wcf-steps-header--title wcf-step__title--editable flex justify-between items-center gap-2.5"},function(){""===i&&(i=(0,z.__)("(no title)","cartflows"));let t=hr(i,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length),a=(0,e.createElement)("a",{href:"#",className:"wcf-steps-header__title--edit",title:(0,z.__)("Edit Step Name","cartflows"),onClick:d},(0,e.createElement)(Uv,{className:"w-5 h-5 stroke-1 text-gray-400 hover:text-primary-500"}));return s&&(t=(0,e.createElement)(dg,{attr:{ref:u},id:"new-step-title",value:i,autocomplete:"off",class:"new-step-title input-field !px-4 !py-2.5 !text-sm font-normal !rounded-md text-gray-400 !w-full !border-gray-200 focus:ring focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none !m-0"}),a=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:"wcf-button wcf-primary-button "+(l?"wcf-disabled":""),type:"button",onClick:m},l&&(0,e.createElement)("svg",{"aria-hidden":"true",className:"w-18 h-18 mr-2 text-gray-400 animate-spin fill-primary-600",viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,e.createElement)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),(0,e.createElement)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})),(0,z.__)("Save","cartflows")),(0,e.createElement)("button",{className:"wcf-button wcf-secondary-button",href:"#",onClick:g},(0,z.__)("Cancel","cartflows")))),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-steps-header__title--text",title:i},t),(0,e.createElement)("span",{className:"wcf-steps-header__title--buttons flex gap-2"},a))}()))},Pv=function(){return(0,e.createElement)("div",{className:"wcf-design-page is-placeholder"},(0,e.createElement)("div",{className:"wcf-design-page__content"},(0,e.createElement)("div",{className:"wcf-design-header--title wcf-step__title--editable"},(0,e.createElement)("div",{className:"title wcf-placeholder__width--30"})),(0,e.createElement)("div",{className:"wcf-design-page__customize"},(0,e.createElement)("div",{className:"wcf-design-page__button"}),(0,e.createElement)("div",{className:"wcf-design-page__button"})),(0,e.createElement)("div",{className:"wcf-design-page__text"},(0,e.createElement)("div",{className:"title wcf-placeholder__width--60"})),(0,e.createElement)("div",{className:"wcf-design-page__WPeditor"},(0,e.createElement)("div",{className:"title wcf-placeholder__width--80"}))),(0,e.createElement)("div",{className:"wcf-design-page__settings"},(0,e.createElement)("div",{className:"title"}),(0,e.createElement)("div",{className:"wcf-field wcf-checkbox-field"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("div",{className:"wcf-settings"},(0,e.createElement)("form",null,(0,e.createElement)("div",{className:"wcf-vertical-nav"},(0,e.createElement)("div",{className:"wcf-vertical-nav__menu"},Array(5).fill().map((t=>(0,e.createElement)("div",{className:"wcf-settings-nav__tab",key:t},(0,e.createElement)(Wy,{height:"45px"}))))),(0,e.createElement)("div",{className:"wcf-vertical-nav__content"},(0,e.createElement)(Hy,{fontSize:"35px",width:"225px"}),(0,e.createElement)(Hy,{width:"80%"}),(0,e.createElement)(Hy,{width:"80%"}),(0,e.createElement)(Hy,{width:"80%"}),(0,e.createElement)(Hy,{width:"65%"}),(0,e.createElement)(By,null),(0,e.createElement)(Hy,{fontSize:"35px",width:"300px"}),(0,e.createElement)(Hy,{width:"60%"}),(0,e.createElement)(Hy,{width:"60%"}),(0,e.createElement)(Hy,{width:"45%"}),(0,e.createElement)(By,null),(0,e.createElement)(Hy,{fontSize:"35px",width:"300px"}),(0,e.createElement)(Hy,{width:"60%"}),(0,e.createElement)(Hy,{width:"60%"}),(0,e.createElement)(Hy,{width:"45%"})))))))},Fv=function({settings:t},a="tr"){const[{options:r}]=Sl();return(0,e.createElement)("div",{className:"wcf-list-options"},(0,e.createElement)("div",{className:"wcf-list-options-wrapper"},"tr"===a?(0,e.createElement)("table",{className:"w-full"},(0,e.createElement)("tbody",null,Object.keys(t.fields).map((a=>{const n=t.fields[a],i=r[n.name]?r[n.name]:"",s=Mr.isActiveControl(n,r);return(0,e.createElement)(xM,{key:a,data:n,value:i,isActive:s,field:a})})))):(0,e.createElement)("div",{className:"wcf-list-options-container"},Object.keys(t.fields).map((n=>{const i=t.fields[n],s=r[i.name]?r[i.name]:"",o=Mr.isActiveControl(i,r);return(0,e.createElement)(xM,{key:n,data:i,value:s,isActive:o,field:n,tabName:"list-options",displayAs:a})})))))},Rv=function(a){const[r,n]=(0,t.useState)(a.isOpen?"":"collapsed"),i=a.settings.title.replace(/ /g,"_").toLowerCase(),s=a.settings.title.replace(/ /g,"-").toLowerCase();return(0,e.createElement)("div",{className:`wcf-${s} accordion-item bg-white -mx-8 border-b border-gray-200 ${!1===a?.isActive?"hidden":""}`},(0,e.createElement)("h2",{className:"accordion-header mb-0 "+("landing"===a?.settings?.step_type&&"general"===a?.settings?.slug?"hidden":""),id:`wcf_${i}_toggler`.toLowerCase()},(0,e.createElement)("button",{className:`wcf-accordion-button relative flex justify-between items-center w-full py-4 px-8 text-base font-semibold text-gray-800 text-left transition focus:outline-none ${r}`,type:"button","data-bs-toggle":"collapse","data-bs-target":`#wcf_collapse_${i}`,"aria-expanded":"false","aria-controls":`wcf_collapse_${i}`,onClick:function(){n("collapsed"===r?"":"collapsed")}},(0,e.createElement)("span",null,a.settings.title),""===r?(0,e.createElement)(gN,{className:"w-5 h-5 text-gray-400","aria-hidden":"true"}):(0,e.createElement)(fN,{className:"w-5 h-5 text-gray-400","aria-hidden":"true"}))),(0,e.createElement)("div",{id:`wcf_collapse_${i}`,className:`accordion-collapse px-8 pt-4 pb-8 ${r}`,"aria-labelledby":`wcf_${i}_toggler`},(0,e.createElement)("div",{className:"accordion-body"},(0,e.createElement)(Fv,{settings:a.settings,displayAs:a.displayAs?a.displayAs:"tr"}))))},Hv=function(){const[{step_id:a,design_settings:r,options:n,flow_type:i,flow_id:s,step_data:o,is_flow_instant_checkout:l}]=Sl(),c=r.settings,u=c?Object.values(c).sort((function(e,t){return e.priority-t.priority})):"",[{step_title:d}]=Sl(),m=(0,f.useHistory)(),g=Iy();return(0,t.useEffect)((()=>{let e=!0;return()=>{e=!1}}),[]),""===a?(0,e.createElement)(Pv,null):(0,e.createElement)("div",{className:"wcf-design-page"},"storeCheckout"===i&&d&&"yes"!==l&&(0,e.createElement)("div",{className:"mb-3"},(0,e.createElement)("div",{className:"wcf-change-step wcf-button wcf-secondary-button",onClick:async function(){await g({title:(0,z.__)("Update Template","cartflows"),description:(0,z.__)("Changing the template will permanently delete the current design in this step. Would you still like to proceed?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})&&m.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&step_id=${a}&flow_id=${s}&tab=update-template`)}},(0,e.createElement)("span",{className:""},(0,z.__)("Change Template","cartflows")))),(0,e.createElement)("div",{className:"wcf-step-notices-wrapper rounded-md bg-yellow-50 border border-yellow-200 p-4 mb-3"},(0,e.createElement)("div",{className:"flex"},(0,e.createElement)("div",{className:"text-sm text-yellow-700"},"yes"===l&&["checkout","upsell","downsell","thankyou"].includes(o?.type)?(0,e.createElement)(e.Fragment,null,(0,z.sprintf)(
// translators: %s: The current step type.
// translators: %s: The current step type.
(0,z.__)("Use this setting to customize the style of the Instant %s Layout.","cartflows"),"thankyou"===o?.type?(0,z.__)("Thank You","cartflows"):o?.type.charAt(0).toUpperCase()+o?.type.slice(1))):(0,e.createElement)(e.Fragment,null,(0,z.__)("If you are using shortcodes, enable this design settings to apply styles.","cartflows"))))),u&&(0,e.createElement)("div",{className:"wcf-design-page__settings"},(0,e.createElement)("div",{className:"mb-4"},(0,e.createElement)(vM,{id:"wcf-enable-design-settings",name:"wcf-enable-design-settings",value:n["wcf-enable-design-settings"],label:(0,z.__)("Enable Design Settings","cartflows"),fullWidth:!0})),"yes"===n["wcf-enable-design-settings"]&&Object.keys(u).map(((t,a)=>(0,e.createElement)(Rv,{settings:u[t],key:t,isOpen:0===a,isActive:Mr.isActiveControl(u[t],n)})))))},Bv=function(){return(0,e.createElement)("div",{className:"wcf-settings-nav"},(0,e.createElement)("div",{className:"wcf-settings-nav__tabs"},Array(5).fill().map((t=>(0,e.createElement)("div",{className:"wcf-settings-nav__tab",key:t},(0,e.createElement)(Wy,{height:"45px"}))))),(0,e.createElement)("div",{className:"wcf-settings-nav__content"},(0,e.createElement)(Hy,{fontSize:"35px",width:"225px"}),(0,e.createElement)(Hy,{width:"80%"}),(0,e.createElement)(Hy,{width:"80%"}),(0,e.createElement)(Hy,{width:"80%"}),(0,e.createElement)(Hy,{width:"65%"}),(0,e.createElement)(By,null),(0,e.createElement)(Hy,{fontSize:"35px",width:"300px"}),(0,e.createElement)(Hy,{width:"60%"}),(0,e.createElement)(Hy,{width:"60%"}),(0,e.createElement)(Hy,{width:"45%"})))},Wv=function(){const[{step_id:a,flow_id:r,step_data:n}]=Sl(),[i,s]=(0,t.useState)("collapsed"),o=(0,f.useHistory)(),l=Iy();return(0,e.createElement)("div",{className:"wcf-change-step-template accordion-item bg-white -mx-8 border-b border-gray-200"},(0,e.createElement)("h2",{className:"accordion-header mb-0",id:"wcf_change_step_template_toggler"},(0,e.createElement)("button",{className:`wcf-accordion-button relative flex justify-between items-center w-full py-4 px-8 text-base font-semibold text-gray-800 text-left transition focus:outline-none ${i}`,type:"button","data-bs-toggle":"collapse","data-bs-target":"#wcf_collapse_change_step_template","aria-expanded":"false","aria-controls":"wcf_collapse_change_step_template",onClick:function(){s("collapsed"===i?"":"collapsed")}},(0,e.createElement)("span",null,(0,z.__)("Change Template","cartflows")),""===i?(0,e.createElement)(gN,{className:"w-5 h-5 text-gray-400","aria-hidden":"true"}):(0,e.createElement)(fN,{className:"w-5 h-5 text-gray-400","aria-hidden":"true"}))),(0,e.createElement)("div",{id:"wcf_collapse_change_step_template",className:`accordion-collapse px-8 pt-4 pb-8 ${i}`,"aria-labelledby":"wcf_change_step_template_toggler"},(0,e.createElement)("div",{className:"accordion-body"},(0,e.createElement)("div",{className:"mb-3 flex items-center gap-4"},(0,e.createElement)("img",{src:function(){let e="";switch(n.type){case"landing":e=uv;break;case"checkout":e=dv;break;case"optin":e=pv;break;case"thankyou":e=fv;break;case"upsell":e=mv;break;case"downsell":e=gv}return e}(),alt:n.type,className:"rounded-lg w-[85px] h-[85px]"}),(0,e.createElement)("div",{className:"wcf-template-content"},(0,e.createElement)("div",{className:"wcf-step-template-type mb-3"},(0,e.createElement)("span",{className:"text-sm font-medium"},(0,z.__)("Step Type: ","cartflows")),(0,e.createElement)("span",{className:"text-sm font-normal text-gray-500 capitalize"},n.type)),(0,e.createElement)("div",{className:"wcf-change-step wcf-button wcf-secondary-button",onClick:async function(){await l({title:(0,z.__)("Update Template","cartflows"),description:(0,z.__)("Changing the template will permanently delete the current design in this step. Would you still like to proceed?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})&&o.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${r}step_id=${a}&tab=update-template`)}},(0,e.createElement)("span",{className:""},(0,z.__)("Update Template","cartflows"))))))))},Zv=function(){const[{step_data:t,settings_data:a,page_builder:r,flow_type:n,step_title:i,options:s}]=Sl(),[{license_status:o}]=g();let l=!0;void 0!==t.id&&(l=!1);const c=a.settings,u=Object.values(c).sort((function(e,t){return e.priority-t.priority}));return l?(0,e.createElement)(Bv,null):["upsell","downsell"].includes(t.type)&&wcfCartflowsPro()&&"Activated"!==o?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-multiple-order-bumps wcf-multiple-order-bumps-cta"},(0,e.createElement)(Py,{heading:(0,z.__)("License is required!","cartflows"),subHeading:(0,z.__)("Activate the license to modify this offer step's settings","cartflows")}))):(0,e.createElement)("div",{className:"wcf-settings-page"},c&&Object.keys(u).map(((a,n)=>"other"!==r&&"shortcode"===u[a].slug?null:(u[a].step_type=t?.type||"",(0,e.createElement)(Rv,{settings:u[a],key:a,displayAs:"div",isOpen:0===n,isActive:Mr.isActiveControl(u[a],s)})))),"storeCheckout"===n&&i&&(0,e.createElement)(Wv,null))},Vv=function({settings:t},a="tr"){const[{options:r}]=Sl(),n=e=>{let t="";const a=e.name;if(a&&a.includes("[")){const n=a.split("["),i=[];for(let e=1;e0&&(n=(c-c*a/100).toFixed(2)):"discount_price"===t&&a>0&&(n=(c-a).toFixed(2)),e.class=n<0?"error_field":"",n}t=o[i[0]]}else t=r[e.name]?r[e.name]:"";return t};return(0,e.createElement)("div",{className:"wcf-list-options wcf-offer-list-options"},(0,e.createElement)("div",{className:"wcf-list-options-wrapper"},"tr"===a?(0,e.createElement)("table",{className:"w-full"},(0,e.createElement)("tbody",null,Object.keys(t.fields).map((a=>{const i=t.fields[a],s=n(i),o=Mr.isActiveControl(i,r);return(0,e.createElement)(xM,{key:a,data:i,value:s,isActive:o,field:a})})))):(0,e.createElement)("div",{className:"wcf-list-options-container"},Object.keys(t.fields).map((i=>{const s=t.fields[i],o=n(s),l=Mr.isActiveControl(s,r);return(0,e.createElement)(xM,{key:i,data:s,value:o,isActive:l,field:i,tabName:"list-options",displayAs:a})})))),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null)))},Gv=function(){return(0,e.createElement)("div",{className:"wcf-checkout-products is-placeholder"},(0,e.createElement)("div",{className:"wcf-checkout-products--selection wcf-checkout__section"},(0,e.createElement)("div",{className:"wcf-product-selection-wrapper"},(0,e.createElement)("div",{className:"wcf-list-options"},(0,e.createElement)("div",{className:"wcf-list-options__title"},(0,e.createElement)("div",{className:"title wcf-placeholder__width--30"})),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",null,(0,e.createElement)("div",{className:"wcf-checkout-product-selection-field"},(0,e.createElement)("div",{className:"wcf-checkout-product-selection-field__add-new"},(0,e.createElement)("div",{className:"wcf-checkout-products__button"}),(0,e.createElement)("div",{className:"wcf-checkout-products__button"})))))))))),(0,e.createElement)("div",{className:"wcf-checkout-products__pro-options"},(0,e.createElement)("div",{className:"wcf-checkout-products--coupon"},(0,e.createElement)("div",{className:"wcf-coupon-selection-wrapper"},(0,e.createElement)("div",{className:"wcf-list-options"},(0,e.createElement)("div",{className:"wcf-list-options__title"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("th",null,(0,e.createElement)("div",null,(0,e.createElement)("div",{className:"wcf-select2-field"},(0,e.createElement)("div",{className:"title"}))))))))))),(0,e.createElement)("div",{className:"wcf-field wcf-submit"},(0,e.createElement)("div",{className:"wcf-checkout-products__button"})))},Xv=function(){const[{settings_data:a,page_settings:r,options:n,step_data:i},s]=Sl(),[{license_status:o}]=g(),l=n["wcf-offer-product"]?n["wcf-offer-product"]:"",c=[{value:"",label:"No Discount",icon:(0,e.createElement)(Cl,{className:"w-5 h-5"})},{value:"discount_percent",label:"Discount Percentage",icon:(0,e.createElement)(Ul,{className:"w-5 h-5"})},{value:"discount_price",label:"Discount Price",icon:(0,e.createElement)(Pl,{className:"w-5 h-5"})}],[u,d]=(0,t.useState)(),[m,p]=(0,t.useState)(""),f=(0,z.__)("Add","cartflows"),h=void 0===l.discount_type||""===l.discount_type?"disable":"enable",[M,y]=(0,t.useState)(h);(0,t.useEffect)((()=>{y(l?.discount_type?"enable":"disable")}),[l]);const[N,w]=(0,t.useState)({isInProcessing:!1,buttonText:f}),{isInProcessing:x,buttonText:b}=N;return void 0===a.settings?(0,e.createElement)(Gv,null):["upsell","downsell"].includes(i.type)&&wcfCartflowsPro()&&"Activated"!==o?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-multiple-order-bumps wcf-multiple-order-bumps-cta"},(0,e.createElement)(Py,{heading:(0,z.__)("License is required!","cartflows"),subHeading:(0,z.__)("Activate the license to modify this offer step's settings","cartflows")}))):(0!==l.length&&function(){const e=n["wcf-offer-discount"],t=parseFloat(n["wcf-offer-discount-value"]),a=parseFloat(l.original_price);let r=0;"discount_percent"===e?t>0&&(r=a-a*t/100):"discount_price"===e&&t>0&&(r=a-t),l.sell_price=r.toFixed(2)}(),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-offer-product--wrapper"},(0,e.createElement)("div",{className:"wcf-offer-products--selection wcf-products__section"},0===l.length?(0,e.createElement)(e.Fragment,null,(0,e.createElement)("input",{name:"wcf-offer-product[]",type:"hidden",value:""}),(0,e.createElement)("div",{className:"wcf-offer-no-product--notice border border-gray-200 bg-gray-25 text-center text-sm font-normal rounded-md p-5"},(0,z.__)("Once you select the product, they will be displayed here.","cartflows")),(0,e.createElement)("div",{className:"wcf-offer-product-selection-field__add-new flex justify-between gap-5 mt-5"},(0,e.createElement)(gM,{name:"",desc:"",field:"product",value:m,allowed_products:"",include_products:"braintree-subscription, braintree-variable-subscription",excluded_products:"grouped",placeholder:(0,z.__)("Search for a Product","cartflows"),onChangeCB:d}),(0,e.createElement)("div",{className:"wcf-select-product-button inline-flex"},(0,e.createElement)("button",{type:"button",className:br()("wcf-button",x?"wcf-disabled":"wcf-secondary-button"),onClick:function(){const e=u?.value;p(u),e&&(w({isInProcessing:!0,buttonText:(0,z.__)("Adding…","cartflows")}),A()({path:`/cartflows/v1/admin/product-data/${e}`}).then((t=>{console.log(t),s({type:"ADD_OFFER_PRODUCT",field_name:"wcf-offer-product",product_data:{value:e,quantity:"1",label:u?.label,img_url:t?.img_url,original_price:t?.regular_price}}),p(null),w({isInProcessing:!1,buttonText:f})})),d(null))}},!x&&(0,e.createElement)(zr,{className:"w-4 h-4 stroke-2","aria-hidden":"true"}),x&&(0,e.createElement)(Sr,{className:"w-4 h-4 stroke-2 animate-spin","aria-hidden":"true"}),b)))):(0,e.createElement)("div",{className:"overflow-visible shadow border border-gray-200 rounded-md"},(0,e.createElement)("div",{className:"wcf-offer-product-selection--header border-b border-gray-200 flex gap-6 p-3"},(0,e.createElement)("div",{className:"text-left text-sm font-semibold text-gray-900 w-1/2"},(0,z.__)("Items","cartflows")),(0,e.createElement)("div",{className:"text-left text-sm font-semibold text-gray-900 w-[10%]"},(0,z.__)("Quantity","cartflows")),(0,e.createElement)("div",{className:"text-left text-sm font-semibold text-gray-900 w-1/5"},(0,z.__)("Discount","cartflows")),(0,e.createElement)("div",{className:"text-left text-sm font-semibold text-gray-900 w-1/6"},(0,z.__)("Shipping Rate","cartflows")),(0,e.createElement)("div",{className:"relative w-[5%]"},(0,e.createElement)("span",{className:"sr-only"},(0,z.__)("Delete","cartflows")))),(0,e.createElement)("div",{className:"wcf-offer-product-selection--selected-product flex items-center p-3 gap-4"},(0,e.createElement)("div",{className:"wcf-offer-product-selection--product-title whitespace-nowrap text-sm font-medium text-gray-900 w-1/2"},(0,e.createElement)("div",{className:"flex gap-3 items-center"},(0,e.createElement)("div",{className:"wcf-offer-product-selection--product-image flex w-24 h-24"},(0,e.createElement)("img",{src:l.img_url?l.img_url:cartflows_admin.image_placeholder,className:"product-image rounded-md w-full h-full aspect-{3/2} object-contain",alt:wr(l.label)})),(0,e.createElement)("div",{className:"wcf-offer-product-selection--product-title_text"},(0,e.createElement)("div",{className:"wcf-offer-product-repeater-field__title whitespace-normal text-left","data-product_id":l.value},wr(l.label)),(0,e.createElement)("div",{className:"wcf-offer-product-repeater-field__reg-price mt-1"},(0,e.createElement)("div",{className:"flex gap-2"},(0,e.createElement)("span",{className:"wcf-offer-product--reg-price "+(0(0,e.createElement)("div",{className:"wcf-order-bumps-rule",key:t},(0,e.createElement)("div",{className:"wcf-order-bumps-rule--select-box"},(0,e.createElement)(Wy,{height:"35px",width:"30%"}),(0,e.createElement)(Wy,{height:"35px",width:"30%"}),(0,e.createElement)(Wy,{height:"35px",width:"30%"})),2!==a&&(0,e.createElement)("div",{className:"wcf-order-bumps-rule__and"},(0,e.createElement)(Wy,{height:"25px",width:"5%"})))))),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--or"},(0,e.createElement)(Wy,{height:"35px",width:"5%"}),(0,e.createElement)(Wy,{height:"45px",width:"12%"})),(0,e.createElement)("div",{className:"wcf-order-bumps-rules-save-settings"},(0,e.createElement)(Wy,{height:"45px",width:"12%"})))},ej=new function(){const e=this;this.compare=function(e,t,a){switch(a){case"==":return e==t;case"!=":return e!=t;case"!==":return e!==t;case"in":return-1!==t.indexOf(e);case"!in":return-1===t.indexOf(e);case"contains":return-1!==e.indexOf(t);case"!contains":return-1===e.indexOf(t);case"<":return e":return e>t;case">=":return e>=t;default:return e===t}},this.check=function(t,a){const r="or"===t.relation;let n=!r;return t.fields.map((function(t){let i;return i=t.fields?e.check(t,a):e.compare(a[t.name],t.value,t.operator),r?(i&&(n=!0),!i):i?"":n=!1})),n},this.isActiveControl=function(t,a){const r=!!t?.conditions&&t?.conditions;return!(r&&!e.check(r,a))}},tj=function(){const[{page_settings:t,current_ob:a}]=Sl();if(null===t||"undefined"===t)return(0,e.createElement)(qv,null);const r=t?.settings["multiple-order-bump-design"];return(0,e.createElement)("div",{className:"wcf-order-bump-design-tab"},(0,e.createElement)("div",{className:"wcf-order-bump-design-tab__settings"},r&&Object.keys(r.fields).map((t=>{const n=r.fields[t];let i="";return"borders"===n.id&&(i="grid grid-cols-4 gap-x-4"),"shadow"===n.id&&(i="grid grid-cols-5 gap-x-2"),n.section_fields?(0,e.createElement)("div",{key:t,className:`wcf-order-bump-design-tab--${n.id}-section ${i} p-5 border border-gray-200 rounded-md mb-5`},(0,e.createElement)("div",{className:"wcf-order-bump-deign-tab--heading-section col-span-full"},(0,e.createElement)(dM,{label:n.title,labelClass:"block text-base font-semibold text-gray-800 mb-5"})),Object.keys(n.section_fields).map((t=>{const r=n.section_fields[t],i=a[r.name],s=ej.isActiveControl(r,a);return(0,e.createElement)(xM,{key:t,data:r,value:i,isActive:s,field:t,displayAs:"div",tabName:"ob-design"})}))):(0,e.createElement)("div",{key:t,className:"wcf-order-bump-design-tab--section mb-5"},(0,e.createElement)(xM,{key:n.name,data:n,value:a[n.name],isActive:ej.isActiveControl(n,a),field:n.name,displayAs:"div",tabName:"ob-design"}))}))))};function aj({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 6v.75m0 3v.75m0 3v.75m0 3V18m-9-5.25h5.25M7.5 15h3M3.375 5.25c-.621 0-1.125.504-1.125 1.125v3.026a2.999 2.999 0 0 1 0 5.198v3.026c0 .621.504 1.125 1.125 1.125h17.25c.621 0 1.125-.504 1.125-1.125v-3.026a2.999 2.999 0 0 1 0-5.198V6.375c0-.621-.504-1.125-1.125-1.125H3.375Z"}))}const rj=t.forwardRef(aj),nj=function(){const[{page_settings:a,current_ob:r},n]=Sl(),[i,s]=(0,t.useState)(r?.product[0]?r?.product[0]:""),[o,l]=(0,t.useState)(!1),[c,u]=(0,t.useState)(),d=(0,z.__)("Add","cartflows"),[m,g]=(0,t.useState)({isInProcessing:!1,buttonText:d}),{isInProcessing:p,buttonText:f}=m,h=a?.settings["multiple-order-bump-product"],M=[{value:"",label:"Original",icon:(0,e.createElement)(Cl,{className:"w-5 h-5"})},{value:"discount_percent",label:"Percentage",icon:(0,e.createElement)(Ul,{className:"w-5 h-5"})},{value:"discount_price",label:"Price",icon:(0,e.createElement)(Pl,{className:"w-5 h-5"})},{value:"coupon",label:"Coupon",icon:(0,e.createElement)(rj,{className:"w-5 h-5"})}];return""!==i&&function(){const e=r.discount_type,t=parseFloat(r.discount_value),a=parseFloat(i.original_price);let n=0;"discount_percent"===e?t>0&&(n=a-a*t/100):"discount_price"===e&&t>0&&(n=a-t),i.sell_price=n.toFixed(2)}(),(0,t.useEffect)((()=>{const e=r?.product?.[0];s(e||""),l(!(e&&!e?.is_deleted))}),[r]),null===a||"undefined"===a?(0,e.createElement)(Jv,null):(0,e.createElement)("div",{className:"wcf-order-bump-product-tab"},""===i&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"border border-gray-200 bg-gray-25 text-center text-sm font-normal rounded-md p-5"},(0,z.__)("Once you have add product, it will be displayed here.","cartflows")),(0,e.createElement)("input",{type:"hidden",name:"product"}),(0,e.createElement)("div",{className:"wcf-ob-product-selection-field__add-new flex justify-between gap-5 mt-5"},(0,e.createElement)(gM,{name:"",desc:"",field:"product",value:"",allowed_products:"",include_products:"braintree-subscription, braintree-variable-subscription",excluded_products:"grouped",placeholder:(0,z.__)("Search for a Product","cartflows"),onChangeCB:u}),(0,e.createElement)("div",{className:"wcf-select-product-button inline-flex"},(0,e.createElement)("button",{type:"button",className:br()("wcf-button",p?"wcf-disabled":"wcf-secondary-button"),onClick:function(e){e.preventDefault();const t=c?.value;"active"===cartflows_admin.woocommerce_status&&t&&(g({isInProcessing:!0,buttonText:(0,z.__)("Adding…","cartflows")}),A()({path:`/cartflows-pro/v1/admin/ob-product-data/${t}`}).then((e=>{n({type:"ADD_OB_PRODUCT",product:e}),g({isInProcessing:!1,buttonText:d})})),u())}},!p&&(0,e.createElement)(zr,{className:"w-4 h-4 stroke-2","aria-hidden":"true"}),p&&(0,e.createElement)(Sr,{className:"w-4 h-4 stroke-2 animate-spin","aria-hidden":"true"}),f)))),""!==i&&(0,e.createElement)(e.Fragment,null,o&&(0,e.createElement)("div",{className:"border border-primary-500 bg-primary-25 text-center text-primary-500 text-xs font-normal rounded-md p-5 mb-5"},(0,z.__)("The product previously added as an Order Bump has been deleted. Please add a new product.","cartflows")),(0,e.createElement)("div",{className:"wcf-ob-product-selection--selected-product flex items-center gap-3 p-3 border border-gray-200 rounded-md"},(0,e.createElement)("div",{className:"wcf-ob-product-selection--product-title whitespace-nowrap text-sm font-medium text-gray-900 w-2/4"},(0,e.createElement)("div",{className:"flex gap-3 items-center"},(0,e.createElement)("div",{className:"wcf-ob-product-selection--product-image w-20 h-20"},(0,e.createElement)("img",{src:i.product_image?i.product_image:cartflows_admin.image_placeholder,className:"wcf-ob-product-image rounded-md w-full h-full aspect-{3/2} object-contain",alt:i.label})),(0,e.createElement)("div",{className:"wcf-ob-product-selection--product-title_text"},(0,e.createElement)("div",{className:"wcf-ob-product-repeater-field__title whitespace-normal text-left","data-product_id":i.value},wr(String(i?.label))),(0,e.createElement)("input",{type:"hidden",name:"product",value:i.value?i.value:""}),(0,e.createElement)("div",{className:"wcf-ob-product-repeater-field__reg-price mt-1 "},(0,e.createElement)("div",{className:"flex gap-2"},(0,e.createElement)("span",{className:`wcf-ob-product--reg-price ${0{const a=h.fields[t],n=a.name,i=r[n],s=ej.isActiveControl(a,r);return(0,e.createElement)(xM,{key:t,data:a,value:i,isActive:s,field:t})})))))))},ij=function(){const[{page_settings:t,current_ob:a}]=Sl();if(null===t||"undefined"===t)return(0,e.createElement)(qv,null);const r=t?.settings["multiple-order-bump-content"];return(0,e.createElement)("div",{className:"wcf-order-bump-content-tab"},(0,e.createElement)("div",{className:"wcf-order-bump-content-tab__settings"},Object.keys(r.fields).map((t=>{const n=r.fields[t],i=a[n.name],s=ej.isActiveControl(n,a);return(0,e.createElement)(xM,{key:t,data:n,value:i,isActive:s,field:t,options:a,displayAs:"div",tabName:"order-bump-content"})}))))},sj=function({rules:t,group_id:a,g_index:r,groups_length:n}){const[{page_settings:i},s]=Sl(),o=i?.settings["multiple-order-bump-rules"],l=o.conditions,c=e=>{const t=e.target.getAttribute("rule_id");a&&t&&s({type:"REMOVE_OB_RULE",name:"rules",rule_id:t,group_id:a})};return(0,e.createElement)(e.Fragment,null,t.map(((i,u)=>{const d=i?.rule_id,m=t[u],g=o.field_data[m.condition];return(0,e.createElement)(e.Fragment,null,0!==u&&(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group_rules__condition-label"},(0,e.createElement)("div",{className:"wcf--condition-label__and_group relative"},(0,e.createElement)("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true"},(0,e.createElement)("div",{className:"w-full border-t border-gray-300 border-dashed"})),(0,e.createElement)("div",{className:"relative flex justify-center"},(0,e.createElement)("span",{className:"wcf--condition-label__and_group__text bg-gray-50 px-2 text-xs text-gray-400"},(0,z.__)("AND","cartflows"))))),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group_rules flex gap-3 items-center","data-rule-id":d,key:d},(0,e.createElement)("input",{type:"hidden",name:`rules[${r}][rules][${u}][rule_id]`,value:d}),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--rule_fields grid gap-3 items-center w-full \n\t\t\t\t\t\t\t\t\t"+(g?.fields?.some((e=>"product"===e.type))?"grid-cols-2":"grid-cols-3")},(0,e.createElement)(jr,{name:`rules[${r}][rules][${u}][condition]`,wrapperClass:"block",options:l,onSelect:()=>{s({type:"RESET_OB_RULE_VALUE",name:"rules",group_id:a,rule_id:d})},value:m.condition}),(0,e.createElement)(jr,{name:`rules[${r}][rules][${u}][operator]`,wrapperClass:"block",options:g.operator,value:wr(m.operator)}),function(t,a,n){const i=n.value;let s="";const o=`rules[${r}][rules][${a}][value]`;return t.map((t=>{switch(t.type){case"select2":s=(0,e.createElement)(Tl,{name:`${o}[]`,value:i,placeholder:t.placeholder,tooltip:t.tooltip,options:t.options,isMulti:t.isMulti,isSearchable:t?.enable_search});break;case"number":s=(0,e.createElement)(mg,{name:o,value:i,min:0,placeholder:t.placeholder,tooltip:t.tooltip});break;case"coupon":s="exist"===n.operator||"not_exist"===n.operator?(0,e.createElement)(jr,{name:o,options:[{label:"in parent order",value:"parent_order"}]}):(0,e.createElement)(pM,{name:o,placeholder:t.placeholder,tooltip:t.tooltip,value:i,isMulti:t.isMulti});break;case"product":s=(0,e.createElement)(gM,{name:o,placeholder:t.placeholder,tooltip:t.tooltip,value:i,isMulti:t.isMulti,sectionClass:"col-span-full",showLabelOnly:!0})}return s}))}(g.fields,u,m)),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--rule_actions"},function(t,r){return 1===t&&1===n?"":(0,e.createElement)(Zl,{className:"w-5 h-6 stroke-2 p-0.5 text-gray-400 cursor-pointer hover:text-primary-700 focus:text-primary-700",onClick:c,group_id:a,rule_id:r})}(t.length,d))))})))},oj=function(){const[{options:a,current_ob:r},n]=Sl(),[i,s]=(0,t.useState)({ruleGroupId:"",isOpen:!1}),{ruleGroupId:o,isOpen:l}=i;if(null===a||"undefined"===r)return(0,e.createElement)(Kv,null);const c=r.rules;if(void 0===c)return(0,e.createElement)(uM,{content:(0,z.__)("Please Update the CartFlows Pro to the latest version to use the conditional order bump feature.","cartflows")});const u=()=>{const e={group_id:Math.random().toString(36).substring(2,5),rules:[{rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""}]};n({type:"ADD_NEW_OB_GROUP",name:"rules",newGroup:e})},d=e=>{const t=e.target.getAttribute("data-group_id"),a={rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""};n({type:"ADD_NEW_OB_RULE",name:"rules",newRule:a,group_id:t})},m=function(e){const t=e.target.getAttribute("data-group_id");s({ruleGroupId:t,isOpen:o!==t||!l})};return(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page--enable_option"},(0,e.createElement)(vM,{name:"is_rule",value:r.is_rule,label:(0,z.__)("Enable conditional order bump ","cartflows"),tooltip:(0,z.__)("By enabling this option, you can create the conditions to display the order bump.","cartflows")})),"yes"===r.is_rule&&c&&(0,e.createElement)("div",{className:"mt-8"},(0,e.createElement)(Al.ReactSortable,{id:"wcf-order-bump-sortable-wrapper",className:"wcf-order-bump--sortable-wrapper flex flex-col gap-4",list:c,setList:e=>n({type:"SET_OB_RULES_GROUPS",groups:e,fieldName:"rules"}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-order-bumps-rules-page--group_wrapper",filter:".wcf-order-bumps-rules--rule_fields, .wcf-order-bumps-rules--rule_actions, .wcf-field wcf-select-option, .wcf-order-bumps-rules--add-rule__repeater .wcf-button.wcf-button--secondary, .wcf-field__data--content, .wcf-order-bumps-rules-page--group_wrapper__footer, .wcf-checkout-rules--group_header__right",preventOnFilter:!1,onStart:function(){document.getElementsByClassName("wcf-order-bumps-rules--or_group__button")[0].setAttribute("style","display:none")},onEnd:function(){document.getElementsByClassName("wcf-order-bumps-rules--or_group__button")[0].setAttribute("style","display:inline-block")}},c.map(((t,a)=>{const r=t.group_id,n=t.rules;return(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page--group_wrapper",key:r},(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group border border-gray-200 rounded-lg mb-6","data-group-id":r},(0,e.createElement)("input",{type:"hidden",name:`rules[${a}][group_id]`,value:r}),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group-header bg-white p-4 rounded-lg flex items-center justify-between"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group_header__left flex gap-2 items-center"},(0,e.createElement)("div",{className:"wcf-order-bumps-rule--sortable-toggle flex cursor-move text-gray-500"},(0,e.createElement)(Rl,{className:"w-6 h-6 stroke-1 -ml-2","aria-hidden":"true"}),(0,e.createElement)(Rl,{className:"w-6 h-6 stroke-1 -ml-4","aria-hidden":"true"})),(0,e.createElement)("span",{className:"wcf-group-header--text font-sm font-normal text-gray-400"},(0,z.__)("Show this order bump if following conditions are true","cartflows"))),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group_header__right flex gap-2 items-center"},o===r&&l?(0,e.createElement)(gN,{className:"w-4 h-4 stroke-1 text-gray-400 hover:text-gray-500 cursor-pointer","aria-hidden":"true",onClick:m,"data-group_id":r}):(0,e.createElement)(fN,{className:"w-4 h-4 stroke-1 text-gray-400 hover:text-gray-500 cursor-pointer","aria-hidden":"true",onClick:m,"data-group_id":r}))),(0,e.createElement)("div",{id:`wcf-order-bumps-rules--group-${r}`,className:"pt-7 px-7 pb-4 border-t border-gray-200 "+(o===r&&l?"visible":"hidden")},(0,e.createElement)("div",{className:"wcf-order-bumps-rules--group_rules--wrapper flex flex-col gap-4"},0!==n.length&&(0,e.createElement)(sj,{rules:n,group_id:r,g_index:a,groups_length:c.length})),(0,e.createElement)("div",{className:"wcf-order-bumps-rules--add-rule__repeater flex"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules--add-rule__button text-sm font-medium flex gap-1.5 items-center cursor-pointer text-primary-500 hover:text-primary-600 focus:text-primary-600 mt-5","data-group_id":r,onClick:d},(0,e.createElement)(zr,{className:"w-18 h-18 stroke-2"}),(0,z.__)("Add Condition","cartflows"))))),(0,e.createElement)("div",{className:"wcf-order-bumps-rules-page--group_wrapper__footer"},(0,e.createElement)("div",{className:"wcf-order-bumps-rules--or_group relative"},(0,e.createElement)("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true"},(0,e.createElement)("div",{className:"w-full border-t border-gray-300 border-dashed"})),(0,e.createElement)("div",{className:"relative flex justify-center"},(0,e.createElement)("span",{className:"wcf-order-bumps-rules--or_group__text bg-gray-50 px-2 text-xs text-gray-400"},(0,z.__)("OR","cartflows")))),parseInt(a)+1===c.length&&(0,e.createElement)("div",{className:"wcf-order-bumps-rules--or_group__button mt-4"},(0,e.createElement)("span",{className:"wcf-order-bumps-rules--or_group_button or-button wcf-button wcf-secondary-button",onClick:u},(0,e.createElement)(zr,{className:"w-18 h-18 stroke-2"}),(0,z.__)("Add Conditions Group","cartflows")))))})))))},lj=function(){const[{current_ob:a}]=Sl(),[r,n]=(0,t.useState)(!1),i=()=>{n(!0)},s=()=>{n(!1)},o=a,l=e=>{let t=o?.product;return e&&t&&(Array.isArray(t)&&(t=o?.product[0]),e=(e=(e=(e=e.replace("{{product_name}}",t?.product_name)).replace("{{product_price}}",t?.display_price?t?.display_price:t?.original_price)).replace("{{product_desc}}",t?.product_desc)).replace("{{quantity}}",o?.quantity)),e},c=()=>(()=>{let e=o?.product;return Array.isArray(e)&&(e=o?.product[0]),"variable"===e?.type||!0===e?.is_variable})()?(0,e.createElement)("div",{className:"wcf-order-bump-choose-variation-preview"},(0,z.__)("Choose a variation","cartflows")):null,u=o?.position,d=wr(l(o?.checkbox_label)||""),m=wr(l(o?.hl_text)||""),g=wr(l(o?.desc_text)||""),p=o?.show_arrow,f=o?.style,h=wr(l(o?.title_text)||""),M=o?.action_element,y=o?.show_animation,N=o?.enable_show_image,w=o?.display_quantity_field,x="yes"===y?"wcf-blink":"",b=(0,e.createElement)("svg",{version:"1.1",className:`wcf-pointing-arrow ${x}`,id:"Capa_1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"20px",height:"15px",fill:"red",viewBox:"310 253 90 70",enableBackground:"new 310 253 90 70"},(0,e.createElement)("g",null,(0,e.createElement)("g",null,(0,e.createElement)("path",{d:"M364.348,253.174c-0.623,0.26-1.029,0.867-1.029,1.54v18.257h-51.653c-0.919,0-1.666,0.747-1.666,1.666v26.658c0,0.92,0.747,1.666,1.666,1.666h51.653v18.327c0,0.673,0.406,1.28,1.026,1.54c0.623,0.257,1.34,0.116,1.816-0.36l33.349-33.238 c0.313-0.313,0.49-0.737,0.49-1.18c0-0.443-0.177-0.866-0.487-1.179l-33.349-33.335 C365.688,253.058,364.971,252.915,364.348,253.174z"})))),D=o?.bg_color,v=o?.border_style,j=o?.border_color,_=o?.box_border_width,I=o?.box_border_radius,E=o?.box_shadow_color,L=""!==o?.box_shadow_horizontal?o?.box_shadow_horizontal:0,T=""!==o?.box_shadow_vertical?o?.box_shadow_vertical:0,A=""!==o?.box_shadow_blur?o?.box_shadow_blur:0,k=""!==o?.box_shadow_spread?o?.box_shadow_spread:0,S=o?.label_color?o?.label_color:"#7a7a7a",O=o?.label_bg_color,C=o?.desc_text_color,Y=o?.hl_text_color,U=o?.button_text_color,Q=o?.button_text_hover_color,P=o?.button_color,F=o?.button_border_width,R=o?.button_border_style,H=o?.button_border_color,B=o?.button_border_radius,W=o?.button_hover_color,Z=o?.title_text_color,V=o?.label_border_style,G=o?.label_border_width,X=o?.label_border_radius,J=o?.label_border_color,q={background:D,borderStyle:v,borderColor:j,borderRadius:""!==I?I+"px":"4px",borderWidth:""!==_?_+"px":"1px",boxShadow:L+"px "+T+"px "+A+"px "+k+"px "+E};let $={},K={},ee={};"style-1"===f?($={borderColor:j,borderBottomStyle:"inherit"!==v?v:"solid",background:O,borderWidth:_+"px"},q.borderStyle="inherit"!==v?v:"solid"):"style-2"===f?($={borderColor:j,borderTopStyle:"inherit"!==v?v:"solid",background:O,borderWidth:_+"px"},q.borderStyle="inherit"!==v?v:"solid"):"style-3"===f?q.borderStyle="inherit"!==v?v:"solid":"style-4"===f?(q.borderStyle="inherit"!==v?v:"solid",ee={color:r?Q:U,background:r?W:P,borderWidth:""!==F?F+"px":"1px",borderStyle:"inherit"!==R?R:"none",borderColor:H,borderRadius:""!==B?B+"px":"3px"}):"style-5"===f&&(q.borderStyle="inherit"!==v?v:"",K={borderStyle:"inherit"!==V?V:"",borderWidth:G+"px",borderRadius:X+"px",borderColor:J,background:O,padding:O?"5px 10px":"5px 0"},ee={color:r?Q:U,background:r?W:P,borderWidth:""!==F?F+"px":"1px",borderStyle:"inherit"!==R?R:"solid",borderColor:H,borderRadius:""!==B?B+"px":"3px"});let te="",ae="left",re="auto";"yes"===N&&(te=o?.product_image,ae=o?.ob_image_position,re=""!==o?.ob_image_width?o?.ob_image_width+"px":"auto"),(0,t.useEffect)((()=>{const e=document.getElementById("wcf-order-bump-preview-wrapper"),t=e.offsetTop-25,a=window.addEventListener("scroll",(()=>{window.pageYOffset>t?e.classList.add("sticky"):e.classList.remove("sticky")}));return()=>{window.removeEventListener("scroll",a)}}),[]);const ne=function(){let t="";return"yes"===w&&(t=(0,e.createElement)("div",{className:"wcf-ob-qty-selection-wrap"},(0,e.createElement)("span",{className:"wcf-ob-qty-selection-btn wcf-ob-qty-decrement wcf-ob-qty-change-icon"},"-"),(0,e.createElement)("input",{type:"number",className:"wcf-order-bump-quantity-updater",name:"wcf_order_bump_quantity",placeholder:"1",defaultValue:o?.quantity,min:"1"}),(0,e.createElement)("span",{className:"wcf-ob-qty-selection-btn wcf-ob-qty-increment wcf-ob-qty-change-icon"},"+"))),t};return(0,e.createElement)("div",{id:"wcf-order-bump-preview-wrapper",className:"wcf-order-bump-preview-wrapper"},(0,e.createElement)("div",{className:`wcf-bump-order-wrap wcf-bump-order-${f} wcf-${u}`,style:q},function(){let t="";return"style-1"===f?t=(0,e.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${ae} `},(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap",style:$},"right"!==ae&&(0,e.createElement)("label",{style:{color:S}},"yes"===p&&b,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("span",{className:"wcf-bump-order-label"},d)),"right"===ae&&(0,e.createElement)("label",{style:{color:S}},(0,e.createElement)("span",{className:"wcf-bump-order-label"},d),(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),"yes"===p&&b)),(0,e.createElement)("div",{className:"wcf-content-container"},""!==te&&"right"!==ae&&(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-left",style:{width:"auto"!==re?re:""}},(0,e.createElement)("img",{src:te,className:"wcf-image",alt:(0,z.__)("Order Bump Product Image","cartflows")})),(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,e.createElement)("div",{className:"wcf-bump-order-offer"},(0,e.createElement)("span",{className:"wcf-bump-order-bump-highlight",style:{color:Y}},m)),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:C}},g),c(),ne()),""!==te&&"right"===ae&&(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-left",style:{width:"auto"!==re?re:""}},(0,e.createElement)("img",{src:te,className:"wcf-image",alt:(0,z.__)("Order Bump Product Image","cartflows")})))):"style-2"===f?t=(0,e.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${ae} `},(0,e.createElement)("div",{className:"wcf-bump-order-offer"},(0,e.createElement)("span",{className:"wcf-bump-order-bump-highlight",style:{color:Y}},m)),(0,e.createElement)("div",{className:"wcf-content-container"},""!==te&&"right"!==ae&&(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-left",style:{width:"auto"===re?"":re}},(0,e.createElement)("img",{src:te,className:"wcf-image",alt:(0,z.__)("Order Bump Product Image","cartflows")})),(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:C}},g),c(),ne()),""!==te&&"right"===ae&&(0,e.createElement)("div",{className:"wcf-bump-order-offer-content-left",style:{width:"auto"===re?"":re}},(0,e.createElement)("img",{src:te,className:"wcf-image",alt:(0,z.__)("Order Bump Product Image","cartflows")}))),(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap",style:$},"right"!==ae&&(0,e.createElement)("label",{style:{color:S}},"yes"===p&&b,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("span",{className:"wcf-bump-order-label"},d)),"right"===ae&&(0,e.createElement)("label",{style:{color:S}},(0,e.createElement)("span",{className:"wcf-bump-order-label"},d),(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),"yes"===p&&b))):"style-3"===f?t=(0,e.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${ae} `},"right"!==ae&&(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},""!==te&&"top"!==ae&&(0,e.createElement)("div",{className:"wcf-bump-order-action"},"yes"===p&&b,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),""!==te&&(0,e.createElement)("div",{className:"wcf-bump-order-image",style:{maxWidth:"auto"!==re?re:""}},(0,e.createElement)("img",{src:te,className:"wcf-image",alt:(0,z.__)("Order Bump Product Image","cartflows")})),(0,e.createElement)("div",{className:"wcf-bump-order-text"},(0,e.createElement)("div",{className:"wcf-bump-order-label"},""===te&&(0,e.createElement)(e.Fragment,null,"yes"===p&&b,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),""!==te&&"top"===ae&&(0,e.createElement)(e.Fragment,null,"yes"===p&&b,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),(0,e.createElement)("label",{style:{color:Z}},h)),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:C}},g),c(),ne())),"right"===ae&&(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,e.createElement)("div",{className:"wcf-bump-order-text"},(0,e.createElement)("div",{className:"wcf-bump-order-label"},(0,e.createElement)("label",{style:{color:Z}},h),""===te&&(0,e.createElement)(e.Fragment,null,"yes"===p&&b,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}))),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:C}},g),c(),ne()),""!==te&&(0,e.createElement)("div",{className:"wcf-bump-order-image",style:{maxWidth:"auto"!==re?re:""}},(0,e.createElement)("img",{src:te,className:"wcf-image",alt:(0,z.__)("Order Bump Product Image","cartflows")})),""!==te&&(0,e.createElement)("div",{className:"wcf-bump-order-action"},(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),"yes"===p&&b))):"style-4"===f?t=(0,e.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${ae} `},(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},""!==te&&"right"!==ae&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:te,className:"wcf-image",style:{width:"auto"===re?"100px":re},alt:(0,z.__)("Order Bump Product Image","cartflows")})),"right"!==ae&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-bump-order-text"},(0,e.createElement)("div",{className:"wcf-bump-order-info"},(0,e.createElement)("div",{className:"wcf-bump-order-label"},(0,e.createElement)("label",{style:{color:Z}},h)),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:C}},g),c(),ne())),(0,e.createElement)("div",{className:"wcf-bump-order-action"},(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:ee,onMouseEnter:i,onMouseLeave:s},(0,z.__)("Add","cartflows")))),"right"===ae&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-bump-order-action"},(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:ee,onMouseEnter:i,onMouseLeave:s},(0,z.__)("Add","cartflows"))),(0,e.createElement)("div",{className:"wcf-bump-order-text"},(0,e.createElement)("div",{className:"wcf-bump-order-info"},(0,e.createElement)("div",{className:"wcf-bump-order-label"},(0,e.createElement)("label",{style:{color:Z}},h)),(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:C}},g),c(),ne()))),""!==te&&"right"===ae&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:te,className:"wcf-image",style:{width:"auto"===re?"100px":re},alt:(0,z.__)("Order Bump Product Image","cartflows")})))):"style-5"===f&&(t=(0,e.createElement)("div",{className:"wcf-bump-order-content"},(0,e.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,e.createElement)("div",{className:`wcf-bump-order-info wcf-bump-order-image-${ae} `},""!==te&&"right"!==ae&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:te,className:"wcf-image",style:{width:re},alt:(0,z.__)("Order Bump Product Image","cartflows")})),(0,e.createElement)("div",{className:"wcf-bump-order-text"},""!==h&&(0,e.createElement)("div",{className:"wcf-bump-order-label",style:{color:Z}},(0,e.createElement)("span",null,h)),""!==g&&(0,e.createElement)("div",{className:"wcf-bump-order-desc",style:{color:C}},g),c(),ne(),"checkbox"===M&&(0,e.createElement)("div",{className:"wcf-bump-order-action",style:K},"yes"===p&&b,(0,e.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,e.createElement)("label",{style:{color:S}},d)),"button"===M&&(0,e.createElement)("div",{className:"wcf-bump-order-action wcf-ob-action-button"},(0,e.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:ee,onMouseEnter:i,onMouseLeave:s},(0,z.__)("Add","cartflows")))),""!==te&&"right"===ae&&(0,e.createElement)("div",{className:"wcf-bump-order-image"},(0,e.createElement)("img",{src:te,className:"wcf-image",style:{width:re},alt:(0,z.__)("Order Bump Product Image","cartflows")})))))),t}()))};function cj({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"}))}const uj=t.forwardRef(cj);function dj({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.559.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.894.149c-.424.07-.764.383-.929.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.398.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.272-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const mj=t.forwardRef(dj),gj=()=>{const[{flow_id:e,step_id:a,current_ob:r},n]=Sl(),[,i]=g();return{saveOrderBump:(0,t.useCallback)((()=>{i({status:"PROCESSING"});const t=document.querySelector(".wcf-slide-out-panel--form");if(!t)return i({status:"RESET"}),Promise.resolve(!1);if(null===r)return i({status:"SAVED"}),Promise.resolve(!0);if("undefined"!=typeof tinymce){const e=tinymce.get("wcf-order-bump-desc-editor");e&&e.save()}const s=new window.FormData(t),o=r.id;return s.append("action","cartflows_pro_save_order_bump_settings"),s.append("security",cartflows_admin.save_order_bump_settings_nonce),s.append("post_id",e),s.append("step_id",a),s.append("ob_id",o),A()({url:cartflows_admin.ajax_url,method:"POST",body:s}).then((e=>{if(e.data&&e.data.success){const e=new window.FormData;return e.append("action","cartflows_pro_get_current_order_bump"),e.append("security",cartflows_admin.get_current_order_bump_nonce),e.append("ob_id",o),e.append("step_id",a),A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((e=>(e.data&&e.data.success&&e.data.current_ob&&n({type:"SET_CURRENT_OB",current_ob:e.data.current_ob,ob_id:o}),i({status:"SAVED"}),window.wcfUnsavedChanges=!1,!0)))}return i({status:"RESET"}),!1})).catch((e=>(console.error(e),i({status:"RESET"}),!1)))}),[e,a,r,n,i])}},pj=function(a){const[{step_id:r,options:n,current_ob:i},s]=Sl(),[o,l]=(0,t.useState)("product"),c=new URLSearchParams((0,f.useLocation)().search),u=a.ob_id,d=c.get("obtab"),m=Iy(),{saveOrderBump:g}=gj();!function(){const[{current_ob:e},a]=Sl(),r=function(t){const{name:r,value:n}=t.detail;if(r.includes("[")){const t=r.split("["),i=[];for(let e=1;e(e&&n.map((function(e){return document.addEventListener(`wcf:${e.type}:change`,r),""})),()=>{n.map((function(e){return document.removeEventListener(`wcf:${e.type}:change`,r),""}))})),[e])}();const p=[{name:(0,z.__)("Product","cartflows"),slug:"product",icon:(0,e.createElement)(Ob,{className:"w-18 h-18 stroke-2"})},{name:(0,z.__)("Content","cartflows"),slug:"content",icon:(0,e.createElement)(uj,{className:"w-18 h-18 stroke-2"})},{name:(0,z.__)("Styles","cartflows"),slug:"styles",icon:(0,e.createElement)(Cv,{className:"w-18 h-18 stroke-2"})},{name:(0,z.__)("Conditions","cartflows"),slug:"conditions",icon:(0,e.createElement)(mj,{className:"w-18 h-18 stroke-2"})}];if((0,t.useEffect)((()=>((async()=>{!function(){const e=new window.FormData;e.append("action","cartflows_pro_get_current_order_bump"),e.append("security",cartflows_admin.get_current_order_bump_nonce),e.append("ob_id",u),e.append("step_id",r),A()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then((e=>{e.data.success&&s({type:"SET_CURRENT_OB",current_ob:e.data.current_ob,ob_id:u})}))}(),null!==n&&"undefined"!==n||A()({path:`/cartflows/v1/admin/step-data/${r}`}).then((e=>{if(e.billing_fields){const t=Object.entries(e.billing_fields.fields).map((([e,t])=>({...t,key:e})));e.billing_fields=t}if(e.shipping_fields){const t=Object.entries(e.shipping_fields.fields).map((([e,t])=>({...t,key:e})));e.shipping_fields=t}s({type:"SET_STEP_DATA",data:e})}))})(),()=>{})),[]),null===i||"undefined"===i){let t="";switch(d){case"design":case"content":t=(0,e.createElement)(qv,null);break;case"product":default:t=(0,e.createElement)(Jv,null);break;case"settings":t=(0,e.createElement)($v,null);break;case"conditions":t=(0,e.createElement)(Kv,null)}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-page-wrapper wcf-order-bump-page-wrapper"},t))}if(i&&u!==i.id)return"";return(0,e.createElement)("div",{className:"wcf-order-bump-page-wrapper p-6 bg-gray-50 rounded-b-lg"},(0,e.createElement)("div",{className:"wcf-order-bump-content-tab__preview"},(0,e.createElement)(lj,null)),(0,e.createElement)("div",{className:"wcf-order-bump--tabs-wrapper border border-gray-200 isolate inline-flex rounded-md shadow-sm w-full mt-8 mb-8 gap-0.5"},p.map((t=>{const a=t.slug===o?"z-10 text-primary-600 bg-primary-25 outline-none ring-1 ring-primary-300 rounded-lg shadow shadow-primary-lg":"";return(0,e.createElement)("button",{type:"button",className:br()("wcf-order-bump--tab flex justify-center gap-2 relative text-center w-1/3 items-center px-4 py-2 text-sm font-medium text-gray-400 hover:bg-primary-25 hover:ring-1 hover:ring-primary-300 hover:rounded-lg hover:text-primary-600",a),onClick:()=>{!async function(e){e!==o?(await async function(){return!!window.wcfUnsavedChanges&&await m({title:(0,z.__)("Save Changes","cartflows"),description:(0,z.__)("You have made changes. Do you want to save the changes?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows"),onConfirm:g})}()||l(e),window.wcfUnsavedChanges=!1):l(e)}(t.slug)},key:t.slug},t.icon?t.icon:"",(0,e.createElement)("span",{className:"text-center"},t.name))}))),function(){let t=(0,e.createElement)("h1",null,"404 Not Found");switch(o){case"styles":t=(0,e.createElement)(tj,null);break;case"product":default:t=(0,e.createElement)(nj,null);break;case"content":t=(0,e.createElement)(ij,null);break;case"conditions":t=(0,e.createElement)(oj,null)}return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",null,t))}())},fj=function(a){const{flow_id:r,step_id:n,data:i,callback:s}=a,[{},o]=Sl(),[l,c]=(0,t.useState)(i.status),[u,d]=(0,t.useState)(!1),[m,g]=(0,t.useState)(""),[p,f]=(0,t.useState)(!1),[h,M]=(0,t.useState)(!1),y=(0,t.createRef)(),[N,w]=(0,t.useState)(""),x=Iy();(0,t.useEffect)((()=>{c(l)}),[l,N]);let b=i.title;const D=function(e){e.preventDefault(),f(!0)},v=function(e){e.preventDefault(),f(!1)},j=function(e){e.preventDefault(),M(!0);const t=e.target.getAttribute("data-ob_id"),a=y.current.value,r=new window.FormData;r.append("action","cartflows_pro_update_order_bump_title"),r.append("security",cartflows_admin.update_order_bump_title_nonce),r.append("step_id",n),r.append("new_title",a),r.append("ob_id",t),A()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then((()=>{o({type:"SET_OB_TITLE",title:a,name:"wcf-order-bumps",ob_id:t}),M(!1),f(!1)}))},_=function(e){event.preventDefault();const t=e.target.getAttribute("data-ob_id");w(!N&&t?t:"")};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-order-bump border-b border-gray-200 last:border-0",onDragEnd:s},(0,e.createElement)("div",{className:"wcf-order-bump__content-wrapper flex items-center relative p-6 text-sm gap-2"},(0,e.createElement)("div",{className:"wcf-order-bump__data wcf-column--product w-3/4"},(0,e.createElement)("div",{className:"wcf-order-bump__data-title flex items-center gap-2"},(0,e.createElement)("span",{className:"text-sm font-medium text-gray-800 flex gap-2 justify-center items-center"},function(){""===b&&(b=(0,z.__)("(no title)","cartflows"));let t=hr(b,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length),a=(0,e.createElement)("a",{href:"#",className:"wcf-ob-header__title--edit flex p-1 cursor-pointer text-gray-500 hover:text-primary-500 hover:bg-gray-100 focus:bg-gray-100 relative wcf-inline-tooltip","data-tooltip":(0,z.__)("Edit Step Name","cartflows"),onClick:D},(0,e.createElement)(by,{className:"w-4 h-4 stroke-1"}));return p&&(t=(0,e.createElement)(dg,{attr:{ref:y},id:"new-step-title",value:b,autocomplete:"off",class:"new-step-title text-sm font-medium text-gray-800 !border-gray-200 !outline-none !shadow-none !px-3 !py-1"}),a=(0,e.createElement)(e.Fragment,null,(0,e.createElement)("button",{className:"wcf-button--small wcf-button wcf-primary-button "+(h?"wcf-disabled":""),href:"#",onClick:j,"data-ob_id":i.id},h&&(0,e.createElement)(ny,null),(0,z.__)("Save","cartflows")),(0,e.createElement)("button",{className:"wcf-button--small wcf-button wcf-secondary-button",href:"#",onClick:v},(0,z.__)("Cancel","cartflows")))),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("span",{className:"wcf-ob-header__title--text"},t),(0,e.createElement)("span",{className:"wcf-ob-header__title--buttons flex gap-2"},a))}()),""===i.product&&(0,e.createElement)("span",{className:"wcf-badge wcf-badge--warning text-xs border-0"},(0,e.createElement)(rb,{className:"w-4 h-4 stroke-2"}),(0,z.__)("No product","cartflows")))),(0,e.createElement)("div",{className:"wcf_order_bump__status w-[12%] flex gap-2"},(0,e.createElement)("button",{type:"button",className:br()("bg-gray-200 relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary-600 focus:ring-offset-2",l?"bg-primary-600":"bg-gray-200"),role:"switch",onClick:function(e){d(!0);const t=e.target.getAttribute("data-ob_id"),a=new window.FormData;a.append("action","cartflows_pro_update_order_bump_status"),a.append("security",cartflows_admin.update_order_bump_status_nonce),a.append("ob_id",t),a.append("post_id",r),a.append("step_id",n),a.append("ob_status",!l),A()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then((()=>{o({type:"SET_OB_STATUS",name:"wcf-order-bumps",newStatus:!l,ob_id:t}),c(!l),d(!1)}))},"data-wcf-order-bump-switch":l,"data-ob_id":i.id},(0,e.createElement)("span",{"aria-hidden":"true",className:br()(l?"translate-x-5":"translate-x-0","translate-x-0 pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out")})),u&&(0,e.createElement)(Sr,{className:"w-18 h-18 stroke-2 text-primary-500 animate-spin"})),(0,e.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions flex justify-between w-[12%]"},(0,e.createElement)("span",{className:"wcf-clone-bump-button cursor-pointer text-gray-500 hover:text-primary-500 p-1 hover:bg-gray-100 focus:bg-gray-100 rounded relative wcf-inline-tooltip",id:i.id,onClick:e=>{e.preventDefault();const t=new window.FormData,a=e.target.closest(".wcf-clone-bump-button").getAttribute("id");g("clone"),t.append("action","cartflows_pro_clone_order_bump"),t.append("security",cartflows_admin.clone_order_bump_nonce),t.append("ob_id",a),t.append("step_id",n),A()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then((e=>{e.success&&(o({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:e.data.order_bumps}),g(""))}))},"data-tooltip":(0,z.__)("Duplicate Order Bump","cartflows")},"clone"===m?(0,e.createElement)(Sr,{className:"w-18 h-18 stroke-1 animate-spin"}):(0,e.createElement)(ob,{className:"w-18 h-18 stroke-1"})),(0,e.createElement)("a",{className:"wcf-setting-bump-button cursor-pointer text-gray-500 p-1 hover:bg-primary-50 hover:text-primary-500 focus:bg-primary-50 rounded relative wcf-inline-tooltip "+(N===i.id?"bg-primary-50 text-primary-500":""),"data-ob_id":i.id,"data-tooltip":(0,z.__)("Edit Order Bump","cartflows"),onClick:_},(0,e.createElement)(mj,{className:"w-18 h-18 stroke-1","data-ob_id":i.id,onClick:_})),(0,e.createElement)("span",{className:"wcf-remove-order-bump-button cursor-pointer text-gray-500 hover:text-primary-500 p-1 hover:bg-gray-100 focus:bg-gray-100 rounded relative wcf-inline-tooltip after:-left-16",id:i.id,onClick:async function(e){if(e.preventDefault(),!await x({title:(0,z.__)("Trash Order Bump","cartflows"),description:(0,z.__)("Do you really want to trash this order bump permanently?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")}))return;const t=e.target.closest(".wcf-remove-order-bump-button").getAttribute("id");g("delete");const a=new window.FormData;a.append("action","cartflows_pro_delete_order_bump"),a.append("security",cartflows_admin.delete_order_bump_nonce),a.append("ob_id",t),a.append("post_id",r),a.append("step_id",n),A()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then((e=>{e.success&&(o({type:"REMOVE_ORDER_BUMP",name:"wcf-order-bumps",ob_id:t}),g(""))}))},"data-tooltip":(0,z.__)("Delete Order Bump","cartflows")},"delete"===m?(0,e.createElement)(Sr,{className:"w-18 h-18 stroke-2 animate-spin"}):(0,e.createElement)(Zl,{className:"w-18 h-18 stroke-1"}))))),N&&(0,e.createElement)(pj,{ob_id:N}))},hj=function(){return(0,e.createElement)("div",{className:"wcf-multiple-order-bumps is-placeholder"},(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__add-new"},(0,e.createElement)("span",{className:"wcf-add-new-order-bump wcf-button--primary"})),(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__header"},(0,e.createElement)("div",{className:"wcf-column wcf-column--title"},"Title"),(0,e.createElement)("div",{className:"wcf-column wcf-column--status"},"Status"),(0,e.createElement)("div",{className:"wcf-column wcf-column--actions"},"Actions")),(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__content"},(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-order-bump"},(0,e.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,e.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,e.createElement)("div",{className:"wcf-order-bump__data-title"},(0,e.createElement)("span",{title:"ob"}))),(0,e.createElement)("div",{className:"wcf_order_bump__status"},(0,e.createElement)("span",{className:"wcf-ob-status"})),(0,e.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,e.createElement)("span",{title:"Edit Order Bump"}))))),(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-order-bump"},(0,e.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,e.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,e.createElement)("div",{className:"wcf-order-bump__data-title"},(0,e.createElement)("span",{title:"ob"}))),(0,e.createElement)("div",{className:"wcf_order_bump__status"},(0,e.createElement)("span",{className:"wcf-ob-status"})),(0,e.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,e.createElement)("span",{title:"Edit Order Bump"})))))))},Mj=function(){return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-multiple-order-bumps wcf-multiple-order-bumps-cta"},(0,e.createElement)("span",{className:"wcf-accordion-button relative flex justify-between items-center w-full py-4 px-0 text-base font-semibold text-gray-800 text-left transition focus:outline-none"},(0,e.createElement)("span",{className:"flex gap-2 items-center"},(0,e.createElement)("span",null,(0,z.__)("Order Bumps","cartflows")),(0,e.createElement)("span",{className:"wcf-pro-badge px-2 py-0.5 text-xs text-primary-600 ml-auto rounded-[14px] shadow-[0px_6px_16px_-2px_rgba(240,100,52,0.4)]"},(0,e.createElement)("span",null,(0,z.__)("PRO","cartflows"))))),(0,e.createElement)(Py,{heading:(0,z.__)("Increase Your Revenue with Smart Order Bumps","cartflows"),subHeading:(0,z.__)("Boost sales with CartFlows’ Order Bump! Offer personalized add-ons at checkout to increase revenue effortlessly. Quick to set up, no coding needed!","cartflows")})))},yj=function(){const[{options:a,step_id:r,flow_id:n,page_settings:i},s]=Sl(),[{license_status:o}]=g(),[l,c]=(0,t.useState)(),[u,d]=(0,t.useState)(""),m=(0,z.__)("Add","cartflows"),[p,f]=(0,t.useState)({button_text:m,is_processing:!1}),{button_text:h,is_processing:M}=p;if(!wcfCartflowsTypePlusPro()||"Activated"!==o)return(0,e.createElement)(Mj,null);if(null===a||"undefined"===i)return(0,e.createElement)(hj,null);const y=i,N=a["wcf-order-bumps"],w=Object.keys(N).length,x=i?.settings["multiple-order-bump-design"],b=()=>{const e=a["wcf-order-bumps"],t=[];Object.keys(e).map((a=>(t.push(e[a].id),"")));const n=new window.FormData;n.append("action","cartflows_pro_reorder_order_bumps"),n.append("security",cartflows_admin.reorder_order_bumps_nonce),n.append("step_id",r),n.append("sorted_obs",t),A()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then((()=>{}))};return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("h2",{className:"text-base font-semibold text-gray-800 py-4"},(0,z.__)("Order Bumps","cartflows")),(0,e.createElement)("div",{className:"wcf-multiple-order-bumps--wrapper py-2"},w>0&&(0,e.createElement)("div",{className:"wcf-multiple-order-bumps -mx-4 mt-4 ring-1 ring-gray-200 sm:mx-0 sm:rounded-lg"},(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__header flex items-center border-b border-gray-200 px-6 py-4 text-left text-sm font-medium text-gray-800"},(0,e.createElement)("span",{className:"wcf-column wcf-column--title w-3/4"},(0,z.__)("Title","cartflows")),(0,e.createElement)("span",{className:"wcf-column wcf-column--status w-[13%]"},(0,z.__)("Status","cartflows")),(0,e.createElement)("span",{className:"wcf-column wcf-column--actions w-[12%]"},(0,e.createElement)("span",{className:"sr-only"},(0,z.__)("Actions","cartflows")))),(0,e.createElement)("div",{className:"wcf-multiple-order-bumps__content"},N&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)(Al.ReactSortable,{list:N,setList:e=>s({type:"SET_OB",obs:e,fieldName:"wcf-order-bumps",step_id:r,flow_id:n}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-order-bump",filter:".wcf-order-bump__action, .wcf_order_bump__status, .wcf-order-bump__data-title a",preventOnFilter:!1},N.map((t=>(0,e.createElement)(fj,{key:t.id,flow_id:n,step_id:r,data:t,title:t.title,settings:y.settings["multiple-order-bump"],design_settings:x,callback:b}))))))),0===w&&(0,e.createElement)("div",{className:"border border-gray-200 bg-gray-25 rounded-md px-5 py-7 text-sm text-gray-600 text-center"},(0,z.__)("Create an order bump.","cartflows")),(0,e.createElement)("div",{className:"flex wcf-multiple-order-bumps__add-new mt-5 gap-3"},(0,e.createElement)(_r,{name:"",value:l,sectionClass:"block text-left w-full",wrapperClass:"block",class:"!w-full !h-auto input-field !px-3 !py-2.5 !text-sm font-normal !rounded-md text-gray-400 !border-gray-200 focus:ring focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none !m-0 !placeholder-gray-400",placeholder:(0,z.__)("Enter order bump name","cartflows"),onChangeCB:c,desc:u,descClass:"absolute text-sm font-normal text-primary-500 mt-2"}),(0,e.createElement)("a",{className:"wcf-add-new-order-bump wcf-button "+(M?"wcf-disabled":"wcf-secondary-button"),onClick:function(e){if(e.preventDefault(),void 0!==l){d(""),f({button_text:(0,z.__)("Adding…","cartflows"),is_processing:!0});const t={title:l,id:Math.random().toString(36).substring(2,5)},a=new window.FormData;a.append("action","cartflows_pro_add_order_bump"),a.append("security",cartflows_admin.add_order_bump_nonce),a.append("ob_id",t.id),a.append("post_id",n),a.append("step_id",r),a.append("title",l),A()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then((t=>{t.success&&(s({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:t.data.order_bumps}),c(""),f({button_text:m,is_processing:!1})),e.target.blur()}))}else d((0,z.__)("Please enter the order bump title","cartflows")),e.target.blur()}},M?(0,e.createElement)(ny,null):(0,e.createElement)(zr,{className:"w-18 h-18 stroke-2"}),(0,e.createElement)("span",null,h)))),(0,e.createElement)(uM,{content:(0,z.sprintf)(
// translators: %1$s: link html start, %2$s: link html end
// translators: %1$s: link html start, %2$s: link html end
(0,z.__)("For more information about order bump settings please %1$sClick here.%2$s","cartflows"),'',"")}))},Nj=function(){return(0,e.createElement)("div",{className:"wcf-checkout-offer-settings wcf-checkout__section is-placeholder"},(0,e.createElement)("div",{className:"wcf-list-options"},(0,e.createElement)("div",{className:"wcf-list-options__title"},(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("table",null,(0,e.createElement)("tbody",null,(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"checkbox-title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})),(0,e.createElement)("tr",null,(0,e.createElement)("div",{className:"title"})))),(0,e.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,e.createElement)("div",{className:"wcf-field wcf-submit"},(0,e.createElement)("div",{className:"wcf-checkout-offer__button"})))))},wj=function(t){const[{page_settings:a,options:r}]=Sl(),n=e=>{let t="";const a=e.name;if(a&&a.includes("[")){const n=a.split("["),i=[];for(let e=1;e0&&(i=(n-n*a/100).toFixed(2)):"discount_price"===t&&a>0&&(i=(n-a).toFixed(2)),e.class=i<0?"error_field":"",i}}t=o[i[0]]}else t=r[e.name]?r[e.name]:"";return t};let i=[];switch(t.tab){case"product":default:i=a?.settings["checkout-offer-product"];break;case"content":i=a?.settings["checkout-offer-content"];break;case"styles":i=a?.settings["checkout-offer-styles"]}const s=function(a){return Object.keys(a.section_fields).map((i=>{const s=a.section_fields[i],o=n(s),l=Mr.isActiveControl(s,r);return(0,e.createElement)(xM,{key:i,data:s,value:o,isActive:l,field:i,tabName:t.tab?t.tab:"",displayAs:t.displayAs?t.displayAs:""})}))};return(0,e.createElement)("div",{className:"wcf-list-options wcf-co-list-options"},(0,e.createElement)("div",{className:"wcf-co-options-wrapper",id:"wcf-co-options-wrapper"},i&&Object.keys(i.fields).map((a=>{const o=i.fields[a];return o.section_fields?(0,e.createElement)("div",{key:a,className:`wcf-${t.tab?t.tab:"setting"}-tab--${o.id}-section p-5 border border-gray-200 rounded-md mb-5`},(0,e.createElement)("div",{className:`wcf-${t.tab?t.tab:"setting"}-tab--heading-section col-span-full`},(0,e.createElement)(dM,{label:o.title,labelClass:"block text-base font-semibold text-gray-800 mb-5"})),t.displayAs&&"tr"===t.displayAs?(0,e.createElement)("table",{className:"w-full"},(0,e.createElement)("tbody",null,s(o))):(0,e.createElement)("div",{className:"wcf-co-list-options-container"},s(o))):(0,e.createElement)("div",{key:a,className:`wcf-${t.tab?t.tab:"setting"}-tab--section mb-5`},t.displayAs&&"tr"===t.displayAs?(0,e.createElement)("table",{className:"wcf-full"},(0,e.createElement)("tbody",null,(0,e.createElement)(xM,{key:a,data:o,value:n(o),isActive:Mr.isActiveControl(o,r),field:o,tabName:t.tab?t.tab:"",displayAs:t.displayAs?t.displayAs:""}))):(0,e.createElement)("div",{className:"wcf-co-list-options-container"},(0,e.createElement)(xM,{key:a,data:o,value:n(o),isActive:Mr.isActiveControl(o,r),field:o,tabName:t.tab?t.tab:"",displayAs:t.displayAs?t.displayAs:""})))}))))};function xj({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"}))}const bj=t.forwardRef(xj);function Dj({title:e,titleId:a,...r},n){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:n,"aria-labelledby":a},r),e?t.createElement("title",{id:a},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"}))}const vj=t.forwardRef(Dj),jj=function(){const[{options:a}]=Sl(),[r,n]=(0,t.useState)("");(0,t.useEffect)((()=>{const e=document.getElementById("wcf-checkout-offer-preview-wrapper"),t=e.offsetTop-25,a=window.addEventListener("scroll",(()=>{window.pageYOffset>t?e.classList.add("sticky"):e.classList.remove("sticky")}));return()=>{window.removeEventListener("scroll",a)}}),[]);let i=a["wcf-pre-checkout-offer-product"];null!==i&&Array.isArray(i)&&(i=i[0]);const s=a["wcf-pre-checkout-offer-discount"],o=parseFloat(a["wcf-pre-checkout-offer-discount-value"]);let l="";const c=i?parseFloat(i.original_price).toFixed(2):0;"discount_percent"===s?o>0&&(l=(c-c*o/100).toFixed(2)):"discount_price"===s&&o>0&&(l=(c-o).toFixed(2));const u=i&&i.product_image?i.product_image:cartflows_admin.image_placeholder;return(0,e.createElement)("div",{id:"wcf-checkout-offer-preview-wrapper",className:"fullscreen"===r?"wcf-checkout-offer-preview-wrapper fullscreen":"wcf-checkout-offer-preview-wrapper"},(0,e.createElement)("div",{className:"mt-8 bg-gray-50 p-6 -mx-6"},(0,e.createElement)("div",{className:"wcf-pre-checkout-offer--header flex justify-between items-center mb-5 p-2.5"},(0,e.createElement)(dM,{label:(0,z.__)("Preview","cartflows"),labelClass:"block text-base font-semibold text-gray-800"}),""===r&&(0,e.createElement)("div",{className:"wcf-co-preview-mode wcf-full-screen-preview-button p-2.5 text-gray-400 hover:text-gray-500 cursor-pointer",onClick:()=>n("fullscreen")},(0,e.createElement)(bj,{className:"w-5 h-5 stroke-2",title:(0,z.__)("View in Full Screen","cartflows")})),"fullscreen"===r&&(0,e.createElement)("div",{className:"wcf-co-preview-mode wcf-full-screen-preview-exit-button p-2.5 text-gray-400 hover:text-gray-500",onClick:()=>n("")},(0,e.createElement)(vj,{className:"w-5 h-5 stroke-2",title:(0,z.__)("Exit Full Screen","cartflows")}))),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-wrapper wcf-pre-checkout-full-width"},(0,e.createElement)("div",{id:"wcf-pre-checkout-offer-modal",style:{backgroundColor:a["wcf-pre-checkout-offer-model-bg-color"]},className:"bg-white border border-gray-200 rounded-md"},(0,e.createElement)("div",{className:"wcf-content-main-wrapper"},(0,e.createElement)("div",{className:"wcf-lightbox-content p-6",style:{backgroundColor:a["wcf-pre-checkout-offer-model-bg-color"]}},(0,e.createElement)("div",{className:"wcf-content-modal-progress-bar mb-8"},(0,e.createElement)("div",{className:"wcf-progress-bar-nav",style:{color:a["wcf-pre-checkout-offer-desc-color"]}},(0,e.createElement)("div",{className:"wcf-pre-checkout-progress grid grid-cols-3 text-center text-sm font-normal text-gray-600 max-w-2xl mx-auto"},(0,e.createElement)("div",{className:"wcf-nav-bar-step active"},(0,e.createElement)("div",{className:"wcf-nav-bar-title mb-3",style:{color:a["wcf-pre-checkout-offer-desc-color"]}},(0,z.__)("Order Submitted","cartflows")),(0,e.createElement)("div",{className:"wcf-nav-bar-step-line relative"},(0,e.createElement)("div",{className:"wcf-progress-nav-step",style:{backgroundColor:a["wcf-pre-checkout-offer-navbar-color"]}},(0,e.createElement)("span",{className:"before"})),(0,e.createElement)("span",{className:"order-after",style:{backgroundColor:a["wcf-pre-checkout-offer-navbar-color"]}}))),(0,e.createElement)("div",{className:"wcf-nav-bar-step active inprogress"},(0,e.createElement)("div",{className:"wcf-nav-bar-title mb-3",style:{color:a["wcf-pre-checkout-offer-desc-color"]}},(0,z.__)("Special Offer","cartflows")),(0,e.createElement)("div",{className:"wcf-nav-bar-step-line relative"},(0,e.createElement)("span",{className:"before",style:{backgroundColor:a["wcf-pre-checkout-offer-navbar-color"]}}),(0,e.createElement)("div",{className:"wcf-progress-nav-step",style:{backgroundColor:a["wcf-pre-checkout-offer-navbar-color"]}},(0,e.createElement)("span",{className:"before"})),(0,e.createElement)("span",{className:"after"}))),(0,e.createElement)("div",{className:"wcf-nav-bar-step"},(0,e.createElement)("div",{className:"wcf-nav-bar-title mb-3"},(0,z.__)("Order Receipt","cartflows")),(0,e.createElement)("div",{className:"wcf-nav-bar-step-line relative"},(0,e.createElement)("span",{className:"before"}),(0,e.createElement)("div",{className:"wcf-progress-nav-step"})))))),(0,e.createElement)("div",{className:"wcf-content-main-head text-center mb-8"},(0,e.createElement)("div",{className:"wcf-content-modal-title"},(0,e.createElement)("h1",{style:{color:a["wcf-pre-checkout-offer-title-color"]},className:"text-xl font-semibold text-gray-800 mb-2.5"},a["wcf-pre-checkout-offer-popup-title"])),(0,e.createElement)("div",{className:"wcf-content-modal-sub-title"},(0,e.createElement)("span",{style:{color:a["wcf-pre-checkout-offer-subtitle-color"]},className:"text-sm font-normal text-600"},a["wcf-pre-checkout-offer-popup-sub-title"]))),(0,e.createElement)("div",{id:"wcf-pre-checkout-offer-content",className:"woocommerce border-2 border-gray-200 border-dashed rounded items-center",style:{backgroundColor:a["wcf-pre-checkout-offer-model-bg-color"]}},(0,e.createElement)("div",{className:"flex gap-4 p-5 items-center"},(0,e.createElement)("div",{className:"wcf-pre-checkout-info wcf-pre-checkout-img w-2/5"},(0,e.createElement)("img",{src:u,alt:"Checkout Offer Product",className:"border border-gray-200"})),(0,e.createElement)("div",{className:"wcf-pre-checkout-info wcf-pre-checkout-offer-product-details w-3/5"},(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-product-title"},(0,e.createElement)("h1",{style:{color:a["wcf-pre-checkout-offer-title-color"]}},a["wcf-pre-checkout-offer-product-title"])),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-price",style:{color:a["wcf-pre-checkout-offer-desc-color"],fontWeight:500}},cartflows_admin.woo_currency,""!==l&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("del",{className:"wcf-regular-price"},isNaN(c)?0:c),(0,e.createElement)("span",{className:"wcf-discount-price"}," ",l)),""===l&&(0,e.createElement)("span",{className:"wcf-regular-price"},isNaN(c)?0:c)),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-desc"},(0,e.createElement)("span",{style:{color:a["wcf-pre-checkout-offer-desc-color"],lineHeight:"0"}},wr((a["wcf-pre-checkout-offer-desc"]||"").toString()))),(0,e.createElement)("input",{type:"hidden",value:"add",className:"wcf-pre-checkout-offer-action"}))),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-actions flex flex-col gap-3 p-5"},(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-btn-action wcf-pre-checkout-add-cart-btn"},(0,e.createElement)("button",{className:"wcf-pre-checkout-offer-btn alt !w-full text-base !bg-primary-500 !rounded !text-white !font-semibold px-4 py-3 !text-center",style:{backgroundColor:a["wcf-pre-checkout-offer-button-color"],borderColor:a["wcf-pre-checkout-offer-button-color"]}},a["wcf-pre-checkout-offer-popup-btn-text"])),(0,e.createElement)("div",{className:"wcf-pre-checkout-offer-btn-action wcf-pre-checkout-skip-btn text-center"},(0,e.createElement)("a",{className:"wcf-pre-checkout-skip text-gray-400",href:"#",style:{color:a["wcf-pre-checkout-offer-desc-color"]}},a["wcf-pre-checkout-offer-popup-skip-btn-text"]))))))))))},_j=function(){const[{settings_data:a,options:r}]=Sl(),[n,i]=(0,t.useState)("product"),s=Iy();if(!wcfCartflowsPro())return(0,e.createElement)(mM,{feature:"Checkout Offer",plan_required:"starter"});const o=[{name:(0,z.__)("Product","cartflows"),slug:"product",icon:(0,e.createElement)(Ob,{className:"w-18 h-18 stroke-2"})},{name:(0,z.__)("Content","cartflows"),slug:"content",icon:(0,e.createElement)(uj,{className:"w-18 h-18 stroke-2"})},{name:(0,z.__)("Styles","cartflows"),slug:"styles",icon:(0,e.createElement)(Cv,{className:"w-18 h-18 stroke-2"})}];if(void 0===a.settings)return(0,e.createElement)(Nj,null);return(0,e.createElement)(e.Fragment,null,(0,e.createElement)(vM,{name:"wcf-pre-checkout-offer",value:r["wcf-pre-checkout-offer"],label:(0,z.__)("Enable Checkout Offer","cartflows"),fullWidth:!0}),"yes"===r["wcf-pre-checkout-offer"]&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-co-preview"},(0,e.createElement)(jj,null)),(0,e.createElement)("span",{className:"border border-gray-200 isolate inline-flex rounded-md shadow-sm w-full mt-8 mb-8 gap-0.5"},o.map((t=>{const a=t.slug===n?"z-10 text-primary-600 bg-primary-25 outline-none ring-1 ring-primary-300 rounded-lg shadow shadow-primary-lg":"";return(0,e.createElement)("button",{type:"button",className:br()("flex justify-center gap-2 relative text-center w-1/3 items-center px-4 py-2 text-sm font-medium text-gray-400 hover:bg-primary-25 hover:ring-1 hover:ring-primary-300 hover:rounded-lg hover:text-primary-600",a),onClick:()=>{!async function(e){e!==n?(await async function(){return!!window.wcfUnsavedChanges&&await s({title:(0,z.__)("Save Changes","cartflows"),description:(0,z.__)("You have made changes. Do you want to save the changes?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})}()||i(e),window.wcfUnsavedChanges=!1):i(e)}(t.slug)},key:t.slug},t.icon?t.icon:"",(0,e.createElement)("span",{className:"text-center"},t.name))}))),(0,e.createElement)("div",{className:"wcf-checkout-offer-settings wcf-checkout__section"},(0,e.createElement)(wj,{tab:n,displayAs:"div"}))))},Ij=function(){return(0,e.createElement)("div",{className:"wcf-checkout-rules-page"},(0,e.createElement)("div",{className:"wcf-checkout-rules-page--enable_option"},(0,e.createElement)(Hy,{width:"65%"})),(0,e.createElement)("div",{className:"wcf-checkout-rules--group_wrapper"},(0,e.createElement)("div",{className:"wcf-checkout-rules--text"},(0,e.createElement)(Hy,{width:"10%"}),(0,e.createElement)(Wy,{width:"25%",height:"35px"}),(0,e.createElement)(Hy,{width:"20%"})),(0,e.createElement)("div",{className:"wcf-checkout-rules"},Array(3).fill().map(((t,a)=>(0,e.createElement)("div",{className:"wcf-checkout-rule",key:a},(0,e.createElement)("div",{className:"wcf-checkout-rule--select-box"},(0,e.createElement)(Wy,{height:"35px",width:"30%"}),(0,e.createElement)(Wy,{height:"35px",width:"30%"}),(0,e.createElement)(Wy,{height:"35px",width:"30%"})),2!==a&&(0,e.createElement)("div",{className:"wcf-checkout-rule__and"},(0,e.createElement)(Wy,{height:"25px",width:"5%"})))))),(0,e.createElement)(Wy,{height:"40px",width:"9%"})),(0,e.createElement)("div",{className:"wcf-checkout-rules--or"},(0,e.createElement)(Wy,{height:"35px",width:"5%"}),(0,e.createElement)(Wy,{height:"45px",width:"12%"})),(0,e.createElement)("div",{className:"wcf-checkout-rules--default-step"},(0,e.createElement)(Hy,{width:"10%"}),(0,e.createElement)(Wy,{width:"25%",height:"35px"}),(0,e.createElement)(Hy,{width:"20%"})))},Ej=function(){return(0,e.createElement)(e.Fragment,null,(0,e.createElement)("div",{className:"wcf-checkout-rules-page-cta"},(0,e.createElement)("div",{className:"wcf-checkout-rules-page"},(0,e.createElement)("span",{className:"wcf-accordion-button relative flex justify-between items-center w-full py-4 px-0 text-base font-semibold text-gray-800 text-left transition focus:outline-none"},(0,e.createElement)("span",{className:"flex gap-2 items-center"},(0,e.createElement)("span",null,(0,z.__)("Dynamic Conditions","cartflows")),(0,e.createElement)("span",{className:"wcf-pro-badge px-2 py-0.5 text-xs text-primary-600 ml-auto rounded-[14px] shadow-[0px_6px_16px_-2px_rgba(240,100,52,0.4)]"},(0,e.createElement)("span",null,(0,z.__)("PRO","cartflows"))))),(0,e.createElement)(Py,{buttonLink:getUpgradeToProUrl("utm_source=dashboard&utm_medium=free-cartflows&utm_campaign=dynamic-offers-cta"),heading:(0,z.__)("Show the Right Offer to the Right People – Automatically!","cartflows"),subHeading:(0,z.__)("Personalize deals based on location, cart details, and more. Upgrade to CartFlows PRO and unlock this smart feature today!","cartflows")}))))},Lj=function({rules:t,group_id:a,g_index:r,groups_length:n}){const[{page_settings:i},s]=Sl(),o=i?.settings.rules,l=o.conditions,c=e=>{const t=e.target.getAttribute("rule_id");a&&t&&s({type:"REMOVE_RULE",name:"wcf-checkout-rules",rule_id:t,group_id:a})};return(0,e.createElement)(e.Fragment,null,t.map(((i,u)=>{const d=i?.rule_id,m=t[u],g=o.field_data[m.condition],p=m.operator.replace(/