| 1 |
(()=>{var e,t,n={5146(){window.wcfWpNavMenuChange=function(e){const t=cartflows_admin.admin_base_slug;let n="";"store-checkout"===e&&""!==cartflows_admin.global_checkout_id?n="admin.php?page="+t+"&path=store-checkout&action=wcf-edit-flow&flow_id="+encodeURIComponent(cartflows_admin.global_checkout_id):("store-checkout-library"===e&&(e="store-checkout"),n=e?"admin.php?page="+t+"&path="+encodeURIComponent(e):"admin.php?page="+t);const r=`.wp-submenu-wrap li > a[href$="${n}"]`,a=document.querySelectorAll(r);Array.from(document.getElementsByClassName("current")).forEach(function(e){e.parentElement.classList.contains("wp-submenu")&&e.classList.remove("current")}),Array.from(a).forEach(function(e){e.parentElement.classList.add("current")})},window.wcfUnsavedChanges=!1,window.onbeforeunload=function(){if(wcfUnsavedChanges)return"Unsaved Changes"},window.wcfCartflowsPro=function(){return!!cartflows_admin.is_pro},window.wcfCartflowsTypePro=function(){return!(!cartflows_admin.is_pro||"pro"!==cartflows_admin.cf_pro_type)},window.wcfCartflowsTypePlus=function(){return!(!cartflows_admin.is_pro||"plus"!==cartflows_admin.cf_pro_type)},window.wcfCartflowsTypeStarter=function(){return!(!cartflows_admin.is_pro||"starter"!==cartflows_admin.cf_pro_type)},window.wcfCartflowsTypePlusPro=function(){return wcfCartflowsTypePlus()||wcfCartflowsTypePro()},window.wcfInactiveProPlus=function(){const e=cartflows_admin.cf_pro_type_inactive;return!("inactive"!==cartflows_admin.cf_pro_status||!["CartFlows Pro","CartFlows Plus"].includes(e))},window.wcfInactivepluginType=function(){let e="";switch(cartflows_admin.cf_pro_type_inactive){case"CartFlows Pro":e="pro";break;case"CartFlows Plus":e="plus";break;case"CartFlows Starter":e="starter"}return e},window.getUtmUrl=function(e,t={}){const n=cartflows_admin?.utm_defaults||{source:"dashboard",medium:"free-cartflows"},r=new URL(e);return r.searchParams.has("utm_source")||r.searchParams.set("utm_source",n.source),r.searchParams.has("utm_medium")||r.searchParams.set("utm_medium",n.medium),Object.entries(t||{}).forEach(([e,t])=>{null!=t&&""!==t&&r.searchParams.set(e,t)}),r.toString()},window.getKbDocUrl=function(e,t={}){return window.getUtmUrl(e,{utm_campaign:"docs",...t||{}})},window.getUpgradeToProUrl=function(e={}){const t=cartflows_admin?.cf_upgrade_to_pro_url||(cartflows_admin?.cf_domain_url||"https://cartflows.com/")+"pricing/";return window.getUtmUrl(t,{utm_campaign:"go-pro",...e||{}})},window.setSureTriggersConfig=function(e){window?.SureTriggers.init(e)}},6246(e,t,n){e.exports={graphlib:n(8191),layout:n(8202),debug:n(8909),util:{time:n(3988).time,notime:n(3988).notime},version:n(7038)}},6822(e,t,n){"use strict";var r=n(6857),a=n(2031);e.exports={run:function(e){var t="greedy"===e.graph().acyclicer?a(e,function(e){return function(t){return e.edge(t).weight}}(e)):function(e){var t=[],n={},a={};return r.forEach(e.nodes(),function o(i){r.has(a,i)||(a[i]=!0,n[i]=!0,r.forEach(e.outEdges(i),function(e){r.has(n,e.w)?t.push(e):o(e.w)}),delete n[i])}),t}(e);r.forEach(t,function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,r.uniqueId("rev"))})},undo:function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}}},135(e,t,n){var r=n(6857),a=n(3988);function o(e,t,n,r,o,i){var s={width:0,height:0,rank:i,borderType:t},l=o[t][i-1],c=a.addDummyNode(e,"border",s,n);o[t][i]=c,e.setParent(c,r),l&&e.setEdge(l,c,{weight:1})}e.exports=function(e){r.forEach(e.children(),function t(n){var a=e.children(n),i=e.node(n);if(a.length&&r.forEach(a,t),r.has(i,"minRank")){i.borderLeft=[],i.borderRight=[];for(var s=i.minRank,l=i.maxRank+1;s<l;++s)o(e,"borderLeft","_bl",n,i,s),o(e,"borderRight","_br",n,i,s)}})}},4850(e,t,n){"use strict";var r=n(6857);function a(e){r.forEach(e.nodes(),function(t){o(e.node(t))}),r.forEach(e.edges(),function(t){o(e.edge(t))})}function o(e){var t=e.width;e.width=e.height,e.height=t}function i(e){e.y=-e.y}function s(e){var t=e.x;e.x=e.y,e.y=t}e.exports={adjust:function(e){var t=e.graph().rankdir.toLowerCase();"lr"!==t&&"rl"!==t||a(e)},undo:function(e){var t=e.graph().rankdir.toLowerCase();"bt"!==t&&"rl"!==t||function(e){r.forEach(e.nodes(),function(t){i(e.node(t))}),r.forEach(e.edges(),function(t){var n=e.edge(t);r.forEach(n.points,i),r.has(n,"y")&&i(n)})}(e),"lr"!==t&&"rl"!==t||(function(e){r.forEach(e.nodes(),function(t){s(e.node(t))}),r.forEach(e.edges(),function(t){var n=e.edge(t);r.forEach(n.points,s),r.has(n,"x")&&s(n)})}(e),a(e))}}},9859(e){function t(){var e={};e._next=e._prev=e,this._sentinel=e}function n(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function r(e,t){if("_next"!==e&&"_prev"!==e)return t}e.exports=t,t.prototype.dequeue=function(){var e=this._sentinel,t=e._prev;if(t!==e)return n(t),t},t.prototype.enqueue=function(e){var t=this._sentinel;e._prev&&e._next&&n(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t},t.prototype.toString=function(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,r)),n=n._prev;return"["+e.join(", ")+"]"}},8909(e,t,n){var r=n(6857),a=n(3988),o=n(8191).Graph;e.exports={debugOrdering:function(e){var t=a.buildLayerMatrix(e),n=new o({compound:!0,multigraph:!0}).setGraph({});return r.forEach(e.nodes(),function(t){n.setNode(t,{label:t}),n.setParent(t,"layer"+e.node(t).rank)}),r.forEach(e.edges(),function(e){n.setEdge(e.v,e.w,{},e.name)}),r.forEach(t,function(e,t){var a="layer"+t;n.setNode(a,{rank:"same"}),r.reduce(e,function(e,t){return n.setEdge(e,t,{style:"invis"}),t})}),n}}},8191(e,t,n){var r;try{r=n(8362)}catch(e){}r||(r=window.graphlib),e.exports=r},2031(e,t,n){var r=n(6857),a=n(8191).Graph,o=n(9859);e.exports=function(e,t){if(e.nodeCount()<=1)return[];var n=function(e,t){var n=new a,i=0,s=0;r.forEach(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),r.forEach(e.edges(),function(e){var r=n.edge(e.v,e.w)||0,a=t(e),o=r+a;n.setEdge(e.v,e.w,o),s=Math.max(s,n.node(e.v).out+=a),i=Math.max(i,n.node(e.w).in+=a)});var c=r.range(s+i+3).map(function(){return new o}),u=i+1;return r.forEach(n.nodes(),function(e){l(c,u,n.node(e))}),{graph:n,buckets:c,zeroIdx:u}}(e,t||i),c=function(e,t,n){for(var r,a=[],o=t[t.length-1],i=t[0];e.nodeCount();){for(;r=i.dequeue();)s(e,t,n,r);for(;r=o.dequeue();)s(e,t,n,r);if(e.nodeCount())for(var l=t.length-2;l>0;--l)if(r=t[l].dequeue()){a=a.concat(s(e,t,n,r,!0));break}}return a}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,function(t){return e.outEdges(t.v,t.w)}),!0)};var i=r.constant(1);function s(e,t,n,a,o){var i=o?[]:void 0;return r.forEach(e.inEdges(a.v),function(r){var a=e.edge(r),s=e.node(r.v);o&&i.push({v:r.v,w:r.w}),s.out-=a,l(t,n,s)}),r.forEach(e.outEdges(a.v),function(r){var a=e.edge(r),o=r.w,i=e.node(o);i.in-=a,l(t,n,i)}),e.removeNode(a.v),i}function l(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}},8202(e,t,n){"use strict";var r=n(6857),a=n(6822),o=n(8209),i=n(9361),s=n(3988).normalizeRanks,l=n(2948),c=n(3988).removeEmptyRanks,u=n(6353),d=n(135),f=n(4850),m=n(1453),p=n(3776),h=n(3988),g=n(8191).Graph;e.exports=function(e,t){var n=t&&t.debugTiming?h.time:h.notime;n("layout",function(){var t=n(" buildLayoutGraph",function(){return function(e){var t=new g({multigraph:!0,compound:!0}),n=I(e.graph());return t.setGraph(r.merge({},y,M(n,w),r.pick(n,b))),r.forEach(e.nodes(),function(n){var a=I(e.node(n));t.setNode(n,r.defaults(M(a,v),x)),t.setParent(n,e.parent(n))}),r.forEach(e.edges(),function(n){var a=I(e.edge(n));t.setEdge(n,r.merge({},E,M(a,_),r.pick(a,N)))}),t}(e)});n(" runLayout",function(){!function(e,t){t(" makeSpaceForEdgeLabels",function(){!function(e){var t=e.graph();t.ranksep/=2,r.forEach(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===t.rankdir||"BT"===t.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}(e)}),t(" removeSelfEdges",function(){!function(e){r.forEach(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}(e)}),t(" acyclic",function(){a.run(e)}),t(" nestingGraph.run",function(){u.run(e)}),t(" rank",function(){i(h.asNonCompoundGraph(e))}),t(" injectEdgeLabelProxies",function(){!function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v),a={rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t};h.addDummyNode(e,"edge-proxy",a,"_ep")}})}(e)}),t(" removeEmptyRanks",function(){c(e)}),t(" nestingGraph.cleanup",function(){u.cleanup(e)}),t(" normalizeRanks",function(){s(e)}),t(" assignRankMinMax",function(){!function(e){var t=0;r.forEach(e.nodes(),function(n){var a=e.node(n);a.borderTop&&(a.minRank=e.node(a.borderTop).rank,a.maxRank=e.node(a.borderBottom).rank,t=r.max(t,a.maxRank))}),e.graph().maxRank=t}(e)}),t(" removeEdgeLabelProxies",function(){!function(e){r.forEach(e.nodes(),function(t){var n=e.node(t);"edge-proxy"===n.dummy&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}(e)}),t(" normalize.run",function(){o.run(e)}),t(" parentDummyChains",function(){l(e)}),t(" addBorderSegments",function(){d(e)}),t(" order",function(){m(e)}),t(" insertSelfEdges",function(){!function(e){var t=h.buildLayerMatrix(e);r.forEach(t,function(t){var n=0;r.forEach(t,function(t,a){var o=e.node(t);o.order=a+n,r.forEach(o.selfEdges,function(t){h.addDummyNode(e,"selfedge",{width:t.label.width,height:t.label.height,rank:o.rank,order:a+ ++n,e:t.e,label:t.label},"_se")}),delete o.selfEdges})})}(e)}),t(" adjustCoordinateSystem",function(){f.adjust(e)}),t(" position",function(){p(e)}),t(" positionSelfEdges",function(){!function(e){r.forEach(e.nodes(),function(t){var n=e.node(t);if("selfedge"===n.dummy){var r=e.node(n.e.v),a=r.x+r.width/2,o=r.y,i=n.x-a,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:a+2*i/3,y:o-s},{x:a+5*i/6,y:o-s},{x:a+i,y:o},{x:a+5*i/6,y:o+s},{x:a+2*i/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}})}(e)}),t(" removeBorderNodes",function(){!function(e){r.forEach(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),a=e.node(n.borderTop),o=e.node(n.borderBottom),i=e.node(r.last(n.borderLeft)),s=e.node(r.last(n.borderRight));n.width=Math.abs(s.x-i.x),n.height=Math.abs(o.y-a.y),n.x=i.x+n.width/2,n.y=a.y+n.height/2}}),r.forEach(e.nodes(),function(t){"border"===e.node(t).dummy&&e.removeNode(t)})}(e)}),t(" normalize.undo",function(){o.undo(e)}),t(" fixupEdgeLabelCoords",function(){!function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}})}(e)}),t(" undoCoordinateSystem",function(){f.undo(e)}),t(" translateGraph",function(){!function(e){var t=Number.POSITIVE_INFINITY,n=0,a=Number.POSITIVE_INFINITY,o=0,i=e.graph(),s=i.marginx||0,l=i.marginy||0;function c(e){var r=e.x,i=e.y,s=e.width,l=e.height;t=Math.min(t,r-s/2),n=Math.max(n,r+s/2),a=Math.min(a,i-l/2),o=Math.max(o,i+l/2)}r.forEach(e.nodes(),function(t){c(e.node(t))}),r.forEach(e.edges(),function(t){var n=e.edge(t);r.has(n,"x")&&c(n)}),t-=s,a-=l,r.forEach(e.nodes(),function(n){var r=e.node(n);r.x-=t,r.y-=a}),r.forEach(e.edges(),function(n){var o=e.edge(n);r.forEach(o.points,function(e){e.x-=t,e.y-=a}),r.has(o,"x")&&(o.x-=t),r.has(o,"y")&&(o.y-=a)}),i.width=n-t+s,i.height=o-a+l}(e)}),t(" assignNodeIntersects",function(){!function(e){r.forEach(e.edges(),function(t){var n,r,a=e.edge(t),o=e.node(t.v),i=e.node(t.w);a.points?(n=a.points[0],r=a.points[a.points.length-1]):(a.points=[],n=i,r=o),a.points.unshift(h.intersectRect(o,n)),a.points.push(h.intersectRect(i,r))})}(e)}),t(" reversePoints",function(){!function(e){r.forEach(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}(e)}),t(" acyclic.undo",function(){a.undo(e)})}(t,n)}),n(" updateInputGraph",function(){!function(e,t){r.forEach(e.nodes(),function(n){var r=e.node(n),a=t.node(n);r&&(r.x=a.x,r.y=a.y,t.children(n).length&&(r.width=a.width,r.height=a.height))}),r.forEach(e.edges(),function(n){var a=e.edge(n),o=t.edge(n);a.points=o.points,r.has(o,"x")&&(a.x=o.x,a.y=o.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}(e,t)})})};var w=["nodesep","edgesep","ranksep","marginx","marginy"],y={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},b=["acyclicer","ranker","rankdir","align"],v=["width","height"],x={width:0,height:0},_=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},N=["labelpos"];function M(e,t){return r.mapValues(r.pick(e,t),Number)}function I(e){var t={};return r.forEach(e,function(e,n){t[n.toLowerCase()]=e}),t}},6857(e,t,n){var r;try{r={cloneDeep:n(8055),constant:n(7334),defaults:n(4684),each:n(6135),filter:n(7612),find:n(7309),flatten:n(5970),forEach:n(7373),forIn:n(2420),has:n(1448),isUndefined:n(2216),last:n(8090),map:n(5378),mapValues:n(3916),max:n(4506),merge:n(5364),min:n(1684),minBy:n(6533),now:n(124),pick:n(4383),range:n(3181),reduce:n(860),sortBy:n(3031),uniqueId:n(7200),values:n(5880),zipObject:n(7248)}}catch(e){}r||(r=window._),e.exports=r},6353(e,t,n){var r=n(6857),a=n(3988);function o(e,t,n,i,s,l,c){var u=e.children(c);if(u.length){var d=a.addBorderNode(e,"_bt"),f=a.addBorderNode(e,"_bb"),m=e.node(c);e.setParent(d,c),m.borderTop=d,e.setParent(f,c),m.borderBottom=f,r.forEach(u,function(r){o(e,t,n,i,s,l,r);var a=e.node(r),u=a.borderTop?a.borderTop:r,m=a.borderBottom?a.borderBottom:r,p=a.borderTop?i:2*i,h=u!==m?1:s-l[c]+1;e.setEdge(d,u,{weight:p,minlen:h,nestingEdge:!0}),e.setEdge(m,f,{weight:p,minlen:h,nestingEdge:!0})}),e.parent(c)||e.setEdge(t,d,{weight:0,minlen:s+l[c]})}else c!==t&&e.setEdge(t,c,{weight:0,minlen:n})}e.exports={run:function(e){var t=a.addDummyNode(e,"root",{},"_root"),n=function(e){var t={};function n(a,o){var i=e.children(a);i&&i.length&&r.forEach(i,function(e){n(e,o+1)}),t[a]=o}return r.forEach(e.children(),function(e){n(e,1)}),t}(e),i=r.max(r.values(n))-1,s=2*i+1;e.graph().nestingRoot=t,r.forEach(e.edges(),function(t){e.edge(t).minlen*=s});var l=function(e){return r.reduce(e.edges(),function(t,n){return t+e.edge(n).weight},0)}(e)+1;r.forEach(e.children(),function(r){o(e,t,s,l,i,n,r)}),e.graph().nodeRankFactor=s},cleanup:function(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,r.forEach(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}}},8209(e,t,n){"use strict";var r=n(6857),a=n(3988);e.exports={run:function(e){e.graph().dummyChains=[],r.forEach(e.edges(),function(t){!function(e,t){var n,r,o,i=t.v,s=e.node(i).rank,l=t.w,c=e.node(l).rank,u=t.name,d=e.edge(t),f=d.labelRank;if(c!==s+1){for(e.removeEdge(t),o=0,++s;s<c;++o,++s)d.points=[],r={width:0,height:0,edgeLabel:d,edgeObj:t,rank:s},n=a.addDummyNode(e,"edge",r,"_d"),s===f&&(r.width=d.width,r.height=d.height,r.dummy="edge-label",r.labelpos=d.labelpos),e.setEdge(i,n,{weight:d.weight},u),0===o&&e.graph().dummyChains.push(n),i=n;e.setEdge(i,l,{weight:d.weight},u)}}(e,t)})},undo:function(e){r.forEach(e.graph().dummyChains,function(t){var n,r=e.node(t),a=r.edgeLabel;for(e.setEdge(r.edgeObj,a);r.dummy;)n=e.successors(t)[0],e.removeNode(t),a.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(a.x=r.x,a.y=r.y,a.width=r.width,a.height=r.height),t=n,r=e.node(t)})}}},4384(e,t,n){var r=n(6857);e.exports=function(e,t,n){var a,o={};r.forEach(n,function(n){for(var r,i,s=e.parent(n);s;){if((r=e.parent(s))?(i=o[r],o[r]=s):(i=a,a=s),i&&i!==s)return void t.setEdge(i,s);s=r}})}},3860(e,t,n){var r=n(6857);e.exports=function(e,t){return r.map(t,function(t){var n=e.inEdges(t);if(n.length){var a=r.reduce(n,function(t,n){var r=e.edge(n),a=e.node(n.v);return{sum:t.sum+r.weight*a.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:a.sum/a.weight,weight:a.weight}}return{v:t}})}},7860(e,t,n){var r=n(6857),a=n(8191).Graph;e.exports=function(e,t,n){var o=function(e){for(var t;e.hasNode(t=r.uniqueId("_root")););return t}(e),i=new a({compound:!0}).setGraph({root:o}).setDefaultNodeLabel(function(t){return e.node(t)});return r.forEach(e.nodes(),function(a){var s=e.node(a),l=e.parent(a);(s.rank===t||s.minRank<=t&&t<=s.maxRank)&&(i.setNode(a),i.setParent(a,l||o),r.forEach(e[n](a),function(t){var n=t.v===a?t.w:t.v,o=i.edge(n,a),s=r.isUndefined(o)?0:o.weight;i.setEdge(n,a,{weight:e.edge(t).weight+s})}),r.has(s,"minRank")&&i.setNode(a,{borderLeft:s.borderLeft[t],borderRight:s.borderRight[t]}))}),i}},6639(e,t,n){"use strict";var r=n(6857);function a(e,t,n){for(var a=r.zipObject(n,r.map(n,function(e,t){return t})),o=r.flatten(r.map(t,function(t){return r.sortBy(r.map(e.outEdges(t),function(t){return{pos:a[t.w],weight:e.edge(t).weight}}),"pos")}),!0),i=1;i<n.length;)i<<=1;var s=2*i-1;i-=1;var l=r.map(new Array(s),function(){return 0}),c=0;return r.forEach(o.forEach(function(e){var t=e.pos+i;l[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=l[t+1]),l[t=t-1>>1]+=e.weight;c+=e.weight*n})),c}e.exports=function(e,t){for(var n=0,r=1;r<t.length;++r)n+=a(e,t[r-1],t[r]);return n}},1453(e,t,n){"use strict";var r=n(6857),a=n(8918),o=n(6639),i=n(4520),s=n(7860),l=n(4384),c=n(8191).Graph,u=n(3988);function d(e,t,n){return r.map(t,function(t){return s(e,t,n)})}function f(e,t){var n=new c;r.forEach(e,function(e){var a=e.graph().root,o=i(e,a,n,t);r.forEach(o.vs,function(t,n){e.node(t).order=n}),l(e,n,o.vs)})}function m(e,t){r.forEach(t,function(t){r.forEach(t,function(t,n){e.node(t).order=n})})}e.exports=function(e){var t=u.maxRank(e),n=d(e,r.range(1,t+1),"inEdges"),i=d(e,r.range(t-1,-1,-1),"outEdges"),s=a(e);m(e,s);for(var l,c=Number.POSITIVE_INFINITY,p=0,h=0;h<4;++p,++h){f(p%2?n:i,p%4>=2),s=u.buildLayerMatrix(e);var g=o(e,s);g<c&&(h=0,l=r.cloneDeep(s),c=g)}m(e,l)}},8918(e,t,n){"use strict";var r=n(6857);e.exports=function(e){var t={},n=r.filter(e.nodes(),function(t){return!e.children(t).length}),a=r.max(r.map(n,function(t){return e.node(t).rank})),o=r.map(r.range(a+1),function(){return[]}),i=r.sortBy(n,function(t){return e.node(t).rank});return r.forEach(i,function n(a){if(!r.has(t,a)){t[a]=!0;var i=e.node(a);o[i.rank].push(a),r.forEach(e.successors(a),n)}}),o}},4959(e,t,n){"use strict";var r=n(6857);e.exports=function(e,t){var n={};return r.forEach(e,function(e,t){var a=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};r.isUndefined(e.barycenter)||(a.barycenter=e.barycenter,a.weight=e.weight)}),r.forEach(t.edges(),function(e){var t=n[e.v],a=n[e.w];r.isUndefined(t)||r.isUndefined(a)||(a.indegree++,t.out.push(n[e.w]))}),function(e){var t=[];function n(e){return function(t){var n,a,o,i;t.merged||(r.isUndefined(t.barycenter)||r.isUndefined(e.barycenter)||t.barycenter>=e.barycenter)&&(a=t,o=0,i=0,(n=e).weight&&(o+=n.barycenter*n.weight,i+=n.weight),a.weight&&(o+=a.barycenter*a.weight,i+=a.weight),n.vs=a.vs.concat(n.vs),n.barycenter=o/i,n.weight=i,n.i=Math.min(a.i,n.i),a.merged=!0)}}function a(t){return function(n){n.in.push(t),0===--n.indegree&&e.push(n)}}for(;e.length;){var o=e.pop();t.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,a(o))}return r.map(r.filter(t,function(e){return!e.merged}),function(e){return r.pick(e,["vs","i","barycenter","weight"])})}(r.filter(n,function(e){return!e.indegree}))}},4520(e,t,n){var r=n(6857),a=n(3860),o=n(4959),i=n(5169);e.exports=function e(t,n,s,l){var c=t.children(n),u=t.node(n),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,m={};d&&(c=r.filter(c,function(e){return e!==d&&e!==f}));var p=a(t,c);r.forEach(p,function(n){if(t.children(n.v).length){var a=e(t,n.v,s,l);m[n.v]=a,r.has(a,"barycenter")&&(o=n,i=a,r.isUndefined(o.barycenter)?(o.barycenter=i.barycenter,o.weight=i.weight):(o.barycenter=(o.barycenter*o.weight+i.barycenter*i.weight)/(o.weight+i.weight),o.weight+=i.weight))}var o,i});var h=o(p,s);!function(e,t){r.forEach(e,function(e){e.vs=r.flatten(e.vs.map(function(e){return t[e]?t[e].vs:e}),!0)})}(h,m);var g=i(h,l);if(d&&(g.vs=r.flatten([d,g.vs,f],!0),t.predecessors(d).length)){var w=t.node(t.predecessors(d)[0]),y=t.node(t.predecessors(f)[0]);r.has(g,"barycenter")||(g.barycenter=0,g.weight=0),g.barycenter=(g.barycenter*g.weight+w.order+y.order)/(g.weight+2),g.weight+=2}return g}},5169(e,t,n){var r=n(6857),a=n(3988);function o(e,t,n){for(var a;t.length&&(a=r.last(t)).i<=n;)t.pop(),e.push(a.vs),n++;return n}e.exports=function(e,t){var n,i=a.partition(e,function(e){return r.has(e,"barycenter")}),s=i.lhs,l=r.sortBy(i.rhs,function(e){return-e.i}),c=[],u=0,d=0,f=0;s.sort((n=!!t,function(e,t){return e.barycenter<t.barycenter?-1:e.barycenter>t.barycenter?1:n?t.i-e.i:e.i-t.i})),f=o(c,l,f),r.forEach(s,function(e){f+=e.vs.length,c.push(e.vs),u+=e.barycenter*e.weight,d+=e.weight,f=o(c,l,f)});var m={vs:r.flatten(c,!0)};return d&&(m.barycenter=u/d,m.weight=d),m}},2948(e,t,n){var r=n(6857);e.exports=function(e){var t=function(e){var t={},n=0;return r.forEach(e.children(),function a(o){var i=n;r.forEach(e.children(o),a),t[o]={low:i,lim:n++}}),t}(e);r.forEach(e.graph().dummyChains,function(n){for(var r=e.node(n),a=r.edgeObj,o=function(e,t,n,r){var a,o,i=[],s=[],l=Math.min(t[n].low,t[r].low),c=Math.max(t[n].lim,t[r].lim);a=n;do{a=e.parent(a),i.push(a)}while(a&&(t[a].low>l||c>t[a].lim));for(o=a,a=r;(a=e.parent(a))!==o;)s.push(a);return{path:i.concat(s.reverse()),lca:o}}(e,t,a.v,a.w),i=o.path,s=o.lca,l=0,c=i[l],u=!0;n!==a.w;){if(r=e.node(n),u){for(;(c=i[l])!==s&&e.node(c).maxRank<r.rank;)l++;c===s&&(u=!1)}if(!u){for(;l<i.length-1&&e.node(c=i[l+1]).minRank<=r.rank;)l++;c=i[l]}e.setParent(n,c),n=e.successors(n)[0]}})}},9741(e,t,n){"use strict";var r=n(6857),a=n(8191).Graph,o=n(3988);function i(e,t){var n={};return r.reduce(t,function(t,a){var o=0,i=0,s=t.length,c=r.last(a);return r.forEach(a,function(t,u){var d=function(e,t){if(e.node(t).dummy)return r.find(e.predecessors(t),function(t){return e.node(t).dummy})}(e,t),f=d?e.node(d).order:s;(d||t===c)&&(r.forEach(a.slice(i,u+1),function(t){r.forEach(e.predecessors(t),function(r){var a=e.node(r),i=a.order;!(i<o||f<i)||a.dummy&&e.node(t).dummy||l(n,r,t)})}),i=u+1,o=f)}),a}),n}function s(e,t){var n={};function a(t,a,o,i,s){var c;r.forEach(r.range(a,o),function(a){c=t[a],e.node(c).dummy&&r.forEach(e.predecessors(c),function(t){var r=e.node(t);r.dummy&&(r.order<i||r.order>s)&&l(n,t,c)})})}return r.reduce(t,function(t,n){var o,i=-1,s=0;return r.forEach(n,function(r,l){if("border"===e.node(r).dummy){var c=e.predecessors(r);c.length&&(o=e.node(c[0]).order,a(n,s,l,i,o),s=l,i=o)}a(n,s,n.length,o,t.length)}),n}),n}function l(e,t,n){if(t>n){var r=t;t=n,n=r}var a=e[t];a||(e[t]=a={}),a[n]=!0}function c(e,t,n){if(t>n){var a=t;t=n,n=a}return r.has(e[t],n)}function u(e,t,n,a){var o={},i={},s={};return r.forEach(t,function(e){r.forEach(e,function(e,t){o[e]=e,i[e]=e,s[e]=t})}),r.forEach(t,function(e){var t=-1;r.forEach(e,function(e){var l=a(e);if(l.length){l=r.sortBy(l,function(e){return s[e]});for(var u=(l.length-1)/2,d=Math.floor(u),f=Math.ceil(u);d<=f;++d){var m=l[d];i[e]===e&&t<s[m]&&!c(n,e,m)&&(i[m]=e,i[e]=o[e]=o[m],t=s[m])}}})}),{root:o,align:i}}function d(e,t,n,o,i){var s={},l=function(e,t,n,o){var i=new a,s=e.graph(),l=function(e,t,n){return function(a,o,i){var s,l=a.node(o),c=a.node(i),u=0;if(u+=l.width/2,r.has(l,"labelpos"))switch(l.labelpos.toLowerCase()){case"l":s=-l.width/2;break;case"r":s=l.width/2}if(s&&(u+=n?s:-s),s=0,u+=(l.dummy?t:e)/2,u+=(c.dummy?t:e)/2,u+=c.width/2,r.has(c,"labelpos"))switch(c.labelpos.toLowerCase()){case"l":s=c.width/2;break;case"r":s=-c.width/2}return s&&(u+=n?s:-s),s=0,u}}(s.nodesep,s.edgesep,o);return r.forEach(t,function(t){var a;r.forEach(t,function(t){var r=n[t];if(i.setNode(r),a){var o=n[a],s=i.edge(o,r);i.setEdge(o,r,Math.max(l(e,t,a),s||0))}a=t})}),i}(e,t,n,i),c=i?"borderLeft":"borderRight";function u(e,t){for(var n=l.nodes(),r=n.pop(),a={};r;)a[r]?e(r):(a[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}return u(function(e){s[e]=l.inEdges(e).reduce(function(e,t){return Math.max(e,s[t.v]+l.edge(t))},0)},l.predecessors.bind(l)),u(function(t){var n=l.outEdges(t).reduce(function(e,t){return Math.min(e,s[t.w]-l.edge(t))},Number.POSITIVE_INFINITY),r=e.node(t);n!==Number.POSITIVE_INFINITY&&r.borderType!==c&&(s[t]=Math.max(s[t],n))},l.successors.bind(l)),r.forEach(o,function(e){s[e]=s[n[e]]}),s}function f(e,t){return r.minBy(r.values(t),function(t){var n=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return r.forIn(t,function(t,r){var o=function(e,t){return e.node(t).width}(e,r)/2;n=Math.max(t+o,n),a=Math.min(t-o,a)}),n-a})}function m(e,t){var n=r.values(t),a=r.min(n),o=r.max(n);r.forEach(["u","d"],function(n){r.forEach(["l","r"],function(i){var s,l=n+i,c=e[l];if(c!==t){var u=r.values(c);(s="l"===i?a-r.min(u):o-r.max(u))&&(e[l]=r.mapValues(c,function(e){return e+s}))}})})}function p(e,t){return r.mapValues(e.ul,function(n,a){if(t)return e[t.toLowerCase()][a];var o=r.sortBy(r.map(e,a));return(o[1]+o[2])/2})}e.exports={positionX:function(e){var t,n=o.buildLayerMatrix(e),a=r.merge(i(e,n),s(e,n)),l={};r.forEach(["u","d"],function(o){t="u"===o?n:r.values(n).reverse(),r.forEach(["l","r"],function(n){"r"===n&&(t=r.map(t,function(e){return r.values(e).reverse()}));var i=("u"===o?e.predecessors:e.successors).bind(e),s=u(0,t,a,i),c=d(e,t,s.root,s.align,"r"===n);"r"===n&&(c=r.mapValues(c,function(e){return-e})),l[o+n]=c})});var c=f(e,l);return m(l,c),p(l,e.graph().align)},findType1Conflicts:i,findType2Conflicts:s,addConflict:l,hasConflict:c,verticalAlignment:u,horizontalCompaction:d,alignCoordinates:m,findSmallestWidthAlignment:f,balance:p}},3776(e,t,n){"use strict";var r=n(6857),a=n(3988),o=n(9741).positionX;e.exports=function(e){(function(e){var t=a.buildLayerMatrix(e),n=e.graph().ranksep,o=0;r.forEach(t,function(t){var a=r.max(r.map(t,function(t){return e.node(t).height}));r.forEach(t,function(t){e.node(t).y=o+a/2}),o+=a+n})})(e=a.asNonCompoundGraph(e)),r.forEach(o(e),function(t,n){e.node(n).x=t})}},8481(e,t,n){"use strict";var r=n(6857),a=n(8191).Graph,o=n(8073).slack;function i(e,t){return r.forEach(e.nodes(),function n(a){r.forEach(t.nodeEdges(a),function(r){var i=r.v,s=a===i?r.w:i;e.hasNode(s)||o(t,r)||(e.setNode(s,{}),e.setEdge(a,s,{}),n(s))})}),e.nodeCount()}function s(e,t){return r.minBy(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return o(t,n)})}function l(e,t,n){r.forEach(e.nodes(),function(e){t.node(e).rank+=n})}e.exports=function(e){var t,n,r=new a({directed:!1}),c=e.nodes()[0],u=e.nodeCount();for(r.setNode(c,{});i(r,e)<u;)t=s(r,e),n=r.hasNode(t.v)?o(e,t):-o(e,t),l(r,e,n);return r}},9361(e,t,n){"use strict";var r=n(8073).longestPath,a=n(8481),o=n(6860);e.exports=function(e){switch(e.graph().ranker){case"network-simplex":default:!function(e){o(e)}(e);break;case"tight-tree":!function(e){r(e),a(e)}(e);break;case"longest-path":i(e)}};var i=r},6860(e,t,n){"use strict";var r=n(6857),a=n(8481),o=n(8073).slack,i=n(8073).longestPath,s=n(8191).alg.preorder,l=n(8191).alg.postorder,c=n(3988).simplify;function u(e){e=c(e),i(e);var t,n=a(e);for(m(n),d(n,e);t=h(n);)w(n,e,t,g(n,e,t))}function d(e,t){var n=l(e,e.nodes());n=n.slice(0,n.length-1),r.forEach(n,function(n){!function(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=f(e,t,n)}(e,t,n)})}function f(e,t,n){var a=e.node(n).parent,o=!0,i=t.edge(n,a),s=0;return i||(o=!1,i=t.edge(a,n)),s=i.weight,r.forEach(t.nodeEdges(n),function(r){var i,l,c=r.v===n,u=c?r.w:r.v;if(u!==a){var d=c===o,f=t.edge(r).weight;if(s+=d?f:-f,i=n,l=u,e.hasEdge(i,l)){var m=e.edge(n,u).cutvalue;s+=d?-m:m}}}),s}function m(e,t){arguments.length<2&&(t=e.nodes()[0]),p(e,{},1,t)}function p(e,t,n,a,o){var i=n,s=e.node(a);return t[a]=!0,r.forEach(e.neighbors(a),function(o){r.has(t,o)||(n=p(e,t,n,o,a))}),s.low=i,s.lim=n++,o?s.parent=o:delete s.parent,n}function h(e){return r.find(e.edges(),function(t){return e.edge(t).cutvalue<0})}function g(e,t,n){var a=n.v,i=n.w;t.hasEdge(a,i)||(a=n.w,i=n.v);var s=e.node(a),l=e.node(i),c=s,u=!1;s.lim>l.lim&&(c=l,u=!0);var d=r.filter(t.edges(),function(t){return u===y(0,e.node(t.v),c)&&u!==y(0,e.node(t.w),c)});return r.minBy(d,function(e){return o(t,e)})}function w(e,t,n,a){var o=n.v,i=n.w;e.removeEdge(o,i),e.setEdge(a.v,a.w,{}),m(e),d(e,t),function(e,t){var n=r.find(e.nodes(),function(e){return!t.node(e).parent}),a=s(e,n);a=a.slice(1),r.forEach(a,function(n){var r=e.node(n).parent,a=t.edge(n,r),o=!1;a||(a=t.edge(r,n),o=!0),t.node(n).rank=t.node(r).rank+(o?a.minlen:-a.minlen)})}(e,t)}function y(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}e.exports=u,u.initLowLimValues=m,u.initCutValues=d,u.calcCutValue=f,u.leaveEdge=h,u.enterEdge=g,u.exchangeEdges=w},8073(e,t,n){"use strict";var r=n(6857);e.exports={longestPath:function(e){var t={};r.forEach(e.sources(),function n(a){var o=e.node(a);if(r.has(t,a))return o.rank;t[a]=!0;var i=r.min(r.map(e.outEdges(a),function(t){return n(t.w)-e.edge(t).minlen}));return i!==Number.POSITIVE_INFINITY&&null!=i||(i=0),o.rank=i})},slack:function(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}}},3988(e,t,n){"use strict";var r=n(6857),a=n(8191).Graph;function o(e,t,n,a){var o;do{o=r.uniqueId(a)}while(e.hasNode(o));return n.dummy=t,e.setNode(o,n),o}function i(e){return r.max(r.map(e.nodes(),function(t){var n=e.node(t).rank;if(!r.isUndefined(n))return n}))}e.exports={addDummyNode:o,simplify:function(e){var t=(new a).setGraph(e.graph());return r.forEach(e.nodes(),function(n){t.setNode(n,e.node(n))}),r.forEach(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},a=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+a.weight,minlen:Math.max(r.minlen,a.minlen)})}),t},asNonCompoundGraph:function(e){var t=new a({multigraph:e.isMultigraph()}).setGraph(e.graph());return r.forEach(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),r.forEach(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t},successorWeights:function(e){var t=r.map(e.nodes(),function(t){var n={};return r.forEach(e.outEdges(t),function(t){n[t.w]=(n[t.w]||0)+e.edge(t).weight}),n});return r.zipObject(e.nodes(),t)},predecessorWeights:function(e){var t=r.map(e.nodes(),function(t){var n={};return r.forEach(e.inEdges(t),function(t){n[t.v]=(n[t.v]||0)+e.edge(t).weight}),n});return r.zipObject(e.nodes(),t)},intersectRect:function(e,t){var n,r,a=e.x,o=e.y,i=t.x-a,s=t.y-o,l=e.width/2,c=e.height/2;if(!i&&!s)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(s)*l>Math.abs(i)*c?(s<0&&(c=-c),n=c*i/s,r=c):(i<0&&(l=-l),n=l,r=l*s/i),{x:a+n,y:o+r}},buildLayerMatrix:function(e){var t=r.map(r.range(i(e)+1),function(){return[]});return r.forEach(e.nodes(),function(n){var a=e.node(n),o=a.rank;r.isUndefined(o)||(t[o][a.order]=n)}),t},normalizeRanks:function(e){var t=r.min(r.map(e.nodes(),function(t){return e.node(t).rank}));r.forEach(e.nodes(),function(n){var a=e.node(n);r.has(a,"rank")&&(a.rank-=t)})},removeEmptyRanks:function(e){var t=r.min(r.map(e.nodes(),function(t){return e.node(t).rank})),n=[];r.forEach(e.nodes(),function(r){var a=e.node(r).rank-t;n[a]||(n[a]=[]),n[a].push(r)});var a=0,o=e.graph().nodeRankFactor;r.forEach(n,function(t,n){r.isUndefined(t)&&n%o!==0?--a:a&&r.forEach(t,function(t){e.node(t).rank+=a})})},addBorderNode:function(e,t,n,r){var a={width:0,height:0};return arguments.length>=4&&(a.rank=n,a.order=r),o(e,"border",a,t)},maxRank:i,partition:function(e,t){var n={lhs:[],rhs:[]};return r.forEach(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n},time:function(e,t){var n=r.now();try{return t()}finally{console.log(e+" time: "+(r.now()-n)+"ms")}},notime:function(e,t){return t()}}},7038(e){e.exports="0.8.5"},8351(e,t,n){var r;!function(){"use strict";var a,o=1e9,i={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},s=!0,l="[DecimalError] ",c=l+"Invalid argument: ",u=l+"Exponent out of range: ",d=Math.floor,f=Math.pow,m=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,p=1e7,h=d(1286742750677284.5),g={};function w(e,t){var n,r,a,o,i,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),s?S(t,f):t;if(c=e.d,u=t.d,i=e.e,a=t.e,c=c.slice(),o=i-a){for(o<0?(r=c,o=-o,l=u.length):(r=u,a=i,l=c.length),o>(l=(i=Math.ceil(f/7))>l?i+1:l+1)&&(o=l,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for((l=c.length)-(o=u.length)<0&&(o=l,r=u,u=c,c=r),n=0;o;)n=(c[--o]=c[o]+u[o]+n)/p|0,c[o]%=p;for(n&&(c.unshift(n),++a),l=c.length;0==c[--l];)c.pop();return t.d=c,t.e=a,s?S(t,f):t}function y(e,t,n){if(e!==~~e||e<t||e>n)throw Error(c+e)}function b(e){var t,n,r,a=e.length-1,o="",i=e[0];if(a>0){for(o+=i,t=1;t<a;t++)(n=7-(r=e[t]+"").length)&&(o+=N(n)),o+=r;(n=7-(r=(i=e[t])+"").length)&&(o+=N(n))}else if(0===i)return"0";for(;i%10==0;)i/=10;return o+i}g.absoluteValue=g.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e},g.comparedTo=g.cmp=function(e){var t,n,r,a,o=this;if(e=new o.constructor(e),o.s!==e.s)return o.s||-e.s;if(o.e!==e.e)return o.e>e.e^o.s<0?1:-1;for(t=0,n=(r=o.d.length)<(a=e.d.length)?r:a;t<n;++t)if(o.d[t]!==e.d[t])return o.d[t]>e.d[t]^o.s<0?1:-1;return r===a?0:r>a^o.s<0?1:-1},g.decimalPlaces=g.dp=function(){var e=this,t=e.d.length-1,n=7*(t-e.e);if(t=e.d[t])for(;t%10==0;t/=10)n--;return n<0?0:n},g.dividedBy=g.div=function(e){return v(this,new this.constructor(e))},g.dividedToIntegerBy=g.idiv=function(e){var t=this.constructor;return S(v(this,new t(e),0,1),t.precision)},g.equals=g.eq=function(e){return!this.cmp(e)},g.exponent=function(){return _(this)},g.greaterThan=g.gt=function(e){return this.cmp(e)>0},g.greaterThanOrEqualTo=g.gte=function(e){return this.cmp(e)>=0},g.isInteger=g.isint=function(){return this.e>this.d.length-2},g.isNegative=g.isneg=function(){return this.s<0},g.isPositive=g.ispos=function(){return this.s>0},g.isZero=function(){return 0===this.s},g.lessThan=g.lt=function(e){return this.cmp(e)<0},g.lessThanOrEqualTo=g.lte=function(e){return this.cmp(e)<1},g.logarithm=g.log=function(e){var t,n=this,r=n.constructor,o=r.precision,i=o+5;if(void 0===e)e=new r(10);else if((e=new r(e)).s<1||e.eq(a))throw Error(l+"NaN");if(n.s<1)throw Error(l+(n.s?"NaN":"-Infinity"));return n.eq(a)?new r(0):(s=!1,t=v(M(n,i),M(e,i),i),s=!0,S(t,o))},g.minus=g.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?k(t,e):w(t,(e.s=-e.s,e))},g.modulo=g.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(!(e=new r(e)).s)throw Error(l+"NaN");return n.s?(s=!1,t=v(n,e,0,1).times(e),s=!0,n.minus(t)):S(new r(n),a)},g.naturalExponential=g.exp=function(){return x(this)},g.naturalLogarithm=g.ln=function(){return M(this)},g.negated=g.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e},g.plus=g.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?w(t,e):k(t,(e.s=-e.s,e))},g.precision=g.sd=function(e){var t,n,r,a=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(c+e);if(t=_(a)+1,n=7*(r=a.d.length-1)+1,r=a.d[r]){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n},g.squareRoot=g.sqrt=function(){var e,t,n,r,a,o,i,c=this,u=c.constructor;if(c.s<1){if(!c.s)return new u(0);throw Error(l+"NaN")}for(e=_(c),s=!1,0==(a=Math.sqrt(+c))||a==1/0?(((t=b(c.d)).length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=d((e+1)/2)-(e<0||e%2),r=new u(t=a==1/0?"5e"+e:(t=a.toExponential()).slice(0,t.indexOf("e")+1)+e)):r=new u(a.toString()),a=i=(n=u.precision)+3;;)if(r=(o=r).plus(v(c,o,i+2)).times(.5),b(o.d).slice(0,i)===(t=b(r.d)).slice(0,i)){if(t=t.slice(i-3,i+1),a==i&&"4999"==t){if(S(o,n+1,0),o.times(o).eq(c)){r=o;break}}else if("9999"!=t)break;i+=4}return s=!0,S(r,n)},g.times=g.mul=function(e){var t,n,r,a,o,i,l,c,u,d=this,f=d.constructor,m=d.d,h=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,(c=m.length)<(u=h.length)&&(o=m,m=h,h=o,i=c,c=u,u=i),o=[],r=i=c+u;r--;)o.push(0);for(r=u;--r>=0;){for(t=0,a=c+r;a>r;)l=o[a]+h[r]*m[a-r-1]+t,o[a--]=l%p|0,t=l/p|0;o[a]=(o[a]+t)%p|0}for(;!o[--i];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,s?S(e,f.precision):e},g.toDecimalPlaces=g.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),void 0===e?n:(y(e,0,o),void 0===t?t=r.rounding:y(t,0,8),S(n,e+_(n)+1,t))},g.toExponential=function(e,t){var n,r=this,a=r.constructor;return void 0===e?n=j(r,!0):(y(e,0,o),void 0===t?t=a.rounding:y(t,0,8),n=j(r=S(new a(r),e+1,t),!0,e+1)),n},g.toFixed=function(e,t){var n,r,a=this,i=a.constructor;return void 0===e?j(a):(y(e,0,o),void 0===t?t=i.rounding:y(t,0,8),n=j((r=S(new i(a),e+_(a)+1,t)).abs(),!1,e+_(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)},g.toInteger=g.toint=function(){var e=this,t=e.constructor;return S(new t(e),_(e)+1,t.rounding)},g.toNumber=function(){return+this},g.toPower=g.pow=function(e){var t,n,r,o,i,c,u=this,f=u.constructor,m=+(e=new f(e));if(!e.s)return new f(a);if(!(u=new f(u)).s){if(e.s<1)throw Error(l+"Infinity");return u}if(u.eq(a))return u;if(r=f.precision,e.eq(a))return S(u,r);if(c=(t=e.e)>=(n=e.d.length-1),i=u.s,c){if((n=m<0?-m:m)<=9007199254740991){for(o=new f(a),t=Math.ceil(r/7+4),s=!1;n%2&&D((o=o.times(u)).d,t),0!==(n=d(n/2));)D((u=u.times(u)).d,t);return s=!0,e.s<0?new f(a).div(o):S(o,r)}}else if(i<0)throw Error(l+"NaN");return i=i<0&&1&e.d[Math.max(t,n)]?-1:1,u.s=1,s=!1,o=e.times(M(u,r+12)),s=!0,(o=x(o)).s=i,o},g.toPrecision=function(e,t){var n,r,a=this,i=a.constructor;return void 0===e?r=j(a,(n=_(a))<=i.toExpNeg||n>=i.toExpPos):(y(e,1,o),void 0===t?t=i.rounding:y(t,0,8),r=j(a=S(new i(a),e,t),e<=(n=_(a))||n<=i.toExpNeg,e)),r},g.toSignificantDigits=g.tosd=function(e,t){var n=this.constructor;return void 0===e?(e=n.precision,t=n.rounding):(y(e,1,o),void 0===t?t=n.rounding:y(t,0,8)),S(new n(this),e,t)},g.toString=g.valueOf=g.val=g.toJSON=function(){var e=this,t=_(e),n=e.constructor;return j(e,t<=n.toExpNeg||t>=n.toExpPos)};var v=function(){function e(e,t){var n,r=0,a=e.length;for(e=e.slice();a--;)n=e[a]*t+r,e[a]=n%p|0,r=n/p|0;return r&&e.unshift(r),e}function t(e,t,n,r){var a,o;if(n!=r)o=n>r?1:-1;else for(a=o=0;a<n;a++)if(e[a]!=t[a]){o=e[a]>t[a]?1:-1;break}return o}function n(e,t,n){for(var r=0;n--;)e[n]-=r,r=e[n]<t[n]?1:0,e[n]=r*p+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,a,o,i){var s,c,u,d,f,m,h,g,w,y,b,v,x,E,N,M,I,k,j=r.constructor,D=r.s==a.s?1:-1,C=r.d,A=a.d;if(!r.s)return new j(r);if(!a.s)throw Error(l+"Division by zero");for(c=r.e-a.e,I=A.length,N=C.length,g=(h=new j(D)).d=[],u=0;A[u]==(C[u]||0);)++u;if(A[u]>(C[u]||0)&&--c,(v=null==o?o=j.precision:i?o+(_(r)-_(a))+1:o)<0)return new j(0);if(v=v/7+2|0,u=0,1==I)for(d=0,A=A[0],v++;(u<N||d)&&v--;u++)x=d*p+(C[u]||0),g[u]=x/A|0,d=x%A|0;else{for((d=p/(A[0]+1)|0)>1&&(A=e(A,d),C=e(C,d),I=A.length,N=C.length),E=I,y=(w=C.slice(0,I)).length;y<I;)w[y++]=0;(k=A.slice()).unshift(0),M=A[0],A[1]>=p/2&&++M;do{d=0,(s=t(A,w,I,y))<0?(b=w[0],I!=y&&(b=b*p+(w[1]||0)),(d=b/M|0)>1?(d>=p&&(d=p-1),1==(s=t(f=e(A,d),w,m=f.length,y=w.length))&&(d--,n(f,I<m?k:A,m))):(0==d&&(s=d=1),f=A.slice()),(m=f.length)<y&&f.unshift(0),n(w,f,y),-1==s&&(s=t(A,w,I,y=w.length))<1&&(d++,n(w,I<y?k:A,y)),y=w.length):0===s&&(d++,w=[0]),g[u++]=d,s&&w[0]?w[y++]=C[E]||0:(w=[C[E]],y=1)}while((E++<N||void 0!==w[0])&&v--)}return g[0]||g.shift(),h.e=c,S(h,i?o+_(h)+1:o)}}();function x(e,t){var n,r,o,i,l,c=0,d=0,m=e.constructor,p=m.precision;if(_(e)>16)throw Error(u+_(e));if(!e.s)return new m(a);for(null==t?(s=!1,l=p):l=t,i=new m(.03125);e.abs().gte(.1);)e=e.times(i),d+=5;for(l+=Math.log(f(2,d))/Math.LN10*2+5|0,n=r=o=new m(a),m.precision=l;;){if(r=S(r.times(e),l),n=n.times(++c),b((i=o.plus(v(r,n,l))).d).slice(0,l)===b(o.d).slice(0,l)){for(;d--;)o=S(o.times(o),l);return m.precision=p,null==t?(s=!0,S(o,p)):o}o=i}}function _(e){for(var t=7*e.e,n=e.d[0];n>=10;n/=10)t++;return t}function E(e,t,n){if(t>e.LN10.sd())throw s=!0,n&&(e.precision=n),Error(l+"LN10 precision limit exceeded");return S(new e(e.LN10),t)}function N(e){for(var t="";e--;)t+="0";return t}function M(e,t){var n,r,o,i,c,u,d,f,m,p=1,h=e,g=h.d,w=h.constructor,y=w.precision;if(h.s<1)throw Error(l+(h.s?"NaN":"-Infinity"));if(h.eq(a))return new w(0);if(null==t?(s=!1,f=y):f=t,h.eq(10))return null==t&&(s=!0),E(w,f);if(f+=10,w.precision=f,r=(n=b(g)).charAt(0),i=_(h),!(Math.abs(i)<15e14))return d=E(w,f+2,y).times(i+""),h=M(new w(r+"."+n.slice(1)),f-10).plus(d),w.precision=y,null==t?(s=!0,S(h,y)):h;for(;r<7&&1!=r||1==r&&n.charAt(1)>3;)r=(n=b((h=h.times(e)).d)).charAt(0),p++;for(i=_(h),r>1?(h=new w("0."+n),i++):h=new w(r+"."+n.slice(1)),u=c=h=v(h.minus(a),h.plus(a),f),m=S(h.times(h),f),o=3;;){if(c=S(c.times(m),f),b((d=u.plus(v(c,new w(o),f))).d).slice(0,f)===b(u.d).slice(0,f))return u=u.times(2),0!==i&&(u=u.plus(E(w,f+2,y).times(i+""))),u=v(u,new w(p),f),w.precision=y,null==t?(s=!0,S(u,y)):u;u=d,o+=2}}function I(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;48===t.charCodeAt(r);)++r;for(a=t.length;48===t.charCodeAt(a-1);)--a;if(t=t.slice(r,a)){if(a-=r,n=n-r-1,e.e=d(n/7),e.d=[],r=(n+1)%7,n<0&&(r+=7),r<a){for(r&&e.d.push(+t.slice(0,r)),a-=7;r<a;)e.d.push(+t.slice(r,r+=7));r=7-(t=t.slice(r)).length}else r-=a;for(;r--;)t+="0";if(e.d.push(+t),s&&(e.e>h||e.e<-h))throw Error(u+n)}else e.s=0,e.e=0,e.d=[0];return e}function S(e,t,n){var r,a,o,i,l,c,m,g,w=e.d;for(i=1,o=w[0];o>=10;o/=10)i++;if((r=t-i)<0)r+=7,a=t,m=w[g=0];else{if((g=Math.ceil((r+1)/7))>=(o=w.length))return e;for(m=o=w[g],i=1;o>=10;o/=10)i++;a=(r%=7)-7+i}if(void 0!==n&&(l=m/(o=f(10,i-a-1))%10|0,c=t<0||void 0!==w[g+1]||m%o,c=n<4?(l||c)&&(0==n||n==(e.s<0?3:2)):l>5||5==l&&(4==n||c||6==n&&(r>0?a>0?m/f(10,i-a):0:w[g-1])%10&1||n==(e.s<0?8:7))),t<1||!w[0])return c?(o=_(e),w.length=1,t=t-o-1,w[0]=f(10,(7-t%7)%7),e.e=d(-t/7)||0):(w.length=1,w[0]=e.e=e.s=0),e;if(0==r?(w.length=g,o=1,g--):(w.length=g+1,o=f(10,7-r),w[g]=a>0?(m/f(10,i-a)%f(10,a)|0)*o:0),c)for(;;){if(0==g){(w[0]+=o)==p&&(w[0]=1,++e.e);break}if(w[g]+=o,w[g]!=p)break;w[g--]=0,o=1}for(r=w.length;0===w[--r];)w.pop();if(s&&(e.e>h||e.e<-h))throw Error(u+_(e));return e}function k(e,t){var n,r,a,o,i,l,c,u,d,f,m=e.constructor,h=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),s?S(t,h):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),i=u-r){for((d=i<0)?(n=c,i=-i,l=f.length):(n=f,r=u,l=c.length),i>(a=Math.max(Math.ceil(h/7),l)+2)&&(i=a,n.length=1),n.reverse(),a=i;a--;)n.push(0);n.reverse()}else{for((d=(a=c.length)<(l=f.length))&&(l=a),a=0;a<l;a++)if(c[a]!=f[a]){d=c[a]<f[a];break}i=0}for(d&&(n=c,c=f,f=n,t.s=-t.s),l=c.length,a=f.length-l;a>0;--a)c[l++]=0;for(a=f.length;a>i;){if(c[--a]<f[a]){for(o=a;o&&0===c[--o];)c[o]=p-1;--c[o],c[a]+=p}c[a]-=f[a]}for(;0===c[--l];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(t.d=c,t.e=r,s?S(t,h):t):new m(0)}function j(e,t,n){var r,a=_(e),o=b(e.d),i=o.length;return t?(n&&(r=n-i)>0?o=o.charAt(0)+"."+o.slice(1)+N(r):i>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(a<0?"e":"e+")+a):a<0?(o="0."+N(-a-1)+o,n&&(r=n-i)>0&&(o+=N(r))):a>=i?(o+=N(a+1-i),n&&(r=n-a-1)>0&&(o=o+"."+N(r))):((r=a+1)<i&&(o=o.slice(0,r)+"."+o.slice(r)),n&&(r=n-i)>0&&(a+1===i&&(o+="."),o+=N(r))),e.s<0?"-"+o:o}function D(e,t){if(e.length>t)return e.length=t,!0}function C(e){if(!e||"object"!=typeof e)throw Error(l+"Object expected");var t,n,r,a=["precision",1,o,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(t=0;t<a.length;t+=3)if(void 0!==(r=e[n=a[t]])){if(!(d(r)===r&&r>=a[t+1]&&r<=a[t+2]))throw Error(c+n+": "+r);this[n]=r}if(void 0!==(r=e[n="LN10"])){if(r!=Math.LN10)throw Error(c+n+": "+r);this[n]=new this(r)}return this}(i=function e(t){var n,r,a;function o(e){var t=this;if(!(t instanceof o))return new o(e);if(t.constructor=o,e instanceof o)return t.s=e.s,t.e=e.e,void(t.d=(e=e.d)?e.slice():e);if("number"==typeof e){if(0*e!=0)throw Error(c+e);if(e>0)t.s=1;else{if(!(e<0))return t.s=0,t.e=0,void(t.d=[0]);e=-e,t.s=-1}return e===~~e&&e<1e7?(t.e=0,void(t.d=[e])):I(t,e.toString())}if("string"!=typeof e)throw Error(c+e);if(45===e.charCodeAt(0)?(e=e.slice(1),t.s=-1):t.s=1,!m.test(e))throw Error(c+e);I(t,e)}if(o.prototype=g,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.clone=e,o.config=o.set=C,void 0===t&&(t={}),t)for(a=["precision","rounding","toExpNeg","toExpPos","LN10"],n=0;n<a.length;)t.hasOwnProperty(r=a[n++])||(t[r]=this[r]);return o.config(t),o}(i)).default=i.Decimal=i,a=new i(1),void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)}()},5413(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Doctype=t.CDATA=t.Tag=t.Style=t.Script=t.Comment=t.Directive=t.Text=t.Root=t.isTag=t.ElementType=void 0,function(e){e.Root="root",e.Text="text",e.Directive="directive",e.Comment="comment",e.Script="script",e.Style="style",e.Tag="tag",e.CDATA="cdata",e.Doctype="doctype"}(n=t.ElementType||(t.ElementType={})),t.isTag=function(e){return e.type===n.Tag||e.type===n.Script||e.type===n.Style},t.Root=n.Root,t.Text=n.Text,t.Directive=n.Directive,t.Comment=n.Comment,t.Script=n.Script,t.Style=n.Style,t.Tag=n.Tag,t.CDATA=n.CDATA,t.Doctype=n.Doctype},1141(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var a=Object.getOwnPropertyDescriptor(t,n);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,a)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),a=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.DomHandler=void 0;var o=n(5413),i=n(6957);a(n(6957),t);var s={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},l=function(){function e(e,t,n){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,"function"==typeof t&&(n=t,t=s),"object"==typeof e&&(t=e,e=void 0),this.callback=null!=e?e:null,this.options=null!=t?t:s,this.elementCB=null!=n?n:null}return e.prototype.onparserinit=function(e){this.parser=e},e.prototype.onreset=function(){this.dom=[],this.root=new i.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},e.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},e.prototype.onerror=function(e){this.handleCallback(e)},e.prototype.onclosetag=function(){this.lastNode=null;var e=this.tagStack.pop();this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(e)},e.prototype.onopentag=function(e,t){var n=this.options.xmlMode?o.ElementType.Tag:void 0,r=new i.Element(e,t,void 0,n);this.addNode(r),this.tagStack.push(r)},e.prototype.ontext=function(e){var t=this.lastNode;if(t&&t.type===o.ElementType.Text)t.data+=e,this.options.withEndIndices&&(t.endIndex=this.parser.endIndex);else{var n=new i.Text(e);this.addNode(n),this.lastNode=n}},e.prototype.oncomment=function(e){if(this.lastNode&&this.lastNode.type===o.ElementType.Comment)this.lastNode.data+=e;else{var t=new i.Comment(e);this.addNode(t),this.lastNode=t}},e.prototype.oncommentend=function(){this.lastNode=null},e.prototype.oncdatastart=function(){var e=new i.Text(""),t=new i.CDATA([e]);this.addNode(t),e.parent=t,this.lastNode=e},e.prototype.oncdataend=function(){this.lastNode=null},e.prototype.onprocessinginstruction=function(e,t){var n=new i.ProcessingInstruction(e,t);this.addNode(n)},e.prototype.handleCallback=function(e){if("function"==typeof this.callback)this.callback(e,this.dom);else if(e)throw e},e.prototype.addNode=function(e){var t=this.tagStack[this.tagStack.length-1],n=t.children[t.children.length-1];this.options.withStartIndices&&(e.startIndex=this.parser.startIndex),this.options.withEndIndices&&(e.endIndex=this.parser.endIndex),t.children.push(e),n&&(e.prev=n,n.next=e),e.parent=t,this.lastNode=null},e}();t.DomHandler=l,t.default=l},6957(e,t,n){"use strict";var r,a=this&&this.__extends||(r=function(e,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},r(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),o=this&&this.__assign||function(){return o=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},o.apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.cloneNode=t.hasChildren=t.isDocument=t.isDirective=t.isComment=t.isText=t.isCDATA=t.isTag=t.Element=t.Document=t.CDATA=t.NodeWithChildren=t.ProcessingInstruction=t.Comment=t.Text=t.DataNode=t.Node=void 0;var i=n(5413),s=function(){function e(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(e.prototype,"parentNode",{get:function(){return this.parent},set:function(e){this.parent=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"previousSibling",{get:function(){return this.prev},set:function(e){this.prev=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextSibling",{get:function(){return this.next},set:function(e){this.next=e},enumerable:!1,configurable:!0}),e.prototype.cloneNode=function(e){return void 0===e&&(e=!1),_(this,e)},e}();t.Node=s;var l=function(e){function t(t){var n=e.call(this)||this;return n.data=t,n}return a(t,e),Object.defineProperty(t.prototype,"nodeValue",{get:function(){return this.data},set:function(e){this.data=e},enumerable:!1,configurable:!0}),t}(s);t.DataNode=l;var c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.ElementType.Text,t}return a(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),t}(l);t.Text=c;var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.ElementType.Comment,t}return a(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),t}(l);t.Comment=u;var d=function(e){function t(t,n){var r=e.call(this,n)||this;return r.name=t,r.type=i.ElementType.Directive,r}return a(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),t}(l);t.ProcessingInstruction=d;var f=function(e){function t(t){var n=e.call(this)||this;return n.children=t,n}return a(t,e),Object.defineProperty(t.prototype,"firstChild",{get:function(){var e;return null!==(e=this.children[0])&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"childNodes",{get:function(){return this.children},set:function(e){this.children=e},enumerable:!1,configurable:!0}),t}(s);t.NodeWithChildren=f;var m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.ElementType.CDATA,t}return a(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),t}(f);t.CDATA=m;var p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=i.ElementType.Root,t}return a(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),t}(f);t.Document=p;var h=function(e){function t(t,n,r,a){void 0===r&&(r=[]),void 0===a&&(a="script"===t?i.ElementType.Script:"style"===t?i.ElementType.Style:i.ElementType.Tag);var o=e.call(this,r)||this;return o.name=t,o.attribs=n,o.type=a,o}return a(t,e),Object.defineProperty(t.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagName",{get:function(){return this.name},set:function(e){this.name=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"attributes",{get:function(){var e=this;return Object.keys(this.attribs).map(function(t){var n,r;return{name:t,value:e.attribs[t],namespace:null===(n=e["x-attribsNamespace"])||void 0===n?void 0:n[t],prefix:null===(r=e["x-attribsPrefix"])||void 0===r?void 0:r[t]}})},enumerable:!1,configurable:!0}),t}(f);function g(e){return(0,i.isTag)(e)}function w(e){return e.type===i.ElementType.CDATA}function y(e){return e.type===i.ElementType.Text}function b(e){return e.type===i.ElementType.Comment}function v(e){return e.type===i.ElementType.Directive}function x(e){return e.type===i.ElementType.Root}function _(e,t){var n;if(void 0===t&&(t=!1),y(e))n=new c(e.data);else if(b(e))n=new u(e.data);else if(g(e)){var r=t?E(e.children):[],a=new h(e.name,o({},e.attribs),r);r.forEach(function(e){return e.parent=a}),null!=e.namespace&&(a.namespace=e.namespace),e["x-attribsNamespace"]&&(a["x-attribsNamespace"]=o({},e["x-attribsNamespace"])),e["x-attribsPrefix"]&&(a["x-attribsPrefix"]=o({},e["x-attribsPrefix"])),n=a}else if(w(e)){r=t?E(e.children):[];var i=new m(r);r.forEach(function(e){return e.parent=i}),n=i}else if(x(e)){r=t?E(e.children):[];var s=new p(r);r.forEach(function(e){return e.parent=s}),e["x-mode"]&&(s["x-mode"]=e["x-mode"]),n=s}else{if(!v(e))throw new Error("Not implemented yet: ".concat(e.type));var l=new d(e.name,e.data);null!=e["x-name"]&&(l["x-name"]=e["x-name"],l["x-publicId"]=e["x-publicId"],l["x-systemId"]=e["x-systemId"]),n=l}return n.startIndex=e.startIndex,n.endIndex=e.endIndex,null!=e.sourceCodeLocation&&(n.sourceCodeLocation=e.sourceCodeLocation),n}function E(e){for(var t=e.map(function(e){return _(e,!0)}),n=1;n<t.length;n++)t[n].prev=t[n-1],t[n-1].next=t[n];return t}t.Element=h,t.isTag=g,t.isCDATA=w,t.isText=y,t.isComment=b,t.isDirective=v,t.isDocument=x,t.hasChildren=function(e){return Object.prototype.hasOwnProperty.call(e,"children")},t.cloneNode=_},228(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,r,o,i){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,o||e,i),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function i(e,t){0===--e._eventsCount?e._events=new r:delete e._events[t]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var e,r,a=[];if(0===this._eventsCount)return a;for(r in e=this._events)t.call(e,r)&&a.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},s.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var a=0,o=r.length,i=new Array(o);a<o;a++)i[a]=r[a].fn;return i},s.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},s.prototype.emit=function(e,t,r,a,o,i){var s=n?n+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,r),!0;case 4:return u.fn.call(u.context,t,r,a),!0;case 5:return u.fn.call(u.context,t,r,a,o),!0;case 6:return u.fn.call(u.context,t,r,a,o,i),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var f,m=u.length;for(c=0;c<m;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,r);break;case 4:u[c].fn.call(u[c].context,t,r,a);break;default:if(!l)for(f=1,l=new Array(d-1);f<d;f++)l[f-1]=arguments[f];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},s.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},s.prototype.removeListener=function(e,t,r,a){var o=n?n+e:e;if(!this._events[o])return this;if(!t)return i(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||a&&!s.once||r&&s.context!==r||i(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||a&&!s[l].once||r&&s[l].context!==r)&&c.push(s[l]);c.length?this._events[o]=1===c.length?c[0]:c:i(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&i(this,t)):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,e.exports=s},8362(e,t,n){var r=n(1166);e.exports={Graph:r.Graph,json:n(7494),alg:n(1667),version:r.version}},3619(e,t,n){var r=n(117);e.exports=function(e){var t,n={},a=[];function o(a){r.has(n,a)||(n[a]=!0,t.push(a),r.each(e.successors(a),o),r.each(e.predecessors(a),o))}return r.each(e.nodes(),function(e){t=[],o(e),t.length&&a.push(t)}),a}},9276(e,t,n){var r=n(117);function a(e,t,n,o,i,s){r.has(o,t)||(o[t]=!0,n||s.push(t),r.each(i(t),function(t){a(e,t,n,o,i,s)}),n&&s.push(t))}e.exports=function(e,t,n){r.isArray(t)||(t=[t]);var o=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],s={};return r.each(t,function(t){if(!e.hasNode(t))throw new Error("Graph does not have node: "+t);a(e,t,"post"===n,s,o,i)}),i}},4919(e,t,n){var r=n(8905),a=n(117);e.exports=function(e,t,n){return a.transform(e.nodes(),function(a,o){a[o]=r(e,o,t,n)},{})}},8905(e,t,n){var r=n(117),a=n(1737);e.exports=function(e,t,n,r){return function(e,t,n,r){var o,i,s={},l=new a,c=function(e){var t=e.v!==o?e.v:e.w,r=s[t],a=n(e),c=i.distance+a;if(a<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+e+" Weight: "+a);c<r.distance&&(r.distance=c,r.predecessor=o,l.decrease(t,c))};for(e.nodes().forEach(function(e){var n=e===t?0:Number.POSITIVE_INFINITY;s[e]={distance:n},l.add(e,n)});l.size()>0&&(o=l.removeMin(),(i=s[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return s}(e,String(t),n||o,r||function(t){return e.outEdges(t)})};var o=r.constant(1)},6678(e,t,n){var r=n(117),a=n(6291);e.exports=function(e){return r.filter(a(e),function(t){return t.length>1||1===t.length&&e.hasEdge(t[0],t[0])})}},3590(e,t,n){var r=n(117);e.exports=function(e,t,n){return function(e,t,n){var r={},a=e.nodes();return a.forEach(function(e){r[e]={},r[e][e]={distance:0},a.forEach(function(t){e!==t&&(r[e][t]={distance:Number.POSITIVE_INFINITY})}),n(e).forEach(function(n){var a=n.v===e?n.w:n.v,o=t(n);r[e][a]={distance:o,predecessor:e}})}),a.forEach(function(e){var t=r[e];a.forEach(function(n){var o=r[n];a.forEach(function(n){var r=o[e],a=t[n],i=o[n],s=r.distance+a.distance;s<i.distance&&(i.distance=s,i.predecessor=a.predecessor)})})}),r}(e,t||a,n||function(t){return e.outEdges(t)})};var a=r.constant(1)},1667(e,t,n){e.exports={components:n(3619),dijkstra:n(8905),dijkstraAll:n(4919),findCycles:n(6678),floydWarshall:n(3590),isAcyclic:n(498),postorder:n(1045),preorder:n(6016),prim:n(4423),tarjan:n(6291),topsort:n(7507)}},498(e,t,n){var r=n(7507);e.exports=function(e){try{r(e)}catch(e){if(e instanceof r.CycleException)return!1;throw e}return!0}},1045(e,t,n){var r=n(9276);e.exports=function(e,t){return r(e,t,"post")}},6016(e,t,n){var r=n(9276);e.exports=function(e,t){return r(e,t,"pre")}},4423(e,t,n){var r=n(117),a=n(6454),o=n(1737);e.exports=function(e,t){var n,i=new a,s={},l=new o;function c(e){var r=e.v===n?e.w:e.v,a=l.priority(r);if(void 0!==a){var o=t(e);o<a&&(s[r]=n,l.decrease(r,o))}}if(0===e.nodeCount())return i;r.each(e.nodes(),function(e){l.add(e,Number.POSITIVE_INFINITY),i.setNode(e)}),l.decrease(e.nodes()[0],0);for(var u=!1;l.size()>0;){if(n=l.removeMin(),r.has(s,n))i.setEdge(n,s[n]);else{if(u)throw new Error("Input graph is not connected: "+e);u=!0}e.nodeEdges(n).forEach(c)}return i}},6291(e,t,n){var r=n(117);e.exports=function(e){var t=0,n=[],a={},o=[];function i(s){var l=a[s]={onStack:!0,lowlink:t,index:t++};if(n.push(s),e.successors(s).forEach(function(e){r.has(a,e)?a[e].onStack&&(l.lowlink=Math.min(l.lowlink,a[e].index)):(i(e),l.lowlink=Math.min(l.lowlink,a[e].lowlink))}),l.lowlink===l.index){var c,u=[];do{c=n.pop(),a[c].onStack=!1,u.push(c)}while(s!==c);o.push(u)}}return e.nodes().forEach(function(e){r.has(a,e)||i(e)}),o}},7507(e,t,n){var r=n(117);function a(e){var t={},n={},a=[];if(r.each(e.sinks(),function i(s){if(r.has(n,s))throw new o;r.has(t,s)||(n[s]=!0,t[s]=!0,r.each(e.predecessors(s),i),delete n[s],a.push(s))}),r.size(t)!==e.nodeCount())throw new o;return a}function o(){}e.exports=a,a.CycleException=o,o.prototype=new Error},1737(e,t,n){var r=n(117);function a(){this._arr=[],this._keyIndices={}}e.exports=a,a.prototype.size=function(){return this._arr.length},a.prototype.keys=function(){return this._arr.map(function(e){return e.key})},a.prototype.has=function(e){return r.has(this._keyIndices,e)},a.prototype.priority=function(e){var t=this._keyIndices[e];if(void 0!==t)return this._arr[t].priority},a.prototype.min=function(){if(0===this.size())throw new Error("Queue underflow");return this._arr[0].key},a.prototype.add=function(e,t){var n=this._keyIndices;if(e=String(e),!r.has(n,e)){var a=this._arr,o=a.length;return n[e]=o,a.push({key:e,priority:t}),this._decrease(o),!0}return!1},a.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},a.prototype.decrease=function(e,t){var n=this._keyIndices[e];if(t>this._arr[n].priority)throw new Error("New priority is greater than current priority. Key: "+e+" Old: "+this._arr[n].priority+" New: "+t);this._arr[n].priority=t,this._decrease(n)},a.prototype._heapify=function(e){var t=this._arr,n=2*e,r=n+1,a=e;n<t.length&&(a=t[n].priority<t[a].priority?n:a,r<t.length&&(a=t[r].priority<t[a].priority?r:a),a!==e&&(this._swap(e,a),this._heapify(a)))},a.prototype._decrease=function(e){for(var t,n=this._arr,r=n[e].priority;0!==e&&!(n[t=e>>1].priority<r);)this._swap(e,t),e=t},a.prototype._swap=function(e,t){var n=this._arr,r=this._keyIndices,a=n[e],o=n[t];n[e]=o,n[t]=a,r[o.key]=e,r[a.key]=t}},6454(e,t,n){"use strict";var r=n(117);e.exports=o;var a="\0";function o(e){this._isDirected=!r.has(e,"directed")||e.directed,this._isMultigraph=!!r.has(e,"multigraph")&&e.multigraph,this._isCompound=!!r.has(e,"compound")&&e.compound,this._label=void 0,this._defaultNodeLabelFn=r.constant(void 0),this._defaultEdgeLabelFn=r.constant(void 0),this._nodes={},this._isCompound&&(this._parent={},this._children={},this._children[a]={}),this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={}}function i(e,t){e[t]?e[t]++:e[t]=1}function s(e,t){--e[t]||delete e[t]}function l(e,t,n,a){var o=""+t,i=""+n;if(!e&&o>i){var s=o;o=i,i=s}return o+""+i+""+(r.isUndefined(a)?"\0":a)}function c(e,t){return l(e,t.v,t.w,t.name)}o.prototype._nodeCount=0,o.prototype._edgeCount=0,o.prototype.isDirected=function(){return this._isDirected},o.prototype.isMultigraph=function(){return this._isMultigraph},o.prototype.isCompound=function(){return this._isCompound},o.prototype.setGraph=function(e){return this._label=e,this},o.prototype.graph=function(){return this._label},o.prototype.setDefaultNodeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultNodeLabelFn=e,this},o.prototype.nodeCount=function(){return this._nodeCount},o.prototype.nodes=function(){return r.keys(this._nodes)},o.prototype.sources=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._in[t])})},o.prototype.sinks=function(){var e=this;return r.filter(this.nodes(),function(t){return r.isEmpty(e._out[t])})},o.prototype.setNodes=function(e,t){var n=arguments,a=this;return r.each(e,function(e){n.length>1?a.setNode(e,t):a.setNode(e)}),this},o.prototype.setNode=function(e,t){return r.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=a,this._children[e]={},this._children[a][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},o.prototype.node=function(e){return this._nodes[e]},o.prototype.hasNode=function(e){return r.has(this._nodes,e)},o.prototype.removeNode=function(e){var t=this;if(r.has(this._nodes,e)){var n=function(e){t.removeEdge(t._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],r.each(this.children(e),function(e){t.setParent(e)}),delete this._children[e]),r.each(r.keys(this._in[e]),n),delete this._in[e],delete this._preds[e],r.each(r.keys(this._out[e]),n),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},o.prototype.setParent=function(e,t){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(r.isUndefined(t))t=a;else{for(var n=t+="";!r.isUndefined(n);n=this.parent(n))if(n===e)throw new Error("Setting "+t+" as parent of "+e+" would create a cycle");this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this},o.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},o.prototype.parent=function(e){if(this._isCompound){var t=this._parent[e];if(t!==a)return t}},o.prototype.children=function(e){if(r.isUndefined(e)&&(e=a),this._isCompound){var t=this._children[e];if(t)return r.keys(t)}else{if(e===a)return this.nodes();if(this.hasNode(e))return[]}},o.prototype.predecessors=function(e){var t=this._preds[e];if(t)return r.keys(t)},o.prototype.successors=function(e){var t=this._sucs[e];if(t)return r.keys(t)},o.prototype.neighbors=function(e){var t=this.predecessors(e);if(t)return r.union(t,this.successors(e))},o.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},o.prototype.filterNodes=function(e){var t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph());var n=this;r.each(this._nodes,function(n,r){e(r)&&t.setNode(r,n)}),r.each(this._edgeObjs,function(e){t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,n.edge(e))});var a={};function o(e){var r=n.parent(e);return void 0===r||t.hasNode(r)?(a[e]=r,r):r in a?a[r]:o(r)}return this._isCompound&&r.each(t.nodes(),function(e){t.setParent(e,o(e))}),t},o.prototype.setDefaultEdgeLabel=function(e){return r.isFunction(e)||(e=r.constant(e)),this._defaultEdgeLabelFn=e,this},o.prototype.edgeCount=function(){return this._edgeCount},o.prototype.edges=function(){return r.values(this._edgeObjs)},o.prototype.setPath=function(e,t){var n=this,a=arguments;return r.reduce(e,function(e,r){return a.length>1?n.setEdge(e,r,t):n.setEdge(e,r),r}),this},o.prototype.setEdge=function(){var e,t,n,a,o=!1,s=arguments[0];"object"==typeof s&&null!==s&&"v"in s?(e=s.v,t=s.w,n=s.name,2===arguments.length&&(a=arguments[1],o=!0)):(e=s,t=arguments[1],n=arguments[3],arguments.length>2&&(a=arguments[2],o=!0)),e=""+e,t=""+t,r.isUndefined(n)||(n=""+n);var c=l(this._isDirected,e,t,n);if(r.has(this._edgeLabels,c))return o&&(this._edgeLabels[c]=a),this;if(!r.isUndefined(n)&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(e),this.setNode(t),this._edgeLabels[c]=o?a:this._defaultEdgeLabelFn(e,t,n);var u=function(e,t,n,r){var a=""+t,o=""+n;if(!e&&a>o){var i=a;a=o,o=i}var s={v:a,w:o};return r&&(s.name=r),s}(this._isDirected,e,t,n);return e=u.v,t=u.w,Object.freeze(u),this._edgeObjs[c]=u,i(this._preds[t],e),i(this._sucs[e],t),this._in[t][c]=u,this._out[e][c]=u,this._edgeCount++,this},o.prototype.edge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return this._edgeLabels[r]},o.prototype.hasEdge=function(e,t,n){var a=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n);return r.has(this._edgeLabels,a)},o.prototype.removeEdge=function(e,t,n){var r=1===arguments.length?c(this._isDirected,arguments[0]):l(this._isDirected,e,t,n),a=this._edgeObjs[r];return a&&(e=a.v,t=a.w,delete this._edgeLabels[r],delete this._edgeObjs[r],s(this._preds[t],e),s(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--),this},o.prototype.inEdges=function(e,t){var n=this._in[e];if(n){var a=r.values(n);return t?r.filter(a,function(e){return e.v===t}):a}},o.prototype.outEdges=function(e,t){var n=this._out[e];if(n){var a=r.values(n);return t?r.filter(a,function(e){return e.w===t}):a}},o.prototype.nodeEdges=function(e,t){var n=this.inEdges(e,t);if(n)return n.concat(this.outEdges(e,t))}},1166(e,t,n){e.exports={Graph:n(6454),version:n(4458)}},7494(e,t,n){var r=n(117),a=n(6454);function o(e){return r.map(e.nodes(),function(t){var n=e.node(t),a=e.parent(t),o={v:t};return r.isUndefined(n)||(o.value=n),r.isUndefined(a)||(o.parent=a),o})}function i(e){return r.map(e.edges(),function(t){var n=e.edge(t),a={v:t.v,w:t.w};return r.isUndefined(t.name)||(a.name=t.name),r.isUndefined(n)||(a.value=n),a})}e.exports={write:function(e){var t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:o(e),edges:i(e)};return r.isUndefined(e.graph())||(t.value=r.clone(e.graph())),t},read:function(e){var t=new a(e.options).setGraph(e.value);return r.each(e.nodes,function(e){t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),r.each(e.edges,function(e){t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}}},117(e,t,n){var r;try{r={clone:n(2629),constant:n(7334),each:n(6135),filter:n(7612),has:n(1448),isArray:n(6449),isEmpty:n(2193),isFunction:n(1882),isUndefined:n(2216),keys:n(5950),map:n(5378),reduce:n(860),size:n(7091),transform:n(9752),union:n(299),values:n(5880)}}catch(e){}r||(r=window._),e.exports=r},4458(e){e.exports="2.1.8"},4499(e,t,n){"use strict";n.r(t),n.d(t,{createBrowserHistory:()=>x,createHashHistory:()=>S,createLocation:()=>m,createMemoryHistory:()=>j,createPath:()=>f,locationsAreEqual:()=>p,parsePath:()=>d});var r=n(8168),a=n(4307),o=n(8783),i=n(1561);function s(e){return"/"===e.charAt(0)?e:"/"+e}function l(e){return"/"===e.charAt(0)?e.substr(1):e}function c(e,t){return function(e,t){return 0===e.toLowerCase().indexOf(t.toLowerCase())&&-1!=="/?#".indexOf(e.charAt(t.length))}(e,t)?e.substr(t.length):e}function u(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e}function d(e){var t=e||"/",n="",r="",a=t.indexOf("#");-1!==a&&(r=t.substr(a),t=t.substr(0,a));var o=t.indexOf("?");return-1!==o&&(n=t.substr(o),t=t.substr(0,o)),{pathname:t,search:"?"===n?"":n,hash:"#"===r?"":r}}function f(e){var t=e.pathname,n=e.search,r=e.hash,a=t||"/";return n&&"?"!==n&&(a+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(a+="#"===r.charAt(0)?r:"#"+r),a}function m(e,t,n,o){var i;"string"==typeof e?(i=d(e)).state=t:(void 0===(i=(0,r.A)({},e)).pathname&&(i.pathname=""),i.search?"?"!==i.search.charAt(0)&&(i.search="?"+i.search):i.search="",i.hash?"#"!==i.hash.charAt(0)&&(i.hash="#"+i.hash):i.hash="",void 0!==t&&void 0===i.state&&(i.state=t));try{i.pathname=decodeURI(i.pathname)}catch(e){throw e instanceof URIError?new URIError('Pathname "'+i.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):e}return n&&(i.key=n),o?i.pathname?"/"!==i.pathname.charAt(0)&&(i.pathname=(0,a.A)(i.pathname,o.pathname)):i.pathname=o.pathname:i.pathname||(i.pathname="/"),i}function p(e,t){return e.pathname===t.pathname&&e.search===t.search&&e.hash===t.hash&&e.key===t.key&&(0,o.A)(e.state,t.state)}function h(){var e=null,t=[];return{setPrompt:function(t){return e=t,function(){e===t&&(e=null)}},confirmTransitionTo:function(t,n,r,a){if(null!=e){var o="function"==typeof e?e(t,n):e;"string"==typeof o?"function"==typeof r?r(o,a):a(!0):a(!1!==o)}else a(!0)},appendListener:function(e){var n=!0;function r(){n&&e.apply(void 0,arguments)}return t.push(r),function(){n=!1,t=t.filter(function(e){return e!==r})}},notifyListeners:function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];t.forEach(function(e){return e.apply(void 0,n)})}}}var g=!("undefined"==typeof window||!window.document||!window.document.createElement);function w(e,t){t(window.confirm(e))}var y="popstate",b="hashchange";function v(){try{return window.history.state||{}}catch(e){return{}}}function x(e){void 0===e&&(e={}),g||(0,i.A)(!1);var t,n=window.history,a=(-1===(t=window.navigator.userAgent).indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history,o=!(-1===window.navigator.userAgent.indexOf("Trident")),l=e,d=l.forceRefresh,p=void 0!==d&&d,x=l.getUserConfirmation,_=void 0===x?w:x,E=l.keyLength,N=void 0===E?6:E,M=e.basename?u(s(e.basename)):"";function I(e){var t=e||{},n=t.key,r=t.state,a=window.location,o=a.pathname+a.search+a.hash;return M&&(o=c(o,M)),m(o,r,n)}function S(){return Math.random().toString(36).substr(2,N)}var k=h();function j(e){(0,r.A)(F,e),F.length=n.length,k.notifyListeners(F.location,F.action)}function D(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||T(I(e.state))}function C(){T(I(v()))}var A=!1;function T(e){A?(A=!1,j()):k.confirmTransitionTo(e,"POP",_,function(t){t?j({action:"POP",location:e}):function(e){var t=F.location,n=L.indexOf(t.key);-1===n&&(n=0);var r=L.indexOf(e.key);-1===r&&(r=0);var a=n-r;a&&(A=!0,P(a))}(e)})}var O=I(v()),L=[O.key];function z(e){return M+f(e)}function P(e){n.go(e)}var R=0;function U(e){1===(R+=e)&&1===e?(window.addEventListener(y,D),o&&window.addEventListener(b,C)):0===R&&(window.removeEventListener(y,D),o&&window.removeEventListener(b,C))}var B=!1,F={length:n.length,action:"POP",location:O,createHref:z,push:function(e,t){var r="PUSH",o=m(e,t,S(),F.location);k.confirmTransitionTo(o,r,_,function(e){if(e){var t=z(o),i=o.key,s=o.state;if(a)if(n.pushState({key:i,state:s},null,t),p)window.location.href=t;else{var l=L.indexOf(F.location.key),c=L.slice(0,l+1);c.push(o.key),L=c,j({action:r,location:o})}else window.location.href=t}})},replace:function(e,t){var r="REPLACE",o=m(e,t,S(),F.location);k.confirmTransitionTo(o,r,_,function(e){if(e){var t=z(o),i=o.key,s=o.state;if(a)if(n.replaceState({key:i,state:s},null,t),p)window.location.replace(t);else{var l=L.indexOf(F.location.key);-1!==l&&(L[l]=o.key),j({action:r,location:o})}else window.location.replace(t)}})},go:P,goBack:function(){P(-1)},goForward:function(){P(1)},block:function(e){void 0===e&&(e=!1);var t=k.setPrompt(e);return B||(U(1),B=!0),function(){return B&&(B=!1,U(-1)),t()}},listen:function(e){var t=k.appendListener(e);return U(1),function(){U(-1),t()}}};return F}var _="hashchange",E={hashbang:{encodePath:function(e){return"!"===e.charAt(0)?e:"!/"+l(e)},decodePath:function(e){return"!"===e.charAt(0)?e.substr(1):e}},noslash:{encodePath:l,decodePath:s},slash:{encodePath:s,decodePath:s}};function N(e){var t=e.indexOf("#");return-1===t?e:e.slice(0,t)}function M(){var e=window.location.href,t=e.indexOf("#");return-1===t?"":e.substring(t+1)}function I(e){window.location.replace(N(window.location.href)+"#"+e)}function S(e){void 0===e&&(e={}),g||(0,i.A)(!1);var t=window.history,n=(window.navigator.userAgent.indexOf("Firefox"),e),a=n.getUserConfirmation,o=void 0===a?w:a,l=n.hashType,d=void 0===l?"slash":l,p=e.basename?u(s(e.basename)):"",y=E[d],b=y.encodePath,v=y.decodePath;function x(){var e=v(M());return p&&(e=c(e,p)),m(e)}var S=h();function k(e){(0,r.A)(B,e),B.length=t.length,S.notifyListeners(B.location,B.action)}var j=!1,D=null;function C(){var e,t,n=M(),r=b(n);if(n!==r)I(r);else{var a=x(),i=B.location;if(!j&&(t=a,(e=i).pathname===t.pathname&&e.search===t.search&&e.hash===t.hash))return;if(D===f(a))return;D=null,function(e){if(j)j=!1,k();else{S.confirmTransitionTo(e,"POP",o,function(t){t?k({action:"POP",location:e}):function(e){var t=B.location,n=L.lastIndexOf(f(t));-1===n&&(n=0);var r=L.lastIndexOf(f(e));-1===r&&(r=0);var a=n-r;a&&(j=!0,z(a))}(e)})}}(a)}}var A=M(),T=b(A);A!==T&&I(T);var O=x(),L=[f(O)];function z(e){t.go(e)}var P=0;function R(e){1===(P+=e)&&1===e?window.addEventListener(_,C):0===P&&window.removeEventListener(_,C)}var U=!1,B={length:t.length,action:"POP",location:O,createHref:function(e){var t=document.querySelector("base"),n="";return t&&t.getAttribute("href")&&(n=N(window.location.href)),n+"#"+b(p+f(e))},push:function(e,t){var n="PUSH",r=m(e,void 0,void 0,B.location);S.confirmTransitionTo(r,n,o,function(e){if(e){var t=f(r),a=b(p+t);if(M()!==a){D=t,function(e){window.location.hash=e}(a);var o=L.lastIndexOf(f(B.location)),i=L.slice(0,o+1);i.push(t),L=i,k({action:n,location:r})}else k()}})},replace:function(e,t){var n="REPLACE",r=m(e,void 0,void 0,B.location);S.confirmTransitionTo(r,n,o,function(e){if(e){var t=f(r),a=b(p+t);M()!==a&&(D=t,I(a));var o=L.indexOf(f(B.location));-1!==o&&(L[o]=t),k({action:n,location:r})}})},go:z,goBack:function(){z(-1)},goForward:function(){z(1)},block:function(e){void 0===e&&(e=!1);var t=S.setPrompt(e);return U||(R(1),U=!0),function(){return U&&(U=!1,R(-1)),t()}},listen:function(e){var t=S.appendListener(e);return R(1),function(){R(-1),t()}}};return B}function k(e,t,n){return Math.min(Math.max(e,t),n)}function j(e){void 0===e&&(e={});var t=e,n=t.getUserConfirmation,a=t.initialEntries,o=void 0===a?["/"]:a,i=t.initialIndex,s=void 0===i?0:i,l=t.keyLength,c=void 0===l?6:l,u=h();function d(e){(0,r.A)(v,e),v.length=v.entries.length,u.notifyListeners(v.location,v.action)}function p(){return Math.random().toString(36).substr(2,c)}var g=k(s,0,o.length-1),w=o.map(function(e){return m(e,void 0,"string"==typeof e?p():e.key||p())}),y=f;function b(e){var t=k(v.index+e,0,v.entries.length-1),r=v.entries[t];u.confirmTransitionTo(r,"POP",n,function(e){e?d({action:"POP",location:r,index:t}):d()})}var v={length:w.length,action:"POP",location:w[g],index:g,entries:w,createHref:y,push:function(e,t){var r="PUSH",a=m(e,t,p(),v.location);u.confirmTransitionTo(a,r,n,function(e){if(e){var t=v.index+1,n=v.entries.slice(0);n.length>t?n.splice(t,n.length-t,a):n.push(a),d({action:r,location:a,index:t,entries:n})}})},replace:function(e,t){var r="REPLACE",a=m(e,t,p(),v.location);u.confirmTransitionTo(a,r,n,function(e){e&&(v.entries[v.index]=a,d({action:r,location:a}))})},go:b,goBack:function(){b(-1)},goForward:function(){b(1)},canGo:function(e){var t=v.index+e;return t>=0&&t<v.entries.length},block:function(e){return void 0===e&&(e=!1),u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return v}},4146(e,t,n){"use strict";var r=n(3404),a={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function l(e){return r.isMemo(e)?i:s[e.$$typeof]||a}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,m=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(p){var a=m(n);a&&a!==p&&e(t,a,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var s=l(t),h=l(n),g=0;g<i.length;++g){var w=i[g];if(!(o[w]||r&&r[w]||h&&h[w]||s&&s[w])){var y=f(n,w);try{c(t,w,y)}catch(e){}}}}return t}},3072(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,a=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,l=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,d=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,m=n?Symbol.for("react.suspense"):60113,p=n?Symbol.for("react.suspense_list"):60120,h=n?Symbol.for("react.memo"):60115,g=n?Symbol.for("react.lazy"):60116,w=n?Symbol.for("react.block"):60121,y=n?Symbol.for("react.fundamental"):60117,b=n?Symbol.for("react.responder"):60118,v=n?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case d:case o:case s:case i:case m:return e;default:switch(e=e&&e.$$typeof){case c:case f:case g:case h:case l:return e;default:return t}}case a:return t}}}function _(e){return x(e)===d}t.AsyncMode=u,t.ConcurrentMode=d,t.ContextConsumer=c,t.ContextProvider=l,t.Element=r,t.ForwardRef=f,t.Fragment=o,t.Lazy=g,t.Memo=h,t.Portal=a,t.Profiler=s,t.StrictMode=i,t.Suspense=m,t.isAsyncMode=function(e){return _(e)||x(e)===u},t.isConcurrentMode=_,t.isContextConsumer=function(e){return x(e)===c},t.isContextProvider=function(e){return x(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return x(e)===f},t.isFragment=function(e){return x(e)===o},t.isLazy=function(e){return x(e)===g},t.isMemo=function(e){return x(e)===h},t.isPortal=function(e){return x(e)===a},t.isProfiler=function(e){return x(e)===s},t.isStrictMode=function(e){return x(e)===i},t.isSuspense=function(e){return x(e)===m},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===d||e===s||e===i||e===m||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===h||e.$$typeof===l||e.$$typeof===c||e.$$typeof===f||e.$$typeof===y||e.$$typeof===b||e.$$typeof===v||e.$$typeof===w)},t.typeOf=x},3404(e,t,n){"use strict";e.exports=n(3072)},5270(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CARRIAGE_RETURN_PLACEHOLDER_REGEX=t.CARRIAGE_RETURN_PLACEHOLDER=t.CARRIAGE_RETURN_REGEX=t.CARRIAGE_RETURN=t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES=void 0,t.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"],t.CASE_SENSITIVE_TAG_NAMES_MAP=t.CASE_SENSITIVE_TAG_NAMES.reduce(function(e,t){return e[t.toLowerCase()]=t,e},{}),t.CARRIAGE_RETURN="\r",t.CARRIAGE_RETURN_REGEX=new RegExp(t.CARRIAGE_RETURN,"g"),t.CARRIAGE_RETURN_PLACEHOLDER="__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now().toString(),"__"),t.CARRIAGE_RETURN_PLACEHOLDER_REGEX=new RegExp(t.CARRIAGE_RETURN_PLACEHOLDER,"g")},5496(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t,n,u,d,f,p;e=(0,r.escapeSpecialCharacters)(e);var g=s.exec(e),w=null===(t=null==g?void 0:g[1])||void 0===t?void 0:t.toLowerCase();switch(w){case a:var y=c(e);return(0,r.hasOpenTag)(e,o)||null===(n=null==(v=y.querySelector(o))?void 0:v.parentNode)||void 0===n||n.removeChild(v),(0,r.hasOpenTag)(e,i)||null===(u=null==(v=y.querySelector(i))?void 0:v.parentNode)||void 0===u||u.removeChild(v),y.querySelectorAll(a);case o:case i:var b=l(e).querySelectorAll(w);return(0,r.hasOpenTag)(e,i)&&(0,r.hasOpenTag)(e,o)?null!==(f=null===(d=b[0].parentNode)||void 0===d?void 0:d.childNodes)&&void 0!==f?f:h():b;default:return m?m(e):null!==(p=null==(v=l(e,i).querySelector(i))?void 0:v.childNodes)&&void 0!==p?p:h();var v}};var r=n(7731),a="html",o="head",i="body",s=/<([a-zA-Z]+[0-9]?)/,l=function(e,t){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},c=function(e,t){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},u="object"==typeof window&&window.DOMParser;if("function"==typeof u){var d=new u;l=c=function(e,t){return t&&(e="<".concat(t,">").concat(e,"</").concat(t,">")),d.parseFromString(e,"text/html")}}if("object"==typeof document&&document.implementation){var f=document.implementation.createHTMLDocument();l=function(e,t){if(t){var n=f.documentElement.querySelector(t);return n&&(n.innerHTML=e),f}return f.documentElement.innerHTML=e,f}}var m,p="object"==typeof document&&document.createElement("template");p&&p.content&&(m=function(e){return p.innerHTML=e,p.content.childNodes});var h=function(){return document.createDocumentFragment().childNodes}},2471(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];var t=i.exec(e),n=t?t[1]:void 0;return(0,o.formatDOM)((0,a.default)(e),null,n)};var a=r(n(5496)),o=n(7731),i=/<(![a-zA-Z\s]+)>/},7731(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatAttributes=o,t.hasOpenTag=function(e,t){var n="<"+t,r=e.toLowerCase().indexOf(n);if(-1===r)return!1;var a=e[r+n.length];return">"===a||" "===a||"\t"===a||"\n"===a||"\r"===a||"/"===a},t.escapeSpecialCharacters=function(e){return e.replace(a.CARRIAGE_RETURN_REGEX,a.CARRIAGE_RETURN_PLACEHOLDER)},t.revertEscapedCharacters=s,t.formatDOM=function e(t,n,a){var l,c,u,d;void 0===n&&(n=null);for(var f,m=[],p=0,h=t.length;p<h;p++){var g=t[p];switch(g.nodeType){case 1:var w=i(g.nodeName);(f=new r.Element(w,o(g.attributes))).children=e("template"===w?g.content.childNodes:g.childNodes,f);break;case 3:f=new r.Text(s(null!==(l=g.nodeValue)&&void 0!==l?l:""));break;case 8:f=new r.Comment(null!==(c=g.nodeValue)&&void 0!==c?c:"");break;default:continue}var y=null!==(u=m[p-1])&&void 0!==u?u:null;y&&(y.next=f),f.parent=n,f.prev=y,f.next=null,m.push(f)}return a&&((f=new r.ProcessingInstruction(a.substring(0,a.indexOf(" ")).toLowerCase(),a)).next=null!==(d=m[0])&&void 0!==d?d:null,f.parent=n,m.unshift(f),m[1]&&(m[1].prev=m[0])),m};var r=n(1141),a=n(5270);function o(e){for(var t={},n=0,r=e.length;n<r;n++){var a=e[n];t[a.name]=a.value}return t}function i(e){return function(e){return a.CASE_SENSITIVE_TAG_NAMES_MAP[e]}(e=e.toLowerCase())||e}function s(e){return e.replace(a.CARRIAGE_RETURN_PLACEHOLDER_REGEX,a.CARRIAGE_RETURN)}},840(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){void 0===e&&(e={});var n={},c=Boolean(e.type&&s[e.type]);for(var u in e){var d=e[u];if((0,r.isCustomAttribute)(u))n[u]=d;else{var f=u.toLowerCase(),m=l(f);if(m){var p=(0,r.getPropertyInfo)(m);switch(o.includes(m)&&i.includes(t)&&!c&&(m=l("default"+f)),n[m]=d,null==p?void 0:p.type){case r.BOOLEAN:n[m]=!0;break;case r.OVERLOADED_BOOLEAN:""===d&&(n[m]=!0)}}else a.PRESERVE_CUSTOM_ATTRIBUTES&&(n[u]=d)}}return(0,a.setStyleProp)(e.style,n),n};var r=n(4210),a=n(4958),o=["checked","value"],i=["input","select","textarea"],s={reset:!0,submit:!0};function l(e){return r.possibleStandardNames[e]}},308(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function e(t,n){var r,a,c,u,d;void 0===n&&(n={});for(var f=[],m="function"==typeof n.replace,p=null!==(r=n.transform)&&void 0!==r?r:i.returnFirstArg,h=null!==(a=n.library)&&void 0!==a?a:s,g=h.cloneElement,w=h.createElement,y=h.isValidElement,b=t.length,v=0;v<b;v++){var x=t[v];if(m){var _=null===(c=n.replace)||void 0===c?void 0:c.call(n,x,v);if(y(_)){b>1&&(_=g(_,{key:null!==(u=_.key)&&void 0!==u?u:v})),f.push(p(_,x,v));continue}}if("text"!==x.type){var E=x,N={};l(E)?((0,i.setStyleProp)(E.attribs.style,E.attribs),N=E.attribs):E.attribs&&(N=(0,o.default)(E.attribs,E.name));var M=void 0;switch(x.type){case"script":case"style":x.children[0]&&(N.dangerouslySetInnerHTML={__html:x.children[0].data});break;case"tag":"textarea"===x.name&&x.children[0]?N.defaultValue=x.children[0].data:(null===(d=x.children)||void 0===d?void 0:d.length)&&(M=e(x.children,n));break;default:continue}b>1&&(N.key=v),f.push(p(w(x.name,N,M),x,v))}else{var I=!x.data.trim().length;if(I&&x.parent&&!(0,i.canTextBeChildOfNode)(x.parent))continue;if(n.trim&&I)continue;f.push(p(x.data,x,v))}}return 1===f.length?f[0]:f};var a=n(1609),o=r(n(840)),i=n(4958),s={cloneElement:a.cloneElement,createElement:a.createElement,isValidElement:a.isValidElement};function l(e){return i.PRESERVE_CUSTOM_ATTRIBUTES&&"tag"===e.type&&(0,i.isCustomComponent)(e.name,e.attribs)}},442(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.htmlToDOM=t.domToReact=t.attributesToProps=t.Text=t.ProcessingInstruction=t.Element=t.Comment=void 0,t.default=function(e,t){var n;if("string"!=typeof e)throw new TypeError("First argument must be a string");return e?(0,i.default)((0,a.default)(e,null!==(n=null==t?void 0:t.htmlparser2)&&void 0!==n?n:l),t):[]};var a=r(n(2471));t.htmlToDOM=a.default;var o=r(n(840));t.attributesToProps=o.default;var i=r(n(308));t.domToReact=i.default;var s=n(1141);Object.defineProperty(t,"Comment",{enumerable:!0,get:function(){return s.Comment}}),Object.defineProperty(t,"Element",{enumerable:!0,get:function(){return s.Element}}),Object.defineProperty(t,"ProcessingInstruction",{enumerable:!0,get:function(){return s.ProcessingInstruction}}),Object.defineProperty(t,"Text",{enumerable:!0,get:function(){return s.Text}});var l={lowerCaseAttributeNames:!1}},4958(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.returnFirstArg=t.canTextBeChildOfNode=t.ELEMENTS_WITH_NO_TEXT_CHILDREN=t.PRESERVE_CUSTOM_ATTRIBUTES=void 0,t.isCustomComponent=function(e,t){return e.includes("-")?!i.has(e):Boolean(t&&"string"==typeof t.is)},t.setStyleProp=function(e,t){if("string"==typeof e)if(e.trim())try{t.style=(0,o.default)(e,s)}catch(e){t.style={}}else t.style={}};var a=n(1609),o=r(n(5229)),i=new Set(["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"]),s={reactCompat:!0};t.PRESERVE_CUSTOM_ATTRIBUTES=Number(a.version.split(".")[0])>=16,t.ELEMENTS_WITH_NO_TEXT_CHILDREN=new Set(["tr","tbody","thead","tfoot","colgroup","table","head","html","frameset"]),t.canTextBeChildOfNode=function(e){return!t.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(e.name)},t.returnFirstArg=function(e){return e}},5077(e){"use strict";var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,l=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(l,c):c}e.exports=function(e,l){if("string"!=typeof e)throw new TypeError("First argument must be a string");if(!e)return[];l=l||{};var d=1,f=1;function m(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function p(){var e={line:d,column:f};return function(t){return t.position=new h(e),y(),t}}function h(e){this.start=e,this.end={line:d,column:f},this.source=l.source}function g(t){var n=new Error(l.source+":"+d+":"+f+": "+t);if(n.reason=t,n.filename=l.source,n.line=d,n.column=f,n.source=e,!l.silent)throw n}function w(t){var n=t.exec(e);if(n){var r=n[0];return m(r),e=e.slice(r.length),n}}function y(){w(r)}function b(e){var t;for(e=e||[];t=v();)!1!==t&&e.push(t);return e}function v(){var t=p();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return g("End of comment missing");var r=e.slice(2,n-2);return f+=2,m(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function x(){var e=p(),n=w(a);if(n){if(v(),!w(o))return g("property missing ':'");var r=w(i),l=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return w(s),l}}return h.prototype.content=e,y(),function(){var e,t=[];for(b(t);e=x();)!1!==e&&(t.push(e),b(t));return t}()}},5580(e,t,n){var r=n(6110)(n(9325),"DataView");e.exports=r},1549(e,t,n){var r=n(2032),a=n(3862),o=n(6721),i=n(2749),s=n(5749);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=a,l.prototype.get=o,l.prototype.has=i,l.prototype.set=s,e.exports=l},79(e,t,n){var r=n(3702),a=n(80),o=n(4739),i=n(8655),s=n(1175);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=a,l.prototype.get=o,l.prototype.has=i,l.prototype.set=s,e.exports=l},8223(e,t,n){var r=n(6110)(n(9325),"Map");e.exports=r},3661(e,t,n){var r=n(3040),a=n(7670),o=n(289),i=n(4509),s=n(2949);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}l.prototype.clear=r,l.prototype.delete=a,l.prototype.get=o,l.prototype.has=i,l.prototype.set=s,e.exports=l},2804(e,t,n){var r=n(6110)(n(9325),"Promise");e.exports=r},6545(e,t,n){var r=n(6110)(n(9325),"Set");e.exports=r},8859(e,t,n){var r=n(3661),a=n(1380),o=n(1459);function i(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new r;++t<n;)this.add(e[t])}i.prototype.add=i.prototype.push=a,i.prototype.has=o,e.exports=i},7217(e,t,n){var r=n(79),a=n(1420),o=n(938),i=n(3605),s=n(9817),l=n(945);function c(e){var t=this.__data__=new r(e);this.size=t.size}c.prototype.clear=a,c.prototype.delete=o,c.prototype.get=i,c.prototype.has=s,c.prototype.set=l,e.exports=c},1873(e,t,n){var r=n(9325).Symbol;e.exports=r},7828(e,t,n){var r=n(9325).Uint8Array;e.exports=r},8303(e,t,n){var r=n(6110)(n(9325),"WeakMap");e.exports=r},1033(e){e.exports=function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}},3729(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}},7277(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}},9770(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,a=0,o=[];++n<r;){var i=e[n];t(i,n,e)&&(o[a++]=i)}return o}},5325(e,t,n){var r=n(6131);e.exports=function(e,t){return!(null==e||!e.length)&&r(e,t,0)>-1}},9905(e){e.exports=function(e,t,n){for(var r=-1,a=null==e?0:e.length;++r<a;)if(n(t,e[r]))return!0;return!1}},695(e,t,n){var r=n(8096),a=n(2428),o=n(6449),i=n(3656),s=n(361),l=n(7167),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var n=o(e),u=!n&&a(e),d=!n&&!u&&i(e),f=!n&&!u&&!d&&l(e),m=n||u||d||f,p=m?r(e.length,String):[],h=p.length;for(var g in e)!t&&!c.call(e,g)||m&&("length"==g||d&&("offset"==g||"parent"==g)||f&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||s(g,h))||p.push(g);return p}},4932(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}},4528(e){e.exports=function(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}},882(e){e.exports=function(e,t,n,r){var a=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++a]);++a<o;)n=t(n,e[a],a,e);return n}},4248(e){e.exports=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}},9811(e,t,n){var r=n(7237)("length");e.exports=r},1074(e){e.exports=function(e){return e.split("")}},7805(e,t,n){var r=n(3360),a=n(5288);e.exports=function(e,t,n){(void 0!==n&&!a(e[t],n)||void 0===n&&!(t in e))&&r(e,t,n)}},6547(e,t,n){var r=n(3360),a=n(5288),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,n){var i=e[t];o.call(e,t)&&a(i,n)&&(void 0!==n||t in e)||r(e,t,n)}},6025(e,t,n){var r=n(5288);e.exports=function(e,t){for(var n=e.length;n--;)if(r(e[n][0],t))return n;return-1}},4733(e,t,n){var r=n(1791),a=n(5950);e.exports=function(e,t){return e&&r(t,a(t),e)}},3838(e,t,n){var r=n(1791),a=n(7241);e.exports=function(e,t){return e&&r(t,a(t),e)}},3360(e,t,n){var r=n(3243);e.exports=function(e,t,n){"__proto__"==t&&r?r(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}},9999(e,t,n){var r=n(7217),a=n(3729),o=n(6547),i=n(4733),s=n(3838),l=n(3290),c=n(3007),u=n(2271),d=n(8948),f=n(2),m=n(3349),p=n(5861),h=n(6189),g=n(7199),w=n(5529),y=n(6449),b=n(3656),v=n(7730),x=n(3805),_=n(8440),E=n(5950),N=n(7241),M="[object Arguments]",I="[object Function]",S="[object Object]",k={};k[M]=k["[object Array]"]=k["[object ArrayBuffer]"]=k["[object DataView]"]=k["[object Boolean]"]=k["[object Date]"]=k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Map]"]=k["[object Number]"]=k[S]=k["[object RegExp]"]=k["[object Set]"]=k["[object String]"]=k["[object Symbol]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k["[object Error]"]=k[I]=k["[object WeakMap]"]=!1,e.exports=function e(t,n,j,D,C,A){var T,O=1&n,L=2&n,z=4&n;if(j&&(T=C?j(t,D,C,A):j(t)),void 0!==T)return T;if(!x(t))return t;var P=y(t);if(P){if(T=h(t),!O)return c(t,T)}else{var R=p(t),U=R==I||"[object GeneratorFunction]"==R;if(b(t))return l(t,O);if(R==S||R==M||U&&!C){if(T=L||U?{}:w(t),!O)return L?d(t,s(T,t)):u(t,i(T,t))}else{if(!k[R])return C?t:{};T=g(t,R,O)}}A||(A=new r);var B=A.get(t);if(B)return B;A.set(t,T),_(t)?t.forEach(function(r){T.add(e(r,n,j,r,t,A))}):v(t)&&t.forEach(function(r,a){T.set(a,e(r,n,j,a,t,A))});var F=P?void 0:(z?L?m:f:L?N:E)(t);return a(F||t,function(r,a){F&&(r=t[a=r]),o(T,a,e(r,n,j,a,t,A))}),T}},9344(e,t,n){var r=n(3805),a=Object.create,o=function(){function e(){}return function(t){if(!r(t))return{};if(a)return a(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();e.exports=o},909(e,t,n){var r=n(641),a=n(8329)(r);e.exports=a},3777(e,t,n){var r=n(909);e.exports=function(e,t){var n=!0;return r(e,function(e,r,a){return n=!!t(e,r,a)}),n}},3599(e,t,n){var r=n(4394);e.exports=function(e,t,n){for(var a=-1,o=e.length;++a<o;){var i=e[a],s=t(i);if(null!=s&&(void 0===l?s==s&&!r(s):n(s,l)))var l=s,c=i}return c}},6574(e,t,n){var r=n(909);e.exports=function(e,t){var n=[];return r(e,function(e,r,a){t(e,r,a)&&n.push(e)}),n}},2523(e){e.exports=function(e,t,n,r){for(var a=e.length,o=n+(r?1:-1);r?o--:++o<a;)if(t(e[o],o,e))return o;return-1}},3120(e,t,n){var r=n(4528),a=n(5891);e.exports=function e(t,n,o,i,s){var l=-1,c=t.length;for(o||(o=a),s||(s=[]);++l<c;){var u=t[l];n>0&&o(u)?n>1?e(u,n-1,o,i,s):r(s,u):i||(s[s.length]=u)}return s}},6649(e,t,n){var r=n(3221)();e.exports=r},641(e,t,n){var r=n(6649),a=n(5950);e.exports=function(e,t){return e&&r(e,t,a)}},7422(e,t,n){var r=n(1769),a=n(7797);e.exports=function(e,t){for(var n=0,o=(t=r(t,e)).length;null!=e&&n<o;)e=e[a(t[n++])];return n&&n==o?e:void 0}},2199(e,t,n){var r=n(4528),a=n(6449);e.exports=function(e,t,n){var o=t(e);return a(e)?o:r(o,n(e))}},2552(e,t,n){var r=n(1873),a=n(659),o=n(9350),i=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":i&&i in Object(e)?a(e):o(e)}},3335(e){e.exports=function(e,t){return e>t}},426(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e,n){return null!=e&&t.call(e,n)}},8077(e){e.exports=function(e,t){return null!=e&&t in Object(e)}},6131(e,t,n){var r=n(2523),a=n(5463),o=n(6959);e.exports=function(e,t,n){return t==t?o(e,t,n):r(e,a,n)}},7534(e,t,n){var r=n(2552),a=n(346);e.exports=function(e){return a(e)&&"[object Arguments]"==r(e)}},270(e,t,n){var r=n(7068),a=n(346);e.exports=function e(t,n,o,i,s){return t===n||(null==t||null==n||!a(t)&&!a(n)?t!=t&&n!=n:r(t,n,o,i,e,s))}},7068(e,t,n){var r=n(7217),a=n(5911),o=n(1986),i=n(689),s=n(5861),l=n(6449),c=n(3656),u=n(7167),d="[object Arguments]",f="[object Array]",m="[object Object]",p=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,h,g,w){var y=l(e),b=l(t),v=y?f:s(e),x=b?f:s(t),_=(v=v==d?m:v)==m,E=(x=x==d?m:x)==m,N=v==x;if(N&&c(e)){if(!c(t))return!1;y=!0,_=!1}if(N&&!_)return w||(w=new r),y||u(e)?a(e,t,n,h,g,w):o(e,t,v,n,h,g,w);if(!(1&n)){var M=_&&p.call(e,"__wrapped__"),I=E&&p.call(t,"__wrapped__");if(M||I){var S=M?e.value():e,k=I?t.value():t;return w||(w=new r),g(S,k,n,h,w)}}return!!N&&(w||(w=new r),i(e,t,n,h,g,w))}},9172(e,t,n){var r=n(5861),a=n(346);e.exports=function(e){return a(e)&&"[object Map]"==r(e)}},1799(e,t,n){var r=n(7217),a=n(270);e.exports=function(e,t,n,o){var i=n.length,s=i,l=!o;if(null==e)return!s;for(e=Object(e);i--;){var c=n[i];if(l&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++i<s;){var u=(c=n[i])[0],d=e[u],f=c[1];if(l&&c[2]){if(void 0===d&&!(u in e))return!1}else{var m=new r;if(o)var p=o(d,f,u,e,t,m);if(!(void 0===p?a(f,d,3,o,m):p))return!1}}return!0}},5463(e){e.exports=function(e){return e!=e}},5083(e,t,n){var r=n(1882),a=n(7296),o=n(3805),i=n(7473),s=/^\[object .+?Constructor\]$/,l=Function.prototype,c=Object.prototype,u=l.toString,d=c.hasOwnProperty,f=RegExp("^"+u.call(d).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||a(e))&&(r(e)?f:s).test(i(e))}},6038(e,t,n){var r=n(5861),a=n(346);e.exports=function(e){return a(e)&&"[object Set]"==r(e)}},4901(e,t,n){var r=n(2552),a=n(294),o=n(346),i={};i["[object Float32Array]"]=i["[object Float64Array]"]=i["[object Int8Array]"]=i["[object Int16Array]"]=i["[object Int32Array]"]=i["[object Uint8Array]"]=i["[object Uint8ClampedArray]"]=i["[object Uint16Array]"]=i["[object Uint32Array]"]=!0,i["[object Arguments]"]=i["[object Array]"]=i["[object ArrayBuffer]"]=i["[object Boolean]"]=i["[object DataView]"]=i["[object Date]"]=i["[object Error]"]=i["[object Function]"]=i["[object Map]"]=i["[object Number]"]=i["[object Object]"]=i["[object RegExp]"]=i["[object Set]"]=i["[object String]"]=i["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&a(e.length)&&!!i[r(e)]}},5389(e,t,n){var r=n(3663),a=n(7978),o=n(3488),i=n(6449),s=n(583);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?i(e)?a(e[0],e[1]):r(e):s(e)}},8984(e,t,n){var r=n(5527),a=n(3650),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return a(e);var t=[];for(var n in Object(e))o.call(e,n)&&"constructor"!=n&&t.push(n);return t}},2903(e,t,n){var r=n(3805),a=n(5527),o=n(181),i=Object.prototype.hasOwnProperty;e.exports=function(e){if(!r(e))return o(e);var t=a(e),n=[];for(var s in e)("constructor"!=s||!t&&i.call(e,s))&&n.push(s);return n}},6176(e){e.exports=function(e,t){return e<t}},5128(e,t,n){var r=n(909),a=n(4894);e.exports=function(e,t){var n=-1,o=a(e)?Array(e.length):[];return r(e,function(e,r,a){o[++n]=t(e,r,a)}),o}},3663(e,t,n){var r=n(1799),a=n(776),o=n(7197);e.exports=function(e){var t=a(e);return 1==t.length&&t[0][2]?o(t[0][0],t[0][1]):function(n){return n===e||r(n,e,t)}}},7978(e,t,n){var r=n(270),a=n(8156),o=n(631),i=n(8586),s=n(756),l=n(7197),c=n(7797);e.exports=function(e,t){return i(e)&&s(t)?l(c(e),t):function(n){var i=a(n,e);return void 0===i&&i===t?o(n,e):r(t,i,3)}}},5250(e,t,n){var r=n(7217),a=n(7805),o=n(6649),i=n(2824),s=n(3805),l=n(7241),c=n(4974);e.exports=function e(t,n,u,d,f){t!==n&&o(n,function(o,l){if(f||(f=new r),s(o))i(t,n,l,u,e,d,f);else{var m=d?d(c(t,l),o,l+"",t,n,f):void 0;void 0===m&&(m=o),a(t,l,m)}},l)}},2824(e,t,n){var r=n(7805),a=n(3290),o=n(1961),i=n(3007),s=n(5529),l=n(2428),c=n(6449),u=n(3693),d=n(3656),f=n(1882),m=n(3805),p=n(1331),h=n(7167),g=n(4974),w=n(9884);e.exports=function(e,t,n,y,b,v,x){var _=g(e,n),E=g(t,n),N=x.get(E);if(N)r(e,n,N);else{var M=v?v(_,E,n+"",e,t,x):void 0,I=void 0===M;if(I){var S=c(E),k=!S&&d(E),j=!S&&!k&&h(E);M=E,S||k||j?c(_)?M=_:u(_)?M=i(_):k?(I=!1,M=a(E,!0)):j?(I=!1,M=o(E,!0)):M=[]:p(E)||l(E)?(M=_,l(_)?M=w(_):m(_)&&!f(_)||(M=s(E))):I=!1}I&&(x.set(E,M),b(M,E,y,v,x),x.delete(E)),r(e,n,M)}}},6155(e,t,n){var r=n(4932),a=n(7422),o=n(5389),i=n(5128),s=n(3937),l=n(7301),c=n(3714),u=n(3488),d=n(6449);e.exports=function(e,t,n){t=t.length?r(t,function(e){return d(e)?function(t){return a(t,1===e.length?e[0]:e)}:e}):[u];var f=-1;t=r(t,l(o));var m=i(e,function(e,n,a){return{criteria:r(t,function(t){return t(e)}),index:++f,value:e}});return s(m,function(e,t){return c(e,t,n)})}},6001(e,t,n){var r=n(7420),a=n(631);e.exports=function(e,t){return r(e,t,function(t,n){return a(e,n)})}},7420(e,t,n){var r=n(7422),a=n(3170),o=n(1769);e.exports=function(e,t,n){for(var i=-1,s=t.length,l={};++i<s;){var c=t[i],u=r(e,c);n(u,c)&&a(l,o(c,e),u)}return l}},7237(e){e.exports=function(e){return function(t){return null==t?void 0:t[e]}}},7255(e,t,n){var r=n(7422);e.exports=function(e){return function(t){return r(t,e)}}},6151(e){var t=Math.ceil,n=Math.max;e.exports=function(e,r,a,o){for(var i=-1,s=n(t((r-e)/(a||1)),0),l=Array(s);s--;)l[o?s:++i]=e,e+=a;return l}},5558(e){e.exports=function(e,t,n,r,a){return a(e,function(e,a,o){n=r?(r=!1,e):t(n,e,a,o)}),n}},9302(e,t,n){var r=n(3488),a=n(6757),o=n(2865);e.exports=function(e,t){return o(a(e,t,r),e+"")}},3170(e,t,n){var r=n(6547),a=n(1769),o=n(361),i=n(3805),s=n(7797);e.exports=function(e,t,n,l){if(!i(e))return e;for(var c=-1,u=(t=a(t,e)).length,d=u-1,f=e;null!=f&&++c<u;){var m=s(t[c]),p=n;if("__proto__"===m||"constructor"===m||"prototype"===m)return e;if(c!=d){var h=f[m];void 0===(p=l?l(h,m,f):void 0)&&(p=i(h)?h:o(t[c+1])?[]:{})}r(f,m,p),f=f[m]}return e}},9570(e,t,n){var r=n(7334),a=n(3243),o=n(3488),i=a?function(e,t){return a(e,"toString",{configurable:!0,enumerable:!1,value:r(t),writable:!0})}:o;e.exports=i},5160(e){e.exports=function(e,t,n){var r=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(n=n>a?a:n)<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(a);++r<a;)o[r]=e[r+t];return o}},916(e,t,n){var r=n(909);e.exports=function(e,t){var n;return r(e,function(e,r,a){return!(n=t(e,r,a))}),!!n}},3937(e){e.exports=function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}},8096(e){e.exports=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}},7556(e,t,n){var r=n(1873),a=n(4932),o=n(6449),i=n(4394),s=r?r.prototype:void 0,l=s?s.toString:void 0;e.exports=function e(t){if("string"==typeof t)return t;if(o(t))return a(t,e)+"";if(i(t))return l?l.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n}},4128(e,t,n){var r=n(1800),a=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(a,""):e}},7301(e){e.exports=function(e){return function(t){return e(t)}}},5765(e,t,n){var r=n(8859),a=n(5325),o=n(9905),i=n(9219),s=n(4517),l=n(4247);e.exports=function(e,t,n){var c=-1,u=a,d=e.length,f=!0,m=[],p=m;if(n)f=!1,u=o;else if(d>=200){var h=t?null:s(e);if(h)return l(h);f=!1,u=i,p=new r}else p=t?[]:m;e:for(;++c<d;){var g=e[c],w=t?t(g):g;if(g=n||0!==g?g:0,f&&w==w){for(var y=p.length;y--;)if(p[y]===w)continue e;t&&p.push(w),m.push(g)}else u(p,w,n)||(p!==m&&p.push(w),m.push(g))}return m}},514(e,t,n){var r=n(4932);e.exports=function(e,t){return r(t,function(t){return e[t]})}},1234(e){e.exports=function(e,t,n){for(var r=-1,a=e.length,o=t.length,i={};++r<a;){var s=r<o?t[r]:void 0;n(i,e[r],s)}return i}},9219(e){e.exports=function(e,t){return e.has(t)}},4066(e,t,n){var r=n(3488);e.exports=function(e){return"function"==typeof e?e:r}},1769(e,t,n){var r=n(6449),a=n(8586),o=n(1802),i=n(3222);e.exports=function(e,t){return r(e)?e:a(e,t)?[e]:o(i(e))}},8754(e,t,n){var r=n(5160);e.exports=function(e,t,n){var a=e.length;return n=void 0===n?a:n,!t&&n>=a?e:r(e,t,n)}},9653(e,t,n){var r=n(7828);e.exports=function(e){var t=new e.constructor(e.byteLength);return new r(t).set(new r(e)),t}},3290(e,t,n){e=n.nmd(e);var r=n(9325),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,i=o&&o.exports===a?r.Buffer:void 0,s=i?i.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var n=e.length,r=s?s(n):new e.constructor(n);return e.copy(r),r}},6169(e,t,n){var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}},3201(e){var t=/\w*$/;e.exports=function(e){var n=new e.constructor(e.source,t.exec(e));return n.lastIndex=e.lastIndex,n}},3736(e,t,n){var r=n(1873),a=r?r.prototype:void 0,o=a?a.valueOf:void 0;e.exports=function(e){return o?Object(o.call(e)):{}}},1961(e,t,n){var r=n(9653);e.exports=function(e,t){var n=t?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}},3730(e,t,n){var r=n(4394);e.exports=function(e,t){if(e!==t){var n=void 0!==e,a=null===e,o=e==e,i=r(e),s=void 0!==t,l=null===t,c=t==t,u=r(t);if(!l&&!u&&!i&&e>t||i&&s&&c&&!l&&!u||a&&s&&c||!n&&c||!o)return 1;if(!a&&!i&&!u&&e<t||u&&n&&o&&!a&&!i||l&&n&&o||!s&&o||!c)return-1}return 0}},3714(e,t,n){var r=n(3730);e.exports=function(e,t,n){for(var a=-1,o=e.criteria,i=t.criteria,s=o.length,l=n.length;++a<s;){var c=r(o[a],i[a]);if(c)return a>=l?c:c*("desc"==n[a]?-1:1)}return e.index-t.index}},3007(e){e.exports=function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}},1791(e,t,n){var r=n(6547),a=n(3360);e.exports=function(e,t,n,o){var i=!n;n||(n={});for(var s=-1,l=t.length;++s<l;){var c=t[s],u=o?o(n[c],e[c],c,n,e):void 0;void 0===u&&(u=e[c]),i?a(n,c,u):r(n,c,u)}return n}},2271(e,t,n){var r=n(1791),a=n(4664);e.exports=function(e,t){return r(e,a(e),t)}},8948(e,t,n){var r=n(1791),a=n(6375);e.exports=function(e,t){return r(e,a(e),t)}},5481(e,t,n){var r=n(9325)["__core-js_shared__"];e.exports=r},999(e,t,n){var r=n(9302),a=n(6800);e.exports=function(e){return r(function(t,n){var r=-1,o=n.length,i=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(i=e.length>3&&"function"==typeof i?(o--,i):void 0,s&&a(n[0],n[1],s)&&(i=o<3?void 0:i,o=1),t=Object(t);++r<o;){var l=n[r];l&&e(t,l,r,i)}return t})}},8329(e,t,n){var r=n(4894);e.exports=function(e,t){return function(n,a){if(null==n)return n;if(!r(n))return e(n,a);for(var o=n.length,i=t?o:-1,s=Object(n);(t?i--:++i<o)&&!1!==a(s[i],i,s););return n}}},3221(e){e.exports=function(e){return function(t,n,r){for(var a=-1,o=Object(t),i=r(t),s=i.length;s--;){var l=i[e?s:++a];if(!1===n(o[l],l,o))break}return t}}},2507(e,t,n){var r=n(8754),a=n(9698),o=n(3912),i=n(3222);e.exports=function(e){return function(t){t=i(t);var n=a(t)?o(t):void 0,s=n?n[0]:t.charAt(0),l=n?r(n,1).join(""):t.slice(1);return s[e]()+l}}},2006(e,t,n){var r=n(5389),a=n(4894),o=n(5950);e.exports=function(e){return function(t,n,i){var s=Object(t);if(!a(t)){var l=r(n,3);t=o(t),n=function(e){return l(s[e],e,s)}}var c=e(t,n,i);return c>-1?s[l?t[c]:c]:void 0}}},5508(e,t,n){var r=n(6151),a=n(6800),o=n(7400);e.exports=function(e){return function(t,n,i){return i&&"number"!=typeof i&&a(t,n,i)&&(n=i=void 0),t=o(t),void 0===n?(n=t,t=0):n=o(n),i=void 0===i?t<n?1:-1:o(i),r(t,n,i,e)}}},4517(e,t,n){var r=n(6545),a=n(3950),o=n(4247),i=r&&1/o(new r([,-0]))[1]==1/0?function(e){return new r(e)}:a;e.exports=i},3243(e,t,n){var r=n(6110),a=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=a},5911(e,t,n){var r=n(8859),a=n(4248),o=n(9219);e.exports=function(e,t,n,i,s,l){var c=1&n,u=e.length,d=t.length;if(u!=d&&!(c&&d>u))return!1;var f=l.get(e),m=l.get(t);if(f&&m)return f==t&&m==e;var p=-1,h=!0,g=2&n?new r:void 0;for(l.set(e,t),l.set(t,e);++p<u;){var w=e[p],y=t[p];if(i)var b=c?i(y,w,p,t,e,l):i(w,y,p,e,t,l);if(void 0!==b){if(b)continue;h=!1;break}if(g){if(!a(t,function(e,t){if(!o(g,t)&&(w===e||s(w,e,n,i,l)))return g.push(t)})){h=!1;break}}else if(w!==y&&!s(w,y,n,i,l)){h=!1;break}}return l.delete(e),l.delete(t),h}},1986(e,t,n){var r=n(1873),a=n(7828),o=n(5288),i=n(5911),s=n(317),l=n(4247),c=r?r.prototype:void 0,u=c?c.valueOf:void 0;e.exports=function(e,t,n,r,c,d,f){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!d(new a(e),new a(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return o(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var m=s;case"[object Set]":var p=1&r;if(m||(m=l),e.size!=t.size&&!p)return!1;var h=f.get(e);if(h)return h==t;r|=2,f.set(e,t);var g=i(m(e),m(t),r,c,d,f);return f.delete(e),g;case"[object Symbol]":if(u)return u.call(e)==u.call(t)}return!1}},689(e,t,n){var r=n(2),a=Object.prototype.hasOwnProperty;e.exports=function(e,t,n,o,i,s){var l=1&n,c=r(e),u=c.length;if(u!=r(t).length&&!l)return!1;for(var d=u;d--;){var f=c[d];if(!(l?f in t:a.call(t,f)))return!1}var m=s.get(e),p=s.get(t);if(m&&p)return m==t&&p==e;var h=!0;s.set(e,t),s.set(t,e);for(var g=l;++d<u;){var w=e[f=c[d]],y=t[f];if(o)var b=l?o(y,w,f,t,e,s):o(w,y,f,e,t,s);if(!(void 0===b?w===y||i(w,y,n,o,s):b)){h=!1;break}g||(g="constructor"==f)}if(h&&!g){var v=e.constructor,x=t.constructor;v==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof x&&x instanceof x||(h=!1)}return s.delete(e),s.delete(t),h}},8816(e,t,n){var r=n(5970),a=n(6757),o=n(2865);e.exports=function(e){return o(a(e,void 0,r),e+"")}},4840(e){var t="object"==typeof globalThis&&globalThis&&globalThis.Object===Object&&globalThis;e.exports=t},2(e,t,n){var r=n(2199),a=n(4664),o=n(5950);e.exports=function(e){return r(e,o,a)}},3349(e,t,n){var r=n(2199),a=n(6375),o=n(7241);e.exports=function(e){return r(e,o,a)}},2651(e,t,n){var r=n(4218);e.exports=function(e,t){var n=e.__data__;return r(t)?n["string"==typeof t?"string":"hash"]:n.map}},776(e,t,n){var r=n(756),a=n(5950);e.exports=function(e){for(var t=a(e),n=t.length;n--;){var o=t[n],i=e[o];t[n]=[o,i,r(i)]}return t}},6110(e,t,n){var r=n(5083),a=n(392);e.exports=function(e,t){var n=a(e,t);return r(n)?n:void 0}},8879(e,t,n){var r=n(4335)(Object.getPrototypeOf,Object);e.exports=r},659(e,t,n){var r=n(1873),a=Object.prototype,o=a.hasOwnProperty,i=a.toString,s=r?r.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),n=e[s];try{e[s]=void 0;var r=!0}catch(e){}var a=i.call(e);return r&&(t?e[s]=n:delete e[s]),a}},4664(e,t,n){var r=n(9770),a=n(3345),o=Object.prototype.propertyIsEnumerable,i=Object.getOwnPropertySymbols,s=i?function(e){return null==e?[]:(e=Object(e),r(i(e),function(t){return o.call(e,t)}))}:a;e.exports=s},6375(e,t,n){var r=n(4528),a=n(8879),o=n(4664),i=n(3345),s=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)r(t,o(e)),e=a(e);return t}:i;e.exports=s},5861(e,t,n){var r=n(5580),a=n(8223),o=n(2804),i=n(6545),s=n(8303),l=n(2552),c=n(7473),u="[object Map]",d="[object Promise]",f="[object Set]",m="[object WeakMap]",p="[object DataView]",h=c(r),g=c(a),w=c(o),y=c(i),b=c(s),v=l;(r&&v(new r(new ArrayBuffer(1)))!=p||a&&v(new a)!=u||o&&v(o.resolve())!=d||i&&v(new i)!=f||s&&v(new s)!=m)&&(v=function(e){var t=l(e),n="[object Object]"==t?e.constructor:void 0,r=n?c(n):"";if(r)switch(r){case h:return p;case g:return u;case w:return d;case y:return f;case b:return m}return t}),e.exports=v},392(e){e.exports=function(e,t){return null==e?void 0:e[t]}},9326(e,t,n){var r=n(1769),a=n(2428),o=n(6449),i=n(361),s=n(294),l=n(7797);e.exports=function(e,t,n){for(var c=-1,u=(t=r(t,e)).length,d=!1;++c<u;){var f=l(t[c]);if(!(d=null!=e&&n(e,f)))break;e=e[f]}return d||++c!=u?d:!!(u=null==e?0:e.length)&&s(u)&&i(f,u)&&(o(e)||a(e))}},9698(e){var t=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");e.exports=function(e){return t.test(e)}},2032(e,t,n){var r=n(1042);e.exports=function(){this.__data__=r?r(null):{},this.size=0}},3862(e){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},6721(e,t,n){var r=n(1042),a=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(r){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return a.call(t,e)?t[e]:void 0}},2749(e,t,n){var r=n(1042),a=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return r?void 0!==t[e]:a.call(t,e)}},5749(e,t,n){var r=n(1042);e.exports=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=r&&void 0===t?"__lodash_hash_undefined__":t,this}},6189(e){var t=Object.prototype.hasOwnProperty;e.exports=function(e){var n=e.length,r=new e.constructor(n);return n&&"string"==typeof e[0]&&t.call(e,"index")&&(r.index=e.index,r.input=e.input),r}},7199(e,t,n){var r=n(9653),a=n(6169),o=n(3201),i=n(3736),s=n(1961);e.exports=function(e,t,n){var l=e.constructor;switch(t){case"[object ArrayBuffer]":return r(e);case"[object Boolean]":case"[object Date]":return new l(+e);case"[object DataView]":return a(e,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return s(e,n);case"[object Map]":case"[object Set]":return new l;case"[object Number]":case"[object String]":return new l(e);case"[object RegExp]":return o(e);case"[object Symbol]":return i(e)}}},5529(e,t,n){var r=n(9344),a=n(8879),o=n(5527);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:r(a(e))}},5891(e,t,n){var r=n(1873),a=n(2428),o=n(6449),i=r?r.isConcatSpreadable:void 0;e.exports=function(e){return o(e)||a(e)||!!(i&&e&&e[i])}},361(e){var t=/^(?:0|[1-9]\d*)$/;e.exports=function(e,n){var r=typeof e;return!!(n=null==n?9007199254740991:n)&&("number"==r||"symbol"!=r&&t.test(e))&&e>-1&&e%1==0&&e<n}},6800(e,t,n){var r=n(5288),a=n(4894),o=n(361),i=n(3805);e.exports=function(e,t,n){if(!i(n))return!1;var s=typeof t;return!!("number"==s?a(n)&&o(t,n.length):"string"==s&&t in n)&&r(n[t],e)}},8586(e,t,n){var r=n(6449),a=n(4394),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=function(e,t){if(r(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!a(e))||i.test(e)||!o.test(e)||null!=t&&e in Object(t)}},4218(e){e.exports=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},7296(e,t,n){var r,a=n(5481),o=(r=/[^.]+$/.exec(a&&a.keys&&a.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";e.exports=function(e){return!!o&&o in e}},5527(e){var t=Object.prototype;e.exports=function(e){var n=e&&e.constructor;return e===("function"==typeof n&&n.prototype||t)}},756(e,t,n){var r=n(3805);e.exports=function(e){return e==e&&!r(e)}},3702(e){e.exports=function(){this.__data__=[],this.size=0}},80(e,t,n){var r=n(6025),a=Array.prototype.splice;e.exports=function(e){var t=this.__data__,n=r(t,e);return!(n<0||(n==t.length-1?t.pop():a.call(t,n,1),--this.size,0))}},4739(e,t,n){var r=n(6025);e.exports=function(e){var t=this.__data__,n=r(t,e);return n<0?void 0:t[n][1]}},8655(e,t,n){var r=n(6025);e.exports=function(e){return r(this.__data__,e)>-1}},1175(e,t,n){var r=n(6025);e.exports=function(e,t){var n=this.__data__,a=r(n,e);return a<0?(++this.size,n.push([e,t])):n[a][1]=t,this}},3040(e,t,n){var r=n(1549),a=n(79),o=n(8223);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||a),string:new r}}},7670(e,t,n){var r=n(2651);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},289(e,t,n){var r=n(2651);e.exports=function(e){return r(this,e).get(e)}},4509(e,t,n){var r=n(2651);e.exports=function(e){return r(this,e).has(e)}},2949(e,t,n){var r=n(2651);e.exports=function(e,t){var n=r(this,e),a=n.size;return n.set(e,t),this.size+=n.size==a?0:1,this}},317(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}},7197(e){e.exports=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}}},2224(e,t,n){var r=n(104);e.exports=function(e){var t=r(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}},1042(e,t,n){var r=n(6110)(Object,"create");e.exports=r},3650(e,t,n){var r=n(4335)(Object.keys,Object);e.exports=r},181(e){e.exports=function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}},6009(e,t,n){e=n.nmd(e);var r=n(4840),a=t&&!t.nodeType&&t,o=a&&e&&!e.nodeType&&e,i=o&&o.exports===a&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=s},9350(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},4335(e){e.exports=function(e,t){return function(n){return e(t(n))}}},6757(e,t,n){var r=n(1033),a=Math.max;e.exports=function(e,t,n){return t=a(void 0===t?e.length-1:t,0),function(){for(var o=arguments,i=-1,s=a(o.length-t,0),l=Array(s);++i<s;)l[i]=o[t+i];i=-1;for(var c=Array(t+1);++i<t;)c[i]=o[i];return c[t]=n(l),r(e,this,c)}}},9325(e,t,n){var r=n(4840),a="object"==typeof self&&self&&self.Object===Object&&self,o=r||a||Function("return this")();e.exports=o},4974(e){e.exports=function(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}},1380(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},1459(e){e.exports=function(e){return this.__data__.has(e)}},4247(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}},2865(e,t,n){var r=n(9570),a=n(1811)(r);e.exports=a},1811(e){var t=Date.now;e.exports=function(e){var n=0,r=0;return function(){var a=t(),o=16-(a-r);if(r=a,o>0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}},1420(e,t,n){var r=n(79);e.exports=function(){this.__data__=new r,this.size=0}},938(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},3605(e){e.exports=function(e){return this.__data__.get(e)}},9817(e){e.exports=function(e){return this.__data__.has(e)}},945(e,t,n){var r=n(79),a=n(8223),o=n(3661);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var i=n.__data__;if(!a||i.length<199)return i.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(i)}return n.set(e,t),this.size=n.size,this}},6959(e){e.exports=function(e,t,n){for(var r=n-1,a=e.length;++r<a;)if(e[r]===t)return r;return-1}},1993(e,t,n){var r=n(9811),a=n(9698),o=n(7927);e.exports=function(e){return a(e)?o(e):r(e)}},3912(e,t,n){var r=n(1074),a=n(9698),o=n(2054);e.exports=function(e){return a(e)?o(e):r(e)}},1802(e,t,n){var r=n(2224),a=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,o=/\\(\\)?/g,i=r(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(a,function(e,n,r,a){t.push(r?a.replace(o,"$1"):n||e)}),t});e.exports=i},7797(e,t,n){var r=n(4394);e.exports=function(e){if("string"==typeof e||r(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}},7473(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},1800(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},7927(e){var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",a="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+a+")?",c="[\\ufe0e\\ufe0f]?",u=c+l+"(?:\\u200d(?:"+[o,i,s].join("|")+")"+c+l+")*",d="(?:"+[o+r+"?",r,i,s,n].join("|")+")",f=RegExp(a+"(?="+a+")|"+d+u,"g");e.exports=function(e){for(var t=f.lastIndex=0;f.test(e);)++t;return t}},2054(e){var t="\\ud800-\\udfff",n="["+t+"]",r="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",a="\\ud83c[\\udffb-\\udfff]",o="[^"+t+"]",i="(?:\\ud83c[\\udde6-\\uddff]){2}",s="[\\ud800-\\udbff][\\udc00-\\udfff]",l="(?:"+r+"|"+a+")?",c="[\\ufe0e\\ufe0f]?",u=c+l+"(?:\\u200d(?:"+[o,i,s].join("|")+")"+c+l+")*",d="(?:"+[o+r+"?",r,i,s,n].join("|")+")",f=RegExp(a+"(?="+a+")|"+d+u,"g");e.exports=function(e){return e.match(f)||[]}},2629(e,t,n){var r=n(9999);e.exports=function(e){return r(e,4)}},8055(e,t,n){var r=n(9999);e.exports=function(e){return r(e,5)}},7334(e){e.exports=function(e){return function(){return e}}},8221(e,t,n){var r=n(3805),a=n(124),o=n(9374),i=Math.max,s=Math.min;e.exports=function(e,t,n){var l,c,u,d,f,m,p=0,h=!1,g=!1,w=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=l,r=c;return l=c=void 0,p=t,d=e.apply(r,n)}function b(e){var n=e-m;return void 0===m||n>=t||n<0||g&&e-p>=u}function v(){var e=a();if(b(e))return x(e);f=setTimeout(v,function(e){var n=t-(e-m);return g?s(n,u-(e-p)):n}(e))}function x(e){return f=void 0,w&&l?y(e):(l=c=void 0,d)}function _(){var e=a(),n=b(e);if(l=arguments,c=this,m=e,n){if(void 0===f)return function(e){return p=e,f=setTimeout(v,t),h?y(e):d}(m);if(g)return clearTimeout(f),f=setTimeout(v,t),y(m)}return void 0===f&&(f=setTimeout(v,t)),d}return t=o(t)||0,r(n)&&(h=!!n.leading,u=(g="maxWait"in n)?i(o(n.maxWait)||0,t):u,w="trailing"in n?!!n.trailing:w),_.cancel=function(){void 0!==f&&clearTimeout(f),p=0,l=m=c=f=void 0},_.flush=function(){return void 0===f?d:x(a())},_}},4684(e,t,n){var r=n(9302),a=n(5288),o=n(6800),i=n(7241),s=Object.prototype,l=s.hasOwnProperty,c=r(function(e,t){e=Object(e);var n=-1,r=t.length,c=r>2?t[2]:void 0;for(c&&o(t[0],t[1],c)&&(r=1);++n<r;)for(var u=t[n],d=i(u),f=-1,m=d.length;++f<m;){var p=d[f],h=e[p];(void 0===h||a(h,s[p])&&!l.call(e,p))&&(e[p]=u[p])}return e});e.exports=c},6135(e,t,n){e.exports=n(7373)},5288(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},9747(e,t,n){var r=n(7277),a=n(3777),o=n(5389),i=n(6449),s=n(6800);e.exports=function(e,t,n){var l=i(e)?r:a;return n&&s(e,t,n)&&(t=void 0),l(e,o(t,3))}},7612(e,t,n){var r=n(9770),a=n(6574),o=n(5389),i=n(6449);e.exports=function(e,t){return(i(e)?r:a)(e,o(t,3))}},7309(e,t,n){var r=n(2006)(n(4713));e.exports=r},4713(e,t,n){var r=n(2523),a=n(5389),o=n(1489),i=Math.max;e.exports=function(e,t,n){var s=null==e?0:e.length;if(!s)return-1;var l=null==n?0:o(n);return l<0&&(l=i(s+l,0)),r(e,a(t,3),l)}},7307(e,t,n){var r=n(3120),a=n(5378);e.exports=function(e,t){return r(a(e,t),1)}},5970(e,t,n){var r=n(3120);e.exports=function(e){return null!=e&&e.length?r(e,1):[]}},7373(e,t,n){var r=n(3729),a=n(909),o=n(4066),i=n(6449);e.exports=function(e,t){return(i(e)?r:a)(e,o(t))}},2420(e,t,n){var r=n(6649),a=n(4066),o=n(7241);e.exports=function(e,t){return null==e?e:r(e,a(t),o)}},8156(e,t,n){var r=n(7422);e.exports=function(e,t,n){var a=null==e?void 0:r(e,t);return void 0===a?n:a}},1448(e,t,n){var r=n(426),a=n(9326);e.exports=function(e,t){return null!=e&&a(e,t,r)}},631(e,t,n){var r=n(8077),a=n(9326);e.exports=function(e,t){return null!=e&&a(e,t,r)}},3488(e){e.exports=function(e){return e}},2428(e,t,n){var r=n(7534),a=n(346),o=Object.prototype,i=o.hasOwnProperty,s=o.propertyIsEnumerable,l=r(function(){return arguments}())?r:function(e){return a(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},6449(e){var t=Array.isArray;e.exports=t},4894(e,t,n){var r=n(1882),a=n(294);e.exports=function(e){return null!=e&&a(e.length)&&!r(e)}},3693(e,t,n){var r=n(4894),a=n(346);e.exports=function(e){return a(e)&&r(e)}},3812(e,t,n){var r=n(2552),a=n(346);e.exports=function(e){return!0===e||!1===e||a(e)&&"[object Boolean]"==r(e)}},3656(e,t,n){e=n.nmd(e);var r=n(9325),a=n(9935),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,s=i&&i.exports===o?r.Buffer:void 0,l=(s?s.isBuffer:void 0)||a;e.exports=l},2193(e,t,n){var r=n(8984),a=n(5861),o=n(2428),i=n(6449),s=n(4894),l=n(3656),c=n(5527),u=n(7167),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(s(e)&&(i(e)||"string"==typeof e||"function"==typeof e.splice||l(e)||u(e)||o(e)))return!e.length;var t=a(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(c(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},2404(e,t,n){var r=n(270);e.exports=function(e,t){return r(e,t)}},1882(e,t,n){var r=n(2552),a=n(3805);e.exports=function(e){if(!a(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},294(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},7730(e,t,n){var r=n(9172),a=n(7301),o=n(6009),i=o&&o.isMap,s=i?a(i):r;e.exports=s},1741(e,t,n){var r=n(8023);e.exports=function(e){return r(e)&&e!=+e}},9843(e){e.exports=function(e){return null==e}},8023(e,t,n){var r=n(2552),a=n(346);e.exports=function(e){return"number"==typeof e||a(e)&&"[object Number]"==r(e)}},3805(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},346(e){e.exports=function(e){return null!=e&&"object"==typeof e}},1331(e,t,n){var r=n(2552),a=n(8879),o=n(346),i=Function.prototype,s=Object.prototype,l=i.toString,c=s.hasOwnProperty,u=l.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=r(e))return!1;var t=a(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==u}},8440(e,t,n){var r=n(6038),a=n(7301),o=n(6009),i=o&&o.isSet,s=i?a(i):r;e.exports=s},5015(e,t,n){var r=n(2552),a=n(6449),o=n(346);e.exports=function(e){return"string"==typeof e||!a(e)&&o(e)&&"[object String]"==r(e)}},4394(e,t,n){var r=n(2552),a=n(346);e.exports=function(e){return"symbol"==typeof e||a(e)&&"[object Symbol]"==r(e)}},7167(e,t,n){var r=n(4901),a=n(7301),o=n(6009),i=o&&o.isTypedArray,s=i?a(i):r;e.exports=s},2216(e){e.exports=function(e){return void 0===e}},5950(e,t,n){var r=n(695),a=n(8984),o=n(4894);e.exports=function(e){return o(e)?r(e):a(e)}},7241(e,t,n){var r=n(695),a=n(2903),o=n(4894);e.exports=function(e){return o(e)?r(e,!0):a(e)}},8090(e){e.exports=function(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}},5378(e,t,n){var r=n(4932),a=n(5389),o=n(5128),i=n(6449);e.exports=function(e,t){return(i(e)?r:o)(e,a(t,3))}},3916(e,t,n){var r=n(3360),a=n(641),o=n(5389);e.exports=function(e,t){var n={};return t=o(t,3),a(e,function(e,a,o){r(n,a,t(e,a,o))}),n}},4506(e,t,n){var r=n(3599),a=n(3335),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,a):void 0}},104(e,t,n){var r=n(3661);function a(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var i=e.apply(this,r);return n.cache=o.set(a,i)||o,i};return n.cache=new(a.Cache||r),n}a.Cache=r,e.exports=a},5364(e,t,n){var r=n(5250),a=n(999)(function(e,t,n){r(e,t,n)});e.exports=a},1684(e,t,n){var r=n(3599),a=n(6176),o=n(3488);e.exports=function(e){return e&&e.length?r(e,o,a):void 0}},6533(e,t,n){var r=n(3599),a=n(5389),o=n(6176);e.exports=function(e,t){return e&&e.length?r(e,a(t,2),o):void 0}},3950(e){e.exports=function(){}},124(e,t,n){var r=n(9325);e.exports=function(){return r.Date.now()}},4383(e,t,n){var r=n(6001),a=n(8816)(function(e,t){return null==e?{}:r(e,t)});e.exports=a},583(e,t,n){var r=n(7237),a=n(7255),o=n(8586),i=n(7797);e.exports=function(e){return o(e)?r(i(e)):a(e)}},3181(e,t,n){var r=n(5508)();e.exports=r},860(e,t,n){var r=n(882),a=n(909),o=n(5389),i=n(5558),s=n(6449);e.exports=function(e,t,n){var l=s(e)?r:i,c=arguments.length<3;return l(e,o(t,4),n,c,a)}},7091(e,t,n){var r=n(8984),a=n(5861),o=n(4894),i=n(5015),s=n(1993);e.exports=function(e){if(null==e)return 0;if(o(e))return i(e)?s(e):e.length;var t=a(e);return"[object Map]"==t||"[object Set]"==t?e.size:r(e).length}},2426(e,t,n){var r=n(4248),a=n(5389),o=n(916),i=n(6449),s=n(6800);e.exports=function(e,t,n){var l=i(e)?r:o;return n&&s(e,t,n)&&(t=void 0),l(e,a(t,3))}},3031(e,t,n){var r=n(3120),a=n(6155),o=n(9302),i=n(6800),s=o(function(e,t){if(null==e)return[];var n=t.length;return n>1&&i(e,t[0],t[1])?t=[]:n>2&&i(t[0],t[1],t[2])&&(t=[t[0]]),a(e,r(t,1),[])});e.exports=s},3345(e){e.exports=function(){return[]}},9935(e){e.exports=function(){return!1}},7350(e,t,n){var r=n(8221),a=n(3805);e.exports=function(e,t,n){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return a(n)&&(o="leading"in n?!!n.leading:o,i="trailing"in n?!!n.trailing:i),r(e,t,{leading:o,maxWait:t,trailing:i})}},7400(e,t,n){var r=n(9374),a=1/0;e.exports=function(e){return e?(e=r(e))===a||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},1489(e,t,n){var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},9374(e,t,n){var r=n(4128),a=n(3805),o=n(4394),i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(a(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=a(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):i.test(e)?NaN:+e}},9884(e,t,n){var r=n(1791),a=n(7241);e.exports=function(e){return r(e,a(e))}},3222(e,t,n){var r=n(7556);e.exports=function(e){return null==e?"":r(e)}},9752(e,t,n){var r=n(3729),a=n(9344),o=n(641),i=n(5389),s=n(8879),l=n(6449),c=n(3656),u=n(1882),d=n(3805),f=n(7167);e.exports=function(e,t,n){var m=l(e),p=m||c(e)||f(e);if(t=i(t,4),null==n){var h=e&&e.constructor;n=p?m?new h:[]:d(e)&&u(h)?a(s(e)):{}}return(p?r:o)(e,function(e,r,a){return t(n,e,r,a)}),n}},299(e,t,n){var r=n(3120),a=n(9302),o=n(5765),i=n(3693),s=a(function(e){return o(r(e,1,i,!0))});e.exports=s},14(e,t,n){var r=n(5389),a=n(5765);e.exports=function(e,t){return e&&e.length?a(e,r(t,2)):[]}},7200(e,t,n){var r=n(3222),a=0;e.exports=function(e){var t=++a;return r(e)+t}},5808(e,t,n){var r=n(2507)("toUpperCase");e.exports=r},5880(e,t,n){var r=n(514),a=n(5950);e.exports=function(e){return null==e?[]:r(e,a(e))}},7248(e,t,n){var r=n(6547),a=n(1234);e.exports=function(e,t){return a(e||[],t||[],r)}},2694(e,t,n){"use strict";var r=n(6925);function a(){}function o(){}o.resetWarningCache=a,e.exports=function(){function e(e,t,n,a,o,i){if(i!==r){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:a};return n.PropTypes=n,n}},5556(e,t,n){e.exports=n(2694)()},6925(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},4496(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultArea=void 0,t.defaultArea="default-area"},4601(e,t,n){"use strict";Object.defineProperty(t,"$h",{enumerable:!0,get:function(){return r.trackPromise}}),Object.defineProperty(t,"H8",{enumerable:!0,get:function(){return a.usePromiseTracker}});var r=n(2609),a=(n(4951),n(5398))},5590(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setupConfig=t.defaultConfig=void 0;var r=n(4496),a={area:r.defaultArea,delay:0};t.defaultConfig=a,t.setupConfig=function(e){return{area:e&&e.area?e.area:r.defaultArea,delay:e&&e.delay?e.delay:0}}},9220(e,t){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}Object.defineProperty(t,"__esModule",{value:!0}),t.Emitter=void 0;var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,a;return t=e,a=[{key:"emit",value:function(e){if(!e)return this;for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];var o,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var a=0,o=function(){};return{s:o,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,s=!0,l=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){l=!0,i=e},f:function(){try{s||null==r.return||r.return()}finally{if(l)throw i}}}}(this._e(e));try{for(i.s();!(o=i.n()).done;){var s=o.value;s.apply(s.ctx,[].concat(r)),1==s.off_event&&this.off(e,s)}}catch(e){i.e(e)}finally{i.f()}return this}},{key:"on",value:function(e,t,n){return e?(t.ctx=n,this._e(e).push(t),this):this}},{key:"once",value:function(e,t,n){return e?(t.ctx=n,t.off_event=!0,this.on(e,t)):this}},{key:"off",value:function(e,t){if(!e)return this;if(!this[e])return this;var n=this._e(e);return t?(this[e]=n.filter(function(e){return e!=t}),this):(delete this[e],this)}},{key:"_e",value:function(e){return this[e]||(this[e]=[])}}],a&&r(t.prototype,a),Object.defineProperty(t,"prototype",{writable:!1}),e}();t.Emitter=a},2609(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.trackPromise=t.promiseCounterUpdateEventId=t.manuallyResetPromiseCounter=t.manuallyIncrementPromiseCounter=t.manuallyDecrementPromiseCounter=t.getCounter=t.emitter=void 0;var r=n(9220),a=n(4496),o=new r.Emitter;t.emitter=o;var i="promise-counter-update";t.promiseCounterUpdateEventId=i;var s,l,c=(s={},(l=a.defaultArea)in s?Object.defineProperty(s,l,{value:0,enumerable:!0,configurable:!0,writable:!0}):s[l]=0,s);t.getCounter=function(e){return c[e]},t.trackPromise=function(e,t){t=t||a.defaultArea,u(t);var n=function(){return m(t)};return e.then(n,n),e};var u=function(e){d(e);var t=f(e);o.emit(i,t,e)},d=function(e){Boolean(c[e])?c[e]++:c[e]=1},f=function(e){return c[e]>0},m=function(e){c[e]>0&&p(e);var t=f(e);o.emit(i,t,e)},p=function(e){c[e]--};t.manuallyResetPromiseCounter=function(e){e=e||a.defaultArea,c[e]=0,o.emit(i,!1,e)},t.manuallyDecrementPromiseCounter=function(e){e=e||a.defaultArea,m(e)},t.manuallyIncrementPromiseCounter=function(e){e=e||a.defaultArea,u(e)}},4951(e,t,n){"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.promiseTrackerHoc=void 0;var a=function(e,t){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var n=s(t);if(n&&n.has(e))return n.get(e);var a={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in e)if("default"!==i&&Object.prototype.hasOwnProperty.call(e,i)){var l=o?Object.getOwnPropertyDescriptor(e,i):null;l&&(l.get||l.set)?Object.defineProperty(a,i,l):a[i]=e[i]}return a.default=e,n&&n.set(e,a),a}(n(1609)),o=n(2609),i=n(5590);function s(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(s=function(e){return e?n:t})(e)}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},l.apply(this,arguments)}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},u(e,t)}function d(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}t.promiseTrackerHoc=function(e){return function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&u(e,t)}(g,t);var n,s,m,p,h=(m=g,p=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=f(m);if(p){var n=f(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return d(e)}(this,e)});function g(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,g),(t=h.call(this,e)).state={promiseInProgress:!1,internalPromiseInProgress:!1,config:(0,i.setupConfig)(e.config)},t.notifyPromiseInProgress=t.notifyPromiseInProgress.bind(d(t)),t.updateProgress=t.updateProgress.bind(d(t)),t.subscribeToCounterUpdate=t.subscribeToCounterUpdate.bind(d(t)),t}return n=g,(s=[{key:"notifyPromiseInProgress",value:function(){var e=this;0===this.state.config.delay?this.setState({promiseInProgress:!0}):setTimeout(function(){var t=Boolean((0,o.getCounter)(e.state.config.area)>0);e.setState({promiseInProgress:t})},this.state.config.delay)}},{key:"updateProgress",value:function(e,t){this.setState({internalPromiseInProgress:e},t),e?this.notifyPromiseInProgress():this.setState({promiseInProgress:!1})}},{key:"subscribeToCounterUpdate",value:function(){var e=this;o.emitter.on(o.promiseCounterUpdateEventId,function(t,n){e.state.config.area===n&&e.updateProgress(t)})}},{key:"componentDidMount",value:function(){this.updateProgress(Boolean((0,o.getCounter)(this.state.config.area)>0),this.subscribeToCounterUpdate)}},{key:"componentWillUnmount",value:function(){o.emitter.off(o.promiseCounterUpdateEventId)}},{key:"render",value:function(){return a.default.createElement(e,l({},this.props,{config:this.state.config,promiseInProgress:this.state.promiseInProgress}))}}])&&c(n.prototype,s),Object.defineProperty(n,"prototype",{writable:!1}),g}(a.Component)}},5398(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.usePromiseTracker=void 0;var r,a=(r=n(1609))&&r.__esModule?r:{default:r},o=n(2609),i=n(5590);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o=[],_n=!0,i=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);_n=!0);}catch(e){i=!0,a=e}finally{try{_n||null==n.return||n.return()}finally{if(i)throw a}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}t.usePromiseTracker=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.defaultConfig,t=a.default.useRef(!1);a.default.useEffect(function(){return t.current=!0,function(){return t.current=!1}},[]);var n=s(a.default.useState((0,i.setupConfig)(e)),1)[0];a.default.useEffect(function(){t.current&&n&&n.area&&(0,o.getCounter)(n.area)>0&&(c(!0),f(!0))},[n]);var r=s(a.default.useState(!1),2),l=r[0],c=r[1],u=s(a.default.useState(!1),2),d=u[0],f=u[1],m=a.default.useRef(l),p=function(e,r){t.current&&n.area===r&&(c(e),m.current=e,e?n&&n.delay&&0!==n.delay?setTimeout(function(){t.current&&m.current&&f(!0)},n.delay):f(!0):f(!1))};return a.default.useEffect(function(){return m.current=l,o.emitter.on(o.promiseCounterUpdateEventId,p),function(){return o.emitter.off(o.promiseCounterUpdateEventId,p)}},[]),{promiseInProgress:d}}},4210(e,t,n){"use strict";function r(e,t,n,r,a,o,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}const a={};["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"].forEach(e=>{a[e]=new r(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(([e,t])=>{a[e]=new r(e,1,!1,t,null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(e=>{a[e]=new r(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(e=>{a[e]=new r(e,2,!1,e,null,!1,!1)}),["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(e=>{a[e]=new r(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(e=>{a[e]=new r(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(e=>{a[e]=new r(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(e=>{a[e]=new r(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(e=>{a[e]=new r(e,5,!1,e.toLowerCase(),null,!1,!1)});const o=/[\-\:]([a-z])/g,i=e=>e[1].toUpperCase();["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(e=>{const t=e.replace(o,i);a[t]=new r(t,1,!1,e,null,!1,!1)}),["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(e=>{const t=e.replace(o,i);a[t]=new r(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(e=>{const t=e.replace(o,i);a[t]=new r(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(e=>{a[e]=new r(e,1,!1,e.toLowerCase(),null,!1,!1)}),a.xlinkHref=new r("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(e=>{a[e]=new r(e,1,!1,e.toLowerCase(),null,!0,!0)});const{CAMELCASE:s,SAME:l,possibleStandardNames:c}=n(6811),u=RegExp.prototype.test.bind(new RegExp("^(data|aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$")),d=Object.keys(c).reduce((e,t)=>{const n=c[t];return n===l?e[t]=t:n===s?e[t.toLowerCase()]=t:e[t]=n,e},{});t.BOOLEAN=3,t.BOOLEANISH_STRING=2,t.NUMERIC=5,t.OVERLOADED_BOOLEAN=4,t.POSITIVE_NUMERIC=6,t.RESERVED=0,t.STRING=1,t.getPropertyInfo=function(e){return a.hasOwnProperty(e)?a[e]:null},t.isCustomAttribute=u,t.possibleStandardNames=d},6811(e,t){t.SAME=0,t.CAMELCASE=1,t.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1}},9296(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var a=n(6347),o=r(n(1609)),i=n(4499);n(5556),n(7573);var s=r(n(7676));function l(){return(l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function c(e,t){e.prototype=Object.create(t.prototype),u(e.prototype.constructor=e,t)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function d(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],0<=t.indexOf(n)||(a[n]=e[n]);return a}(function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=i.createBrowserHistory(t.props),t}c(t,e),t.prototype.render=function(){return o.createElement(a.Router,{history:this.history,children:this.props.children})}})(o.Component),function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=i.createHashHistory(t.props),t}c(t,e),t.prototype.render=function(){return o.createElement(a.Router,{history:this.history,children:this.props.children})}}(o.Component);var f=function(e,t){return"function"==typeof e?e(t):e},m=function(e,t){return"string"==typeof e?i.createLocation(e,null,null,t):e},p=function(e){return e},h=o.forwardRef;void 0===h&&(h=p);var g=h(function(e,t){var n=e.innerRef,r=e.navigate,a=e.onClick,i=d(e,["innerRef","navigate","onClick"]),s=i.target,c=l({},i,{onClick:function(e){try{a&&a(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||s&&"_self"!==s||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return c.ref=p!==h&&t||n,o.createElement("a",c)}),w=h(function(e,t){var n=e.component,r=void 0===n?g:n,c=e.replace,u=e.to,w=e.innerRef,y=d(e,["component","replace","to","innerRef"]);return o.createElement(a.__RouterContext.Consumer,null,function(e){e||s(!1);var n=e.history,a=m(f(u,e.location),e.location),d=a?n.createHref(a):"",g=l({},y,{href:d,navigate:function(){var t=f(u,e.location),r=i.createPath(e.location)===i.createPath(m(t));(c||r?n.replace:n.push)(t)}});return p!==h?g.ref=t||w:g.innerRef=w,o.createElement(r,g)})}),y=function(e){return e},b=o.forwardRef;void 0===b&&(b=y);b(function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,i=e.activeClassName,c=void 0===i?"active":i,u=e.activeStyle,p=e.className,h=e.exact,g=e.isActive,v=e.location,x=e.sensitive,_=e.strict,E=e.style,N=e.to,M=e.innerRef,I=d(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return o.createElement(a.__RouterContext.Consumer,null,function(e){e||s(!1);var n=v||e.location,i=m(f(N,n),n),d=i.pathname,S=d&&d.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),k=S?a.matchPath(n.pathname,{path:S,exact:h,sensitive:x,strict:_}):null,j=!!(g?g(k,n):k),D="function"==typeof p?p(j):p,C="function"==typeof E?E(j):E;j&&(D=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return e}).join(" ")}(D,c),C=l({},C,u));var A=l({"aria-current":j&&r||null,className:D,style:C,to:i},I);return y!==b?A.ref=t||M:A.innerRef=M,o.createElement(w,A)})});Object.defineProperty(t,"W6",{enumerable:!0,get:function(){return a.useHistory}})},6347(e,t,n){"use strict";n.r(t),n.d(t,{MemoryRouter:()=>E,Prompt:()=>M,Redirect:()=>j,Route:()=>T,Router:()=>_,StaticRouter:()=>U,Switch:()=>B,__HistoryContext:()=>v,__RouterContext:()=>x,generatePath:()=>k,matchPath:()=>A,useHistory:()=>Q,useLocation:()=>V,useParams:()=>W,useRouteMatch:()=>Z,withRouter:()=>F});var r=n(7387),a=n(1609),o=n.n(a),i=n(5556),s=n.n(i),l=n(4499),c=n(1561),u=n(8168),d=n(8505),f=n.n(d),m=(n(7564),n(8587)),p=n(4146),h=n.n(p),g=1073741823,w="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:{},y=o().createContext||function(e,t){var n,a,i,l="__create-react-context-"+((w[i="__global_unique_id__"]=(w[i]||0)+1)+"__"),c=function(e){function n(){for(var t,n,r,a=arguments.length,o=new Array(a),i=0;i<a;i++)o[i]=arguments[i];return(t=e.call.apply(e,[this].concat(o))||this).emitter=(n=t.props.value,r=[],{on:function(e){r.push(e)},off:function(e){r=r.filter(function(t){return t!==e})},get:function(){return n},set:function(e,t){n=e,r.forEach(function(e){return e(n,t)})}}),t}(0,r.A)(n,e);var a=n.prototype;return a.getChildContext=function(){var e;return(e={})[l]=this.emitter,e},a.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,r=this.props.value,a=e.value;((o=r)===(i=a)?0!==o||1/o==1/i:o!=o&&i!=i)?n=0:(n="function"==typeof t?t(r,a):g,0!=(n|=0)&&this.emitter.set(e.value,n))}var o,i},a.render=function(){return this.props.children},n}(o().Component);c.childContextTypes=((n={})[l]=s().object.isRequired,n);var u=function(t){function n(){for(var e,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(e=t.call.apply(t,[this].concat(r))||this).observedBits=void 0,e.state={value:e.getValue()},e.onUpdate=function(t,n){(0|e.observedBits)&n&&e.setState({value:e.getValue()})},e}(0,r.A)(n,t);var a=n.prototype;return a.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?g:t},a.componentDidMount=function(){this.context[l]&&this.context[l].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?g:e},a.componentWillUnmount=function(){this.context[l]&&this.context[l].off(this.onUpdate)},a.getValue=function(){return this.context[l]?this.context[l].get():e},a.render=function(){return(e=this.props.children,Array.isArray(e)?e[0]:e)(this.state.value);var e},n}(o().Component);return u.contextTypes=((a={})[l]=s().object,a),{Provider:c,Consumer:u}},b=function(e){var t=y();return t.displayName=e,t},v=b("Router-History"),x=b("Router"),_=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen(function(e){n._pendingLocation=e})),n}(0,r.A)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){var e=this;this._isMounted=!0,this.unlisten&&this.unlisten(),this.props.staticContext||(this.unlisten=this.props.history.listen(function(t){e._isMounted&&e.setState({location:t})})),this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return o().createElement(x.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},o().createElement(v.Provider,{children:this.props.children||null,value:this.props.history}))},t}(o().Component),E=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=(0,l.createMemoryHistory)(t.props),t}return(0,r.A)(t,e),t.prototype.render=function(){return o().createElement(_,{history:this.history,children:this.props.children})},t}(o().Component),N=function(e){function t(){return e.apply(this,arguments)||this}(0,r.A)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(o().Component);function M(e){var t=e.message,n=e.when,r=void 0===n||n;return o().createElement(x.Consumer,null,function(e){if(e||(0,c.A)(!1),!r||e.staticContext)return null;var n=e.history.block;return o().createElement(N,{onMount:function(e){e.release=n(t)},onUpdate:function(e,r){r.message!==t&&(e.release(),e.release=n(t))},onUnmount:function(e){e.release()},message:t})})}var I={},S=0;function k(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:function(e){if(I[e])return I[e];var t=f().compile(e);return S<1e4&&(I[e]=t,S++),t}(e)(t,{pretty:!0})}function j(e){var t=e.computedMatch,n=e.to,r=e.push,a=void 0!==r&&r;return o().createElement(x.Consumer,null,function(e){e||(0,c.A)(!1);var r=e.history,i=e.staticContext,s=a?r.push:r.replace,d=(0,l.createLocation)(t?"string"==typeof n?k(n,t.params):(0,u.A)({},n,{pathname:k(n.pathname,t.params)}):n);return i?(s(d),null):o().createElement(N,{onMount:function(){s(d)},onUpdate:function(e,t){var n=(0,l.createLocation)(t.to);(0,l.locationsAreEqual)(n,(0,u.A)({},d,{key:n.key}))||s(d)},to:n})})}var D={},C=0;function A(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,r=n.path,a=n.exact,o=void 0!==a&&a,i=n.strict,s=void 0!==i&&i,l=n.sensitive,c=void 0!==l&&l;return[].concat(r).reduce(function(t,n){if(!n&&""!==n)return null;if(t)return t;var r=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=D[n]||(D[n]={});if(r[e])return r[e];var a=[],o={regexp:f()(e,a,t),keys:a};return C<1e4&&(r[e]=o,C++),o}(n,{end:o,strict:s,sensitive:c}),a=r.regexp,i=r.keys,l=a.exec(e);if(!l)return null;var u=l[0],d=l.slice(1),m=e===u;return o&&!m?null:{path:n,url:"/"===n&&""===u?"/":u,isExact:m,params:i.reduce(function(e,t,n){return e[t.name]=d[n],e},{})}},null)}var T=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.A)(t,e),t.prototype.render=function(){var e=this;return o().createElement(x.Consumer,null,function(t){t||(0,c.A)(!1);var n=e.props.location||t.location,r=e.props.computedMatch?e.props.computedMatch:e.props.path?A(n.pathname,e.props):t.match,a=(0,u.A)({},t,{location:n,match:r}),i=e.props,s=i.children,l=i.component,d=i.render;return Array.isArray(s)&&function(e){return 0===o().Children.count(e)}(s)&&(s=null),o().createElement(x.Provider,{value:a},a.match?s?"function"==typeof s?s(a):s:l?o().createElement(l,a):d?d(a):null:"function"==typeof s?s(a):null)})},t}(o().Component);function O(e){return"/"===e.charAt(0)?e:"/"+e}function L(e,t){if(!e)return t;var n=O(e);return 0!==t.pathname.indexOf(n)?t:(0,u.A)({},t,{pathname:t.pathname.substr(n.length)})}function z(e){return"string"==typeof e?e:(0,l.createPath)(e)}function P(e){return function(){(0,c.A)(!1)}}function R(){}var U=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).handlePush=function(e){return t.navigateTo(e,"PUSH")},t.handleReplace=function(e){return t.navigateTo(e,"REPLACE")},t.handleListen=function(){return R},t.handleBlock=function(){return R},t}(0,r.A)(t,e);var n=t.prototype;return n.navigateTo=function(e,t){var n=this.props,r=n.basename,a=void 0===r?"":r,o=n.context,i=void 0===o?{}:o;i.action=t,i.location=function(e,t){return e?(0,u.A)({},t,{pathname:O(e)+t.pathname}):t}(a,(0,l.createLocation)(e)),i.url=z(i.location)},n.render=function(){var e=this.props,t=e.basename,n=void 0===t?"":t,r=e.context,a=void 0===r?{}:r,i=e.location,s=void 0===i?"/":i,c=(0,m.A)(e,["basename","context","location"]),d={createHref:function(e){return O(n+z(e))},action:"POP",location:L(n,(0,l.createLocation)(s)),push:this.handlePush,replace:this.handleReplace,go:P(),goBack:P(),goForward:P(),listen:this.handleListen,block:this.handleBlock};return o().createElement(_,(0,u.A)({},c,{history:d,staticContext:a}))},t}(o().Component),B=function(e){function t(){return e.apply(this,arguments)||this}return(0,r.A)(t,e),t.prototype.render=function(){var e=this;return o().createElement(x.Consumer,null,function(t){t||(0,c.A)(!1);var n,r,a=e.props.location||t.location;return o().Children.forEach(e.props.children,function(e){if(null==r&&o().isValidElement(e)){n=e;var i=e.props.path||e.props.from;r=i?A(a.pathname,(0,u.A)({},e.props,{path:i})):t.match}}),r?o().cloneElement(n,{location:a,computedMatch:r}):null})},t}(o().Component);function F(e){var t="withRouter("+(e.displayName||e.name)+")",n=function(t){var n=t.wrappedComponentRef,r=(0,m.A)(t,["wrappedComponentRef"]);return o().createElement(x.Consumer,null,function(t){return t||(0,c.A)(!1),o().createElement(e,(0,u.A)({},r,t,{ref:n}))})};return n.displayName=t,n.WrappedComponent=e,h()(n,e)}var Y=o().useContext;function Q(){return Y(v)}function V(){return Y(x).location}function W(){var e=Y(x).match;return e?e.params:{}}function Z(e){var t=V(),n=Y(x).match;return e?A(t.pathname,e):n}},9375(e){e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},8505(e,t,n){var r=n(9375);e.exports=function e(t,n,a){return r(n)||(a=n||a,n=[]),a=a||{},t instanceof RegExp?function(e,t){var n=e.source.match(/\((?!\?)/g);if(n)for(var r=0;r<n.length;r++)t.push({name:r,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return f(e,t)}(t,n):r(t)?function(t,n,r){for(var a=[],o=0;o<t.length;o++)a.push(e(t[o],n,r).source);return f(new RegExp("(?:"+a.join("|")+")",m(r)),n)}(t,n,a):function(e,t,n){return p(o(e,n),t,n)}(t,n,a)},e.exports.parse=o,e.exports.compile=function(e,t){return c(o(e,t),t)},e.exports.tokensToFunction=c,e.exports.tokensToRegExp=p;var a=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(e,t){for(var n,r=[],o=0,s=0,l="",c=t&&t.delimiter||"/";null!=(n=a.exec(e));){var u=n[0],f=n[1],m=n.index;if(l+=e.slice(s,m),s=m+u.length,f)l+=f[1];else{var p=e[s],h=n[2],g=n[3],w=n[4],y=n[5],b=n[6],v=n[7];l&&(r.push(l),l="");var x=null!=h&&null!=p&&p!==h,_="+"===b||"*"===b,E="?"===b||"*"===b,N=h||c,M=w||y,I=h||("string"==typeof r[r.length-1]?r[r.length-1]:"");r.push({name:g||o++,prefix:h||"",delimiter:N,optional:E,repeat:_,partial:x,asterisk:!!v,pattern:M?d(M):v?".*":i(N,I)})}}return s<e.length&&(l+=e.substr(s)),l&&r.push(l),r}function i(e,t){return!t||t.indexOf(e)>-1?"[^"+u(e)+"]+?":u(t)+"|(?:(?!"+u(t)+")[^"+u(e)+"])+?"}function s(e){return encodeURI(e).replace(/[\/?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function l(e){return encodeURI(e).replace(/[?#]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}function c(e,t){for(var n=new Array(e.length),a=0;a<e.length;a++)"object"==typeof e[a]&&(n[a]=new RegExp("^(?:"+e[a].pattern+")$",m(t)));return function(t,a){for(var o="",i=t||{},c=(a||{}).pretty?s:encodeURIComponent,u=0;u<e.length;u++){var d=e[u];if("string"!=typeof d){var f,m=i[d.name];if(null==m){if(d.optional){d.partial&&(o+=d.prefix);continue}throw new TypeError('Expected "'+d.name+'" to be defined')}if(r(m)){if(!d.repeat)throw new TypeError('Expected "'+d.name+'" to not repeat, but received `'+JSON.stringify(m)+"`");if(0===m.length){if(d.optional)continue;throw new TypeError('Expected "'+d.name+'" to not be empty')}for(var p=0;p<m.length;p++){if(f=c(m[p]),!n[u].test(f))throw new TypeError('Expected all "'+d.name+'" to match "'+d.pattern+'", but received `'+JSON.stringify(f)+"`");o+=(0===p?d.prefix:d.delimiter)+f}}else{if(f=d.asterisk?l(m):c(m),!n[u].test(f))throw new TypeError('Expected "'+d.name+'" to match "'+d.pattern+'", but received "'+f+'"');o+=d.prefix+f}}else o+=d}return o}}function u(e){return e.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function d(e){return e.replace(/([=!:$\/()])/g,"\\$1")}function f(e,t){return e.keys=t,e}function m(e){return e&&e.sensitive?"":"i"}function p(e,t,n){r(t)||(n=t||n,t=[]);for(var a=(n=n||{}).strict,o=!1!==n.end,i="",s=0;s<e.length;s++){var l=e[s];if("string"==typeof l)i+=u(l);else{var c=u(l.prefix),d="(?:"+l.pattern+")";t.push(l),l.repeat&&(d+="(?:"+c+d+")*"),i+=d=l.optional?l.partial?c+"("+d+")?":"(?:"+c+"("+d+"))?":c+"("+d+")"}}var p=u(n.delimiter||"/"),h=i.slice(-p.length)===p;return a||(i=(h?i.slice(0,-p.length):i)+"(?:"+p+"(?=$))?"),i+=o?"$":a&&h?"":"(?="+p+"|$)",f(new RegExp("^"+i,m(n)),t)}},4912(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for;n&&Symbol.for("react.element"),n&&Symbol.for("react.portal"),n&&Symbol.for("react.fragment"),n&&Symbol.for("react.strict_mode"),n&&Symbol.for("react.profiler"),n&&Symbol.for("react.provider"),n&&Symbol.for("react.context"),n&&Symbol.for("react.async_mode"),n&&Symbol.for("react.concurrent_mode"),n&&Symbol.for("react.forward_ref"),n&&Symbol.for("react.suspense"),n&&Symbol.for("react.suspense_list"),n&&Symbol.for("react.memo"),n&&Symbol.for("react.lazy"),n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope")},7564(e,t,n){"use strict";n(4912)},5901(e,t,n){var r=n(246),a=n(1720),o=n(1609),i=n(2236);function s(e){return e&&e.__esModule?e.default:e}function l(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}function c(e){null!==e.parentElement&&e.parentElement.removeChild(e)}function u(e){e.forEach(e=>c(e.element))}function d(e){e.forEach(e=>{!function(e,t,n){const r=e.children[n]||null;e.insertBefore(t,r)}(e.parentElement,e.element,e.oldIndex)})}function f(e,t){const n=h(e),r={parentElement:e.from};let a=[];switch(n){case"normal":a=[{element:e.item,newIndex:e.newIndex,oldIndex:e.oldIndex,parentElement:e.from}];break;case"swap":a=[{element:e.item,oldIndex:e.oldIndex,newIndex:e.newIndex,...r},{element:e.swapItem,oldIndex:e.newIndex,newIndex:e.oldIndex,...r}];break;case"multidrag":a=e.oldIndicies.map((t,n)=>({element:t.multiDragElement,oldIndex:t.index,newIndex:e.newIndicies[n].index,...r}))}const o=function(e,t){return e.map(e=>({...e,item:t[e.oldIndex]})).sort((e,t)=>e.oldIndex-t.oldIndex)}(a,t);return o}function m(e,t){const n=[...t];return e.concat().reverse().forEach(e=>n.splice(e.oldIndex,1)),n}function p(e,t,n,r){const a=[...t];return e.forEach(e=>{const t=r&&n&&r(e.item,n);a.splice(e.newIndex,0,t||e.item)}),a}function h(e){return e.oldIndicies&&e.oldIndicies.length>0?"multidrag":e.swapItem?"swap":"normal"}l(e.exports,"Sortable",()=>$882b6d93070905b3$re_export$Sortable),l(e.exports,"Direction",()=>$882b6d93070905b3$re_export$Direction),l(e.exports,"DOMRect",()=>$882b6d93070905b3$re_export$DOMRect),l(e.exports,"GroupOptions",()=>$882b6d93070905b3$re_export$GroupOptions),l(e.exports,"MoveEvent",()=>$882b6d93070905b3$re_export$MoveEvent),l(e.exports,"Options",()=>$882b6d93070905b3$re_export$Options),l(e.exports,"PullResult",()=>$882b6d93070905b3$re_export$PullResult),l(e.exports,"PutResult",()=>$882b6d93070905b3$re_export$PutResult),l(e.exports,"SortableEvent",()=>$882b6d93070905b3$re_export$SortableEvent),l(e.exports,"SortableOptions",()=>$882b6d93070905b3$re_export$SortableOptions),l(e.exports,"Utils",()=>$882b6d93070905b3$re_export$Utils),l(e.exports,"ReactSortable",()=>w);const g={dragging:null};class w extends o.Component{static defaultProps={clone:e=>e};constructor(e){super(e),this.ref=(0,o.createRef)();const t=[...e.list].map(e=>Object.assign(e,{chosen:!1,selected:!1}));e.setList(t,this.sortable,g),s(i)(!e.plugins,'\nPlugins prop is no longer supported.\nInstead, mount it with "Sortable.mount(new MultiDrag())"\nPlease read the updated README.md at https://github.com/SortableJS/react-sortablejs.\n ')}componentDidMount(){if(null===this.ref.current)return;const e=this.makeOptions();s(r).create(this.ref.current,e)}componentDidUpdate(e){e.disabled!==this.props.disabled&&this.sortable&&this.sortable.option("disabled",this.props.disabled)}render(){const{tag:e,style:t,className:n,id:r}=this.props,a={style:t,className:n,id:r},i=e&&null!==e?e:"div";return(0,o.createElement)(i,{ref:this.ref,...a},this.getChildren())}getChildren(){const{children:e,dataIdAttr:t,selectedClass:n="sortable-selected",chosenClass:r="sortable-chosen",dragClass:i="sortable-drag",fallbackClass:l="sortable-falback",ghostClass:c="sortable-ghost",swapClass:u="sortable-swap-highlight",filter:d="sortable-filter",list:f}=this.props;if(!e||null==e)return null;const m=t||"data-id";return o.Children.map(e,(e,t)=>{if(void 0===e)return;const i=f[t]||{},{className:l}=e.props,c="string"==typeof d&&{[d.replace(".","")]:!!i.filtered},u=s(a)(l,{[n]:i.selected,[r]:i.chosen,...c});return(0,o.cloneElement)(e,{[m]:e.key,className:u})})}get sortable(){const e=this.ref.current;if(null===e)return null;const t=Object.keys(e).find(e=>e.includes("Sortable"));return t?e[t]:null}makeOptions(){const e=function(e){const{list:t,setList:n,children:r,tag:a,style:o,className:i,clone:s,onAdd:l,onChange:c,onChoose:u,onClone:d,onEnd:f,onFilter:m,onRemove:p,onSort:h,onStart:g,onUnchoose:w,onUpdate:y,onMove:b,onSpill:v,onSelect:x,onDeselect:_,...E}=e;return E}(this.props);return["onAdd","onChoose","onDeselect","onEnd","onRemove","onSelect","onSpill","onStart","onUnchoose","onUpdate"].forEach(t=>e[t]=this.prepareOnHandlerPropAndDOM(t)),["onChange","onClone","onFilter","onSort"].forEach(t=>e[t]=this.prepareOnHandlerProp(t)),{...e,onMove:(e,t)=>{const{onMove:n}=this.props,r=e.willInsertAfter||-1;if(!n)return r;const a=n(e,t,this.sortable,g);return void 0!==a&&a}}}prepareOnHandlerPropAndDOM(e){return t=>{this.callOnHandlerProp(t,e),this[e](t)}}prepareOnHandlerProp(e){return t=>{this.callOnHandlerProp(t,e)}}callOnHandlerProp(e,t){const n=this.props[t];n&&n(e,this.sortable,g)}onAdd(e){const{list:t,setList:n,clone:r}=this.props,a=f(e,[...g.dragging.props.list]);u(a),n(p(a,t,e,r).map(e=>Object.assign(e,{selected:!1})),this.sortable,g)}onRemove(e){const{list:t,setList:n}=this.props,r=h(e),a=f(e,t);d(a);let o=[...t];if("clone"!==e.pullMode)o=m(a,o);else{let t=a;switch(r){case"multidrag":t=a.map((t,n)=>({...t,element:e.clones[n]}));break;case"normal":t=a.map(t=>({...t,element:e.clone}));break;default:s(i)(!0,`mode "${r}" cannot clone. Please remove "props.clone" from <ReactSortable/> when using the "${r}" plugin`)}u(t),a.forEach(t=>{const n=t.oldIndex,r=this.props.clone(t.item,e);o.splice(n,1,r)})}o=o.map(e=>Object.assign(e,{selected:!1})),n(o,this.sortable,g)}onUpdate(e){const{list:t,setList:n}=this.props,r=f(e,t);return u(r),d(r),n(function(e,t){return p(e,m(e,t))}(r,t),this.sortable,g)}onStart(){g.dragging=this}onEnd(){g.dragging=null}onChoose(e){const{list:t,setList:n}=this.props;n(t.map((t,n)=>{let r=t;return n===e.oldIndex&&(r=Object.assign(t,{chosen:!0})),r}),this.sortable,g)}onUnchoose(e){const{list:t,setList:n}=this.props;n(t.map((t,n)=>{let r=t;return n===e.oldIndex&&(r=Object.assign(r,{chosen:!1})),r}),this.sortable,g)}onSpill(e){const{removeOnSpill:t,revertOnSpill:n}=this.props;t&&!n&&c(e.item)}onSelect(e){const{list:t,setList:n}=this.props,r=t.map(e=>Object.assign(e,{selected:!1}));e.newIndicies.forEach(t=>{const n=t.index;if(-1===n)return console.log(`"${e.type}" had indice of "${t.index}", which is probably -1 and doesn't usually happen here.`),void console.log(e);r[n].selected=!0}),n(r,this.sortable,g)}onDeselect(e){const{list:t,setList:n}=this.props,r=t.map(e=>Object.assign(e,{selected:!1}));e.newIndicies.forEach(e=>{const t=e.index;-1!==t&&(r[t].selected=!0)}),n(r,this.sortable,g)}}var y,b;y=e.exports,b={},Object.keys(b).forEach(function(e){"default"===e||"__esModule"===e||y.hasOwnProperty(e)||Object.defineProperty(y,e,{enumerable:!0,get:function(){return b[e]}})})},1720(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var o=typeof n;if("string"===o||"number"===o)e.push(n);else if(Array.isArray(n)){if(n.length){var i=a.apply(null,n);i&&e.push(i)}}else if("object"===o)if(n.toString===Object.prototype.toString)for(var s in n)r.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},2236(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>r});function r(e,t){if(!e)throw new Error("Invariant failed")}},1020(e,t,n){"use strict";var r=n(1609),a=Symbol.for("react.element"),o=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,n){var r,o={},c=null,u=null;for(r in void 0!==n&&(c=""+n),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(u=t.ref),t)i.call(t,r)&&!l.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===o[r]&&(o[r]=t[r]);return{$$typeof:a,type:e,key:c,ref:u,props:o,_owner:s.current}}t.Fragment=o,t.jsx=c,t.jsxs=c},4848(e,t,n){"use strict";e.exports=n(1020)},8867(e,t){"use strict";var n=Symbol.for("react.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),c=Symbol.for("react.server_context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy");Symbol.for("react.offscreen");Symbol.for("react.module.reference"),t.isFragment=function(e){return function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case a:case i:case o:case d:case f:return e;default:switch(e=e&&e.$$typeof){case c:case l:case u:case p:case m:case s:return e;default:return t}}case r:return t}}}(e)===a}},4580(e,t,n){"use strict";e.exports=n(8867)},4307(e,t,n){"use strict";function r(e){return"/"===e.charAt(0)}function a(e,t){for(var n=t,r=n+1,a=e.length;r<a;n+=1,r+=1)e[n]=e[r];e.pop()}n.d(t,{A:()=>o});const o=function(e,t){void 0===t&&(t="");var n,o=e&&e.split("/")||[],i=t&&t.split("/")||[],s=e&&r(e),l=t&&r(t),c=s||l;if(e&&r(e)?i=o:o.length&&(i.pop(),i=i.concat(o)),!i.length)return"/";if(i.length){var u=i[i.length-1];n="."===u||".."===u||""===u}else n=!1;for(var d=0,f=i.length;f>=0;f--){var m=i[f];"."===m?a(i,f):".."===m?(a(i,f),d++):d&&(a(i,f),d--)}if(!c)for(;d--;d)i.unshift("..");!c||""===i[0]||i[0]&&r(i[0])||i.unshift("");var p=i.join("/");return n&&"/"!==p.substr(-1)&&(p+="/"),p}},246(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(Object(n),!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(){return s=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s.apply(this,arguments)}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function c(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}n.r(t),n.d(t,{MultiDrag:()=>bt,Sortable:()=>Be,Swap:()=>lt,default:()=>_t});var u=c(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),d=c(/Edge/i),f=c(/firefox/i),m=c(/safari/i)&&!c(/chrome/i)&&!c(/android/i),p=c(/iP(ad|od|hone)/i),h=c(/chrome/i)&&c(/android/i),g={capture:!1,passive:!1};function w(e,t,n){e.addEventListener(t,n,!u&&g)}function y(e,t,n){e.removeEventListener(t,n,!u&&g)}function b(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function v(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function x(e,t,n,r){if(e){n=n||document;do{if(null!=t&&(">"===t[0]?e.parentNode===n&&b(e,t):b(e,t))||r&&e===n)return e;if(e===n)break}while(e=v(e))}return null}var _,E=/\s+/g;function N(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var r=(" "+e.className+" ").replace(E," ").replace(" "+t+" "," ");e.className=(r+(n?" "+t:"")).replace(E," ")}}function M(e,t,n){var r=e&&e.style;if(r){if(void 0===n)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),void 0===t?n:n[t];t in r||-1!==t.indexOf("webkit")||(t="-webkit-"+t),r[t]=n+("string"==typeof n?"":"px")}}function I(e,t){var n="";if("string"==typeof e)n=e;else do{var r=M(e,"transform");r&&"none"!==r&&(n=r+" "+n)}while(!t&&(e=e.parentNode));var a=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return a&&new a(n)}function S(e,t,n){if(e){var r=e.getElementsByTagName(t),a=0,o=r.length;if(n)for(;a<o;a++)n(r[a],a);return r}return[]}function k(){return document.scrollingElement||document.documentElement}function j(e,t,n,r,a){if(e.getBoundingClientRect||e===window){var o,i,s,l,c,d,f;if(e!==window&&e.parentNode&&e!==k()?(i=(o=e.getBoundingClientRect()).top,s=o.left,l=o.bottom,c=o.right,d=o.height,f=o.width):(i=0,s=0,l=window.innerHeight,c=window.innerWidth,d=window.innerHeight,f=window.innerWidth),(t||n)&&e!==window&&(a=a||e.parentNode,!u))do{if(a&&a.getBoundingClientRect&&("none"!==M(a,"transform")||n&&"static"!==M(a,"position"))){var m=a.getBoundingClientRect();i-=m.top+parseInt(M(a,"border-top-width")),s-=m.left+parseInt(M(a,"border-left-width")),l=i+o.height,c=s+o.width;break}}while(a=a.parentNode);if(r&&e!==window){var p=I(a||e),h=p&&p.a,g=p&&p.d;p&&(l=(i/=g)+(d/=g),c=(s/=h)+(f/=h))}return{top:i,left:s,bottom:l,right:c,width:f,height:d}}}function D(e,t,n){for(var r=L(e,!0),a=j(e)[t];r;){var o=j(r)[n];if(!("top"===n||"left"===n?a>=o:a<=o))return r;if(r===k())break;r=L(r,!1)}return!1}function C(e,t,n,r){for(var a=0,o=0,i=e.children;o<i.length;){if("none"!==i[o].style.display&&i[o]!==Be.ghost&&(r||i[o]!==Be.dragged)&&x(i[o],n.draggable,e,!1)){if(a===t)return i[o];a++}o++}return null}function A(e,t){for(var n=e.lastElementChild;n&&(n===Be.ghost||"none"===M(n,"display")||t&&!b(n,t));)n=n.previousElementSibling;return n||null}function T(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===Be.clone||t&&!b(e,t)||n++;return n}function O(e){var t=0,n=0,r=k();if(e)do{var a=I(e),o=a.a,i=a.d;t+=e.scrollLeft*o,n+=e.scrollTop*i}while(e!==r&&(e=e.parentNode));return[t,n]}function L(e,t){if(!e||!e.getBoundingClientRect)return k();var n=e,r=!1;do{if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var a=M(n);if(n.clientWidth<n.scrollWidth&&("auto"==a.overflowX||"scroll"==a.overflowX)||n.clientHeight<n.scrollHeight&&("auto"==a.overflowY||"scroll"==a.overflowY)){if(!n.getBoundingClientRect||n===document.body)return k();if(r||t)return n;r=!0}}}while(n=n.parentNode);return k()}function z(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function P(e,t){return function(){if(!_){var n=arguments;1===n.length?e.call(this,n[0]):e.apply(this,n),_=setTimeout(function(){_=void 0},t)}}}function R(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function U(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function B(e,t){M(e,"position","absolute"),M(e,"top",t.top),M(e,"left",t.left),M(e,"width",t.width),M(e,"height",t.height)}function F(e){M(e,"position",""),M(e,"top",""),M(e,"left",""),M(e,"width",""),M(e,"height","")}var Y="Sortable"+(new Date).getTime();var Q=[],V={initializeByDefault:!0},W={mount:function(e){for(var t in V)V.hasOwnProperty(t)&&!(t in e)&&(e[t]=V[t]);Q.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Q.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var o=e+"Global";Q.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][o]&&t[r.pluginName][o](a({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](a({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var a in Q.forEach(function(r){var a=r.pluginName;if(e.options[a]||r.initializeByDefault){var o=new r(e,t,e.options);o.sortable=e,o.options=e.options,e[a]=o,s(n,o.defaults)}}),e.options)if(e.options.hasOwnProperty(a)){var o=this.modifyOption(e,a,e.options[a]);void 0!==o&&(e.options[a]=o)}},getEventProperties:function(e,t){var n={};return Q.forEach(function(r){"function"==typeof r.eventProperties&&s(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return Q.forEach(function(a){e[a.pluginName]&&a.optionListeners&&"function"==typeof a.optionListeners[t]&&(r=a.optionListeners[t].call(e[a.pluginName],n))}),r}};function Z(e){var t=e.sortable,n=e.rootEl,r=e.name,o=e.targetEl,i=e.cloneEl,s=e.toEl,l=e.fromEl,c=e.oldIndex,f=e.newIndex,m=e.oldDraggableIndex,p=e.newDraggableIndex,h=e.originalEvent,g=e.putSortable,w=e.extraEventProperties;if(t=t||n&&n[Y]){var y,b=t.options,v="on"+r.charAt(0).toUpperCase()+r.substr(1);!window.CustomEvent||u||d?(y=document.createEvent("Event")).initEvent(r,!0,!0):y=new CustomEvent(r,{bubbles:!0,cancelable:!0}),y.to=s||n,y.from=l||n,y.item=o||n,y.clone=i,y.oldIndex=c,y.newIndex=f,y.oldDraggableIndex=m,y.newDraggableIndex=p,y.originalEvent=h,y.pullMode=g?g.lastPutMode:void 0;var x=a(a({},w),W.getEventProperties(r,t));for(var _ in x)y[_]=x[_];n&&n.dispatchEvent(y),b[v]&&b[v].call(t,y)}}var G=["evt"],H=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.evt,o=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(n,G);W.pluginEvent.bind(Be)(e,t,a({dragEl:X,parentEl:q,ghostEl:J,rootEl:K,nextEl:ee,lastDownEl:te,cloneEl:ne,cloneHidden:re,dragStarted:ge,putSortable:ce,activeSortable:Be.active,originalEvent:r,oldIndex:ae,oldDraggableIndex:ie,newIndex:oe,newDraggableIndex:se,hideGhostForTarget:ze,unhideGhostForTarget:Pe,cloneNowHidden:function(){re=!0},cloneNowShown:function(){re=!1},dispatchSortableEvent:function(e){$({sortable:t,name:e,originalEvent:r})}},o))};function $(e){Z(a({putSortable:ce,cloneEl:ne,targetEl:X,rootEl:K,oldIndex:ae,oldDraggableIndex:ie,newIndex:oe,newDraggableIndex:se},e))}var X,q,J,K,ee,te,ne,re,ae,oe,ie,se,le,ce,ue,de,fe,me,pe,he,ge,we,ye,be,ve,xe=!1,_e=!1,Ee=[],Ne=!1,Me=!1,Ie=[],Se=!1,ke=[],je="undefined"!=typeof document,De=p,Ce=d||u?"cssFloat":"float",Ae=je&&!h&&!p&&"draggable"in document.createElement("div"),Te=function(){if(je){if(u)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Oe=function(e,t){var n=M(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),a=C(e,0,t),o=C(e,1,t),i=a&&M(a),s=o&&M(o),l=i&&parseInt(i.marginLeft)+parseInt(i.marginRight)+j(a).width,c=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+j(o).width;if("flex"===n.display)return"column"===n.flexDirection||"column-reverse"===n.flexDirection?"vertical":"horizontal";if("grid"===n.display)return n.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&i.float&&"none"!==i.float){var u="left"===i.float?"left":"right";return!o||"both"!==s.clear&&s.clear!==u?"horizontal":"vertical"}return a&&("block"===i.display||"flex"===i.display||"table"===i.display||"grid"===i.display||l>=r&&"none"===n[Ce]||o&&"none"===n[Ce]&&l+c>r)?"vertical":"horizontal"},Le=function(e){function t(e,n){return function(r,a,o,i){var s=r.options.group.name&&a.options.group.name&&r.options.group.name===a.options.group.name;if(null==e&&(n||s))return!0;if(null==e||!1===e)return!1;if(n&&"clone"===e)return e;if("function"==typeof e)return t(e(r,a,o,i),n)(r,a,o,i);var l=(n?r:a).options.group.name;return!0===e||"string"==typeof e&&e===l||e.join&&e.indexOf(l)>-1}}var n={},r=e.group;r&&"object"==o(r)||(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},ze=function(){!Te&&J&&M(J,"display","none")},Pe=function(){!Te&&J&&M(J,"display","")};je&&document.addEventListener("click",function(e){if(_e)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),_e=!1,!1},!0);var Re=function(e){if(X){e=e.touches?e.touches[0]:e;var t=(a=e.clientX,o=e.clientY,Ee.some(function(e){var t=e[Y].options.emptyInsertThreshold;if(t&&!A(e)){var n=j(e),r=a>=n.left-t&&a<=n.right+t,s=o>=n.top-t&&o<=n.bottom+t;return r&&s?i=e:void 0}}),i);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[Y]._onDragOver(n)}}var a,o,i},Ue=function(e){X&&X.parentNode[Y]._isOutsideThisEl(e.target)};function Be(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=s({},t),e[Y]=this;var n,r,o={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Oe(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==Be.supportPointer&&"PointerEvent"in window&&!m,emptyInsertThreshold:5};for(var i in W.initializePlugins(this,e,o),o)!(i in t)&&(t[i]=o[i]);for(var l in Le(t),this)"_"===l.charAt(0)&&"function"==typeof this[l]&&(this[l]=this[l].bind(this));this.nativeDraggable=!t.forceFallback&&Ae,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?w(e,"pointerdown",this._onTapStart):(w(e,"mousedown",this._onTapStart),w(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(w(e,"dragover",this),w(e,"dragenter",this)),Ee.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),s(this,(r=[],{captureAnimationState:function(){r=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(e){if("none"!==M(e,"display")&&e!==Be.ghost){r.push({target:e,rect:j(e)});var t=a({},r[r.length-1].rect);if(e.thisAnimationDuration){var n=I(e,!0);n&&(t.top-=n.f,t.left-=n.e)}e.fromRect=t}})},addAnimationState:function(e){r.push(e)},removeAnimationState:function(e){r.splice(function(e,t){for(var n in e)if(e.hasOwnProperty(n))for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n);return-1}(r,{target:e}),1)},animateAll:function(e){var t=this;if(!this.options.animation)return clearTimeout(n),void("function"==typeof e&&e());var a=!1,o=0;r.forEach(function(e){var n=0,r=e.target,i=r.fromRect,s=j(r),l=r.prevFromRect,c=r.prevToRect,u=e.rect,d=I(r,!0);d&&(s.top-=d.f,s.left-=d.e),r.toRect=s,r.thisAnimationDuration&&z(l,s)&&!z(i,s)&&(u.top-s.top)/(u.left-s.left)===(i.top-s.top)/(i.left-s.left)&&(n=function(e,t,n,r){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-n.top,2)+Math.pow(t.left-n.left,2))*r.animation}(u,l,c,t.options)),z(s,i)||(r.prevFromRect=i,r.prevToRect=s,n||(n=t.options.animation),t.animate(r,u,s,n)),n&&(a=!0,o=Math.max(o,n),clearTimeout(r.animationResetTimer),r.animationResetTimer=setTimeout(function(){r.animationTime=0,r.prevFromRect=null,r.fromRect=null,r.prevToRect=null,r.thisAnimationDuration=null},n),r.thisAnimationDuration=n)}),clearTimeout(n),a?n=setTimeout(function(){"function"==typeof e&&e()},o):"function"==typeof e&&e(),r=[]},animate:function(e,t,n,r){if(r){M(e,"transition",""),M(e,"transform","");var a=I(this.el),o=a&&a.a,i=a&&a.d,s=(t.left-n.left)/(o||1),l=(t.top-n.top)/(i||1);e.animatingX=!!s,e.animatingY=!!l,M(e,"transform","translate3d("+s+"px,"+l+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),M(e,"transition","transform "+r+"ms"+(this.options.easing?" "+this.options.easing:"")),M(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){M(e,"transition",""),M(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}))}function Fe(e,t,n,r,a,o,i,s){var l,c,f=e[Y],m=f.options.onMove;return!window.CustomEvent||u||d?(l=document.createEvent("Event")).initEvent("move",!0,!0):l=new CustomEvent("move",{bubbles:!0,cancelable:!0}),l.to=t,l.from=e,l.dragged=n,l.draggedRect=r,l.related=a||t,l.relatedRect=o||j(t),l.willInsertAfter=s,l.originalEvent=i,e.dispatchEvent(l),m&&(c=m.call(f,l,i)),c}function Ye(e){e.draggable=!1}function Qe(){Se=!1}function Ve(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function We(e){return setTimeout(e,0)}function Ze(e){return clearTimeout(e)}Be.prototype={constructor:Be,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(we=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,X):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,a=r.preventOnFilter,o=e.type,i=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,s=(i||e).target,l=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,c=r.filter;if(function(e){ke.length=0;for(var t=e.getElementsByTagName("input"),n=t.length;n--;){var r=t[n];r.checked&&ke.push(r)}}(n),!X&&!(/mousedown|pointerdown/.test(o)&&0!==e.button||r.disabled)&&!l.isContentEditable&&(this.nativeDraggable||!m||!s||"SELECT"!==s.tagName.toUpperCase())&&!((s=x(s,r.draggable,n,!1))&&s.animated||te===s)){if(ae=T(s),ie=T(s,r.draggable),"function"==typeof c){if(c.call(this,e,s,this))return $({sortable:t,rootEl:l,name:"filter",targetEl:s,toEl:n,fromEl:n}),H("filter",t,{evt:e}),void(a&&e.cancelable&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(r){if(r=x(l,r.trim(),n,!1))return $({sortable:t,rootEl:r,name:"filter",targetEl:s,fromEl:n,toEl:n}),H("filter",t,{evt:e}),!0})))return void(a&&e.cancelable&&e.preventDefault());r.handle&&!x(l,r.handle,n,!1)||this._prepareDragStart(e,i,s)}}},_prepareDragStart:function(e,t,n){var r,a=this,o=a.el,i=a.options,s=o.ownerDocument;if(n&&!X&&n.parentNode===o){var l=j(n);if(K=o,q=(X=n).parentNode,ee=X.nextSibling,te=n,le=i.group,Be.dragged=X,ue={target:X,clientX:(t||e).clientX,clientY:(t||e).clientY},pe=ue.clientX-l.left,he=ue.clientY-l.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,X.style["will-change"]="all",r=function(){H("delayEnded",a,{evt:e}),Be.eventCanceled?a._onDrop():(a._disableDelayedDragEvents(),!f&&a.nativeDraggable&&(X.draggable=!0),a._triggerDragStart(e,t),$({sortable:a,name:"choose",originalEvent:e}),N(X,i.chosenClass,!0))},i.ignore.split(",").forEach(function(e){S(X,e.trim(),Ye)}),w(s,"dragover",Re),w(s,"mousemove",Re),w(s,"touchmove",Re),w(s,"mouseup",a._onDrop),w(s,"touchend",a._onDrop),w(s,"touchcancel",a._onDrop),f&&this.nativeDraggable&&(this.options.touchStartThreshold=4,X.draggable=!0),H("delayStart",this,{evt:e}),!i.delay||i.delayOnTouchOnly&&!t||this.nativeDraggable&&(d||u))r();else{if(Be.eventCanceled)return void this._onDrop();w(s,"mouseup",a._disableDelayedDrag),w(s,"touchend",a._disableDelayedDrag),w(s,"touchcancel",a._disableDelayedDrag),w(s,"mousemove",a._delayedDragTouchMoveHandler),w(s,"touchmove",a._delayedDragTouchMoveHandler),i.supportPointer&&w(s,"pointermove",a._delayedDragTouchMoveHandler),a._dragStartTimer=setTimeout(r,i.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){X&&Ye(X),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;y(e,"mouseup",this._disableDelayedDrag),y(e,"touchend",this._disableDelayedDrag),y(e,"touchcancel",this._disableDelayedDrag),y(e,"mousemove",this._delayedDragTouchMoveHandler),y(e,"touchmove",this._delayedDragTouchMoveHandler),y(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?w(document,"pointermove",this._onTouchMove):w(document,t?"touchmove":"mousemove",this._onTouchMove):(w(X,"dragend",this),w(K,"dragstart",this._onDragStart));try{document.selection?We(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(xe=!1,K&&X){H("dragStarted",this,{evt:t}),this.nativeDraggable&&w(document,"dragover",Ue);var n=this.options;!e&&N(X,n.dragClass,!1),N(X,n.ghostClass,!0),Be.active=this,e&&this._appendGhost(),$({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(de){this._lastX=de.clientX,this._lastY=de.clientY,ze();for(var e=document.elementFromPoint(de.clientX,de.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(de.clientX,de.clientY))!==t;)t=e;if(X.parentNode[Y]._isOutsideThisEl(e),t)do{if(t[Y]&&t[Y]._onDragOver({clientX:de.clientX,clientY:de.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break;e=t}while(t=t.parentNode);Pe()}},_onTouchMove:function(e){if(ue){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,a=e.touches?e.touches[0]:e,o=J&&I(J,!0),i=J&&o&&o.a,s=J&&o&&o.d,l=De&&ve&&O(ve),c=(a.clientX-ue.clientX+r.x)/(i||1)+(l?l[0]-Ie[0]:0)/(i||1),u=(a.clientY-ue.clientY+r.y)/(s||1)+(l?l[1]-Ie[1]:0)/(s||1);if(!Be.active&&!xe){if(n&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(J){o?(o.e+=c-(fe||0),o.f+=u-(me||0)):o={a:1,b:0,c:0,d:1,e:c,f:u};var d="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");M(J,"webkitTransform",d),M(J,"mozTransform",d),M(J,"msTransform",d),M(J,"transform",d),fe=c,me=u,de=a}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!J){var e=this.options.fallbackOnBody?document.body:K,t=j(X,!0,De,!0,e),n=this.options;if(De){for(ve=e;"static"===M(ve,"position")&&"none"===M(ve,"transform")&&ve!==document;)ve=ve.parentNode;ve!==document.body&&ve!==document.documentElement?(ve===document&&(ve=k()),t.top+=ve.scrollTop,t.left+=ve.scrollLeft):ve=k(),Ie=O(ve)}N(J=X.cloneNode(!0),n.ghostClass,!1),N(J,n.fallbackClass,!0),N(J,n.dragClass,!0),M(J,"transition",""),M(J,"transform",""),M(J,"box-sizing","border-box"),M(J,"margin",0),M(J,"top",t.top),M(J,"left",t.left),M(J,"width",t.width),M(J,"height",t.height),M(J,"opacity","0.8"),M(J,"position",De?"absolute":"fixed"),M(J,"zIndex","100000"),M(J,"pointerEvents","none"),Be.ghost=J,e.appendChild(J),M(J,"transform-origin",pe/parseInt(J.style.width)*100+"% "+he/parseInt(J.style.height)*100+"%")}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,a=n.options;H("dragStart",this,{evt:e}),Be.eventCanceled?this._onDrop():(H("setupClone",this),Be.eventCanceled||((ne=U(X)).draggable=!1,ne.style["will-change"]="",this._hideClone(),N(ne,this.options.chosenClass,!1),Be.clone=ne),n.cloneId=We(function(){H("clone",n),Be.eventCanceled||(n.options.removeCloneOnHide||K.insertBefore(ne,X),n._hideClone(),$({sortable:n,name:"clone"}))}),!t&&N(X,a.dragClass,!0),t?(_e=!0,n._loopId=setInterval(n._emulateDragOver,50)):(y(document,"mouseup",n._onDrop),y(document,"touchend",n._onDrop),y(document,"touchcancel",n._onDrop),r&&(r.effectAllowed="move",a.setData&&a.setData.call(n,r,X)),w(document,"drop",n),M(X,"transform","translateZ(0)")),xe=!0,n._dragStartId=We(n._dragStarted.bind(n,t,e)),w(document,"selectstart",n),ge=!0,m&&M(document.body,"user-select","none"))},_onDragOver:function(e){var t,n,r,o,i=this.el,s=e.target,l=this.options,c=l.group,u=Be.active,d=le===c,f=l.sort,m=ce||u,p=this,h=!1;if(!Se){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),s=x(s,l.draggable,i,!0),U("dragOver"),Be.eventCanceled)return h;if(X.contains(e.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return F(!1);if(_e=!1,u&&!l.disabled&&(d?f||(r=q!==K):ce===this||(this.lastPutMode=le.checkPull(this,u,X,e))&&c.checkPut(this,u,X,e))){if(o="vertical"===this._getDirection(e,s),t=j(X),U("dragOverValid"),Be.eventCanceled)return h;if(r)return q=K,B(),this._hideClone(),U("revert"),Be.eventCanceled||(ee?K.insertBefore(X,ee):K.appendChild(X)),F(!0);var g=A(i,l.draggable);if(!g||function(e,t,n){var r=j(A(n.el,n.options.draggable));return t?e.clientX>r.right+10||e.clientX<=r.right&&e.clientY>r.bottom&&e.clientX>=r.left:e.clientX>r.right&&e.clientY>r.top||e.clientX<=r.right&&e.clientY>r.bottom+10}(e,o,this)&&!g.animated){if(g===X)return F(!1);if(g&&i===e.target&&(s=g),s&&(n=j(s)),!1!==Fe(K,i,X,t,s,n,e,!!s))return B(),i.appendChild(X),q=i,Q(),F(!0)}else if(g&&function(e,t,n){var r=j(C(n.el,0,n.options,!0));return t?e.clientX<r.left-10||e.clientY<r.top&&e.clientX<r.right:e.clientY<r.top-10||e.clientY<r.bottom&&e.clientX<r.left}(e,o,this)){var w=C(i,0,l,!0);if(w===X)return F(!1);if(n=j(s=w),!1!==Fe(K,i,X,t,s,n,e,!1))return B(),i.insertBefore(X,w),q=i,Q(),F(!0)}else if(s.parentNode===i){n=j(s);var y,b,v,_=X.parentNode!==i,E=!function(e,t,n){var r=n?e.left:e.top,a=n?e.right:e.bottom,o=n?e.width:e.height,i=n?t.left:t.top,s=n?t.right:t.bottom,l=n?t.width:t.height;return r===i||a===s||r+o/2===i+l/2}(X.animated&&X.toRect||t,s.animated&&s.toRect||n,o),I=o?"top":"left",S=D(s,"top","top")||D(X,"top","top"),k=S?S.scrollTop:void 0;if(we!==s&&(b=n[I],Ne=!1,Me=!E&&l.invertSwap||_),y=function(e,t,n,r,a,o,i,s){var l=r?e.clientY:e.clientX,c=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!i)if(s&&be<c*a){if(!Ne&&(1===ye?l>u+c*o/2:l<d-c*o/2)&&(Ne=!0),Ne)f=!0;else if(1===ye?l<u+be:l>d-be)return-ye}else if(l>u+c*(1-a)/2&&l<d-c*(1-a)/2)return function(e){return T(X)<T(e)?1:-1}(t);return(f=f||i)&&(l<u+c*o/2||l>d-c*o/2)?l>u+c/2?1:-1:0}(e,s,n,o,E?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,Me,we===s),0!==y){var O=T(X);do{O-=y,v=q.children[O]}while(v&&("none"===M(v,"display")||v===J))}if(0===y||v===s)return F(!1);we=s,ye=y;var L=s.nextElementSibling,z=!1,P=Fe(K,i,X,t,s,n,e,z=1===y);if(!1!==P)return 1!==P&&-1!==P||(z=1===P),Se=!0,setTimeout(Qe,30),B(),z&&!L?i.appendChild(X):s.parentNode.insertBefore(X,z?L:s),S&&R(S,0,k-S.scrollTop),q=X.parentNode,void 0===b||Me||(be=Math.abs(b-j(s)[I])),Q(),F(!0)}if(i.contains(X))return F(!1)}return!1}function U(l,c){H(l,p,a({evt:e,isOwner:d,axis:o?"vertical":"horizontal",revert:r,dragRect:t,targetRect:n,canSort:f,fromSortable:m,target:s,completed:F,onMove:function(n,r){return Fe(K,i,X,t,n,j(n),e,r)},changed:Q},c))}function B(){U("dragOverAnimationCapture"),p.captureAnimationState(),p!==m&&m.captureAnimationState()}function F(t){return U("dragOverCompleted",{insertion:t}),t&&(d?u._hideClone():u._showClone(p),p!==m&&(N(X,ce?ce.options.ghostClass:u.options.ghostClass,!1),N(X,l.ghostClass,!0)),ce!==p&&p!==Be.active?ce=p:p===Be.active&&ce&&(ce=null),m===p&&(p._ignoreWhileAnimating=s),p.animateAll(function(){U("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==m&&(m.animateAll(),m._ignoreWhileAnimating=null)),(s===X&&!X.animated||s===i&&!s.animated)&&(we=null),l.dragoverBubble||e.rootEl||s===document||(X.parentNode[Y]._isOutsideThisEl(e.target),!t&&Re(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),h=!0}function Q(){oe=T(X),se=T(X,l.draggable),$({sortable:p,name:"change",toEl:i,newIndex:oe,newDraggableIndex:se,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){y(document,"mousemove",this._onTouchMove),y(document,"touchmove",this._onTouchMove),y(document,"pointermove",this._onTouchMove),y(document,"dragover",Re),y(document,"mousemove",Re),y(document,"touchmove",Re)},_offUpEvents:function(){var e=this.el.ownerDocument;y(e,"mouseup",this._onDrop),y(e,"touchend",this._onDrop),y(e,"pointerup",this._onDrop),y(e,"touchcancel",this._onDrop),y(document,"selectstart",this)},_onDrop:function(e){var t=this.el,n=this.options;oe=T(X),se=T(X,n.draggable),H("drop",this,{evt:e}),q=X&&X.parentNode,oe=T(X),se=T(X,n.draggable),Be.eventCanceled||(xe=!1,Me=!1,Ne=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ze(this.cloneId),Ze(this._dragStartId),this.nativeDraggable&&(y(document,"drop",this),y(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),m&&M(document.body,"user-select",""),M(X,"transform",""),e&&(ge&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),J&&J.parentNode&&J.parentNode.removeChild(J),(K===q||ce&&"clone"!==ce.lastPutMode)&&ne&&ne.parentNode&&ne.parentNode.removeChild(ne),X&&(this.nativeDraggable&&y(X,"dragend",this),Ye(X),X.style["will-change"]="",ge&&!xe&&N(X,ce?ce.options.ghostClass:this.options.ghostClass,!1),N(X,this.options.chosenClass,!1),$({sortable:this,name:"unchoose",toEl:q,newIndex:null,newDraggableIndex:null,originalEvent:e}),K!==q?(oe>=0&&($({rootEl:q,name:"add",toEl:q,fromEl:K,originalEvent:e}),$({sortable:this,name:"remove",toEl:q,originalEvent:e}),$({rootEl:q,name:"sort",toEl:q,fromEl:K,originalEvent:e}),$({sortable:this,name:"sort",toEl:q,originalEvent:e})),ce&&ce.save()):oe!==ae&&oe>=0&&($({sortable:this,name:"update",toEl:q,originalEvent:e}),$({sortable:this,name:"sort",toEl:q,originalEvent:e})),Be.active&&(null!=oe&&-1!==oe||(oe=ae,se=ie),$({sortable:this,name:"end",toEl:q,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){H("nulling",this),K=X=q=J=ee=ne=te=re=ue=de=ge=oe=se=ae=ie=we=ye=ce=le=Be.dragged=Be.ghost=Be.clone=Be.active=null,ke.forEach(function(e){e.checked=!0}),ke.length=fe=me=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":X&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move"),e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],n=this.el.children,r=0,a=n.length,o=this.options;r<a;r++)x(e=n[r],o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||Ve(e));return t},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var a=r.children[t];x(a,this.options.draggable,r,!1)&&(n[e]=a)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return x(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(void 0===t)return n[e];var r=W.modifyOption(this,e,t);n[e]=void 0!==r?r:t,"group"===e&&Le(n)},destroy:function(){H("destroy",this);var e=this.el;e[Y]=null,y(e,"mousedown",this._onTapStart),y(e,"touchstart",this._onTapStart),y(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(y(e,"dragover",this),y(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Ee.splice(Ee.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!re){if(H("hideClone",this),Be.eventCanceled)return;M(ne,"display","none"),this.options.removeCloneOnHide&&ne.parentNode&&ne.parentNode.removeChild(ne),re=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(re){if(H("showClone",this),Be.eventCanceled)return;X.parentNode!=K||this.options.group.revertClone?ee?K.insertBefore(ne,ee):K.appendChild(ne):K.insertBefore(ne,X),this.options.group.revertClone&&this.animate(X,ne),M(ne,"display",""),re=!1}}else this._hideClone()}},je&&w(document,"touchmove",function(e){(Be.active||xe)&&e.cancelable&&e.preventDefault()}),Be.utils={on:w,off:y,css:M,find:S,is:function(e,t){return!!x(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},throttle:P,closest:x,toggleClass:N,clone:U,index:T,nextTick:We,cancelNextTick:Ze,detectDirection:Oe,getChild:C},Be.get=function(e){return e[Y]},Be.mount=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(Be.utils=a(a({},Be.utils),e.utils)),W.mount(e)})},Be.create=function(e,t){return new Be(e,t)},Be.version="1.14.0";var Ge,He,$e,Xe,qe,Je,Ke=[],et=!1;function tt(){Ke.forEach(function(e){clearInterval(e.pid)}),Ke=[]}function nt(){clearInterval(Je)}var rt,at=P(function(e,t,n,r){if(t.scroll){var a,o=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,s=t.scrollSensitivity,l=t.scrollSpeed,c=k(),u=!1;He!==n&&(He=n,tt(),Ge=t.scroll,a=t.scrollFn,!0===Ge&&(Ge=L(n,!0)));var d=0,f=Ge;do{var m=f,p=j(m),h=p.top,g=p.bottom,w=p.left,y=p.right,b=p.width,v=p.height,x=void 0,_=void 0,E=m.scrollWidth,N=m.scrollHeight,I=M(m),S=m.scrollLeft,D=m.scrollTop;m===c?(x=b<E&&("auto"===I.overflowX||"scroll"===I.overflowX||"visible"===I.overflowX),_=v<N&&("auto"===I.overflowY||"scroll"===I.overflowY||"visible"===I.overflowY)):(x=b<E&&("auto"===I.overflowX||"scroll"===I.overflowX),_=v<N&&("auto"===I.overflowY||"scroll"===I.overflowY));var C=x&&(Math.abs(y-o)<=s&&S+b<E)-(Math.abs(w-o)<=s&&!!S),A=_&&(Math.abs(g-i)<=s&&D+v<N)-(Math.abs(h-i)<=s&&!!D);if(!Ke[d])for(var T=0;T<=d;T++)Ke[T]||(Ke[T]={});Ke[d].vx==C&&Ke[d].vy==A&&Ke[d].el===m||(Ke[d].el=m,Ke[d].vx=C,Ke[d].vy=A,clearInterval(Ke[d].pid),0==C&&0==A||(u=!0,Ke[d].pid=setInterval(function(){r&&0===this.layer&&Be.active._onTouchMove(qe);var t=Ke[this.layer].vy?Ke[this.layer].vy*l:0,n=Ke[this.layer].vx?Ke[this.layer].vx*l:0;"function"==typeof a&&"continue"!==a.call(Be.dragged.parentNode[Y],n,t,e,qe,Ke[this.layer].el)||R(Ke[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==c&&(f=L(f,!1)));et=u}},30),ot=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,a=e.activeSortable,o=e.dispatchSortableEvent,i=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var l=n||a;i();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(c.clientX,c.clientY);s(),l&&!l.el.contains(u)&&(o("spill"),this.onSpill({dragEl:r,putSortable:n}))}};function it(){}function st(){}function lt(){function e(){this.defaults={swapClass:"sortable-swap-highlight"}}return e.prototype={dragStart:function(e){var t=e.dragEl;rt=t},dragOverValid:function(e){var t=e.completed,n=e.target,r=e.onMove,a=e.activeSortable,o=e.changed,i=e.cancel;if(a.options.swap){var s=this.sortable.el,l=this.options;if(n&&n!==s){var c=rt;!1!==r(n)?(N(n,l.swapClass,!0),rt=n):rt=null,c&&c!==rt&&N(c,l.swapClass,!1)}o(),t(!0),i()}},drop:function(e){var t,n,r,a,o,i,s=e.activeSortable,l=e.putSortable,c=e.dragEl,u=l||this.sortable,d=this.options;rt&&N(rt,d.swapClass,!1),rt&&(d.swap||l&&l.options.swap)&&c!==rt&&(u.captureAnimationState(),u!==s&&s.captureAnimationState(),n=rt,o=(t=c).parentNode,i=n.parentNode,o&&i&&!o.isEqualNode(n)&&!i.isEqualNode(t)&&(r=T(t),a=T(n),o.isEqualNode(i)&&r<a&&a++,o.insertBefore(n,o.children[r]),i.insertBefore(t,i.children[a])),u.animateAll(),u!==s&&s.animateAll())},nulling:function(){rt=null}},s(e,{pluginName:"swap",eventProperties:function(){return{swapItem:rt}}})}it.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=C(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:ot},s(it,{pluginName:"revertOnSpill"}),st.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:ot},s(st,{pluginName:"removeOnSpill"});var ct,ut,dt,ft,mt,pt=[],ht=[],gt=!1,wt=!1,yt=!1;function bt(){function e(e){for(var t in this)"_"===t.charAt(0)&&"function"==typeof this[t]&&(this[t]=this[t].bind(this));e.options.supportPointer?w(document,"pointerup",this._deselectMultiDrag):(w(document,"mouseup",this._deselectMultiDrag),w(document,"touchend",this._deselectMultiDrag)),w(document,"keydown",this._checkKeyDown),w(document,"keyup",this._checkKeyUp),this.defaults={selectedClass:"sortable-selected",multiDragKey:null,setData:function(t,n){var r="";pt.length&&ut===e?pt.forEach(function(e,t){r+=(t?", ":"")+e.textContent}):r=n.textContent,t.setData("Text",r)}}}return e.prototype={multiDragKeyDown:!1,isMultiDrag:!1,delayStartGlobal:function(e){var t=e.dragEl;dt=t},delayEnded:function(){this.isMultiDrag=~pt.indexOf(dt)},setupClone:function(e){var t=e.sortable,n=e.cancel;if(this.isMultiDrag){for(var r=0;r<pt.length;r++)ht.push(U(pt[r])),ht[r].sortableIndex=pt[r].sortableIndex,ht[r].draggable=!1,ht[r].style["will-change"]="",N(ht[r],this.options.selectedClass,!1),pt[r]===dt&&N(ht[r],this.options.chosenClass,!1);t._hideClone(),n()}},clone:function(e){var t=e.sortable,n=e.rootEl,r=e.dispatchSortableEvent,a=e.cancel;this.isMultiDrag&&(this.options.removeCloneOnHide||pt.length&&ut===t&&(vt(!0,n),r("clone"),a()))},showClone:function(e){var t=e.cloneNowShown,n=e.rootEl,r=e.cancel;this.isMultiDrag&&(vt(!1,n),ht.forEach(function(e){M(e,"display","")}),t(),mt=!1,r())},hideClone:function(e){var t=this,n=(e.sortable,e.cloneNowHidden),r=e.cancel;this.isMultiDrag&&(ht.forEach(function(e){M(e,"display","none"),t.options.removeCloneOnHide&&e.parentNode&&e.parentNode.removeChild(e)}),n(),mt=!0,r())},dragStartGlobal:function(e){e.sortable,!this.isMultiDrag&&ut&&ut.multiDrag._deselectMultiDrag(),pt.forEach(function(e){e.sortableIndex=T(e)}),pt=pt.sort(function(e,t){return e.sortableIndex-t.sortableIndex}),yt=!0},dragStarted:function(e){var t=this,n=e.sortable;if(this.isMultiDrag){if(this.options.sort&&(n.captureAnimationState(),this.options.animation)){pt.forEach(function(e){e!==dt&&M(e,"position","absolute")});var r=j(dt,!1,!0,!0);pt.forEach(function(e){e!==dt&&B(e,r)}),wt=!0,gt=!0}n.animateAll(function(){wt=!1,gt=!1,t.options.animation&&pt.forEach(function(e){F(e)}),t.options.sort&&xt()})}},dragOver:function(e){var t=e.target,n=e.completed,r=e.cancel;wt&&~pt.indexOf(t)&&(n(!1),r())},revert:function(e){var t=e.fromSortable,n=e.rootEl,r=e.sortable,a=e.dragRect;pt.length>1&&(pt.forEach(function(e){r.addAnimationState({target:e,rect:wt?j(e):a}),F(e),e.fromRect=a,t.removeAnimationState(e)}),wt=!1,function(e,t){pt.forEach(function(n,r){var a=t.children[n.sortableIndex+(e?Number(r):0)];a?t.insertBefore(n,a):t.appendChild(n)})}(!this.options.removeCloneOnHide,n))},dragOverCompleted:function(e){var t=e.sortable,n=e.isOwner,r=e.insertion,a=e.activeSortable,o=e.parentEl,i=e.putSortable,s=this.options;if(r){if(n&&a._hideClone(),gt=!1,s.animation&&pt.length>1&&(wt||!n&&!a.options.sort&&!i)){var l=j(dt,!1,!0,!0);pt.forEach(function(e){e!==dt&&(B(e,l),o.appendChild(e))}),wt=!0}if(!n)if(wt||xt(),pt.length>1){var c=mt;a._showClone(t),a.options.animation&&!mt&&c&&ht.forEach(function(e){a.addAnimationState({target:e,rect:ft}),e.fromRect=ft,e.thisAnimationDuration=null})}else a._showClone(t)}},dragOverAnimationCapture:function(e){var t=e.dragRect,n=e.isOwner,r=e.activeSortable;if(pt.forEach(function(e){e.thisAnimationDuration=null}),r.options.animation&&!n&&r.multiDrag.isMultiDrag){ft=s({},t);var a=I(dt,!0);ft.top-=a.f,ft.left-=a.e}},dragOverAnimationComplete:function(){wt&&(wt=!1,xt())},drop:function(e){var t=e.originalEvent,n=e.rootEl,r=e.parentEl,a=e.sortable,o=e.dispatchSortableEvent,i=e.oldIndex,s=e.putSortable,l=s||this.sortable;if(t){var c=this.options,u=r.children;if(!yt)if(c.multiDragKey&&!this.multiDragKeyDown&&this._deselectMultiDrag(),N(dt,c.selectedClass,!~pt.indexOf(dt)),~pt.indexOf(dt))pt.splice(pt.indexOf(dt),1),ct=null,Z({sortable:a,rootEl:n,name:"deselect",targetEl:dt,originalEvt:t});else{if(pt.push(dt),Z({sortable:a,rootEl:n,name:"select",targetEl:dt,originalEvt:t}),t.shiftKey&&ct&&a.el.contains(ct)){var d,f,m=T(ct),p=T(dt);if(~m&&~p&&m!==p)for(p>m?(f=m,d=p):(f=p,d=m+1);f<d;f++)~pt.indexOf(u[f])||(N(u[f],c.selectedClass,!0),pt.push(u[f]),Z({sortable:a,rootEl:n,name:"select",targetEl:u[f],originalEvt:t}))}else ct=dt;ut=l}if(yt&&this.isMultiDrag){if(wt=!1,(r[Y].options.sort||r!==n)&&pt.length>1){var h=j(dt),g=T(dt,":not(."+this.options.selectedClass+")");if(!gt&&c.animation&&(dt.thisAnimationDuration=null),l.captureAnimationState(),!gt&&(c.animation&&(dt.fromRect=h,pt.forEach(function(e){if(e.thisAnimationDuration=null,e!==dt){var t=wt?j(e):h;e.fromRect=t,l.addAnimationState({target:e,rect:t})}})),xt(),pt.forEach(function(e){u[g]?r.insertBefore(e,u[g]):r.appendChild(e),g++}),i===T(dt))){var w=!1;pt.forEach(function(e){e.sortableIndex===T(e)||(w=!0)}),w&&o("update")}pt.forEach(function(e){F(e)}),l.animateAll()}ut=l}(n===r||s&&"clone"!==s.lastPutMode)&&ht.forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)})}},nullingGlobal:function(){this.isMultiDrag=yt=!1,ht.length=0},destroyGlobal:function(){this._deselectMultiDrag(),y(document,"pointerup",this._deselectMultiDrag),y(document,"mouseup",this._deselectMultiDrag),y(document,"touchend",this._deselectMultiDrag),y(document,"keydown",this._checkKeyDown),y(document,"keyup",this._checkKeyUp)},_deselectMultiDrag:function(e){if(!(void 0!==yt&&yt||ut!==this.sortable||e&&x(e.target,this.options.draggable,this.sortable.el,!1)||e&&0!==e.button))for(;pt.length;){var t=pt[0];N(t,this.options.selectedClass,!1),pt.shift(),Z({sortable:this.sortable,rootEl:this.sortable.el,name:"deselect",targetEl:t,originalEvt:e})}},_checkKeyDown:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!0)},_checkKeyUp:function(e){e.key===this.options.multiDragKey&&(this.multiDragKeyDown=!1)}},s(e,{pluginName:"multiDrag",utils:{select:function(e){var t=e.parentNode[Y];t&&t.options.multiDrag&&!~pt.indexOf(e)&&(ut&&ut!==t&&(ut.multiDrag._deselectMultiDrag(),ut=t),N(e,t.options.selectedClass,!0),pt.push(e))},deselect:function(e){var t=e.parentNode[Y],n=pt.indexOf(e);t&&t.options.multiDrag&&~n&&(N(e,t.options.selectedClass,!1),pt.splice(n,1))}},eventProperties:function(){var e,t=this,n=[],r=[];return pt.forEach(function(e){var a;n.push({multiDragElement:e,index:e.sortableIndex}),a=wt&&e!==dt?-1:wt?T(e,":not(."+t.options.selectedClass+")"):T(e),r.push({multiDragElement:e,index:a})}),{items:(e=pt,function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),clones:[].concat(ht),oldIndicies:n,newIndicies:r}},optionListeners:{multiDragKey:function(e){return"ctrl"===(e=e.toLowerCase())?e="Control":e.length>1&&(e=e.charAt(0).toUpperCase()+e.substr(1)),e}}})}function vt(e,t){ht.forEach(function(n,r){var a=t.children[n.sortableIndex+(e?Number(r):0)];a?t.insertBefore(n,a):t.appendChild(n)})}function xt(){pt.forEach(function(e){e!==dt&&e.parentNode&&e.parentNode.removeChild(e)})}Be.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?w(document,"dragover",this._handleAutoScroll):this.options.supportPointer?w(document,"pointermove",this._handleFallbackAutoScroll):t.touches?w(document,"touchmove",this._handleFallbackAutoScroll):w(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?y(document,"dragover",this._handleAutoScroll):(y(document,"pointermove",this._handleFallbackAutoScroll),y(document,"touchmove",this._handleFallbackAutoScroll),y(document,"mousemove",this._handleFallbackAutoScroll)),nt(),tt(),clearTimeout(_),_=void 0},nulling:function(){qe=He=Ge=et=Je=$e=Xe=null,Ke.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,o=document.elementFromPoint(r,a);if(qe=e,t||this.options.forceAutoScrollFallback||d||u||m){at(e,this.options,o,t);var i=L(o,!0);!et||Je&&r===$e&&a===Xe||(Je&&nt(),Je=setInterval(function(){var o=L(document.elementFromPoint(r,a),!0);o!==i&&(i=o,tt()),at(e,n.options,o,t)},10),$e=r,Xe=a)}else{if(!this.options.bubbleScroll||L(o,!0)===k())return void tt();at(e,this.options,L(o,!1),!1)}}},s(e,{pluginName:"scroll",initializeByDefault:!0})}),Be.mount(st,it);const _t=Be},5229(e,t,n){"use strict";var r=(this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(n(1133)),a=n(8917);function o(e,t){var n={};return e&&"string"==typeof e?((0,r.default)(e,function(e,r){e&&r&&(n[(0,a.camelCase)(e,t)]=r)}),n):n}o.default=o,e.exports=o},8917(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.camelCase=void 0;var n=/^--[a-zA-Z0-9_-]+$/,r=/-([a-z])/g,a=/^[^-]+$/,o=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(e,t){return t.toUpperCase()},l=function(e,t){return"".concat(t,"-")};t.camelCase=function(e,t){return void 0===t&&(t={}),function(e){return!e||a.test(e)||n.test(e)}(e)?e:(e=e.toLowerCase(),(e=t.reactCompat?e.replace(i,l):e.replace(o,l)).replace(r,s))}},1133(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){let n=null;if(!e||"string"!=typeof e)return n;const r=(0,a.default)(e),o="function"==typeof t;return r.forEach(e=>{if("declaration"!==e.type)return;const{property:r,value:a}=e;o?t(r,a,e):a&&(n=n||{},n[r]=a)}),n};const a=r(n(5077))},7676(e){"use strict";e.exports=function(e,t){if(!e)throw new Error("Invariant failed")}},7573(e,t,n){"use strict";n.r(t),n.d(t,{default:()=>r});const r=function(e,t){}},8493(e,t,n){"use strict";var r=n(1609),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useState,i=r.useEffect,s=r.useLayoutEffect,l=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!a(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=o({inst:{value:n,getSnapshot:t}}),a=r[0].inst,u=r[1];return s(function(){a.value=n,a.getSnapshot=t,c(a)&&u({inst:a})},[e,n,t]),i(function(){return c(a)&&u({inst:a}),e(function(){c(a)&&u({inst:a})})},[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},2162(e,t,n){"use strict";var r=n(1609),a=n(9888),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=a.useSyncExternalStore,s=r.useRef,l=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,a){var d=s(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!l){if(l=!0,i=e,e=r(e),void 0!==a&&f.hasValue){var t=f.value;if(a(t,e))return s=t}return s=e}if(t=s,o(i,e))return t;var n=r(e);return void 0!==a&&a(t,n)?(i=e,t):(i=e,s=n)}var i,s,l=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]},[t,n,r,a]);var m=i(e,d[0],d[1]);return l(function(){f.hasValue=!0,f.value=m},[m]),u(m),m}},2779(e,t,n){"use strict";var r=n(1609),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=r.useSyncExternalStore,i=r.useRef,s=r.useEffect,l=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=i(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!s){if(s=!0,o=e,e=r(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return i=t}return i=e}if(t=i,a(o,e))return t;var n=r(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,i=n)}var o,i,s=!1,l=void 0===n?null:n;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,n,r,u]);var m=o(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=m},[m]),c(m),m}},9888(e,t,n){"use strict";e.exports=n(8493)},9242(e,t,n){"use strict";e.exports=n(2162)},8418(e,t,n){"use strict";e.exports=n(2779)},8783(e,t,n){"use strict";function r(e){return e.valueOf?e.valueOf():Object.prototype.valueOf.call(e)}n.d(t,{A:()=>a});const a=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every(function(t,r){return e(t,n[r])});if("object"==typeof t||"object"==typeof n){var a=r(t),o=r(n);return a!==t||o!==n?e(a,o):Object.keys(Object.assign({},t,n)).every(function(r){return e(t[r],n[r])})}return!1}},1609(e){"use strict";e.exports=window.React},1455(e){"use strict";e.exports=window.wp.apiFetch},6942(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=i(e,o(n)))}return e}function o(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)r.call(e,n)&&e[n]&&(t=i(t,n));return t}function i(e,t){return t?e?e+" "+t:e+t:e}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},8168(e,t,n){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},r.apply(null,arguments)}n.d(t,{A:()=>r})},7387(e,t,n){"use strict";n.d(t,{A:()=>a});var r=n(3662);function a(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,(0,r.A)(e,t)}},8587(e,t,n){"use strict";function r(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}n.d(t,{A:()=>r})},3662(e,t,n){"use strict";function r(e,t){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},r(e,t)}n.d(t,{A:()=>r})},1561(e,t,n){"use strict";n.d(t,{A:()=>r});function r(e,t){if(!e)throw new Error("Invariant failed")}}},r={};function a(e){var t=r[e];if(void 0!==t)return t.exports;var o=r[e]={id:e,loaded:!1,exports:{}};return n[e].call(o.exports,o,o.exports,a),o.loaded=!0,o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},t=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var o=Object.create(null);a.r(o);var i={};e=e||[null,t({}),t([]),t(t)];for(var s=2&r&&n;("object"==typeof s||"function"==typeof s)&&!~e.indexOf(s);s=t(s))Object.getOwnPropertyNames(s).forEach(e=>i[e]=()=>n[e]);return i.default=()=>n,a.d(o,i),o},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;globalThis.importScripts&&(e=globalThis.location+"");var t=globalThis.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=e})(),(()=>{"use strict";var e={};a.r(e),a.d(e,{scaleBand:()=>Av,scaleDiverging:()=>rI,scaleDivergingLog:()=>aI,scaleDivergingPow:()=>iI,scaleDivergingSqrt:()=>sI,scaleDivergingSymlog:()=>oI,scaleIdentity:()=>eE,scaleImplicit:()=>Dv,scaleLinear:()=>K_,scaleLog:()=>cE,scaleOrdinal:()=>Cv,scalePoint:()=>Ov,scalePow:()=>yE,scaleQuantile:()=>kE,scaleQuantize:()=>jE,scaleRadial:()=>xE,scaleSequential:()=>XM,scaleSequentialLog:()=>qM,scaleSequentialPow:()=>KM,scaleSequentialQuantile:()=>tI,scaleSequentialSqrt:()=>eI,scaleSequentialSymlog:()=>JM,scaleSqrt:()=>bE,scaleSymlog:()=>mE,scaleThreshold:()=>DE,scaleTime:()=>ZM,scaleUtc:()=>GM,tickFormat:()=>q_});var t={};a.r(t),a.d(t,{Button:()=>qB,CaptionLabel:()=>JB,Chevron:()=>KB,Day:()=>eF,DayButton:()=>tF,Dropdown:()=>nF,DropdownNav:()=>rF,Footer:()=>aF,Month:()=>oF,MonthCaption:()=>iF,MonthGrid:()=>sF,Months:()=>lF,MonthsDropdown:()=>cF,Nav:()=>uF,NextMonthButton:()=>dF,Option:()=>fF,PreviousMonthButton:()=>mF,Root:()=>pF,Select:()=>hF,Week:()=>gF,WeekNumber:()=>bF,WeekNumberHeader:()=>vF,Weekday:()=>wF,Weekdays:()=>yF,Weeks:()=>xF,YearsDropdown:()=>_F});var n={};a.r(n),a.d(n,{formatCaption:()=>NF,formatDay:()=>IF,formatMonthCaption:()=>MF,formatMonthDropdown:()=>SF,formatWeekNumber:()=>jF,formatWeekNumberHeader:()=>DF,formatWeekdayName:()=>kF,formatYearCaption:()=>AF,formatYearDropdown:()=>CF});var r={};a.r(r),a.d(r,{labelCaption:()=>zF,labelDay:()=>OF,labelDayButton:()=>TF,labelGrid:()=>LF,labelGridcell:()=>PF,labelMonthDropdown:()=>RF,labelNav:()=>UF,labelNext:()=>FF,labelPrevious:()=>YF,labelWeekNumber:()=>VF,labelWeekNumberHeader:()=>WF,labelWeekday:()=>QF,labelYearDropdown:()=>ZF});const o=window.wp.element;var i=a(1609),s=a.t(i,2),l=a.n(i);const c=(0,i.createContext)(),u=({reducer:e,initialState:t,children:n})=>(0,o.createElement)(c.Provider,{value:(0,i.useReducer)(e,t)},n),d=()=>(0,i.useContext)(c),f=cartflows_admin?.page_builder?cartflows_admin.page_builder:"other",m={is_cf_pro:!!cartflows_admin?.is_pro,admin_url:"test_url",flows_data:null,flows_pagination:{},setup_checklist_data:null,flows_limit_over:!1,globaldata:[],page_builder:f,active_flows_count:"",trash_flows_count:"",draft_flows_count:"",found_posts:"",flows_count:"",analyticsData:null,publishedFlows:null,suretriggers_config:[],page_builder_group_data:cartflows_admin.required_plugins,page_builder_group:cartflows_admin.required_plugins[f],options:[]},p=(e,t)=>{switch(t.type){case"SET_FLOWS":return t.flows?{...e,flows_data:[...t.flows]}:{...e,flows_data:t.flows};case"SET_FLOWS_DATA":return{...e,flows_data:[...t.flows],flows_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,flows_count:t.found_posts,flows_limit_over:!1};case"SET_SETTINGS":return{...e,globaldata:t.commondata,options:t.commondata.options};case"SET_PAGE_BUILDER":return{...e,page_builder:t.pagebuilder};case"SET_ANALYTICS_DATA":return{...e,analyticsData:t.analyticsData};case"SET_PUBLISHED_FLOWS":return{...e,publishedFlows:t.publishedFlows};case"SET_OPTION":const n=e.options;return n[t.name]=t.value,{...e,options:n};case"SET_SURETRIGGERS_CONFIG":return t.config&&setSureTriggersConfig(t.config),{...e,suretriggers_config:t};case"SET_SETUP_CHECKLIST_DATA":return{...e,setup_checklist_data:t.setup_checklist};default:return e}},h=(0,i.createContext)(),g=()=>(0,i.useContext)(h);var w;const y={settingsProcess:!1,unsavedChanges:!1,page_builder:cartflows_admin?.page_builder?cartflows_admin.page_builder:"other",license_status:null!==(w=cartflows_admin?.license_status)&&void 0!==w?w:"",canvasMode:(()=>{try{return"true"===localStorage.getItem("wcf_canvas_mode_enabled")}catch(e){return!1}})()};a(5146);var b=a(6347),v=a(7387),x=a(4499),_=a(8168),E=a(8587),N=a(1561),M=function(e){function t(){for(var t,n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return(t=e.call.apply(e,[this].concat(r))||this).history=(0,x.createBrowserHistory)(t.props),t}return(0,v.A)(t,e),t.prototype.render=function(){return l().createElement(b.Router,{history:this.history,children:this.props.children})},t}(l().Component);l().Component;var I=function(e,t){return"function"==typeof e?e(t):e},S=function(e,t){return"string"==typeof e?(0,x.createLocation)(e,null,null,t):e},k=function(e){return e},j=l().forwardRef;void 0===j&&(j=k);var D=j(function(e,t){var n=e.innerRef,r=e.navigate,a=e.onClick,o=(0,E.A)(e,["innerRef","navigate","onClick"]),i=o.target,s=(0,_.A)({},o,{onClick:function(e){try{a&&a(e)}catch(t){throw e.preventDefault(),t}e.defaultPrevented||0!==e.button||i&&"_self"!==i||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e)||(e.preventDefault(),r())}});return s.ref=k!==j&&t||n,l().createElement("a",s)}),C=j(function(e,t){var n=e.component,r=void 0===n?D:n,a=e.replace,o=e.to,i=e.innerRef,s=(0,E.A)(e,["component","replace","to","innerRef"]);return l().createElement(b.__RouterContext.Consumer,null,function(e){e||(0,N.A)(!1);var n=e.history,c=S(I(o,e.location),e.location),u=c?n.createHref(c):"",d=(0,_.A)({},s,{href:u,navigate:function(){var t=I(o,e.location),r=(0,x.createPath)(e.location)===(0,x.createPath)(S(t));(a||r?n.replace:n.push)(t)}});return k!==j?d.ref=t||i:d.innerRef=i,l().createElement(r,d)})}),A=function(e){return e},T=l().forwardRef;void 0===T&&(T=A),T(function(e,t){var n=e["aria-current"],r=void 0===n?"page":n,a=e.activeClassName,o=void 0===a?"active":a,i=e.activeStyle,s=e.className,c=e.exact,u=e.isActive,d=e.location,f=e.sensitive,m=e.strict,p=e.style,h=e.to,g=e.innerRef,w=(0,E.A)(e,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return l().createElement(b.__RouterContext.Consumer,null,function(e){e||(0,N.A)(!1);var n=d||e.location,a=S(I(h,n),n),y=a.pathname,v=y&&y.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),x=v?(0,b.matchPath)(n.pathname,{path:v,exact:c,sensitive:f,strict:m}):null,E=!!(u?u(x,n):x),M="function"==typeof s?s(E):s,k="function"==typeof p?p(E):p;E&&(M=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(function(e){return e}).join(" ")}(M,o),k=(0,_.A)({},k,i));var j=(0,_.A)({"aria-current":E&&r||null,className:M,style:k,to:a},w);return A!==T?j.ref=t||g:j.innerRef=g,l().createElement(C,j)})});var O=a(1455),L=a.n(O);const z=window.wp.i18n;var P=a(4848);const R=e=>{const t=Y(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{const n=e.split("-");return""===n[0]&&1!==n.length&&n.shift(),U(n,t)||F(e)},getConflictingClassGroupIds:(e,t)=>{const a=n[e]||[];return t&&r[e]?[...a,...r[e]]:a}}},U=(e,t)=>{if(0===e.length)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?U(e.slice(1),r):void 0;if(a)return a;if(0===t.validators.length)return;const o=e.join("-");return t.validators.find(({validator:e})=>e(o))?.classGroupId},B=/^\[(.+)\]$/,F=e=>{if(B.test(e)){const t=B.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Y=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return Z(Object.entries(e.classGroups),n).forEach(([e,n])=>{Q(n,r,e,t)}),r},Q=(e,t,n,r)=>{e.forEach(e=>{if("string"!=typeof e)return"function"==typeof e?W(e)?void Q(e(r),t,n,r):void t.validators.push({validator:e,classGroupId:n}):void Object.entries(e).forEach(([e,a])=>{Q(a,V(t,e),n,r)});(""===e?t:V(t,e)).classGroupId=n})},V=(e,t)=>{let n=e;return t.split("-").forEach(e=>{n.nextPart.has(e)||n.nextPart.set(e,{nextPart:new Map,validators:[]}),n=n.nextPart.get(e)}),n},W=e=>e.isThemeGetter,Z=(e,t)=>t?e.map(([e,n])=>{const r=n.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,n])=>[t+e,n])):e);return[e,r]}):e,G=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(a,o)=>{n.set(a,o),t++,t>e&&(t=0,r=n,n=new Map)};return{get(e){let t=n.get(e);return void 0!==t?t:void 0!==(t=r.get(e))?(a(e,t),t):void 0},set(e,t){n.has(e)?n.set(e,t):a(e,t)}}},H=e=>{const{separator:t,experimentalParseClassName:n}=e,r=1===t.length,a=t[0],o=t.length,i=e=>{const n=[];let i,s=0,l=0;for(let c=0;c<e.length;c++){let u=e[c];if(0===s){if(u===a&&(r||e.slice(c,c+o)===t)){n.push(e.slice(l,c)),l=c+o;continue}if("/"===u){i=c;continue}}"["===u?s++:"]"===u&&s--}const c=0===n.length?e:e.substring(l),u=c.startsWith("!");return{modifiers:n,hasImportantModifier:u,baseClassName:u?c.substring(1):c,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return n?e=>n({className:e,parseClassName:i}):i},$=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(e=>{"["===e[0]?(t.push(...n.sort(),e),n=[]):n.push(e)}),t.push(...n.sort()),t},X=/\s+/;function q(){let e,t,n=0,r="";for(;n<arguments.length;)(e=arguments[n++])&&(t=J(e))&&(r&&(r+=" "),r+=t);return r}const J=e=>{if("string"==typeof e)return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=J(e[r]))&&(n&&(n+=" "),n+=t);return n};function K(e,...t){let n,r,a,o=function(s){const l=t.reduce((e,t)=>t(e),e());return n=(e=>({cache:G(e.cacheSize),parseClassName:H(e),...R(e)}))(l),r=n.cache.get,a=n.cache.set,o=i,i(s)};function i(e){const t=r(e);if(t)return t;const o=((e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,o=[],i=e.trim().split(X);let s="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=n(t);let f=Boolean(d),m=r(f?u.substring(0,d):u);if(!m){if(!f){s=t+(s.length>0?" "+s:s);continue}if(m=r(u),!m){s=t+(s.length>0?" "+s:s);continue}f=!1}const p=$(l).join(":"),h=c?p+"!":p,g=h+m;if(o.includes(g))continue;o.push(g);const w=a(m,f);for(let e=0;e<w.length;++e){const t=w[e];o.push(h+t)}s=t+(s.length>0?" "+s:s)}return s})(e,n);return a(e,o),o}return function(){return o(q.apply(null,arguments))}}const ee=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},te=/^\[(?:([a-z-]+):)?(.+)\]$/i,ne=/^\d+\/\d+$/,re=new Set(["px","full","screen"]),ae=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,se=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,le=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ce=e=>de(e)||re.has(e)||ne.test(e),ue=e=>Ne(e,"length",Me),de=e=>Boolean(e)&&!Number.isNaN(Number(e)),fe=e=>Ne(e,"number",de),me=e=>Boolean(e)&&Number.isInteger(Number(e)),pe=e=>e.endsWith("%")&&de(e.slice(0,-1)),he=e=>te.test(e),ge=e=>ae.test(e),we=new Set(["length","size","percentage"]),ye=e=>Ne(e,we,Ie),be=e=>Ne(e,"position",Ie),ve=new Set(["image","url"]),xe=e=>Ne(e,ve,ke),_e=e=>Ne(e,"",Se),Ee=()=>!0,Ne=(e,t,n)=>{const r=te.exec(e);return!!r&&(r[1]?"string"==typeof t?r[1]===t:t.has(r[1]):n(r[2]))},Me=e=>oe.test(e)&&!ie.test(e),Ie=()=>!1,Se=e=>se.test(e),ke=e=>le.test(e),je=(Symbol.toStringTag,()=>{const e=ee("colors"),t=ee("spacing"),n=ee("blur"),r=ee("brightness"),a=ee("borderColor"),o=ee("borderRadius"),i=ee("borderSpacing"),s=ee("borderWidth"),l=ee("contrast"),c=ee("grayscale"),u=ee("hueRotate"),d=ee("invert"),f=ee("gap"),m=ee("gradientColorStops"),p=ee("gradientColorStopPositions"),h=ee("inset"),g=ee("margin"),w=ee("opacity"),y=ee("padding"),b=ee("saturate"),v=ee("scale"),x=ee("sepia"),_=ee("skew"),E=ee("space"),N=ee("translate"),M=()=>["auto",he,t],I=()=>[he,t],S=()=>["",ce,ue],k=()=>["auto",de,he],j=()=>["","0",he],D=()=>[de,he];return{cacheSize:500,separator:":",theme:{colors:[Ee],spacing:[ce,ue],blur:["none","",ge,he],brightness:D(),borderColor:[e],borderRadius:["none","","full",ge,he],borderSpacing:I(),borderWidth:S(),contrast:D(),grayscale:j(),hueRotate:D(),invert:j(),gap:I(),gradientColorStops:[e],gradientColorStopPositions:[pe,ue],inset:M(),margin:M(),opacity:D(),padding:I(),saturate:D(),scale:D(),sepia:j(),skew:D(),space:I(),translate:I()},classGroups:{aspect:[{aspect:["auto","square","video",he]}],container:["container"],columns:[{columns:[ge]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",he]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",me,he]}],basis:[{basis:M()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",he]}],grow:[{grow:j()}],shrink:[{shrink:j()}],order:[{order:["first","last","none",me,he]}],"grid-cols":[{"grid-cols":[Ee]}],"col-start-end":[{col:["auto",{span:["full",me,he]},he]}],"col-start":[{"col-start":k()}],"col-end":[{"col-end":k()}],"grid-rows":[{"grid-rows":[Ee]}],"row-start-end":[{row:["auto",{span:[me,he]},he]}],"row-start":[{"row-start":k()}],"row-end":[{"row-end":k()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",he]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",he]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[y]}],px:[{px:[y]}],py:[{py:[y]}],ps:[{ps:[y]}],pe:[{pe:[y]}],pt:[{pt:[y]}],pr:[{pr:[y]}],pb:[{pb:[y]}],pl:[{pl:[y]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",he,t]}],"min-w":[{"min-w":[he,t,"min","max","fit"]}],"max-w":[{"max-w":[he,t,"none","full","min","max","fit","prose",{screen:[ge]},ge]}],h:[{h:[he,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[he,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[he,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[he,t,"auto","min","max","fit"]}],"font-size":[{text:["base",ge,ue]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",fe]}],"font-family":[{font:[Ee]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",he]}],"line-clamp":[{"line-clamp":["none",de,fe]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ce,he]}],"list-image":[{"list-image":["none",he]}],"list-style-type":[{list:["none","disc","decimal",he]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ce,ue]}],"underline-offset":[{"underline-offset":["auto",ce,he]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",he]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",he]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",be]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",ye]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xe]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[p]}],"gradient-via-pos":[{via:[p]}],"gradient-to-pos":[{to:[p]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[ce,he]}],"outline-w":[{outline:[ce,ue]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:S()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[ce,ue]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",ge,_e]}],"shadow-color":[{shadow:[Ee]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",ge,he]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[b]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[b]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",he]}],duration:[{duration:D()}],ease:[{ease:["linear","in","out","in-out",he]}],delay:[{delay:D()}],animate:[{animate:["none","spin","ping","pulse","bounce",he]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[v]}],"scale-x":[{"scale-x":[v]}],"scale-y":[{"scale-y":[v]}],rotate:[{rotate:[me,he]}],"translate-x":[{"translate-x":[N]}],"translate-y":[{"translate-y":[N]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",he]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",he]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",he]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ce,ue,fe]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}}),De=K(je);function Ce(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Ce(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ae(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Ce(e))&&(r&&(r+=" "),r+=t);return r}const Te=Ae,Oe=(...e)=>De(Ae(...e)),Le=(...e)=>(...t)=>e.filter(Boolean).forEach(e=>e?.(...t)),ze=e=>{const t={0:"gap-0",xxs:"gap-1",xs:"gap-2",sm:"gap-3",md:"gap-4",lg:"gap-5",xl:"gap-6","2xl":"gap-8"};return t[e]||t.md},Pe={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},Re=()=>{const e=window.navigator?.userAgentData?.platform||window.navigator.platform;let t="null";return["macOS","Macintosh","MacIntel","MacPPC","Mac68K"].includes(e)?t="Mac OS":["Win32","Win64","Windows","WinCE"].includes(e)&&(t="Windows"),t},Ue=(e,t)=>{if(!(typeof window>"u"))try{localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(e)}},Be=e=>{if(typeof window>"u")return null;try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch(e){return console.error(e),null}},Fe=({children:e,gap:t="lg",className:n,...r})=>(0,P.jsx)("div",{className:Oe("w-full box-border flex items-center justify-between bg-background-primary p-5 min-h-16",ze(t),n),...r,children:e});Fe.displayName="Topbar";const Ye=({gap:e="sm",children:t,className:n})=>(0,P.jsx)("div",{className:Oe("flex items-center",ze(e),n),children:t});Ye.displayName="Topbar.Left";const Qe=({gap:e="md",children:t,align:n="center",className:r})=>{const a={left:"justify-start",center:"justify-center",right:"justify-end"}[n];return(0,P.jsx)("div",{className:Oe("flex items-center grow",ze(e),a,r),children:t})};Qe.displayName="Topbar.Middle";const Ve=({gap:e="sm",children:t,className:n})=>(0,P.jsx)("div",{className:Oe("flex items-center",ze(e),n),children:t});Ve.displayName="Topbar.Right";const We=({children:e,className:t})=>(0,P.jsx)("div",{className:Oe("flex items-center [&>svg]:block h-full",t),children:e});function Ze(){return"undefined"!=typeof window}function Ge(e){return Xe(e)?(e.nodeName||"").toLowerCase():"#document"}function He(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function $e(e){var t;return null==(t=(Xe(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Xe(e){return!!Ze()&&(e instanceof Node||e instanceof He(e).Node)}function qe(e){return!!Ze()&&(e instanceof Element||e instanceof He(e).Element)}function Je(e){return!!Ze()&&(e instanceof HTMLElement||e instanceof He(e).HTMLElement)}function Ke(e){return!(!Ze()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof He(e).ShadowRoot)}function et(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ut(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&"inline"!==a&&"contents"!==a}function tt(e){return/^(table|td|th)$/.test(Ge(e))}function nt(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}We.displayName="Topbar.Item",Fe.Left=Ye,Fe.Middle=Qe,Fe.Right=Ve,Fe.Item=We;const rt=/transform|translate|scale|rotate|perspective|filter/,at=/paint|layout|strict|content/,ot=e=>!!e&&"none"!==e;let it;function st(e){const t=qe(e)?ut(e):e;return ot(t.transform)||ot(t.translate)||ot(t.scale)||ot(t.rotate)||ot(t.perspective)||!lt()&&(ot(t.backdropFilter)||ot(t.filter))||rt.test(t.willChange||"")||at.test(t.contain||"")}function lt(){return null==it&&(it="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),it}function ct(e){return/^(html|body|#document)$/.test(Ge(e))}function ut(e){return He(e).getComputedStyle(e)}function dt(e){return qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ft(e){if("html"===Ge(e))return e;const t=e.assignedSlot||e.parentNode||Ke(e)&&e.host||$e(e);return Ke(t)?t.host:t}function mt(e){const t=ft(e);return ct(t)?e.ownerDocument?e.ownerDocument.body:e.body:Je(t)&&et(t)?t:mt(t)}function pt(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const a=mt(e),o=a===(null==(r=e.ownerDocument)?void 0:r.body),i=He(a);if(o){const e=ht(i);return t.concat(i,i.visualViewport||[],et(a)?a:[],e&&n?pt(e):[])}return t.concat(a,pt(a,[],n))}function ht(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gt(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function wt(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ke(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function yt(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function bt(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+"/"+n}).join(" "):navigator.userAgent}function vt(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Et()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function xt(e){return!bt().includes("jsdom/")&&(!Et()&&0===e.width&&0===e.height||Et()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function _t(){return/apple/i.test(navigator.vendor)}function Et(){const e=/android/i;return e.test(yt())||e.test(bt())}function Nt(){return yt().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function Mt(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function It(e){return(null==e?void 0:e.ownerDocument)||document}function St(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function kt(e){return"composedPath"in e?e.composedPath()[0]:e.target}function jt(e){return Je(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function Dt(e){e.preventDefault(),e.stopPropagation()}function Ct(e){return!!e&&"combobox"===e.getAttribute("role")&&jt(e)}const At=Math.min,Tt=Math.max,Ot=Math.round,Lt=Math.floor,zt=e=>({x:e,y:e}),Pt={left:"right",right:"left",bottom:"top",top:"bottom"};function Rt(e,t,n){return Tt(e,At(t,n))}function Ut(e,t){return"function"==typeof e?e(t):e}function Bt(e){return e.split("-")[0]}function Ft(e){return e.split("-")[1]}function Yt(e){return"x"===e?"y":"x"}function Qt(e){return"y"===e?"height":"width"}function Vt(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function Wt(e){return Yt(Vt(e))}function Zt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Gt=["left","right"],Ht=["right","left"],$t=["top","bottom"],Xt=["bottom","top"];function qt(e){const t=Bt(e);return Pt[t]+e.slice(t.length)}function Jt(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Kt(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}var en=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"].join(","),tn="undefined"==typeof Element,nn=tn?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,rn=!tn&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},an=function(e,t){var n;void 0===t&&(t=!0);var r=null==e||null===(n=e.getAttribute)||void 0===n?void 0:n.call(e,"inert");return""===r||"true"===r||t&&e&&("function"==typeof e.closest?e.closest("[inert]"):an(e.parentNode))},on=function(e,t,n){for(var r=[],a=Array.from(e);a.length;){var o=a.shift();if(!an(o,!1))if("SLOT"===o.tagName){var i=o.assignedElements(),s=i.length?i:o.children,l=on(s,!0,n);n.flatten?r.push.apply(r,l):r.push({scopeParent:o,candidates:l})}else{nn.call(o,en)&&n.filter(o)&&(t||!e.includes(o))&&r.push(o);var c=o.shadowRoot||"function"==typeof n.getShadowRoot&&n.getShadowRoot(o),u=!an(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(o));if(c&&u){var d=on(!0===c?o.children:c.children,!0,n);n.flatten?r.push.apply(r,d):r.push({scopeParent:o,candidates:d})}else a.unshift.apply(a,o.children)}}return r},sn=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},ln=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!sn(e)?0:e.tabIndex},cn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},un=function(e){return"INPUT"===e.tagName},dn=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},fn=function(e,t){return!(t.disabled||function(e){return un(e)&&"hidden"===e.type}(t)||function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("full-native"===n&&"checkVisibility"in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});if("hidden"===getComputedStyle(e).visibility)return!0;var a=nn.call(e,"details>summary:first-of-type")?e.parentElement:e;if(nn.call(a,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"full-native"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return dn(e)}else{if("function"==typeof r){for(var o=e;e;){var i=e.parentElement,s=rn(e);if(i&&!i.shadowRoot&&!0===r(i))return dn(e);e=e.assignedSlot?e.assignedSlot:i||s===e.ownerDocument?i:s.host}e=o}if(function(e){var t,n,r,a,o=e&&rn(e),i=null===(t=o)||void 0===t?void 0:t.host,s=!1;if(o&&o!==e)for(s=!!(null!==(n=i)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(i)||null!=e&&null!==(a=e.ownerDocument)&&void 0!==a&&a.contains(e));!s&&i;){var l,c,u;s=!(null===(c=i=null===(l=o=rn(i))||void 0===l?void 0:l.host)||void 0===c||null===(u=c.ownerDocument)||void 0===u||!u.contains(i))}return s}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1}(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some(function(e){return"SUMMARY"===e.tagName})}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!nn.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},mn=function(e,t){return!(function(e){return function(e){return un(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||rn(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var a=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!a||a===e}(e)}(t)||ln(t)<0||!fn(e,t))},pn=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},hn=function(e){var t=[],n=[];return e.forEach(function(e,r){var a=!!e.scopeParent,o=a?e.scopeParent:e,i=function(e,t){var n=ln(e);return n<0&&t&&!sn(e)?0:n}(o,a),s=a?hn(e.candidates):o;0===i?a?t.push.apply(t,s):t.push(o):n.push({documentOrder:r,tabIndex:i,item:e,isScope:a,content:s})}),n.sort(cn).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},gn=function(e,t){var n;return n=(t=t||{}).getShadowRoot?on([e],t.includeContainer,{filter:mn.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:pn}):function(e,t,n){if(an(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(en));return t&&nn.call(e,en)&&r.unshift(e),r.filter(n)}(e,t.includeContainer,mn.bind(null,t)),hn(n)};const wn=window.ReactDOM;function yn(e,t,n){let{reference:r,floating:a}=e;const o=Vt(t),i=Wt(t),s=Qt(i),l=Bt(t),c="y"===o,u=r.x+r.width/2-a.width/2,d=r.y+r.height/2-a.height/2,f=r[s]/2-a[s]/2;let m;switch(l){case"top":m={x:u,y:r.y-a.height};break;case"bottom":m={x:u,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-a.width,y:d};break;default:m={x:r.x,y:r.y}}switch(Ft(t)){case"start":m[i]-=f*(n&&c?-1:1);break;case"end":m[i]+=f*(n&&c?-1:1)}return m}async function bn(e,t){var n;void 0===t&&(t={});const{x:r,y:a,platform:o,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:m=0}=Ut(t,e),p=Jt(m),h=s[f?"floating"===d?"reference":"floating":d],g=Kt(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(h)))||n?h:h.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),w="floating"===d?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,y=await(null==o.getOffsetParent?void 0:o.getOffsetParent(s.floating)),b=await(null==o.isElement?void 0:o.isElement(y))&&await(null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},v=Kt(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetParent:y,strategy:l}):w);return{top:(g.top-v.top+p.top)/b.y,bottom:(v.bottom-g.bottom+p.bottom)/b.y,left:(g.left-v.left+p.left)/b.x,right:(v.right-g.right+p.right)/b.x}}const vn=new Set(["left","top"]);function xn(e){const t=ut(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Je(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,s=Ot(n)!==o||Ot(r)!==i;return s&&(n=o,r=i),{width:n,height:r,$:s}}function En(e){return qe(e)?e:e.contextElement}function Nn(e){const t=En(e);if(!Je(t))return zt(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=xn(t);let i=(o?Ot(n.width):n.width)/r,s=(o?Ot(n.height):n.height)/a;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const Mn=zt(0);function In(e){const t=He(e);return lt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Mn}function Sn(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const a=e.getBoundingClientRect(),o=En(e);let i=zt(1);t&&(r?qe(r)&&(i=Nn(r)):i=Nn(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==He(e))&&t}(o,n,r)?In(o):zt(0);let l=(a.left+s.x)/i.x,c=(a.top+s.y)/i.y,u=a.width/i.x,d=a.height/i.y;if(o){const e=He(o),t=r&&qe(r)?He(r):r;let n=e,a=ht(n);for(;a&&r&&t!==n;){const e=Nn(a),t=a.getBoundingClientRect(),r=ut(a),o=t.left+(a.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(a.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=o,c+=i,n=He(a),a=ht(n)}}return Kt({width:u,height:d,x:l,y:c})}function kn(e,t){const n=dt(e).scrollLeft;return t?t.left+n:Sn($e(e)).left+n}function jn(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-kn(e,n),y:n.top+t.scrollTop}}function Dn(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=He(e),r=$e(e),a=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,s=0,l=0;if(a){o=a.width,i=a.height;const e=lt();(!e||e&&"fixed"===t)&&(s=a.offsetLeft,l=a.offsetTop)}const c=kn(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),a="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(r.clientWidth-t.clientWidth-a);i<=25&&(o-=i)}else c<=25&&(o+=c);return{width:o,height:i,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=$e(e),n=dt(e),r=e.ownerDocument.body,a=Tt(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Tt(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+kn(e);const s=-n.scrollTop;return"rtl"===ut(r).direction&&(i+=Tt(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:i,y:s}}($e(e));else if(qe(t))r=function(e,t){const n=Sn(e,!0,"fixed"===t),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=Je(e)?Nn(e):zt(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:a*o.x,y:r*o.y}}(t,n);else{const n=In(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Kt(r)}function Cn(e,t){const n=ft(e);return!(n===t||!qe(n)||ct(n))&&("fixed"===ut(n).position||Cn(n,t))}function An(e,t,n){const r=Je(t),a=$e(t),o="fixed"===n,i=Sn(e,!0,o,t);let s={scrollLeft:0,scrollTop:0};const l=zt(0);function c(){l.x=kn(a)}if(r||!r&&!o)if(("body"!==Ge(t)||et(a))&&(s=dt(t)),r){const e=Sn(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else a&&c();o&&!r&&a&&c();const u=!a||r||o?zt(0):jn(a,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function Tn(e){return"static"===ut(e).position}function On(e,t){if(!Je(e)||"fixed"===ut(e).position)return null;if(t)return t(e);let n=e.offsetParent;return $e(e)===n&&(n=n.ownerDocument.body),n}function Ln(e,t){const n=He(e);if(nt(e))return n;if(!Je(e)){let t=ft(e);for(;t&&!ct(t);){if(qe(t)&&!Tn(t))return t;t=ft(t)}return n}let r=On(e,t);for(;r&&tt(r)&&Tn(r);)r=On(r,t);return r&&ct(r)&&Tn(r)&&!st(r)?n:r||function(e){let t=ft(e);for(;Je(t)&&!ct(t);){if(st(t))return t;if(nt(t))return null;t=ft(t)}return null}(e)||n}const zn={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o="fixed"===a,i=$e(r),s=!!t&&nt(t.floating);if(r===i||s&&o)return n;let l={scrollLeft:0,scrollTop:0},c=zt(1);const u=zt(0),d=Je(r);if((d||!d&&!o)&&(("body"!==Ge(r)||et(i))&&(l=dt(r)),d)){const e=Sn(r);c=Nn(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!i||d||o?zt(0):jn(i,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:$e,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[..."clippingAncestors"===n?nt(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=pt(e,[],!1).filter(e=>qe(e)&&"body"!==Ge(e)),a=null;const o="fixed"===ut(e).position;let i=o?ft(e):e;for(;qe(i)&&!ct(i);){const t=ut(i),n=st(i);n||"fixed"!==t.position||(a=null),(o?!n&&!a:!n&&"static"===t.position&&a&&("absolute"===a.position||"fixed"===a.position)||et(i)&&!n&&Cn(e,i))?r=r.filter(e=>e!==i):a=t,i=ft(i)}return t.set(e,r),r}(t,this._c):[].concat(n),r],i=Dn(t,o[0],a);let s=i.top,l=i.right,c=i.bottom,u=i.left;for(let e=1;e<o.length;e++){const n=Dn(t,o[e],a);s=Tt(n.top,s),l=At(n.right,l),c=At(n.bottom,c),u=Tt(n.left,u)}return{width:l-u,height:c-s,x:u,y:s}},getOffsetParent:Ln,getElementRects:async function(e){const t=this.getOffsetParent||Ln,n=this.getDimensions,r=await n(e.floating);return{reference:An(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=xn(e);return{width:t,height:n}},getScale:Nn,isElement:qe,isRTL:function(e){return"rtl"===ut(e).direction}};function Pn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rn(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=En(e),u=a||o?[...c?pt(c):[],...t?pt(t):[]]:[];u.forEach(e=>{a&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const a=$e(e);function o(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),o();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:m}=c;if(s||t(),!f||!m)return;const p={rootMargin:-Lt(d)+"px "+-Lt(a.clientWidth-(u+f))+"px "+-Lt(a.clientHeight-(d+m))+"px "+-Lt(u)+"px",threshold:Tt(0,At(1,l))||1};let h=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!h)return i();r?i(!1,r):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==r||Pn(c,e.getBoundingClientRect())||i(),h=!1}try{r=new IntersectionObserver(g,{...p,root:a.ownerDocument})}catch(e){r=new IntersectionObserver(g,p)}r.observe(e)}(!0),o}(c,n):null;let f,m=-1,p=null;i&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&p&&t&&(p.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var e;null==(e=p)||e.observe(t)})),n()}),c&&!l&&p.observe(c),t&&p.observe(t));let h=l?Sn(e):null;return l&&function t(){const r=Sn(e);h&&!Pn(h,r)&&n(),h=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{a&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=p)||e.disconnect(),p=null,l&&cancelAnimationFrame(f)}}const Un=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...g}=Ut(e,t);if(null!=(n=o.arrow)&&n.alignmentOffset)return{};const w=Bt(a),y=Vt(s),b=Bt(s)===s,v=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!h?[qt(s)]:function(e){const t=qt(e);return[Zt(e),t,Zt(t)]}(s)),_="none"!==p;!f&&_&&x.push(...function(e,t,n,r){const a=Ft(e);let o=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Ht:Gt:t?Gt:Ht;case"left":case"right":return t?$t:Xt;default:return[]}}(Bt(e),"start"===n,r);return a&&(o=o.map(e=>e+"-"+a),t&&(o=o.concat(o.map(Zt)))),o}(s,h,p,v));const E=[s,...x],N=await l.detectOverflow(t,g),M=[];let I=(null==(r=o.flip)?void 0:r.overflows)||[];if(u&&M.push(N[w]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=Ft(e),a=Wt(e),o=Qt(a);let i="x"===a?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=qt(i)),[i,qt(i)]}(a,i,v);M.push(N[e[0]],N[e[1]])}if(I=[...I,{placement:a,overflows:M}],!M.every(e=>e<=0)){var S,k;const e=((null==(S=o.flip)?void 0:S.index)||0)+1,t=E[e];if(t&&("alignment"!==d||y===Vt(t)||I.every(e=>Vt(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:I},reset:{placement:t}};let n=null==(k=I.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:k.placement;if(!n)switch(m){case"bestFit":{var j;const e=null==(j=I.filter(e=>{if(_){const t=Vt(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:j[0];e&&(n=e);break}case"initialPlacement":n=s}if(a!==n)return{reset:{placement:n}}}return{}}}},Bn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Ut(e,t)||{};if(null==c)return{};const d=Jt(u),f={x:n,y:r},m=Wt(a),p=Qt(m),h=await i.getDimensions(c),g="y"===m,w=g?"top":"left",y=g?"bottom":"right",b=g?"clientHeight":"clientWidth",v=o.reference[p]+o.reference[m]-f[m]-o.floating[p],x=f[m]-o.reference[m],_=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let E=_?_[b]:0;E&&await(null==i.isElement?void 0:i.isElement(_))||(E=s.floating[b]||o.floating[p]);const N=v/2-x/2,M=E/2-h[p]/2-1,I=At(d[w],M),S=At(d[y],M),k=I,j=E-h[p]-S,D=E/2-h[p]/2+N,C=Rt(k,D,j),A=!l.arrow&&null!=Ft(a)&&D!==C&&o.reference[p]/2-(D<k?I:S)-h[p]/2<0,T=A?D<k?D-k:D-j:0;return{[m]:f[m]+T,data:{[m]:C,centerOffset:D-C-T,...A&&{alignmentOffset:T}},reset:A}}}),Fn=(e,t,n)=>{const r=new Map,a={platform:zn,...n},o={...a.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,s=i.detectOverflow?i:{...i,detectOverflow:bn},l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:d}=yn(c,r,l),f=r,m=0;const p={};for(let n=0;n<o.length;n++){const h=o[n];if(!h)continue;const{name:g,fn:w}=h,{x:y,y:b,data:v,reset:x}=await w({x:u,y:d,initialPlacement:r,placement:f,strategy:a,middlewareData:p,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=y?y:u,d=null!=b?b:d,p[g]={...p[g],...v},x&&m<50&&(m++,"object"==typeof x&&(x.placement&&(f=x.placement),x.rects&&(c=!0===x.rects?await i.getElementRects({reference:e,floating:t,strategy:a}):x.rects),({x:u,y:d}=yn(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:a,middlewareData:p}})(e,t,{...a,platform:o})};var Yn="undefined"!=typeof document?i.useLayoutEffect:function(){};function Qn(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 n,r,a;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!Qn(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;0!==r--;){const n=a[r];if(!("_owner"===n&&e.$$typeof||Qn(e[n],t[n])))return!1}return!0}return e!=e&&t!=t}function Vn(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Wn(e,t){const n=Vn(e);return Math.round(t*n)/n}function Zn(e){const t=i.useRef(e);return Yn(()=>{t.current=e}),t}const Gn=(e,t)=>{const n=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:a}=e,o=await(null==r.isRTL?void 0:r.isRTL(a.floating)),i=Bt(n),s=Ft(n),l="y"===Vt(n),c=vn.has(i)?-1:1,u=o&&l?-1:1,d=Ut(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof p&&(m="end"===s?-1*p:p),l?{x:m*u,y:f*c}:{x:f*c,y:m*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:a+l.x,y:o+l.y,data:{...l,placement:i}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},Hn=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Ut(e,t),u={x:n,y:r},d=await o.detectOverflow(t,c),f=Vt(Bt(a)),m=Yt(f);let p=u[m],h=u[f];if(i){const e="y"===m?"bottom":"right";p=Rt(p+d["y"===m?"top":"left"],p,p-d[e])}if(s){const e="y"===f?"bottom":"right";h=Rt(h+d["y"===f?"top":"left"],h,h-d[e])}const g=l.fn({...t,[m]:p,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[m]:i,[f]:s}}}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},$n=(e,t)=>{const n=Un(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xn=(e,t)=>{const n=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Ut(e,t),u=await i.detectOverflow(t,c),d=Bt(a),f=Ft(a),m="y"===Vt(a),{width:p,height:h}=o.floating;let g,w;"top"===d||"bottom"===d?(g=d,w=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(w=d,g="end"===f?"top":"bottom");const y=h-u.top-u.bottom,b=p-u.left-u.right,v=At(h-u[g],y),x=At(p-u[w],b),_=!t.middlewareData.shift;let E=v,N=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(N=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=y),_&&!f){const e=Tt(u.left,0),t=Tt(u.right,0),n=Tt(u.top,0),r=Tt(u.bottom,0);m?N=p-2*(0!==e||0!==t?e+t:Tt(u.left,u.right)):E=h-2*(0!==n||0!==r?n+r:Tt(u.top,u.bottom))}await l({...t,availableWidth:N,availableHeight:E});const M=await i.getDimensions(s.floating);return p!==M.width||h!==M.height?{reset:{rects:!0}}:{}}}}(e);return{name:n.name,fn:n.fn,options:[e,t]}},qn=(e,t)=>{const n=(e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&function(e){return{}.hasOwnProperty.call(e,"current")}(n)?null!=n.current?Bn({element:n.current,padding:r}).fn(t):{}:n?Bn({element:n,padding:r}).fn(t):{}}}))(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jn={...s},Kn=Jn.useInsertionEffect||(e=>e());function er(e){const t=i.useRef(()=>{});return Kn(()=>{t.current=e}),i.useCallback(function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}const tr="ArrowUp",nr="ArrowDown",rr="ArrowLeft",ar="ArrowRight";function or(e,t,n){return Math.floor(e/t)!==n}function ir(e,t){return t<0||t>=e.current.length}function sr(e,t){return cr(e,{disabledIndices:t})}function lr(e,t){return cr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function cr(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:a,amount:o=1}=void 0===t?{}:t;const i=e.current;let s=n;do{s+=r?-o:o}while(s>=0&&s<=i.length-1&&fr(i,s,a));return s}function ur(e,t,n,r,a){if(-1===e)return-1;const o=n.indexOf(e),i=t[e];switch(a){case"tl":return o;case"tr":return i?o+i.width-1:o;case"bl":return i?o+(i.height-1)*r:o;case"br":return n.lastIndexOf(e)}}function dr(e,t){return t.flatMap((t,n)=>e.includes(t)?[n]:[])}function fr(e,t,n){if(n)return n.includes(t);const r=e[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}var mr="undefined"!=typeof document?i.useLayoutEffect:i.useEffect;function pr(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const hr=i.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function gr(e){const{children:t,elementsRef:n,labelsRef:r}=e,[a,o]=i.useState(()=>new Map),s=i.useCallback(e=>{o(t=>new Map(t).set(e,null))},[]),l=i.useCallback(e=>{o(t=>{const n=new Map(t);return n.delete(e),n})},[]);return mr(()=>{const e=new Map(a);Array.from(e.keys()).sort(pr).forEach((t,n)=>{e.set(t,n)}),function(e,t){if(e.size!==t.size)return!1;for(const[n,r]of e.entries())if(r!==t.get(n))return!1;return!0}(a,e)||o(e)},[a]),i.createElement(hr.Provider,{value:i.useMemo(()=>({register:s,unregister:l,map:a,elementsRef:n,labelsRef:r}),[s,l,a,n,r])},t)}function wr(){return wr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wr.apply(this,arguments)}let yr=!1,br=0;const vr=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+br++,xr=Jn.useId||function(){const[e,t]=i.useState(()=>yr?vr():void 0);return mr(()=>{null==e&&t(vr())},[]),i.useEffect(()=>{yr=!0},[]),e},_r=i.forwardRef(function(e,t){const{context:{placement:n,elements:{floating:r},middlewareData:{arrow:a,shift:o}},width:s=14,height:l=7,tipRadius:c=0,strokeWidth:u=0,staticOffset:d,stroke:f,d:m,style:{transform:p,...h}={},...g}=e,w=xr(),[y,b]=i.useState(!1);if(mr(()=>{r&&"rtl"===ut(r).direction&&b(!0)},[r]),!r)return null;const[v,x]=n.split("-"),_="top"===v||"bottom"===v;let E=d;(_&&null!=o&&o.x||!_&&null!=o&&o.y)&&(E=null);const N=2*u,M=N/2,I=s/2*(c/-8+1),S=l/2*c/4,k=!!m,j=E&&"end"===x?"bottom":"top";let D=E&&"end"===x?"right":"left";E&&y&&(D="end"===x?"left":"right");const C=null!=(null==a?void 0:a.x)?E||a.x:"",A=null!=(null==a?void 0:a.y)?E||a.y:"",T=m||"M0,0 H"+s+" L"+(s-I)+","+(l-S)+" Q"+s/2+","+l+" "+I+","+(l-S)+" Z",O={top:k?"rotate(180deg)":"",left:k?"rotate(90deg)":"rotate(-90deg)",bottom:k?"":"rotate(180deg)",right:k?"rotate(-90deg)":"rotate(90deg)"}[v];return i.createElement("svg",wr({},g,{"aria-hidden":!0,ref:t,width:k?s:s+N,height:s,viewBox:"0 0 "+s+" "+(l>s?l:s),style:{position:"absolute",pointerEvents:"none",[D]:C,[j]:A,[v]:_||k?"100%":"calc(100% - "+N/2+"px)",transform:[O,p].filter(e=>!!e).join(" "),...h}}),N>0&&i.createElement("path",{clipPath:"url(#"+w+")",fill:"none",stroke:f,strokeWidth:N+(m?0:1),d:T}),i.createElement("path",{stroke:N&&!m?g.fill:"none",d:T}),i.createElement("clipPath",{id:w},i.createElement("rect",{x:-M,y:M*(k?-1:1),width:s+N,height:s})))});const Er=i.createContext(null),Nr=i.createContext(null),Mr=()=>{var e;return(null==(e=i.useContext(Er))?void 0:e.id)||null},Ir=()=>i.useContext(Nr);function Sr(e){return"data-floating-ui-"+e}function kr(e){const t=(0,i.useRef)(e);return mr(()=>{t.current=e}),t}const jr=Sr("safe-polygon");function Dr(e,t,n){return n&&!Mt(n)?0:"number"==typeof e?e:null==e?void 0:e[t]}let Cr=0;function Ar(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=t;r&&cancelAnimationFrame(Cr);const o=()=>null==e?void 0:e.focus({preventScroll:n});a?o():Cr=requestAnimationFrame(o)}function Tr(e,t){let n=e.filter(e=>{var n;return e.parentId===t&&(null==(n=e.context)?void 0:n.open)}),r=n;for(;r.length;)r=e.filter(e=>{var t;return null==(t=r)?void 0:t.some(t=>{var n;return e.parentId===t.id&&(null==(n=e.context)?void 0:n.open)})}),n=n.concat(r);return n}let Or=new WeakMap,Lr=new WeakSet,zr={},Pr=0;const Rr=e=>e&&(e.host||Rr(e.parentNode));function Ur(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=It(e[0]).body;return function(e,t,n,r){const a="data-floating-ui-inert",o=r?"inert":n?"aria-hidden":null,i=(s=t,e.map(e=>{if(s.contains(e))return e;const t=Rr(e);return s.contains(t)?t:null}).filter(e=>null!=e));var s;const l=new Set,c=new Set(i),u=[];zr[a]||(zr[a]=new WeakMap);const d=zr[a];return i.forEach(function e(t){t&&!l.has(t)&&(l.add(t),t.parentNode&&e(t.parentNode))}),function e(t){t&&!c.has(t)&&[].forEach.call(t.children,t=>{if("script"!==Ge(t))if(l.has(t))e(t);else{const e=o?t.getAttribute(o):null,n=null!==e&&"false"!==e,r=(Or.get(t)||0)+1,i=(d.get(t)||0)+1;Or.set(t,r),d.set(t,i),u.push(t),1===r&&n&&Lr.add(t),1===i&&t.setAttribute(a,""),!n&&o&&t.setAttribute(o,"true")}})}(t),l.clear(),Pr++,()=>{u.forEach(e=>{const t=(Or.get(e)||0)-1,n=(d.get(e)||0)-1;Or.set(e,t),d.set(e,n),t||(!Lr.has(e)&&o&&e.removeAttribute(o),Lr.delete(e)),n||e.removeAttribute(a)}),Pr--,Pr||(Or=new WeakMap,Or=new WeakMap,Lr=new WeakSet,zr={})}}(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const Br=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Fr(e,t){const n=gn(e,Br());"prev"===t&&n.reverse();const r=n.indexOf(gt(It(e)));return n.slice(r+1)[0]}function Yr(){return Fr(document.body,"next")}function Qr(){return Fr(document.body,"prev")}function Vr(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!wt(n,r)}function Wr(e){gn(e,Br()).forEach(e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")})}function Zr(e){e.querySelectorAll("[data-tabindex]").forEach(e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")})}const Gr={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0};function Hr(e){"Tab"===e.key&&(e.target,clearTimeout(void 0))}const $r=i.forwardRef(function(e,t){const[n,r]=i.useState();mr(()=>(_t()&&r("button"),document.addEventListener("keydown",Hr),()=>{document.removeEventListener("keydown",Hr)}),[]);const a={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[Sr("focus-guard")]:"",style:Gr};return i.createElement("span",wr({},e,a))}),Xr=i.createContext(null),qr=Sr("portal");function Jr(e){const{children:t,id:n,root:r,preserveTabOrder:a=!0}=e,o=function(e){void 0===e&&(e={});const{id:t,root:n}=e,r=xr(),a=Kr(),[o,s]=i.useState(null),l=i.useRef(null);return mr(()=>()=>{null==o||o.remove(),queueMicrotask(()=>{l.current=null})},[o]),mr(()=>{if(!r)return;if(l.current)return;const e=t?document.getElementById(t):null;if(!e)return;const n=document.createElement("div");n.id=r,n.setAttribute(qr,""),e.appendChild(n),l.current=n,s(n)},[t,r]),mr(()=>{if(null===n)return;if(!r)return;if(l.current)return;let e=n||(null==a?void 0:a.portalNode);e&&!qe(e)&&(e=e.current),e=e||document.body;let o=null;t&&(o=document.createElement("div"),o.id=t,e.appendChild(o));const i=document.createElement("div");i.id=r,i.setAttribute(qr,""),e=o||e,e.appendChild(i),l.current=i,s(i)},[t,n,r,a]),o}({id:n,root:r}),[s,l]=i.useState(null),c=i.useRef(null),u=i.useRef(null),d=i.useRef(null),f=i.useRef(null),m=null==s?void 0:s.modal,p=null==s?void 0:s.open,h=!!s&&!s.modal&&s.open&&a&&!(!r&&!o);return i.useEffect(()=>{if(o&&a&&!m)return o.addEventListener("focusin",e,!0),o.addEventListener("focusout",e,!0),()=>{o.removeEventListener("focusin",e,!0),o.removeEventListener("focusout",e,!0)};function e(e){o&&Vr(e)&&("focusin"===e.type?Zr:Wr)(o)}},[o,a,m]),i.useEffect(()=>{o&&(p||Zr(o))},[p,o]),i.createElement(Xr.Provider,{value:i.useMemo(()=>({preserveTabOrder:a,beforeOutsideRef:c,afterOutsideRef:u,beforeInsideRef:d,afterInsideRef:f,portalNode:o,setFocusManagerState:l}),[a,o])},h&&o&&i.createElement($r,{"data-type":"outside",ref:c,onFocus:e=>{if(Vr(e,o)){var t;null==(t=d.current)||t.focus()}else{const e=Qr()||(null==s?void 0:s.refs.domReference.current);null==e||e.focus()}}}),h&&o&&i.createElement("span",{"aria-owns":o.id,style:Gr}),o&&wn.createPortal(t,o),h&&o&&i.createElement($r,{"data-type":"outside",ref:u,onFocus:e=>{if(Vr(e,o)){var t;null==(t=f.current)||t.focus()}else{const t=Yr()||(null==s?void 0:s.refs.domReference.current);null==t||t.focus(),(null==s?void 0:s.closeOnFocusOut)&&(null==s||s.onOpenChange(!1,e.nativeEvent,"focus-out"))}}}))}const Kr=()=>i.useContext(Xr),ea="data-floating-ui-focusable";function ta(e){return e?e.hasAttribute(ea)?e:e.querySelector("["+ea+"]")||e:null}let na=[];function ra(e){na=na.filter(e=>e.isConnected);let t=e;if(t&&"body"!==Ge(t)){if(!function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==nn.call(e,en)&&mn(t,e)}(t,Br())){const e=gn(t,Br())[0];e&&(t=e)}na.push(t),na.length>20&&(na=na.slice(-20))}}function aa(){return na.slice().reverse().find(e=>e.isConnected)}const oa=i.forwardRef(function(e,t){return i.createElement("button",wr({},e,{type:"button",ref:t,tabIndex:-1,style:Gr}))});function ia(e){const{context:t,children:n,disabled:r=!1,order:a=["content"],guards:o=!0,initialFocus:s=0,returnFocus:l=!0,restoreFocus:c=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0}=e,{open:m,refs:p,nodeId:h,onOpenChange:g,events:w,dataRef:y,floatingId:b,elements:{domReference:v,floating:x}}=t,_="number"==typeof s&&s<0,E=Ct(v)&&_,N="undefined"==typeof HTMLElement||!("inert"in HTMLElement.prototype)||o,M=kr(a),I=kr(s),S=kr(l),k=Ir(),j=Kr(),D=i.useRef(null),C=i.useRef(null),A=i.useRef(!1),T=i.useRef(!1),O=i.useRef(-1),L=null!=j,z=ta(x),P=er(function(e){return void 0===e&&(e=z),e?gn(e,Br()):[]}),R=er(e=>{const t=P(e);return M.current.map(e=>v&&"reference"===e?v:z&&"floating"===e?z:t).filter(Boolean).flat()});function U(e){return!r&&d&&u?i.createElement(oa,{ref:"start"===e?D:C,onClick:e=>g(!1,e.nativeEvent)},"string"==typeof d?d:"Dismiss"):null}i.useEffect(()=>{if(r)return;if(!u)return;function e(e){if("Tab"===e.key){wt(z,gt(It(z)))&&0===P().length&&!E&&Dt(e);const t=R(),n=kt(e);"reference"===M.current[0]&&n===v&&(Dt(e),e.shiftKey?Ar(t[t.length-1]):Ar(t[1])),"floating"===M.current[1]&&n===z&&e.shiftKey&&(Dt(e),Ar(t[0]))}}const t=It(z);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}},[r,v,z,u,M,E,P,R]),i.useEffect(()=>{if(!r&&x)return x.addEventListener("focusin",e),()=>{x.removeEventListener("focusin",e)};function e(e){const t=kt(e),n=P().indexOf(t);-1!==n&&(O.current=n)}},[r,x,P]),i.useEffect(()=>{if(!r&&f)return x&&Je(v)?(v.addEventListener("focusout",t),v.addEventListener("pointerdown",e),x.addEventListener("focusout",t),()=>{v.removeEventListener("focusout",t),v.removeEventListener("pointerdown",e),x.removeEventListener("focusout",t)}):void 0;function e(){T.current=!0,setTimeout(()=>{T.current=!1})}function t(e){const t=e.relatedTarget;queueMicrotask(()=>{const n=!(wt(v,t)||wt(x,t)||wt(t,x)||wt(null==j?void 0:j.portalNode,t)||null!=t&&t.hasAttribute(Sr("focus-guard"))||k&&(Tr(k.nodesRef.current,h).find(e=>{var n,r;return wt(null==(n=e.context)?void 0:n.elements.floating,t)||wt(null==(r=e.context)?void 0:r.elements.domReference,t)})||function(e,t){var n;let r=[],a=null==(n=e.find(e=>e.id===t))?void 0:n.parentId;for(;a;){const t=e.find(e=>e.id===a);a=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}(k.nodesRef.current,h).find(e=>{var n,r;return(null==(n=e.context)?void 0:n.elements.floating)===t||(null==(r=e.context)?void 0:r.elements.domReference)===t})));if(c&&n&>(It(z))===It(z).body){Je(z)&&z.focus();const e=O.current,t=P(),n=t[e]||t[t.length-1]||z;Je(n)&&n.focus()}!E&&u||!t||!n||T.current||t===aa()||(A.current=!0,g(!1,e,"focus-out"))})}},[r,v,x,z,u,h,k,j,g,f,c,P,E]),i.useEffect(()=>{var e;if(r)return;const t=Array.from((null==j||null==(e=j.portalNode)?void 0:e.querySelectorAll("["+Sr("portal")+"]"))||[]);if(x){const e=[x,...t,D.current,C.current,M.current.includes("reference")||E?v:null].filter(e=>null!=e),n=u||E?Ur(e,N,!N):Ur(e);return()=>{n()}}},[r,v,x,u,M,j,E,N]),mr(()=>{if(r||!Je(z))return;const e=gt(It(z));queueMicrotask(()=>{const t=R(z),n=I.current,r=("number"==typeof n?t[n]:n.current)||z,a=wt(z,e);_||a||!m||Ar(r,{preventScroll:r===z})})},[r,m,z,_,R,I]),mr(()=>{if(r||!z)return;let e=!1;const t=It(z),n=gt(t);let a=y.current.openEvent;function o(t){let{open:n,reason:r,event:o,nested:i}=t;n&&(a=o),"escape-key"===r&&p.domReference.current&&ra(p.domReference.current),"hover"===r&&"mouseleave"===o.type&&(A.current=!0),"outside-press"===r&&(i?(A.current=!1,e=!0):A.current=!(vt(o)||xt(o)))}ra(n),w.on("openchange",o);const i=t.createElement("span");return i.setAttribute("tabindex","-1"),i.setAttribute("aria-hidden","true"),Object.assign(i.style,Gr),L&&v&&v.insertAdjacentElement("afterend",i),()=>{w.off("openchange",o);const n=gt(t),r=wt(x,n)||k&&Tr(k.nodesRef.current,h).some(e=>{var t;return wt(null==(t=e.context)?void 0:t.elements.floating,n)});(r||a&&["click","mousedown"].includes(a.type))&&p.domReference.current&&ra(p.domReference.current);const s="boolean"==typeof S.current?aa()||i:S.current.current||i;queueMicrotask(()=>{S.current&&!A.current&&Je(s)&&(s===n||n===t.body||r)&&s.focus({preventScroll:e}),i.remove()})}},[r,x,z,S,y,p,w,k,h,L,v]),i.useEffect(()=>{queueMicrotask(()=>{A.current=!1})},[r]),mr(()=>{if(!r&&j)return j.setFocusManagerState({modal:u,closeOnFocusOut:f,open:m,onOpenChange:g,refs:p}),()=>{j.setFocusManagerState(null)}},[r,j,u,m,g,p,f]),mr(()=>{if(r)return;if(!z)return;if("function"!=typeof MutationObserver)return;if(_)return;const e=()=>{const e=z.getAttribute("tabindex"),t=P(),n=gt(It(x)),r=t.indexOf(n);-1!==r&&(O.current=r),M.current.includes("floating")||n!==p.domReference.current&&0===t.length?"0"!==e&&z.setAttribute("tabindex","0"):"-1"!==e&&z.setAttribute("tabindex","-1")};e();const t=new MutationObserver(e);return t.observe(z,{childList:!0,subtree:!0,attributes:!0}),()=>{t.disconnect()}},[r,x,z,p,M,P,_]);const B=!r&&N&&(!u||!E)&&(L||u);return i.createElement(i.Fragment,null,B&&i.createElement($r,{"data-type":"inside",ref:null==j?void 0:j.beforeInsideRef,onFocus:e=>{if(u){const e=R();Ar("reference"===a[0]?e[0]:e[e.length-1])}else if(null!=j&&j.preserveTabOrder&&j.portalNode)if(A.current=!1,Vr(e,j.portalNode)){const e=Yr()||v;null==e||e.focus()}else{var t;null==(t=j.beforeOutsideRef.current)||t.focus()}}}),!E&&U("start"),n,U("end"),B&&i.createElement($r,{"data-type":"inside",ref:null==j?void 0:j.afterInsideRef,onFocus:e=>{if(u)Ar(R()[0]);else if(null!=j&&j.preserveTabOrder&&j.portalNode)if(f&&(A.current=!0),Vr(e,j.portalNode)){const e=Qr()||v;null==e||e.focus()}else{var t;null==(t=j.afterOutsideRef.current)||t.focus()}}}))}let sa=0,la=()=>{};const ca=i.forwardRef(function(e,t){const{lockScroll:n=!1,...r}=e;return mr(()=>{if(n)return sa++,1===sa&&(la=function(){const e=/iP(hone|ad|od)|iOS/.test(yt()),t=document.body.style,n=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",r=window.innerWidth-document.documentElement.clientWidth,a=t.left?parseFloat(t.left):window.scrollX,o=t.top?parseFloat(t.top):window.scrollY;if(t.overflow="hidden",r&&(t[n]=r+"px"),e){var i,s;const e=(null==(i=window.visualViewport)?void 0:i.offsetLeft)||0,n=(null==(s=window.visualViewport)?void 0:s.offsetTop)||0;Object.assign(t,{position:"fixed",top:-(o-Math.floor(n))+"px",left:-(a-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(t,{overflow:"",[n]:""}),e&&(Object.assign(t,{position:"",top:"",left:"",right:""}),window.scrollTo(a,o))}}()),()=>{sa--,0===sa&&la()}},[n]),i.createElement("div",wr({ref:t},r,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...r.style}}))});function ua(e){return Je(e.target)&&"BUTTON"===e.target.tagName}function da(e){return jt(e)}function fa(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:a,elements:{domReference:o}}=e,{enabled:s=!0,event:l="click",toggle:c=!0,ignoreMouse:u=!1,keyboardHandlers:d=!0,stickIfOpen:f=!0}=t,m=i.useRef(),p=i.useRef(!1),h=i.useMemo(()=>({onPointerDown(e){m.current=e.pointerType},onMouseDown(e){const t=m.current;0===e.button&&"click"!==l&&(Mt(t,!0)&&u||(!n||!c||a.current.openEvent&&f&&"mousedown"!==a.current.openEvent.type?(e.preventDefault(),r(!0,e.nativeEvent,"click")):r(!1,e.nativeEvent,"click")))},onClick(e){const t=m.current;"mousedown"===l&&m.current?m.current=void 0:Mt(t,!0)&&u||(!n||!c||a.current.openEvent&&f&&"click"!==a.current.openEvent.type?r(!0,e.nativeEvent,"click"):r(!1,e.nativeEvent,"click"))},onKeyDown(e){m.current=void 0,e.defaultPrevented||!d||ua(e)||(" "!==e.key||da(o)||(e.preventDefault(),p.current=!0),"Enter"===e.key&&r(!n||!c,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!d||ua(e)||da(o)||" "===e.key&&p.current&&(p.current=!1,r(!n||!c,e.nativeEvent,"click"))}}),[a,o,l,u,d,r,n,f,c]);return i.useMemo(()=>s?{reference:h}:{},[s,h])}const ma={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},pa={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ha=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function ga(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,elements:a,dataRef:o}=e,{enabled:s=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:m=!1,bubbles:p,capture:h}=t,g=Ir(),w=er("function"==typeof c?c:()=>!1),y="function"==typeof c?w:c,b=i.useRef(!1),v=i.useRef(!1),{escapeKey:x,outsidePress:_}=ha(p),{escapeKey:E,outsidePress:N}=ha(h),M=i.useRef(!1),I=er(e=>{var t;if(!n||!s||!l||"Escape"!==e.key)return;if(M.current)return;const a=null==(t=o.current.floatingContext)?void 0:t.nodeId,i=g?Tr(g.nodesRef.current,a):[];if(!x&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)}),!e)return}r(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")}),S=er(e=>{var t;const n=()=>{var t;I(e),null==(t=kt(e))||t.removeEventListener("keydown",n)};null==(t=kt(e))||t.addEventListener("keydown",n)}),k=er(e=>{var t;const n=b.current;b.current=!1;const i=v.current;if(v.current=!1,"click"===u&&i)return;if(n)return;if("function"==typeof y&&!y(e))return;const s=kt(e),l="["+Sr("inert")+"]",c=It(a.floating).querySelectorAll(l);let d=qe(s)?s:null;for(;d&&!ct(d);){const e=ft(d);if(ct(e)||!qe(e))break;d=e}if(c.length&&qe(s)&&!s.matches("html,body")&&!wt(s,a.floating)&&Array.from(c).every(e=>!wt(d,e)))return;if(Je(s)&&C){const t=s.clientWidth>0&&s.scrollWidth>s.clientWidth,n=s.clientHeight>0&&s.scrollHeight>s.clientHeight;let r=n&&e.offsetX>s.clientWidth;if(n&&"rtl"===ut(s).direction&&(r=e.offsetX<=s.offsetWidth-s.clientWidth),r||t&&e.offsetY>s.clientHeight)return}const f=null==(t=o.current.floatingContext)?void 0:t.nodeId,m=g&&Tr(g.nodesRef.current,f).some(t=>{var n;return St(e,null==(n=t.context)?void 0:n.elements.floating)});if(St(e,a.floating)||St(e,a.domReference)||m)return;const p=g?Tr(g.nodesRef.current,f):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)}),!e)return}r(!1,e,"outside-press")}),j=er(e=>{var t;const n=()=>{var t;k(e),null==(t=kt(e))||t.removeEventListener(u,n)};null==(t=kt(e))||t.addEventListener(u,n)});i.useEffect(()=>{if(!n||!s)return;o.current.__escapeKeyBubbles=x,o.current.__outsidePressBubbles=_;let e=-1;function t(e){r(!1,e,"ancestor-scroll")}function i(){window.clearTimeout(e),M.current=!0}function c(){e=window.setTimeout(()=>{M.current=!1},lt()?5:0)}const d=It(a.floating);l&&(d.addEventListener("keydown",E?S:I,E),d.addEventListener("compositionstart",i),d.addEventListener("compositionend",c)),y&&d.addEventListener(u,N?j:k,N);let f=[];return m&&(qe(a.domReference)&&(f=pt(a.domReference)),qe(a.floating)&&(f=f.concat(pt(a.floating))),!qe(a.reference)&&a.reference&&a.reference.contextElement&&(f=f.concat(pt(a.reference.contextElement)))),f=f.filter(e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)}),f.forEach(e=>{e.addEventListener("scroll",t,{passive:!0})}),()=>{l&&(d.removeEventListener("keydown",E?S:I,E),d.removeEventListener("compositionstart",i),d.removeEventListener("compositionend",c)),y&&d.removeEventListener(u,N?j:k,N),f.forEach(e=>{e.removeEventListener("scroll",t)}),window.clearTimeout(e)}},[o,a,l,y,u,n,r,m,s,x,_,I,E,S,k,N,j]),i.useEffect(()=>{b.current=!1},[y,u]);const D=i.useMemo(()=>({onKeyDown:I,[ma[f]]:e=>{d&&r(!1,e.nativeEvent,"reference-press")}}),[I,r,d,f]),C=i.useMemo(()=>({onKeyDown:I,onMouseDown(){v.current=!0},onMouseUp(){v.current=!0},[pa[u]]:()=>{b.current=!0}}),[I,u]);return i.useMemo(()=>s?{reference:D,floating:C}:{},[s,D,C])}function wa(e){void 0===e&&(e={});const{nodeId:t}=e,n=function(e){const{open:t=!1,onOpenChange:n,elements:r}=e,a=xr(),o=i.useRef({}),[s]=i.useState(()=>function(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach(e=>e(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,(null==(r=e.get(t))?void 0:r.filter(e=>e!==n))||[])}}}()),l=null!=Mr(),[c,u]=i.useState(r.reference),d=er((e,t,r)=>{o.current.openEvent=e?t:void 0,s.emit("openchange",{open:e,event:t,reason:r,nested:l}),null==n||n(e,t,r)}),f=i.useMemo(()=>({setPositionReference:u}),[]),m=i.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return i.useMemo(()=>({dataRef:o,open:t,onOpenChange:d,elements:m,events:s,floatingId:a,refs:f}),[t,d,m,s,a,f])}({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,a=r.elements,[o,s]=i.useState(null),[l,c]=i.useState(null),u=(null==a?void 0:a.domReference)||o,d=i.useRef(null),f=Ir();mr(()=>{u&&(d.current=u)},[u]);const m=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,p]=i.useState(r);Qn(m,r)||p(r);const[h,g]=i.useState(null),[w,y]=i.useState(null),b=i.useCallback(e=>{e!==E.current&&(E.current=e,g(e))},[]),v=i.useCallback(e=>{e!==N.current&&(N.current=e,y(e))},[]),x=o||h,_=s||w,E=i.useRef(null),N=i.useRef(null),M=i.useRef(d),I=null!=c,S=Zn(c),k=Zn(a),j=Zn(u),D=i.useCallback(()=>{if(!E.current||!N.current)return;const e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),Fn(E.current,N.current,e).then(e=>{const t={...e,isPositioned:!1!==j.current};C.current&&!Qn(M.current,t)&&(M.current=t,wn.flushSync(()=>{f(t)}))})},[m,t,n,k,j]);Yn(()=>{!1===u&&M.current.isPositioned&&(M.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const C=i.useRef(!1);Yn(()=>(C.current=!0,()=>{C.current=!1}),[]),Yn(()=>{if(x&&(E.current=x),_&&(N.current=_),x&&_){if(S.current)return S.current(x,_,D);D()}},[x,_,D,S,I]);const A=i.useMemo(()=>({reference:E,floating:N,setReference:b,setFloating:v}),[b,v]),T=i.useMemo(()=>({reference:x,floating:_}),[x,_]),O=i.useMemo(()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=Wn(T.floating,d.x),r=Wn(T.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+r+"px)",...Vn(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,l,T.floating,d.x,d.y]);return i.useMemo(()=>({...d,update:D,refs:A,elements:T,floatingStyles:O}),[d,D,A,T,O])}({...e,elements:{...a,...l&&{reference:l}}}),p=i.useCallback(e=>{const t=qe(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),contextElement:e}:e;c(t),m.refs.setReference(t)},[m.refs]),h=i.useCallback(e=>{(qe(e)||null===e)&&(d.current=e,s(e)),(qe(m.refs.reference.current)||null===m.refs.reference.current||null!==e&&!qe(e))&&m.refs.setReference(e)},[m.refs]),g=i.useMemo(()=>({...m.refs,setReference:h,setPositionReference:p,domReference:d}),[m.refs,h,p]),w=i.useMemo(()=>({...m.elements,domReference:u}),[m.elements,u]),y=i.useMemo(()=>({...m,...r,refs:g,elements:w,nodeId:t}),[m,g,w,t,r]);return mr(()=>{r.dataRef.current.floatingContext=y;const e=null==f?void 0:f.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),i.useMemo(()=>({...m,context:y,refs:g,elements:w}),[m,g,w,y])}const ya="active",ba="selected";function va(e,t,n){const r=new Map,a="item"===n;let o=e;if(a&&e){const{[ya]:t,[ba]:__,...n}=e;o=n}return{..."floating"===n&&{tabIndex:-1,[ea]:""},...o,...t.map(t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r}).concat(e).reduce((e,t)=>t?(Object.entries(t).forEach(t=>{let[n,o]=t;var i;a&&[ya,ba].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof o&&(null==(i=r.get(n))||i.push(o),e[n]=function(){for(var e,t=arguments.length,a=new Array(t),o=0;o<t;o++)a[o]=arguments[o];return null==(e=r.get(n))?void 0:e.map(e=>e(...a)).find(e=>void 0!==e)})):e[n]=o)}),e):e,{})}}function xa(e){void 0===e&&(e=[]);const t=e.map(e=>null==e?void 0:e.reference),n=e.map(e=>null==e?void 0:e.floating),r=e.map(e=>null==e?void 0:e.item),a=i.useCallback(t=>va(t,e,"reference"),t),o=i.useCallback(t=>va(t,e,"floating"),n),s=i.useCallback(t=>va(t,e,"item"),r);return i.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:s}),[a,o,s])}let _a=!1;function Ea(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Na(e,t){return Ea(t,e===tr||e===nr,e===rr||e===ar)}function Ma(e,t,n){return Ea(t,e===nr,n?e===rr:e===ar)||"Enter"===e||" "===e||""===e}function Ia(e,t,n){return Ea(t,n?e===ar:e===rr,e===tr)}function Sa(e,t){const{open:n,onOpenChange:r,elements:a}=e,{listRef:o,activeIndex:s,onNavigate:l=()=>{},enabled:c=!0,selectedIndex:u=null,allowEscape:d=!1,loop:f=!1,nested:m=!1,rtl:p=!1,virtual:h=!1,focusItemOnOpen:g="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:y=!0,disabledIndices:b,orientation:v="vertical",cols:x=1,scrollItemIntoView:_=!0,virtualItemRef:E,itemSizes:N,dense:M=!1}=t,I=kr(ta(a.floating)),S=Mr(),k=Ir(),j=er(l),D=Ct(a.domReference),C=i.useRef(g),A=i.useRef(null!=u?u:-1),T=i.useRef(null),O=i.useRef(!0),L=i.useRef(j),z=i.useRef(!!a.floating),P=i.useRef(n),R=i.useRef(!1),U=i.useRef(!1),B=kr(b),F=kr(n),Y=kr(_),Q=kr(u),[V,W]=i.useState(),[Z,G]=i.useState(),H=er(function(e,t,n){function r(e){h?(W(e.id),null==k||k.events.emit("virtualfocus",e),E&&(E.current=e)):Ar(e,{preventScroll:!0,sync:!(!Nt()||!_t())&&(_a||R.current)})}void 0===n&&(n=!1);const a=e.current[t.current];a&&r(a),requestAnimationFrame(()=>{const o=e.current[t.current]||a;if(!o)return;a||r(o);const i=Y.current;i&&X&&(n||!O.current)&&(null==o.scrollIntoView||o.scrollIntoView("boolean"==typeof i?{block:"nearest",inline:"nearest"}:i))})});mr(()=>{document.createElement("div").focus({get preventScroll(){return _a=!0,!1}})},[]),mr(()=>{c&&(n&&a.floating?C.current&&null!=u&&(U.current=!0,A.current=u,j(u)):z.current&&(A.current=-1,L.current(null)))},[c,n,a.floating,u,j]),mr(()=>{if(c&&n&&a.floating)if(null==s){if(R.current=!1,null!=Q.current)return;if(z.current&&(A.current=-1,H(o,A)),(!P.current||!z.current)&&C.current&&(null!=T.current||!0===C.current&&null==T.current)){let e=0;const t=()=>{null==o.current[0]?(e<2&&(e?requestAnimationFrame:queueMicrotask)(t),e++):(A.current=null==T.current||Ma(T.current,v,p)||m?sr(o,B.current):lr(o,B.current),T.current=null,j(A.current))};t()}}else ir(o,s)||(A.current=s,H(o,A,U.current),U.current=!1)},[c,n,a.floating,s,Q,m,o,v,p,j,H,B]),mr(()=>{var e;if(!c||a.floating||!k||h||!z.current)return;const t=k.nodesRef.current,n=null==(e=t.find(e=>e.id===S))||null==(e=e.context)?void 0:e.elements.floating,r=gt(It(a.floating)),o=t.some(e=>e.context&&wt(e.context.elements.floating,r));n&&!o&&O.current&&n.focus({preventScroll:!0})},[c,a.floating,k,S,h]),mr(()=>{if(c&&k&&h&&!S)return k.events.on("virtualfocus",e),()=>{k.events.off("virtualfocus",e)};function e(e){G(e.id),E&&(E.current=e)}},[c,k,h,S,E]),mr(()=>{L.current=j,z.current=!!a.floating}),mr(()=>{n||(T.current=null)},[n]),mr(()=>{P.current=n},[n]);const $=null!=s,X=i.useMemo(()=>{function e(e){if(!n)return;const t=o.current.indexOf(e);-1!==t&&j(t)}const t={onFocus(t){let{currentTarget:n}=t;e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},...w&&{onMouseMove(t){let{currentTarget:n}=t;e(n)},onPointerLeave(e){let{pointerType:t}=e;O.current&&"touch"!==t&&(A.current=-1,H(o,A),j(null),h||Ar(I.current,{preventScroll:!0}))}}};return t},[n,I,H,w,o,j,h]),q=er(e=>{if(O.current=!1,R.current=!0,229===e.which)return;if(!F.current&&e.currentTarget===I.current)return;if(m&&Ia(e.key,v,p))return Dt(e),r(!1,e.nativeEvent,"list-navigation"),void(Je(a.domReference)&&(h?null==k||k.events.emit("virtualfocus",a.domReference):a.domReference.focus()));const t=A.current,i=sr(o,b),s=lr(o,b);if(D||("Home"===e.key&&(Dt(e),A.current=i,j(A.current)),"End"===e.key&&(Dt(e),A.current=s,j(A.current))),x>1){const t=N||Array.from({length:o.current.length},()=>({width:1,height:1})),n=function(e,t,n){const r=[];let a=0;return e.forEach((e,o)=>{let{width:i,height:s}=e,l=!1;for(n&&(a=0);!l;){const e=[];for(let n=0;n<i;n++)for(let r=0;r<s;r++)e.push(a+n+r*t);a%t+i<=t&&e.every(e=>null==r[e])?(e.forEach(e=>{r[e]=o}),l=!0):a++}}),[...r]}(t,x,M),r=n.findIndex(e=>null!=e&&!fr(o.current,e,b)),a=n.reduce((e,t,n)=>null==t||fr(o.current,t,b)?e:n,-1),l=n[function(e,t){let{event:n,orientation:r,loop:a,rtl:o,cols:i,disabledIndices:s,minIndex:l,maxIndex:c,prevIndex:u,stopEvent:d=!1}=t,f=u;if(n.key===tr){if(d&&Dt(n),-1===u)f=c;else if(f=cr(e,{startingIndex:f,amount:i,decrement:!0,disabledIndices:s}),a&&(u-i<l||f<0)){const e=u%i,t=c%i,n=c-(t-e);f=t===e?c:t>e?n:n-i}ir(e,f)&&(f=u)}if(n.key===nr&&(d&&Dt(n),-1===u?f=l:(f=cr(e,{startingIndex:u,amount:i,disabledIndices:s}),a&&u+i>c&&(f=cr(e,{startingIndex:u%i-i,amount:i,disabledIndices:s}))),ir(e,f)&&(f=u)),"both"===r){const t=Lt(u/i);n.key===(o?rr:ar)&&(d&&Dt(n),u%i!==i-1?(f=cr(e,{startingIndex:u,disabledIndices:s}),a&&or(f,i,t)&&(f=cr(e,{startingIndex:u-u%i-1,disabledIndices:s}))):a&&(f=cr(e,{startingIndex:u-u%i-1,disabledIndices:s})),or(f,i,t)&&(f=u)),n.key===(o?ar:rr)&&(d&&Dt(n),u%i!==0?(f=cr(e,{startingIndex:u,decrement:!0,disabledIndices:s}),a&&or(f,i,t)&&(f=cr(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:s}))):a&&(f=cr(e,{startingIndex:u+(i-u%i),decrement:!0,disabledIndices:s})),or(f,i,t)&&(f=u));const r=Lt(c/i)===t;ir(e,f)&&(f=a&&r?n.key===(o?ar:rr)?c:cr(e,{startingIndex:u-u%i-1,disabledIndices:s}):u)}return f}({current:n.map(e=>null!=e?o.current[e]:null)},{event:e,orientation:v,loop:f,rtl:p,cols:x,disabledIndices:dr([...b||o.current.map((e,t)=>fr(o.current,t)?t:void 0),void 0],n),minIndex:r,maxIndex:a,prevIndex:ur(A.current>s?i:A.current,t,n,x,e.key===nr?"bl":e.key===(p?rr:ar)?"tr":"tl"),stopEvent:!0})];if(null!=l&&(A.current=l,j(A.current)),"both"===v)return}if(Na(e.key,v)){if(Dt(e),n&&!h&>(e.currentTarget.ownerDocument)===e.currentTarget)return A.current=Ma(e.key,v,p)?i:s,void j(A.current);Ma(e.key,v,p)?A.current=f?t>=s?d&&t!==o.current.length?-1:i:cr(o,{startingIndex:t,disabledIndices:b}):Math.min(s,cr(o,{startingIndex:t,disabledIndices:b})):A.current=f?t<=i?d&&-1!==t?o.current.length:s:cr(o,{startingIndex:t,decrement:!0,disabledIndices:b}):Math.max(i,cr(o,{startingIndex:t,decrement:!0,disabledIndices:b})),ir(o,A.current)?j(null):j(A.current)}}),J=i.useMemo(()=>h&&n&&$&&{"aria-activedescendant":Z||V},[h,n,$,Z,V]),K=i.useMemo(()=>({"aria-orientation":"both"===v?void 0:v,...!Ct(a.domReference)&&J,onKeyDown:q,onPointerMove(){O.current=!0}}),[J,q,a.domReference,v]),ee=i.useMemo(()=>{function e(e){"auto"===g&&vt(e.nativeEvent)&&(C.current=!0)}return{...J,onKeyDown(e){O.current=!1;const t=e.key.startsWith("Arrow"),a=["Home","End"].includes(e.key),i=t||a,s=function(e,t,n){return Ea(t,n?e===rr:e===ar,e===nr)}(e.key,v,p),l=Ia(e.key,v,p),c=Na(e.key,v),d=(m?s:c)||"Enter"===e.key||""===e.key.trim();if(h&&n){const t=null==k?void 0:k.nodesRef.current.find(e=>null==e.parentId),n=k&&t?function(e,t){let n,r=-1;return function t(a,o){o>r&&(n=a,r=o),Tr(e,a).forEach(e=>{t(e.id,o+1)})}(t,0),e.find(e=>e.id===n)}(k.nodesRef.current,t.id):null;if(i&&n&&E){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(s||l){var f,g;const r=(null==(f=n.context)?void 0:f.elements.domReference)===e.currentTarget,a=l&&!r?null==(g=n.context)?void 0:g.elements.domReference:s?o.current.find(e=>(null==e?void 0:e.id)===V):null;a&&(Dt(e),a.dispatchEvent(t),G(void 0))}var w;if((c||a)&&n.context&&n.context.open&&n.parentId&&e.currentTarget!==n.context.elements.domReference)return Dt(e),void(null==(w=n.context.elements.domReference)||w.dispatchEvent(t))}return q(e)}(n||y||!t)&&(d&&(T.current=m&&c?null:e.key),m?s&&(Dt(e),n?(A.current=sr(o,B.current),j(A.current)):r(!0,e.nativeEvent,"list-navigation")):c&&(null!=u&&(A.current=u),Dt(e),!n&&y?r(!0,e.nativeEvent,"list-navigation"):q(e),n&&j(A.current)))},onFocus(){n&&!h&&j(null)},onPointerDown:function(e){C.current=g,"auto"===g&&xt(e.nativeEvent)&&(C.current=!0)},onMouseDown:e,onClick:e}},[V,J,q,B,g,o,m,j,r,n,y,v,p,u,k,h,E]);return i.useMemo(()=>c?{reference:ee,floating:K,item:X}:{},[c,ee,K,X])}const ka=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function ja(e,t){var n;void 0===t&&(t={});const{open:r,floatingId:a}=e,{enabled:o=!0,role:s="dialog"}=t,l=null!=(n=ka.get(s))?n:s,c=xr(),u=null!=Mr(),d=i.useMemo(()=>"tooltip"===l||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:r?a:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":"alertdialog"===l?"dialog":l,"aria-controls":r?a:void 0,..."listbox"===l&&{role:"combobox"},..."menu"===l&&{id:c},..."menu"===l&&u&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}},[l,a,u,r,c,s]),f=i.useMemo(()=>{const e={id:a,...l&&{role:l}};return"tooltip"===l||"label"===s?e:{...e,..."menu"===l&&{"aria-labelledby":c}}},[l,a,c,s]),m=i.useCallback(e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:a+"-option"}};switch(s){case"select":return{...r,"aria-selected":t&&n};case"combobox":return{...r,...t&&{"aria-selected":!0}}}return{}},[a,s]);return i.useMemo(()=>o?{reference:d,floating:f,item:m}:{},[o,d,f,m])}const Da=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?"-":"")+e.toLowerCase());function Ca(e,t){return"function"==typeof e?e(t):e}function Aa(e,t){void 0===t&&(t={});const{initial:n={opacity:0},open:r,close:a,common:o,duration:s=250}=t,l=e.placement,c=l.split("-")[0],u=i.useMemo(()=>({side:c,placement:l}),[c,l]),d="number"==typeof s,f=(d?s:s.open)||0,m=(d?s:s.close)||0,[p,h]=i.useState(()=>({...Ca(o,u),...Ca(n,u)})),{isMounted:g,status:w}=function(e,t){void 0===t&&(t={});const{open:n,elements:{floating:r}}=e,{duration:a=250}=t,o=("number"==typeof a?a:a.close)||0,[s,l]=i.useState("unmounted"),c=function(e,t){const[n,r]=i.useState(e);return e&&!n&&r(!0),i.useEffect(()=>{if(!e&&n){const e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}(n,o);return c||"close"!==s||l("unmounted"),mr(()=>{if(r){if(n){l("initial");const e=requestAnimationFrame(()=>{l("open")});return()=>{cancelAnimationFrame(e)}}l("close")}},[n,r]),{isMounted:c,status:s}}(e,{duration:s}),y=kr(n),b=kr(r),v=kr(a),x=kr(o);return mr(()=>{const e=Ca(y.current,u),t=Ca(v.current,u),n=Ca(x.current,u),r=Ca(b.current,u)||Object.keys(e).reduce((e,t)=>(e[t]="",e),{});if("initial"===w&&h(t=>({transitionProperty:t.transitionProperty,...n,...e})),"open"===w&&h({transitionProperty:Object.keys(r).map(Da).join(","),transitionDuration:f+"ms",...n,...r}),"close"===w){const r=t||e;h({transitionProperty:Object.keys(r).map(Da).join(","),transitionDuration:m+"ms",...n,...r})}},[m,v,y,b,x,f,w,u]),{isMounted:g,styles:p}}function Ta(e,t){const[n,r]=e;let a=!1;const o=t.length;for(let e=0,i=o-1;e<o;i=e++){const[o,s]=t[e]||[0,0],[l,c]=t[i]||[0,0];s>=r!=c>=r&&n<=(l-o)*(r-s)/(c-s)+o&&(a=!a)}return a}function Oa(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e;let a,o=!1,i=null,s=null,l=performance.now();const c=e=>{let{x:n,y:c,placement:u,elements:d,onClose:f,nodeId:m,tree:p}=e;return function(e){function h(){clearTimeout(a),f()}if(clearTimeout(a),!d.domReference||!d.floating||null==u||null==n||null==c)return;const{clientX:g,clientY:w}=e,y=[g,w],b=kt(e),v="mouseleave"===e.type,x=wt(d.floating,b),_=wt(d.domReference,b),E=d.domReference.getBoundingClientRect(),N=d.floating.getBoundingClientRect(),M=u.split("-")[0],I=n>N.right-N.width/2,S=c>N.bottom-N.height/2,k=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(y,E),j=N.width>E.width,D=N.height>E.height,C=(j?E:N).left,A=(j?E:N).right,T=(D?E:N).top,O=(D?E:N).bottom;if(x&&(o=!0,!v))return;if(_&&(o=!1),_&&!v)return void(o=!0);if(v&&qe(e.relatedTarget)&&wt(d.floating,e.relatedTarget))return;if(p&&Tr(p.nodesRef.current,m).some(e=>{let{context:t}=e;return null==t?void 0:t.open}))return;if("top"===M&&c>=E.bottom-1||"bottom"===M&&c<=E.top+1||"left"===M&&n>=E.right-1||"right"===M&&n<=E.left+1)return h();let L=[];switch(M){case"top":L=[[C,E.top+1],[C,N.bottom-1],[A,N.bottom-1],[A,E.top+1]];break;case"bottom":L=[[C,N.top+1],[C,E.bottom-1],[A,E.bottom-1],[A,N.top+1]];break;case"left":L=[[N.right-1,O],[N.right-1,T],[E.left+1,T],[E.left+1,O]];break;case"right":L=[[E.right-1,O],[E.right-1,T],[N.left+1,T],[N.left+1,O]]}if(!Ta([g,w],L)){if(o&&!k)return h();if(!v&&r){const t=function(e,t){const n=performance.now(),r=n-l;if(null===i||null===s||0===r)return i=e,s=t,l=n,null;const a=e-i,o=t-s,c=Math.sqrt(a*a+o*o);return i=e,s=t,l=n,c/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return h()}Ta([g,w],function(e){let[n,r]=e;switch(M){case"top":return[[j?n+t/2:I?n+4*t:n-4*t,r+t+1],[j?n-t/2:I?n+4*t:n-4*t,r+t+1],[N.left,I||j?N.bottom-t:N.top],[N.right,I?j?N.bottom-t:N.top:N.bottom-t]];case"bottom":return[[j?n+t/2:I?n+4*t:n-4*t,r-t],[j?n-t/2:I?n+4*t:n-4*t,r-t],[N.left,I||j?N.top+t:N.bottom],[N.right,I?j?N.top+t:N.bottom:N.top+t]];case"left":{const e=[n+t+1,D?r+t/2:S?r+4*t:r-4*t],a=[n+t+1,D?r-t/2:S?r+4*t:r-4*t];return[[S||D?N.right-t:N.left,N.top],[S?D?N.right-t:N.left:N.right-t,N.bottom],e,a]}case"right":return[[n-t,D?r+t/2:S?r+4*t:r-4*t],[n-t,D?r-t/2:S?r+4*t:r-4*t],[S||D?N.left+t:N.right,N.top],[S?D?N.left+t:N.right:N.left+t,N.bottom]]}}([n,c]))?!o&&r&&(a=window.setTimeout(h,40)):h()}}};return c.__options={blockPointerEvents:n},c}const La=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),za=(...e)=>e.filter((e,t,n)=>Boolean(e)&&n.indexOf(e)===t).join(" ");var Pa={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const Ra=(0,i.forwardRef)(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:s,...l},c)=>(0,i.createElement)("svg",{ref:c,...Pa,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:za("lucide",a),...l},[...s.map(([e,t])=>(0,i.createElement)(e,t)),...Array.isArray(o)?o:[o]])),Ua=(e,t)=>{const n=(0,i.forwardRef)(({className:n,...r},a)=>(0,i.createElement)(Ra,{ref:a,iconNode:t,className:za(`lucide-${La(e)}`,n),...r}));return n.displayName=`${e}`,n},Ba=Ua("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),Fa=Ua("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Ya=Ua("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Qa=Ua("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),Va=(0,i.forwardRef)((e,t)=>{const{variant:n="primary",size:r="md",type:a="button",tag:o="button",className:s,children:l,disabled:c=!1,destructive:u=!1,icon:d=null,iconPosition:f="left",loading:m=!1,...p}=e,h=u&&"focus:ring-focus-error",g=m?"opacity-50 disabled:cursor-not-allowed":"",w={primary:"text-text-on-color bg-button-primary hover:bg-button-primary-hover outline-button-primary hover:outline-button-primary-hover shadow-xs disabled:shadow-none focus:shadow-none disabled:bg-button-disabled disabled:outline-button-disabled",secondary:"text-text-on-color bg-button-secondary hover:bg-button-secondary-hover outline-button-secondary hover:outline-button-secondary-hover shadow-xs focus:shadow-none disabled:shadow-none disabled:bg-button-disabled disabled:outline-button-disabled",outline:"text-button-tertiary-color outline-border-subtle bg-button-tertiary shadow-sm focus:shadow-none hover:bg-button-tertiary-hover hover:outline-border-subtle disabled:bg-button-tertiary disabled:outline-border-disabled",ghost:"text-text-primary bg-transparent outline-transparent hover:bg-button-tertiary-hover",link:"outline-none text-link-primary bg-transparent hover:text-link-primary-hover hover:underline p-0 border-0 leading-none"}[n],y=u&&!c?{primary:"bg-button-danger hover:bg-button-danger-hover outline-button-danger hover:outline-button-danger-hover",secondary:"bg-button-danger hover:bg-button-danger-hover outline-button-danger hover:outline-button-danger-hover",outline:"text-button-danger outline outline-1 outline-button-danger hover:outline-button-danger bg-button-tertiary hover:bg-field-background-error",ghost:"text-button-danger hover:bg-field-background-error",link:"text-button-danger hover:text-button-danger-secondary"}[n]:"",b={xs:"p-1 rounded [&>svg]:size-4",sm:"p-2 rounded [&>svg]:size-4 gap-0.5",md:"p-2.5 rounded-md text-sm [&>svg]:size-5 gap-1",lg:"p-3 rounded-lg text-base [&>svg]:size-6 gap-1"}[r];let v,x=null,_="";return d&&(_="flex items-center justify-center","left"===f?v=d:x=d),(0,P.jsxs)(o,{ref:t,type:a,className:Oe(_,"outline outline-1 border-none cursor-pointer transition-colors duration-300 ease-in-out text-xs font-semibold focus:ring-2 focus:ring-toggle-on focus:ring-offset-2 disabled:text-text-disabled",b,w,y,h,g,{"cursor-default":c},s),disabled:c,"aria-disabled":c,...p,children:[(0,P.jsx)(i.Fragment,{children:v},"left-icon"),l?(0,P.jsx)("span",{className:"px-1",children:l}):null,(0,P.jsx)(i.Fragment,{children:x},"right-icon")]})});Va.displayName="Button";const Wa="light",Za="neutral",Ga=({icon:e,theme:t=Wa,variant:n=Za})=>{const r="[&>svg]:h-5 [&>svg]:w-5",a=(({theme:e=Wa,variant:t=Za})=>{let n="light"===e?"text-icon-secondary":"text-icon-inverse";return n={info:"light"===e?"text-support-info":"text-support-info-inverse",success:"light"===e?"text-support-success":"text-support-success-inverse",warning:"light"===e?"text-support-warning":"text-support-warning-inverse",error:"light"===e?"text-support-error":"text-support-error-inverse"}[t]||n,n})({theme:t,variant:n});if(e&&(0,i.isValidElement)(e))return(0,i.cloneElement)(e,{className:Oe(r,a,e?.props?.className??"")});const o={neutral:(0,P.jsx)(Ba,{className:Oe(r,a)}),info:(0,P.jsx)(Ba,{className:Oe(r,a)}),success:(0,P.jsx)(Fa,{className:Oe(r,a)}),warning:(0,P.jsx)(Ya,{className:Oe(r,a)}),error:(0,P.jsx)(Qa,{className:Oe(r,a)})};return o[n]||o.neutral},Ha=({actionType:e="button",onAction:t=()=>{},actionLabel:n="",theme:r=Wa})=>{const a="focus:ring-0 focus:ring-offset-0 ring-offset-0 focus:outline-none";let o="text-button-primary border-button-primary hover:border-button-primary hover:text-button-primary-hover";switch("dark"===r&&(o="text-text-inverse border-text-inverse hover:border-text-inverse hover:text-text-inverse"),e){case"button":return(0,P.jsx)(Va,{variant:"outline",size:"xs",onClick:t,className:Oe("rounded",a,o,"dark"===r?"bg-transparent hover:bg-transparent":"bg-white hover:bg-white"),children:n});case"link":return(0,P.jsx)(Va,{variant:"link",size:"xs",onClick:t,className:Oe(a,o),children:n});default:return null}},$a=({theme:e=Wa,title:t="",inline:n=!1})=>t?(0,P.jsx)("span",{className:Oe("block",{light:"text-text-primary",dark:"text-text-inverse"}[e],"text-sm leading-5 font-semibold",n?"inline":"block"),children:t}):null,Xa=({theme:e=Wa,content:t="",inline:n=!1})=>t?(0,P.jsx)("span",{className:Oe({light:"text-text-primary",dark:"text-text-inverse"}[e],"block text-sm [&_*]:text-sm leading-5 [&_*]:leading-5 font-normal [word-break:break-word]",n?"inline":"block"),children:t}):null,qa=(...e)=>t=>{e.forEach(e=>{"function"==typeof e?e(t):e&&(e.current=t)})},Ja=({variant:e="dark",placement:t="bottom",title:n="",content:r,arrow:a=!1,open:o,setOpen:s,children:l,className:c,tooltipPortalRoot:u,tooltipPortalId:d,boundary:f="clippingAncestors",strategy:m="fixed",offset:p=8,triggers:h=["hover","focus"],interactive:g=!1})=>{const w=(0,i.useMemo)(()=>"boolean"==typeof o&&"function"==typeof s,[o,s]),[y,b]=(0,i.useState)(!1),v=(0,i.useRef)(null),{refs:x,floatingStyles:_,context:E}=wa({open:w?o:y,onOpenChange:w?s:b,placement:t,strategy:m,middleware:[Gn(p),$n({boundary:f}),Hn({boundary:f}),qn({element:v})],whileElementsMounted:Rn}),N=fa(E,{enabled:!w&&h.includes("click")}),M=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,dataRef:a,events:o,elements:s}=e,{enabled:l=!0,delay:c=0,handleClose:u=null,mouseOnly:d=!1,restMs:f=0,move:m=!0}=t,p=Ir(),h=Mr(),g=kr(u),w=kr(c),y=kr(n),b=i.useRef(),v=i.useRef(-1),x=i.useRef(),_=i.useRef(-1),E=i.useRef(!0),N=i.useRef(!1),M=i.useRef(()=>{}),I=i.useRef(!1),S=i.useCallback(()=>{var e;const t=null==(e=a.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t},[a]);i.useEffect(()=>{if(l)return o.on("openchange",e),()=>{o.off("openchange",e)};function e(e){let{open:t}=e;t||(clearTimeout(v.current),clearTimeout(_.current),E.current=!0,I.current=!1)}},[l,o]),i.useEffect(()=>{if(!l)return;if(!g.current)return;if(!n)return;function e(e){S()&&r(!1,e,"hover")}const t=It(s.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}},[s.floating,n,r,l,g,S]);const k=i.useCallback(function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const a=Dr(w.current,"close",b.current);a&&!x.current?(clearTimeout(v.current),v.current=window.setTimeout(()=>r(!1,e,n),a)):t&&(clearTimeout(v.current),r(!1,e,n))},[w,r]),j=er(()=>{M.current(),x.current=void 0}),D=er(()=>{if(N.current){const e=It(s.floating).body;e.style.pointerEvents="",e.removeAttribute(jr),N.current=!1}}),C=er(()=>!!a.current.openEvent&&["click","mousedown"].includes(a.current.openEvent.type));i.useEffect(()=>{if(l&&qe(s.domReference)){var e;const r=s.domReference;return n&&r.addEventListener("mouseleave",i),null==(e=s.floating)||e.addEventListener("mouseleave",i),m&&r.addEventListener("mousemove",t,{once:!0}),r.addEventListener("mouseenter",t),r.addEventListener("mouseleave",o),()=>{var e;n&&r.removeEventListener("mouseleave",i),null==(e=s.floating)||e.removeEventListener("mouseleave",i),m&&r.removeEventListener("mousemove",t),r.removeEventListener("mouseenter",t),r.removeEventListener("mouseleave",o)}}function t(e){if(clearTimeout(v.current),E.current=!1,d&&!Mt(b.current)||f>0&&!Dr(w.current,"open"))return;const t=Dr(w.current,"open",b.current);t?v.current=window.setTimeout(()=>{y.current||r(!0,e,"hover")},t):n||r(!0,e,"hover")}function o(e){if(C())return;M.current();const t=It(s.floating);if(clearTimeout(_.current),I.current=!1,g.current&&a.current.floatingContext){n||clearTimeout(v.current),x.current=g.current({...a.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){D(),j(),C()||k(e,!0,"safe-polygon")}});const r=x.current;return t.addEventListener("mousemove",r),void(M.current=()=>{t.removeEventListener("mousemove",r)})}("touch"!==b.current||!wt(s.floating,e.relatedTarget))&&k(e)}function i(e){C()||a.current.floatingContext&&(null==g.current||g.current({...a.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){D(),j(),C()||k(e)}})(e))}},[s,l,e,d,f,m,k,j,D,r,n,y,p,w,g,a,C]),mr(()=>{var e;if(l&&n&&null!=(e=g.current)&&e.__options.blockPointerEvents&&S()){N.current=!0;const e=s.floating;if(qe(s.domReference)&&e){var t;const n=It(s.floating).body;n.setAttribute(jr,"");const r=s.domReference,a=null==p||null==(t=p.nodesRef.current.find(e=>e.id===h))||null==(t=t.context)?void 0:t.elements.floating;return a&&(a.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}},[l,n,h,s,p,g,S]),mr(()=>{n||(b.current=void 0,I.current=!1,j(),D())},[n,j,D]),i.useEffect(()=>()=>{j(),clearTimeout(v.current),clearTimeout(_.current),D()},[l,s.domReference,j,D]);const A=i.useMemo(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function a(){E.current||y.current||r(!0,t,"hover")}d&&!Mt(b.current)||n||0===f||I.current&&e.movementX**2+e.movementY**2<2||(clearTimeout(_.current),"touch"===b.current?a():(I.current=!0,_.current=window.setTimeout(a,f)))}}},[d,r,n,y,f]),T=i.useMemo(()=>({onMouseEnter(){clearTimeout(v.current)},onMouseLeave(e){C()||k(e.nativeEvent,!1)}}),[k,C]);return i.useMemo(()=>l?{reference:A,floating:T}:{},[l,A,T])}(E,{move:!1,enabled:!w&&h.includes("hover"),...g&&{handleClose:Oa()}}),I=function(e,t){void 0===t&&(t={});const{open:n,onOpenChange:r,events:a,dataRef:o,elements:s}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=i.useRef(!1),d=i.useRef(),f=i.useRef(!0);i.useEffect(()=>{if(!l)return;const e=He(s.domReference);function t(){!n&&Je(s.domReference)&&s.domReference===gt(It(s.domReference))&&(u.current=!0)}function r(){f.current=!0}return e.addEventListener("blur",t),e.addEventListener("keydown",r,!0),()=>{e.removeEventListener("blur",t),e.removeEventListener("keydown",r,!0)}},[s.domReference,n,l]),i.useEffect(()=>{if(l)return a.on("openchange",e),()=>{a.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(u.current=!0)}},[a,l]),i.useEffect(()=>()=>{clearTimeout(d.current)},[]);const m=i.useMemo(()=>({onPointerDown(e){xt(e.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;const t=kt(e.nativeEvent);if(c&&qe(t))try{if(_t()&&Nt())throw Error();if(!t.matches(":focus-visible"))return}catch(e){if(!f.current&&!jt(t))return}r(!0,e.nativeEvent,"focus")},onBlur(e){u.current=!1;const t=e.relatedTarget,n=e.nativeEvent,a=qe(t)&&t.hasAttribute(Sr("focus-guard"))&&"outside"===t.getAttribute("data-type");d.current=window.setTimeout(()=>{var e;const i=gt(s.domReference?s.domReference.ownerDocument:document);(t||i!==s.domReference)&&(wt(null==(e=o.current.floatingContext)?void 0:e.refs.floating.current,i)||wt(s.domReference,i)||a||r(!1,n,"focus"))})}}),[o,s.domReference,r,c]);return i.useMemo(()=>l?{reference:m}:{},[l,m])}(E,{enabled:!w&&h.includes("focus")}),S=ga(E),k=ja(E,{role:"tooltip"}),{getReferenceProps:j,getFloatingProps:D}=xa([N,M,I,S,k]),{isMounted:C,styles:A}=Aa(E,{duration:150,initial:{opacity:0},open:{opacity:1},close:{opacity:0}}),T={light:"bg-tooltip-background-light text-text-primary",dark:"bg-tooltip-background-dark text-text-on-color"}[e],O="dark"===e?"text-tooltip-background-dark":"text-tooltip-background-light";return(0,P.jsxs)(i.Fragment,{children:[(0,i.isValidElement)(l)&&(0,P.jsx)(i.Fragment,{children:(0,i.cloneElement)(l,{ref:qa(l.ref,x.setReference),className:Oe(l.props.className),...j()})},"tooltip-reference"),(0,P.jsx)(Jr,{id:d,root:u,children:C&&(0,P.jsxs)("div",{className:Oe("absolute z-20 py-2 px-3 rounded-md text-xs leading-4 shadow-soft-shadow-lg",T,"max-w-80 w-fit",c),ref:x.setFloating,style:{..._,...A},...D(),children:[(0,P.jsxs)("div",{children:[!!n&&(0,P.jsx)("span",{className:"font-semibold",children:n},"tooltip-title"),!!r&&(0,P.jsx)("div",{className:"font-normal",children:r},"tooltip-content")]}),a&&(0,P.jsx)(_r,{ref:v,context:E,className:Oe("fill-current",O)})]})})]})};function Ka(e){if("undefined"==typeof Proxy)return e;const t=new Map;return new Proxy((...t)=>e(...t),{get:(n,r)=>"create"===r?e:(t.has(r)||t.set(r,e(r)),t.get(r))})}function eo(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}Ja.displayName="Tooltip";const to=e=>Array.isArray(e);function no(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function ro(e){return"string"==typeof e||Array.isArray(e)}function ao(e){const t=[{},{}];return null==e||e.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function oo(e,t,n,r){if("function"==typeof t){const[a,o]=ao(r);t=t(void 0!==n?n:e.custom,a,o)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[a,o]=ao(r);t=t(void 0!==n?n:e.custom,a,o)}return t}function io(e,t,n){const r=e.getProps();return oo(r,t,void 0!==n?n:r.custom,e)}const so=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],lo=["initial",...so];function co(e){let t;return()=>(void 0===t&&(t=e()),t)}const uo=co(()=>void 0!==window.ScrollTimeline);class fo{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=t}attachTimeline(e,t){const n=this.animations.map(n=>uo()&&n.attachTimeline?n.attachTimeline(e):"function"==typeof t?t(n):void 0);return()=>{n.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class mo extends fo{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function po(e,t){return e?e[t]||e.default||e:void 0}const ho=2e4;function go(e){let t=0,n=e.next(t);for(;!n.done&&t<ho;)t+=50,n=e.next(t);return t>=ho?1/0:t}function wo(e){return"function"==typeof e}function yo(e,t){e.timeline=t,e.onfinish=null}const bo=e=>Array.isArray(e)&&"number"==typeof e[0],vo={linearEasing:void 0};function xo(e,t){const n=co(e);return()=>{var e;return null!==(e=vo[t])&&void 0!==e?e:n()}}const _o=xo(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing"),Eo=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},No=(e,t,n=10)=>{let r="";const a=Math.max(Math.round(t/n),2);for(let t=0;t<a;t++)r+=e(Eo(0,a-1,t))+", ";return`linear(${r.substring(0,r.length-2)})`};function Mo(e){return Boolean("function"==typeof e&&_o()||!e||"string"==typeof e&&(e in So||_o())||bo(e)||Array.isArray(e)&&e.every(Mo))}const Io=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,So={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Io([0,.65,.55,1]),circOut:Io([.55,0,1,.45]),backIn:Io([.31,.01,.66,-.59]),backOut:Io([.33,1.53,.69,.99])};function ko(e,t){return e?"function"==typeof e&&_o()?No(e,t):bo(e)?Io(e):Array.isArray(e)?e.map(e=>ko(e,t)||So.easeOut):So[e]:void 0}const jo={x:!1,y:!1};function Do(){return jo.x||jo.y}function Co(e,t){const n=function(e){if(e instanceof Element)return[e];if("string"==typeof e){let t=document;const n=t.querySelectorAll(e);return n?Array.from(n):[]}return Array.from(e)}(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function Ao(e){return t=>{"touch"===t.pointerType||Do()||e(t)}}const To=(e,t)=>!!t&&(e===t||To(e,t.parentElement)),Oo=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,Lo=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]),zo=new WeakSet;function Po(e){return t=>{"Enter"===t.key&&e(t)}}function Ro(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function Uo(e){return Oo(e)&&!Do()}const Bo=e=>1e3*e,Fo=e=>e/1e3,Yo=e=>e,Qo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Vo=new Set(Qo),Wo=new Set(["width","height","top","left","right","bottom",...Qo]),Zo=e=>to(e)?e[e.length-1]||0:e,Go=["read","resolveKeyframes","update","preRender","render","postRender"];function Ho(e,t){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,i=Go.reduce((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,a=!1;const o=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function s(t){o.has(t)&&(l.schedule(t),e()),t(i)}const l={schedule:(e,a=!1,i=!1)=>{const s=i&&r?t:n;return a&&o.add(e),s.has(e)||s.add(e),e},cancel:e=>{n.delete(e),o.delete(e)},process:e=>{i=e,r?a=!0:(r=!0,[t,n]=[n,t],t.forEach(s),t.clear(),r=!1,a&&(a=!1,l.process(e)))}};return l}(o),e),{}),{read:s,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:f}=i,m=()=>{const o=performance.now();n=!1,a.delta=r?1e3/60:Math.max(Math.min(o-a.timestamp,40),1),a.timestamp=o,a.isProcessing=!0,s.process(a),l.process(a),c.process(a),u.process(a),d.process(a),f.process(a),a.isProcessing=!1,n&&t&&(r=!1,e(m))};return{schedule:Go.reduce((t,o)=>{const s=i[o];return t[o]=(t,o=!1,i=!1)=>(n||(n=!0,r=!0,a.isProcessing||e(m)),s.schedule(t,o,i)),t},{}),cancel:e=>{for(let t=0;t<Go.length;t++)i[Go[t]].cancel(e)},state:a,steps:i}}const{schedule:$o,cancel:Xo,state:qo,steps:Jo}=Ho("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Yo,!0);let Ko;function ei(){Ko=void 0}const ti={now:()=>(void 0===Ko&&ti.set(qo.isProcessing?qo.timestamp:performance.now()),Ko),set:e=>{Ko=e,queueMicrotask(ei)}};function ni(e,t){-1===e.indexOf(t)&&e.push(t)}function ri(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class ai{constructor(){this.subscriptions=[]}add(e){return ni(this.subscriptions,e),()=>ri(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let a=0;a<r;a++){const r=this.subscriptions[a];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function oi(e,t){return t?e*(1e3/t):0}const ii={current:void 0};class si{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const n=ti.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=ti.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new ai);const n=this.events[e].add(t);return"change"===e?()=>{n(),$o.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return ii.current&&ii.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=ti.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return oi(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function li(e,t){return new si(e,t)}function ci(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,li(n))}const ui=e=>Boolean(e&&e.getVelocity);function di(e,t){const n=e.getValue("willChange");if(function(e){return Boolean(ui(e)&&e.add)}(n))return n.add(t)}const fi=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),mi="data-"+fi("framerAppearId");function pi(e){return e.props[mi]}const hi=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function gi(e,t,n,r){if(e===t&&n===r)return Yo;return a=>0===a||1===a?a:hi(function(e,t,n,r,a){let o,i,s=0;do{i=t+(n-t)/2,o=hi(i,r,a)-e,o>0?n=i:t=i}while(Math.abs(o)>1e-7&&++s<12);return i}(a,0,1,e,n),t,r)}const wi=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,yi=e=>t=>1-e(1-t),bi=gi(.33,1.53,.69,.99),vi=yi(bi),xi=wi(vi),_i=e=>(e*=2)<1?.5*vi(e):.5*(2-Math.pow(2,-10*(e-1))),Ei=e=>1-Math.sin(Math.acos(e)),Ni=yi(Ei),Mi=wi(Ei),Ii=e=>/^0[^.\s]+$/u.test(e);function Si(e){return"number"==typeof e?0===e:null===e||"none"===e||"0"===e||Ii(e)}const ki=(e,t,n)=>n>t?t:n<e?e:n,ji={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Di={...ji,transform:e=>ki(0,1,e)},Ci={...ji,default:1},Ai=e=>Math.round(1e5*e)/1e5,Ti=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,Oi=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Li=(e,t)=>n=>Boolean("string"==typeof n&&Oi.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),zi=(e,t,n)=>r=>{if("string"!=typeof r)return r;const[a,o,i,s]=r.match(Ti);return{[e]:parseFloat(a),[t]:parseFloat(o),[n]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},Pi={...ji,transform:e=>Math.round((e=>ki(0,255,e))(e))},Ri={test:Li("rgb","red"),parse:zi("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Pi.transform(e)+", "+Pi.transform(t)+", "+Pi.transform(n)+", "+Ai(Di.transform(r))+")"},Ui={test:Li("#"),parse:function(e){let t="",n="",r="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,r+=r,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}},transform:Ri.transform},Bi=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Fi=Bi("deg"),Yi=Bi("%"),Qi=Bi("px"),Vi=Bi("vh"),Wi=Bi("vw"),Zi={...Yi,parse:e=>Yi.parse(e)/100,transform:e=>Yi.transform(100*e)},Gi={test:Li("hsl","hue"),parse:zi("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Yi.transform(Ai(t))+", "+Yi.transform(Ai(n))+", "+Ai(Di.transform(r))+")"},Hi={test:e=>Ri.test(e)||Ui.test(e)||Gi.test(e),parse:e=>Ri.test(e)?Ri.parse(e):Gi.test(e)?Gi.parse(e):Ui.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?Ri.transform(e):Gi.transform(e)},$i=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Xi="number",qi="color",Ji=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ki(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},a=[];let o=0;const i=t.replace(Ji,e=>(Hi.test(e)?(r.color.push(o),a.push(qi),n.push(Hi.parse(e))):e.startsWith("var(")?(r.var.push(o),a.push("var"),n.push(e)):(r.number.push(o),a.push(Xi),n.push(parseFloat(e))),++o,"${}")).split("${}");return{values:n,split:i,indexes:r,types:a}}function es(e){return Ki(e).values}function ts(e){const{split:t,types:n}=Ki(e),r=t.length;return e=>{let a="";for(let o=0;o<r;o++)if(a+=t[o],void 0!==e[o]){const t=n[o];a+=t===Xi?Ai(e[o]):t===qi?Hi.transform(e[o]):e[o]}return a}}const ns=e=>"number"==typeof e?0:e,rs={test:function(e){var t,n;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(Ti))||void 0===t?void 0:t.length)||0)+((null===(n=e.match($i))||void 0===n?void 0:n.length)||0)>0},parse:es,createTransformer:ts,getAnimatableNone:function(e){const t=es(e);return ts(e)(t.map(ns))}},as=new Set(["brightness","contrast","saturate","opacity"]);function os(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(Ti)||[];if(!r)return e;const a=n.replace(r,"");let o=as.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+a+")"}const is=/\b([a-z-]*)\(.*?\)/gu,ss={...rs,getAnimatableNone:e=>{const t=e.match(is);return t?t.map(os).join(" "):e}},ls={borderWidth:Qi,borderTopWidth:Qi,borderRightWidth:Qi,borderBottomWidth:Qi,borderLeftWidth:Qi,borderRadius:Qi,radius:Qi,borderTopLeftRadius:Qi,borderTopRightRadius:Qi,borderBottomRightRadius:Qi,borderBottomLeftRadius:Qi,width:Qi,maxWidth:Qi,height:Qi,maxHeight:Qi,top:Qi,right:Qi,bottom:Qi,left:Qi,padding:Qi,paddingTop:Qi,paddingRight:Qi,paddingBottom:Qi,paddingLeft:Qi,margin:Qi,marginTop:Qi,marginRight:Qi,marginBottom:Qi,marginLeft:Qi,backgroundPositionX:Qi,backgroundPositionY:Qi},cs={rotate:Fi,rotateX:Fi,rotateY:Fi,rotateZ:Fi,scale:Ci,scaleX:Ci,scaleY:Ci,scaleZ:Ci,skew:Fi,skewX:Fi,skewY:Fi,distance:Qi,translateX:Qi,translateY:Qi,translateZ:Qi,x:Qi,y:Qi,z:Qi,perspective:Qi,transformPerspective:Qi,opacity:Di,originX:Zi,originY:Zi,originZ:Qi},us={...ji,transform:Math.round},ds={...ls,...cs,zIndex:us,size:Qi,fillOpacity:Di,strokeOpacity:Di,numOctaves:us},fs={...ds,color:Hi,backgroundColor:Hi,outlineColor:Hi,fill:Hi,stroke:Hi,borderColor:Hi,borderTopColor:Hi,borderRightColor:Hi,borderBottomColor:Hi,borderLeftColor:Hi,filter:ss,WebkitFilter:ss},ms=e=>fs[e];function ps(e,t){let n=ms(e);return n!==ss&&(n=rs),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const hs=new Set(["auto","none","0"]),gs=e=>e===ji||e===Qi,ws=(e,t)=>parseFloat(e.split(", ")[t]),ys=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const a=r.match(/^matrix3d\((.+)\)$/u);if(a)return ws(a[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?ws(t[1],e):0}},bs=new Set(["x","y","z"]),vs=Qo.filter(e=>!bs.has(e)),xs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:ys(4,13),y:ys(5,14)};xs.translateX=xs.x,xs.translateY=xs.y;const _s=new Set;let Es=!1,Ns=!1;function Ms(){if(Ns){const e=Array.from(_s).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{const t=function(e){const t=[];return vs.forEach(n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=n.get(e);t&&t.forEach(([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}Ns=!1,Es=!1,_s.forEach(e=>e.complete()),_s.clear()}function Is(){_s.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ns=!0)})}class Ss{constructor(e,t,n,r,a,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=a,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(_s.add(this),Es||(Es=!0,$o.read(Is),$o.resolveKeyframes(Ms))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let a=0;a<e.length;a++)if(null===e[a])if(0===a){const a=null==r?void 0:r.get(),o=e[e.length-1];if(void 0!==a)e[0]=a;else if(n&&t){const r=n.readValue(t,o);null!=r&&(e[0]=r)}void 0===e[0]&&(e[0]=o),r&&void 0===a&&r.set(e[0])}else e[a]=e[a-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),_s.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,_s.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}let ks=Yo,js=Yo;const Ds=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Cs=e=>t=>"string"==typeof t&&t.startsWith(e),As=Cs("--"),Ts=Cs("var(--"),Os=e=>!!Ts(e)&&Ls.test(e.split("/*")[0].trim()),Ls=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,zs=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ps(e,t,n=1){js(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,a]=function(e){const t=zs.exec(e);if(!t)return[,];const[,n,r,a]=t;return[`--${null!=n?n:r}`,a]}(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const e=o.trim();return Ds(e)?parseFloat(e):e}return Os(a)?Ps(a,t,n+1):a}const Rs=e=>t=>t.test(e),Us=[ji,Qi,Yi,Fi,Wi,Vi,{test:e=>"auto"===e,parse:e=>e}],Bs=e=>Us.find(Rs(e));class Fs extends Ss{constructor(e,t,n,r,a){super(e,t,n,r,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if("string"==typeof r&&(r=r.trim(),Os(r))){const a=Ps(r,t.current);void 0!==a&&(e[n]=a),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!Wo.has(n)||2!==e.length)return;const[r,a]=e,o=Bs(r),i=Bs(a);if(o!==i)if(gs(o)&&gs(i))for(let t=0;t<e.length;t++){const n=e[t];"string"==typeof n&&(e[t]=parseFloat(n))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)Si(e[t])&&n.push(t);n.length&&function(e,t,n){let r,a=0;for(;a<e.length&&!r;){const t=e[a];"string"==typeof t&&!hs.has(t)&&Ki(t).values.length&&(r=e[a]),a++}if(r&&n)for(const a of t)e[a]=ps(n,r)}(e,n,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=xs[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];void 0!==r&&e.getValue(n,r).jump(r,!1)}measureEndState(){var e;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const a=t.getValue(n);a&&a.jump(this.measuredOrigin,!1);const o=r.length-1,i=r[o];r[o]=xs[n](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),(null===(e=this.removedTransforms)||void 0===e?void 0:e.length)&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const Ys=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!rs.test(e)&&"0"!==e||e.startsWith("url(")));function Qs(e,t,n,r){const a=e[0];if(null===a)return!1;if("display"===t||"visibility"===t)return!0;const o=e[e.length-1],i=Ys(a,t),s=Ys(o,t);return ks(i===s,`You are trying to animate ${t} from "${a}" to "${o}". ${a} is not an animatable value - to enable this animation set ${a} to a value animatable to ${o} via the \`style\` property.`),!(!i||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}(e)||("spring"===n||wo(n))&&r)}const Vs=e=>null!==e;function Ws(e,{repeat:t,repeatType:n="loop"},r){const a=e.filter(Vs),o=t&&"loop"!==n&&t%2==1?0:a.length-1;return o&&void 0!==r?r:a[o]}class Zs{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:a=0,repeatType:o="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ti.now(),this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:a,repeatType:o,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(Is(),Ms()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=ti.now(),this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:a,delay:o,onComplete:i,onUpdate:s,isGenerator:l}=this.options;if(!l&&!Qs(e,n,r,a)){if(!o)return s&&s(Ws(e,this.options,t)),i&&i(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const Gs=(e,t,n)=>e+(t-e)*n;function Hs(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function $s(e,t){return n=>n>0?t:e}const Xs=(e,t,n)=>{const r=e*e,a=n*(t*t-r)+r;return a<0?0:Math.sqrt(a)},qs=[Ui,Ri,Gi];function Js(e){const t=(n=e,qs.find(e=>e.test(n)));var n;if(ks(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let r=t.parse(e);return t===Gi&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let a=0,o=0,i=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;a=Hs(s,r,e+1/3),o=Hs(s,r,e),i=Hs(s,r,e-1/3)}else a=o=i=n;return{red:Math.round(255*a),green:Math.round(255*o),blue:Math.round(255*i),alpha:r}}(r)),r}const Ks=(e,t)=>{const n=Js(e),r=Js(t);if(!n||!r)return $s(e,t);const a={...n};return e=>(a.red=Xs(n.red,r.red,e),a.green=Xs(n.green,r.green,e),a.blue=Xs(n.blue,r.blue,e),a.alpha=Gs(n.alpha,r.alpha,e),Ri.transform(a))},el=(e,t)=>n=>t(e(n)),tl=(...e)=>e.reduce(el),nl=new Set(["none","hidden"]);function rl(e,t){return n=>Gs(e,t,n)}function al(e){return"number"==typeof e?rl:"string"==typeof e?Os(e)?$s:Hi.test(e)?Ks:sl:Array.isArray(e)?ol:"object"==typeof e?Hi.test(e)?Ks:il:$s}function ol(e,t){const n=[...e],r=n.length,a=e.map((e,n)=>al(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=a[t](e);return n}}function il(e,t){const n={...e,...t},r={};for(const a in n)void 0!==e[a]&&void 0!==t[a]&&(r[a]=al(e[a])(e[a],t[a]));return e=>{for(const t in r)n[t]=r[t](e);return n}}const sl=(e,t)=>{const n=rs.createTransformer(t),r=Ki(e),a=Ki(t);return r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length?nl.has(e)&&!a.values.length||nl.has(t)&&!r.values.length?function(e,t){return nl.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):tl(ol(function(e,t){var n;const r=[],a={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],s=e.indexes[i][a[i]],l=null!==(n=e.values[s])&&void 0!==n?n:0;r[o]=l,a[i]++}return r}(r,a),a.values),n):(ks(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),$s(e,t))};function ll(e,t,n){return"number"==typeof e&&"number"==typeof t&&"number"==typeof n?Gs(e,t,n):al(e)(e,t)}function cl(e,t,n){const r=Math.max(t-5,0);return oi(n-e(r),t-r)}const ul=.01,dl=2,fl=.005,ml=.5;const pl=12;function hl(e,t){return e*Math.sqrt(1-t*t)}const gl=["duration","bounce"],wl=["stiffness","damping","mass"];function yl(e,t){return t.some(t=>void 0!==e[t])}function bl(e=.3,t=.3){const n="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:a}=n;const o=n.keyframes[0],i=n.keyframes[n.keyframes.length-1],s={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:d,velocity:f,isResolvedFromDuration:m}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!yl(e,wl)&&yl(e,gl))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(1.2*n),a=r*r,o=2*ki(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:1,stiffness:a,damping:o}}else{const n=function({duration:e=800,bounce:t=.3,velocity:n=0,mass:r=1}){let a,o;ks(e<=Bo(10),"Spring duration must be 10 seconds or less");let i=1-t;i=ki(.05,1,i),e=ki(.01,10,Fo(e)),i<1?(a=t=>{const r=t*i,a=r*e;return.001-(r-n)/hl(t,i)*Math.exp(-a)},o=t=>{const r=t*i*e,o=r*n+n,s=Math.pow(i,2)*Math.pow(t,2)*e,l=Math.exp(-r),c=hl(Math.pow(t,2),i);return(.001-a(t)>0?-1:1)*((o-s)*l)/c}):(a=t=>Math.exp(-t*e)*((t-n)*e+1)-.001,o=t=>Math.exp(-t*e)*(e*e*(n-t)));const s=function(e,t,n){let r=n;for(let n=1;n<pl;n++)r-=e(r)/t(r);return r}(a,o,5/e);if(e=Bo(e),isNaN(s))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(s,2)*r;return{stiffness:t,damping:2*i*Math.sqrt(r*t),duration:e}}}(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}({...n,velocity:-Fo(n.velocity||0)}),p=f||0,h=c/(2*Math.sqrt(l*u)),g=i-o,w=Fo(Math.sqrt(l/u)),y=Math.abs(g)<5;let b;if(r||(r=y?ul:dl),a||(a=y?fl:ml),h<1){const e=hl(w,h);b=t=>{const n=Math.exp(-h*w*t);return i-n*((p+h*w*g)/e*Math.sin(e*t)+g*Math.cos(e*t))}}else if(1===h)b=e=>i-Math.exp(-w*e)*(g+(p+w*g)*e);else{const e=w*Math.sqrt(h*h-1);b=t=>{const n=Math.exp(-h*w*t),r=Math.min(e*t,300);return i-n*((p+h*w*g)*Math.sinh(r)+e*g*Math.cosh(r))/e}}const v={calculatedDuration:m&&d||null,next:e=>{const t=b(e);if(m)s.done=e>=d;else{let n=0;h<1&&(n=0===e?Bo(p):cl(b,e,t));const o=Math.abs(n)<=r,l=Math.abs(i-t)<=a;s.done=o&&l}return s.value=s.done?i:t,s},toString:()=>{const e=Math.min(go(v),ho),t=No(t=>v.next(e*t).value,e,30);return e+"ms "+t}};return v}function vl({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:o=500,modifyTarget:i,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],f={done:!1,value:d},m=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let p=n*t;const h=d+p,g=void 0===i?h:i(h);g!==h&&(p=g-d);const w=e=>-p*Math.exp(-e/r),y=e=>g+w(e),b=e=>{const t=w(e),n=y(e);f.done=Math.abs(t)<=c,f.value=f.done?g:n};let v,x;const _=e=>{var t;t=f.value,(void 0!==s&&t<s||void 0!==l&&t>l)&&(v=e,x=bl({keyframes:[f.value,m(f.value)],velocity:cl(y,e,f.value),damping:a,stiffness:o,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return x||void 0!==v||(t=!0,b(e),_(e)),void 0!==v&&e>=v?x.next(e-v):(!t&&b(e),f)}}}const xl=gi(.42,0,1,1),_l=gi(0,0,.58,1),El=gi(.42,0,.58,1),Nl={linear:Yo,easeIn:xl,easeInOut:El,easeOut:_l,circIn:Ei,circInOut:Mi,circOut:Ni,backIn:vi,backInOut:xi,backOut:bi,anticipate:_i},Ml=e=>{if(bo(e)){js(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,a]=e;return gi(t,n,r,a)}return"string"==typeof e?(js(void 0!==Nl[e],`Invalid easing type '${e}'`),Nl[e]):e};function Il({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const a=(e=>Array.isArray(e)&&"number"!=typeof e[0])(r)?r.map(Ml):Ml(r),o={done:!1,value:t[0]},i=function(e,t){return e.map(e=>e*t)}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const a=Eo(0,t,r);e.push(Gs(n,1,a))}}(t,e.length-1),t}(t),e),s=function(e,t,{clamp:n=!0,ease:r,mixer:a}={}){const o=e.length;if(js(o===t.length,"Both input and output ranges must be the same length"),1===o)return()=>t[0];if(2===o&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,n){const r=[],a=n||ll,o=e.length-1;for(let n=0;n<o;n++){let o=a(e[n],e[n+1]);if(t){const e=Array.isArray(t)?t[n]||Yo:t;o=tl(e,o)}r.push(o)}return r}(t,r,a),l=s.length,c=n=>{if(i&&n<e[0])return t[0];let r=0;if(l>1)for(;r<e.length-2&&!(n<e[r+1]);r++);const a=Eo(e[r],e[r+1],n);return s[r](a)};return n?t=>c(ki(e[0],e[o-1],t)):c}(i,t,{ease:Array.isArray(a)?a:(l=t,c=a,l.map(()=>c||El).splice(0,l.length-1))});var l,c;return{calculatedDuration:e,next:t=>(o.value=s(t),o.done=t>=e,o)}}const Sl=e=>{const t=({timestamp:t})=>e(t);return{start:()=>$o.update(t,!0),stop:()=>Xo(t),now:()=>qo.isProcessing?qo.timestamp:ti.now()}},kl={decay:vl,inertia:vl,tween:Il,keyframes:Il,spring:bl},jl=e=>e/100;class Dl extends Zs{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:n,element:r,keyframes:a}=this.options,o=(null==r?void 0:r.KeyframeResolver)||Ss;this.resolver=new o(a,(e,t)=>this.onKeyframesResolved(e,t),t,n,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:a,velocity:o=0}=this.options,i=wo(t)?t:kl[t]||Il;let s,l;i!==Il&&"number"!=typeof e[0]&&(s=tl(jl,ll(e[0],e[1])),e=[0,100]);const c=i({...this.options,keyframes:e});"mirror"===a&&(l=i({...this.options,keyframes:[...e].reverse(),velocity:-o})),null===c.calculatedDuration&&(c.calculatedDuration=go(c));const{calculatedDuration:u}=c,d=u+r;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:s,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:a,mirroredGenerator:o,mapPercentToKeyframes:i,keyframes:s,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=n;if(null===this.startTime)return a.next(0);const{delay:d,repeat:f,repeatType:m,repeatDelay:p,onUpdate:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const g=this.currentTime-d*(this.speed>=0?1:-1),w=this.speed>=0?g<0:g>c;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let y=this.currentTime,b=a;if(f){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,f+1),Boolean(t%2)&&("reverse"===m?(n=1-n,p&&(n-=p/u)):"mirror"===m&&(b=o)),y=ki(0,1,n)*u}const v=w?{done:!1,value:s[0]}:b.next(y);i&&(v.value=i(v.value));let{done:x}=v;w||null===l||(x=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return _&&void 0!==r&&(v.value=Ws(s,this.options,r)),h&&h(v.value),_&&this.finish(),v}get duration(){const{resolved:e}=this;return e?Fo(e.calculatedDuration):0}get time(){return Fo(this.currentTime)}set time(e){e=Bo(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Fo(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=Sl,onPlay:t,startTime:n}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();const r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=r):this.startTime=null!=n?n:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const Cl=new Set(["opacity","clipPath","filter","transform"]),Al=co(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Tl={anticipate:_i,backInOut:xi,circInOut:Mi};class Ol extends Zs{constructor(e){super(e);const{name:t,motionValue:n,element:r,keyframes:a}=this.options;this.resolver=new Fs(a,(e,t)=>this.onKeyframesResolved(e,t),t,n,r),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:n=300,times:r,ease:a,type:o,motionValue:i,name:s,startTime:l}=this.options;if(!i.owner||!i.owner.current)return!1;if("string"==typeof a&&_o()&&a in Tl&&(a=Tl[a]),function(e){return wo(e.type)||"spring"===e.type||!Mo(e.ease)}(this.options)){const{onComplete:t,onUpdate:i,motionValue:s,element:l,...c}=this.options,u=function(e,t){const n=new Dl({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const a=[];let o=0;for(;!r.done&&o<2e4;)r=n.sample(o),a.push(r.value),o+=10;return{times:void 0,keyframes:a,duration:o-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),n=u.duration,r=u.times,a=u.ease,o="keyframes"}const c=function(e,t,n,{delay:r=0,duration:a=300,repeat:o=0,repeatType:i="loop",ease:s="easeInOut",times:l}={}){const c={[t]:n};l&&(c.offset=l);const u=ko(s,a);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:r,duration:a,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:"reverse"===i?"alternate":"normal"})}(i.owner.current,s,e,{...this.options,duration:n,times:r,ease:a});return c.startTime=null!=l?l:this.calcStartTime(),this.pendingTimeline?(yo(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;i.set(Ws(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:n,times:r,type:o,ease:a,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Fo(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Fo(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Bo(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Yo;const{animation:n}=t;yo(n,e)}else this.pendingTimeline=e;return Yo}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:a,ease:o,times:i}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:s,element:l,...c}=this.options,u=new Dl({...c,keyframes:n,duration:r,type:a,ease:o,times:i,isGenerator:!0}),d=Bo(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:s}=this.options;s&&s(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:n,repeatDelay:r,repeatType:a,damping:o,type:i}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:s,transformTemplate:l}=t.owner.getProps();return Al()&&n&&Cl.has(n)&&!s&&!l&&!r&&"mirror"!==a&&0!==o&&"inertia"!==i}}const Ll={type:"spring",stiffness:500,damping:25,restSpeed:10},zl={type:"keyframes",duration:.8},Pl={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Rl=(e,{keyframes:t})=>t.length>2?zl:Vo.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Ll:Pl,Ul=(e,t,n,r={},a,o)=>i=>{const s=po(r,e)||{},l=s.delay||r.delay||0;let{elapsed:c=0}=r;c-=Bo(l);let u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:o?void 0:a};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:a,repeat:o,repeatType:i,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(s)||(u={...u,...Rl(e,u)}),u.duration&&(u.duration=Bo(u.duration)),u.repeatDelay&&(u.repeatDelay=Bo(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),d&&!o&&void 0!==t.get()){const e=Ws(u.keyframes,s);if(void 0!==e)return $o.update(()=>{u.onUpdate(e),u.onComplete()}),new mo([])}return!o&&Ol.supports(u)?new Ol(u):new Dl(u)};function Bl({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function Fl(e,t,{delay:n=0,transitionOverride:r,type:a}={}){var o;let{transition:i=e.getDefaultTransition(),transitionEnd:s,...l}=t;r&&(i=r);const c=[],u=a&&e.animationState&&e.animationState.getState()[a];for(const t in l){const r=e.getValue(t,null!==(o=e.latestValues[t])&&void 0!==o?o:null),a=l[t];if(void 0===a||u&&Bl(u,t))continue;const s={delay:n,...po(i||{},t)};let d=!1;if(window.MotionHandoffAnimation){const n=pi(e);if(n){const e=window.MotionHandoffAnimation(n,t,$o);null!==e&&(s.startTime=e,d=!0)}}di(e,t),r.start(Ul(t,r,a,e.shouldReduceMotion&&Wo.has(t)?{type:!1}:s,e,d));const f=r.animation;f&&c.push(f)}return s&&Promise.all(c).then(()=>{$o.update(()=>{s&&function(e,t){const n=io(e,t);let{transitionEnd:r={},transition:a={},...o}=n||{};o={...o,...r};for(const t in o)ci(e,t,Zo(o[t]))}(e,s)})}),c}function Yl(e,t,n={}){var r;const a=io(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=a||{};n.transitionOverride&&(o=n.transitionOverride);const i=a?()=>Promise.all(Fl(e,a,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:a=0,staggerChildren:i,staggerDirection:s}=o;return function(e,t,n=0,r=0,a=1,o){const i=[],s=(e.variantChildren.size-1)*r,l=1===a?(e=0)=>e*r:(e=0)=>s-e*r;return Array.from(e.variantChildren).sort(Ql).forEach((e,r)=>{e.notify("AnimationStart",t),i.push(Yl(e,t,{...o,delay:n+l(r)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(i)}(e,t,a+r,i,s,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[e,t]="beforeChildren"===l?[i,s]:[s,i];return e().then(()=>t())}return Promise.all([i(),s(n.delay)])}function Ql(e,t){return e.sortNodePosition(t)}const Vl=lo.length;function Wl(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&Wl(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let n=0;n<Vl;n++){const r=lo[n],a=e.props[r];(ro(a)||!1===a)&&(t[r]=a)}return t}const Zl=[...so].reverse(),Gl=so.length;function Hl(e){let t=function(e){return t=>Promise.all(t.map(({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const a=t.map(t=>Yl(e,t,n));r=Promise.all(a)}else if("string"==typeof t)r=Yl(e,t,n);else{const a="function"==typeof t?io(e,t,n.custom):t;r=Promise.all(Fl(e,a,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}(e,t,n)))}(e),n=ql(),r=!0;const a=t=>(n,r)=>{var a;const o=io(e,r,"exit"===t?null===(a=e.presenceContext)||void 0===a?void 0:a.custom:void 0);if(o){const{transition:e,transitionEnd:t,...r}=o;n={...n,...r,...t}}return n};function o(o){const{props:i}=e,s=Wl(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<Gl;t++){const f=Zl[t],m=n[f],p=void 0!==i[f]?i[f]:s[f],h=ro(p),g=f===o?m.isActive:null;!1===g&&(d=t);let w=p===s[f]&&p!==i[f]&&h;if(w&&r&&e.manuallyAnimateOnMount&&(w=!1),m.protectedKeys={...u},!m.isActive&&null===g||!p&&!m.prevProp||eo(p)||"boolean"==typeof p)continue;const y=$l(m.prevProp,p);let b=y||f===o&&m.isActive&&!w&&h||t>d&&h,v=!1;const x=Array.isArray(p)?p:[p];let _=x.reduce(a(f),{});!1===g&&(_={});const{prevResolvedValues:E={}}=m,N={...E,..._},M=t=>{b=!0,c.has(t)&&(v=!0,c.delete(t)),m.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in N){const t=_[e],n=E[e];if(u.hasOwnProperty(e))continue;let r=!1;r=to(t)&&to(n)?!no(t,n):t!==n,r?null!=t?M(e):c.add(e):void 0!==t&&c.has(e)?M(e):m.protectedKeys[e]=!0}m.prevProp=p,m.prevResolvedValues=_,m.isActive&&(u={...u,..._}),r&&e.blockInitialAnimation&&(b=!1),b&&(!w||!y||v)&&l.push(...x.map(e=>({animation:e,options:{type:f}})))}if(c.size){const t={};c.forEach(n=>{const r=e.getBaseTarget(n),a=e.getValue(n);a&&(a.liveStyle=!0),t[n]=null!=r?r:null}),l.push({animation:t})}let f=Boolean(l.length);return!r||!1!==i.initial&&i.initial!==i.animate||e.manuallyAnimateOnMount||(f=!1),r=!1,f?t(l):Promise.resolve()}return{animateChanges:o,setActive:function(t,r){var a;if(n[t].isActive===r)return Promise.resolve();null===(a=e.variantChildren)||void 0===a||a.forEach(e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)}),n[t].isActive=r;const i=o(t);for(const e in n)n[e].protectedKeys={};return i},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=ql(),r=!0}}}function $l(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!no(t,e)}function Xl(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ql(){return{animate:Xl(!0),whileInView:Xl(),whileHover:Xl(),whileTap:Xl(),whileDrag:Xl(),whileFocus:Xl(),exit:Xl()}}class Jl{constructor(e){this.isMounted=!1,this.node=e}update(){}}let Kl=0;const ec={animation:{Feature:class extends Jl{constructor(e){super(e),e.animationState||(e.animationState=Hl(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();eo(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends Jl{constructor(){super(...arguments),this.id=Kl++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}};function tc(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function nc(e){return{point:{x:e.pageX,y:e.pageY}}}function rc(e,t,n,r){return tc(e,t,(e=>t=>Oo(t)&&e(t,nc(t)))(n),r)}const ac=(e,t)=>Math.abs(e-t);class oc{constructor(e,t,{transformPagePoint:n,contextWindow:r,dragSnapToOrigin:a=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=lc(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=ac(e.x,t.x),r=ac(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:a}=qo;this.history.push({...r,timestamp:a});const{onStart:o,onMove:i}=this.handlers;t||(o&&o(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=ic(t,this.transformPagePoint),$o.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:a}=this.handlers;if(this.dragSnapToOrigin&&a&&a(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=lc("pointercancel"===e.type?this.lastMoveEventInfo:ic(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,o),r&&r(e,o)},!Oo(e))return;this.dragSnapToOrigin=a,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const o=ic(nc(e),this.transformPagePoint),{point:i}=o,{timestamp:s}=qo;this.history=[{...i,timestamp:s}];const{onSessionStart:l}=t;l&&l(e,lc(o,this.history)),this.removeListeners=tl(rc(this.contextWindow,"pointermove",this.handlePointerMove),rc(this.contextWindow,"pointerup",this.handlePointerUp),rc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Xo(this.updatePoint)}}function ic(e,t){return t?{point:t(e.point)}:e}function sc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function lc({point:e},t){return{point:e,delta:sc(e,uc(t)),offset:sc(e,cc(t)),velocity:dc(t,.1)}}function cc(e){return e[0]}function uc(e){return e[e.length-1]}function dc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const a=uc(e);for(;n>=0&&(r=e[n],!(a.timestamp-r.timestamp>Bo(t)));)n--;if(!r)return{x:0,y:0};const o=Fo(a.timestamp-r.timestamp);if(0===o)return{x:0,y:0};const i={x:(a.x-r.x)/o,y:(a.y-r.y)/o};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function fc(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function mc(e){return e.max-e.min}function pc(e,t,n,r=.5){e.origin=r,e.originPoint=Gs(t.min,t.max,e.origin),e.scale=mc(n)/mc(t),e.translate=Gs(n.min,n.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function hc(e,t,n,r){pc(e.x,t.x,n.x,r?r.originX:void 0),pc(e.y,t.y,n.y,r?r.originY:void 0)}function gc(e,t,n){e.min=n.min+t.min,e.max=e.min+mc(t)}function wc(e,t,n){e.min=t.min-n.min,e.max=e.min+mc(t)}function yc(e,t,n){wc(e.x,t.x,n.x),wc(e.y,t.y,n.y)}function bc(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function vc(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}const xc=.35;function _c(e,t,n){return{min:Ec(e,t),max:Ec(e,n)}}function Ec(e,t){return"number"==typeof e?e:e[t]||0}const Nc=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Mc(e){return[e("x"),e("y")]}function Ic({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Sc(e){return void 0===e||1===e}function kc({scale:e,scaleX:t,scaleY:n}){return!Sc(e)||!Sc(t)||!Sc(n)}function jc(e){return kc(e)||Dc(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Dc(e){return Cc(e.x)||Cc(e.y)}function Cc(e){return e&&"0%"!==e}function Ac(e,t,n){return n+t*(e-n)}function Tc(e,t,n,r,a){return void 0!==a&&(e=Ac(e,a,r)),Ac(e,n,r)+t}function Oc(e,t=0,n=1,r,a){e.min=Tc(e.min,t,n,r,a),e.max=Tc(e.max,t,n,r,a)}function Lc(e,{x:t,y:n}){Oc(e.x,t.translate,t.scale,t.originPoint),Oc(e.y,n.translate,n.scale,n.originPoint)}const zc=.999999999999,Pc=1.0000000000001;function Rc(e,t){e.min=e.min+t,e.max=e.max+t}function Uc(e,t,n,r,a=.5){Oc(e,t,n,Gs(e.min,e.max,a),r)}function Bc(e,t){Uc(e.x,t.x,t.scaleX,t.scale,t.originX),Uc(e.y,t.y,t.scaleY,t.scale,t.originY)}function Fc(e,t){return Ic(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const Yc=({current:e})=>e?e.ownerDocument.defaultView:null,Qc=new WeakMap;class Vc{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new oc(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(nc(e).point)},onStart:(e,t)=>{const{drag:n,dragPropagation:r,onDragStart:a}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?jo[o]?null:(jo[o]=!0,()=>{jo[o]=!1}):jo.x||jo.y?null:(jo.x=jo.y=!0,()=>{jo.x=jo.y=!1}),!this.openDragLock))return;var o;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Mc(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Yi.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=mc(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),a&&$o.postRender(()=>a(e,t)),di(this.visualElement,"transform");const{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:a,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:i}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(i),void(null!==this.currentDirection&&a&&a(this.currentDirection));this.updateAxis("x",t.point,i),this.updateAxis("y",t.point,i),this.visualElement.render(),o&&o(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>Mc(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:Yc(this.visualElement)})}stop(e,t){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:a}=this.getProps();a&&$o.postRender(()=>a(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!Wc(e,r,this.currentDirection))return;const a=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=function(e,{min:t,max:n},r){return void 0!==t&&e<t?e=r?Gs(t,e,r.min):Math.max(e,t):void 0!==n&&e>n&&(e=r?Gs(n,e,r.max):Math.min(e,n)),e}(o,this.constraints[e],this.elastic[e])),a.set(o)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,a=this.constraints;t&&fc(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:a}){return{x:bc(e.x,n,a),y:bc(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=xc){return!1===e?e=0:!0===e&&(e=xc),{x:_c(e,"left","right"),y:_c(e,"top","bottom")}}(n),a!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Mc(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!fc(e))return!1;const n=e.current;js(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const a=function(e,t,n){const r=Fc(e,n),{scroll:a}=t;return a&&(Rc(r.x,a.offset.x),Rc(r.y,a.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let o=function(e,t){return{x:vc(e.x,t.x),y:vc(e.y,t.y)}}(r.layout.layoutBox,a);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(o));this.hasMutatedConstraints=!!e,e&&(o=Ic(e))}return o}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:i}=this.getProps(),s=this.constraints||{},l=Mc(i=>{if(!Wc(i,t,this.currentDirection))return;let l=s&&s[i]||{};o&&(l={min:0,max:0});const c=r?200:1e6,u=r?40:1e7,d={type:"inertia",velocity:n?e[i]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...a,...l};return this.startAxisValueAnimation(i,d)});return Promise.all(l).then(i)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return di(this.visualElement,e),n.start(Ul(e,n,0,t,this.visualElement,!1))}stopAnimation(){Mc(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Mc(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Mc(t=>{const{drag:n}=this.getProps();if(!Wc(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,a=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:o}=r.layout.layoutBox[t];a.set(e[t]-Gs(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!fc(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Mc(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=mc(e),a=mc(t);return a>r?n=Eo(t.min,t.max-r,e.min):r>a&&(n=Eo(e.min,e.max-a,t.min)),ki(0,1,n)}({min:n,max:n},this.constraints[e])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Mc(t=>{if(!Wc(t,e,null))return;const n=this.getAxisMotionValue(t),{min:a,max:o}=this.constraints[t];n.set(Gs(a,o,r[t]))})}addListeners(){if(!this.visualElement.current)return;Qc.set(this.visualElement,this);const e=rc(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();fc(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),$o.read(t);const a=tc(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Mc(t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())});return()=>{a(),e(),r(),o&&o()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:a=!1,dragElastic:o=xc,dragMomentum:i=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:a,dragElastic:o,dragMomentum:i}}}function Wc(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const Zc=e=>(t,n)=>{e&&$o.postRender(()=>e(t,n))},Gc=(0,i.createContext)(null);function Hc(e=!0){const t=(0,i.useContext)(Gc);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=t,o=(0,i.useId)();(0,i.useEffect)(()=>{e&&a(o)},[e]);const s=(0,i.useCallback)(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}const $c=(0,i.createContext)({}),Xc=(0,i.createContext)({}),qc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Jc(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Kc={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Qi.test(e))return e;e=parseFloat(e)}return`${Jc(e,t.target.x)}% ${Jc(e,t.target.y)}%`}},eu={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,a=rs.parse(e);if(a.length>5)return r;const o=rs.createTransformer(e),i="number"!=typeof a[0]?1:0,s=n.x.scale*t.x,l=n.y.scale*t.y;a[0+i]/=s,a[1+i]/=l;const c=Gs(s,l,.5);return"number"==typeof a[2+i]&&(a[2+i]/=c),"number"==typeof a[3+i]&&(a[3+i]/=c),o(a)}},tu={},{schedule:nu,cancel:ru}=Ho(queueMicrotask,!1);class au extends i.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:a}=e;var o;o=iu,Object.assign(tu,o),a&&(t.group&&t.group.add(a),n&&n.register&&r&&n.register(a),a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,onExitComplete:()=>this.safeToRemove()})),qc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:a}=this.props,o=n.projection;return o?(o.isPresent=a,r||e.layoutDependency!==t||void 0===t?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||$o.postRender(()=>{const e=o.getStack();e&&e.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),nu.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function ou(e){const[t,n]=Hc(),r=(0,i.useContext)($c);return(0,P.jsx)(au,{...e,layoutGroup:r,switchLayoutGroup:(0,i.useContext)(Xc),isPresent:t,safeToRemove:n})}const iu={borderRadius:{...Kc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Kc,borderTopRightRadius:Kc,borderBottomLeftRadius:Kc,borderBottomRightRadius:Kc,boxShadow:eu},su=(e,t)=>e.depth-t.depth;class lu{constructor(){this.children=[],this.isDirty=!1}add(e){ni(this.children,e),this.isDirty=!0}remove(e){ri(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(su),this.isDirty=!1,this.children.forEach(e)}}function cu(e){const t=ui(e)?e.get():e;return n=t,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?t.toValue():t;var n}const uu=["TopLeft","TopRight","BottomLeft","BottomRight"],du=uu.length,fu=e=>"string"==typeof e?parseFloat(e):e,mu=e=>"number"==typeof e||Qi.test(e);function pu(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const hu=wu(0,.5,Ni),gu=wu(.5,.95,Yo);function wu(e,t,n){return r=>r<e?0:r>t?1:n(Eo(e,t,r))}function yu(e,t){e.min=t.min,e.max=t.max}function bu(e,t){yu(e.x,t.x),yu(e.y,t.y)}function vu(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function xu(e,t,n,r,a){return e=Ac(e-=t,1/n,r),void 0!==a&&(e=Ac(e,1/a,r)),e}function _u(e,t,[n,r,a],o,i){!function(e,t=0,n=1,r=.5,a,o=e,i=e){if(Yi.test(t)&&(t=parseFloat(t),t=Gs(i.min,i.max,t/100)-i.min),"number"!=typeof t)return;let s=Gs(o.min,o.max,r);e===o&&(s-=t),e.min=xu(e.min,t,n,s,a),e.max=xu(e.max,t,n,s,a)}(e,t[n],t[r],t[a],t.scale,o,i)}const Eu=["x","scaleX","originX"],Nu=["y","scaleY","originY"];function Mu(e,t,n,r){_u(e.x,t,Eu,n?n.x:void 0,r?r.x:void 0),_u(e.y,t,Nu,n?n.y:void 0,r?r.y:void 0)}function Iu(e){return 0===e.translate&&1===e.scale}function Su(e){return Iu(e.x)&&Iu(e.y)}function ku(e,t){return e.min===t.min&&e.max===t.max}function ju(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Du(e,t){return ju(e.x,t.x)&&ju(e.y,t.y)}function Cu(e){return mc(e.x)/mc(e.y)}function Au(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Tu{constructor(){this.members=[]}add(e){ni(this.members,e),e.scheduleRender()}remove(e){if(ri(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex(t=>e===t);if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Ou={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Lu="undefined"!=typeof window&&void 0!==window.MotionDebug,zu=["","X","Y","Z"],Pu={visibility:"hidden"};let Ru=0;function Uu(e,t,n,r){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Bu(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=pi(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",$o,!(t||r))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Bu(r)}function Fu({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=Ru++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Lu&&(Ou.totalNodes=Ou.resolvedTargetDeltas=Ou.recalculatedProjection=0),this.nodes.forEach(Vu),this.nodes.forEach(qu),this.nodes.forEach(Ju),this.nodes.forEach(Wu),Lu&&window.MotionDebug.record(Ou)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new lu)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ai),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,n=this.root.hasTreeAnimated){if(this.instance)return;var r;this.isSVG=(r=t)instanceof SVGElement&&"svg"!==r.tagName,this.instance=t;const{layoutId:a,layout:o,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(o||a)&&(this.isLayoutDirty=!0),e){let n;const r=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=ti.now(),r=({timestamp:a})=>{const o=a-n;o>=t&&(Xo(r),e(o-t))};return $o.read(r,!0),()=>Xo(r)}(r,250),qc.hasAnimatedSinceResize&&(qc.hasAnimatedSinceResize=!1,this.nodes.forEach(Xu))})}a&&this.root.registerSharedNode(a,this),!1!==this.options.animate&&i&&(a||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const a=this.options.transition||i.getDefaultTransition()||ad,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),l=!this.targetLayout||!Du(this.targetLayout,r)||n,c=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...po(a,"layout"),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||Xu(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Xo(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Ku),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Bu(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){const t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:t,layout:n}=this.options;if(void 0===t&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Gu);this.isUpdating||this.nodes.forEach(Hu),this.isUpdating=!1,this.nodes.forEach($u),this.nodes.forEach(Yu),this.nodes.forEach(Qu),this.clearAllSnapshots();const e=ti.now();qo.delta=ki(0,1e3/60,e-qo.timestamp),qo.timestamp=e,qo.isProcessing=!0,Jo.update.process(qo),Jo.preRender.process(qo),Jo.render.process(qo),qo.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,nu.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Zu),this.sharedNodes.forEach(ed)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,$o.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){$o.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!a)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Su(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,o=r!==this.prevTransformTemplateValue;e&&(t||jc(this.latestValues)||o)&&(a(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let n=this.removeElementScroll(t);var r;return e&&(n=this.removeTransform(n)),sd((r=n).x),sd(r.y),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const n=t.measureViewportBox();if(!(null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)&&!this.path.some(cd)){const{scroll:e}=this.root;e&&(Rc(n.x,e.offset.x),Rc(n.y,e.offset.y))}return n}removeElementScroll(e){var t;const n={x:{min:0,max:0},y:{min:0,max:0}};if(bu(n,e),null===(t=this.scroll)||void 0===t?void 0:t.wasRoot)return n;for(let t=0;t<this.path.length;t++){const r=this.path[t],{scroll:a,options:o}=r;r!==this.root&&a&&o.layoutScroll&&(a.wasRoot&&bu(n,e),Rc(n.x,a.offset.x),Rc(n.y,a.offset.y))}return n}applyTransform(e,t=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};bu(n,e);for(let e=0;e<this.path.length;e++){const r=this.path[e];!t&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Bc(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),jc(r.latestValues)&&Bc(n,r.latestValues)}return jc(this.latestValues)&&Bc(n,this.latestValues),n}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};bu(t,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];if(!n.instance)continue;if(!jc(n.latestValues))continue;kc(n.latestValues)&&n.updateSnapshot();const r=Nc();bu(r,n.measurePageBox()),Mu(t,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return jc(this.latestValues)&&Mu(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==qo.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(e||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:a,layoutId:o}=this.options;if(this.layout&&(a||o)){if(this.resolvedRelativeTargetAt=qo.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},yc(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),bu(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var i,s,l;if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),i=this.target,s=this.relativeTarget,l=this.relativeParent.target,gc(i.x,s.x,l.x),gc(i.y,s.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):bu(this.target,this.layout.layoutBox),Lc(this.target,this.targetDelta)):bu(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&Boolean(e.resumingFrom)===Boolean(this.resumingFrom)&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},yc(this.relativeTargetOrigin,this.target,e.target),bu(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Lu&&Ou.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!kc(this.parent.latestValues)&&!Dc(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;const t=this.getLead(),n=Boolean(this.resumingFrom)||this!==t;let r=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===qo.timestamp&&(r=!1),r)return;const{layout:a,layoutId:o}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!a&&!o)return;bu(this.layoutCorrected,this.layout.layoutBox);const i=this.treeScale.x,s=this.treeScale.y;!function(e,t,n,r=!1){const a=n.length;if(!a)return;let o,i;t.x=t.y=1;for(let s=0;s<a;s++){o=n[s],i=o.projectionDelta;const{visualElement:a}=o.options;a&&a.props.style&&"contents"===a.props.style.display||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Bc(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,Lc(e,i)),r&&jc(o.latestValues)&&Bc(e,o.latestValues))}t.x<Pc&&t.x>zc&&(t.x=1),t.y<Pc&&t.y>zc&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(vu(this.prevProjectionDelta.x,this.projectionDelta.x),vu(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),hc(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===i&&this.treeScale.y===s&&Au(this.projectionDelta.x,this.prevProjectionDelta.x)&&Au(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),Lu&&Ou.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},a={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const i={x:{min:0,max:0},y:{min:0,max:0}},s=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(s&&!c&&!0===this.options.crossfade&&!this.path.some(rd));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;td(o.x,e.x,n),td(o.y,e.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(yc(i,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,n,r){nd(e.x,t.x,n.x,r),nd(e.y,t.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,i,n),d&&function(e,t){return ku(e.x,t.x)&&ku(e.y,t.y)}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),bu(d,this.relativeTarget)),s&&(this.animationValues=a,function(e,t,n,r,a,o){a?(e.opacity=Gs(0,void 0!==n.opacity?n.opacity:1,hu(r)),e.opacityExit=Gs(void 0!==t.opacity?t.opacity:1,0,gu(r))):o&&(e.opacity=Gs(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let a=0;a<du;a++){const o=`border${uu[a]}Radius`;let i=pu(t,o),s=pu(n,o);void 0===i&&void 0===s||(i||(i=0),s||(s=0),0===i||0===s||mu(i)===mu(s)?(e[o]=Math.max(Gs(fu(i),fu(s),r),0),(Yi.test(s)||Yi.test(i))&&(e[o]+="%")):e[o]=s)}(t.rotate||n.rotate)&&(e.rotate=Gs(t.rotate||0,n.rotate||0,r))}(a,r,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Xo(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=$o.update(()=>{qc.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=ui(0)?0:li(0);return r.start(Ul("",r,1e3,n)),r.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:a}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&ld(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=mc(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=mc(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}bu(t,n),Bc(t,a),hc(this.projectionDeltaWithTransform,this.layoutCorrected,t,a)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Tu),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&Uu("z",e,r,this.animationValues);for(let t=0;t<zu.length;t++)Uu(`rotate${zu[t]}`,e,r,this.animationValues),Uu(`skew${zu[t]}`,e,r,this.animationValues);e.render();for(const t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}getProjectionStyles(e){var t,n;if(!this.instance||this.isSVG)return;if(!this.isVisible)return Pu;const r={visibility:""},a=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=cu(null==e?void 0:e.pointerEvents)||"",r.transform=a?a(this.latestValues,""):"none",r;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=cu(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!jc(this.latestValues)&&(t.transform=a?a({},""):"none",this.hasProjected=!1),t}const i=o.animationValues||o.latestValues;this.applyTransformsToTarget(),r.transform=function(e,t,n){let r="";const a=e.x.translate/t.x,o=e.y.translate/t.y,i=(null==n?void 0:n.z)||0;if((a||o||i)&&(r=`translate3d(${a}px, ${o}px, ${i}px) `),1===t.x&&1===t.y||(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:e,rotate:t,rotateX:a,rotateY:o,skewX:i,skewY:s}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),i&&(r+=`skewX(${i}deg) `),s&&(r+=`skewY(${s}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return 1===s&&1===l||(r+=`scale(${s}, ${l})`),r||"none"}(this.projectionDeltaWithTransform,this.treeScale,i),a&&(r.transform=a(i,r.transform));const{x:s,y:l}=this.projectionDelta;r.transformOrigin=`${100*s.origin}% ${100*l.origin}% 0`,o.animationValues?r.opacity=o===this?null!==(n=null!==(t=i.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r.opacity=o===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const e in tu){if(void 0===i[e])continue;const{correct:t,applyTo:n}=tu[e],a="none"===r.transform?i[e]:t(i[e],o);if(n){const e=n.length;for(let t=0;t<e;t++)r[n[t]]=a}else r[e]=a}return this.options.layoutId&&(r.pointerEvents=o===this?cu(null==e?void 0:e.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(Gu),this.root.sharedNodes.clear()}}}function Yu(e){e.updateLayout()}function Qu(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:a}=e.options,o=n.source!==e.layout.source;"size"===a?Mc(e=>{const r=o?n.measuredBox[e]:n.layoutBox[e],a=mc(r);r.min=t[e].min,r.max=r.min+a}):ld(a,n.layoutBox,t)&&Mc(r=>{const a=o?n.measuredBox[r]:n.layoutBox[r],i=mc(t[r]);a.max=a.min+i,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+i)});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};hc(i,t,n.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?hc(s,e.applyTransform(r,!0),n.measuredBox):hc(s,t,n.layoutBox);const l=!Su(i);let c=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:a,layout:o}=r;if(a&&o){const i={x:{min:0,max:0},y:{min:0,max:0}};yc(i,n.layoutBox,a.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};yc(s,t,o.layoutBox),Du(i,s)||(c=!0),r.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=i,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Vu(e){Lu&&Ou.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Wu(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Zu(e){e.clearSnapshot()}function Gu(e){e.clearMeasurements()}function Hu(e){e.isLayoutDirty=!1}function $u(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Xu(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function qu(e){e.resolveTargetDelta()}function Ju(e){e.calcProjection()}function Ku(e){e.resetSkewAndRotation()}function ed(e){e.removeLeadSnapshot()}function td(e,t,n){e.translate=Gs(t.translate,0,n),e.scale=Gs(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function nd(e,t,n,r){e.min=Gs(t.min,n.min,r),e.max=Gs(t.max,n.max,r)}function rd(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const ad={duration:.45,ease:[.4,0,.1,1]},od=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),id=od("applewebkit/")&&!od("chrome/")?Math.round:Yo;function sd(e){e.min=id(e.min),e.max=id(e.max)}function ld(e,t,n){return"position"===e||"preserve-aspect"===e&&!function(e,t){return Math.abs(e-t)<=.2}(Cu(t),Cu(n))}function cd(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const ud=Fu({attachResizeListener:(e,t)=>tc(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),dd={current:void 0},fd=Fu({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!dd.current){const e=new ud({});e.mount(window),e.setOptions({layoutScroll:!0}),dd.current=e}return dd.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),md={pan:{Feature:class extends Jl{constructor(){super(...arguments),this.removePointerDownListener=Yo}onPointerDown(e){this.session=new oc(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Yc(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Zc(e),onStart:Zc(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&$o.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=rc(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends Jl{constructor(e){super(e),this.removeGroupControls=Yo,this.removeListeners=Yo,this.controls=new Vc(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Yo}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:fd,MeasureLayout:ou}};function pd(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover","Start"===n);const a=r["onHover"+n];a&&$o.postRender(()=>a(t,nc(t)))}function hd(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap","Start"===n);const a=r["onTap"+("End"===n?"":n)];a&&$o.postRender(()=>a(t,nc(t)))}const gd=new WeakMap,wd=new WeakMap,yd=e=>{const t=gd.get(e.target);t&&t(e)},bd=e=>{e.forEach(yd)};const vd={some:0,all:1},xd={inView:{Feature:class extends Jl{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:a}=e,o={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:vd[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;wd.has(n)||wd.set(n,{});const r=wd.get(n),a=JSON.stringify(t);return r[a]||(r[a]=new IntersectionObserver(bd,{root:e,...t})),r[a]}(t);return gd.set(e,n),r.observe(e),()=>{gd.delete(e),r.unobserve(e)}}(this.node.current,o,e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,a&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),o=t?n:r;o&&o(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends Jl{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,a,o]=Co(e,n),i=e=>{const r=e.currentTarget;if(!Uo(e)||zo.has(r))return;zo.add(r);const o=t(e),i=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),Uo(e)&&zo.has(r)&&(zo.delete(r),"function"==typeof o&&o(e,{success:t}))},s=e=>{i(e,n.useGlobalTarget||To(r,e.target))},l=e=>{i(e,!1)};window.addEventListener("pointerup",s,a),window.addEventListener("pointercancel",l,a)};return r.forEach(e=>{(function(e){return Lo.has(e.tagName)||-1!==e.tabIndex})(e)||null!==e.getAttribute("tabindex")||(e.tabIndex=0),(n.useGlobalTarget?window:e).addEventListener("pointerdown",i,a),e.addEventListener("focus",e=>((e,t)=>{const n=e.currentTarget;if(!n)return;const r=Po(()=>{if(zo.has(n))return;Ro(n,"down");const e=Po(()=>{Ro(n,"up")});n.addEventListener("keyup",e,t),n.addEventListener("blur",()=>Ro(n,"cancel"),t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)})(e,a),a)}),o}(e,e=>(hd(this.node,e,"Start"),(e,{success:t})=>hd(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends Jl{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=tl(tc(this.node.current,"focus",()=>this.onFocus()),tc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends Jl{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,n={}){const[r,a,o]=Co(e,n),i=Ao(e=>{const{target:n}=e,r=t(e);if("function"!=typeof r||!n)return;const o=Ao(e=>{r(e),n.removeEventListener("pointerleave",o)});n.addEventListener("pointerleave",o,a)});return r.forEach(e=>{e.addEventListener("pointerenter",i,a)}),o}(e,e=>(pd(this.node,e,"Start"),e=>pd(this.node,e,"End"))))}unmount(){}}}},_d={layout:{ProjectionNode:fd,MeasureLayout:ou}},Ed=(0,i.createContext)({strict:!1}),Nd=(0,i.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Md=(0,i.createContext)({});function Id(e){return eo(e.animate)||lo.some(t=>ro(e[t]))}function Sd(e){return Boolean(Id(e)||e.variants)}function kd(e){return Array.isArray(e)?e.join(" "):e}const jd="undefined"!=typeof window,Dd={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Cd={};for(const e in Dd)Cd[e]={isEnabled:t=>Dd[e].some(e=>!!t[e])};const Ad=Symbol.for("motionComponentSymbol");function Td(e,t,n){return(0,i.useCallback)(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):fc(n)&&(n.current=r))},[t])}const Od=jd?i.useLayoutEffect:i.useEffect;function Ld(e,t,n,r,a){var o,s;const{visualElement:l}=(0,i.useContext)(Md),c=(0,i.useContext)(Ed),u=(0,i.useContext)(Gc),d=(0,i.useContext)(Nd).reducedMotion,f=(0,i.useRef)(null);r=r||c.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:d}));const m=f.current,p=(0,i.useContext)(Xc);!m||m.projection||!a||"html"!==m.type&&"svg"!==m.type||function(e,t,n,r){const{layoutId:a,layout:o,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:c}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:zd(e.parent)),e.projection.setOptions({layoutId:a,layout:o,alwaysMeasureLayout:Boolean(i)||s&&fc(s),visualElement:e,animationType:"string"==typeof o?o:"both",initialPromotionConfig:r,layoutScroll:l,layoutRoot:c})}(f.current,n,a,p);const h=(0,i.useRef)(!1);(0,i.useInsertionEffect)(()=>{m&&h.current&&m.update(n,u)});const g=n[mi],w=(0,i.useRef)(Boolean(g)&&!(null===(o=window.MotionHandoffIsComplete)||void 0===o?void 0:o.call(window,g))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,g)));return Od(()=>{m&&(h.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),nu.render(m.render),w.current&&m.animationState&&m.animationState.animateChanges())}),(0,i.useEffect)(()=>{m&&(!w.current&&m.animationState&&m.animationState.animateChanges(),w.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,g)}),w.current=!1))}),m}function zd(e){if(e)return!1!==e.options.allowProjection?e.projection:zd(e.parent)}function Pd({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:a}){var o,s;function l(e,o){let s;const l={...(0,i.useContext)(Nd),...e,layoutId:Rd(e)},{isStatic:c}=l,u=function(e){const{initial:t,animate:n}=function(e,t){if(Id(e)){const{initial:t,animate:n}=e;return{initial:!1===t||ro(t)?t:void 0,animate:ro(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,i.useContext)(Md));return(0,i.useMemo)(()=>({initial:t,animate:n}),[kd(t),kd(n)])}(e),d=r(e,c);if(!c&&jd){(0,i.useContext)(Ed).strict;const e=function(e){const{drag:t,layout:n}=Cd;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(l);s=e.MeasureLayout,u.visualElement=Ld(a,d,l,t,e.ProjectionNode)}return(0,P.jsxs)(Md.Provider,{value:u,children:[s&&u.visualElement?(0,P.jsx)(s,{visualElement:u.visualElement,...l}):null,n(a,e,Td(d,u.visualElement,o),d,c,u.visualElement)]})}e&&function(e){for(const t in e)Cd[t]={...Cd[t],...e[t]}}(e),l.displayName=`motion.${"string"==typeof a?a:`create(${null!==(s=null!==(o=a.displayName)&&void 0!==o?o:a.name)&&void 0!==s?s:""})`}`;const c=(0,i.forwardRef)(l);return c[Ad]=a,c}function Rd({layoutId:e}){const t=(0,i.useContext)($c).id;return t&&void 0!==e?t+"-"+e:e}const Ud=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Bd(e){return"string"==typeof e&&!e.includes("-")&&!!(Ud.indexOf(e)>-1||/[A-Z]/u.test(e))}function Fd(e){const t=(0,i.useRef)(null);return null===t.current&&(t.current=e()),t.current}const Yd=e=>(t,n)=>{const r=(0,i.useContext)(Md),a=(0,i.useContext)(Gc),o=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,a,o){const i={latestValues:Qd(r,a,o,e),renderState:t()};return n&&(i.onMount=e=>n({props:r,current:e,...i}),i.onUpdate=e=>n(e)),i}(e,t,r,a);return n?o():Fd(o)};function Qd(e,t,n,r){const a={},o=r(e,{});for(const e in o)a[e]=cu(o[e]);let{initial:i,animate:s}=e;const l=Id(e),c=Sd(e);t&&c&&!l&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===s&&(s=t.animate));let u=!!n&&!1===n.initial;u=u||!1===i;const d=u?s:i;if(d&&"boolean"!=typeof d&&!eo(d)){const t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){const r=oo(e,t[n]);if(r){const{transitionEnd:e,transition:t,...n}=r;for(const e in n){let t=n[e];Array.isArray(t)&&(t=t[u?t.length-1:0]),null!==t&&(a[e]=t)}for(const t in e)a[t]=e[t]}}}return a}const Vd=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Wd={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Zd=Qo.length;function Gd(e,t,n){const{style:r,vars:a,transformOrigin:o}=e;let i=!1,s=!1;for(const e in t){const n=t[e];if(Vo.has(e))i=!0;else if(As(e))a[e]=n;else{const t=Vd(n,ds[e]);e.startsWith("origin")?(s=!0,o[e]=t):r[e]=t}}if(t.transform||(i||n?r.transform=function(e,t,n){let r="",a=!0;for(let o=0;o<Zd;o++){const i=Qo[o],s=e[i];if(void 0===s)continue;let l=!0;if(l="number"==typeof s?s===(i.startsWith("scale")?1:0):0===parseFloat(s),!l||n){const e=Vd(s,ds[i]);l||(a=!1,r+=`${Wd[i]||i}(${e}) `),n&&(t[i]=e)}}return r=r.trim(),n?r=n(t,a?"":r):a&&(r="none"),r}(t,e.transform,n):r.transform&&(r.transform="none")),s){const{originX:e="50%",originY:t="50%",originZ:n=0}=o;r.transformOrigin=`${e} ${t} ${n}`}}const Hd={offset:"stroke-dashoffset",array:"stroke-dasharray"},$d={offset:"strokeDashoffset",array:"strokeDasharray"};function Xd(e,t,n){return"string"==typeof e?e:Qi.transform(t+n*e)}function qd(e,{attrX:t,attrY:n,attrScale:r,originX:a,originY:o,pathLength:i,pathSpacing:s=1,pathOffset:l=0,...c},u,d){if(Gd(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:f,style:m,dimensions:p}=e;f.transform&&(p&&(m.transform=f.transform),delete f.transform),p&&(void 0!==a||void 0!==o||m.transform)&&(m.transformOrigin=function(e,t,n){return`${Xd(t,e.x,e.width)} ${Xd(n,e.y,e.height)}`}(p,void 0!==a?a:.5,void 0!==o?o:.5)),void 0!==t&&(f.x=t),void 0!==n&&(f.y=n),void 0!==r&&(f.scale=r),void 0!==i&&function(e,t,n=1,r=0,a=!0){e.pathLength=1;const o=a?Hd:$d;e[o.offset]=Qi.transform(-r);const i=Qi.transform(t),s=Qi.transform(n);e[o.array]=`${i} ${s}`}(f,i,s,l,!1)}const Jd=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Kd(e,{style:t,vars:n},r,a){Object.assign(e.style,t,a&&a.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const ef=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function tf(e,t,n,r){Kd(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(ef.has(n)?n:fi(n),t.attrs[n])}function nf(e,{layout:t,layoutId:n}){return Vo.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!tu[e]||"opacity"===e)}function rf(e,t,n){var r;const{style:a}=e,o={};for(const i in a)(ui(a[i])||t.style&&ui(t.style[i])||nf(i,e)||void 0!==(null===(r=null==n?void 0:n.getValue(i))||void 0===r?void 0:r.liveStyle))&&(o[i]=a[i]);return o}function af(e,t,n){const r=rf(e,t,n);for(const n in e)(ui(e[n])||ui(t[n]))&&(r[-1!==Qo.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}const of=["x","y","width","height","cx","cy","r"],sf={useVisualState:Yd({scrapeMotionValuesFromProps:af,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:a})=>{if(!n)return;let o=!!e.drag;if(!o)for(const e in a)if(Vo.has(e)){o=!0;break}if(!o)return;let i=!t;if(t)for(let n=0;n<of.length;n++){const r=of[n];e[r]!==t[r]&&(i=!0)}i&&$o.read(()=>{!function(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(e){t.dimensions={x:0,y:0,width:0,height:0}}}(n,r),$o.render(()=>{qd(r,a,Jd(n.tagName),e.transformTemplate),tf(n,r)})})}})},lf={useVisualState:Yd({scrapeMotionValuesFromProps:rf,createRenderState:()=>({style:{},transform:{},transformOrigin:{},vars:{}})})};function cf(e,t,n){for(const r in t)ui(t[r])||nf(r,n)||(e[r]=t[r])}function uf(e,t){const n={},r=function(e,t){const n={};return cf(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,i.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{}};return Gd(n,t,e),Object.assign({},n.vars,n.style)},[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const df=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ff(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||df.has(e)}let mf=e=>!ff(e);try{(pf=require("@emotion/is-prop-valid").default)&&(mf=e=>e.startsWith("on")?!ff(e):pf(e))}catch(e){}var pf;function hf(e,t,n,r){const a=(0,i.useMemo)(()=>{const n={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return qd(n,t,Jd(r),e.transformTemplate),{...n.attrs,style:{...n.style}}},[t]);if(e.style){const t={};cf(t,e.style,e),a.style={...t,...a.style}}return a}function gf(e=!1){return(t,n,r,{latestValues:a},o)=>{const s=(Bd(t)?hf:uf)(n,a,o,t),l=function(e,t,n){const r={};for(const a in e)"values"===a&&"object"==typeof e.values||(mf(a)||!0===n&&ff(a)||!t&&!ff(a)||e.draggable&&a.startsWith("onDrag"))&&(r[a]=e[a]);return r}(n,"string"==typeof t,e),c=t!==i.Fragment?{...l,...s,ref:r}:{},{children:u}=n,d=(0,i.useMemo)(()=>ui(u)?u.get():u,[u]);return(0,i.createElement)(t,{...c,children:d})}}function wf(e,t){return function(n,{forwardMotionProps:r}={forwardMotionProps:!1}){return Pd({...Bd(n)?sf:lf,preloadedFeatures:e,useRender:gf(r),createVisualElement:t,Component:n})}}const yf={current:null},bf={current:!1},vf=[...Us,Hi,rs],xf=new WeakMap,_f=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ef{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:a,visualState:o},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ss,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=ti.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,$o.render(this.render,!1,!0))};const{latestValues:s,renderState:l,onUpdate:c}=o;this.onUpdate=c,this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=i,this.blockInitialAnimation=Boolean(a),this.isControllingVariants=Id(t),this.isVariantNode=Sd(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==s[e]&&ui(t)&&t.set(s[e],!1)}}mount(e){this.current=e,xf.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),bf.current||function(){if(bf.current=!0,jd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>yf.current=e.matches;e.addListener(t),t()}else yf.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||yf.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){xf.delete(this.current),this.projection&&this.projection.unmount(),Xo(this.notifyUpdate),Xo(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=Vo.has(e),r=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&$o.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),a=t.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),a(),o&&o(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Cd){const t=Cd[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<_f.length;t++){const n=_f[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=e["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(e,t,n){for(const r in t){const a=t[r],o=n[r];if(ui(a))e.addValue(r,a);else if(ui(o))e.addValue(r,li(a,{owner:e}));else if(o!==a)if(e.hasValue(r)){const t=e.getValue(r);!0===t.liveStyle?t.jump(a):t.hasAnimated||t.set(a)}else{const t=e.getStaticValue(r);e.addValue(r,li(void 0!==t?t:a,{owner:e}))}}for(const r in n)void 0===t[r]&&e.removeValue(r);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=li(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=r&&("string"==typeof r&&(Ds(r)||Ii(r))?r=parseFloat(r):(a=r,!vf.find(Rs(a))&&rs.test(t)&&(r=ps(e,t))),this.setBaseTarget(e,ui(r)?r.get():r)),ui(r)?r.get():r;var a}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const a=oo(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);a&&(r=a[e])}if(n&&void 0!==r)return r;const a=this.getBaseTargetFromProps(this.props,e);return void 0===a||ui(a)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:a}on(e,t){return this.events[e]||(this.events[e]=new ai),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Nf extends Ef{constructor(){super(...arguments),this.KeyframeResolver=Fs}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ui(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class Mf extends Nf{constructor(){super(...arguments),this.type="html",this.renderInstance=Kd}readValueFromInstance(e,t){if(Vo.has(t)){const e=ms(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),a=(As(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof a?a.trim():a}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Fc(e,t)}build(e,t,n){Gd(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return rf(e,t,n)}}class If extends Nf{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Nc}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Vo.has(t)){const e=ms(t);return e&&e.default||0}return t=ef.has(t)?t:fi(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return af(e,t,n)}build(e,t,n){qd(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){tf(e,t,0,r)}mount(e){this.isSVGTag=Jd(e.tagName),super.mount(e)}}const Sf=(e,t)=>Bd(e)?new If(t):new Mf(t,{allowProjection:e!==i.Fragment}),kf=Ka(wf({...ec,...xd,...md,..._d},Sf)),jf=(0,i.createContext)({}),Df=jf.Provider,Cf=()=>(0,i.useContext)(jf),Af=(e,t,n)=>{if(!e||!t)return{open:()=>({}),closed:()=>({})};const r=e?.getBoundingClientRect(),a=t?.getBoundingClientRect(),o=n?r?.x-a?.x+r?.width/2:a?.width-(a?.right-r?.x)+r?.width/2,i=r?.y-a?.y+r?.height/2;return{open:(e=1e3)=>({clipPath:`circle(${2*e+200}px at ${o}px ${i}px)`,background:"rgb(255, 255, 255, 1)",transition:{type:"spring",stiffness:20,restDelta:2,background:{duration:0}}}),closed:{clipPath:`circle(${r?.width/2}px at ${o}px ${i}px)`,background:"rgb(255, 255, 255, 0)",transition:{delay:.5,type:"spring",stiffness:400,damping:40,background:{duration:0,delay:1e3}}}}},Tf=e=>(0,P.jsx)(kf.path,{className:"stroke-icon-primary",fill:"transparent",strokeWidth:"3",strokeLinecap:"round",...e}),Of=({className:e})=>{const{toggleOpen:t,setTriggerRef:n}=Cf();return(0,P.jsx)(Va,{ref:n,className:Oe("relative z-[1] rounded-full hover:shadow-sm focus:[box-shadow:none] pointer-events-auto bg-background-primary",e),variant:"ghost",size:"xs",onClick:t,"aria-label":"Toggle menu",icon:(0,P.jsxs)(kf.svg,{className:"shrink-0 stroke-icon-primary",width:"23",height:"23",variants:{open:{viewBox:"0 0 20 20"},closed:{viewBox:"0 0 23 18"}},children:[(0,P.jsx)(Tf,{variants:{closed:{d:"M 2 2.5 L 20 2.5"},open:{d:"M 3 16.5 L 17 2.5"}}}),(0,P.jsx)(Tf,{d:"M 2 9.423 L 20 9.423",variants:{closed:{opacity:1},open:{opacity:0}},transition:{duration:.1}}),(0,P.jsx)(Tf,{variants:{closed:{d:"M 2 16.346 L 20 16.346"},open:{d:"M 3 2.5 L 17 16.346"}}})]})})},Lf={open:{transition:{staggerChildren:.07,delayChildren:.2}},closed:{transition:{staggerChildren:.05,staggerDirection:-1}}},zf=({tag:e="a",active:t,icon:n,iconPosition:r="left",className:a,children:o,...s})=>{let l=null,c=null;const u=n&&(0,i.isValidElement)(n)?(0,i.cloneElement)(n,{key:"left-icon",className:Oe("size-5",t?"text-brand-800":"text-icon-secondary",n.props?.className??"")}):null;switch(r){case"left":l=u;break;case"right":c=u;break;default:l=null,c=null}return(0,P.jsx)(Rf,{children:(0,P.jsxs)(e,{className:Oe("w-full no-underline hover:no-underline text-text-primary text-lg font-medium flex items-center gap-2 px-2.5 py-1.5 rounded-md hover:bg-background-secondary hover:text-text-primary focus:outline-none focus:shadow-none transition ease-in-out duration-150",t?"text-text-primary bg-background-secondary":"text-text-secondary",a),...s,children:[!!l&&l,(0,P.jsx)("span",{className:"contents",children:o}),!!c&&c]})})},Pf={open:{y:0,opacity:1,transition:{y:{stiffness:1e3,velocity:-100}}},closed:{y:50,opacity:0,transition:{y:{stiffness:1e3}}}},Rf=({children:e})=>(0,P.jsx)(kf.li,{className:"m-0 p-0 flex items-center justify-start w-full",variants:Pf,whileHover:{scale:1.05},whileTap:{scale:.95},children:e}),Uf=({children:e,className:t})=>{const{triggerRef:n,triggerOnRight:r,triggerOnLeft:a}=Cf(),[o,s]=(0,i.useState)(null);return n?(0,P.jsxs)(kf.div,{ref:s,className:Oe("absolute top-0 bottom-0 w-80 h-screen",r?"right-0":"left-0",t),children:[o&&(0,P.jsx)(kf.div,{className:Oe("bg-background-primary shadow-lg absolute top-0 bottom-0 w-80 border-y-0 border-l-0 border-r border-solid border-border-subtle",r?"right-0":"left-0"),variants:Af(n,o,a??!1)}),(0,P.jsx)(kf.ul,{variants:Lf,className:Oe("relative mt-14 mb-0 w-full px-5 pb-5 pt-2 flex flex-col items-start justify-start gap-0.5",t),children:e})]}):null},Bf=({className:e,children:t})=>{const[n,r]=function(...e){const t=(0,i.useRef)(0),[n,r]=(0,i.useState)(e[t.current]),a=(0,i.useCallback)(n=>{t.current="number"!=typeof n?((e,t,n)=>{const r=t-0;return((n-0)%r+r)%r+0})(0,e.length,t.current+1):n,r(e[t.current])},[e.length,...e]);return[n,a]}(!1,!0),[a,o]=(0,i.useState)(null),s=(0,i.useRef)(null),{height:l}=(e=>{const t=(0,i.useRef)({width:0,height:0});return(0,i.useEffect)(()=>{e.current&&(t.current.width=e.current.offsetWidth,t.current.height=e.current.offsetHeight)},[]),t.current})(s),{isRight:c=!1,isLeft:u=!0}=(e=>{if(!e)return{error:"Element not found."};const t=e.getBoundingClientRect(),n=window.innerWidth,r=n/2,a=t.right<r,o=t.left>r;return{isLeft:a,isRight:o,isCenter:!a&&!o,elementRect:{left:t.left,right:t.right,width:t.width},viewport:{width:n,center:r}}})(a);return(0,P.jsx)(Df,{value:{isOpen:n,toggleOpen:r,setTriggerRef:e=>{(0,i.startTransition)(()=>{o(e)})},triggerRef:a,triggerOnRight:c,triggerOnLeft:u},children:(0,P.jsx)("div",{className:Oe("size-6 z-[1]",e),children:(0,P.jsx)(kf.nav,{className:"h-full",initial:!1,animate:n?"open":"closed",custom:l,variants:{open:{pointerEvents:"auto"},closed:{pointerEvents:"none"}},ref:s,children:t})})})};Bf.displayName="HamburgerMenu",Of.displayName="HamburgerMenu.Toggle",Uf.displayName="HamburgerMenu.Options",zf.displayName="HamburgerMenu.Option",Bf.Options=Uf,Bf.Option=zf,Bf.Toggle=Of;const Ff=Ua("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),Yf=(0,i.forwardRef)(({label:e="",size:t="sm",className:n="",type:r="pill",variant:a="neutral",icon:o=null,disabled:i=!1,onClose:s=()=>{},closable:l=!1,onMouseDown:c=()=>{},disableHover:u=!1},d)=>{const f={neutral:"bg-badge-background-gray text-badge-color-gray border-badge-border-gray",red:"bg-badge-background-red text-badge-color-red border-badge-border-red",yellow:"bg-badge-background-yellow text-badge-color-yellow border-badge-border-yellow",green:"bg-badge-background-green text-badge-color-green border-badge-border-green",blue:"bg-badge-background-sky text-badge-color-sky border-badge-border-sky",inverse:"bg-background-inverse text-text-inverse border-background-inverse",disabled:"bg-badge-background-disabled text-badge-color-disabled border-badge-border-disabled disabled cursor-not-allowed"};let m="",p="group relative justify-center flex items-center cursor-pointer";const h={xxs:"[&>svg]:size-3",xs:"[&>svg]:size-3",sm:"[&>svg]:size-3",md:"[&>svg]:size-4",lg:"[&>svg]:size-5"};return i?(m=f.disabled,p+=" cursor-not-allowed disabled"):m=f[a],e?(0,P.jsxs)("span",{className:Oe("font-medium border-badge-border-gray flex items-center justify-center border border-solid box-border max-w-full transition-colors duration-150 ease-in-out",{xxs:"py-0.5 px-0.5 text-xs h-4",xs:"py-0.5 px-1 text-xs h-5",sm:"py-1 px-1.5 text-xs h-6",md:"py-1 px-1.5 text-sm h-7",lg:"py-1 px-1.5 text-base h-8"}[t],{pill:"rounded-full",rounded:"rounded"}[r],"gap-0.5",m,!u&&{neutral:"hover:bg-badge-hover-gray",red:"hover:bg-badge-hover-red",yellow:"hover:bg-badge-hover-yellow",green:"hover:bg-badge-hover-green",blue:"hover:bg-badge-hover-sky",inverse:"hover:bg-badge-hover-inverse",disabled:"hover:bg-badge-hover-disabled"}[a],n),ref:d,children:[o?(0,P.jsx)("span",{className:Oe("justify-center flex items-center",h[t]),children:o}):null,(0,P.jsx)("span",{className:"px-1 truncate inline-block",children:e}),l&&(0,P.jsxs)("span",{className:Oe(p,h[t]),onMouseDown:c,role:"button",tabIndex:0,...!i&&{onClick:s},children:[(0,P.jsx)("span",{className:"sr-only",children:`Remove ${e}`}),(0,P.jsx)(Ff,{}),(0,P.jsx)("span",{className:"absolute -inset-1"})]})]}):null});Yf.displayName="Badge";const Qf=(0,i.forwardRef)(({children:e=null,tag:t="label",size:n="sm",className:r="",variant:a="neutral",required:o=!1,...i},s)=>{if(!e)return null;let l="";return o&&(l="after:content-['*'] after:text-field-required after:ml-0.5"),(0,P.jsx)(t,{ref:s,className:Oe("font-medium text-field-label flex items-center gap-0.5",{xs:"text-xs [&>*]:text-xs [&>svg]:h-3 [&>svg]:w-3",sm:"text-sm [&>*]:text-sm [&>svg]:h-4 [&>svg]:w-4",md:"text-base [&>*]:text-base [&>svg]:h-5 [&>svg]:w-5"}[n],{neutral:"text-field-label [&>*]:text-field-label",help:"text-field-helper [&>*]:text-field-helper",error:"text-support-error [&>*]:text-support-error",disabled:"text-field-color-disabled disabled cursor-not-allowed [&>*]:text-field-color-disabled"}[a],l,{neutral:"",help:"font-normal",error:"font-normal",disabled:""}?.[a],r),...i,children:e})});function Vf({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))}Qf.displayName="Label";const Wf=i.forwardRef(Vf);var Zf=a(6942),Gf=a.n(Zf);const Hf=a.p+"images/cartflows-symbol.4a28363b.png";var $f=function(e,t,n,r){return new(n||(n=Promise))(function(a,o){function i(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){e.done?a(e.value):function(e){return e instanceof n?e:new n(function(t){t(e)})}(e.value).then(i,s)}l((r=r.apply(e,t||[])).next())})};const Xf={rssFeedURL:"",selector:"",uniqueKey:"",loaderIcon:'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid">\n\t<circle cx="50" cy="50" fill="none" stroke="#9f9f9f" stroke-width="10" r="35" stroke-dasharray="164.93361431346415 56.97787143782138">\n\t\t<animateTransform attributeName="transform" type="rotate" repeatCount="indefinite" dur="1s" values="0 50 50;360 50 50" keyTimes="0;1"></animateTransform>\n\t</circle>\n\t</svg>',viewAll:{link:"",label:"View All"},triggerButton:{label:"",icon:'<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M8.61703 13.1998C8.04294 13.1503 7.46192 13.125 6.875 13.125H6.25C4.17893 13.125 2.5 11.4461 2.5 9.375C2.5 7.30393 4.17893 5.625 6.25 5.625H6.875C7.46192 5.625 8.04294 5.59972 8.61703 5.55018M8.61703 13.1998C8.82774 14.0012 9.1031 14.7764 9.43719 15.5195C9.64341 15.9782 9.48685 16.5273 9.05134 16.7787L8.50441 17.0945C8.04492 17.3598 7.45466 17.1921 7.23201 16.7106C6.70983 15.5811 6.30451 14.3866 6.03155 13.1425M8.61703 13.1998C8.29598 11.9787 8.125 10.6968 8.125 9.375C8.125 8.05316 8.29598 6.77125 8.61703 5.55018M8.61703 13.1998C11.25 13.427 13.737 14.1643 15.9789 15.3124M8.61703 5.55018C11.25 5.323 13.737 4.58569 15.9789 3.43757M15.9789 3.43757C15.8808 3.12162 15.7751 2.80903 15.662 2.5M15.9789 3.43757C16.4247 4.87356 16.7131 6.37885 16.8238 7.93326M15.9789 15.3124C15.8808 15.6284 15.7751 15.941 15.662 16.25M15.9789 15.3124C16.4247 13.8764 16.7131 12.3711 16.8238 10.8167M16.8238 7.93326C17.237 8.2772 17.5 8.79539 17.5 9.375C17.5 9.95461 17.237 10.4728 16.8238 10.8167M16.8238 7.93326C16.8578 8.40942 16.875 8.8902 16.875 9.375C16.875 9.8598 16.8578 10.3406 16.8238 10.8167" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',beforeBtn:"",afterBtn:"",className:"",onClick:()=>{}},notification:{setLastPostUnixTime:null,getLastPostUnixTime:null},flyout:{title:"What's New?",innerContent:{titleLink:!0,additionalClasses:[]},excerpt:{wordLimit:500,moreSymbol:"…",readMore:{label:"Read More",className:""}},className:"",closeOnEsc:!0,closeOnOverlayClick:!0,closeBtnIcon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 18L18 6M6 6L18 18" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>',formatDate:null,onOpen:()=>{},onClose:()=>{},onReady:()=>{}}};class qf{constructor(e){this.rssFeedURLs=[],this.lastPostUnixTime=0,this.multiLastPostUnixTime={},this.notificationsCount=0,this.multiNotificationCount={},this.hasNewFeeds=!1,this.multiHasNewFeeds={},this.validateArgs(e),this.parseDefaults(e),this.setElement(),this.getElement()?(this.setID(),this.setRSSFeedURLs(),Jf.setInstanceID(this.getID()),this.RSS_Fetch_Instance=new Kf(this),this.RSS_View_Instance=new em(this),this.setNotificationsCount(),this.setTriggers()):console.warn("WNR: Cannot find element with",this.getArgs().selector)}validateArgs(e){["rssFeedURL","selector","uniqueKey"].forEach(t=>{if(!e[t])throw new Error(`${t} is a required argument. It cannot be empty or undefined.`);if("rssFeedURL"===t){const n=e[t];Array.isArray(n)&&n.forEach(e=>{if(!(null==e?void 0:e.key))throw new Error(`The parameter "key" is required for "${t}" parameter in multi-feed mode.`);if(e.key.includes(" "))throw new Error(`The parameter "key" cannot have spaces for "${t}" parameter in multi-feed mode. Ref Key: "${e.key}"`)})}})}parseDefaults(e){var t,n;this.args=Object.assign(Object.assign(Object.assign({},Xf),e),{viewAll:Object.assign(Object.assign({},Xf.viewAll),null==e?void 0:e.viewAll),triggerButton:Object.assign(Object.assign({},Xf.triggerButton),null==e?void 0:e.triggerButton),flyout:Object.assign(Object.assign(Object.assign({},Xf.flyout),null==e?void 0:e.flyout),{innerContent:Object.assign(Object.assign({},Xf.flyout.innerContent),null===(t=null==e?void 0:e.flyout)||void 0===t?void 0:t.innerContent),excerpt:Object.assign(Object.assign({},Xf.flyout.excerpt),null===(n=null==e?void 0:e.flyout)||void 0===n?void 0:n.excerpt)})})}getArgs(){return this.args}setElement(){this.element=document.querySelector(this.args.selector)}getElement(){return this.element}setID(){const e=[this.getArgs().selector,this.getArgs().uniqueKey],t=this.getArgs().rssFeedURL;Array.isArray(t)?t.forEach(t=>{e.push(t.key)}):e.push(t),this.ID=btoa(e.join("-")).slice(-12).replace(/=/g,"")+"-"+this.getArgs().uniqueKey}isMultiFeedRSS(){return"string"!=typeof this.getArgs().rssFeedURL}setRSSFeedURLs(){const e=this.getArgs().rssFeedURL;this.isMultiFeedRSS()?Array.isArray(e)&&e.forEach(e=>{this.rssFeedURLs.push(e)}):this.rssFeedURLs.push({key:null,label:"",url:e.toString()})}getRSSFeedURLs(){return this.rssFeedURLs}getID(){return this.ID}setNotificationsCount(){return $f(this,void 0,void 0,function*(){yield Promise.all(this.getRSSFeedURLs().map(e=>$f(this,[e],void 0,function*({key:e}){let t=0;t="function"==typeof this.getArgs().notification.getLastPostUnixTime?yield this.getArgs().notification.getLastPostUnixTime(e,this):Jf.getLastPostUnixTime(e),this.isMultiFeedRSS()?this.multiLastPostUnixTime[e]=+t:this.lastPostUnixTime=+t}))),yield this.RSS_Fetch_Instance.fetchData().then(e=>{Object.keys(e).forEach(t=>{const n=e[t];if(!n.length)return;this.multiNotificationCount[t]=0;const r=+n[0].date,a=this.isMultiFeedRSS()?this.multiLastPostUnixTime[t]:this.lastPostUnixTime;r>a&&(n.forEach(e=>{e.date>a&&(this.isMultiFeedRSS()&&(this.multiNotificationCount[t]++,this.multiHasNewFeeds[t]=!0),this.notificationsCount++,this.hasNewFeeds=!0)}),this.RSS_View_Instance.setNotification(this.notificationsCount))})}).catch(console.error)})}getNotificationsCount(){return this.notificationsCount}setTriggers(){const e=document.getElementById(this.RSS_View_Instance.getTriggerButtonID()),t=document.getElementById(this.RSS_View_Instance.getFlyoutID()),n=t.querySelector(".whats-new-rss-flyout-inner-content"),r=document.getElementById(this.RSS_View_Instance.getFlyoutCloseBtnID()),a=document.getElementById(this.RSS_View_Instance.getFlyoutMultiFeedNavID()),o=e=>{this.RSS_Fetch_Instance.fetchData().then(r=>{n.innerHTML="";const a=r[e];if(!a.length)return;const o=+a[0].date,i=this.isMultiFeedRSS()?this.multiLastPostUnixTime[e]:this.lastPostUnixTime;a.forEach(t=>{const r=!!i&&t.date>i,a=this.getArgs().flyout.innerContent.titleLink?`<a href="${t.postLink}" target="_blank">\n\t\t\t\t\t\t\t\t<h2>${t.title}</h2>\n\t\t\t\t\t\t\t</a>`:`<h2>${t.title}</h2>`,o=`\n\t\t\t\t\t\t\t\t<div class="rss-content-header">\n\t\t\t\t\t\t\t\t\t<p>${this.RSS_View_Instance.formatDate(new Date(t.date))}</p>\n\t\t\t\t\t\t\t\t\t${a}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t${this.RSS_View_Instance.createExcerpt(t.description,t.postLink,this.getArgs().flyout.excerpt)}\n\t\t\t\t\t\t\t\t${this.RSS_View_Instance.listChildrenPosts(t.children)}\n\t\t\t\t\t\t\t`,s=this.getArgs().flyout.innerContent.additionalClasses;e&&s.push("`inner-content-item-feed-key-${key}`"),n.innerHTML+=this.RSS_View_Instance.innerContentWrapper(o,r,s.join(" "))}),this.getArgs().viewAll.link&&(n.innerHTML+=this.RSS_View_Instance.innerContentWrapper(`\n\t\t\t\t\t\t\t<a href="${this.getArgs().viewAll.link}" class="button view-all">${this.getArgs().viewAll.label}</a>\n\t\t\t\t\t\t\t`)),this.RSS_View_Instance.setIsLoading(!1),t.classList.add("ready"),this.getArgs().flyout.onReady(this),t.focus(),this.isMultiFeedRSS()||(this.lastPostUnixTime=o,this.hasNewFeeds&&("function"==typeof this.getArgs().notification.setLastPostUnixTime?this.getArgs().notification.setLastPostUnixTime(o,e):Jf.setLastPostUnixTime(o,e)))}).catch(console.error)};e.addEventListener("click",e=>{e.preventDefault();const n=window.innerWidth-document.documentElement.clientWidth;if(this.getArgs().triggerButton.onClick(this),this.RSS_View_Instance.setIsLoading(!0),t.removeAttribute("style"),t.classList.remove("closed"),t.classList.add("open"),document.body.classList.add("whats-new-rss-is-active"),n){const e=document.getElementById("whats-new-rss-styles");(null==e?void 0:e.sheet)&&e.sheet.insertRule(`.whats-new-rss-is-active { background-color: yellow; padding-right: ${n}px; }`,e.sheet.cssRules.length)}if(this.getArgs().flyout.onOpen(this),!this.isMultiFeedRSS())return void o(null);const r=a.querySelectorAll("button");r.forEach(e=>{this.RSS_View_Instance.setMultiFeedTabNotificationCount(e.dataset.feedKey,this.multiNotificationCount[e.dataset.feedKey]),e.addEventListener("click",t=>{t.preventDefault();const n=e.dataset.feedKey;this.multiNotificationCount[n]=0,this.RSS_Fetch_Instance.fetchData().then(e=>{const t=e[n][0].date;this.multiLastPostUnixTime[n]=t,!0===this.multiHasNewFeeds[n]&&("function"==typeof this.getArgs().notification.setLastPostUnixTime?this.getArgs().notification.setLastPostUnixTime(t,n):Jf.setLastPostUnixTime(t,n)),this.multiHasNewFeeds[n]=!1}).catch(console.error),r.forEach(e=>{e.classList.remove("selected");const t=e.dataset.feedKey,r=`.inner-content-item-feed-key-${t}`;document.querySelectorAll(r).forEach(e=>{n!==t?e.classList.add("hidden"):e.classList.remove("hidden")})}),e.classList.add("selected"),o(n)})}),r[0].click()});const i=()=>{t.classList.add("closed"),t.classList.remove("open"),t.classList.remove("ready"),document.body.classList.remove("whats-new-rss-is-active"),this.isMultiFeedRSS()?this.RSS_View_Instance.setNotification(Object.values(this.multiNotificationCount).filter(Boolean).length):(this.hasNewFeeds=!1,this.RSS_View_Instance.setNotification(!1)),n.innerHTML="",this.getArgs().flyout.onClose(this),e.focus()};this.getArgs().flyout.closeOnEsc&&document.addEventListener("keydown",function(e){"Escape"===e.key&&t.classList.contains("open")&&i()}),this.getArgs().flyout.closeOnOverlayClick&&t.querySelector(".whats-new-rss-flyout-overlay").addEventListener("click",i),r.addEventListener("click",i)}}class Jf{static setInstanceID(e){this.instanceID||(this.instanceID=e)}static prefixer(e,t=""){if(!this.instanceID)throw new Error("Instance ID not set.");return t?`${this.keys[e]}-${this.instanceID}-${t}`:`${this.keys[e]}-${this.instanceID}`}static _setDataExpiry(e=""){const t=(new Date).getTime()+864e5;sessionStorage.setItem(this.prefixer("SESSION_DATA_EXPIRY",e),JSON.stringify(t))}static _isDataExpired(e=""){const t=this.prefixer("SESSION_DATA_EXPIRY",e),n=window.sessionStorage.getItem(t);if(!n)return!0;const r=JSON.parse(n);return(new Date).getTime()>r&&(window.sessionStorage.removeItem(t),!0)}static setSessionData(e,t=""){return this._setDataExpiry(t),window.sessionStorage.setItem(this.prefixer("SESSION",t),e)}static getSessionData(e=""){return this._isDataExpired(e)?"{}":window.sessionStorage.getItem(this.prefixer("SESSION",e))}static setLastPostUnixTime(e,t=""){return window.localStorage.setItem(this.prefixer("LAST_LATEST_POST",t),e.toString())}static getLastPostUnixTime(e=""){return+window.localStorage.getItem(this.prefixer("LAST_LATEST_POST",e))}}Jf.keys={SESSION_DATA_EXPIRY:"whats-new-cache-expiry",LAST_LATEST_POST:"whats-new-last-unixtime",SESSION:"whats-new-cache"};class Kf{constructor(e){this.data={},this.RSS=e,this.RSS.getRSSFeedURLs().forEach(e=>{const t=JSON.parse(Jf.getSessionData(e.key));t&&t.length&&(this.data[e.key]=t)})}fetchData(){return $f(this,void 0,void 0,function*(){if(Object.keys(this.data).length)return this.data;const e=this.RSS.getRSSFeedURLs().map(e=>$f(this,void 0,void 0,function*(){this.data[e.key]=[];const t=yield fetch(e.url);let n=yield t.text();n=n.replace(/»/g,"&raquo;"),(new DOMParser).parseFromString(n,"text/xml").querySelectorAll("item").forEach(t=>{var n;const r=t.querySelector("title").textContent,a=t.querySelector("link").textContent,o=t.querySelector("content\\:encoded, encoded"),i=o?o.textContent:"",s=t.querySelector("pubDate").innerHTML;this.data[e.key].push({title:r,date:s?+new Date(s):null,postLink:a,description:i.replace(/<a\b((?:(?!target=)[^>])*)>/g,'<a$1 target="_blank">').replace(/<p>\s*<\/p>/g,""),children:JSON.parse((null===(n=t.querySelector("children"))||void 0===n?void 0:n.innerHTML)||"{}")})}),Jf.setSessionData(JSON.stringify(this.data[e.key]),e.key)}));return yield Promise.all(e),this.data})}}class em{constructor(e){this.RSS=e,this.createTriggerButton(),this.createFlyOut()}getTriggerButtonID(){return`whats-new-rss-btn-${this.RSS.getID()}`}getFlyoutID(){return`whats-new-rss-flyout-${this.RSS.getID()}`}getFlyoutCloseBtnID(){return`whats-new-rss-flyout-close-${this.RSS.getID()}`}getFlyoutMultiFeedNavID(){return`whats-new-rss-flyout-multi-feed-nav-${this.RSS.getID()}`}setIsLoading(e=!1){const t=document.getElementById(this.getFlyoutID());e?t.classList.add("is-loading"):t.classList.remove("is-loading")}setNotification(e){const t=document.querySelector(`#${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")}createTriggerButton(){let e="";const t=this.RSS.getArgs().triggerButton.label;e=t?`\n\t\t\t${this.RSS.getArgs().triggerButton.beforeBtn}\n\t\t\t<a class="whats-new-rss-trigger-button has-label" id="${this.getTriggerButtonID()}">\n\t\t\t\t<div class="icon-badge">\n\t\t\t\t\t${this.RSS.getArgs().triggerButton.icon}\n\t\t\t\t\t<div class="whats-new-rss-notification-badge hide">0</div>\n\t\t\t\t</div>\n\t\t\t\t${t}\n\t\t\t</a>\n\t\t\t${this.RSS.getArgs().triggerButton.afterBtn}\n\t\t\t`:`\n\t\t\t${this.RSS.getArgs().triggerButton.beforeBtn}\n\t\t\t<a class="whats-new-rss-trigger-button" id="${this.getTriggerButtonID()}">\n\t\t\t\t${this.RSS.getArgs().triggerButton.icon}\n\t\t\t\t<div class="whats-new-rss-notification-badge hide">0</div>\n\t\t\t</a>\n\t\t\t${this.RSS.getArgs().triggerButton.afterBtn}\n\t\t\t`,this.RSS.getElement().innerHTML+=e}createFlyOut(){const e=["whats-new-rss-flyout","closed"];this.RSS.getArgs().flyout.className&&e.push(this.RSS.getArgs().flyout.className);let t=[];this.RSS.isMultiFeedRSS()&&(t.push(`<nav id="${this.getFlyoutMultiFeedNavID()}" class="whats-new-rss-multi-feed-nav">`),this.RSS.getRSSFeedURLs().forEach(e=>{t.push(`<button type="button" data-feed-key="${e.key}">\n\t\t\t\t\t\t${e.label}\n\t\t\t\t\t\t<div class="new-notification-count"></div>\n\t\t\t\t\t</button>\n\t\t\t\t\t`)}),t.push("</nav>"));const n=document.createElement("div");n.setAttribute("id",this.getFlyoutID()),n.setAttribute("class",e.join(" ")),n.setAttribute("role","dialog"),n.setAttribute("style","visibility:hidden"),n.innerHTML=`\n\t\t<div class="whats-new-rss-flyout-contents">\n\n\t\t\t<div class="whats-new-rss-flyout-inner-header">\n\n\t\t\t\t<div class="whats-new-rss-flyout-inner-header__title-icon-wrapper">\n\t\t\t\t\t<h3>${this.RSS.getArgs().flyout.title}</h3>\n\n\t\t\t\t\t<span class="whats-new-rss-flyout-inner-header__loading-icon">\n\t\t\t\t\t${this.RSS.getArgs().loaderIcon}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\n\t\t\t\t<button type="button" id="${this.getFlyoutCloseBtnID()}">${this.RSS.getArgs().flyout.closeBtnIcon}</button>\n\t\t\t</div>\n\n\t\t\t${t.join("")}\n\n\t\t\t<div class="whats-new-rss-flyout-inner-content">\n\t\t\t\t<div class="skeleton-container">\n\t\t\t\t\t<div class="skeleton-row whats-new-rss-flyout-inner-content-item"></div>\n\t\t\t\t\t<div class="skeleton-row whats-new-rss-flyout-inner-content-item"></div>\n\t\t\t\t\t<div class="skeleton-row whats-new-rss-flyout-inner-content-item"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t</div>\n\n\t\t<div class="whats-new-rss-flyout-overlay"></div>\n\t\t`,document.body.appendChild(n)}setMultiFeedTabNotificationCount(e,t=0){const n=document.querySelector(`#${this.getFlyoutMultiFeedNavID()} button[data-feed-key="${e}"]`);if(!n)return;const r=n.querySelector(".new-notification-count");if(t){const e=t>9?"9+":t;r.innerHTML=e.toString()}else r.innerHTML=""}innerContentWrapper(e,t=!1,n=""){const r=["whats-new-rss-flyout-inner-content-item"];return t&&r.push("rss-new-post"),n&&r.push(n),`\n\t\t<div class="${r.join(" ")}">\n\t\t\t${t?'<small class="new-post-badge">New ✨</small>':""}\n\t\t\t${e}\n\t\t</div>\n\t\t`}createExcerpt(e,t,n){const{wordLimit:r,moreSymbol:a,readMore:o}=n;if(!r)return e;const i=e.replace(/<[^>]*>/g,"").split(/\s+/);let s=i.slice(0,r).join(" ");return a&&(s+=a),r>i.length?e:t&&(null==o?void 0:o.label)?`<p>${s} <a href="${t}" target="_blank" class="${o.className}">${o.label}</a></p>`:`<p>${s}</p>`}listChildrenPosts(e){const t=Object.values(e);if(!t.length)return"";const n=document.createElement("details"),r=document.createElement("summary"),a=document.createElement("div");return t.forEach(e=>{const t=(new DOMParser).parseFromString(e.post_content,"text/html"),n=document.createElement("div");n.classList.add("sub-version-item"),n.innerHTML=`\n\t\t\t\t<div class="sub-version-header">\n\t\t\t\t\t<h4 class="sub-version-title">${e.post_title}</h4>\n\t\t\t\t\t<span class="sub-version-date">${this.formatDate(new Date(e.post_date))}</span>\n\t\t\t\t</div>\n\t\t\t\t<div class="sub-version-content">${t.documentElement.textContent}</div>\n\t\t\t`,a.appendChild(n)}),r.innerHTML='<p class="text-see-more">See More</p><p class="text-see-less">See Less</p>',n.appendChild(r),n.appendChild(a),a.classList.add("sub-version-items-wrapper"),n.classList.add("whats-new-rss-sub-version-details"),n.outerHTML}formatDate(e){if("function"==typeof this.RSS.getArgs().flyout.formatDate)return this.RSS.getArgs().flyout.formatDate(e);const t=new Date,n=e.getTime(),r=t.getTime()-n,a=36e5,o=24*a,i=7*o,s=30*o;if(r<6e4)return"Just now";if(r<a){const e=Math.floor(r/6e4);return`${e} minute${e>1?"s":""} ago`}if(r<o){const e=Math.floor(r/a);return`${e} hour${e>1?"s":""} ago`}if(r<i){const e=Math.floor(r/o);return`${e} day${e>1?"s":""} ago`}if(r<s){const e=Math.floor(r/i);return`${e} week${e>1?"s":""} ago`}{const e=Math.floor(r/s);return`${e} month${e>1?"s":""} ago`}}}const tm=function(){const e=cartflows_admin?.whats_new_rss_feed;return function({selector:e,...t}){const n=(0,i.useRef)(null);(0,i.useEffect)(()=>{var r;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'@import url(https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap);.whats-new-rss-is-active{overflow:hidden}.whats-new-rss-trigger-button{display:flex;align-items:center;position:relative;width:auto;padding:0!important;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:-9px;width:18px;height:18px;font-size:10px;line-height:20px;text-align:center;border-radius:10px;color:#fff;background:#ff580e;display:flex;align-items:center;justify-content:center;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!important}.whats-new-rss-trigger-button:hover .whats-new-rss-notification-badge{transform:unset}.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:Figtree,sans-serif;height:100vh;font-size:15px;font-weight:400;line-height:20px;color:#374151;margin-bottom:5px}.whats-new-rss-flyout *,.whats-new-rss-flyout ::after,.whats-new-rss-flyout ::before{box-sizing:border-box}.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 p{font-size:14px;font-weight:400;line-height:20px;color:#374151;margin-bottom:15px}.whats-new-rss-flyout p a{color:#1170ff}.whats-new-rss-flyout .wp-block-uagb-buttons{background:#ff6c0a;padding:10px 18px;width:fit-content;color:#fff;border-radius:6px;box-shadow:0 1px 2px rgba(0,0,0,.05);margin-bottom:15px}.whats-new-rss-flyout .wp-block-uagb-buttons .uagb-button__link{color:#fff;font-size:1rem;font-weight:600;line-height:1.5rem}.whats-new-rss-flyout .ast-oembed-container{position:relative;padding-top:56.25%;height:0;overflow:hidden;max-width:100%;height:auto}.whats-new-rss-flyout .wp-has-aspect-ratio iframe{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.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!important;border-bottom:1px solid #e5e7eb}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-header [id^=whats-new-rss-flyout-close-]{width:24px;height:24px;display:flex;align-items:center;justify-content:center}.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:#111827;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;padding:0 4px}.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:#111827;font-weight:600;font-size:16px;line-height:24px;margin-bottom:0!important}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-multi-feed-nav{display:flex;padding:0 30px;border-bottom:1px solid #e5e7eb;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:20px;color:#374151;font-weight:400;font-size:14px;line-height:20px;display:flex;flex-direction:column}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>:nth-child(n+1){margin:8px 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>:first-child{margin-top:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>:nth-child(n+1):is(ul){margin-top:0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item>:nth-child(n+1):is(div):has(figure){margin-bottom:12px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item figure,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item img{margin:0!important}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item .wp-smiley{display:inline-block;margin:0;min-height:1em;margin-bottom:4px}.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 h2{font-size:22px;font-weight:600;line-height:1.5em;margin-bottom:15px;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h3{font-size:20px;font-weight:600;line-height:1.5em;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h4{font-size:18px;font-weight:600;line-height:1.5em;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h5{font-size:16px;font-weight:600;line-height:1.5em;margin-bottom:15px;padding-top:12px;padding-bottom:4px}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item h6{font-size:13px;font-weight:600;line-height:1.5em;margin-bottom:15px;padding-top:12px;padding-bottom:4px}.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:#ff6c0a;border-radius:4px;top:22px;right:24px;padding:0 4px;color:#fff;position:absolute}.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:4px;padding: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:#6b7280;margin:0;padding:0;font-weight:500;line-height:16px;font-size:12px;margin-bottom:0!important}.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:#111827;font-weight:600;line-height:30px;font-size:20px;padding:0}.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 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;margin-bottom: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;max-width:100%}.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;margin-bottom:15px}.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;margin-left:10px}.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{font-size:14px;font-weight:400;line-height:20px;color:#374151;margin:0 0 4px 0}.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ol li:last-child,.whats-new-rss-flyout .whats-new-rss-flyout-contents .whats-new-rss-flyout-inner-content .whats-new-rss-flyout-inner-content-item ul li:last-child{margin-bottom:0}.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)}}(),n.current||(n.current=(r={selector:e,...t},new qf(r))),()=>{n.current&&"function"==typeof n.current.destroy&&n.current.destroy()}},[e,...Object.values(t)]),n.current}({uniqueKey:"cartflows",rssFeedURL:1<e.length?e:e[0]?.url,selector:"#wcf-whats-new-content",triggerButton:{icon:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="size-4 m-1 text-text-primary"><path d="m3 11 18-5v12L3 13v-2z"/><path d="M11.6 16.8a3 3 0 1 1-5.8-1.6"/></svg>'},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,o.createElement)("div",{id:"wcf-whats-new-content",className:"[&>a]:p-0.5 [&>a]:pl-0"})},nm=Ua("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]),rm=Ua("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]),am=(e,t=!0)=>new Promise((n,r)=>{const a=new window.FormData;a.append("action","cartflows_activate_plugin"),a.append("init",e.init),a.append("security",cartflows_admin.activate_plugin_nonce),L()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then(e=>{console.log("Helper.js",e),e.success?(n(e),t&&window.location.reload()):r(e)})});function om({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"}))}const im=i.forwardRef(om),sm=function(){const e=cartflows_admin?.cf_pro_status,t=(0,z.__)("upgrading to PRO","cartflows"),n=!wcfCartflowsPro()&&"inactive"===e,[r,a]=(0,i.useState)(!1),s=getUpgradeToProUrl();let l="";return n?l=(0,z.__)("activating CartFlows Pro","cartflows"):wcfCartflowsPro()||(l=t),(0,o.createElement)("div",{className:"bg-primary-50 p-3 z-20 relative"},(0,o.createElement)("p",{className:"wcf-main-upgrade-pro-notice text-sm flex justify-center m-0"},(0,z.__)("You're on","cartflows")," ",(0,o.createElement)("span",{className:"font-semibold"},(0,z.__)("CartFlows Free.","cartflows")," "),(0,z.__)("Unlock upsells, order bumps & more revenue by","cartflows")," ",n?(0,o.createElement)("span",{className:"text-brand-600 hover:text-brand-800 font-semibold flex items-center gap-1 cursor-pointer",onClick:()=>{a(!0),am({slug:"cartflows-pro",init:"cartflows-pro/cartflows-pro.php",name:"cartflows-pro"}).then(e=>{console.log(e),a(!0)}).catch(e=>{console.log(e),a(!1)})}},r&&(0,o.createElement)(Wf,{className:`w-4 h-4 stroke-2 ${r?"wcf-processing animate-spin":""} `}),r?(0,z.__)("Activating","cartflows"):l):(0,o.createElement)("a",{href:s,target:"_blank",className:"text-brand-600 hover:text-brand-800 font-semibold flex items-center gap-1",rel:"noreferrer"},l,(0,o.createElement)(im,{className:"w-4 h-[18px] stroke-2 text-brand-500"}))))};class lm extends i.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function cm({children:e,isPresent:t}){const n=(0,i.useId)(),r=(0,i.useRef)(null),a=(0,i.useRef)({width:0,height:0,top:0,left:0}),{nonce:o}=(0,i.useContext)(Nd);return(0,i.useInsertionEffect)(()=>{const{width:e,height:i,top:s,left:l}=a.current;if(t||!r.current||!e||!i)return;r.current.dataset.motionPopId=n;const c=document.createElement("style");return o&&(c.nonce=o),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${n}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${i}px !important;\n top: ${s}px !important;\n left: ${l}px !important;\n }\n `),()=>{document.head.removeChild(c)}},[t]),(0,P.jsx)(lm,{isPresent:t,childRef:r,sizeRef:a,children:i.cloneElement(e,{ref:r})})}const um=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:a,presenceAffectsLayout:o,mode:s})=>{const l=Fd(dm),c=(0,i.useId)(),u=(0,i.useCallback)(e=>{l.set(e,!0);for(const e of l.values())if(!e)return;r&&r()},[l,r]),d=(0,i.useMemo)(()=>({id:c,initial:t,isPresent:n,custom:a,onExitComplete:u,register:e=>(l.set(e,!1),()=>l.delete(e))}),o?[Math.random(),u]:[n,u]);return(0,i.useMemo)(()=>{l.forEach((e,t)=>l.set(t,!1))},[n]),i.useEffect(()=>{!n&&!l.size&&r&&r()},[n]),"popLayout"===s&&(e=(0,P.jsx)(cm,{isPresent:n,children:e})),(0,P.jsx)(Gc.Provider,{value:d,children:e})};function dm(){return new Map}const fm=e=>e.key||"";function mm(e){const t=[];return i.Children.forEach(e,e=>{(0,i.isValidElement)(e)&&t.push(e)}),t}const pm=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:a=!0,mode:o="sync",propagate:s=!1})=>{const[l,c]=Hc(s),u=(0,i.useMemo)(()=>mm(e),[e]),d=s&&!l?[]:u.map(fm),f=(0,i.useRef)(!0),m=(0,i.useRef)(u),p=Fd(()=>new Map),[h,g]=(0,i.useState)(u),[w,y]=(0,i.useState)(u);Od(()=>{f.current=!1,m.current=u;for(let e=0;e<w.length;e++){const t=fm(w[e]);d.includes(t)?p.delete(t):!0!==p.get(t)&&p.set(t,!1)}},[w,d.length,d.join("-")]);const b=[];if(u!==h){let e=[...u];for(let t=0;t<w.length;t++){const n=w[t],r=fm(n);d.includes(r)||(e.splice(t,0,n),b.push(n))}return"wait"===o&&b.length&&(e=b),y(mm(e)),void g(u)}const{forceRender:v}=(0,i.useContext)($c);return(0,P.jsx)(P.Fragment,{children:w.map(e=>{const i=fm(e),h=!(s&&!l)&&(u===w||d.includes(i));return(0,P.jsx)(um,{isPresent:h,initial:!(f.current&&!n)&&void 0,custom:h?void 0:t,presenceAffectsLayout:a,mode:o,onExitComplete:h?void 0:()=>{if(!p.has(i))return;p.set(i,!0);let e=!0;p.forEach(t=>{t||(e=!1)}),e&&(null==v||v(),y(m.current),s&&(null==c||c()),r&&r())},children:e},i)})})},hm=Ua("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),gm=(0,i.createContext)({}),wm=()=>(0,i.useContext)(gm),ym=({size:e="md",children:t,className:n})=>(0,P.jsx)(gm.Provider,{value:{size:e},children:(0,P.jsx)("div",{className:Oe("flex flex-col bg-background-primary p-2",n),children:t})});ym.displayName="Menu";const bm=({heading:e,arrow:t=!1,showArrowOnHover:n=!1,open:r=!0,onClick:a,children:o,className:s})=>{const[l,c]=(0,i.useState)(r),[u,d]=(0,i.useState)(!1),{size:f}=wm(),m={sm:"text-xs",md:"text-sm"}[f??"md"],p={sm:"size-4",md:"size-5"}[f??"md"],h=()=>{c(!l),a&&a(!l)};return(0,P.jsxs)("div",{children:[!!e&&(0,P.jsxs)("div",{role:"button",tabIndex:0,onClick:h,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&h()},onMouseEnter:()=>n&&d(!0),onMouseLeave:()=>n&&d(!1),className:Oe("text-text-primary bg-transparent cursor-pointer flex justify-between items-center gap-1",m,e?"p-1":"p-0",s),"aria-expanded":l,children:[(0,P.jsx)("span",{className:"text-text-tertiary",children:e}),t&&(0,P.jsx)(kf.span,{className:"flex items-center text-border-strong",initial:"hidden",animate:n?l||u?"visible":"hidden":"visible",exit:"hidden",variants:{visible:{opacity:1},hidden:{opacity:0}},transition:{duration:.15},children:(0,P.jsx)(kf.span,{className:"inline-flex p-1",variants:{open:{rotate:180},closed:{rotate:0}},animate:l?"open":"closed",transition:{duration:.15},children:(0,P.jsx)(hm,{className:Oe("shrink-0",p)})})})]}),(0,P.jsx)(pm,{initial:!1,children:l&&(0,P.jsx)(kf.ul,{role:"menu",variants:{open:{height:"auto",opacity:1},closed:{height:0,opacity:0}},initial:"closed",animate:"open",exit:"closed",transition:{duration:.3,ease:"easeInOut"},className:"overflow flex gap-0.5 flex-col m-0 bg-white rounded p-0",children:o})})]})};bm.displayName="Menu.List";const vm=({disabled:e=!1,active:t,onClick:n,children:r,className:a,...o})=>{const{size:i}=wm(),s={sm:"[&>svg]:size-4 [&>svg]:m-1 [&>*:not(svg)]:mx-1 [&>*:not(svg)]:my-0.5 text-sm",md:"[&>svg]:size-5 [&>svg]:m-1.5 [&>*:not(svg)]:m-1 text-base"}[i??"md"];return(0,P.jsx)("li",{role:"menuitem",tabIndex:e?-1:0,onClick:e?void 0:n,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&n?.()},className:Oe("flex p-1 gap-1 items-center bg-transparent border-none rounded text-text-secondary cursor-pointer m-0",s,"hover:bg-background-secondary hover:text-text-primary",e?"text-text-disabled hover:text-text-disabled cursor-not-allowed hover:bg-transparent":"",t?"text-icon-primary [&>svg]:text-icon-interactive bg-background-secondary":"","transition-colors duration-300 ease-in-out",a),"aria-disabled":e,...o,children:r})};vm.displayName="Menu.Item";const xm=({variant:e="solid",className:t})=>{const n={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted",double:"border-double",hidden:"border-hidden",none:"border-none"}[e];return(0,P.jsx)("li",{className:"m-0 p-0 list-none",role:"separator","aria-hidden":"true",children:(0,P.jsx)("hr",{className:Oe("w-full border-0 border-t border-border-subtle",n,t)})})};xm.displayName="Menu.Separator",ym.List=bm,ym.Item=vm,ym.Separator=xm;const _m=(0,i.createContext)({}),Em=()=>(0,i.useContext)(_m),Nm=({placement:e="bottom",offset:t=10,boundary:n="clippingAncestors",children:r,className:a})=>{const[o,s]=(0,i.useState)(!1),{refs:l,floatingStyles:c,context:u}=wa({open:o,onOpenChange:s,placement:e,strategy:"fixed",middleware:[Gn(t),$n({boundary:n}),Hn({boundary:n})],whileElementsMounted:Rn}),d=fa(u),f=ga(u),m=ja(u,{role:"menu"}),{getReferenceProps:p,getFloatingProps:h}=xa([d,f,m]),{isMounted:g,styles:w}=Aa(u,{duration:150,initial:{opacity:0,scale:.95},open:{opacity:1,scale:1},close:{opacity:0,scale:.95}}),y=()=>s(e=>!e);return(0,P.jsx)(_m.Provider,{value:{refs:l,handleClose:()=>s(!1),isMounted:g,styles:w,floatingStyles:c,getFloatingProps:h},children:(0,P.jsxs)("div",{className:Oe("relative inline-block",a),children:[i.Children.map(r,e=>i.isValidElement(e)&&"DropdownMenu.Trigger"===e?.type?.displayName?(0,i.cloneElement)(e,{ref:l.setReference,onClick:y,...p()}):null),i.Children.toArray(r).filter(e=>i.isValidElement(e)&&["DropdownMenu.Portal","DropdownMenu.ContentWrapper"].includes(e.type.displayName||"")).map(e=>e)]})})};Nm.displayName="DropdownMenu";const Mm=({children:e,className:t})=>{const{refs:n,floatingStyles:r,getFloatingProps:a,isMounted:o,styles:s}=Em();return o&&(0,P.jsx)("div",{ref:n.setFloating,className:t,style:{...r,...s},...a(),children:i.Children.map(e,e=>"DropdownMenu.Content"===e?.type?.displayName?e:null)})};Mm.displayName="DropdownMenu.ContentWrapper";const Im=({children:e,root:t,id:n})=>(0,P.jsx)(Jr,{id:n,root:t,children:e});Im.displayName="DropdownMenu.Portal";const Sm=i.forwardRef(({children:e,className:t,...n},r)=>(0,i.isValidElement)(e)?i.cloneElement(e,{className:Oe(t,e.props.className),ref:r,...n}):(0,P.jsx)("div",{ref:r,className:Oe("cursor-pointer",t),role:"button",tabIndex:0,...n,children:e}));Sm.displayName="DropdownMenu.Trigger";const km=({children:e,className:t,...n})=>(0,P.jsx)("div",{className:Oe("border border-solid border-border-subtle rounded-md shadow-lg overflow-hidden",t),children:(0,P.jsx)(ym,{...n,children:e})});km.displayName="DropdownMenu.Content";const jm=e=>(0,P.jsx)(ym.List,{...e});jm.displayName="DropdownMenu.List";const Dm=({children:e,as:t=ym.Item,...n})=>{const{handleClose:r}=Em();return e?t===i.Fragment&&(0,i.isValidElement)(e)?(0,i.cloneElement)(e,{onClick:Le(e.props?.onClick,r)}):(0,P.jsx)(t,{...n,className:Oe("px-2",n.className),onClick:Le(n.onClick,r),children:e}):null};Dm.displayName="DropdownMenu.Item";const Cm=e=>(0,P.jsx)(ym.Separator,{...e});function Am({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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"}))}Cm.displayName="DropdownMenu.Separator",Nm.Trigger=Sm,Nm.Content=km,Nm.List=jm,Nm.Item=Dm,Nm.Separator=Cm,Nm.Portal=Im,Nm.ContentWrapper=Mm;const Tm=i.forwardRef(Am);function Om({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 Lm=i.forwardRef(Om);function zm({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 9v.906a2.25 2.25 0 0 1-1.183 1.981l-6.478 3.488M2.25 9v.906a2.25 2.25 0 0 0 1.183 1.981l6.478 3.488m8.839 2.51-4.66-2.51m0 0-1.023-.55a2.25 2.25 0 0 0-2.134 0l-1.022.55m0 0-4.661 2.51m16.5 1.615a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V8.844a2.25 2.25 0 0 1 1.183-1.981l7.5-4.039a2.25 2.25 0 0 1 2.134 0l7.5 4.039a2.25 2.25 0 0 1 1.183 1.98V19.5Z"}))}const Pm=i.forwardRef(zm);function Rm({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const Um=i.forwardRef(Rm),Bm=[{label:(0,z.__)("Funnels","cartflows"),type:"flows",icon:Tm},{label:(0,z.__)("Conversions","cartflows"),type:"conversion",icon:Lm},{label:(0,z.__)("Opt-in","cartflows"),type:"optin",icon:Pm}],Fm=function({menu:e,isEditorApp:t,activePage:n,activePath:r}){const a=n===e.slug&&r===e.path,i=(0,b.useHistory)(),s=Gf()("h-full text-sm font-medium no-underline px-1 content-center relative inline-flex items-center gap-1 focus:outline-none focus:[box-shadow:none] bg-transparent border-0 shadow-none outline-none cursor-pointer hover:text-brand-500 transition-colors duration-200",{'text-brand-500 before:content-[""] before:absolute before:h-px before:bg-brand-500 before:bottom-0 before:inset-x-0':a,"text-text-secondary":!a});return(0,o.createElement)(Nm,{placement:"bottom-start",className:"h-full ss-007"},(0,o.createElement)(Nm.Trigger,null,(0,o.createElement)("button",{className:s},(0,o.createElement)("span",{className:"relative h-full inline-flex items-center gap-1"},e.name,(0,o.createElement)(Um,{className:"w-4 h-4","aria-hidden":"true"})))),(0,o.createElement)(Nm.ContentWrapper,null,(0,o.createElement)(Nm.Content,{size:"sm"},(0,o.createElement)(Nm.List,null,Bm.map(n=>(0,o.createElement)(Nm.Item,{key:n.type,onClick:()=>((n=null)=>{const r=`admin.php?page=${e.slug}&path=${e.path}`;t?window.location.href=n?`${r}&type=${n}`:r:i.push({pathname:"admin.php",search:n?`?page=${e.slug}&path=${e.path}&type=${n}`:`?page=${e.slug}&path=${e.path}`})})(n.type),className:"hover:bg-brand-25 hover:text-brand-600"},(0,o.createElement)("span",{className:"flex items-center gap-2"},(0,o.createElement)(n.icon,{className:"w-4 h-4 stroke-[1.5]","aria-hidden":"true"}),n.label)))))))},Ym=({label:e="PRO"})=>(0,o.createElement)(Yf,{label:e,size:"xs",type:"pill",className:"!bg-brand-25 !text-brand-600 !border-brand-500/20",disableHover:!0}),Qm=({title:e,children:t,onClick:n,icon:r})=>(0,o.createElement)(Fe.Item,{className:"p-1 gap-2"},(0,o.createElement)(Ja,{content:e,placement:"bottom",variant:"dark"},t||(0,o.createElement)(Va,{size:"xs",variant:"ghost",className:"p-0 focus:[box-shadow:none] [box-shadow:none] text-text-primary",onClick:n,icon:r}))),Vm=function(){const[{license_status:e,canvasMode:t}]=g(),n=cartflows_admin?.current_user_can_manage_cartflows,[r,a]=(0,i.useState)({isProcessing:!1,buttonText:""}),{isProcessing:s,buttonText:l}=r,c=[{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:n},{name:(0,z.__)("Settings","cartflows"),slug:cartflows_admin.home_slug,path:"settings",url:"",visible:n},{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),u=(0,b.useHistory)(),d=new URLSearchParams((0,b.useLocation)()?.search),f=d.get("page")?d.get("page"):cartflows_admin.home_slug;let m=d.get("path")?d.get("path"):"";"store-checkout-library"===m&&(m="store-checkout");const p=["wcf-edit-flow","wcf-edit-step"].includes(d.get("action"));let h="",w="",y="";const v=cartflows_admin?.cf_pro_status;wcfCartflowsPro()||"inactive"!==v?wcfCartflowsPro()?wcfCartflowsPro()&&"Activated"!==e?(h=(0,z.__)("Unlicensed","cartflows"),w=cartflows_admin.cf_pro_type):(h=(0,z.__)("Licensed","cartflows"),w=cartflows_admin.cf_pro_type):h=(0,z.__)("Upgrade to Pro","cartflows"):(h=(0,z.__)("Activate CartFlows Pro","cartflows"),y="activate");const x=function(e){if(e.preventDefault(),"activate"===y){const e="cartflows-pro",t="cartflows-pro/cartflows-pro.php",n="cartflows-pro";a({isProcessing:!0,buttonText:(0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 2 |
(0,z.__)("Activating %s","cartflows"),cartflows_admin.cf_pro_type_inactive)}),am({slug:e,init:t,name:n}).then(()=>{a({isProcessing:!0,buttonText:(0,z.__)("Successfully Activated","cartflows")}),setTimeout(()=>{a({isProcessing:!1,buttonText:(0,z.__)("Activated","cartflows")})},3e3)}).catch(()=>{a({isProcessing:!1,buttonText:(0,z.__)("Activation Failed","cartflows")})})}y||u.push({pathname:"admin.php",search:`?page=${cartflows_admin.home_slug}&path=settings&tab=license`})},_=e=>`admin.php?page=${e.slug}${""!==e.path?"&path="+e.path:""}${e.url}`,E=e=>Gf()("h-full text-sm font-medium no-underline px-1 content-center relative focus:outline-none focus:[box-shadow:none] hover:text-brand-500 transition-colors duration-200",{'text-brand-500 before:content-[""] before:absolute before:h-px before:bg-brand-500 before:bottom-0 before:inset-x-0':e,"text-text-secondary":!e});return(0,o.createElement)(o.Fragment,null,!wcfCartflowsPro()&&!t&&(0,o.createElement)(sm,null),(0,o.createElement)("div",{className:"wcf-main--nav-menu sticky top-0 sm:top-8 z-20"},(0,o.createElement)(Fe,{className:"py-0 px-4 min-h-0 h-14 gap-4 shadow-sm bg-background-primary backdrop-blur-[5px]"},(0,o.createElement)(Fe.Left,{className:"gap-3"},(0,o.createElement)(Fe.Item,{className:"w-auto h-auto lg:hidden"},(0,o.createElement)(Bf,null,(0,o.createElement)(Bf.Toggle,{className:"size-6"}),(0,o.createElement)(Bf.Options,null,c.map(e=>(0,o.createElement)(Bf.Option,{key:e.name,active:f===e.slug&&m===e.path,href:_(e),iconPosition:"left",rel:"noopener noreferrer",tag:"a",target:"_self"},e.name)),!wcfCartflowsPro()&&(0,o.createElement)(Bf.Option,{href:getUpgradeToProUrl(),iconPosition:"left",rel:"noopener noreferrer",tag:"a",target:"_blank",className:"text-link-primary gap-1"},(0,z.__)("Upgrade to Pro","cartflows")," ",(0,o.createElement)(nm,{className:"!size-5"}))))),(0,o.createElement)(Fe.Item,null,(0,o.createElement)("img",{className:"block h-8 w-auto",src:Hf,alt:"CartFlows"}))),(0,o.createElement)(Fe.Middle,{align:"left",className:"h-full hidden lg:flex"},(0,o.createElement)(Fe.Item,null,(0,o.createElement)("nav",{className:"flex items-center gap-4 h-full"},c.map(e=>"analytics"===e.path?(0,o.createElement)(Fm,{key:e.name,menu:e,isEditorApp:p,activePage:f,activePath:m}):(e=>{const t=f===e.slug&&m===e.path;return p?(0,o.createElement)("a",{key:e.name,href:_(e),className:E(t)},e.name):(0,o.createElement)(C,{key:e.name,to:{pathname:"admin.php",search:`?page=${e.slug}${""!==e.path?"&path="+e.path:""}${e.url}`},className:E(t)},e.name)})(e)))),!wcfCartflowsPro()&&(0,o.createElement)(Fe.Item,null,"inactive"===v?(0,o.createElement)(Va,{icon:s?(0,o.createElement)(Wf,{className:"w-4 h-4 animate-spin"}):null,iconPosition:"left",variant:"link",size:"sm",className:"h-full text-link-primary text-sm font-semibold no-underline hover:no-underline hover:text-link-primary-hover px-1 content-center [box-shadow:none] focus:[box-shadow:none] focus:outline-none",onClick:x},s?l:h):(0,o.createElement)(Va,{icon:(0,o.createElement)(nm,{className:"!size-5"}),iconPosition:"right",variant:"link",size:"sm",className:"h-full text-link-primary text-sm font-semibold no-underline hover:no-underline hover:text-link-primary-hover px-1 content-center [box-shadow:none] focus:[box-shadow:none] focus:outline-none",onClick:()=>window.open(getUpgradeToProUrl(),"_blank","noreferrer")},h))),(0,o.createElement)(Fe.Right,null,wcfCartflowsPro()&&(0,o.createElement)(Fe.Item,null,(0,o.createElement)(Va,{variant:"ghost",className:"p-0 hover:bg-transparent focus:[box-shadow:none] [box-shadow:none]",onClick:t=>{"Activated"!==e&&x(t)},icon:(0,o.createElement)(Yf,{label:h,size:"xs",variant:"Activated"===e?"green":"red"})})),(0,o.createElement)(Fe.Item,{className:"flex gap-3 items-center"},(0,o.createElement)(Qf,{size:"xs",variant:"neutral",className:"text-text-tertiary"},`v${cartflows_admin?.cartflows_current_version}`),wcfCartflowsPro()?(0,o.createElement)(Ym,{label:w.toUpperCase()}):(0,o.createElement)(Yf,{label:(0,z.__)("Free","cartflows"),className:"text-text-tertiary uppercase",size:"xs",variant:"neutral",type:"pill"})),(0,o.createElement)(Qm,{title:(0,z.__)("Documentation","cartflows"),icon:(0,o.createElement)(rm,{className:"size-4"}),onClick:()=>window.open(getKbDocUrl("https://cartflows.com/docs/"),"_blank","noopener noreferrer")}),0<cartflows_admin?.whats_new_rss_feed?.length&&(0,o.createElement)(Qm,{title:(0,z.__)("What's New","cartflows")},(0,o.createElement)(tm,null))))))},Wm=(0,i.createContext)({}),Zm=()=>(0,i.useContext)(Wm),Gm={open:{opacity:1},exit:{opacity:0}},Hm={duration:.2},$m=({open:e,setOpen:t,children:n,trigger:r=null,className:a,exitOnClickOutside:o=!1,exitOnEsc:s=!0,design:l="simple",scrollLock:c=!0})=>{const u=void 0!==e&&void 0!==t,[d,f]=(0,i.useState)(!1),m=(0,i.useRef)(null),p=(0,i.useRef)(null),h=(0,i.useMemo)(()=>u?e:d,[e,d]),g=(0,i.useMemo)(()=>u?t:f,[f,t]),{refs:w,context:y}=wa({open:h,onOpenChange:g}),b=fa(y),v=ga(y,{enabled:o||s,escapeKey:s,outsidePress:e=>!!o&&!e?.target?.closest("ul.fui-toast-container")}),x=ja(y,{role:"dialog"}),{getFloatingProps:_}=xa([b,v,x]),E=()=>{h||g(!0)},N=(0,i.useCallback)(()=>(0,i.isValidElement)(r)?(0,i.cloneElement)(r,{onClick:Le(E,r?.props?.onClick),ref:w.setReference,"aria-haspopup":"dialog","aria-expanded":h}):"function"==typeof r?r({onClick:E}):null,[r,E,w.setReference,h]);return(0,P.jsxs)(P.Fragment,{children:[N(),(0,P.jsx)(Wm.Provider,{value:{open:h,setOpen:g,handleClose:()=>{h&&g(!1)},design:l,context:y,getFloatingProps:_,refs:w,dialogContainerRef:p,dialogRef:m,scrollLock:c,className:a},children:n})]})};$m.displayName="Dialog";const Xm=({children:e,className:t})=>{const{open:n,handleClose:r,context:a,getFloatingProps:o,dialogRef:i,scrollLock:s,dialogContainerRef:l,className:c,refs:u}=Zm();return(0,P.jsx)(pm,{children:n&&(0,P.jsx)(ca,{ref:l,lockScroll:s,className:Oe("z-999999",c),"aria-modal":"true",children:(0,P.jsx)(ia,{context:a,...u?.reference&&{returnFocus:u.reference},children:(0,P.jsx)(kf.div,{className:"fixed inset-0 overflow-y-auto",initial:"exit",animate:"open",exit:"exit",variants:Gm,role:"dialog","aria-modal":"true",transition:Hm,children:(0,P.jsx)("div",{className:"flex items-center justify-center min-h-full",children:(0,P.jsx)("div",{ref:e=>{e&&(i.current=e,a&&a.refs.setFloating(e))},...o?.(),className:Oe("flex flex-col gap-5 w-120 h-fit bg-background-primary border border-solid border-border-subtle rounded-xl shadow-soft-shadow-2xl my-5 overflow-hidden",t),children:"function"==typeof e?e({close:r}):e})})})})})})};Xm.displayName="Dialog.Panel";const qm=({children:e,...t})=>(0,P.jsx)(Jr,{...t,children:e});qm.displayName="Dialog.Portal";const Jm=({className:e,...t})=>{const{open:n,dialogContainerRef:r}=Zm();return r?.current?(0,P.jsx)(P.Fragment,{children:(0,wn.createPortal)((0,P.jsx)(pm,{children:n&&(0,P.jsx)(kf.div,{className:Oe("fixed inset-0 -z-10 bg-background-inverse/90",e),...t,initial:"exit",animate:"open",exit:"exit",variants:Gm,transition:Hm})}),r.current)}):null};Jm.displayName="Dialog.Backdrop";const Km=({children:e,className:t,...n})=>(0,P.jsx)("div",{className:Oe("space-y-2 px-5 pt-5 pb-1",t),...n,children:e});Km.displayName="Dialog.Header";const ep=({children:e,as:t="h3",className:n,...r})=>(0,P.jsx)(t,{className:Oe("text-base font-semibold text-text-primary m-0 p-0",n),...r,children:e});ep.displayName="Dialog.Title";const tp=({children:e,as:t="p",className:n,...r})=>(0,P.jsx)(t,{className:Oe("text-sm font-normal text-text-secondary my-0 ml-0 mr-1 p-0",n),...r,children:e});tp.displayName="Dialog.Description";const np=({className:e,...t})=>(0,P.jsx)("button",{className:Oe("bg-transparent inline-flex justify-center items-center border-0 p-1 m-0 cursor-pointer focus:outline-none outline-none shadow-none",e),"aria-label":"Close dialog",...t,children:(0,P.jsx)(Ff,{className:"size-4 text-text-primary shrink-0"})}),rp=({children:e,as:t=i.Fragment,...n})=>{const{handleClose:r}=Zm();return e?t===i.Fragment?"function"==typeof e?e({close:r}):(0,i.cloneElement)(e,{onClick:r}):(0,P.jsx)(t,{...n,onClick:r,"aria-label":"Close dialog",children:e}):(0,P.jsx)(np,{onClick:r,...n})};rp.displayName="Dialog.CloseButton";const ap=({children:e,className:t,...n})=>(0,P.jsx)("div",{className:Oe("px-5",t),...n,children:e});ap.displayName="Dialog.Body";const op=({children:e,className:t})=>{const{design:n,handleClose:r}=Zm();return(0,P.jsx)("div",{className:Oe("p-4 flex justify-end gap-3",{"bg-background-secondary":"footer-divided"===n},t),children:e?"function"==typeof e?e({close:r}):e:null})};op.displayName="Dialog.Footer",$m.Panel=Xm,$m.Portal=qm,$m.Title=ep,$m.Description=tp,$m.CloseButton=rp,$m.Header=Km,$m.Body=ap,$m.Footer=op,$m.Backdrop=Jm;const ip=function(e){const{showModel:t}=e,[n,r]=(0,i.useState)(t);return(0,o.createElement)($m,{open:n,setOpen:r,exitOnClickOutside:!0},(0,o.createElement)($m.Panel,{className:"sm:max-w-3xl w-full !p-0 !rounded-lg overflow-hidden relative !border-0 !shadow-none !bg-transparent"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)("div",{className:"absolute top-2 right-2 z-10"},(0,o.createElement)($m.CloseButton,{className:"!bg-white/80 hover:!bg-white !rounded-full !p-1 !shadow-sm"})),(0,o.createElement)("iframe",{width:"100%",src:"https://www.youtube.com/embed/tCm60PWOd0M?autoplay=1&rel=0&modestbranding=1",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:"",className:"block rounded-lg !h-[200px] sm:!h-[400px]",title:(0,z.__)("Introduction to CartFlows","cartflows")})))},sp=window.wp.compose,lp=window.wp.data;let cp=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};const up=Ua("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),dp=(0,i.forwardRef)(({id:e,type:t="text",defaultValue:n="",value:r,size:a="sm",className:o="",disabled:s=!1,onChange:l=()=>{},error:c=!1,onError:u=()=>{},prefix:d=null,suffix:f=null,label:m="",...p},h)=>{const g=(0,i.useRef)(null),w=(0,i.useMemo)(()=>e||`input-${t}-${cp()}`,[e]),y=(0,i.useMemo)(()=>typeof r<"u",[r]),[b,v]=(0,i.useState)(n),[x,_]=(0,i.useState)(null),E=(0,i.useCallback)(()=>y?r:b,[y,r,b]),N=e=>{if(s)return;let n;"file"===t?(n=e.target.files,n&&n.length>0?_(n[0].name):_(null)):n=e.target.value,!y&&"file"!==t&&v(n),"function"==typeof l&&l(n)},M=()=>{_(null),g.current&&(g.current.value=""),l(null)},I="bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary w-full outline outline-1 outline-border-subtle border-none transition-[color,box-shadow,outline] duration-200",S={xs:"px-2 py-1 rounded",sm:"p-3 py-2 rounded",md:"p-3.5 py-2.5 rounded-md",lg:"p-4 py-3 rounded-lg"},k={xs:"text-xs font-medium",sm:"text-sm font-medium",md:"text-sm font-medium",lg:"text-base font-medium"},j={xs:"text-xs",sm:"text-xs",md:"text-sm",lg:"text-base"},D={sm:d?"pl-8":"",md:d?"pl-9":"",lg:d?"pl-10":""},C={sm:f?"pr-8":"",md:f?"pr-9":"",lg:f?"pr-10":""},A=s?"hover:outline-border-disabled":"hover:outline-border-strong",T="focus:outline-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",O=c?"focus:outline-focus-error-border focus:ring-field-color-error outline-focus-error-border":"",L=c?"focus:outline-focus-error-border focus:ring-field-color-error outline-focus-error-border":"",z=s?"outline-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",R=s?"outline-border-disabled cursor-not-allowed text-text-disabled file:text-text-tertiary":"",U="font-normal placeholder-text-tertiary text-text-primary pointer-events-none absolute inset-y-0 flex flex-1 items-center [&>svg]:h-4 [&>svg]:w-4",B=s?"font-normal placeholder-text-tertiary text-icon-disabled pointer-events-none absolute inset-y-0 flex flex-1 items-center":"font-normal placeholder-text-tertiary text-field-placeholder pointer-events-none absolute inset-y-0 flex flex-1 items-center",F={xs:"[&>svg]:size-4",sm:"[&>svg]:size-4",md:"[&>svg]:size-5",lg:"[&>svg]:size-6"},Y=(0,i.useMemo)(()=>m?(0,P.jsx)(Qf,{className:Oe(k[a]),htmlFor:w,...p?.required&&{required:!0},children:m}):null,[m,a,w]),Q=x?"file:border-0 file:bg-transparent pr-10":"text-text-tertiary file:border-0 file:bg-transparent pr-10";return"file"===t?(0,P.jsxs)("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[Y,(0,P.jsxs)("div",{className:Oe("w-full relative flex focus-within:z-10",o),children:[(0,P.jsx)("input",{ref:qa(g,h),id:w,type:"file",className:Oe(I,R,S[a],j[a],T,A,L,Q),disabled:s,onChange:N,onInvalid:u,...p}),(0,P.jsx)("div",{className:Oe(B,"right-0 pr-3",F[a]),children:(0,P.jsx)(up,{})})]})]}):(0,P.jsxs)("div",{className:"flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[Y,(0,P.jsxs)("div",{className:Oe("w-full relative flex focus-within:z-10",o),children:[d?(0,P.jsx)("div",{className:Oe(U,"left-0 pl-3",j[a]),children:d}):null,(0,P.jsx)("input",{ref:qa(g,h),id:w,type:t,className:Oe(I,z,S[a],j[a],D[a],C[a],T,A,O),disabled:s,onChange:N,onInvalid:u,value:E(),...p}),"file"===t?x?(0,P.jsx)("div",{className:Oe(B,"right-0 pr-3 cursor-pointer z-20 pointer-events-auto",F[a]),onClick:M,role:"button",tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&M()},children:(0,P.jsx)(Ff,{})}):(0,P.jsx)("div",{className:Oe(B,"right-0 pr-3",F[a]),children:(0,P.jsx)(up,{})}):f?(0,P.jsx)("div",{className:Oe(U,"right-0 pr-3",j[a]),children:f}):null]})]})});dp.displayName="Input";let fp=1;const mp=new class{#e;#t;constructor(){this.#e=[],this.#t=[]}subscribe(e){return this.#t.push(e),()=>{this.#t=this.#t.filter(t=>t!==e)}}publish(e){this.#t.forEach(t=>t(e))}add(e){this.#e.push(e),this.publish(e)}remove(e){return this.#e=this.#e.filter(t=>t.id!==e),e}create(e){const{id:t,message:n="",jsx:r,...a}=e;if(!n&&"function"!=typeof r)return;const o="number"==typeof t?t:fp++;return this.#e.find(e=>e.id===o)&&(this.#e=this.#e.map(e=>e.id===o?(this.publish({...e,title:n,jsx:r,...a}),{...e,title:n,jsx:r,...a}):e)),this.add({id:o,title:n,jsx:r,...a}),o}update(e,t){const{render:n}=t;let r=t;switch(typeof n){case"function":r={jsx:n,...t};break;case"string":r={title:n,...t}}this.#e=this.#e.map(t=>t.id===e?(this.publish({...t,...r}),{...t,...r}):t)}dismiss(e){return e||this.#e.forEach(e=>this.#t.forEach(t=>t({id:e.id,dismiss:!0}))),this.#t.forEach(t=>t({id:e,dismiss:!0})),e}history(){return this.#e}default(e="",t={}){return this.create({message:e,type:"neutral",...t})}success(e="",t={}){return this.create({message:e,type:"success",...t})}error(e="",t={}){return this.create({message:e,type:"error",...t})}warning(e="",t={}){return this.create({message:e,type:"warning",...t})}info(e="",t={}){return this.create({message:e,type:"info",...t})}custom(e,t={}){return this.create({jsx:e,type:"custom",...t})}},pp=Object.seal(Object.assign((e,t)=>mp.default(e,t),{success:mp.success.bind(mp),error:mp.error.bind(mp),warning:mp.warning.bind(mp),info:mp.info.bind(mp),custom:mp.custom.bind(mp),dismiss:mp.dismiss.bind(mp),update:mp.update.bind(mp)},{getHistory:mp.history.bind(mp)})),hp=(0,sp.compose)((0,lp.withDispatch)(e=>{const{updateWooCommerceStatus:t}=e("wcf/importer");return{updateWooCommerceStatus(e){t(e)}}}))(({title:e,updateWooCommerceStatus:t})=>{const n=e||(0,z.__)("Activate WooCommerce","cartflows"),[r,a]=(0,i.useState)({isProcessing:!1,buttonText:n}),{isProcessing:s,buttonText:l}=r;return(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)(Va,{className:"wcf-button wcf-primary-button",variant:"primary",size:"md",loading:s,disabled:s,onClick:()=>{a({isProcessing:!0,buttonText:(0,z.__)("Activating WooCommerce..","cartflows")}),am({slug:"woocommerce",init:"woocommerce/woocommerce.php",name:"WooCommerce"},!1).then(()=>{a({isProcessing:!1,buttonText:(0,z.__)("Successfully Activated!","cartflows")}),setTimeout(()=>{t("active")},3e3)}).catch(e=>{console.log(e),a({isProcessing:!1,buttonText:(0,z.__)("Failed! Activation!","cartflows")})})}},l)))}),gp=(0,sp.compose)((0,lp.withDispatch)(e=>{const{updateWooCommerceStatus:t}=e("wcf/importer");return{updateWooCommerceStatus(e){t(e)}}}))(({updateWooCommerceStatus:e})=>{const t=(0,z.__)("Install WooCommerce","cartflows"),[n,r]=(0,i.useState)({isProcessing:!1,buttonText:t}),{isProcessing:a,buttonText:s}=n;return(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)(Va,{className:"wcf-button wcf-primary-button",variant:"primary",size:"md",loading:a,disabled:a,onClick:()=>{var n;r({isProcessing:!0,buttonText:(0,z.__)("Installing WooCommerce..","cartflows")}),(n={slug:"woocommerce",init:"woocommerce/woocommerce.php",name:"woocommerce"},new Promise((e,t)=>{console.log("plugin.slug",n.slug),wp.updates.queue.push({action:"install-plugin",data:{slug:n.slug,init:n.init,name:n.name,success(t){console.log("Installed Successfully! Activating plugin ",n.slug),e(t,n)},error(e){t(e,n)}}}),wp.updates.queueChecker()})).then(()=>{r({isProcessing:!1,buttonText:(0,z.__)("Successfully Installed!","cartflows")}),e("inactive")}).catch(e=>{console.log(e),r({isProcessing:!1,buttonText:(0,z.__)("Installation Failed!","cartflows")}),setTimeout(()=>{r({isProcessing:!1,buttonText:t})},3e3)})}},s)))}),yp=(0,sp.compose)((0,lp.withDispatch)(e=>{const{updateCFProStatus:t}=e("wcf/importer");return{updateCFProStatus(e){t(e)}}}))(({title:e,updateCFProStatus:t})=>{const n=e||(0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 3 |
(0,z.__)("Activate %s","cartflows"),cartflows_admin.cf_pro_type_inactive),[r,a]=(0,i.useState)({isProcessing:!1,buttonText:n}),{isProcessing:s,buttonText:l}=r;return(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)(Va,{variant:"primary",size:"md",loading:s,disabled:s,onClick:e=>{e.preventDefault(),a({isProcessing:!0,buttonText:(0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 4 |
(0,z.__)("Activating %s","cartflows"),cartflows_admin.cf_pro_type_inactive)}),am({slug:"cartflows-pro",init:"cartflows-pro/cartflows-pro.php",name:"cartflows-pro"}).then(e=>{console.log(e),a({isProcessing:!1,buttonText:(0,z.__)("Successfully Activated!","cartflows")}),setTimeout(()=>{t("active")},3e3)}).catch(e=>{console.log(e),a({isProcessing:!1,buttonText:(0,z.__)("Failed! Activation!","cartflows")})})}},l)))}),bp=({buttonLink:e,title:t,buttonStyle:n="primary"})=>{const r=t||(0,z.__)("Upgrade to Cartflows Pro","cartflows"),a=e?.buttonLink||getUpgradeToProUrl();return(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)(Va,{tag:"a",href:a,target:"_blank",rel:"noreferrer",variant:n,size:"md",className:"no-underline"},r)))};function vp({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))}const xp=i.forwardRef(vp),_p=({title:e})=>{const t=e||"Activate Cartflows Pro License";return(0,o.createElement)(Va,{tag:"a",href:cartflows_admin?.license_popup_url,rel:"noreferrer",variant:"primary",size:"md",icon:(0,o.createElement)(xp,null),iconPosition:"right",className:"no-underline"},t)},Ep=(0,sp.compose)((0,lp.withSelect)(e=>{const{getFlowsCount:t,getCFProStatus:n,getWooCommerceStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:n(),woocommerce_status:r()}}))(({preview:e,cf_pro_status:t,woocommerce_status:n,flowName:r,setInputFieldVisibility:a,setErrorDesc:s})=>{const[l,c]=(0,i.useState)({cta:"",error_msg:""}),[{license_status:u}]=g(),{cta:d,error_msg:f}=l,[m,p]=(0,i.useState)({isProcessing:!1,buttonText:(0,z.__)("Import Funnel","cartflows")}),{isProcessing:h,buttonText:w}=m,[y,b]=(0,i.useState)(!1),v=function(){b(!0),document.addEventListener("click",x)},x=function(){b(!1),document.removeEventListener("click",x)};if(d)return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("span",{className:"wcf-message wcf-message--error",dangerouslySetInnerHTML:{__html:d}}),y&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("a",{className:"wcf-error-message--toggle",onClick:function(e){e.preventDefault(),y?x():v()}},(0,z.__)("Click for more info","cartflows")),(0,o.createElement)("div",{className:"wcf-error--info",dangerouslySetInnerHTML:{__html:f}})));if("active"!==n)return"inactive"===n?(a("hidden"),s((0,z.__)("You need WooCommerce plugin installed and activated to import this funnel.","cartflows")),(0,o.createElement)(hp,null)):(a("hidden"),s((0,z.__)("You need WooCommerce plugin installed and activated to import this funnel.","cartflows")),(0,o.createElement)(gp,null));if("active"===n&&(a("visible"),s("")),"pro"===e.type){if(!wcfCartflowsTypePro())return"inactive"===t&&"pro"===wcfInactivepluginType()?(a("hidden"),s((0,z.__)("Access all of our pro templates by activating CartFlows Pro.","cartflows")),(0,o.createElement)(yp,{description:(0,z.__)("Access all of our pro templates by activating CartFlows Pro.","cartflows")})):(a("hidden"),s((0,z.__)("Access all of our pro templates when you upgrade your plan to CartFlows Pro today.","cartflows")),(0,o.createElement)(bp,{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 a("hidden"),s((0,z.__)("Access all of our pro templates when you activate CartFlows Pro license.","cartflows")),(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)(_p,null)))}return(0,o.createElement)(Va,{variant:"primary",size:"md",loading:h,disabled:h,onClick:t=>{t.preventDefault(),h||(p({isProcessing:!0,buttonText:(0,z.__)("Importing Complete Funnel..","cartflows")}),((e,t,n,r)=>{const a=new window.FormData;a.append("action","cartflows_import_flow"),a.append("flow_name",r),a.append("security",cartflows_admin.import_flow_nonce),a.append("flow",JSON.stringify(e)),a.append("creation_method","ready_made_template"),L()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then(e=>{e.success?(t({isProcessing:!1,buttonText:(0,z.__)("Imported! Redirecting…","cartflows")}),pp.success((0,z.__)("Funnel imported successfully!","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?n({cta:e.data.call_to_action,error_msg:e.data.message}):(t({isProcessing:!1,buttonText:e.data.message}),pp.error((0,z.__)("Failed to import funnel.","cartflows")))})})(e,p,c,r))}},w)}),Np=(0,sp.compose)((0,lp.withSelect)(e=>{const{getFlowsCount:t,getCFProStatus:n,getLicenseStatus:r,getWooCommerceStatus:a}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:n(),license_status:r(),woocommerce_status:a()}}))(({flowName:e,isStoreCheckout:t})=>{const[n,r]=(0,i.useState)((0,z.__)("Design Your Funnel","cartflows")),[a,s]=(0,i.useState)(!1);return(0,o.createElement)(Va,{variant:"primary",size:"md",loading:a,disabled:a,onClick:n=>{n.preventDefault(),((e,t,n,r,a)=>{if(n)return;e("Creating Flow.."),r(!0);const o=new window.FormData;o.append("action","cartflows_create_flow"),o.append("security",cartflows_admin.create_flow_nonce),o.append("flow_name",t),o.append("store_checkout",a),o.append("creation_method","scratch"),L()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then(t=>{t.success?(e((0,z.__)("Created! Redirecting…","cartflows")),r(!1),pp.success((0,z.__)("Funnel created successfully!","cartflows")),setTimeout(()=>{let e=`admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t.data.flow_id}`;a&&(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")),pp.error((0,z.__)("Failed to create funnel.","cartflows")))})})(r,e,a,s,t)}},n)}),Mp=(0,sp.compose)((0,lp.withSelect)(e=>{const{getFlowsCount:t,getCFProStatus:n,getLicenseStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:n(),license_status:r()}}))(({visibility:e,setVisibility:t,preview:n,type:r,flowName:a,setFlowName:s})=>{const l="show"===e,[c,u]=(0,i.useState)(""),[d,f]=(0,i.useState)(""),[{flows_limit_over:m}]=g(),[p,h]=(0,i.useState)(0);return(0,o.createElement)($m,{open:l,setOpen:e=>{e||t("hide")},exitOnClickOutside:!1},(0,o.createElement)($m.Panel,{className:"sm:max-w-lg w-full"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)($m.Header,{className:"flex items-center justify-between !space-y-0"},(0,o.createElement)($m.Title,null,m?(0,z.__)("Upgrade To CartFlows Pro","cartflows"):(0,z.__)("Name Your Funnel","cartflows")),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)($m.Body,null,(0,o.createElement)("div",{className:`${c}`},(0,o.createElement)("div",{className:"flex justify-between py-2"},(0,o.createElement)("label",{className:"flex gap-1 text-sm font-normal text-text-primary"},(0,z.__)("Funnel Name","cartflows")),(0,o.createElement)("span",{className:"text-xs font-normal "+(40===p?"text-brand-500":"text-field-placeholder")},p,"/40")),(0,o.createElement)(dp,{type:"text",value:a,onChange:e=>{e.length<=40&&(h(e.length),s(e))},placeholder:(0,z.__)("Enter Funnel Name","cartflows"),size:"md"})),""!==d&&(0,o.createElement)("p",{className:"text-sm font-regular text-text-secondary mt-3 m-0"},d)),(0,o.createElement)($m.Footer,{className:"flex gap-3 justify-end"},"import"===r&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:()=>t("hide")},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(Ep,{preview:n,flowName:a,setInputFieldVisibility:u,setErrorDesc:f})),"blank"===r&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:()=>t("hide")},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(Np,{flowName:a,setInputFieldVisibility:u,isStoreCheckout:!1})))))}),Ip=function(){return(0,o.createElement)("div",{role:"status",className:"wcf-onboarding-stats-loader space-y-4 animate-pulse"},(0,o.createElement)("div",{className:"flex items-center justify-between"},(0,o.createElement)("div",null,(0,o.createElement)("div",{className:"w-32 h-2.5 bg-background-secondary rounded-full mb-2.5"}),(0,o.createElement)("div",{className:"w-44 h-2 bg-background-secondary rounded-full"})),(0,o.createElement)("div",{className:"h-2.5 w-24 bg-background-secondary rounded-full"})),Array(3).fill().map((e,t)=>(0,o.createElement)("div",{key:t,className:"flex items-center justify-between pt-4"},(0,o.createElement)("div",null,(0,o.createElement)("div",{className:"h-2.5 bg-background-secondary rounded-full w-24 mb-2.5"}),(0,o.createElement)("div",{className:"w-32 h-2 bg-background-secondary rounded-full"})),(0,o.createElement)("div",{className:"h-2.5 w-24 bg-background-secondary rounded-full"}))))},Sp={sm:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8",9:"grid-cols-9",10:"grid-cols-10",11:"grid-cols-11",12:"grid-cols-12"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6",7:"md:grid-cols-7",8:"md:grid-cols-8",9:"md:grid-cols-9",10:"md:grid-cols-10",11:"md:grid-cols-11",12:"md:grid-cols-12"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6",7:"lg:grid-cols-7",8:"lg:grid-cols-8",9:"lg:grid-cols-9",10:"lg:grid-cols-10",11:"lg:grid-cols-11",12:"lg:grid-cols-12"}},kp={sm:{xs:"gap-2",sm:"gap-4",md:"gap-5",lg:"gap-6",xl:"gap-6","2xl":"gap-8"},md:{xs:"md:gap-2",sm:"md:gap-4",md:"md:gap-5",lg:"md:gap-6",xl:"md:gap-6","2xl":"md:gap-8"},lg:{xs:"lg:gap-2",sm:"lg:gap-4",md:"lg:gap-5",lg:"lg:gap-6",xl:"lg:gap-6","2xl":"lg:gap-8"}},jp={sm:{xs:"gap-x-2",sm:"gap-x-4",md:"gap-x-5",lg:"gap-x-6",xl:"gap-x-6","2xl":"gap-x-8"},md:{xs:"md:gap-x-2",sm:"md:gap-x-4",md:"md:gap-x-5",lg:"md:gap-x-6",xl:"md:gap-x-6","2xl":"md:gap-x-8"},lg:{xs:"lg:gap-x-2",sm:"lg:gap-x-4",md:"lg:gap-x-5",lg:"lg:gap-x-6",xl:"lg:gap-x-6","2xl":"lg:gap-x-8"}},Dp={sm:{xs:"gap-y-2",sm:"gap-y-4",md:"gap-y-5",lg:"gap-y-6",xl:"gap-y-6","2xl":"gap-y-8"},md:{xs:"md:gap-y-2",sm:"md:gap-y-4",md:"md:gap-y-5",lg:"md:gap-y-6",xl:"md:gap-y-6","2xl":"md:gap-y-8"},lg:{xs:"lg:gap-y-2",sm:"lg:gap-y-4",md:"lg:gap-y-5",lg:"lg:gap-y-6",xl:"lg:gap-y-6","2xl":"lg:gap-y-8"}},Cp={sm:{1:"col-span-1",2:"col-span-2",3:"col-span-3",4:"col-span-4",5:"col-span-5",6:"col-span-6",7:"col-span-7",8:"col-span-8",9:"col-span-9",10:"col-span-10",11:"col-span-11",12:"col-span-12"},md:{1:"md:col-span-1",2:"md:col-span-2",3:"md:col-span-3",4:"md:col-span-4",5:"md:col-span-5",6:"md:col-span-6",7:"md:col-span-7",8:"md:col-span-8",9:"md:col-span-9",10:"md:col-span-10",11:"md:col-span-11",12:"md:col-span-12"},lg:{1:"lg:col-span-1",2:"lg:col-span-2",3:"lg:col-span-3",4:"lg:col-span-4",5:"lg:col-span-5",6:"lg:col-span-6",7:"lg:col-span-7",8:"lg:col-span-8",9:"lg:col-span-9",10:"lg:col-span-10",11:"lg:col-span-11",12:"lg:col-span-12"}},Ap={sm:{1:"col-start-1",2:"col-start-2",3:"col-start-3",4:"col-start-4",5:"col-start-5",6:"col-start-6",7:"col-start-7",8:"col-start-8",9:"col-start-9",10:"col-start-10",11:"col-start-11",12:"col-start-12"},md:{1:"md:col-start-1",2:"md:col-start-2",3:"md:col-start-3",4:"md:col-start-4",5:"md:col-start-5",6:"md:col-start-6",7:"md:col-start-7",8:"md:col-start-8",9:"md:col-start-9",10:"md:col-start-10",11:"md:col-start-11",12:"md:col-start-12"},lg:{1:"lg:col-start-1",2:"lg:col-start-2",3:"lg:col-start-3",4:"lg:col-start-4",5:"lg:col-start-5",6:"lg:col-start-6",7:"lg:col-start-7",8:"lg:col-start-8",9:"lg:col-start-9",10:"lg:col-start-10",11:"lg:col-start-11",12:"lg:col-start-12"}},Tp={sm:{row:"grid-flow-row",column:"grid-flow-col","row-dense":"grid-flow-row-dense","column-dense":"grid-flow-col-dense"},md:{row:"md:grid-flow-row",column:"md:grid-flow-col","row-dense":"md:grid-flow-row-dense","column-dense":"md:grid-flow-col-dense"},lg:{row:"lg:grid-flow-row",column:"lg:grid-flow-col","row-dense":"lg:grid-flow-row-dense","column-dense":"lg:grid-flow-col-dense"}},Op={sm:{normal:"justify-normal",start:"justify-start",end:"justify-end",center:"justify-center",between:"justify-between",around:"justify-around",evenly:"justify-evenly",stretch:"justify-stretch"},md:{normal:"md:justify-normal",start:"md:justify-start",end:"md:justify-end",center:"md:justify-center",between:"md:justify-between",around:"md:justify-around",evenly:"md:justify-evenly",stretch:"md:justify-stretch"},lg:{normal:"lg:justify-normal",start:"lg:justify-start",end:"lg:justify-end",center:"lg:justify-center",between:"lg:justify-between",around:"lg:justify-around",evenly:"lg:justify-evenly",stretch:"lg:justify-stretch"}},Lp={sm:{start:"items-start",end:"items-end",center:"items-center",baseline:"items-baseline",stretch:"items-stretch"},md:{start:"md:items-start",end:"md:items-end",center:"md:items-center",baseline:"md:items-baseline",stretch:"md:items-stretch"},lg:{start:"lg:items-start",end:"lg:items-end",center:"lg:items-center",baseline:"lg:items-baseline",stretch:"lg:items-stretch"}},zp={sm:{start:"self-start",end:"self-end",center:"self-center",baseline:"self-baseline",stretch:"self-stretch"},md:{start:"md:self-start",end:"md:self-end",center:"md:self-center",baseline:"md:self-baseline",stretch:"md:self-stretch"},lg:{start:"lg:self-start",end:"lg:self-end",center:"lg:self-center",baseline:"lg:self-baseline",stretch:"lg:self-stretch"}},Pp={sm:{auto:"justify-self-auto",start:"justify-self-start",end:"justify-self-end",center:"justify-self-center",baseline:"justify-self-baseline",stretch:"justify-self-stretch"},md:{auto:"md:justify-self-auto",start:"md:justify-self-start",end:"md:justify-self-end",center:"md:justify-self-center",baseline:"md:justify-self-baseline",stretch:"md:justify-self-stretch"},lg:{auto:"lg:justify-self-auto",start:"lg:justify-self-start",end:"lg:justify-self-end",center:"lg:justify-self-center",baseline:"lg:justify-self-baseline",stretch:"lg:justify-self-stretch"}},Rp={sm:{row:"flex-row","row-reverse":"flex-row-reverse",column:"flex-col","column-reverse":"flex-col-reverse"},md:{row:"md:flex-row","row-reverse":"md:flex-row-reverse",column:"md:flex-col","column-reverse":"md:flex-col-reverse"},lg:{row:"lg:flex-row","row-reverse":"lg:flex-row-reverse",column:"lg:flex-col","column-reverse":"lg:flex-col-reverse"}},Up={sm:{wrap:"flex-wrap","wrap-reverse":"flex-wrap-reverse",nowrap:"flex-nowrap"},md:{wrap:"md:flex-wrap","wrap-reverse":"md:flex-wrap-reverse",nowrap:"md:flex-nowrap"},lg:{wrap:"lg:flex-wrap","wrap-reverse":"lg:flex-wrap-reverse",nowrap:"lg:flex-nowrap"}},Bp={sm:{1:"w-full",2:"w-1/2",3:"w-1/3",4:"w-1/4",5:"w-1/5",6:"w-1/6",7:"w-1/7",8:"w-1/8",9:"w-1/9",10:"w-1/10",11:"w-1/11",12:"w-1/12"},md:{1:"md:w-full",2:"md:w-1/2",3:"md:w-1/3",4:"md:w-1/4",5:"md:w-1/5",6:"md:w-1/6",7:"md:w-1/7",8:"md:w-1/8",9:"md:w-1/9",10:"md:w-1/10",11:"md:w-1/11",12:"md:w-1/12"},lg:{1:"lg:w-full",2:"lg:w-1/2",3:"lg:w-1/3",4:"lg:w-1/4",5:"lg:w-1/5",6:"lg:w-1/6",7:"lg:w-1/7",8:"lg:w-1/8",9:"lg:w-1/9",10:"lg:w-1/10",11:"lg:w-1/11",12:"lg:w-1/12"}},Fp={sm:{1:"order-1",2:"order-2",3:"order-3",4:"order-4",5:"order-5",6:"order-6",7:"order-7",8:"order-8",9:"order-9",10:"order-10",11:"order-11",12:"order-12",first:"order-first",last:"order-last",none:"order-none"},md:{1:"md:order-1",2:"md:order-2",3:"md:order-3",4:"md:order-4",5:"md:order-5",6:"md:order-6",7:"md:order-7",8:"md:order-8",9:"md:order-9",10:"md:order-10",11:"md:order-11",12:"md:order-12",first:"md:order-first",last:"md:order-last",none:"md:order-none"},lg:{1:"lg:order-1",2:"lg:order-2",3:"lg:order-3",4:"lg:order-4",5:"lg:order-5",6:"lg:order-6",7:"lg:order-7",8:"lg:order-8",9:"lg:order-9",10:"lg:order-10",11:"lg:order-11",12:"lg:order-12",first:"lg:order-first",last:"lg:order-last",none:"lg:order-none"}},Yp={sm:{0:"grow-0",1:"grow"},md:{0:"md:grow-0",1:"md:grow"},lg:{0:"lg:grow-0",1:"lg:grow"}},Qp={sm:{0:"shrink-0",1:"shrink"},md:{0:"md:shrink-0",1:"md:shrink"},lg:{0:"lg:shrink-0",1:"lg:shrink"}},Vp=(e,t,n,r="sm")=>{const a=[];switch(typeof e){case"object":for(const[r,o]of Object.entries(e))t[r]&&a.push(t?.[r]?.[o]??t?.[r]?.[n?.[r]]??"");break;case"string":case"number":const o=r;a.push(t?.[o]?.[e]??t?.[o]?.[n?.[o]]??"");break;default:if(void 0===e)break;a.push(t?.[r]?.[n]??"")}return a.join(" ")},Wp=({className:e,cols:t,gap:n,gapX:r,gapY:a,align:o,justify:i,gridFlow:s,colsSubGrid:l=!1,rowsSubGrid:c=!1,autoRows:u=!1,autoCols:d=!1,children:f,...m})=>{const p=Vp(t,Sp,1),h=Vp(n,kp,"sm"),g=Vp(r,jp,""),w=Vp(a,Dp,""),y=Vp(o,Lp,""),b=Vp(i,Op,""),v=Vp(s,Tp,"");return(0,P.jsx)("div",{className:Oe("grid",{"grid-cols-subgrid":l,"grid-rows-subgrid":c,"auto-cols-auto":d,"auto-rows-auto":u},p,h,g,w,y,b,v,e),...m,children:f})};Wp.Item=({className:e,children:t,colSpan:n,colStart:r,alignSelf:a,justifySelf:o,...i})=>{const s=Vp(n,Cp,0),l=Vp(r,Ap,0),c=Vp(a,zp,""),u=Vp(o,Pp,"");return(0,P.jsx)("div",{className:Oe(s,l,c,u,e),...i,children:t})};const Zp=(0,i.createContext)({}),Gp=({containerType:e="flex",gap:t="sm",gapX:n,gapY:r,direction:a,justify:o,align:i,wrap:s,cols:l,className:c,children:u,...d})=>{if("grid"===e)return(0,P.jsx)(Zp.Provider,{value:{containerType:e},children:(0,P.jsx)(Wp,{className:c,gap:t,gapX:n,gapY:r,cols:l,children:u,align:i,justify:o,...d})});const f=Vp(s,Up,""),m=Vp(t,kp,"sm"),p=Vp(n,jp,""),h=Vp(r,Dp,""),g=Vp(a,Rp,""),w=Vp(o,Op,""),y=Vp(i,Lp,""),b=Oe("flex",f,m,p,h,g,w,y,c);return(0,P.jsx)(Zp.Provider,{value:{containerType:e,cols:l},children:"flex"===e?(0,P.jsx)("div",{className:b,children:u}):(0,P.jsx)(Wp,{className:c,gap:t,gapX:n,gapY:r,cols:l,children:u,align:i,justify:o,...d})})},Hp=({grow:e,shrink:t,order:n,alignSelf:r,justifySelf:a,className:o,children:s,...l})=>{const{containerType:c,cols:u}=(0,i.useContext)(Zp);if("grid"===c)return(0,P.jsx)(Wp.Item,{className:o,alignSelf:r,justifySelf:a,children:s,...l});const d=Vp(r,zp,""),f=Vp(a,Pp,""),m=Vp(e,Yp,0),p=Vp(t,Qp,0),h=Vp(n,Fp,0),g=Vp(u,Bp,1);return(0,P.jsx)("div",{className:Oe("box-border",m,p,h,d,f,g,o),children:s})};Gp.Item=Hp,Gp.displayName="Container",Hp.displayName="Container.Item";const $p=({title:e="",description:t="",icon:n=null,iconPosition:r="right",tag:a="h2",size:o="sm",className:i=""})=>{const s={xs:"gap-1 [&>svg]:size-3.5",sm:"gap-1 [&>svg]:size-4",md:"gap-1.5 [&>svg]:size-5",lg:"gap-1.5 [&>svg]:size-5"};if(!e)return null;const l=()=>(0,P.jsx)(a,{className:Oe("font-semibold p-0 m-0",{xs:"text-base [&>*]:text-base gap-1",sm:"text-lg [&>*]:text-lg gap-1",md:"text-xl [&>*]:text-xl gap-1.5",lg:"text-2xl [&>*]:text-2xl gap-1.5"}[o]),children:e});return t?(0,P.jsxs)("div",{className:i,children:[(0,P.jsxs)("div",{children:[n&&"left"===r&&(0,P.jsxs)("div",{className:Oe("flex items-center",s[o]),children:[n,l()]}),n&&"right"===r&&(0,P.jsxs)("div",{className:Oe("flex items-center",s[o]),children:[l(),n]}),!n&&l()]}),(0,P.jsx)("p",{className:Oe("text-text-secondary font-normal my-0",{xs:"text-sm",sm:"text-sm",md:"text-base",lg:"text-base"}[o]),children:t})]}):(0,P.jsxs)("div",{className:i,children:[n&&"left"===r&&(0,P.jsxs)("div",{className:Oe("flex items-center",s[o]),children:[n,l()]}),n&&"right"===r&&(0,P.jsxs)("div",{className:Oe("flex items-center",s[o]),children:[l(),n]}),!n&&l()]})},Xp={400:"font-normal",500:"font-medium",600:"font-semibold",700:"font-bold"},qp={36:"text-4xl",30:"text-3xl",24:"text-2xl",20:"text-xl",18:"text-lg",16:"text-base",14:"text-sm",12:"text-xs"},Jp={44:"leading-11",38:"leading-9.5",32:"leading-8",30:"leading-7.5",28:"leading-7",24:"leading-6",20:"leading-5",16:"leading-4"},Kp={2:"tracking-2"},eh={brand600:"text-brand-primary-600",link:"text-link-primary",primary:"text-text-primary",secondary:"text-text-secondary",tertiary:"text-text-tertiary",disabled:"text-text-disabled",help:"text-field-helper",label:"text-field-label",info:"text-support-info",success:"text-support-success",warning:"text-support-warning",error:"text-support-error",inverse:"text-text-on-color"},th=(0,i.forwardRef)(function({as:e,children:t,weight:n,size:r,lineHeight:a,letterSpacing:o,color:i="primary",className:s,...l},c){return(0,P.jsx)(e||"p",{ref:c,className:Oe("m-0 p-0",n?Xp[n]:"",r?qp[r]:"",a?Jp[a]:"",o?Kp[o]:"",i?eh[i]:"",s),...l,children:t})});function nh({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 rh=i.forwardRef(nh);function ah(e){const t="undefined"!=typeof cartflows_admin&&"active"===cartflows_admin.woocommerce_status,n=cartflows_admin?.global_checkout_id,r="undefined"!=typeof cartflows_admin&&!!cartflows_admin.is_pro,a=e?.flow_exists,o=e?.flow_have_order_bump,i=e?.flow_have_upsell;return[{woocommerce_setup:{completed:t}},{global_checkout_added:{completed:null!=n&&""!==n}},{funnel_created:{completed:a>0}},{order_bump_created:{completed:o&&r}},{upsell_created:{completed:i&&r}}]}const oh=function({page_builder:e}){const[{setup_checklist_data:t},n]=d(),[r,a]=(0,i.useState)(!1),s=!!cartflows_admin?.is_pro,l=t?.flow_exists,c=t?.checkout_flow_id,u=t?.checkout_step_id,f=[{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 Sales Funnel","cartflows"),actionLabel:"bricks-builder"===e||"other"===e?(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:l&&c&&u?`admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${c}&step_id=${u}&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:l&&c?`admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${c}`:"index.php?page=cartflows&path=library",pro:!0}],m=ah(t);let p=0;m.forEach(e=>{Object.values(e).forEach(e=>{e.completed&&p++})}),(0,i.useEffect)(()=>{let e=!0;if(null===t){const t=new window.FormData;(async()=>{a(!0),L()({path:"/cartflows/v1/admin/setup-checklist/",method:"POST",body:t}).then(t=>{e&&(n({type:"SET_SETUP_CHECKLIST_DATA",setup_checklist:t}),a(!1))})})()}return()=>{e=!1}},[]);const h=getUpgradeToProUrl({utm_campaign:"pricing"});return(0,o.createElement)(Gp,{containerType:"flex",direction:"column",className:"wcf-onboarding-stats-box box-border h-full bg-primary-25 border border-solid border-primary-500 rounded-lg p-6 gap-5"},!t&&r&&(0,o.createElement)(Ip,null),t&&!r&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"flex justify-between items-center"},(0,o.createElement)($p,{tag:"h4",size:"xs",title:(0,z.__)("Almost There! Let's Go Live.","cartflows"),className:"tracking-[-0.1px] leading-[30px]"}),(0,o.createElement)(th,{size:14,color:"secondary",className:"text-right w-[180px]"},(0,z.sprintf)(/* translators: %d is the number of completed steps. */ /* translators: %d is the number of completed steps. */ |
| 5 |
(0,z.__)("%d out of 5 completed","cartflows"),p))),(0,o.createElement)("ul",{className:"list-none p-0 m-0 space-y-[14px]"},f.map(({id:e,label:t,actionLabel:n,url:r,pro:a})=>{const i=(e=>{const t=m.find(t=>t[e]);return!!t&&t[e]?.completed})(e),l=a&&!s,c=`${cartflows_admin?.admin_base_url}${r}`;return(0,o.createElement)("li",{key:e,className:"flex justify-between items-center"},(0,o.createElement)("div",{className:"flex items-center gap-[10px]"},i?(0,o.createElement)("div",{className:"flex items-center justify-center size-5 shrink-0"},(0,o.createElement)(rh,{className:"size-4 text-primary-500"})):(0,o.createElement)("div",{className:"flex items-center justify-center size-5 shrink-0"},(0,o.createElement)("span",{className:"border border-field-border bg-background-primary rounded-full size-4 inline-block"})),(0,o.createElement)(th,{size:14,weight:500,color:"secondary"},t),a&&!s&&(0,o.createElement)(Ym,null)),i&&(0,o.createElement)(th,{size:14,weight:500,className:"text-support-success"},(0,z.__)("Completed","cartflows")),!i&&l&&(0,o.createElement)(Va,{tag:"a",href:h,variant:"link",size:"sm",className:"!text-primary-500 hover:!text-primary-600"},(0,z.__)("Unlock with PRO","cartflows")),!i&&!l&&(0,o.createElement)(Va,{tag:"a",href:c,variant:"link",size:"sm",className:"!text-primary-500 hover:!text-primary-600"},n))}))))};function ih({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{d:"M10.75 4.75a.75.75 0 0 0-1.5 0v4.5h-4.5a.75.75 0 0 0 0 1.5h4.5v4.5a.75.75 0 0 0 1.5 0v-4.5h4.5a.75.75 0 0 0 0-1.5h-4.5v-4.5Z"}))}const sh=i.forwardRef(ih),lh=function(){const[{page_builder:e}]=g(),[t,n]=(0,i.useState)(!1),[r,a]=(0,i.useState)("hide"),[s,l]=(0,i.useState)("");return(0,o.createElement)("div",{className:"wcf-user-info"},(0,o.createElement)("div",{className:"flex flex-col gap-6 md:gap-8 lg:flex-row lg:items-stretch justify-between"},(0,o.createElement)("div",{className:"grid grid-cols-12 items-center w-full lg:w-[64.5%] bg-background-primary border border-solid border-border-subtle rounded-lg shadow-sm overflow-hidden p-4 gap-2 box-border"},(0,o.createElement)("div",{className:"flex flex-col col-span-12 md:col-span-7 lg:col-span-7 pl-2 pr-5 py-2 gap-6"},(0,o.createElement)("div",{className:"flex flex-col gap-1"},(0,o.createElement)($p,{tag:"h3",size:"md",title:(0,z.__)("Welcome to CartFlows!","cartflows"),className:"tracking-[-0.1px] leading-[30px] text-text-primary"}),(0,o.createElement)(th,{size:16,color:"secondary"},(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,o.createElement)("div",{className:"w-fit"},(0,o.createElement)(Va,{tag:C,to:{pathname:"admin.php",search:"?page=cartflows&path=library"},variant:"primary",size:"md",icon:(0,o.createElement)(sh,null),iconPosition:"left",onClick:t=>{"bricks-builder"===e&&(t.preventDefault(),a("show"))},className:"no-underline"},(0,z.__)("Create New Funnel","cartflows")))),(0,o.createElement)("div",{className:"col-span-12 md:col-span-5 lg:col-span-5 p-2 h-full box-border"},(0,o.createElement)("div",{className:"relative w-full h-full rounded overflow-hidden cursor-pointer",style:{backgroundImage:"url(https://img.youtube.com/vi/tCm60PWOd0M/maxresdefault.jpg)",backgroundSize:"cover",backgroundPosition:"center"},onClick:e=>{e.preventDefault(),n(!t)}},(0,o.createElement)("div",{className:"absolute inset-0 rounded"}),(0,o.createElement)("div",{className:"absolute inset-0 flex items-center justify-center"},(0,o.createElement)("div",{className:"w-14 h-14 flex items-center justify-center bg-black bg-opacity-50 group-hover:bg-opacity-80 transition-all duration-300 rounded-full"},(0,o.createElement)("svg",{className:"w-8 h-8 text-white",viewBox:"0 0 24 24",fill:"currentColor"},(0,o.createElement)("path",{d:"M8 5v14l11-7L8 5z"})))))),t&&(0,o.createElement)(ip,{showModel:t,setOpenVideoModel:n})),(0,o.createElement)("div",{className:"w-full lg:w-[33%]"},(0,o.createElement)(oh,{page_builder:e}))),(0,o.createElement)(Mp,{visibility:r,setVisibility:a,type:"blank",flowName:s,setFlowName:l}))};function ch({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))}const uh=i.forwardRef(ch);var dh=a(442);const fh=dh.default||dh;var mh=function(){return mh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},mh.apply(this,arguments)};function ph(e,t){for(var n={},r={},a=e.split("~~"),o=!1,i=0;a.length>i;i++){for(var s=a[i].split("~"),l=0;l<s.length;l+=2){var c=s[l],u=s[l+1],d="&"+c+";";n[d]=u,o&&(n["&"+c]=u),r[u]=d}o=!0}return t?{entities:mh(mh({},n),t.entities),characters:mh(mh({},r),t.characters)}:{entities:n,characters:r}}var hh={xml:/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html4:/∉|&(?:nbsp|iexcl|cent|pound|curren|yen|brvbar|sect|uml|copy|ordf|laquo|not|shy|reg|macr|deg|plusmn|sup2|sup3|acute|micro|para|middot|cedil|sup1|ordm|raquo|frac14|frac12|frac34|iquest|Agrave|Aacute|Acirc|Atilde|Auml|Aring|AElig|Ccedil|Egrave|Eacute|Ecirc|Euml|Igrave|Iacute|Icirc|Iuml|ETH|Ntilde|Ograve|Oacute|Ocirc|Otilde|Ouml|times|Oslash|Ugrave|Uacute|Ucirc|Uuml|Yacute|THORN|szlig|agrave|aacute|acirc|atilde|auml|aring|aelig|ccedil|egrave|eacute|ecirc|euml|igrave|iacute|icirc|iuml|eth|ntilde|ograve|oacute|ocirc|otilde|ouml|divide|oslash|ugrave|uacute|ucirc|uuml|yacute|thorn|yuml|quot|amp|lt|gt|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g,html5:/·|℗|⋇|⪧|⩺|⋗|⦕|⩼|⪆|⥸|⋗|⋛|⪌|≷|≳|⪦|⩹|⋖|⋋|⋉|⥶|⩻|⦖|◃|⊴|◂|∉|⋹̸|⋵̸|∉|⋷|⋶|∌|∌|⋾|⋽|∥|⊠|⨱|⨰|&(?:AElig|AMP|Aacute|Acirc|Agrave|Aring|Atilde|Auml|COPY|Ccedil|ETH|Eacute|Ecirc|Egrave|Euml|GT|Iacute|Icirc|Igrave|Iuml|LT|Ntilde|Oacute|Ocirc|Ograve|Oslash|Otilde|Ouml|QUOT|REG|THORN|Uacute|Ucirc|Ugrave|Uuml|Yacute|aacute|acirc|acute|aelig|agrave|amp|aring|atilde|auml|brvbar|ccedil|cedil|cent|copy|curren|deg|divide|eacute|ecirc|egrave|eth|euml|frac12|frac14|frac34|gt|iacute|icirc|iexcl|igrave|iquest|iuml|laquo|lt|macr|micro|middot|nbsp|not|ntilde|oacute|ocirc|ograve|ordf|ordm|oslash|otilde|ouml|para|plusmn|pound|quot|raquo|reg|sect|shy|sup1|sup2|sup3|szlig|thorn|times|uacute|ucirc|ugrave|uml|uuml|yacute|yen|yuml|#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);?/g},gh={};gh.xml=ph("lt~<~gt~>~quot~\"~apos~'~amp~&"),gh.html4=ph("apos~'~OElig~Œ~oelig~œ~Scaron~Š~scaron~š~Yuml~Ÿ~circ~ˆ~tilde~˜~ensp~ ~emsp~ ~thinsp~ ~zwnj~~zwj~~lrm~~rlm~~ndash~–~mdash~—~lsquo~‘~rsquo~’~sbquo~‚~ldquo~“~rdquo~”~bdquo~„~dagger~†~Dagger~‡~permil~‰~lsaquo~‹~rsaquo~›~euro~€~fnof~ƒ~Alpha~Α~Beta~Β~Gamma~Γ~Delta~Δ~Epsilon~Ε~Zeta~Ζ~Eta~Η~Theta~Θ~Iota~Ι~Kappa~Κ~Lambda~Λ~Mu~Μ~Nu~Ν~Xi~Ξ~Omicron~Ο~Pi~Π~Rho~Ρ~Sigma~Σ~Tau~Τ~Upsilon~Υ~Phi~Φ~Chi~Χ~Psi~Ψ~Omega~Ω~alpha~α~beta~β~gamma~γ~delta~δ~epsilon~ε~zeta~ζ~eta~η~theta~θ~iota~ι~kappa~κ~lambda~λ~mu~μ~nu~ν~xi~ξ~omicron~ο~pi~π~rho~ρ~sigmaf~ς~sigma~σ~tau~τ~upsilon~υ~phi~φ~chi~χ~psi~ψ~omega~ω~thetasym~ϑ~upsih~ϒ~piv~ϖ~bull~•~hellip~…~prime~′~Prime~″~oline~‾~frasl~⁄~weierp~℘~image~ℑ~real~ℜ~trade~™~alefsym~ℵ~larr~←~uarr~↑~rarr~→~darr~↓~harr~↔~crarr~↵~lArr~⇐~uArr~⇑~rArr~⇒~dArr~⇓~hArr~⇔~forall~∀~part~∂~exist~∃~empty~∅~nabla~∇~isin~∈~notin~∉~ni~∋~prod~∏~sum~∑~minus~−~lowast~∗~radic~√~prop~∝~infin~∞~ang~∠~and~∧~or~∨~cap~∩~cup~∪~int~∫~there4~∴~sim~∼~cong~≅~asymp~≈~ne~≠~equiv~≡~le~≤~ge~≥~sub~⊂~sup~⊃~nsub~⊄~sube~⊆~supe~⊇~oplus~⊕~otimes~⊗~perp~⊥~sdot~⋅~lceil~⌈~rceil~⌉~lfloor~⌊~rfloor~⌋~lang~〈~rang~〉~loz~◊~spades~♠~clubs~♣~hearts~♥~diams~♦~~nbsp~ ~iexcl~¡~cent~¢~pound~£~curren~¤~yen~¥~brvbar~¦~sect~§~uml~¨~copy~©~ordf~ª~laquo~«~not~¬~shy~~reg~®~macr~¯~deg~°~plusmn~±~sup2~²~sup3~³~acute~´~micro~µ~para~¶~middot~·~cedil~¸~sup1~¹~ordm~º~raquo~»~frac14~¼~frac12~½~frac34~¾~iquest~¿~Agrave~À~Aacute~Á~Acirc~Â~Atilde~Ã~Auml~Ä~Aring~Å~AElig~Æ~Ccedil~Ç~Egrave~È~Eacute~É~Ecirc~Ê~Euml~Ë~Igrave~Ì~Iacute~Í~Icirc~Î~Iuml~Ï~ETH~Ð~Ntilde~Ñ~Ograve~Ò~Oacute~Ó~Ocirc~Ô~Otilde~Õ~Ouml~Ö~times~×~Oslash~Ø~Ugrave~Ù~Uacute~Ú~Ucirc~Û~Uuml~Ü~Yacute~Ý~THORN~Þ~szlig~ß~agrave~à~aacute~á~acirc~â~atilde~ã~auml~ä~aring~å~aelig~æ~ccedil~ç~egrave~è~eacute~é~ecirc~ê~euml~ë~igrave~ì~iacute~í~icirc~î~iuml~ï~eth~ð~ntilde~ñ~ograve~ò~oacute~ó~ocirc~ô~otilde~õ~ouml~ö~divide~÷~oslash~ø~ugrave~ù~uacute~ú~ucirc~û~uuml~ü~yacute~ý~thorn~þ~yuml~ÿ~quot~\"~amp~&~lt~<~gt~>"),gh.html5=ph('Abreve~Ă~Acy~А~Afr~𝔄~Amacr~Ā~And~⩓~Aogon~Ą~Aopf~𝔸~ApplyFunction~~Ascr~𝒜~Assign~≔~Backslash~∖~Barv~⫧~Barwed~⌆~Bcy~Б~Because~∵~Bernoullis~ℬ~Bfr~𝔅~Bopf~𝔹~Breve~˘~Bscr~ℬ~Bumpeq~≎~CHcy~Ч~Cacute~Ć~Cap~⋒~CapitalDifferentialD~ⅅ~Cayleys~ℭ~Ccaron~Č~Ccirc~Ĉ~Cconint~∰~Cdot~Ċ~Cedilla~¸~CenterDot~·~Cfr~ℭ~CircleDot~⊙~CircleMinus~⊖~CirclePlus~⊕~CircleTimes~⊗~ClockwiseContourIntegral~∲~CloseCurlyDoubleQuote~”~CloseCurlyQuote~’~Colon~∷~Colone~⩴~Congruent~≡~Conint~∯~ContourIntegral~∮~Copf~ℂ~Coproduct~∐~CounterClockwiseContourIntegral~∳~Cross~⨯~Cscr~𝒞~Cup~⋓~CupCap~≍~DD~ⅅ~DDotrahd~⤑~DJcy~Ђ~DScy~Ѕ~DZcy~Џ~Darr~↡~Dashv~⫤~Dcaron~Ď~Dcy~Д~Del~∇~Dfr~𝔇~DiacriticalAcute~´~DiacriticalDot~˙~DiacriticalDoubleAcute~˝~DiacriticalGrave~`~DiacriticalTilde~˜~Diamond~⋄~DifferentialD~ⅆ~Dopf~𝔻~Dot~¨~DotDot~⃜~DotEqual~≐~DoubleContourIntegral~∯~DoubleDot~¨~DoubleDownArrow~⇓~DoubleLeftArrow~⇐~DoubleLeftRightArrow~⇔~DoubleLeftTee~⫤~DoubleLongLeftArrow~⟸~DoubleLongLeftRightArrow~⟺~DoubleLongRightArrow~⟹~DoubleRightArrow~⇒~DoubleRightTee~⊨~DoubleUpArrow~⇑~DoubleUpDownArrow~⇕~DoubleVerticalBar~∥~DownArrow~↓~DownArrowBar~⤓~DownArrowUpArrow~⇵~DownBreve~̑~DownLeftRightVector~⥐~DownLeftTeeVector~⥞~DownLeftVector~↽~DownLeftVectorBar~⥖~DownRightTeeVector~⥟~DownRightVector~⇁~DownRightVectorBar~⥗~DownTee~⊤~DownTeeArrow~↧~Downarrow~⇓~Dscr~𝒟~Dstrok~Đ~ENG~Ŋ~Ecaron~Ě~Ecy~Э~Edot~Ė~Efr~𝔈~Element~∈~Emacr~Ē~EmptySmallSquare~◻~EmptyVerySmallSquare~▫~Eogon~Ę~Eopf~𝔼~Equal~⩵~EqualTilde~≂~Equilibrium~⇌~Escr~ℰ~Esim~⩳~Exists~∃~ExponentialE~ⅇ~Fcy~Ф~Ffr~𝔉~FilledSmallSquare~◼~FilledVerySmallSquare~▪~Fopf~𝔽~ForAll~∀~Fouriertrf~ℱ~Fscr~ℱ~GJcy~Ѓ~Gammad~Ϝ~Gbreve~Ğ~Gcedil~Ģ~Gcirc~Ĝ~Gcy~Г~Gdot~Ġ~Gfr~𝔊~Gg~⋙~Gopf~𝔾~GreaterEqual~≥~GreaterEqualLess~⋛~GreaterFullEqual~≧~GreaterGreater~⪢~GreaterLess~≷~GreaterSlantEqual~⩾~GreaterTilde~≳~Gscr~𝒢~Gt~≫~HARDcy~Ъ~Hacek~ˇ~Hat~^~Hcirc~Ĥ~Hfr~ℌ~HilbertSpace~ℋ~Hopf~ℍ~HorizontalLine~─~Hscr~ℋ~Hstrok~Ħ~HumpDownHump~≎~HumpEqual~≏~IEcy~Е~IJlig~IJ~IOcy~Ё~Icy~И~Idot~İ~Ifr~ℑ~Im~ℑ~Imacr~Ī~ImaginaryI~ⅈ~Implies~⇒~Int~∬~Integral~∫~Intersection~⋂~InvisibleComma~~InvisibleTimes~~Iogon~Į~Iopf~𝕀~Iscr~ℐ~Itilde~Ĩ~Iukcy~І~Jcirc~Ĵ~Jcy~Й~Jfr~𝔍~Jopf~𝕁~Jscr~𝒥~Jsercy~Ј~Jukcy~Є~KHcy~Х~KJcy~Ќ~Kcedil~Ķ~Kcy~К~Kfr~𝔎~Kopf~𝕂~Kscr~𝒦~LJcy~Љ~Lacute~Ĺ~Lang~⟪~Laplacetrf~ℒ~Larr~↞~Lcaron~Ľ~Lcedil~Ļ~Lcy~Л~LeftAngleBracket~⟨~LeftArrow~←~LeftArrowBar~⇤~LeftArrowRightArrow~⇆~LeftCeiling~⌈~LeftDoubleBracket~⟦~LeftDownTeeVector~⥡~LeftDownVector~⇃~LeftDownVectorBar~⥙~LeftFloor~⌊~LeftRightArrow~↔~LeftRightVector~⥎~LeftTee~⊣~LeftTeeArrow~↤~LeftTeeVector~⥚~LeftTriangle~⊲~LeftTriangleBar~⧏~LeftTriangleEqual~⊴~LeftUpDownVector~⥑~LeftUpTeeVector~⥠~LeftUpVector~↿~LeftUpVectorBar~⥘~LeftVector~↼~LeftVectorBar~⥒~Leftarrow~⇐~Leftrightarrow~⇔~LessEqualGreater~⋚~LessFullEqual~≦~LessGreater~≶~LessLess~⪡~LessSlantEqual~⩽~LessTilde~≲~Lfr~𝔏~Ll~⋘~Lleftarrow~⇚~Lmidot~Ŀ~LongLeftArrow~⟵~LongLeftRightArrow~⟷~LongRightArrow~⟶~Longleftarrow~⟸~Longleftrightarrow~⟺~Longrightarrow~⟹~Lopf~𝕃~LowerLeftArrow~↙~LowerRightArrow~↘~Lscr~ℒ~Lsh~↰~Lstrok~Ł~Lt~≪~Map~⤅~Mcy~М~MediumSpace~ ~Mellintrf~ℳ~Mfr~𝔐~MinusPlus~∓~Mopf~𝕄~Mscr~ℳ~NJcy~Њ~Nacute~Ń~Ncaron~Ň~Ncedil~Ņ~Ncy~Н~NegativeMediumSpace~~NegativeThickSpace~~NegativeThinSpace~~NegativeVeryThinSpace~~NestedGreaterGreater~≫~NestedLessLess~≪~NewLine~\n~Nfr~𝔑~NoBreak~~NonBreakingSpace~ ~Nopf~ℕ~Not~⫬~NotCongruent~≢~NotCupCap~≭~NotDoubleVerticalBar~∦~NotElement~∉~NotEqual~≠~NotEqualTilde~≂̸~NotExists~∄~NotGreater~≯~NotGreaterEqual~≱~NotGreaterFullEqual~≧̸~NotGreaterGreater~≫̸~NotGreaterLess~≹~NotGreaterSlantEqual~⩾̸~NotGreaterTilde~≵~NotHumpDownHump~≎̸~NotHumpEqual~≏̸~NotLeftTriangle~⋪~NotLeftTriangleBar~⧏̸~NotLeftTriangleEqual~⋬~NotLess~≮~NotLessEqual~≰~NotLessGreater~≸~NotLessLess~≪̸~NotLessSlantEqual~⩽̸~NotLessTilde~≴~NotNestedGreaterGreater~⪢̸~NotNestedLessLess~⪡̸~NotPrecedes~⊀~NotPrecedesEqual~⪯̸~NotPrecedesSlantEqual~⋠~NotReverseElement~∌~NotRightTriangle~⋫~NotRightTriangleBar~⧐̸~NotRightTriangleEqual~⋭~NotSquareSubset~⊏̸~NotSquareSubsetEqual~⋢~NotSquareSuperset~⊐̸~NotSquareSupersetEqual~⋣~NotSubset~⊂⃒~NotSubsetEqual~⊈~NotSucceeds~⊁~NotSucceedsEqual~⪰̸~NotSucceedsSlantEqual~⋡~NotSucceedsTilde~≿̸~NotSuperset~⊃⃒~NotSupersetEqual~⊉~NotTilde~≁~NotTildeEqual~≄~NotTildeFullEqual~≇~NotTildeTilde~≉~NotVerticalBar~∤~Nscr~𝒩~Ocy~О~Odblac~Ő~Ofr~𝔒~Omacr~Ō~Oopf~𝕆~OpenCurlyDoubleQuote~“~OpenCurlyQuote~‘~Or~⩔~Oscr~𝒪~Otimes~⨷~OverBar~‾~OverBrace~⏞~OverBracket~⎴~OverParenthesis~⏜~PartialD~∂~Pcy~П~Pfr~𝔓~PlusMinus~±~Poincareplane~ℌ~Popf~ℙ~Pr~⪻~Precedes~≺~PrecedesEqual~⪯~PrecedesSlantEqual~≼~PrecedesTilde~≾~Product~∏~Proportion~∷~Proportional~∝~Pscr~𝒫~Qfr~𝔔~Qopf~ℚ~Qscr~𝒬~RBarr~⤐~Racute~Ŕ~Rang~⟫~Rarr~↠~Rarrtl~⤖~Rcaron~Ř~Rcedil~Ŗ~Rcy~Р~Re~ℜ~ReverseElement~∋~ReverseEquilibrium~⇋~ReverseUpEquilibrium~⥯~Rfr~ℜ~RightAngleBracket~⟩~RightArrow~→~RightArrowBar~⇥~RightArrowLeftArrow~⇄~RightCeiling~⌉~RightDoubleBracket~⟧~RightDownTeeVector~⥝~RightDownVector~⇂~RightDownVectorBar~⥕~RightFloor~⌋~RightTee~⊢~RightTeeArrow~↦~RightTeeVector~⥛~RightTriangle~⊳~RightTriangleBar~⧐~RightTriangleEqual~⊵~RightUpDownVector~⥏~RightUpTeeVector~⥜~RightUpVector~↾~RightUpVectorBar~⥔~RightVector~⇀~RightVectorBar~⥓~Rightarrow~⇒~Ropf~ℝ~RoundImplies~⥰~Rrightarrow~⇛~Rscr~ℛ~Rsh~↱~RuleDelayed~⧴~SHCHcy~Щ~SHcy~Ш~SOFTcy~Ь~Sacute~Ś~Sc~⪼~Scedil~Ş~Scirc~Ŝ~Scy~С~Sfr~𝔖~ShortDownArrow~↓~ShortLeftArrow~←~ShortRightArrow~→~ShortUpArrow~↑~SmallCircle~∘~Sopf~𝕊~Sqrt~√~Square~□~SquareIntersection~⊓~SquareSubset~⊏~SquareSubsetEqual~⊑~SquareSuperset~⊐~SquareSupersetEqual~⊒~SquareUnion~⊔~Sscr~𝒮~Star~⋆~Sub~⋐~Subset~⋐~SubsetEqual~⊆~Succeeds~≻~SucceedsEqual~⪰~SucceedsSlantEqual~≽~SucceedsTilde~≿~SuchThat~∋~Sum~∑~Sup~⋑~Superset~⊃~SupersetEqual~⊇~Supset~⋑~TRADE~™~TSHcy~Ћ~TScy~Ц~Tab~\t~Tcaron~Ť~Tcedil~Ţ~Tcy~Т~Tfr~𝔗~Therefore~∴~ThickSpace~ ~ThinSpace~ ~Tilde~∼~TildeEqual~≃~TildeFullEqual~≅~TildeTilde~≈~Topf~𝕋~TripleDot~⃛~Tscr~𝒯~Tstrok~Ŧ~Uarr~↟~Uarrocir~⥉~Ubrcy~Ў~Ubreve~Ŭ~Ucy~У~Udblac~Ű~Ufr~𝔘~Umacr~Ū~UnderBar~_~UnderBrace~⏟~UnderBracket~⎵~UnderParenthesis~⏝~Union~⋃~UnionPlus~⊎~Uogon~Ų~Uopf~𝕌~UpArrow~↑~UpArrowBar~⤒~UpArrowDownArrow~⇅~UpDownArrow~↕~UpEquilibrium~⥮~UpTee~⊥~UpTeeArrow~↥~Uparrow~⇑~Updownarrow~⇕~UpperLeftArrow~↖~UpperRightArrow~↗~Upsi~ϒ~Uring~Ů~Uscr~𝒰~Utilde~Ũ~VDash~⊫~Vbar~⫫~Vcy~В~Vdash~⊩~Vdashl~⫦~Vee~⋁~Verbar~‖~Vert~‖~VerticalBar~∣~VerticalLine~|~VerticalSeparator~❘~VerticalTilde~≀~VeryThinSpace~ ~Vfr~𝔙~Vopf~𝕍~Vscr~𝒱~Vvdash~⊪~Wcirc~Ŵ~Wedge~⋀~Wfr~𝔚~Wopf~𝕎~Wscr~𝒲~Xfr~𝔛~Xopf~𝕏~Xscr~𝒳~YAcy~Я~YIcy~Ї~YUcy~Ю~Ycirc~Ŷ~Ycy~Ы~Yfr~𝔜~Yopf~𝕐~Yscr~𝒴~ZHcy~Ж~Zacute~Ź~Zcaron~Ž~Zcy~З~Zdot~Ż~ZeroWidthSpace~~Zfr~ℨ~Zopf~ℤ~Zscr~𝒵~abreve~ă~ac~∾~acE~∾̳~acd~∿~acy~а~af~~afr~𝔞~aleph~ℵ~amacr~ā~amalg~⨿~andand~⩕~andd~⩜~andslope~⩘~andv~⩚~ange~⦤~angle~∠~angmsd~∡~angmsdaa~⦨~angmsdab~⦩~angmsdac~⦪~angmsdad~⦫~angmsdae~⦬~angmsdaf~⦭~angmsdag~⦮~angmsdah~⦯~angrt~∟~angrtvb~⊾~angrtvbd~⦝~angsph~∢~angst~Å~angzarr~⍼~aogon~ą~aopf~𝕒~ap~≈~apE~⩰~apacir~⩯~ape~≊~apid~≋~approx~≈~approxeq~≊~ascr~𝒶~ast~*~asympeq~≍~awconint~∳~awint~⨑~bNot~⫭~backcong~≌~backepsilon~϶~backprime~‵~backsim~∽~backsimeq~⋍~barvee~⊽~barwed~⌅~barwedge~⌅~bbrk~⎵~bbrktbrk~⎶~bcong~≌~bcy~б~becaus~∵~because~∵~bemptyv~⦰~bepsi~϶~bernou~ℬ~beth~ℶ~between~≬~bfr~𝔟~bigcap~⋂~bigcirc~◯~bigcup~⋃~bigodot~⨀~bigoplus~⨁~bigotimes~⨂~bigsqcup~⨆~bigstar~★~bigtriangledown~▽~bigtriangleup~△~biguplus~⨄~bigvee~⋁~bigwedge~⋀~bkarow~⤍~blacklozenge~⧫~blacksquare~▪~blacktriangle~▴~blacktriangledown~▾~blacktriangleleft~◂~blacktriangleright~▸~blank~␣~blk12~▒~blk14~░~blk34~▓~block~█~bne~=⃥~bnequiv~≡⃥~bnot~⌐~bopf~𝕓~bot~⊥~bottom~⊥~bowtie~⋈~boxDL~╗~boxDR~╔~boxDl~╖~boxDr~╓~boxH~═~boxHD~╦~boxHU~╩~boxHd~╤~boxHu~╧~boxUL~╝~boxUR~╚~boxUl~╜~boxUr~╙~boxV~║~boxVH~╬~boxVL~╣~boxVR~╠~boxVh~╫~boxVl~╢~boxVr~╟~boxbox~⧉~boxdL~╕~boxdR~╒~boxdl~┐~boxdr~┌~boxh~─~boxhD~╥~boxhU~╨~boxhd~┬~boxhu~┴~boxminus~⊟~boxplus~⊞~boxtimes~⊠~boxuL~╛~boxuR~╘~boxul~┘~boxur~└~boxv~│~boxvH~╪~boxvL~╡~boxvR~╞~boxvh~┼~boxvl~┤~boxvr~├~bprime~‵~breve~˘~bscr~𝒷~bsemi~⁏~bsim~∽~bsime~⋍~bsol~\\~bsolb~⧅~bsolhsub~⟈~bullet~•~bump~≎~bumpE~⪮~bumpe~≏~bumpeq~≏~cacute~ć~capand~⩄~capbrcup~⩉~capcap~⩋~capcup~⩇~capdot~⩀~caps~∩︀~caret~⁁~caron~ˇ~ccaps~⩍~ccaron~č~ccirc~ĉ~ccups~⩌~ccupssm~⩐~cdot~ċ~cemptyv~⦲~centerdot~·~cfr~𝔠~chcy~ч~check~✓~checkmark~✓~cir~○~cirE~⧃~circeq~≗~circlearrowleft~↺~circlearrowright~↻~circledR~®~circledS~Ⓢ~circledast~⊛~circledcirc~⊚~circleddash~⊝~cire~≗~cirfnint~⨐~cirmid~⫯~cirscir~⧂~clubsuit~♣~colon~:~colone~≔~coloneq~≔~comma~,~commat~@~comp~∁~compfn~∘~complement~∁~complexes~ℂ~congdot~⩭~conint~∮~copf~𝕔~coprod~∐~copysr~℗~cross~✗~cscr~𝒸~csub~⫏~csube~⫑~csup~⫐~csupe~⫒~ctdot~⋯~cudarrl~⤸~cudarrr~⤵~cuepr~⋞~cuesc~⋟~cularr~↶~cularrp~⤽~cupbrcap~⩈~cupcap~⩆~cupcup~⩊~cupdot~⊍~cupor~⩅~cups~∪︀~curarr~↷~curarrm~⤼~curlyeqprec~⋞~curlyeqsucc~⋟~curlyvee~⋎~curlywedge~⋏~curvearrowleft~↶~curvearrowright~↷~cuvee~⋎~cuwed~⋏~cwconint~∲~cwint~∱~cylcty~⌭~dHar~⥥~daleth~ℸ~dash~‐~dashv~⊣~dbkarow~⤏~dblac~˝~dcaron~ď~dcy~д~dd~ⅆ~ddagger~‡~ddarr~⇊~ddotseq~⩷~demptyv~⦱~dfisht~⥿~dfr~𝔡~dharl~⇃~dharr~⇂~diam~⋄~diamond~⋄~diamondsuit~♦~die~¨~digamma~ϝ~disin~⋲~div~÷~divideontimes~⋇~divonx~⋇~djcy~ђ~dlcorn~⌞~dlcrop~⌍~dollar~$~dopf~𝕕~dot~˙~doteq~≐~doteqdot~≑~dotminus~∸~dotplus~∔~dotsquare~⊡~doublebarwedge~⌆~downarrow~↓~downdownarrows~⇊~downharpoonleft~⇃~downharpoonright~⇂~drbkarow~⤐~drcorn~⌟~drcrop~⌌~dscr~𝒹~dscy~ѕ~dsol~⧶~dstrok~đ~dtdot~⋱~dtri~▿~dtrif~▾~duarr~⇵~duhar~⥯~dwangle~⦦~dzcy~џ~dzigrarr~⟿~eDDot~⩷~eDot~≑~easter~⩮~ecaron~ě~ecir~≖~ecolon~≕~ecy~э~edot~ė~ee~ⅇ~efDot~≒~efr~𝔢~eg~⪚~egs~⪖~egsdot~⪘~el~⪙~elinters~⏧~ell~ℓ~els~⪕~elsdot~⪗~emacr~ē~emptyset~∅~emptyv~∅~emsp13~ ~emsp14~ ~eng~ŋ~eogon~ę~eopf~𝕖~epar~⋕~eparsl~⧣~eplus~⩱~epsi~ε~epsiv~ϵ~eqcirc~≖~eqcolon~≕~eqsim~≂~eqslantgtr~⪖~eqslantless~⪕~equals~=~equest~≟~equivDD~⩸~eqvparsl~⧥~erDot~≓~erarr~⥱~escr~ℯ~esdot~≐~esim~≂~excl~!~expectation~ℰ~exponentiale~ⅇ~fallingdotseq~≒~fcy~ф~female~♀~ffilig~ffi~fflig~ff~ffllig~ffl~ffr~𝔣~filig~fi~fjlig~fj~flat~♭~fllig~fl~fltns~▱~fopf~𝕗~fork~⋔~forkv~⫙~fpartint~⨍~frac13~⅓~frac15~⅕~frac16~⅙~frac18~⅛~frac23~⅔~frac25~⅖~frac35~⅗~frac38~⅜~frac45~⅘~frac56~⅚~frac58~⅝~frac78~⅞~frown~⌢~fscr~𝒻~gE~≧~gEl~⪌~gacute~ǵ~gammad~ϝ~gap~⪆~gbreve~ğ~gcirc~ĝ~gcy~г~gdot~ġ~gel~⋛~geq~≥~geqq~≧~geqslant~⩾~ges~⩾~gescc~⪩~gesdot~⪀~gesdoto~⪂~gesdotol~⪄~gesl~⋛︀~gesles~⪔~gfr~𝔤~gg~≫~ggg~⋙~gimel~ℷ~gjcy~ѓ~gl~≷~glE~⪒~gla~⪥~glj~⪤~gnE~≩~gnap~⪊~gnapprox~⪊~gne~⪈~gneq~⪈~gneqq~≩~gnsim~⋧~gopf~𝕘~grave~`~gscr~ℊ~gsim~≳~gsime~⪎~gsiml~⪐~gtcc~⪧~gtcir~⩺~gtdot~⋗~gtlPar~⦕~gtquest~⩼~gtrapprox~⪆~gtrarr~⥸~gtrdot~⋗~gtreqless~⋛~gtreqqless~⪌~gtrless~≷~gtrsim~≳~gvertneqq~≩︀~gvnE~≩︀~hairsp~ ~half~½~hamilt~ℋ~hardcy~ъ~harrcir~⥈~harrw~↭~hbar~ℏ~hcirc~ĥ~heartsuit~♥~hercon~⊹~hfr~𝔥~hksearow~⤥~hkswarow~⤦~hoarr~⇿~homtht~∻~hookleftarrow~↩~hookrightarrow~↪~hopf~𝕙~horbar~―~hscr~𝒽~hslash~ℏ~hstrok~ħ~hybull~⁃~hyphen~‐~ic~~icy~и~iecy~е~iff~⇔~ifr~𝔦~ii~ⅈ~iiiint~⨌~iiint~∭~iinfin~⧜~iiota~℩~ijlig~ij~imacr~ī~imagline~ℐ~imagpart~ℑ~imath~ı~imof~⊷~imped~Ƶ~in~∈~incare~℅~infintie~⧝~inodot~ı~intcal~⊺~integers~ℤ~intercal~⊺~intlarhk~⨗~intprod~⨼~iocy~ё~iogon~į~iopf~𝕚~iprod~⨼~iscr~𝒾~isinE~⋹~isindot~⋵~isins~⋴~isinsv~⋳~isinv~∈~it~~itilde~ĩ~iukcy~і~jcirc~ĵ~jcy~й~jfr~𝔧~jmath~ȷ~jopf~𝕛~jscr~𝒿~jsercy~ј~jukcy~є~kappav~ϰ~kcedil~ķ~kcy~к~kfr~𝔨~kgreen~ĸ~khcy~х~kjcy~ќ~kopf~𝕜~kscr~𝓀~lAarr~⇚~lAtail~⤛~lBarr~⤎~lE~≦~lEg~⪋~lHar~⥢~lacute~ĺ~laemptyv~⦴~lagran~ℒ~langd~⦑~langle~⟨~lap~⪅~larrb~⇤~larrbfs~⤟~larrfs~⤝~larrhk~↩~larrlp~↫~larrpl~⤹~larrsim~⥳~larrtl~↢~lat~⪫~latail~⤙~late~⪭~lates~⪭︀~lbarr~⤌~lbbrk~❲~lbrace~{~lbrack~[~lbrke~⦋~lbrksld~⦏~lbrkslu~⦍~lcaron~ľ~lcedil~ļ~lcub~{~lcy~л~ldca~⤶~ldquor~„~ldrdhar~⥧~ldrushar~⥋~ldsh~↲~leftarrow~←~leftarrowtail~↢~leftharpoondown~↽~leftharpoonup~↼~leftleftarrows~⇇~leftrightarrow~↔~leftrightarrows~⇆~leftrightharpoons~⇋~leftrightsquigarrow~↭~leftthreetimes~⋋~leg~⋚~leq~≤~leqq~≦~leqslant~⩽~les~⩽~lescc~⪨~lesdot~⩿~lesdoto~⪁~lesdotor~⪃~lesg~⋚︀~lesges~⪓~lessapprox~⪅~lessdot~⋖~lesseqgtr~⋚~lesseqqgtr~⪋~lessgtr~≶~lesssim~≲~lfisht~⥼~lfr~𝔩~lg~≶~lgE~⪑~lhard~↽~lharu~↼~lharul~⥪~lhblk~▄~ljcy~љ~ll~≪~llarr~⇇~llcorner~⌞~llhard~⥫~lltri~◺~lmidot~ŀ~lmoust~⎰~lmoustache~⎰~lnE~≨~lnap~⪉~lnapprox~⪉~lne~⪇~lneq~⪇~lneqq~≨~lnsim~⋦~loang~⟬~loarr~⇽~lobrk~⟦~longleftarrow~⟵~longleftrightarrow~⟷~longmapsto~⟼~longrightarrow~⟶~looparrowleft~↫~looparrowright~↬~lopar~⦅~lopf~𝕝~loplus~⨭~lotimes~⨴~lowbar~_~lozenge~◊~lozf~⧫~lpar~(~lparlt~⦓~lrarr~⇆~lrcorner~⌟~lrhar~⇋~lrhard~⥭~lrtri~⊿~lscr~𝓁~lsh~↰~lsim~≲~lsime~⪍~lsimg~⪏~lsqb~[~lsquor~‚~lstrok~ł~ltcc~⪦~ltcir~⩹~ltdot~⋖~lthree~⋋~ltimes~⋉~ltlarr~⥶~ltquest~⩻~ltrPar~⦖~ltri~◃~ltrie~⊴~ltrif~◂~lurdshar~⥊~luruhar~⥦~lvertneqq~≨︀~lvnE~≨︀~mDDot~∺~male~♂~malt~✠~maltese~✠~map~↦~mapsto~↦~mapstodown~↧~mapstoleft~↤~mapstoup~↥~marker~▮~mcomma~⨩~mcy~м~measuredangle~∡~mfr~𝔪~mho~℧~mid~∣~midast~*~midcir~⫰~minusb~⊟~minusd~∸~minusdu~⨪~mlcp~⫛~mldr~…~mnplus~∓~models~⊧~mopf~𝕞~mp~∓~mscr~𝓂~mstpos~∾~multimap~⊸~mumap~⊸~nGg~⋙̸~nGt~≫⃒~nGtv~≫̸~nLeftarrow~⇍~nLeftrightarrow~⇎~nLl~⋘̸~nLt~≪⃒~nLtv~≪̸~nRightarrow~⇏~nVDash~⊯~nVdash~⊮~nacute~ń~nang~∠⃒~nap~≉~napE~⩰̸~napid~≋̸~napos~ʼn~napprox~≉~natur~♮~natural~♮~naturals~ℕ~nbump~≎̸~nbumpe~≏̸~ncap~⩃~ncaron~ň~ncedil~ņ~ncong~≇~ncongdot~⩭̸~ncup~⩂~ncy~н~neArr~⇗~nearhk~⤤~nearr~↗~nearrow~↗~nedot~≐̸~nequiv~≢~nesear~⤨~nesim~≂̸~nexist~∄~nexists~∄~nfr~𝔫~ngE~≧̸~nge~≱~ngeq~≱~ngeqq~≧̸~ngeqslant~⩾̸~nges~⩾̸~ngsim~≵~ngt~≯~ngtr~≯~nhArr~⇎~nharr~↮~nhpar~⫲~nis~⋼~nisd~⋺~niv~∋~njcy~њ~nlArr~⇍~nlE~≦̸~nlarr~↚~nldr~‥~nle~≰~nleftarrow~↚~nleftrightarrow~↮~nleq~≰~nleqq~≦̸~nleqslant~⩽̸~nles~⩽̸~nless~≮~nlsim~≴~nlt~≮~nltri~⋪~nltrie~⋬~nmid~∤~nopf~𝕟~notinE~⋹̸~notindot~⋵̸~notinva~∉~notinvb~⋷~notinvc~⋶~notni~∌~notniva~∌~notnivb~⋾~notnivc~⋽~npar~∦~nparallel~∦~nparsl~⫽⃥~npart~∂̸~npolint~⨔~npr~⊀~nprcue~⋠~npre~⪯̸~nprec~⊀~npreceq~⪯̸~nrArr~⇏~nrarr~↛~nrarrc~⤳̸~nrarrw~↝̸~nrightarrow~↛~nrtri~⋫~nrtrie~⋭~nsc~⊁~nsccue~⋡~nsce~⪰̸~nscr~𝓃~nshortmid~∤~nshortparallel~∦~nsim~≁~nsime~≄~nsimeq~≄~nsmid~∤~nspar~∦~nsqsube~⋢~nsqsupe~⋣~nsubE~⫅̸~nsube~⊈~nsubset~⊂⃒~nsubseteq~⊈~nsubseteqq~⫅̸~nsucc~⊁~nsucceq~⪰̸~nsup~⊅~nsupE~⫆̸~nsupe~⊉~nsupset~⊃⃒~nsupseteq~⊉~nsupseteqq~⫆̸~ntgl~≹~ntlg~≸~ntriangleleft~⋪~ntrianglelefteq~⋬~ntriangleright~⋫~ntrianglerighteq~⋭~num~#~numero~№~numsp~ ~nvDash~⊭~nvHarr~⤄~nvap~≍⃒~nvdash~⊬~nvge~≥⃒~nvgt~>⃒~nvinfin~⧞~nvlArr~⤂~nvle~≤⃒~nvlt~<⃒~nvltrie~⊴⃒~nvrArr~⤃~nvrtrie~⊵⃒~nvsim~∼⃒~nwArr~⇖~nwarhk~⤣~nwarr~↖~nwarrow~↖~nwnear~⤧~oS~Ⓢ~oast~⊛~ocir~⊚~ocy~о~odash~⊝~odblac~ő~odiv~⨸~odot~⊙~odsold~⦼~ofcir~⦿~ofr~𝔬~ogon~˛~ogt~⧁~ohbar~⦵~ohm~Ω~oint~∮~olarr~↺~olcir~⦾~olcross~⦻~olt~⧀~omacr~ō~omid~⦶~ominus~⊖~oopf~𝕠~opar~⦷~operp~⦹~orarr~↻~ord~⩝~order~ℴ~orderof~ℴ~origof~⊶~oror~⩖~orslope~⩗~orv~⩛~oscr~ℴ~osol~⊘~otimesas~⨶~ovbar~⌽~par~∥~parallel~∥~parsim~⫳~parsl~⫽~pcy~п~percnt~%~period~.~pertenk~‱~pfr~𝔭~phiv~ϕ~phmmat~ℳ~phone~☎~pitchfork~⋔~planck~ℏ~planckh~ℎ~plankv~ℏ~plus~+~plusacir~⨣~plusb~⊞~pluscir~⨢~plusdo~∔~plusdu~⨥~pluse~⩲~plussim~⨦~plustwo~⨧~pm~±~pointint~⨕~popf~𝕡~pr~≺~prE~⪳~prap~⪷~prcue~≼~pre~⪯~prec~≺~precapprox~⪷~preccurlyeq~≼~preceq~⪯~precnapprox~⪹~precneqq~⪵~precnsim~⋨~precsim~≾~primes~ℙ~prnE~⪵~prnap~⪹~prnsim~⋨~profalar~⌮~profline~⌒~profsurf~⌓~propto~∝~prsim~≾~prurel~⊰~pscr~𝓅~puncsp~ ~qfr~𝔮~qint~⨌~qopf~𝕢~qprime~⁗~qscr~𝓆~quaternions~ℍ~quatint~⨖~quest~?~questeq~≟~rAarr~⇛~rAtail~⤜~rBarr~⤏~rHar~⥤~race~∽̱~racute~ŕ~raemptyv~⦳~rangd~⦒~range~⦥~rangle~⟩~rarrap~⥵~rarrb~⇥~rarrbfs~⤠~rarrc~⤳~rarrfs~⤞~rarrhk~↪~rarrlp~↬~rarrpl~⥅~rarrsim~⥴~rarrtl~↣~rarrw~↝~ratail~⤚~ratio~∶~rationals~ℚ~rbarr~⤍~rbbrk~❳~rbrace~}~rbrack~]~rbrke~⦌~rbrksld~⦎~rbrkslu~⦐~rcaron~ř~rcedil~ŗ~rcub~}~rcy~р~rdca~⤷~rdldhar~⥩~rdquor~”~rdsh~↳~realine~ℛ~realpart~ℜ~reals~ℝ~rect~▭~rfisht~⥽~rfr~𝔯~rhard~⇁~rharu~⇀~rharul~⥬~rhov~ϱ~rightarrow~→~rightarrowtail~↣~rightharpoondown~⇁~rightharpoonup~⇀~rightleftarrows~⇄~rightleftharpoons~⇌~rightrightarrows~⇉~rightsquigarrow~↝~rightthreetimes~⋌~ring~˚~risingdotseq~≓~rlarr~⇄~rlhar~⇌~rmoust~⎱~rmoustache~⎱~rnmid~⫮~roang~⟭~roarr~⇾~robrk~⟧~ropar~⦆~ropf~𝕣~roplus~⨮~rotimes~⨵~rpar~)~rpargt~⦔~rppolint~⨒~rrarr~⇉~rscr~𝓇~rsh~↱~rsqb~]~rsquor~’~rthree~⋌~rtimes~⋊~rtri~▹~rtrie~⊵~rtrif~▸~rtriltri~⧎~ruluhar~⥨~rx~℞~sacute~ś~sc~≻~scE~⪴~scap~⪸~sccue~≽~sce~⪰~scedil~ş~scirc~ŝ~scnE~⪶~scnap~⪺~scnsim~⋩~scpolint~⨓~scsim~≿~scy~с~sdotb~⊡~sdote~⩦~seArr~⇘~searhk~⤥~searr~↘~searrow~↘~semi~;~seswar~⤩~setminus~∖~setmn~∖~sext~✶~sfr~𝔰~sfrown~⌢~sharp~♯~shchcy~щ~shcy~ш~shortmid~∣~shortparallel~∥~sigmav~ς~simdot~⩪~sime~≃~simeq~≃~simg~⪞~simgE~⪠~siml~⪝~simlE~⪟~simne~≆~simplus~⨤~simrarr~⥲~slarr~←~smallsetminus~∖~smashp~⨳~smeparsl~⧤~smid~∣~smile~⌣~smt~⪪~smte~⪬~smtes~⪬︀~softcy~ь~sol~/~solb~⧄~solbar~⌿~sopf~𝕤~spadesuit~♠~spar~∥~sqcap~⊓~sqcaps~⊓︀~sqcup~⊔~sqcups~⊔︀~sqsub~⊏~sqsube~⊑~sqsubset~⊏~sqsubseteq~⊑~sqsup~⊐~sqsupe~⊒~sqsupset~⊐~sqsupseteq~⊒~squ~□~square~□~squarf~▪~squf~▪~srarr~→~sscr~𝓈~ssetmn~∖~ssmile~⌣~sstarf~⋆~star~☆~starf~★~straightepsilon~ϵ~straightphi~ϕ~strns~¯~subE~⫅~subdot~⪽~subedot~⫃~submult~⫁~subnE~⫋~subne~⊊~subplus~⪿~subrarr~⥹~subset~⊂~subseteq~⊆~subseteqq~⫅~subsetneq~⊊~subsetneqq~⫋~subsim~⫇~subsub~⫕~subsup~⫓~succ~≻~succapprox~⪸~succcurlyeq~≽~succeq~⪰~succnapprox~⪺~succneqq~⪶~succnsim~⋩~succsim~≿~sung~♪~supE~⫆~supdot~⪾~supdsub~⫘~supedot~⫄~suphsol~⟉~suphsub~⫗~suplarr~⥻~supmult~⫂~supnE~⫌~supne~⊋~supplus~⫀~supset~⊃~supseteq~⊇~supseteqq~⫆~supsetneq~⊋~supsetneqq~⫌~supsim~⫈~supsub~⫔~supsup~⫖~swArr~⇙~swarhk~⤦~swarr~↙~swarrow~↙~swnwar~⤪~target~⌖~tbrk~⎴~tcaron~ť~tcedil~ţ~tcy~т~tdot~⃛~telrec~⌕~tfr~𝔱~therefore~∴~thetav~ϑ~thickapprox~≈~thicksim~∼~thkap~≈~thksim~∼~timesb~⊠~timesbar~⨱~timesd~⨰~tint~∭~toea~⤨~top~⊤~topbot~⌶~topcir~⫱~topf~𝕥~topfork~⫚~tosa~⤩~tprime~‴~triangle~▵~triangledown~▿~triangleleft~◃~trianglelefteq~⊴~triangleq~≜~triangleright~▹~trianglerighteq~⊵~tridot~◬~trie~≜~triminus~⨺~triplus~⨹~trisb~⧍~tritime~⨻~trpezium~⏢~tscr~𝓉~tscy~ц~tshcy~ћ~tstrok~ŧ~twixt~≬~twoheadleftarrow~↞~twoheadrightarrow~↠~uHar~⥣~ubrcy~ў~ubreve~ŭ~ucy~у~udarr~⇅~udblac~ű~udhar~⥮~ufisht~⥾~ufr~𝔲~uharl~↿~uharr~↾~uhblk~▀~ulcorn~⌜~ulcorner~⌜~ulcrop~⌏~ultri~◸~umacr~ū~uogon~ų~uopf~𝕦~uparrow~↑~updownarrow~↕~upharpoonleft~↿~upharpoonright~↾~uplus~⊎~upsi~υ~upuparrows~⇈~urcorn~⌝~urcorner~⌝~urcrop~⌎~uring~ů~urtri~◹~uscr~𝓊~utdot~⋰~utilde~ũ~utri~▵~utrif~▴~uuarr~⇈~uwangle~⦧~vArr~⇕~vBar~⫨~vBarv~⫩~vDash~⊨~vangrt~⦜~varepsilon~ϵ~varkappa~ϰ~varnothing~∅~varphi~ϕ~varpi~ϖ~varpropto~∝~varr~↕~varrho~ϱ~varsigma~ς~varsubsetneq~⊊︀~varsubsetneqq~⫋︀~varsupsetneq~⊋︀~varsupsetneqq~⫌︀~vartheta~ϑ~vartriangleleft~⊲~vartriangleright~⊳~vcy~в~vdash~⊢~vee~∨~veebar~⊻~veeeq~≚~vellip~⋮~verbar~|~vert~|~vfr~𝔳~vltri~⊲~vnsub~⊂⃒~vnsup~⊃⃒~vopf~𝕧~vprop~∝~vrtri~⊳~vscr~𝓋~vsubnE~⫋︀~vsubne~⊊︀~vsupnE~⫌︀~vsupne~⊋︀~vzigzag~⦚~wcirc~ŵ~wedbar~⩟~wedge~∧~wedgeq~≙~wfr~𝔴~wopf~𝕨~wp~℘~wr~≀~wreath~≀~wscr~𝓌~xcap~⋂~xcirc~◯~xcup~⋃~xdtri~▽~xfr~𝔵~xhArr~⟺~xharr~⟷~xlArr~⟸~xlarr~⟵~xmap~⟼~xnis~⋻~xodot~⨀~xopf~𝕩~xoplus~⨁~xotime~⨂~xrArr~⟹~xrarr~⟶~xscr~𝓍~xsqcup~⨆~xuplus~⨄~xutri~△~xvee~⋁~xwedge~⋀~yacy~я~ycirc~ŷ~ycy~ы~yfr~𝔶~yicy~ї~yopf~𝕪~yscr~𝓎~yucy~ю~zacute~ź~zcaron~ž~zcy~з~zdot~ż~zeetrf~ℨ~zfr~𝔷~zhcy~ж~zigrarr~⇝~zopf~𝕫~zscr~𝓏~~AMP~&~COPY~©~GT~>~LT~<~QUOT~"~REG~®',gh.html4);var wh={0:65533,128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376},yh=String.fromCodePoint||function(e){return String.fromCharCode(Math.floor((e-65536)/1024)+55296,(e-65536)%1024+56320)},bh=(String.prototype.codePointAt,function(){return bh=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},bh.apply(this,arguments)}),vh=bh(bh({},gh),{all:gh.html5}),xh={scope:"body",level:"all"},_h=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+);/g,Eh=/&(?:#\d+|#[xX][\da-fA-F]+|[0-9a-zA-Z]+)[;=]?/g,Nh={xml:{strict:_h,attribute:Eh,body:hh.xml},html4:{strict:_h,attribute:Eh,body:hh.html4},html5:{strict:_h,attribute:Eh,body:hh.html5}},Mh=bh(bh({},Nh),{all:Nh.html5}),Ih=String.fromCharCode,Sh=Ih(65533);function kh(e,t){var n=void 0===t?xh:t,r=n.level,a=void 0===r?"all":r,o=n.scope,i=void 0===o?"xml"===a?"strict":"body":o;if(!e)return"";var s=Mh[a][i],l=vh[a].entities,c="attribute"===i,u="strict"===i;return e.replace(s,function(e){return function(e,t,n,r){var a=e,o=e[e.length-1];if(n&&"="===o)a=e;else if(r&&";"!==o)a=e;else{var i=t[e];if(i)a=i;else if("&"===e[0]&&"#"===e[1]){var s=e[2],l="x"==s||"X"==s?parseInt(e.substr(3),16):parseInt(e.substr(2));a=l>=1114111?Sh:l>65535?yh(l):Ih(wh[l]||l)}}return a}(e,l,c,u)})}function jh(e,t){return"yes"===t&&["checkout","thankyou","upsell","downsell"].includes(e)}function Dh(){return(0,o.createElement)("div",null,(0,o.createElement)("span",{className:"wcf-tooltip-heading text-xs font-semibold mb-1 block"},(0,z.__)("Step Editing is Disabled","cartflows")),(0,o.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")))}function Ch(e,t,n){return kh(e.length>t?e.substring(0,n)+"...":e)}cartflows_admin.admin_base_slug,cartflows_admin.admin_base_url;const Ah=new function(){const e=this;this.compare=function(e,t,n){switch(n){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<t;case"<=":return e<=t;case">":return e>t;case">=":return e>=t;default:return e===t}},this.check=function(t,n){const r="or"===t.relation;let a=!r;return!Array.isArray(t?.fields)||(t.fields.map(function(t){let o;return o=t.fields?e.check(t,n):e.compare(n[t.name],t.value,t.operator),r?(o&&(a=!0),!o):o?"":a=!1}),a)},this.isActiveControl=function(t,n){const r=!!t?.conditions&&t?.conditions;return!(r&&!e.check(r,n))}};function Th(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}var Oh=a(7350),Lh=a.n(Oh),zh=a(5015),Ph=a.n(zh),Rh=a(1741),Uh=a.n(Rh),Bh=a(8156),Fh=a.n(Bh),Yh=a(8023),Qh=a.n(Yh),Vh=a(9843),Wh=a.n(Vh),Zh=function(e){return 0===e?0:e>0?1:-1},Gh=function(e){return Ph()(e)&&e.indexOf("%")===e.length-1},Hh=function(e){return Qh()(e)&&!Uh()(e)},$h=function(e){return Hh(e)||Ph()(e)},Xh=0,qh=function(e){var t=++Xh;return"".concat(e||"").concat(t)},Jh=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!Hh(e)&&!Ph()(e))return r;if(Gh(e)){var o=e.indexOf("%");n=t*parseFloat(e.slice(0,o))/100}else n=+e;return Uh()(n)&&(n=r),a&&n>t&&(n=t),n},Kh=function(e){if(!e)return null;var t=Object.keys(e);return t&&t.length?e[t[0]]:null},eg=function(e,t){return Hh(e)&&Hh(t)?function(n){return e+n*(t-e)}:function(){return t}};function tg(e,t,n){return e&&e.length?e.find(function(e){return e&&("function"==typeof t?t(e):Fh()(e,t))===n}):null}var ng=function(e,t){return Hh(e)&&Hh(t)?e-t:Ph()(e)&&Ph()(t)?e.localeCompare(t):e instanceof Date&&t instanceof Date?e.getTime()-t.getTime():String(e).localeCompare(String(t))},rg=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a]},ag=a(1882),og=a.n(ag),ig=a(3805),sg=a.n(ig),lg=a(4580);function cg(e,t){for(var n in e)if({}.hasOwnProperty.call(e,n)&&(!{}.hasOwnProperty.call(t,n)||e[n]!==t[n]))return!1;for(var r in t)if({}.hasOwnProperty.call(t,r)&&!{}.hasOwnProperty.call(e,r))return!1;return!0}function ug(e){return ug="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ug(e)}var dg=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],fg=["points","pathLength"],mg={svg:["viewBox","children"],polygon:fg,polyline:fg},pg=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],hg=function(e,t){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var n=e;if((0,i.isValidElement)(e)&&(n=e.props),!sg()(n))return null;var r={};return Object.keys(n).forEach(function(e){pg.includes(e)&&(r[e]=t||function(t){return n[e](n,t)})}),r},gg=function(e,t,n){if(!sg()(e)||"object"!==ug(e))return null;var r=null;return Object.keys(e).forEach(function(a){var o=e[a];pg.includes(a)&&"function"==typeof o&&(r||(r={}),r[a]=function(e,t,n){return function(r){return e(t,n,r),null}}(o,t,n))}),r},wg=["children"],yg=["children"];function bg(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function vg(e){return vg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vg(e)}var xg={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},_g=function(e){return"string"==typeof e?e:e?e.displayName||e.name||"Component":""},Eg=null,Ng=null,Mg=function e(t){if(t===Eg&&Array.isArray(Ng))return Ng;var n=[];return i.Children.forEach(t,function(t){Wh()(t)||((0,lg.isFragment)(t)?n=n.concat(e(t.props.children)):n.push(t))}),Ng=n,Eg=t,n};function Ig(e,t){var n=[],r=[];return r=Array.isArray(t)?t.map(function(e){return _g(e)}):[_g(t)],Mg(e).forEach(function(e){var t=Fh()(e,"type.displayName")||Fh()(e,"type.name");-1!==r.indexOf(t)&&n.push(e)}),n}function Sg(e,t){var n=Ig(e,t);return n&&n[0]}var kg=function(e){if(!e||!e.props)return!1;var t=e.props,n=t.width,r=t.height;return!(!Hh(n)||n<=0||!Hh(r)||r<=0)},jg=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],Dg=function(e,t,n){if(!e||"function"==typeof e||"boolean"==typeof e)return null;var r=e;if((0,i.isValidElement)(e)&&(r=e.props),!sg()(r))return null;var a={};return Object.keys(r).forEach(function(e){var o;(function(e,t,n,r){var a,o=null!==(a=null==mg?void 0:mg[r])&&void 0!==a?a:[];return t.startsWith("data-")||!og()(e)&&(r&&o.includes(t)||dg.includes(t))||n&&pg.includes(t)})(null===(o=r)||void 0===o?void 0:o[e],e,t,n)&&(a[e]=r[e])}),a},Cg=function e(t,n){if(t===n)return!0;var r=i.Children.count(t);if(r!==i.Children.count(n))return!1;if(0===r)return!0;if(1===r)return Ag(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a<r;a++){var o=t[a],s=n[a];if(Array.isArray(o)||Array.isArray(s)){if(!e(o,s))return!1}else if(!Ag(o,s))return!1}return!0},Ag=function(e,t){if(Wh()(e)&&Wh()(t))return!0;if(!Wh()(e)&&!Wh()(t)){var n=e.props||{},r=n.children,a=bg(n,wg),o=t.props||{},i=o.children,s=bg(o,yg);return r&&i?cg(a,s)&&Cg(r,i):!r&&!i&&cg(a,s)}return!1},Tg=function(e,t){var n=[],r={};return Mg(e).forEach(function(e,a){if(function(e){return e&&e.type&&Ph()(e.type)&&jg.indexOf(e.type)>=0}(e))n.push(e);else if(e){var o=_g(e.type),i=t[o]||{},s=i.handler,l=i.once;if(s&&(!l||!r[o])){var c=s(e,o,a);n.push(c),r[o]=!0}}}),n},Og=function(e,t){return Mg(t).indexOf(e)};function Lg(e){return Lg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lg(e)}function zg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pg(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zg(Object(n),!0).forEach(function(t){Rg(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zg(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Rg(e,t,n){return t=function(e){var t=function(e){if("object"!=Lg(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Lg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Lg(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ug(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Bg=(0,i.forwardRef)(function(e,t){var n=e.aspect,r=e.initialDimension,a=void 0===r?{width:-1,height:-1}:r,o=e.width,s=void 0===o?"100%":o,c=e.height,u=void 0===c?"100%":c,d=e.minWidth,f=void 0===d?0:d,m=e.minHeight,p=e.maxHeight,h=e.children,g=e.debounce,w=void 0===g?0:g,y=e.id,b=e.className,v=e.onResize,x=e.style,_=void 0===x?{}:x,E=(0,i.useRef)(null),N=(0,i.useRef)();N.current=v,(0,i.useImperativeHandle)(t,function(){return Object.defineProperty(E.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),E.current},configurable:!0})});var M=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ug(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ug(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,i.useState)({containerWidth:a.width,containerHeight:a.height}),2),I=M[0],S=M[1],k=(0,i.useCallback)(function(e,t){S(function(n){var r=Math.round(e),a=Math.round(t);return n.containerWidth===r&&n.containerHeight===a?n:{containerWidth:r,containerHeight:a}})},[]);(0,i.useEffect)(function(){var e=function(e){var t,n=e[0].contentRect,r=n.width,a=n.height;k(r,a),null===(t=N.current)||void 0===t||t.call(N,r,a)};w>0&&(e=Lh()(e,w,{trailing:!0,leading:!1}));var t=new ResizeObserver(e),n=E.current.getBoundingClientRect(),r=n.width,a=n.height;return k(r,a),t.observe(E.current),function(){t.disconnect()}},[k,w]);var j=(0,i.useMemo)(function(){var e=I.containerWidth,t=I.containerHeight;if(e<0||t<0)return null;rg(Gh(s)||Gh(u),"The width(%s) and height(%s) are both fixed numbers,\n maybe you don't need to use a ResponsiveContainer.",s,u),rg(!n||n>0,"The aspect(%s) must be greater than zero.",n);var r=Gh(s)?e:s,a=Gh(u)?t:u;n&&n>0&&(r?a=r/n:a&&(r=a*n),p&&a>p&&(a=p)),rg(r>0||a>0,"The width(%s) and height(%s) of chart should be greater than 0,\n please check the style of container, or the props width(%s) and height(%s),\n or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the\n height and width.",r,a,s,u,f,m,n);var o=!Array.isArray(h)&&_g(h.type).endsWith("Chart");return l().Children.map(h,function(e){return l().isValidElement(e)?(0,i.cloneElement)(e,Pg({width:r,height:a},o?{style:Pg({height:"100%",width:"100%",maxHeight:a,maxWidth:r},e.props.style)}:{})):e})},[n,h,u,p,m,f,I,s]);return l().createElement("div",{id:y?"".concat(y):void 0,className:Te("recharts-responsive-container",b),style:Pg(Pg({},_),{},{width:s,height:u,minWidth:f,minHeight:m,maxHeight:p}),ref:E},j)}),Fg=a(3181),Yg=a.n(Fg),Qg=a(3031),Vg=a.n(Qg),Wg=["children","width","height","viewBox","className","style","title","desc"];function Zg(){return Zg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zg.apply(this,arguments)}function Gg(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,o=e.className,i=e.style,s=e.title,c=e.desc,u=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,Wg),d=a||{width:n,height:r,x:0,y:0},f=Te("recharts-surface",o);return l().createElement("svg",Zg({},Dg(u,!0,"svg"),{className:f,width:n,height:r,style:i,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),l().createElement("title",null,s),l().createElement("desc",null,c),t)}var Hg=["children","className"];function $g(){return $g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$g.apply(this,arguments)}var Xg=l().forwardRef(function(e,t){var n=e.children,r=e.className,a=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,Hg),o=Te("recharts-layer",r);return l().createElement("g",$g({className:o},Dg(a,!0),{ref:t}),n)});function qg(e){return qg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qg(e)}function Jg(){return Jg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Jg.apply(this,arguments)}function Kg(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ew(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function tw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ew(Object(n),!0).forEach(function(t){nw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ew(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function nw(e,t,n){return t=function(e){var t=function(e){if("object"!=qg(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=qg(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==qg(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rw(e){return Array.isArray(e)&&$h(e[0])&&$h(e[1])?e.join(" ~ "):e}var aw=function(e){var t=e.separator,n=void 0===t?" : ":t,r=e.contentStyle,a=void 0===r?{}:r,o=e.itemStyle,i=void 0===o?{}:o,s=e.labelStyle,c=void 0===s?{}:s,u=e.payload,d=e.formatter,f=e.itemSorter,m=e.wrapperClassName,p=e.labelClassName,h=e.label,g=e.labelFormatter,w=e.accessibilityLayer,y=void 0!==w&&w,b=tw({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},a),v=tw({margin:0},c),x=!Wh()(h),_=x?h:"",E=Te("recharts-default-tooltip",m),N=Te("recharts-tooltip-label",p);x&&g&&null!=u&&(_=g(h,u));var M=y?{role:"status","aria-live":"assertive"}:{};return l().createElement("div",Jg({className:E,style:b},M),l().createElement("p",{className:N,style:v},l().isValidElement(_)?_:"".concat(_)),function(){if(u&&u.length){var e=(f?Vg()(u,f):u).map(function(e,t){if("none"===e.type)return null;var r=tw({display:"block",paddingTop:4,paddingBottom:4,color:e.color||"#000"},i),a=e.formatter||d||rw,o=e.value,s=e.name,c=o,f=s;if(a&&null!=c&&null!=f){var m=a(o,s,e,t,u);if(Array.isArray(m)){var p=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Kg(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Kg(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(m,2);c=p[0],f=p[1]}else c=m}return l().createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(t),style:r},$h(f)?l().createElement("span",{className:"recharts-tooltip-item-name"},f):null,$h(f)?l().createElement("span",{className:"recharts-tooltip-item-separator"},n):null,l().createElement("span",{className:"recharts-tooltip-item-value"},c),l().createElement("span",{className:"recharts-tooltip-item-unit"},e.unit||""))});return l().createElement("ul",{className:"recharts-tooltip-item-list",style:{padding:0,margin:0}},e)}return null}())};function ow(e){return ow="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ow(e)}function iw(e,t,n){return t=function(e){var t=function(e){if("object"!=ow(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ow(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ow(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var sw="recharts-tooltip-wrapper",lw={visibility:"hidden"};function cw(e){var t=e.coordinate,n=e.translateX,r=e.translateY;return Te(sw,iw(iw(iw(iw({},"".concat(sw,"-right"),Hh(n)&&t&&Hh(t.x)&&n>=t.x),"".concat(sw,"-left"),Hh(n)&&t&&Hh(t.x)&&n<t.x),"".concat(sw,"-bottom"),Hh(r)&&t&&Hh(t.y)&&r>=t.y),"".concat(sw,"-top"),Hh(r)&&t&&Hh(t.y)&&r<t.y))}function uw(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.key,a=e.offsetTopLeft,o=e.position,i=e.reverseDirection,s=e.tooltipDimension,l=e.viewBox,c=e.viewBoxDimension;if(o&&Hh(o[r]))return o[r];var u=n[r]-s-a,d=n[r]+a;return t[r]?i[r]?u:d:i[r]?u<l[r]?Math.max(d,l[r]):Math.max(u,l[r]):d+s>l[r]+c?Math.max(u,l[r]):Math.max(d,l[r])}function dw(e){return dw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dw(e)}function fw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fw(Object(n),!0).forEach(function(t){yw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,bw(r.key),r)}}function hw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(hw=function(){return!!e})()}function gw(e){return gw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},gw(e)}function ww(e,t){return ww=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ww(e,t)}function yw(e,t,n){return(t=bw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function bw(e){var t=function(e){if("object"!=dw(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=dw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==dw(t)?t:t+""}var vw=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return yw(e=function(e,t,n){return t=gw(t),function(e,t){if(t&&("object"===dw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,hw()?Reflect.construct(t,n||[],gw(e).constructor):t.apply(e,n))}(this,t,[].concat(r)),"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),yw(e,"handleKeyDown",function(t){var n,r,a,o;"Escape"===t.key&&e.setState({dismissed:!0,dismissedAtCoordinate:{x:null!==(n=null===(r=e.props.coordinate)||void 0===r?void 0:r.x)&&void 0!==n?n:0,y:null!==(a=null===(o=e.props.coordinate)||void 0===o?void 0:o.y)&&void 0!==a?a:0}})}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ww(e,t)}(t,e),n=t,r=[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();(Math.abs(e.width-this.state.lastBoundingBox.width)>1||Math.abs(e.height-this.state.lastBoundingBox.height)>1)&&this.setState({lastBoundingBox:{width:e.width,height:e.height}})}else-1===this.state.lastBoundingBox.width&&-1===this.state.lastBoundingBox.height||this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var e,t;this.props.active&&this.updateBBox(),this.state.dismissed&&((null===(e=this.props.coordinate)||void 0===e?void 0:e.x)===this.state.dismissedAtCoordinate.x&&(null===(t=this.props.coordinate)||void 0===t?void 0:t.y)===this.state.dismissedAtCoordinate.y||(this.state.dismissed=!1))}},{key:"render",value:function(){var e=this,t=this.props,n=t.active,r=t.allowEscapeViewBox,a=t.animationDuration,o=t.animationEasing,i=t.children,s=t.coordinate,c=t.hasPayload,u=t.isAnimationActive,d=t.offset,f=t.position,m=t.reverseDirection,p=t.useTranslate3d,h=t.viewBox,g=t.wrapperStyle,w=function(e){var t,n,r=e.allowEscapeViewBox,a=e.coordinate,o=e.offsetTopLeft,i=e.position,s=e.reverseDirection,l=e.tooltipBox,c=e.useTranslate3d,u=e.viewBox;return{cssProperties:l.height>0&&l.width>0&&a?function(e){var t=e.translateX,n=e.translateY;return{transform:e.useTranslate3d?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}({translateX:t=uw({allowEscapeViewBox:r,coordinate:a,key:"x",offsetTopLeft:o,position:i,reverseDirection:s,tooltipDimension:l.width,viewBox:u,viewBoxDimension:u.width}),translateY:n=uw({allowEscapeViewBox:r,coordinate:a,key:"y",offsetTopLeft:o,position:i,reverseDirection:s,tooltipDimension:l.height,viewBox:u,viewBoxDimension:u.height}),useTranslate3d:c}):lw,cssClasses:cw({translateX:t,translateY:n,coordinate:a})}}({allowEscapeViewBox:r,coordinate:s,offsetTopLeft:d,position:f,reverseDirection:m,tooltipBox:this.state.lastBoundingBox,useTranslate3d:p,viewBox:h}),y=w.cssClasses,b=w.cssProperties,v=mw(mw({transition:u&&n?"transform ".concat(a,"ms ").concat(o):void 0},b),{},{pointerEvents:"none",visibility:!this.state.dismissed&&n&&c?"visible":"hidden",position:"absolute",top:0,left:0},g);return l().createElement("div",{tabIndex:-1,className:y,style:v,ref:function(t){e.wrapperNode=t}},i)}}],r&&pw(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.PureComponent),xw={isSsr:!("undefined"!=typeof window&&window.document&&window.document.createElement&&window.setTimeout),get:function(e){return xw[e]},set:function(e,t){if("string"==typeof e)xw[e]=t;else{var n=Object.keys(e);n&&n.length&&n.forEach(function(t){xw[t]=e[t]})}}},_w=a(14),Ew=a.n(_w);function Nw(e,t,n){return!0===t?Ew()(e,n):og()(t)?Ew()(e,t):e}function Mw(e){return Mw="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mw(e)}function Iw(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Sw(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Iw(Object(n),!0).forEach(function(t){Aw(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Iw(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kw(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Tw(r.key),r)}}function jw(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(jw=function(){return!!e})()}function Dw(e){return Dw=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Dw(e)}function Cw(e,t){return Cw=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Cw(e,t)}function Aw(e,t,n){return(t=Tw(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tw(e){var t=function(e){if("object"!=Mw(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Mw(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Mw(t)?t:t+""}function Ow(e){return e.dataKey}var Lw=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=Dw(t),function(e,t){if(t&&("object"===Mw(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,jw()?Reflect.construct(t,n||[],Dw(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cw(e,t)}(t,e),n=t,r=[{key:"render",value:function(){var e=this,t=this.props,n=t.active,r=t.allowEscapeViewBox,a=t.animationDuration,o=t.animationEasing,i=t.content,s=t.coordinate,c=t.filterNull,u=t.isAnimationActive,d=t.offset,f=t.payload,m=t.payloadUniqBy,p=t.position,h=t.reverseDirection,g=t.useTranslate3d,w=t.viewBox,y=t.wrapperStyle,b=null!=f?f:[];c&&b.length&&(b=Nw(f.filter(function(t){return null!=t.value&&(!0!==t.hide||e.props.includeHidden)}),m,Ow));var v=b.length>0;return l().createElement(vw,{allowEscapeViewBox:r,animationDuration:a,animationEasing:o,isAnimationActive:u,active:n,coordinate:s,hasPayload:v,offset:d,position:p,reverseDirection:h,useTranslate3d:g,viewBox:w,wrapperStyle:y},function(e,t){return l().isValidElement(e)?l().cloneElement(e,t):"function"==typeof e?l().createElement(e,t):l().createElement(aw,t)}(i,Sw(Sw({},this.props),{},{payload:b})))}}],r&&kw(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.PureComponent);Aw(Lw,"displayName","Tooltip"),Aw(Lw,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!xw.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var zw=a(5808),Pw=a.n(zw);Math.abs,Math.atan2;const Rw=Math.cos,Uw=(Math.max,Math.min,Math.sin),Bw=Math.sqrt,Fw=Math.PI,Yw=2*Fw,Qw={draw(e,t){const n=Bw(t/Fw);e.moveTo(n,0),e.arc(0,0,n,0,Yw)}},Vw={draw(e,t){const n=Bw(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},Ww=Bw(1/3),Zw=2*Ww,Gw={draw(e,t){const n=Bw(t/Zw),r=n*Ww;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},Hw={draw(e,t){const n=Bw(t),r=-n/2;e.rect(r,r,n,n)}},$w=Uw(Fw/10)/Uw(7*Fw/10),Xw=Uw(Yw/10)*$w,qw=-Rw(Yw/10)*$w,Jw={draw(e,t){const n=Bw(.8908130915292852*t),r=Xw*n,a=qw*n;e.moveTo(0,-n),e.lineTo(r,a);for(let t=1;t<5;++t){const o=Yw*t/5,i=Rw(o),s=Uw(o);e.lineTo(s*n,-i*n),e.lineTo(i*r-s*a,s*r+i*a)}e.closePath()}},Kw=Bw(3),ey={draw(e,t){const n=-Bw(t/(3*Kw));e.moveTo(0,2*n),e.lineTo(-Kw*n,-n),e.lineTo(Kw*n,-n),e.closePath()}},ty=-.5,ny=Bw(3)/2,ry=1/Bw(12),ay=3*(ry/2+1),oy={draw(e,t){const n=Bw(t/ay),r=n/2,a=n*ry,o=r,i=n*ry+n,s=-o,l=i;e.moveTo(r,a),e.lineTo(o,i),e.lineTo(s,l),e.lineTo(ty*r-ny*a,ny*r+ty*a),e.lineTo(ty*o-ny*i,ny*o+ty*i),e.lineTo(ty*s-ny*l,ny*s+ty*l),e.lineTo(ty*r+ny*a,ty*a-ny*r),e.lineTo(ty*o+ny*i,ty*i-ny*o),e.lineTo(ty*s+ny*l,ty*l-ny*s),e.closePath()}};function iy(e){return function(){return e}}const sy=Math.PI,ly=2*sy,cy=1e-6,uy=ly-cy;function dy(e){this._+=e[0];for(let t=1,n=e.length;t<n;++t)this._+=arguments[t]+e[t]}class fy{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=null==e?dy:function(e){let t=Math.floor(e);if(!(t>=0))throw new Error(`invalid digits: ${e}`);if(t>15)return dy;const n=10**t;return function(e){this._+=e[0];for(let t=1,r=e.length;t<r;++t)this._+=Math.round(arguments[t]*n)/n+e[t]}}(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,n,r){this._append`Q${+e},${+t},${this._x1=+n},${this._y1=+r}`}bezierCurveTo(e,t,n,r,a,o){this._append`C${+e},${+t},${+n},${+r},${this._x1=+a},${this._y1=+o}`}arcTo(e,t,n,r,a){if(e=+e,t=+t,n=+n,r=+r,(a=+a)<0)throw new Error(`negative radius: ${a}`);let o=this._x1,i=this._y1,s=n-e,l=r-t,c=o-e,u=i-t,d=c*c+u*u;if(null===this._x1)this._append`M${this._x1=e},${this._y1=t}`;else if(d>cy)if(Math.abs(u*s-l*c)>cy&&a){let f=n-o,m=r-i,p=s*s+l*l,h=f*f+m*m,g=Math.sqrt(p),w=Math.sqrt(d),y=a*Math.tan((sy-Math.acos((p+d-h)/(2*g*w)))/2),b=y/w,v=y/g;Math.abs(b-1)>cy&&this._append`L${e+b*c},${t+b*u}`,this._append`A${a},${a},0,0,${+(u*f>c*m)},${this._x1=e+v*s},${this._y1=t+v*l}`}else this._append`L${this._x1=e},${this._y1=t}`}arc(e,t,n,r,a,o){if(e=+e,t=+t,o=!!o,(n=+n)<0)throw new Error(`negative radius: ${n}`);let i=n*Math.cos(r),s=n*Math.sin(r),l=e+i,c=t+s,u=1^o,d=o?r-a:a-r;null===this._x1?this._append`M${l},${c}`:(Math.abs(this._x1-l)>cy||Math.abs(this._y1-c)>cy)&&this._append`L${l},${c}`,n&&(d<0&&(d=d%ly+ly),d>uy?this._append`A${n},${n},0,1,${u},${e-i},${t-s}A${n},${n},0,1,${u},${this._x1=l},${this._y1=c}`:d>cy&&this._append`A${n},${n},0,${+(d>=sy)},${u},${this._x1=e+n*Math.cos(a)},${this._y1=t+n*Math.sin(a)}`)}rect(e,t,n,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function my(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(null==n)t=null;else{const e=Math.floor(n);if(!(e>=0))throw new RangeError(`invalid digits: ${n}`);t=e}return e},()=>new fy(t)}function py(e){return py="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},py(e)}Bw(3),Bw(3);var hy=["type","size","sizeType"];function gy(){return gy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gy.apply(this,arguments)}function wy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yy(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wy(Object(n),!0).forEach(function(t){by(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wy(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function by(e,t,n){return t=function(e){var t=function(e){if("object"!=py(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=py(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==py(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var vy={symbolCircle:Qw,symbolCross:Vw,symbolDiamond:Gw,symbolSquare:Hw,symbolStar:Jw,symbolTriangle:ey,symbolWye:oy},xy=Math.PI/180,_y=function(e){var t,n,r=e.type,a=void 0===r?"circle":r,o=e.size,i=void 0===o?64:o,s=e.sizeType,c=void 0===s?"area":s,u=yy(yy({},function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,hy)),{},{type:a,size:i,sizeType:c}),d=u.className,f=u.cx,m=u.cy,p=Dg(u,!0);return f===+f&&m===+m&&i===+i?l().createElement("path",gy({},p,{className:Te("recharts-symbols",d),transform:"translate(".concat(f,", ").concat(m,")"),d:(t=function(e){var t="symbol".concat(Pw()(e));return vy[t]||Qw}(a),n=function(e,t){let n=null,r=my(a);function a(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return e="function"==typeof e?e:iy(e||Qw),t="function"==typeof t?t:iy(void 0===t?64:+t),a.type=function(t){return arguments.length?(e="function"==typeof t?t:iy(t),a):e},a.size=function(e){return arguments.length?(t="function"==typeof e?e:iy(+e),a):t},a.context=function(e){return arguments.length?(n=null==e?null:e,a):n},a}().type(t).size(function(e,t,n){if("area"===t)return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return.5*e*e/Math.sqrt(3);case"square":return e*e;case"star":var r=18*xy;return 1.25*e*e*(Math.tan(r)-Math.tan(2*r)*Math.pow(Math.tan(r),2));case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}}(i,c,a)),n())})):null};function Ey(e){return Ey="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ey(e)}function Ny(){return Ny=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ny.apply(this,arguments)}function My(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Iy(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Cy(r.key),r)}}function Sy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Sy=function(){return!!e})()}function ky(e){return ky=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ky(e)}function jy(e,t){return jy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jy(e,t)}function Dy(e,t,n){return(t=Cy(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cy(e){var t=function(e){if("object"!=Ey(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ey(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ey(t)?t:t+""}_y.registerSymbol=function(e,t){vy["symbol".concat(Pw()(e))]=t};var Ay=32,Ty=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=ky(t),function(e,t){if(t&&("object"===Ey(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Sy()?Reflect.construct(t,n||[],ky(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jy(e,t)}(t,e),n=t,r=[{key:"renderIcon",value:function(e){var t=this.props.inactiveColor,n=16,r=Ay/6,a=Ay/3,o=e.inactive?t:e.color;if("plainline"===e.type)return l().createElement("line",{strokeWidth:4,fill:"none",stroke:o,strokeDasharray:e.payload.strokeDasharray,x1:0,y1:n,x2:Ay,y2:n,className:"recharts-legend-icon"});if("line"===e.type)return l().createElement("path",{strokeWidth:4,fill:"none",stroke:o,d:"M0,".concat(n,"h").concat(a,"\n A").concat(r,",").concat(r,",0,1,1,").concat(2*a,",").concat(n,"\n H").concat(Ay,"M").concat(2*a,",").concat(n,"\n A").concat(r,",").concat(r,",0,1,1,").concat(a,",").concat(n),className:"recharts-legend-icon"});if("rect"===e.type)return l().createElement("path",{stroke:"none",fill:o,d:"M0,".concat(4,"h").concat(Ay,"v").concat(24,"h").concat(-32,"z"),className:"recharts-legend-icon"});if(l().isValidElement(e.legendIcon)){var i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?My(Object(n),!0).forEach(function(t){Dy(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):My(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},e);return delete i.legendIcon,l().cloneElement(e.legendIcon,i)}return l().createElement(_y,{fill:o,cx:n,cy:n,size:Ay,sizeType:"diameter",type:e.type})}},{key:"renderItems",value:function(){var e=this,t=this.props,n=t.payload,r=t.iconSize,a=t.layout,o=t.formatter,i=t.inactiveColor,s={x:0,y:0,width:Ay,height:Ay},c={display:"horizontal"===a?"inline-block":"block",marginRight:10},u={display:"inline-block",verticalAlign:"middle",marginRight:4};return n.map(function(t,n){var a=t.formatter||o,d=Te(Dy(Dy({"recharts-legend-item":!0},"legend-item-".concat(n),!0),"inactive",t.inactive));if("none"===t.type)return null;var f=og()(t.value)?null:t.value;rg(!og()(t.value),'The name property is also required when using a function for the dataKey of a chart\'s cartesian components. Ex: <Bar name="Name of my Data"/>');var m=t.inactive?i:t.color;return l().createElement("li",Ny({className:d,style:c,key:"legend-item-".concat(n)},gg(e.props,t,n)),l().createElement(Gg,{width:r,height:r,viewBox:s,style:u},e.renderIcon(t)),l().createElement("span",{className:"recharts-legend-item-text",style:{color:m}},a?a(f,t,n):f))})}},{key:"render",value:function(){var e=this.props,t=e.payload,n=e.layout,r=e.align;if(!t||!t.length)return null;var a={padding:0,margin:0,textAlign:"horizontal"===n?r:"left"};return l().createElement("ul",{className:"recharts-default-legend",style:a},this.renderItems())}}],r&&Iy(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.PureComponent);function Oy(e){return Oy="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oy(e)}Dy(Ty,"displayName","Legend"),Dy(Ty,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var Ly=["ref"];function zy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Py(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zy(Object(n),!0).forEach(function(t){Yy(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zy(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ry(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Qy(r.key),r)}}function Uy(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Uy=function(){return!!e})()}function By(e){return By=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},By(e)}function Fy(e,t){return Fy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Fy(e,t)}function Yy(e,t,n){return(t=Qy(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qy(e){var t=function(e){if("object"!=Oy(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Oy(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Oy(t)?t:t+""}function Vy(e){return e.value}var Wy=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Yy(e=function(e,t,n){return t=By(t),function(e,t){if(t&&("object"===Oy(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Uy()?Reflect.construct(t,n||[],By(e).constructor):t.apply(e,n))}(this,t,[].concat(r)),"lastBoundingBox",{width:-1,height:-1}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fy(e,t)}(t,e),n=t,r=[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var e=this.wrapperNode.getBoundingClientRect();return e.height=this.wrapperNode.offsetHeight,e.width=this.wrapperNode.offsetWidth,e}return null}},{key:"updateBBox",value:function(){var e=this.props.onBBoxUpdate,t=this.getBBox();t?(Math.abs(t.width-this.lastBoundingBox.width)>1||Math.abs(t.height-this.lastBoundingBox.height)>1)&&(this.lastBoundingBox.width=t.width,this.lastBoundingBox.height=t.height,e&&e(t)):-1===this.lastBoundingBox.width&&-1===this.lastBoundingBox.height||(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,e&&e(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?Py({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(e){var t,n,r=this.props,a=r.layout,o=r.align,i=r.verticalAlign,s=r.margin,l=r.chartWidth,c=r.chartHeight;return e&&(void 0!==e.left&&null!==e.left||void 0!==e.right&&null!==e.right)||(t="center"===o&&"vertical"===a?{left:((l||0)-this.getBBoxSnapshot().width)/2}:"right"===o?{right:s&&s.right||0}:{left:s&&s.left||0}),e&&(void 0!==e.top&&null!==e.top||void 0!==e.bottom&&null!==e.bottom)||(n="middle"===i?{top:((c||0)-this.getBBoxSnapshot().height)/2}:"bottom"===i?{bottom:s&&s.bottom||0}:{top:s&&s.top||0}),Py(Py({},t),n)}},{key:"render",value:function(){var e=this,t=this.props,n=t.content,r=t.width,a=t.height,o=t.wrapperStyle,i=t.payloadUniqBy,s=t.payload,c=Py(Py({position:"absolute",width:r||"auto",height:a||"auto"},this.getDefaultPosition(o)),o);return l().createElement("div",{className:"recharts-legend-wrapper",style:c,ref:function(t){e.wrapperNode=t}},function(e,t){if(l().isValidElement(e))return l().cloneElement(e,t);if("function"==typeof e)return l().createElement(e,t);t.ref;var n=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,Ly);return l().createElement(Ty,n)}(n,Py(Py({},this.props),{},{payload:Nw(s,i,Vy)})))}}],a=[{key:"getWithHeight",value:function(e,t){var n=Py(Py({},this.defaultProps),e.props).layout;return"vertical"===n&&Hh(e.props.height)?{height:e.props.height}:"horizontal"===n?{width:e.props.width||t}:null}}],r&&Ry(n.prototype,r),a&&Ry(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,a}(i.PureComponent);function Zy(){return Zy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zy.apply(this,arguments)}Yy(Wy,"displayName","Legend"),Yy(Wy,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Gy=function(e){var t=e.cx,n=e.cy,r=e.r,a=e.className,o=Te("recharts-dot",a);return t===+t&&n===+n&&r===+r?i.createElement("circle",Zy({},Dg(e,!1),hg(e),{className:o,cx:t,cy:n,r})):null},Hy=a(5556),$y=a.n(Hy);const{getOwnPropertyNames:Xy,getOwnPropertySymbols:qy}=Object,{hasOwnProperty:Jy}=Object.prototype;function Ky(e,t){return function(n,r,a){return e(n,r,a)&&t(n,r,a)}}function eb(e){return function(t,n,r){if(!t||!n||"object"!=typeof t||"object"!=typeof n)return e(t,n,r);const{cache:a}=r,o=a.get(t),i=a.get(n);if(o&&i)return o===n&&i===t;a.set(t,n),a.set(n,t);const s=e(t,n,r);return a.delete(t),a.delete(n),s}}function tb(e){return Xy(e).concat(qy(e))}const nb=Object.hasOwn||((e,t)=>Jy.call(e,t));function rb(e,t){return e===t||!e&&!t&&e!=e&&t!=t}const{getOwnPropertyDescriptor:ab,keys:ob}=Object;function ib(e,t){return e.byteLength===t.byteLength&&bb(new Uint8Array(e),new Uint8Array(t))}function sb(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-- >0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function lb(e,t){return e.byteLength===t.byteLength&&bb(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function cb(e,t){return rb(e.getTime(),t.getTime())}function ub(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function db(e,t){return e===t}function fb(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),o=e.entries();let i,s,l=0;for(;(i=o.next())&&!i.done;){const r=t.entries();let o=!1,c=0;for(;(s=r.next())&&!s.done;){if(a[c]){c++;continue}const r=i.value,u=s.value;if(n.equals(r[0],u[0],l,c,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){o=a[c]=!0;break}c++}if(!o)return!1;l++}return!0}const mb=rb;function pb(e,t,n){const r=ob(e);let a=r.length;if(ob(t).length!==a)return!1;for(;a-- >0;)if(!xb(e,t,n,r[a]))return!1;return!0}function hb(e,t,n){const r=tb(e);let a,o,i,s=r.length;if(tb(t).length!==s)return!1;for(;s-- >0;){if(a=r[s],!xb(e,t,n,a))return!1;if(o=ab(e,a),i=ab(t,a),(o||i)&&(!o||!i||o.configurable!==i.configurable||o.enumerable!==i.enumerable||o.writable!==i.writable))return!1}return!0}function gb(e,t){return rb(e.valueOf(),t.valueOf())}function wb(e,t){return e.source===t.source&&e.flags===t.flags}function yb(e,t,n){const r=e.size;if(r!==t.size)return!1;if(!r)return!0;const a=new Array(r),o=e.values();let i,s;for(;(i=o.next())&&!i.done;){const r=t.values();let o=!1,l=0;for(;(s=r.next())&&!s.done;){if(!a[l]&&n.equals(i.value,s.value,i.value,s.value,e,t,n)){o=a[l]=!0;break}l++}if(!o)return!1}return!0}function bb(e,t){let n=e.byteLength;if(t.byteLength!==n||e.byteOffset!==t.byteOffset)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function vb(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function xb(e,t,n,r){return!("_owner"!==r&&"__o"!==r&&"__v"!==r||!e.$$typeof&&!t.$$typeof)||nb(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}const _b={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Eb=Object.prototype.toString;const Nb=Mb();function Mb(e={}){const{circular:t=!1,createInternalComparator:n,createState:r,strict:a=!1}=e,o=function({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:ib,areArraysEqual:n?hb:sb,areDataViewsEqual:lb,areDatesEqual:cb,areErrorsEqual:ub,areFunctionsEqual:db,areMapsEqual:n?Ky(fb,hb):fb,areNumbersEqual:mb,areObjectsEqual:n?hb:pb,arePrimitiveWrappersEqual:gb,areRegExpsEqual:wb,areSetsEqual:n?Ky(yb,hb):yb,areTypedArraysEqual:n?Ky(bb,hb):bb,areUrlsEqual:vb,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){const e=eb(r.areArraysEqual),t=eb(r.areMapsEqual),n=eb(r.areObjectsEqual),a=eb(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areMapsEqual:t,areObjectsEqual:n,areSetsEqual:a})}return r}(e),i=function({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:a,areFunctionsEqual:o,areMapsEqual:i,areNumbersEqual:s,areObjectsEqual:l,arePrimitiveWrappersEqual:c,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:m,unknownTagComparators:p}){return function(h,g,w){if(h===g)return!0;if(null==h||null==g)return!1;const y=typeof h;if(y!==typeof g)return!1;if("object"!==y)return"number"===y?s(h,g,w):"function"===y&&o(h,g,w);const b=h.constructor;if(b!==g.constructor)return!1;if(b===Object)return l(h,g,w);if(Array.isArray(h))return t(h,g,w);if(b===Date)return r(h,g,w);if(b===RegExp)return u(h,g,w);if(b===Map)return i(h,g,w);if(b===Set)return d(h,g,w);const v=Eb.call(h);if("[object Date]"===v)return r(h,g,w);if("[object RegExp]"===v)return u(h,g,w);if("[object Map]"===v)return i(h,g,w);if("[object Set]"===v)return d(h,g,w);if("[object Object]"===v)return"function"!=typeof h.then&&"function"!=typeof g.then&&l(h,g,w);if("[object URL]"===v)return m(h,g,w);if("[object Error]"===v)return a(h,g,w);if("[object Arguments]"===v)return l(h,g,w);if(_b[v])return f(h,g,w);if("[object ArrayBuffer]"===v)return e(h,g,w);if("[object DataView]"===v)return n(h,g,w);if("[object Boolean]"===v||"[object Number]"===v||"[object String]"===v)return c(h,g,w);if(p){let e=p[v];if(!e){const t=function(e){return null!=e?e[Symbol.toStringTag]:void 0}(h);t&&(e=p[t])}if(e)return e(h,g,w)}return!1}}(o),s=n?n(i):(l=i,function(e,t,n,r,a,o,i){return l(e,t,i)});var l;return function({circular:e,comparator:t,createState:n,equals:r,strict:a}){if(n)return function(o,i){const{cache:s=(e?new WeakMap:void 0),meta:l}=n();return t(o,i,{cache:s,equals:r,meta:l,strict:a})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:a})};const o={cache:void 0,equals:r,meta:void 0,strict:a};return function(e,n){return t(e,n,o)}}({circular:t,comparator:i,createState:r,equals:s,strict:a})}function Ib(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=-1;requestAnimationFrame(function r(a){n<0&&(n=a),a-n>t?(e(a),n=-1):function(e){"undefined"!=typeof requestAnimationFrame&&requestAnimationFrame(e)}(r)})}function Sb(e){return Sb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sb(e)}function kb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function jb(){var e=function(){return null},t=!1,n=function n(r){if(!t){if(Array.isArray(r)){if(!r.length)return;var a=function(e){if(Array.isArray(e))return e}(s=r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||function(e,t){if(e){if("string"==typeof e)return kb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kb(e,t):void 0}}(s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=a[0],i=a.slice(1);return"number"==typeof o?void Ib(n.bind(null,i),o):(n(o),void Ib(n.bind(null,i)))}"object"===Sb(r)&&e(r),"function"==typeof r&&r()}var s};return{stop:function(){t=!0},start:function(e){t=!1,n(e)},subscribe:function(t){return e=t,function(){e=function(){return null}}}}}function Db(e){return Db="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Db(e)}function Cb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ab(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cb(Object(n),!0).forEach(function(t){Tb(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cb(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tb(e,t,n){return(t=function(e){var t=function(e){if("object"!==Db(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==Db(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Db(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Mb({strict:!0}),Mb({circular:!0}),Mb({circular:!0,strict:!0}),Mb({createInternalComparator:()=>rb}),Mb({strict:!0,createInternalComparator:()=>rb}),Mb({circular:!0,createInternalComparator:()=>rb}),Mb({circular:!0,createInternalComparator:()=>rb,strict:!0});var Ob=function(e){return e},Lb=function(e,t){return Object.keys(t).reduce(function(n,r){return Ab(Ab({},n),{},Tb({},r,e(r,t[r])))},{})},zb=function(e,t,n){return e.map(function(e){return"".concat((r=e,r.replace(/([A-Z])/g,function(e){return"-".concat(e.toLowerCase())}))," ").concat(t,"ms ").concat(n);var r}).join(",")};function Pb(e,t){if(e){if("string"==typeof e)return Rb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rb(e,t):void 0}}function Rb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ub=1e-4,Bb=function(e,t){return[0,3*e,3*t-6*e,3*e-3*t+1]},Fb=function(e,t){return e.map(function(e,n){return e*Math.pow(t,n)}).reduce(function(e,t){return e+t})},Yb=function(e,t){return function(n){var r=Bb(e,t);return Fb(r,n)}},Qb=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],a=t[1],o=t[2],i=t[3];if(1===t.length)switch(t[0]){case"linear":r=0,a=0,o=1,i=1;break;case"ease":r=.25,a=.1,o=.25,i=1;break;case"ease-in":r=.42,a=0,o=1,i=1;break;case"ease-out":r=.42,a=0,o=.58,i=1;break;case"ease-in-out":r=0,a=0,o=.58,i=1;break;default:var s=t[0].split("(");if("cubic-bezier"===s[0]&&4===s[1].split(")")[0].split(",").length){var l=s[1].split(")")[0].split(",").map(function(e){return parseFloat(e)}),c=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||Pb(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(l,4);r=c[0],a=c[1],o=c[2],i=c[3]}}[r,o,a,i].every(function(e){return"number"==typeof e&&e>=0&&e<=1});var u,d,f=Yb(r,o),m=Yb(a,i),p=(u=r,d=o,function(e){var t,n=Bb(u,d),r=[].concat((t=n.map(function(e,t){return e*t}).slice(1),function(e){if(Array.isArray(e))return Rb(e)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||Pb(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),[0]);return Fb(r,e)}),h=function(e){return e>1?1:e<0?0:e},g=function(e){for(var t=e>1?1:e,n=t,r=0;r<8;++r){var a=f(n)-t,o=p(n);if(Math.abs(a-t)<Ub||o<Ub)return m(n);n=h(n-a/o)}return m(n)};return g.isStepper=!1,g};function Vb(e){return Vb="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vb(e)}function Wb(e){return function(e){if(Array.isArray(e))return Xb(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||$b(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Zb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gb(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zb(Object(n),!0).forEach(function(t){Hb(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zb(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Hb(e,t,n){return(t=function(e){var t=function(e){if("object"!==Vb(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==Vb(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Vb(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $b(e,t){if(e){if("string"==typeof e)return Xb(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xb(e,t):void 0}}function Xb(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var qb=function(e,t,n){return e+(t-e)*n},Jb=function(e){return e.from!==e.to},Kb=function e(t,n,r){var a=Lb(function(e,n){if(Jb(n)){var r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||$b(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t(n.from,n.to,n.velocity),2),a=r[0],o=r[1];return Gb(Gb({},n),{},{from:a,velocity:o})}return n},n);return r<1?Lb(function(e,t){return Jb(t)?Gb(Gb({},t),{},{velocity:qb(t.velocity,a[e].velocity,r),from:qb(t.from,a[e].from,r)}):t},n):e(t,a,r-1)};function ev(e){return ev="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ev(e)}var tv=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function nv(e){return function(e){if(Array.isArray(e))return rv(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return rv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?rv(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function rv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function av(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ov(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?av(Object(n),!0).forEach(function(t){iv(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):av(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function iv(e,t,n){return(t=lv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,lv(r.key),r)}}function lv(e){var t=function(e){if("object"!==ev(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!==ev(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ev(t)?t:String(t)}function cv(e,t){return cv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},cv(e,t)}function uv(e,t){if(t&&("object"===ev(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return dv(e)}function dv(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function fv(e){return fv=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},fv(e)}var mv=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cv(e,t)}(s,e);var t,n,r,a,o=(r=s,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=fv(r);if(a){var n=fv(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return uv(this,e)});function s(e,t){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s);var r=(n=o.call(this,e,t)).props,a=r.isActive,i=r.attributeName,l=r.from,c=r.to,u=r.steps,d=r.children,f=r.duration;if(n.handleStyleChange=n.handleStyleChange.bind(dv(n)),n.changeStyle=n.changeStyle.bind(dv(n)),!a||f<=0)return n.state={style:{}},"function"==typeof d&&(n.state={style:c}),uv(n);if(u&&u.length)n.state={style:u[0].style};else if(l){if("function"==typeof d)return n.state={style:l},uv(n);n.state={style:i?iv({},i,l):l}}else n.state={style:{}};return n}return t=s,n=[{key:"componentDidMount",value:function(){var e=this.props,t=e.isActive,n=e.canBegin;this.mounted=!0,t&&n&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isActive,r=t.canBegin,a=t.attributeName,o=t.shouldReAnimate,i=t.to,s=t.from,l=this.state.style;if(r)if(n){if(!(Nb(e.to,i)&&e.canBegin&&e.isActive)){var c=!e.canBegin||!e.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var u=c||o?s:e.to;if(this.state&&l){var d={style:a?iv({},a,u):u};(a&&l[a]!==u||!a&&l!==u)&&this.setState(d)}this.runAnimation(ov(ov({},this.props),{},{from:u,begin:0}))}}else{var f={style:a?iv({},a,i):i};this.state&&l&&(a&&l[a]!==i||!a&&l!==i)&&this.setState(f)}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var e=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),e&&e()}},{key:"handleStyleChange",value:function(e){this.changeStyle(e)}},{key:"changeStyle",value:function(e){this.mounted&&this.setState({style:e})}},{key:"runJSAnimation",value:function(e){var t=this,n=e.from,r=e.to,a=e.duration,o=e.easing,i=e.begin,s=e.onAnimationEnd,l=e.onAnimationStart,c=function(e,t,n,r,a){var o,i,s,l,c=(o=e,i=t,[Object.keys(o),Object.keys(i)].reduce(function(e,t){return e.filter(function(e){return t.includes(e)})})),u=c.reduce(function(n,r){return Gb(Gb({},n),{},Hb({},r,[e[r],t[r]]))},{}),d=c.reduce(function(n,r){return Gb(Gb({},n),{},Hb({},r,{from:e[r],velocity:0,to:t[r]}))},{}),f=-1,m=function(){return null};return m=n.isStepper?function(r){s||(s=r);var o=(r-s)/n.dt;d=Kb(n,d,o),a(Gb(Gb(Gb({},e),t),Lb(function(e,t){return t.from},d))),s=r,Object.values(d).filter(Jb).length&&(f=requestAnimationFrame(m))}:function(o){l||(l=o);var i=(o-l)/r,s=Lb(function(e,t){return qb.apply(void 0,Wb(t).concat([n(i)]))},u);if(a(Gb(Gb(Gb({},e),t),s)),i<1)f=requestAnimationFrame(m);else{var c=Lb(function(e,t){return qb.apply(void 0,Wb(t).concat([n(1)]))},u);a(Gb(Gb(Gb({},e),t),c))}},function(){return requestAnimationFrame(m),function(){cancelAnimationFrame(f)}}}(n,r,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0];if("string"==typeof r)switch(r){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Qb(r);case"spring":return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.stiff,n=void 0===t?100:t,r=e.damping,a=void 0===r?8:r,o=e.dt,i=void 0===o?17:o,s=function(e,t,r){var o=r+(-(e-t)*n-r*a)*i/1e3,s=r*i/1e3+e;return Math.abs(s-t)<Ub&&Math.abs(o)<Ub?[t,0]:[s,o]};return s.isStepper=!0,s.dt=i,s}();default:if("cubic-bezier"===r.split("(")[0])return Qb(r)}return"function"==typeof r?r:null}(o),a,this.changeStyle);this.manager.start([l,i,function(){t.stopJSAnimation=c()},a,s])}},{key:"runStepAnimation",value:function(e){var t=this,n=e.steps,r=e.begin,a=e.onAnimationStart,o=n[0],i=o.style,s=o.duration,l=void 0===s?0:s;return this.manager.start([a].concat(nv(n.reduce(function(e,r,a){if(0===a)return e;var o=r.duration,i=r.easing,s=void 0===i?"ease":i,l=r.style,c=r.properties,u=r.onAnimationEnd,d=a>0?n[a-1]:r,f=c||Object.keys(l);if("function"==typeof s||"spring"===s)return[].concat(nv(e),[t.runJSAnimation.bind(t,{from:d.style,to:l,duration:o,easing:s}),o]);var m=zb(f,o,s),p=ov(ov(ov({},d.style),l),{},{transition:m});return[].concat(nv(e),[p,o,u]).filter(Ob)},[i,Math.max(l,r)])),[e.onAnimationEnd]))}},{key:"runAnimation",value:function(e){this.manager||(this.manager=jb());var t=e.begin,n=e.duration,r=e.attributeName,a=e.to,o=e.easing,i=e.onAnimationStart,s=e.onAnimationEnd,l=e.steps,c=e.children,u=this.manager;if(this.unSubscribe=u.subscribe(this.handleStyleChange),"function"!=typeof o&&"function"!=typeof c&&"spring"!==o)if(l.length>1)this.runStepAnimation(e);else{var d=r?iv({},r,a):a,f=zb(Object.keys(d),n,o);u.start([i,t,ov(ov({},d),{},{transition:f}),n,s])}else this.runJSAnimation(e)}},{key:"render",value:function(){var e=this.props,t=e.children,n=(e.begin,e.duration),r=(e.attributeName,e.easing,e.isActive),a=(e.steps,e.from,e.to,e.canBegin,e.onAnimationEnd,e.shouldReAnimate,e.onAnimationReStart,function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,tv)),o=i.Children.count(t),s=this.state.style;if("function"==typeof t)return t(s);if(!r||0===o||n<=0)return t;var c=function(e){var t=e.props,n=t.style,r=void 0===n?{}:n,o=t.className;return(0,i.cloneElement)(e,ov(ov({},a),{},{style:ov(ov({},r),s),className:o}))};return 1===o?c(i.Children.only(t)):l().createElement("div",null,i.Children.map(t,function(e){return c(e)}))}}],n&&sv(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(i.PureComponent);mv.displayName="Animate",mv.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}},mv.propTypes={from:$y().oneOfType([$y().object,$y().string]),to:$y().oneOfType([$y().object,$y().string]),attributeName:$y().string,duration:$y().number,begin:$y().number,easing:$y().oneOfType([$y().string,$y().func]),steps:$y().arrayOf($y().shape({duration:$y().number.isRequired,style:$y().object.isRequired,easing:$y().oneOfType([$y().oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),$y().func]),properties:$y().arrayOf("string"),onAnimationEnd:$y().func})),children:$y().oneOfType([$y().node,$y().func]),isActive:$y().bool,canBegin:$y().bool,onAnimationEnd:$y().func,shouldReAnimate:$y().bool,onAnimationStart:$y().func,onAnimationReStart:$y().func};const pv=mv;function hv(e){return hv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hv(e)}function gv(){return gv=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gv.apply(this,arguments)}function wv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function yv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?yv(Object(n),!0).forEach(function(t){vv(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):yv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vv(e,t,n){return t=function(e){var t=function(e){if("object"!=hv(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=hv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==hv(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var xv=function(e,t,n,r,a){var o,i=Math.min(Math.abs(n)/2,Math.abs(r)/2),s=r>=0?1:-1,l=n>=0?1:-1,c=r>=0&&n>=0||r<0&&n<0?1:0;if(i>0&&a instanceof Array){for(var u=[0,0,0,0],d=0;d<4;d++)u[d]=a[d]>i?i:a[d];o="M".concat(e,",").concat(t+s*u[0]),u[0]>0&&(o+="A ".concat(u[0],",").concat(u[0],",0,0,").concat(c,",").concat(e+l*u[0],",").concat(t)),o+="L ".concat(e+n-l*u[1],",").concat(t),u[1]>0&&(o+="A ".concat(u[1],",").concat(u[1],",0,0,").concat(c,",\n ").concat(e+n,",").concat(t+s*u[1])),o+="L ".concat(e+n,",").concat(t+r-s*u[2]),u[2]>0&&(o+="A ".concat(u[2],",").concat(u[2],",0,0,").concat(c,",\n ").concat(e+n-l*u[2],",").concat(t+r)),o+="L ".concat(e+l*u[3],",").concat(t+r),u[3]>0&&(o+="A ".concat(u[3],",").concat(u[3],",0,0,").concat(c,",\n ").concat(e,",").concat(t+r-s*u[3])),o+="Z"}else if(i>0&&a===+a&&a>0){var f=Math.min(i,a);o="M ".concat(e,",").concat(t+s*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+l*f,",").concat(t,"\n L ").concat(e+n-l*f,",").concat(t,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+n,",").concat(t+s*f,"\n L ").concat(e+n,",").concat(t+r-s*f,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e+n-l*f,",").concat(t+r,"\n L ").concat(e+l*f,",").concat(t+r,"\n A ").concat(f,",").concat(f,",0,0,").concat(c,",").concat(e,",").concat(t+r-s*f," Z")}else o="M ".concat(e,",").concat(t," h ").concat(n," v ").concat(r," h ").concat(-n," Z");return o},_v=function(e,t){if(!e||!t)return!1;var n=e.x,r=e.y,a=t.x,o=t.y,i=t.width,s=t.height;if(Math.abs(i)>0&&Math.abs(s)>0){var l=Math.min(a,a+i),c=Math.max(a,a+i),u=Math.min(o,o+s),d=Math.max(o,o+s);return n>=l&&n<=c&&r>=u&&r<=d}return!1},Ev={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Nv=function(e){var t=bv(bv({},Ev),e),n=(0,i.useRef)(),r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return wv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?wv(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,i.useState)(-1),2),a=r[0],o=r[1];(0,i.useEffect)(function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&o(e)}catch(e){}},[]);var s=t.x,c=t.y,u=t.width,d=t.height,f=t.radius,m=t.className,p=t.animationEasing,h=t.animationDuration,g=t.animationBegin,w=t.isAnimationActive,y=t.isUpdateAnimationActive;if(s!==+s||c!==+c||u!==+u||d!==+d||0===u||0===d)return null;var b=Te("recharts-rectangle",m);return y?l().createElement(pv,{canBegin:a>0,from:{width:u,height:d,x:s,y:c},to:{width:u,height:d,x:s,y:c},duration:h,animationEasing:p,isActive:y},function(e){var r=e.width,o=e.height,i=e.x,s=e.y;return l().createElement(pv,{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:h,isActive:w,easing:p},l().createElement("path",gv({},Dg(t,!0),{className:b,d:xv(i,s,r,o,f),ref:n})))}):l().createElement("path",gv({},Dg(t,!0),{className:b,d:xv(s,c,u,d,f)}))};function Mv(e,t){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(t).domain(e)}return this}function Iv(e,t){switch(arguments.length){case 0:break;case 1:"function"==typeof e?this.interpolator(e):this.range(e);break;default:this.domain(e),"function"==typeof t?this.interpolator(t):this.range(t)}return this}class Sv extends Map{constructor(e,t=jv){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),null!=e)for(const[t,n]of e)this.set(t,n)}get(e){return super.get(kv(this,e))}has(e){return super.has(kv(this,e))}set(e,t){return super.set(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}(this,e),t)}delete(e){return super.delete(function({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}(this,e))}}function kv({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function jv(e){return null!==e&&"object"==typeof e?e.valueOf():e}Set;const Dv=Symbol("implicit");function Cv(){var e=new Sv,t=[],n=[],r=Dv;function a(a){let o=e.get(a);if(void 0===o){if(r!==Dv)return r;e.set(a,o=t.push(a)-1)}return n[o%n.length]}return a.domain=function(n){if(!arguments.length)return t.slice();t=[],e=new Sv;for(const r of n)e.has(r)||e.set(r,t.push(r)-1);return a},a.range=function(e){return arguments.length?(n=Array.from(e),a):n.slice()},a.unknown=function(e){return arguments.length?(r=e,a):r},a.copy=function(){return Cv(t,n).unknown(r)},Mv.apply(a,arguments),a}function Av(){var e,t,n=Cv().unknown(void 0),r=n.domain,a=n.range,o=0,i=1,s=!1,l=0,c=0,u=.5;function d(){var n=r().length,d=i<o,f=d?i:o,m=d?o:i;e=(m-f)/Math.max(1,n-l+2*c),s&&(e=Math.floor(e)),f+=(m-f-e*(n-l))*u,t=e*(1-l),s&&(f=Math.round(f),t=Math.round(t));var p=function(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=0|Math.max(0,Math.ceil((t-e)/n)),o=new Array(a);++r<a;)o[r]=e+r*n;return o}(n).map(function(t){return f+e*t});return a(d?p.reverse():p)}return delete n.unknown,n.domain=function(e){return arguments.length?(r(e),d()):r()},n.range=function(e){return arguments.length?([o,i]=e,o=+o,i=+i,d()):[o,i]},n.rangeRound=function(e){return[o,i]=e,o=+o,i=+i,s=!0,d()},n.bandwidth=function(){return t},n.step=function(){return e},n.round=function(e){return arguments.length?(s=!!e,d()):s},n.padding=function(e){return arguments.length?(l=Math.min(1,c=+e),d()):l},n.paddingInner=function(e){return arguments.length?(l=Math.min(1,e),d()):l},n.paddingOuter=function(e){return arguments.length?(c=+e,d()):c},n.align=function(e){return arguments.length?(u=Math.max(0,Math.min(1,e)),d()):u},n.copy=function(){return Av(r(),[o,i]).round(s).paddingInner(l).paddingOuter(c).align(u)},Mv.apply(d(),arguments)}function Tv(e){var t=e.copy;return e.padding=e.paddingOuter,delete e.paddingInner,delete e.paddingOuter,e.copy=function(){return Tv(t())},e}function Ov(){return Tv(Av.apply(null,arguments).paddingInner(1))}function Lv(e){return Lv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lv(e)}function zv(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Pv(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zv(Object(n),!0).forEach(function(t){Rv(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zv(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Rv(e,t,n){return t=function(e){var t=function(e){if("object"!=Lv(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Lv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Lv(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Uv={widthCache:{},cacheCount:0},Bv={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},Fv="recharts_measurement_span",Yv=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==e||xw.isSsr)return{width:0,height:0};var n,r=(n=Pv({},t),Object.keys(n).forEach(function(e){n[e]||delete n[e]}),n),a=JSON.stringify({text:e,copyStyle:r});if(Uv.widthCache[a])return Uv.widthCache[a];try{var o=document.getElementById(Fv);o||((o=document.createElement("span")).setAttribute("id",Fv),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var i=Pv(Pv({},Bv),r);Object.assign(o.style,i),o.textContent="".concat(e);var s=o.getBoundingClientRect(),l={width:s.width,height:s.height};return Uv.widthCache[a]=l,++Uv.cacheCount>2e3&&(Uv.cacheCount=0,Uv.widthCache={}),l}catch(e){return{width:0,height:0}}};function Qv(e){return Qv="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qv(e)}function Vv(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Wv(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Wv(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wv(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Zv(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Gv(r.key),r)}}function Gv(e){var t=function(e){if("object"!=Qv(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Qv(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qv(t)?t:t+""}var Hv=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,$v=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Xv=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,qv=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Jv={cm:96/2.54,mm:96/25.4,pt:96/72,pc:16,in:96,Q:96/101.6,px:1},Kv=Object.keys(Jv),ex="NaN",tx=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.num=t,this.unit=n,this.num=t,this.unit=n,Number.isNaN(t)&&(this.unit=""),""===n||Xv.test(n)||(this.num=NaN,this.unit=""),Kv.includes(n)&&(this.num=function(e,t){return e*Jv[t]}(t,n),this.unit="px")}return t=e,r=[{key:"parse",value:function(t){var n,r=Vv(null!==(n=qv.exec(t))&&void 0!==n?n:[],3),a=r[1],o=r[2];return new e(parseFloat(a),null!=o?o:"")}}],(n=[{key:"add",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num+t.num,this.unit)}},{key:"subtract",value:function(t){return this.unit!==t.unit?new e(NaN,""):new e(this.num-t.num,this.unit)}},{key:"multiply",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num*t.num,this.unit||t.unit)}},{key:"divide",value:function(t){return""!==this.unit&&""!==t.unit&&this.unit!==t.unit?new e(NaN,""):new e(this.num/t.num,this.unit||t.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}])&&Zv(t.prototype,n),r&&Zv(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,r}();function nx(e){if(e.includes(ex))return ex;for(var t=e;t.includes("*")||t.includes("/");){var n,r=Vv(null!==(n=Hv.exec(t))&&void 0!==n?n:[],4),a=r[1],o=r[2],i=r[3],s=tx.parse(null!=a?a:""),l=tx.parse(null!=i?i:""),c="*"===o?s.multiply(l):s.divide(l);if(c.isNaN())return ex;t=t.replace(Hv,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,d=Vv(null!==(u=$v.exec(t))&&void 0!==u?u:[],4),f=d[1],m=d[2],p=d[3],h=tx.parse(null!=f?f:""),g=tx.parse(null!=p?p:""),w="+"===m?h.add(g):h.subtract(g);if(w.isNaN())return ex;t=t.replace($v,w.toString())}return t}var rx=/\(([^()]*)\)/;function ax(e){var t=function(e){try{return function(e){var t=e.replace(/\s+/g,"");return t=function(e){for(var t=e;t.includes("(");){var n=Vv(rx.exec(t),2)[1];t=t.replace(rx,nx(n))}return t}(t),nx(t)}(e)}catch(e){return ex}}(e.slice(5,-1));return t===ex?"":t}var ox=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],ix=["dx","dy","angle","className","breakAll"];function sx(){return sx=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sx.apply(this,arguments)}function lx(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function cx(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ux(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ux(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ux(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var dx=/[ \f\n\r\t\v\u2028\u2029]+/,fx=function(e){var t=e.children,n=e.breakAll,r=e.style;try{var a=[];return Wh()(t)||(a=n?t.toString().split(""):t.toString().split(dx)),{wordsWithComputedWidth:a.map(function(e){return{word:e,width:Yv(e,r).width}}),spaceWidth:n?0:Yv(" ",r).width}}catch(e){return null}},mx=function(e){return[{words:Wh()(e)?[]:e.toString().split(dx)}]},px="#808080",hx=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,a=void 0===r?0:r,o=e.lineHeight,s=void 0===o?"1em":o,c=e.capHeight,u=void 0===c?"0.71em":c,d=e.scaleToFit,f=void 0!==d&&d,m=e.textAnchor,p=void 0===m?"start":m,h=e.verticalAnchor,g=void 0===h?"end":h,w=e.fill,y=void 0===w?px:w,b=lx(e,ox),v=(0,i.useMemo)(function(){return function(e){var t=e.width,n=e.scaleToFit,r=e.children,a=e.style,o=e.breakAll,i=e.maxLines;if((t||n)&&!xw.isSsr){var s=fx({breakAll:o,children:r,style:a});return s?function(e,t,n,r,a){var o=e.maxLines,i=e.children,s=e.style,l=e.breakAll,c=Hh(o),u=i,d=function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).reduce(function(e,t){var o=t.word,i=t.width,s=e[e.length-1];if(s&&(null==r||a||s.width+i+n<Number(r)))s.words.push(o),s.width+=i+n;else{var l={words:[o],width:i};e.push(l)}return e},[])},f=d(t);if(!c)return f;for(var m,p=function(e){var t=u.slice(0,e),n=fx({breakAll:l,style:s,children:t+"…"}).wordsWithComputedWidth,a=d(n),i=a.length>o||function(e){return e.reduce(function(e,t){return e.width>t.width?e:t})}(a).width>Number(r);return[i,a]},h=0,g=u.length-1,w=0;h<=g&&w<=u.length-1;){var y=Math.floor((h+g)/2),b=cx(p(y-1),2),v=b[0],x=b[1],_=cx(p(y),1)[0];if(v||_||(h=y+1),v&&_&&(g=y-1),!v&&_){m=x;break}w++}return m||f}({breakAll:o,children:r,maxLines:i,style:a},s.wordsWithComputedWidth,s.spaceWidth,t,n):mx(r)}return mx(r)}({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:f,style:b.style,width:b.width})},[b.breakAll,b.children,b.maxLines,f,b.style,b.width]),x=b.dx,_=b.dy,E=b.angle,N=b.className,M=b.breakAll,I=lx(b,ix);if(!$h(n)||!$h(a))return null;var S,k=n+(Hh(x)?x:0),j=a+(Hh(_)?_:0);switch(g){case"start":S=ax("calc(".concat(u,")"));break;case"middle":S=ax("calc(".concat((v.length-1)/2," * -").concat(s," + (").concat(u," / 2))"));break;default:S=ax("calc(".concat(v.length-1," * -").concat(s,")"))}var D=[];if(f){var C=v[0].width,A=b.width;D.push("scale(".concat((Hh(A)?A/C:1)/C,")"))}return E&&D.push("rotate(".concat(E,", ").concat(k,", ").concat(j,")")),D.length&&(I.transform=D.join(" ")),l().createElement("text",sx({},Dg(I,!0),{x:k,y:j,className:Te("recharts-text",N),textAnchor:p,fill:y.includes("url")?px:y}),v.map(function(e,t){var n=e.words.join(M?"":" ");return l().createElement("tspan",{x:k,dy:0===t?S:s,key:"".concat(n,"-").concat(t)},n)}))};const gx=Math.sqrt(50),wx=Math.sqrt(10),yx=Math.sqrt(2);function bx(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),o=r/Math.pow(10,a),i=o>=gx?10:o>=wx?5:o>=yx?2:1;let s,l,c;return a<0?(c=Math.pow(10,-a)/i,s=Math.round(e*c),l=Math.round(t*c),s/c<e&&++s,l/c>t&&--l,c=-c):(c=Math.pow(10,a)*i,s=Math.round(e/c),l=Math.round(t/c),s*c<e&&++s,l*c>t&&--l),l<s&&.5<=n&&n<2?bx(e,t,2*n):[s,l,c]}function vx(e,t,n){if(!((n=+n)>0))return[];if((e=+e)===(t=+t))return[e];const r=t<e,[a,o,i]=r?bx(t,e,n):bx(e,t,n);if(!(o>=a))return[];const s=o-a+1,l=new Array(s);if(r)if(i<0)for(let e=0;e<s;++e)l[e]=(o-e)/-i;else for(let e=0;e<s;++e)l[e]=(o-e)*i;else if(i<0)for(let e=0;e<s;++e)l[e]=(a+e)/-i;else for(let e=0;e<s;++e)l[e]=(a+e)*i;return l}function xx(e,t,n){return bx(e=+e,t=+t,n=+n)[2]}function Ex(e,t,n){n=+n;const r=(t=+t)<(e=+e),a=r?xx(t,e,n):xx(e,t,n);return(r?-1:1)*(a<0?1/-a:a)}function Nx(e,t){return null==e||null==t?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function Mx(e,t){return null==e||null==t?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function Ix(e){let t,n,r;function a(e,r,a=0,o=e.length){if(a<o){if(0!==t(r,r))return o;do{const t=a+o>>>1;n(e[t],r)<0?a=t+1:o=t}while(a<o)}return a}return 2!==e.length?(t=Nx,n=(t,n)=>Nx(e(t),n),r=(t,n)=>e(t)-n):(t=e===Nx||e===Mx?e:Sx,n=e,r=e),{left:a,center:function(e,t,n=0,o=e.length){const i=a(e,t,n,o-1);return i>n&&r(e[i-1],t)>-r(e[i],t)?i-1:i},right:function(e,r,a=0,o=e.length){if(a<o){if(0!==t(r,r))return o;do{const t=a+o>>>1;n(e[t],r)<=0?a=t+1:o=t}while(a<o)}return a}}}function Sx(){return 0}function kx(e){return null===e?NaN:+e}const jx=Ix(Nx),Dx=jx.right,Cx=(jx.left,Ix(kx).center,Dx);function Ax(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Tx(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function Ox(){}var Lx=.7,zx=1/Lx,Px="\\s*([+-]?\\d+)\\s*",Rx="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Ux="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Bx=/^#([0-9a-f]{3,8})$/,Fx=new RegExp(`^rgb\\(${Px},${Px},${Px}\\)$`),Yx=new RegExp(`^rgb\\(${Ux},${Ux},${Ux}\\)$`),Qx=new RegExp(`^rgba\\(${Px},${Px},${Px},${Rx}\\)$`),Vx=new RegExp(`^rgba\\(${Ux},${Ux},${Ux},${Rx}\\)$`),Wx=new RegExp(`^hsl\\(${Rx},${Ux},${Ux}\\)$`),Zx=new RegExp(`^hsla\\(${Rx},${Ux},${Ux},${Rx}\\)$`),Gx={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Hx(){return this.rgb().formatHex()}function $x(){return this.rgb().formatRgb()}function Xx(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Bx.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?qx(t):3===n?new e_(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?Jx(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?Jx(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=Fx.exec(e))?new e_(t[1],t[2],t[3],1):(t=Yx.exec(e))?new e_(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Qx.exec(e))?Jx(t[1],t[2],t[3],t[4]):(t=Vx.exec(e))?Jx(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Wx.exec(e))?i_(t[1],t[2]/100,t[3]/100,1):(t=Zx.exec(e))?i_(t[1],t[2]/100,t[3]/100,t[4]):Gx.hasOwnProperty(e)?qx(Gx[e]):"transparent"===e?new e_(NaN,NaN,NaN,0):null}function qx(e){return new e_(e>>16&255,e>>8&255,255&e,1)}function Jx(e,t,n,r){return r<=0&&(e=t=n=NaN),new e_(e,t,n,r)}function Kx(e,t,n,r){return 1===arguments.length?function(e){return e instanceof Ox||(e=Xx(e)),e?new e_((e=e.rgb()).r,e.g,e.b,e.opacity):new e_}(e):new e_(e,t,n,null==r?1:r)}function e_(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function t_(){return`#${o_(this.r)}${o_(this.g)}${o_(this.b)}`}function n_(){const e=r_(this.opacity);return`${1===e?"rgb(":"rgba("}${a_(this.r)}, ${a_(this.g)}, ${a_(this.b)}${1===e?")":`, ${e})`}`}function r_(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function a_(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function o_(e){return((e=a_(e))<16?"0":"")+e.toString(16)}function i_(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new l_(e,t,n,r)}function s_(e){if(e instanceof l_)return new l_(e.h,e.s,e.l,e.opacity);if(e instanceof Ox||(e=Xx(e)),!e)return new l_;if(e instanceof l_)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),o=Math.max(t,n,r),i=NaN,s=o-a,l=(o+a)/2;return s?(i=t===o?(n-r)/s+6*(n<r):n===o?(r-t)/s+2:(t-n)/s+4,s/=l<.5?o+a:2-o-a,i*=60):s=l>0&&l<1?0:i,new l_(i,s,l,e.opacity)}function l_(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function c_(e){return(e=(e||0)%360)<0?e+360:e}function u_(e){return Math.max(0,Math.min(1,e||0))}function d_(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}function f_(e,t,n,r,a){var o=e*e,i=o*e;return((1-3*e+3*o-i)*t+(4-6*o+3*i)*n+(1+3*e+3*o-3*i)*r+i*a)/6}Ax(Ox,Xx,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Hx,formatHex:Hx,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return s_(this).formatHsl()},formatRgb:$x,toString:$x}),Ax(e_,Kx,Tx(Ox,{brighter(e){return e=null==e?zx:Math.pow(zx,e),new e_(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?Lx:Math.pow(Lx,e),new e_(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new e_(a_(this.r),a_(this.g),a_(this.b),r_(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:t_,formatHex:t_,formatHex8:function(){return`#${o_(this.r)}${o_(this.g)}${o_(this.b)}${o_(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:n_,toString:n_})),Ax(l_,function(e,t,n,r){return 1===arguments.length?s_(e):new l_(e,t,n,null==r?1:r)},Tx(Ox,{brighter(e){return e=null==e?zx:Math.pow(zx,e),new l_(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?Lx:Math.pow(Lx,e),new l_(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new e_(d_(e>=240?e-240:e+120,a,r),d_(e,a,r),d_(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new l_(c_(this.h),u_(this.s),u_(this.l),r_(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=r_(this.opacity);return`${1===e?"hsl(":"hsla("}${c_(this.h)}, ${100*u_(this.s)}%, ${100*u_(this.l)}%${1===e?")":`, ${e})`}`}}));const m_=e=>()=>e;function p_(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):m_(isNaN(e)?t:e)}const h_=function e(t){var n=function(e){return 1===(e=+e)?p_:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):m_(isNaN(t)?n:t)}}(t);function r(e,t){var r=n((e=Kx(e)).r,(t=Kx(t)).r),a=n(e.g,t.g),o=n(e.b,t.b),i=p_(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=a(t),e.b=o(t),e.opacity=i(t),e+""}}return r.gamma=e,r}(1);function g_(e){return function(t){var n,r,a=t.length,o=new Array(a),i=new Array(a),s=new Array(a);for(n=0;n<a;++n)r=Kx(t[n]),o[n]=r.r||0,i[n]=r.g||0,s[n]=r.b||0;return o=e(o),i=e(i),s=e(s),r.opacity=1,function(e){return r.r=o(e),r.g=i(e),r.b=s(e),r+""}}}function w_(e,t){var n,r=t?t.length:0,a=e?Math.min(r,e.length):0,o=new Array(a),i=new Array(r);for(n=0;n<a;++n)o[n]=I_(e[n],t[n]);for(;n<r;++n)i[n]=t[n];return function(e){for(n=0;n<a;++n)i[n]=o[n](e);return i}}function y_(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function b_(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function v_(e,t){var n,r={},a={};for(n in null!==e&&"object"==typeof e||(e={}),null!==t&&"object"==typeof t||(t={}),t)n in e?r[n]=I_(e[n],t[n]):a[n]=t[n];return function(e){for(n in r)a[n]=r[n](e);return a}}g_(function(e){var t=e.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,t-1):Math.floor(n*t),a=e[r],o=e[r+1],i=r>0?e[r-1]:2*a-o,s=r<t-1?e[r+2]:2*o-a;return f_((n-r/t)*t,i,a,o,s)}}),g_(function(e){var t=e.length;return function(n){var r=Math.floor(((n%=1)<0?++n:n)*t),a=e[(r+t-1)%t],o=e[r%t],i=e[(r+1)%t],s=e[(r+2)%t];return f_((n-r/t)*t,a,o,i,s)}});var x_=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,E_=new RegExp(x_.source,"g");function N_(e,t){var n,r,a,o=x_.lastIndex=E_.lastIndex=0,i=-1,s=[],l=[];for(e+="",t+="";(n=x_.exec(e))&&(r=E_.exec(t));)(a=r.index)>o&&(a=t.slice(o,a),s[i]?s[i]+=a:s[++i]=a),(n=n[0])===(r=r[0])?s[i]?s[i]+=r:s[++i]=r:(s[++i]=null,l.push({i,x:b_(n,r)})),o=E_.lastIndex;return o<t.length&&(a=t.slice(o),s[i]?s[i]+=a:s[++i]=a),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}function M_(e,t){t||(t=[]);var n,r=e?Math.min(t.length,e.length):0,a=t.slice();return function(o){for(n=0;n<r;++n)a[n]=e[n]*(1-o)+t[n]*o;return a}}function I_(e,t){var n,r=typeof t;return null==t||"boolean"===r?m_(t):("number"===r?b_:"string"===r?(n=Xx(t))?(t=n,h_):N_:t instanceof Xx?h_:t instanceof Date?y_:function(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}(t)?M_:Array.isArray(t)?w_:"function"!=typeof t.valueOf&&"function"!=typeof t.toString||isNaN(t)?v_:b_)(e,t)}function S_(e,t){return e=+e,t=+t,function(n){return Math.round(e*(1-n)+t*n)}}function k_(e){return+e}var j_=[0,1];function D_(e){return e}function C_(e,t){return(t-=e=+e)?function(n){return(n-e)/t}:function(e){return function(){return e}}(isNaN(t)?NaN:.5)}function A_(e,t,n){var r=e[0],a=e[1],o=t[0],i=t[1];return a<r?(r=C_(a,r),o=n(i,o)):(r=C_(r,a),o=n(o,i)),function(e){return o(r(e))}}function T_(e,t,n){var r=Math.min(e.length,t.length)-1,a=new Array(r),o=new Array(r),i=-1;for(e[r]<e[0]&&(e=e.slice().reverse(),t=t.slice().reverse());++i<r;)a[i]=C_(e[i],e[i+1]),o[i]=n(t[i],t[i+1]);return function(t){var n=Cx(e,t,1,r)-1;return o[n](a[n](t))}}function O_(e,t){return t.domain(e.domain()).range(e.range()).interpolate(e.interpolate()).clamp(e.clamp()).unknown(e.unknown())}function L_(){var e,t,n,r,a,o,i=j_,s=j_,l=I_,c=D_;function u(){var e=Math.min(i.length,s.length);return c!==D_&&(c=function(e,t){var n;return e>t&&(n=e,e=t,t=n),function(n){return Math.max(e,Math.min(t,n))}}(i[0],i[e-1])),r=e>2?T_:A_,a=o=null,d}function d(t){return null==t||isNaN(t=+t)?n:(a||(a=r(i.map(e),s,l)))(e(c(t)))}return d.invert=function(n){return c(t((o||(o=r(s,i.map(e),b_)))(n)))},d.domain=function(e){return arguments.length?(i=Array.from(e,k_),u()):i.slice()},d.range=function(e){return arguments.length?(s=Array.from(e),u()):s.slice()},d.rangeRound=function(e){return s=Array.from(e),l=S_,u()},d.clamp=function(e){return arguments.length?(c=!!e||D_,u()):c!==D_},d.interpolate=function(e){return arguments.length?(l=e,u()):l},d.unknown=function(e){return arguments.length?(n=e,d):n},function(n,r){return e=n,t=r,u()}}function z_(){return L_()(D_,D_)}var P_,R_=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function U_(e){if(!(t=R_.exec(e)))throw new Error("invalid format: "+e);var t;return new B_({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}function B_(e){this.fill=void 0===e.fill?" ":e.fill+"",this.align=void 0===e.align?">":e.align+"",this.sign=void 0===e.sign?"-":e.sign+"",this.symbol=void 0===e.symbol?"":e.symbol+"",this.zero=!!e.zero,this.width=void 0===e.width?void 0:+e.width,this.comma=!!e.comma,this.precision=void 0===e.precision?void 0:+e.precision,this.trim=!!e.trim,this.type=void 0===e.type?"":e.type+""}function F_(e,t){if(!isFinite(e)||0===e)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Y_(e){return(e=F_(Math.abs(e)))?e[1]:NaN}function Q_(e,t){var n=F_(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}U_.prototype=B_.prototype,B_.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const V_={"%":(e,t)=>(100*e).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:function(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)},e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>Q_(100*e,t),r:Q_,s:function(e,t){var n=F_(e,t);if(!n)return P_=void 0,e.toPrecision(t);var r=n[0],a=n[1],o=a-(P_=3*Math.max(-8,Math.min(8,Math.floor(a/3))))+1,i=r.length;return o===i?r:o>i?r+new Array(o-i+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+F_(e,Math.max(0,t+o-1))[0]},X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function W_(e){return e}var Z_,G_,H_,$_=Array.prototype.map,X_=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function q_(e,t,n,r){var a,o=Ex(e,t,n);switch((r=U_(null==r?",f":r)).type){case"s":var i=Math.max(Math.abs(e),Math.abs(t));return null!=r.precision||isNaN(a=function(e,t){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(Y_(t)/3)))-Y_(Math.abs(e)))}(o,i))||(r.precision=a),H_(r,i);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(a=function(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Y_(t)-Y_(e))+1}(o,Math.max(Math.abs(e),Math.abs(t))))||(r.precision=a-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(a=function(e){return Math.max(0,-Y_(Math.abs(e)))}(o))||(r.precision=a-2*("%"===r.type))}return G_(r)}function J_(e){var t=e.domain;return e.ticks=function(e){var n=t();return vx(n[0],n[n.length-1],null==e?10:e)},e.tickFormat=function(e,n){var r=t();return q_(r[0],r[r.length-1],null==e?10:e,n)},e.nice=function(n){null==n&&(n=10);var r,a,o=t(),i=0,s=o.length-1,l=o[i],c=o[s],u=10;for(c<l&&(a=l,l=c,c=a,a=i,i=s,s=a);u-- >0;){if((a=xx(l,c,n))===r)return o[i]=l,o[s]=c,t(o);if(a>0)l=Math.floor(l/a)*a,c=Math.ceil(c/a)*a;else{if(!(a<0))break;l=Math.ceil(l*a)/a,c=Math.floor(c*a)/a}r=a}return e},e}function K_(){var e=z_();return e.copy=function(){return O_(e,K_())},Mv.apply(e,arguments),J_(e)}function eE(e){var t;function n(e){return null==e||isNaN(e=+e)?t:e}return n.invert=n,n.domain=n.range=function(t){return arguments.length?(e=Array.from(t,k_),n):e.slice()},n.unknown=function(e){return arguments.length?(t=e,n):t},n.copy=function(){return eE(e).unknown(t)},e=arguments.length?Array.from(e,k_):[0,1],J_(n)}function tE(e,t){var n,r=0,a=(e=e.slice()).length-1,o=e[r],i=e[a];return i<o&&(n=r,r=a,a=n,n=o,o=i,i=n),e[r]=t.floor(o),e[a]=t.ceil(i),e}function nE(e){return Math.log(e)}function rE(e){return Math.exp(e)}function aE(e){return-Math.log(-e)}function oE(e){return-Math.exp(-e)}function iE(e){return isFinite(e)?+("1e"+e):e<0?0:e}function sE(e){return(t,n)=>-e(-t,n)}function lE(e){const t=e(nE,rE),n=t.domain;let r,a,o=10;function i(){return r=function(e){return e===Math.E?Math.log:10===e&&Math.log10||2===e&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}(o),a=function(e){return 10===e?iE:e===Math.E?Math.exp:t=>Math.pow(e,t)}(o),n()[0]<0?(r=sE(r),a=sE(a),e(aE,oE)):e(nE,rE),t}return t.base=function(e){return arguments.length?(o=+e,i()):o},t.domain=function(e){return arguments.length?(n(e),i()):n()},t.ticks=e=>{const t=n();let i=t[0],s=t[t.length-1];const l=s<i;l&&([i,s]=[s,i]);let c,u,d=r(i),f=r(s);const m=null==e?10:+e;let p=[];if(!(o%1)&&f-d<m){if(d=Math.floor(d),f=Math.ceil(f),i>0){for(;d<=f;++d)for(c=1;c<o;++c)if(u=d<0?c/a(-d):c*a(d),!(u<i)){if(u>s)break;p.push(u)}}else for(;d<=f;++d)for(c=o-1;c>=1;--c)if(u=d>0?c/a(-d):c*a(d),!(u<i)){if(u>s)break;p.push(u)}2*p.length<m&&(p=vx(i,s,m))}else p=vx(d,f,Math.min(f-d,m)).map(a);return l?p.reverse():p},t.tickFormat=(e,n)=>{if(null==e&&(e=10),null==n&&(n=10===o?"s":","),"function"!=typeof n&&(o%1||null!=(n=U_(n)).precision||(n.trim=!0),n=G_(n)),e===1/0)return n;const i=Math.max(1,o*e/t.ticks().length);return e=>{let t=e/a(Math.round(r(e)));return t*o<o-.5&&(t*=o),t<=i?n(e):""}},t.nice=()=>n(tE(n(),{floor:e=>a(Math.floor(r(e))),ceil:e=>a(Math.ceil(r(e)))})),t}function cE(){const e=lE(L_()).domain([1,10]);return e.copy=()=>O_(e,cE()).base(e.base()),Mv.apply(e,arguments),e}function uE(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function dE(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function fE(e){var t=1,n=e(uE(t),dE(t));return n.constant=function(n){return arguments.length?e(uE(t=+n),dE(t)):t},J_(n)}function mE(){var e=fE(L_());return e.copy=function(){return O_(e,mE()).constant(e.constant())},Mv.apply(e,arguments)}function pE(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function hE(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function gE(e){return e<0?-e*e:e*e}function wE(e){var t=e(D_,D_),n=1;return t.exponent=function(t){return arguments.length?1===(n=+t)?e(D_,D_):.5===n?e(hE,gE):e(pE(n),pE(1/n)):n},J_(t)}function yE(){var e=wE(L_());return e.copy=function(){return O_(e,yE()).exponent(e.exponent())},Mv.apply(e,arguments),e}function bE(){return yE.apply(null,arguments).exponent(.5)}function vE(e){return Math.sign(e)*e*e}function xE(){var e,t=z_(),n=[0,1],r=!1;function a(n){var a=function(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}(t(n));return isNaN(a)?e:r?Math.round(a):a}return a.invert=function(e){return t.invert(vE(e))},a.domain=function(e){return arguments.length?(t.domain(e),a):t.domain()},a.range=function(e){return arguments.length?(t.range((n=Array.from(e,k_)).map(vE)),a):n.slice()},a.rangeRound=function(e){return a.range(e).round(!0)},a.round=function(e){return arguments.length?(r=!!e,a):r},a.clamp=function(e){return arguments.length?(t.clamp(e),a):t.clamp()},a.unknown=function(t){return arguments.length?(e=t,a):e},a.copy=function(){return xE(t.domain(),n).round(r).clamp(t.clamp()).unknown(e)},Mv.apply(a,arguments),J_(a)}function _E(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n<t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let a of e)null!=(a=t(a,++r,e))&&(n<a||void 0===n&&a>=a)&&(n=a)}return n}function EE(e,t){let n;if(void 0===t)for(const t of e)null!=t&&(n>t||void 0===n&&t>=t)&&(n=t);else{let r=-1;for(let a of e)null!=(a=t(a,++r,e))&&(n>a||void 0===n&&a>=a)&&(n=a)}return n}function NE(e,t){return(null==e||!(e>=e))-(null==t||!(t>=t))||(e<t?-1:e>t?1:0)}function ME(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=void 0===a?NE:function(e=Nx){if(e===Nx)return NE;if("function"!=typeof e)throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||0===r?r:(0===e(n,n))-(0===e(t,t))}}(a);r>n;){if(r-n>600){const o=r-n+1,i=t-n+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(i-o/2<0?-1:1);ME(e,t,Math.max(n,Math.floor(t-i*l/o+c)),Math.min(r,Math.floor(t+(o-i)*l/o+c)),a)}const o=e[t];let i=n,s=r;for(IE(e,n,t),a(e[r],o)>0&&IE(e,n,r);i<s;){for(IE(e,i,s),++i,--s;a(e[i],o)<0;)++i;for(;a(e[s],o)>0;)--s}0===a(e[n],o)?IE(e,n,s):(++s,IE(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}return e}function IE(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function SE(e,t,n=kx){if((r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,o=Math.floor(a),i=+n(e[o],o,e);return i+(+n(e[o+1],o+1,e)-i)*(a-o)}}function kE(){var e,t=[],n=[],r=[];function a(){var e=0,a=Math.max(1,n.length);for(r=new Array(a-1);++e<a;)r[e-1]=SE(t,e/a);return o}function o(t){return null==t||isNaN(t=+t)?e:n[Cx(r,t)]}return o.invertExtent=function(e){var a=n.indexOf(e);return a<0?[NaN,NaN]:[a>0?r[a-1]:t[0],a<r.length?r[a]:t[t.length-1]]},o.domain=function(e){if(!arguments.length)return t.slice();t=[];for(let n of e)null==n||isNaN(n=+n)||t.push(n);return t.sort(Nx),a()},o.range=function(e){return arguments.length?(n=Array.from(e),a()):n.slice()},o.unknown=function(t){return arguments.length?(e=t,o):e},o.quantiles=function(){return r.slice()},o.copy=function(){return kE().domain(t).range(n).unknown(e)},Mv.apply(o,arguments)}function jE(){var e,t=0,n=1,r=1,a=[.5],o=[0,1];function i(t){return null!=t&&t<=t?o[Cx(a,t,0,r)]:e}function s(){var e=-1;for(a=new Array(r);++e<r;)a[e]=((e+1)*n-(e-r)*t)/(r+1);return i}return i.domain=function(e){return arguments.length?([t,n]=e,t=+t,n=+n,s()):[t,n]},i.range=function(e){return arguments.length?(r=(o=Array.from(e)).length-1,s()):o.slice()},i.invertExtent=function(e){var i=o.indexOf(e);return i<0?[NaN,NaN]:i<1?[t,a[0]]:i>=r?[a[r-1],n]:[a[i-1],a[i]]},i.unknown=function(t){return arguments.length?(e=t,i):i},i.thresholds=function(){return a.slice()},i.copy=function(){return jE().domain([t,n]).range(o).unknown(e)},Mv.apply(J_(i),arguments)}function DE(){var e,t=[.5],n=[0,1],r=1;function a(a){return null!=a&&a<=a?n[Cx(t,a,0,r)]:e}return a.domain=function(e){return arguments.length?(t=Array.from(e),r=Math.min(t.length,n.length-1),a):t.slice()},a.range=function(e){return arguments.length?(n=Array.from(e),r=Math.min(t.length,n.length-1),a):n.slice()},a.invertExtent=function(e){var r=n.indexOf(e);return[t[r-1],t[r]]},a.unknown=function(t){return arguments.length?(e=t,a):e},a.copy=function(){return DE().domain(t).range(n).unknown(e)},Mv.apply(a,arguments)}Z_=function(e){var t,n,r=void 0===e.grouping||void 0===e.thousands?W_:(t=$_.call(e.grouping,Number),n=e.thousands+"",function(e,r){for(var a=e.length,o=[],i=0,s=t[0],l=0;a>0&&s>0&&(l+s+1>r&&(s=Math.max(1,r-l)),o.push(e.substring(a-=s,a+s)),!((l+=s+1)>r));)s=t[i=(i+1)%t.length];return o.reverse().join(n)}),a=void 0===e.currency?"":e.currency[0]+"",o=void 0===e.currency?"":e.currency[1]+"",i=void 0===e.decimal?".":e.decimal+"",s=void 0===e.numerals?W_:function(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}($_.call(e.numerals,String)),l=void 0===e.percent?"%":e.percent+"",c=void 0===e.minus?"−":e.minus+"",u=void 0===e.nan?"NaN":e.nan+"";function d(e,t){var n=(e=U_(e)).fill,d=e.align,f=e.sign,m=e.symbol,p=e.zero,h=e.width,g=e.comma,w=e.precision,y=e.trim,b=e.type;"n"===b?(g=!0,b="g"):V_[b]||(void 0===w&&(w=12),y=!0,b="g"),(p||"0"===n&&"="===d)&&(p=!0,n="0",d="=");var v=(t&&void 0!==t.prefix?t.prefix:"")+("$"===m?a:"#"===m&&/[boxX]/.test(b)?"0"+b.toLowerCase():""),x=("$"===m?o:/[%p]/.test(b)?l:"")+(t&&void 0!==t.suffix?t.suffix:""),_=V_[b],E=/[defgprs%]/.test(b);function N(e){var t,a,o,l=v,m=x;if("c"===b)m=_(e)+m,e="";else{var N=(e=+e)<0||1/e<0;if(e=isNaN(e)?u:_(Math.abs(e),w),y&&(e=function(e){e:for(var t,n=e.length,r=1,a=-1;r<n;++r)switch(e[r]){case".":a=t=r;break;case"0":0===a&&(a=r),t=r;break;default:if(!+e[r])break e;a>0&&(a=0)}return a>0?e.slice(0,a)+e.slice(t+1):e}(e)),N&&0===+e&&"+"!==f&&(N=!1),l=(N?"("===f?f:c:"-"===f||"("===f?"":f)+l,m=("s"!==b||isNaN(e)||void 0===P_?"":X_[8+P_/3])+m+(N&&"("===f?")":""),E)for(t=-1,a=e.length;++t<a;)if(48>(o=e.charCodeAt(t))||o>57){m=(46===o?i+e.slice(t+1):e.slice(t))+m,e=e.slice(0,t);break}}g&&!p&&(e=r(e,1/0));var M=l.length+e.length+m.length,I=M<h?new Array(h-M+1).join(n):"";switch(g&&p&&(e=r(I+e,I.length?h-m.length:1/0),I=""),d){case"<":e=l+e+m+I;break;case"=":e=l+I+e+m;break;case"^":e=I.slice(0,M=I.length>>1)+l+e+m+I.slice(M);break;default:e=I+l+e+m}return s(e)}return w=void 0===w?6:/[gprs]/.test(b)?Math.max(1,Math.min(21,w)):Math.max(0,Math.min(20,w)),N.toString=function(){return e+""},N}return{format:d,formatPrefix:function(e,t){var n=3*Math.max(-8,Math.min(8,Math.floor(Y_(t)/3))),r=Math.pow(10,-n),a=d(((e=U_(e)).type="f",e),{suffix:X_[8+n/3]});return function(e){return a(r*e)}}}}({thousands:",",grouping:[3],currency:["$",""]}),G_=Z_.format,H_=Z_.formatPrefix;const CE=1e3,AE=6e4,TE=36e5,OE=864e5,LE=6048e5,zE=31536e6,PE=new Date,RE=new Date;function UE(e,t,n,r){function a(t){return e(t=0===arguments.length?new Date:new Date(+t)),t}return a.floor=t=>(e(t=new Date(+t)),t),a.ceil=n=>(e(n=new Date(n-1)),t(n,1),e(n),n),a.round=e=>{const t=a(e),n=a.ceil(e);return e-t<n-e?t:n},a.offset=(e,n)=>(t(e=new Date(+e),null==n?1:Math.floor(n)),e),a.range=(n,r,o)=>{const i=[];if(n=a.ceil(n),o=null==o?1:Math.floor(o),!(n<r&&o>0))return i;let s;do{i.push(s=new Date(+n)),t(n,o),e(n)}while(s<n&&n<r);return i},a.filter=n=>UE(t=>{if(t>=t)for(;e(t),!n(t);)t.setTime(t-1)},(e,r)=>{if(e>=e)if(r<0)for(;++r<=0;)for(;t(e,-1),!n(e););else for(;--r>=0;)for(;t(e,1),!n(e););}),n&&(a.count=(t,r)=>(PE.setTime(+t),RE.setTime(+r),e(PE),e(RE),Math.floor(n(PE,RE))),a.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?a.filter(r?t=>r(t)%e===0:t=>a.count(0,t)%e===0):a:null)),a}const BE=UE(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);BE.every=e=>(e=Math.floor(e),isFinite(e)&&e>0?e>1?UE(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):BE:null),BE.range;const FE=UE(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*CE)},(e,t)=>(t-e)/CE,e=>e.getUTCSeconds()),YE=(FE.range,UE(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*CE)},(e,t)=>{e.setTime(+e+t*AE)},(e,t)=>(t-e)/AE,e=>e.getMinutes())),QE=(YE.range,UE(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*AE)},(e,t)=>(t-e)/AE,e=>e.getUTCMinutes())),VE=(QE.range,UE(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*CE-e.getMinutes()*AE)},(e,t)=>{e.setTime(+e+t*TE)},(e,t)=>(t-e)/TE,e=>e.getHours())),WE=(VE.range,UE(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*TE)},(e,t)=>(t-e)/TE,e=>e.getUTCHours())),ZE=(WE.range,UE(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*AE)/OE,e=>e.getDate()-1)),GE=(ZE.range,UE(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/OE,e=>e.getUTCDate()-1)),HE=(GE.range,UE(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/OE,e=>Math.floor(e/OE)));function $E(e){return UE(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+7*t)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*AE)/LE)}HE.range;const XE=$E(0),qE=$E(1),JE=$E(2),KE=$E(3),eN=$E(4),tN=$E(5),nN=$E(6);function rN(e){return UE(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+7*t)},(e,t)=>(t-e)/LE)}XE.range,qE.range,JE.range,KE.range,eN.range,tN.range,nN.range;const aN=rN(0),oN=rN(1),iN=rN(2),sN=rN(3),lN=rN(4),cN=rN(5),uN=rN(6),dN=(aN.range,oN.range,iN.range,sN.range,lN.range,cN.range,uN.range,UE(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+12*(t.getFullYear()-e.getFullYear()),e=>e.getMonth())),fN=(dN.range,UE(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+12*(t.getUTCFullYear()-e.getUTCFullYear()),e=>e.getUTCMonth())),mN=(fN.range,UE(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear()));mN.every=e=>isFinite(e=Math.floor(e))&&e>0?UE(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)}):null,mN.range;const pN=UE(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());function hN(e,t,n,r,a,o){const i=[[FE,1,CE],[FE,5,5e3],[FE,15,15e3],[FE,30,3e4],[o,1,AE],[o,5,3e5],[o,15,9e5],[o,30,18e5],[a,1,TE],[a,3,108e5],[a,6,216e5],[a,12,432e5],[r,1,OE],[r,2,1728e5],[n,1,LE],[t,1,2592e6],[t,3,7776e6],[e,1,zE]];function s(t,n,r){const a=Math.abs(n-t)/r,o=Ix(([,,e])=>e).right(i,a);if(o===i.length)return e.every(Ex(t/zE,n/zE,r));if(0===o)return BE.every(Math.max(Ex(t,n,r),1));const[s,l]=i[a/i[o-1][2]<i[o][2]/a?o-1:o];return s.every(l)}return[function(e,t,n){const r=t<e;r&&([e,t]=[t,e]);const a=n&&"function"==typeof n.range?n:s(e,t,n),o=a?a.range(e,+t+1):[];return r?o.reverse():o},s]}pN.every=e=>isFinite(e=Math.floor(e))&&e>0?UE(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)}):null,pN.range;const[gN,wN]=hN(pN,fN,aN,HE,WE,QE),[yN,bN]=hN(mN,dN,XE,ZE,VE,YE);function vN(e){if(0<=e.y&&e.y<100){var t=new Date(-1,e.m,e.d,e.H,e.M,e.S,e.L);return t.setFullYear(e.y),t}return new Date(e.y,e.m,e.d,e.H,e.M,e.S,e.L)}function xN(e){if(0<=e.y&&e.y<100){var t=new Date(Date.UTC(-1,e.m,e.d,e.H,e.M,e.S,e.L));return t.setUTCFullYear(e.y),t}return new Date(Date.UTC(e.y,e.m,e.d,e.H,e.M,e.S,e.L))}function _N(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}var EN,NN,MN,IN={"-":"",_:" ",0:"0"},SN=/^\s*\d+/,kN=/^%/,jN=/[\\^$*+?|[\]().{}]/g;function DN(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",o=a.length;return r+(o<n?new Array(n-o+1).join(t)+a:a)}function CN(e){return e.replace(jN,"\\$&")}function AN(e){return new RegExp("^(?:"+e.map(CN).join("|")+")","i")}function TN(e){return new Map(e.map((e,t)=>[e.toLowerCase(),t]))}function ON(e,t,n){var r=SN.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function LN(e,t,n){var r=SN.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function zN(e,t,n){var r=SN.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function PN(e,t,n){var r=SN.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function RN(e,t,n){var r=SN.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function UN(e,t,n){var r=SN.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function BN(e,t,n){var r=SN.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function FN(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function YN(e,t,n){var r=SN.exec(t.slice(n,n+1));return r?(e.q=3*r[0]-3,n+r[0].length):-1}function QN(e,t,n){var r=SN.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function VN(e,t,n){var r=SN.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function WN(e,t,n){var r=SN.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function ZN(e,t,n){var r=SN.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function GN(e,t,n){var r=SN.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function HN(e,t,n){var r=SN.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function $N(e,t,n){var r=SN.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function XN(e,t,n){var r=SN.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function qN(e,t,n){var r=kN.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function JN(e,t,n){var r=SN.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function KN(e,t,n){var r=SN.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function eM(e,t){return DN(e.getDate(),t,2)}function tM(e,t){return DN(e.getHours(),t,2)}function nM(e,t){return DN(e.getHours()%12||12,t,2)}function rM(e,t){return DN(1+ZE.count(mN(e),e),t,3)}function aM(e,t){return DN(e.getMilliseconds(),t,3)}function oM(e,t){return aM(e,t)+"000"}function iM(e,t){return DN(e.getMonth()+1,t,2)}function sM(e,t){return DN(e.getMinutes(),t,2)}function lM(e,t){return DN(e.getSeconds(),t,2)}function cM(e){var t=e.getDay();return 0===t?7:t}function uM(e,t){return DN(XE.count(mN(e)-1,e),t,2)}function dM(e){var t=e.getDay();return t>=4||0===t?eN(e):eN.ceil(e)}function fM(e,t){return e=dM(e),DN(eN.count(mN(e),e)+(4===mN(e).getDay()),t,2)}function mM(e){return e.getDay()}function pM(e,t){return DN(qE.count(mN(e)-1,e),t,2)}function hM(e,t){return DN(e.getFullYear()%100,t,2)}function gM(e,t){return DN((e=dM(e)).getFullYear()%100,t,2)}function wM(e,t){return DN(e.getFullYear()%1e4,t,4)}function yM(e,t){var n=e.getDay();return DN((e=n>=4||0===n?eN(e):eN.ceil(e)).getFullYear()%1e4,t,4)}function bM(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+DN(t/60|0,"0",2)+DN(t%60,"0",2)}function vM(e,t){return DN(e.getUTCDate(),t,2)}function xM(e,t){return DN(e.getUTCHours(),t,2)}function _M(e,t){return DN(e.getUTCHours()%12||12,t,2)}function EM(e,t){return DN(1+GE.count(pN(e),e),t,3)}function NM(e,t){return DN(e.getUTCMilliseconds(),t,3)}function MM(e,t){return NM(e,t)+"000"}function IM(e,t){return DN(e.getUTCMonth()+1,t,2)}function SM(e,t){return DN(e.getUTCMinutes(),t,2)}function kM(e,t){return DN(e.getUTCSeconds(),t,2)}function jM(e){var t=e.getUTCDay();return 0===t?7:t}function DM(e,t){return DN(aN.count(pN(e)-1,e),t,2)}function CM(e){var t=e.getUTCDay();return t>=4||0===t?lN(e):lN.ceil(e)}function AM(e,t){return e=CM(e),DN(lN.count(pN(e),e)+(4===pN(e).getUTCDay()),t,2)}function TM(e){return e.getUTCDay()}function OM(e,t){return DN(oN.count(pN(e)-1,e),t,2)}function LM(e,t){return DN(e.getUTCFullYear()%100,t,2)}function zM(e,t){return DN((e=CM(e)).getUTCFullYear()%100,t,2)}function PM(e,t){return DN(e.getUTCFullYear()%1e4,t,4)}function RM(e,t){var n=e.getUTCDay();return DN((e=n>=4||0===n?lN(e):lN.ceil(e)).getUTCFullYear()%1e4,t,4)}function UM(){return"+0000"}function BM(){return"%"}function FM(e){return+e}function YM(e){return Math.floor(+e/1e3)}function QM(e){return new Date(e)}function VM(e){return e instanceof Date?+e:+new Date(+e)}function WM(e,t,n,r,a,o,i,s,l,c){var u=z_(),d=u.invert,f=u.domain,m=c(".%L"),p=c(":%S"),h=c("%I:%M"),g=c("%I %p"),w=c("%a %d"),y=c("%b %d"),b=c("%B"),v=c("%Y");function x(e){return(l(e)<e?m:s(e)<e?p:i(e)<e?h:o(e)<e?g:r(e)<e?a(e)<e?w:y:n(e)<e?b:v)(e)}return u.invert=function(e){return new Date(d(e))},u.domain=function(e){return arguments.length?f(Array.from(e,VM)):f().map(QM)},u.ticks=function(t){var n=f();return e(n[0],n[n.length-1],null==t?10:t)},u.tickFormat=function(e,t){return null==t?x:c(t)},u.nice=function(e){var n=f();return e&&"function"==typeof e.range||(e=t(n[0],n[n.length-1],null==e?10:e)),e?f(tE(n,e)):u},u.copy=function(){return O_(u,WM(e,t,n,r,a,o,i,s,l,c))},u}function ZM(){return Mv.apply(WM(yN,bN,mN,dN,XE,ZE,VE,YE,FE,NN).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function GM(){return Mv.apply(WM(gN,wN,pN,fN,aN,GE,WE,QE,FE,MN).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function HM(){var e,t,n,r,a,o=0,i=1,s=D_,l=!1;function c(t){return null==t||isNaN(t=+t)?a:s(0===n?.5:(t=(r(t)-e)*n,l?Math.max(0,Math.min(1,t)):t))}function u(e){return function(t){var n,r;return arguments.length?([n,r]=t,s=e(n,r),c):[s(0),s(1)]}}return c.domain=function(a){return arguments.length?([o,i]=a,e=r(o=+o),t=r(i=+i),n=e===t?0:1/(t-e),c):[o,i]},c.clamp=function(e){return arguments.length?(l=!!e,c):l},c.interpolator=function(e){return arguments.length?(s=e,c):s},c.range=u(I_),c.rangeRound=u(S_),c.unknown=function(e){return arguments.length?(a=e,c):a},function(a){return r=a,e=a(o),t=a(i),n=e===t?0:1/(t-e),c}}function $M(e,t){return t.domain(e.domain()).interpolator(e.interpolator()).clamp(e.clamp()).unknown(e.unknown())}function XM(){var e=J_(HM()(D_));return e.copy=function(){return $M(e,XM())},Iv.apply(e,arguments)}function qM(){var e=lE(HM()).domain([1,10]);return e.copy=function(){return $M(e,qM()).base(e.base())},Iv.apply(e,arguments)}function JM(){var e=fE(HM());return e.copy=function(){return $M(e,JM()).constant(e.constant())},Iv.apply(e,arguments)}function KM(){var e=wE(HM());return e.copy=function(){return $M(e,KM()).exponent(e.exponent())},Iv.apply(e,arguments)}function eI(){return KM.apply(null,arguments).exponent(.5)}function tI(){var e=[],t=D_;function n(n){if(null!=n&&!isNaN(n=+n))return t((Cx(e,n,1)-1)/(e.length-1))}return n.domain=function(t){if(!arguments.length)return e.slice();e=[];for(let n of t)null==n||isNaN(n=+n)||e.push(n);return e.sort(Nx),n},n.interpolator=function(e){return arguments.length?(t=e,n):t},n.range=function(){return e.map((n,r)=>t(r/(e.length-1)))},n.quantiles=function(t){return Array.from({length:t+1},(n,r)=>function(e,t,n){if(e=Float64Array.from(function*(e,t){if(void 0===t)for(let t of e)null!=t&&(t=+t)>=t&&(yield t);else{let n=-1;for(let r of e)null!=(r=t(r,++n,e))&&(r=+r)>=r&&(yield r)}}(e,n)),(r=e.length)&&!isNaN(t=+t)){if(t<=0||r<2)return EE(e);if(t>=1)return _E(e);var r,a=(r-1)*t,o=Math.floor(a),i=_E(ME(e,o).subarray(0,o+1));return i+(EE(e.subarray(o+1))-i)*(a-o)}}(e,r/t))},n.copy=function(){return tI(t).domain(e)},Iv.apply(n,arguments)}function nI(){var e,t,n,r,a,o,i,s=0,l=.5,c=1,u=1,d=D_,f=!1;function m(e){return isNaN(e=+e)?i:(e=.5+((e=+o(e))-t)*(u*e<u*t?r:a),d(f?Math.max(0,Math.min(1,e)):e))}function p(e){return function(t){var n,r,a;return arguments.length?([n,r,a]=t,d=function(e,t){void 0===t&&(t=e,e=I_);for(var n=0,r=t.length-1,a=t[0],o=new Array(r<0?0:r);n<r;)o[n]=e(a,a=t[++n]);return function(e){var t=Math.max(0,Math.min(r-1,Math.floor(e*=r)));return o[t](e-t)}}(e,[n,r,a]),m):[d(0),d(.5),d(1)]}}return m.domain=function(i){return arguments.length?([s,l,c]=i,e=o(s=+s),t=o(l=+l),n=o(c=+c),r=e===t?0:.5/(t-e),a=t===n?0:.5/(n-t),u=t<e?-1:1,m):[s,l,c]},m.clamp=function(e){return arguments.length?(f=!!e,m):f},m.interpolator=function(e){return arguments.length?(d=e,m):d},m.range=p(I_),m.rangeRound=p(S_),m.unknown=function(e){return arguments.length?(i=e,m):i},function(i){return o=i,e=i(s),t=i(l),n=i(c),r=e===t?0:.5/(t-e),a=t===n?0:.5/(n-t),u=t<e?-1:1,m}}function rI(){var e=J_(nI()(D_));return e.copy=function(){return $M(e,rI())},Iv.apply(e,arguments)}function aI(){var e=lE(nI()).domain([.1,1,10]);return e.copy=function(){return $M(e,aI()).base(e.base())},Iv.apply(e,arguments)}function oI(){var e=fE(nI());return e.copy=function(){return $M(e,oI()).constant(e.constant())},Iv.apply(e,arguments)}function iI(){var e=wE(nI());return e.copy=function(){return $M(e,iI()).exponent(e.exponent())},Iv.apply(e,arguments)}function sI(){return iI.apply(null,arguments).exponent(.5)}function lI(e,t){if((a=e.length)>1)for(var n,r,a,o=1,i=e[t[0]],s=i.length;o<a;++o)for(r=i,i=e[t[o]],n=0;n<s;++n)i[n][1]+=i[n][0]=isNaN(r[n][1])?r[n][0]:r[n][1]}function cI(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function uI(e){for(var t=e.length,n=new Array(t);--t>=0;)n[t]=t;return n}function dI(e,t){return e[t]}function fI(e){const t=[];return t.key=e,t}EN=function(e){var t=e.dateTime,n=e.date,r=e.time,a=e.periods,o=e.days,i=e.shortDays,s=e.months,l=e.shortMonths,c=AN(a),u=TN(a),d=AN(o),f=TN(o),m=AN(i),p=TN(i),h=AN(s),g=TN(s),w=AN(l),y=TN(l),b={a:function(e){return i[e.getDay()]},A:function(e){return o[e.getDay()]},b:function(e){return l[e.getMonth()]},B:function(e){return s[e.getMonth()]},c:null,d:eM,e:eM,f:oM,g:gM,G:yM,H:tM,I:nM,j:rM,L:aM,m:iM,M:sM,p:function(e){return a[+(e.getHours()>=12)]},q:function(e){return 1+~~(e.getMonth()/3)},Q:FM,s:YM,S:lM,u:cM,U:uM,V:fM,w:mM,W:pM,x:null,X:null,y:hM,Y:wM,Z:bM,"%":BM},v={a:function(e){return i[e.getUTCDay()]},A:function(e){return o[e.getUTCDay()]},b:function(e){return l[e.getUTCMonth()]},B:function(e){return s[e.getUTCMonth()]},c:null,d:vM,e:vM,f:MM,g:zM,G:RM,H:xM,I:_M,j:EM,L:NM,m:IM,M:SM,p:function(e){return a[+(e.getUTCHours()>=12)]},q:function(e){return 1+~~(e.getUTCMonth()/3)},Q:FM,s:YM,S:kM,u:jM,U:DM,V:AM,w:TM,W:OM,x:null,X:null,y:LM,Y:PM,Z:UM,"%":BM},x={a:function(e,t,n){var r=m.exec(t.slice(n));return r?(e.w=p.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(e,t,n){var r=d.exec(t.slice(n));return r?(e.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(e,t,n){var r=w.exec(t.slice(n));return r?(e.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(e,t,n){var r=h.exec(t.slice(n));return r?(e.m=g.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(e,n,r){return N(e,t,n,r)},d:VN,e:VN,f:XN,g:BN,G:UN,H:ZN,I:ZN,j:WN,L:$N,m:QN,M:GN,p:function(e,t,n){var r=c.exec(t.slice(n));return r?(e.p=u.get(r[0].toLowerCase()),n+r[0].length):-1},q:YN,Q:JN,s:KN,S:HN,u:LN,U:zN,V:PN,w:ON,W:RN,x:function(e,t,r){return N(e,n,t,r)},X:function(e,t,n){return N(e,r,t,n)},y:BN,Y:UN,Z:FN,"%":qN};function _(e,t){return function(n){var r,a,o,i=[],s=-1,l=0,c=e.length;for(n instanceof Date||(n=new Date(+n));++s<c;)37===e.charCodeAt(s)&&(i.push(e.slice(l,s)),null!=(a=IN[r=e.charAt(++s)])?r=e.charAt(++s):a="e"===r?" ":"0",(o=t[r])&&(r=o(n,a)),i.push(r),l=s+1);return i.push(e.slice(l,s)),i.join("")}}function E(e,t){return function(n){var r,a,o=_N(1900,void 0,1);if(N(o,e,n+="",0)!=n.length)return null;if("Q"in o)return new Date(o.Q);if("s"in o)return new Date(1e3*o.s+("L"in o?o.L:0));if(t&&!("Z"in o)&&(o.Z=0),"p"in o&&(o.H=o.H%12+12*o.p),void 0===o.m&&(o.m="q"in o?o.q:0),"V"in o){if(o.V<1||o.V>53)return null;"w"in o||(o.w=1),"Z"in o?(a=(r=xN(_N(o.y,0,1))).getUTCDay(),r=a>4||0===a?oN.ceil(r):oN(r),r=GE.offset(r,7*(o.V-1)),o.y=r.getUTCFullYear(),o.m=r.getUTCMonth(),o.d=r.getUTCDate()+(o.w+6)%7):(a=(r=vN(_N(o.y,0,1))).getDay(),r=a>4||0===a?qE.ceil(r):qE(r),r=ZE.offset(r,7*(o.V-1)),o.y=r.getFullYear(),o.m=r.getMonth(),o.d=r.getDate()+(o.w+6)%7)}else("W"in o||"U"in o)&&("w"in o||(o.w="u"in o?o.u%7:"W"in o?1:0),a="Z"in o?xN(_N(o.y,0,1)).getUTCDay():vN(_N(o.y,0,1)).getDay(),o.m=0,o.d="W"in o?(o.w+6)%7+7*o.W-(a+5)%7:o.w+7*o.U-(a+6)%7);return"Z"in o?(o.H+=o.Z/100|0,o.M+=o.Z%100,xN(o)):vN(o)}}function N(e,t,n,r){for(var a,o,i=0,s=t.length,l=n.length;i<s;){if(r>=l)return-1;if(37===(a=t.charCodeAt(i++))){if(a=t.charAt(i++),!(o=x[a in IN?t.charAt(i++):a])||(r=o(e,n,r))<0)return-1}else if(a!=n.charCodeAt(r++))return-1}return r}return b.x=_(n,b),b.X=_(r,b),b.c=_(t,b),v.x=_(n,v),v.X=_(r,v),v.c=_(t,v),{format:function(e){var t=_(e+="",b);return t.toString=function(){return e},t},parse:function(e){var t=E(e+="",!1);return t.toString=function(){return e},t},utcFormat:function(e){var t=_(e+="",v);return t.toString=function(){return e},t},utcParse:function(e){var t=E(e+="",!0);return t.toString=function(){return e},t}}}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),NN=EN.format,EN.parse,MN=EN.utcFormat,EN.utcParse,Array.prototype.slice;var mI=a(4506),pI=a.n(mI),hI=a(1684),gI=a.n(hI),wI=a(7307),yI=a.n(wI),bI=a(2404),vI=a.n(bI),xI=a(8351),_I=a.n(xI);function EI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var NI=function(e){return e},MI={"@@functional/placeholder":!0},II=function(e){return e===MI},SI=function(e){return function t(){return 0===arguments.length||1===arguments.length&&II(arguments.length<=0?void 0:arguments[0])?t:e.apply(void 0,arguments)}},kI=function e(t,n){return 1===t?n:SI(function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];var i=a.filter(function(e){return e!==MI}).length;return i>=t?n.apply(void 0,a):e(t-i,SI(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var o,i=a.map(function(e){return II(e)?t.shift():e});return n.apply(void 0,(o=i,function(e){if(Array.isArray(e))return EI(e)}(o)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(o)||function(e,t){if(e){if("string"==typeof e)return EI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?EI(e,t):void 0}}(o)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).concat(t))}))})},jI=function(e){return kI(e.length,e)},DI=function(e,t){for(var n=[],r=e;r<t;++r)n[r-e]=r;return n},CI=jI(function(e,t){return Array.isArray(t)?t.map(e):Object.keys(t).map(function(e){return t[e]}).map(e)}),AI=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(!t.length)return NI;var r=t.reverse(),a=r[0],o=r.slice(1);return function(){return o.reduce(function(e,t){return t(e)},a.apply(void 0,arguments))}},TI=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},OI=function(e){var t=null,n=null;return function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return t&&a.every(function(e,n){return e===t[n]})?n:(t=a,n=e.apply(void 0,a))}};jI(function(e,t,n){var r=+e;return r+n*(+t-r)}),jI(function(e,t,n){var r=t-+e;return(n-e)/(r||1/0)}),jI(function(e,t,n){var r=t-+e;return r=r||1/0,Math.max(0,Math.min(1,(n-e)/r))});const LI=function(e,t,n){for(var r=new(_I())(e),a=0,o=[];r.lt(t)&&a<1e5;)o.push(r.toNumber()),r=r.add(n),a++;return o},zI=function(e){return 0===e?1:Math.floor(new(_I())(e).abs().log(10).toNumber())+1};function PI(e){return function(e){if(Array.isArray(e))return BI(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||UI(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function RI(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var n=[],_n=!0,r=!1,a=void 0;try{for(var o,i=e[Symbol.iterator]();!(_n=(o=i.next()).done)&&(n.push(o.value),!t||n.length!==t);_n=!0);}catch(e){r=!0,a=e}finally{try{_n||null==i.return||i.return()}finally{if(r)throw a}}return n}}(e,t)||UI(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function UI(e,t){if(e){if("string"==typeof e)return BI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?BI(e,t):void 0}}function BI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function FI(e){var t=RI(e,2),n=t[0],r=t[1],a=n,o=r;return n>r&&(a=r,o=n),[a,o]}function YI(e,t,n){if(e.lte(0))return new(_I())(0);var r=zI(e.toNumber()),a=new(_I())(10).pow(r),o=e.div(a),i=1!==r?.05:.1,s=new(_I())(Math.ceil(o.div(i).toNumber())).add(n).mul(i).mul(a);return t?s:new(_I())(Math.ceil(s))}function QI(e,t,n){var r=1,a=new(_I())(e);if(!a.isint()&&n){var o=Math.abs(e);o<1?(r=new(_I())(10).pow(zI(e)-1),a=new(_I())(Math.floor(a.div(r).toNumber())).mul(r)):o>1&&(a=new(_I())(Math.floor(e)))}else 0===e?a=new(_I())(Math.floor((t-1)/2)):n||(a=new(_I())(Math.floor(e)));var i=Math.floor((t-1)/2),s=AI(CI(function(e){return a.add(new(_I())(e-i).mul(r)).toNumber()}),DI);return s(0,t)}function VI(e,t,n,r){var a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new(_I())(0),tickMin:new(_I())(0),tickMax:new(_I())(0)};var o,i=YI(new(_I())(t).sub(e).div(n-1),r,a);o=e<=0&&t>=0?new(_I())(0):(o=new(_I())(e).add(t).div(2)).sub(new(_I())(o).mod(i));var s=Math.ceil(o.sub(e).div(i).toNumber()),l=Math.ceil(new(_I())(t).sub(o).div(i).toNumber()),c=s+l+1;return c>n?VI(e,t,n,r,a+1):(c<n&&(l=t>0?l+(n-c):l,s=t>0?s:s+(n-c)),{step:i,tickMin:o.sub(new(_I())(s).mul(i)),tickMax:o.add(new(_I())(l).mul(i))})}var WI=OI(function(e){var t=RI(e,2),n=t[0],r=t[1],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=Math.max(a,2),s=RI(FI([n,r]),2),l=s[0],c=s[1];if(l===-1/0||c===1/0){var u=c===1/0?[l].concat(PI(DI(0,a-1).map(function(){return 1/0}))):[].concat(PI(DI(0,a-1).map(function(){return-1/0})),[c]);return n>r?TI(u):u}if(l===c)return QI(l,a,o);var d=VI(l,c,i,o),f=d.step,m=d.tickMin,p=d.tickMax,h=LI(m,p.add(new(_I())(.1).mul(f)),f);return n>r?TI(h):h}),ZI=(OI(function(e){var t=RI(e,2),n=t[0],r=t[1],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=Math.max(a,2),s=RI(FI([n,r]),2),l=s[0],c=s[1];if(l===-1/0||c===1/0)return[n,r];if(l===c)return QI(l,a,o);var u=YI(new(_I())(c).sub(l).div(i-1),o,0),d=AI(CI(function(e){return new(_I())(l).add(new(_I())(e).mul(u)).toNumber()}),DI),f=d(0,i).filter(function(e){return e>=l&&e<=c});return n>r?TI(f):f}),OI(function(e,t){var n=RI(e,2),r=n[0],a=n[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=RI(FI([r,a]),2),s=i[0],l=i[1];if(s===-1/0||l===1/0)return[r,a];if(s===l)return[s];var c=Math.max(t,2),u=YI(new(_I())(l).sub(s).div(c-1),o,0),d=[].concat(PI(LI(new(_I())(s),new(_I())(l).sub(new(_I())(.99).mul(u)),u)),[l]);return r>a?TI(d):d})),GI=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function HI(e){return HI="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},HI(e)}function $I(){return $I=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$I.apply(this,arguments)}function XI(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qI(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,nS(r.key),r)}}function JI(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(JI=function(){return!!e})()}function KI(e){return KI=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},KI(e)}function eS(e,t){return eS=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},eS(e,t)}function tS(e,t,n){return(t=nS(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nS(e){var t=function(e){if("object"!=HI(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=HI(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==HI(t)?t:t+""}var rS=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=KI(t),function(e,t){if(t&&("object"===HI(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,JI()?Reflect.construct(t,n||[],KI(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eS(e,t)}(t,e),n=t,r=[{key:"render",value:function(){var e=this.props,t=e.offset,n=e.layout,r=e.width,a=e.dataKey,o=e.data,i=e.dataPointFormatter,s=e.xAxis,c=e.yAxis,u=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,GI),d=Dg(u,!1);"x"===this.props.direction&&"number"!==s.type&&(0,N.A)(!1);var f=o.map(function(e){var o=i(e,a),u=o.x,f=o.y,m=o.value,p=o.errorVal;if(!p)return null;var h,g,w=[];if(Array.isArray(p)){var y=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return XI(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XI(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(p,2);h=y[0],g=y[1]}else h=g=p;if("vertical"===n){var b=s.scale,v=f+t,x=v+r,_=v-r,E=b(m-h),N=b(m+g);w.push({x1:N,y1:x,x2:N,y2:_}),w.push({x1:E,y1:v,x2:N,y2:v}),w.push({x1:E,y1:x,x2:E,y2:_})}else if("horizontal"===n){var M=c.scale,I=u+t,S=I-r,k=I+r,j=M(m-h),D=M(m+g);w.push({x1:S,y1:D,x2:k,y2:D}),w.push({x1:I,y1:j,x2:I,y2:D}),w.push({x1:S,y1:j,x2:k,y2:j})}return l().createElement(Xg,$I({className:"recharts-errorBar",key:"bar-".concat(w.map(function(e){return"".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))},d),w.map(function(e){return l().createElement("line",$I({},e,{key:"line-".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)}))}))});return l().createElement(Xg,{className:"recharts-errorBars"},f)}}],r&&qI(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(l().Component);function aS(e){return aS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},aS(e)}function oS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function iS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oS(Object(n),!0).forEach(function(t){sS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function sS(e,t,n){return t=function(e){var t=function(e){if("object"!=aS(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=aS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==aS(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}tS(rS,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"}),tS(rS,"displayName","ErrorBar");var lS=function(e){var t=e.children,n=e.formattedGraphicalItems,r=e.legendWidth,a=e.legendContent,o=Sg(t,Wy);if(!o)return null;var i,s=Wy.defaultProps,l=void 0!==s?iS(iS({},s),o.props):{};return i=o.props&&o.props.payload?o.props&&o.props.payload:"children"===a?(n||[]).reduce(function(e,t){var n=t.item,r=t.props,a=r.sectors||r.data||[];return e.concat(a.map(function(e){return{type:o.props.iconType||n.props.legendType,value:e.name,color:e.fill,payload:e}}))},[]):(n||[]).map(function(e){var t=e.item,n=t.type.defaultProps,r=void 0!==n?iS(iS({},n),t.props):{},a=r.dataKey,o=r.name,i=r.legendType;return{inactive:r.hide,dataKey:a,type:l.iconType||i||"square",color:wS(t),value:o||a,payload:r}}),iS(iS(iS({},l),Wy.getWithHeight(o,r)),{},{payload:i,item:o})};function cS(e){return cS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cS(e)}function uS(e){return function(e){if(Array.isArray(e))return dS(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return dS(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dS(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function dS(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fS(Object(n),!0).forEach(function(t){pS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pS(e,t,n){return t=function(e){var t=function(e){if("object"!=cS(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=cS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==cS(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hS(e,t,n){return Wh()(e)||Wh()(t)?n:$h(t)?Fh()(e,t,n):og()(t)?t(e):n}function gS(e,t,n,r){var a=yI()(e,function(e){return hS(e,t)});if("number"===n){var o=a.filter(function(e){return Hh(e)||parseFloat(e)});return o.length?[gI()(o),pI()(o)]:[1/0,-1/0]}return(r?a.filter(function(e){return!Wh()(e)}):a).map(function(e){return $h(e)||e instanceof Date?e:""})}var wS=function(e){var t,n,r=e.type.displayName,a=null!==(t=e.type)&&void 0!==t&&t.defaultProps?mS(mS({},e.type.defaultProps),e.props):e.props,o=a.stroke,i=a.fill;switch(r){case"Line":n=o;break;case"Area":case"Radar":n=o&&"none"!==o?o:i;break;default:n=i}return n},yS=function(e,t,n,r,a){var o=Ig(t.props.children,rS).filter(function(e){return function(e,t,n){return!!Wh()(t)||("horizontal"===e?"yAxis"===t:"vertical"===e||"x"===n?"xAxis"===t:"y"!==n||"yAxis"===t)}(r,a,e.props.direction)});if(o&&o.length){var i=o.map(function(e){return e.props.dataKey});return e.reduce(function(e,t){var r=hS(t,n);if(Wh()(r))return e;var a=Array.isArray(r)?[gI()(r),pI()(r)]:[r,r],o=i.reduce(function(e,n){var r=hS(t,n,0),o=a[0]-Math.abs(Array.isArray(r)?r[0]:r),i=a[1]+Math.abs(Array.isArray(r)?r[1]:r);return[Math.min(o,e[0]),Math.max(i,e[1])]},[1/0,-1/0]);return[Math.min(o[0],e[0]),Math.max(o[1],e[1])]},[1/0,-1/0])}return null},bS=function(e,t,n,r,a){var o=t.map(function(t){var o=t.props.dataKey;return"number"===n&&o&&yS(e,t,o,r)||gS(e,o,n,a)});if("number"===n)return o.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]);var i={};return o.reduce(function(e,t){for(var n=0,r=t.length;n<r;n++)i[t[n]]||(i[t[n]]=!0,e.push(t[n]));return e},[])},vS=function(e,t){return"horizontal"===e&&"xAxis"===t||"vertical"===e&&"yAxis"===t||"centric"===e&&"angleAxis"===t||"radial"===e&&"radiusAxis"===t},xS=function(e,t,n,r){if(r)return e.map(function(e){return e.coordinate});var a,o,i=e.map(function(e){return e.coordinate===t&&(a=!0),e.coordinate===n&&(o=!0),e.coordinate});return a||i.push(t),o||i.push(n),i},_S=function(e,t,n){if(!e)return null;var r=e.scale,a=e.duplicateDomain,o=e.type,i=e.range,s="scaleBand"===e.realScaleType?r.bandwidth()/2:2,l=(t||n)&&"category"===o&&r.bandwidth?r.bandwidth()/s:0;return l="angleAxis"===e.axisType&&(null==i?void 0:i.length)>=2?2*Zh(i[0]-i[1])*l:l,t&&(e.ticks||e.niceTicks)?(e.ticks||e.niceTicks).map(function(e){var t=a?a.indexOf(e):e;return{coordinate:r(t)+l,value:e,offset:l}}).filter(function(e){return!Uh()(e.coordinate)}):e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(e,t){return{coordinate:r(e)+l,value:e,index:t,offset:l}}):r.ticks&&!n?r.ticks(e.tickCount).map(function(e){return{coordinate:r(e)+l,value:e,offset:l}}):r.domain().map(function(e,t){return{coordinate:r(e)+l,value:a?a[e]:e,index:t,offset:l}})},ES=new WeakMap,NS=function(e,t){if("function"!=typeof t)return e;ES.has(e)||ES.set(e,new WeakMap);var n=ES.get(e);if(n.has(t))return n.get(t);var r=function(){e.apply(void 0,arguments),t.apply(void 0,arguments)};return n.set(t,r),r},MS=1e-4,IS={sign:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var a=0,o=0,i=0;i<t;++i){var s=Uh()(e[i][n][1])?e[i][n][0]:e[i][n][1];s>=0?(e[i][n][0]=a,e[i][n][1]=a+s,a=e[i][n][1]):(e[i][n][0]=o,e[i][n][1]=o+s,o=e[i][n][1])}},expand:function(e,t){if((r=e.length)>0){for(var n,r,a,o=0,i=e[0].length;o<i;++o){for(a=n=0;n<r;++n)a+=e[n][o][1]||0;if(a)for(n=0;n<r;++n)e[n][o][1]/=a}lI(e,t)}},none:lI,silhouette:function(e,t){if((n=e.length)>0){for(var n,r=0,a=e[t[0]],o=a.length;r<o;++r){for(var i=0,s=0;i<n;++i)s+=e[i][r][1]||0;a[r][1]+=a[r][0]=-s/2}lI(e,t)}},wiggle:function(e,t){if((a=e.length)>0&&(r=(n=e[t[0]]).length)>0){for(var n,r,a,o=0,i=1;i<r;++i){for(var s=0,l=0,c=0;s<a;++s){for(var u=e[t[s]],d=u[i][1]||0,f=(d-(u[i-1][1]||0))/2,m=0;m<s;++m){var p=e[t[m]];f+=(p[i][1]||0)-(p[i-1][1]||0)}l+=d,c+=f*d}n[i-1][1]+=n[i-1][0]=o,l&&(o-=c/l)}n[i-1][1]+=n[i-1][0]=o,lI(e,t)}},positive:function(e){var t=e.length;if(!(t<=0))for(var n=0,r=e[0].length;n<r;++n)for(var a=0,o=0;o<t;++o){var i=Uh()(e[o][n][1])?e[o][n][0]:e[o][n][1];i>=0?(e[o][n][0]=a,e[o][n][1]=a+i,a=e[o][n][1]):(e[o][n][0]=0,e[o][n][1]=0)}}},SS=function(e,t,n){var r=t.map(function(e){return e.props.dataKey}),a=IS[n],o=function(){var e=iy([]),t=uI,n=lI,r=dI;function a(a){var o,i,s=Array.from(e.apply(this,arguments),fI),l=s.length,c=-1;for(const e of a)for(o=0,++c;o<l;++o)(s[o][c]=[0,+r(e,s[o].key,c,a)]).data=e;for(o=0,i=cI(t(s));o<l;++o)s[i[o]].index=o;return n(s,i),s}return a.keys=function(t){return arguments.length?(e="function"==typeof t?t:iy(Array.from(t)),a):e},a.value=function(e){return arguments.length?(r="function"==typeof e?e:iy(+e),a):r},a.order=function(e){return arguments.length?(t=null==e?uI:"function"==typeof e?e:iy(Array.from(e)),a):t},a.offset=function(e){return arguments.length?(n=null==e?lI:e,a):n},a}().keys(r).value(function(e,t){return+hS(e,t,0)}).order(uI).offset(a);return o(e)};function kS(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,o=e.index,i=e.dataKey;if("category"===t.type){if(!t.allowDuplicatedCategory&&t.dataKey&&!Wh()(a[t.dataKey])){var s=tg(n,"value",a[t.dataKey]);if(s)return s.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var l=hS(a,Wh()(i)?t.dataKey:i);return Wh()(l)?null:t.scale(l)}var jS=function(e){var t=e.axis,n=e.ticks,r=e.offset,a=e.bandSize,o=e.entry,i=e.index;if("category"===t.type)return n[i]?n[i].coordinate+r:null;var s=hS(o,t.dataKey,t.domain[i]);return Wh()(s)?null:t.scale(s)-a/2+r},DS=function(e,t,n){return Object.keys(e).reduce(function(r,a){var o=e[a].stackedData.reduce(function(e,r){var a=r.slice(t,n+1).reduce(function(e,t){return[gI()(t.concat([e[0]]).filter(Hh)),pI()(t.concat([e[1]]).filter(Hh))]},[1/0,-1/0]);return[Math.min(e[0],a[0]),Math.max(e[1],a[1])]},[1/0,-1/0]);return[Math.min(o[0],r[0]),Math.max(o[1],r[1])]},[1/0,-1/0]).map(function(e){return e===1/0||e===-1/0?0:e})},CS=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,AS=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,TS=function(e,t,n){if(og()(e))return e(t,n);if(!Array.isArray(e))return t;var r=[];if(Hh(e[0]))r[0]=n?e[0]:Math.min(e[0],t[0]);else if(CS.test(e[0])){var a=+CS.exec(e[0])[1];r[0]=t[0]-a}else og()(e[0])?r[0]=e[0](t[0]):r[0]=t[0];if(Hh(e[1]))r[1]=n?e[1]:Math.max(e[1],t[1]);else if(AS.test(e[1])){var o=+AS.exec(e[1])[1];r[1]=t[1]+o}else og()(e[1])?r[1]=e[1](t[1]):r[1]=t[1];return r},OS=function(e,t,n){if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var a=Vg()(t,function(e){return e.coordinate}),o=1/0,i=1,s=a.length;i<s;i++){var l=a[i],c=a[i-1];o=Math.min((l.coordinate||0)-(c.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},LS=function(e,t,n){return e&&e.length?vI()(e,Fh()(n,"type.defaultProps.domain"))?t:e:t},zS=function(e,t){var n=e.type.defaultProps?mS(mS({},e.type.defaultProps),e.props):e.props,r=n.dataKey,a=n.name,o=n.unit,i=n.formatter,s=n.tooltipType,l=n.chartType,c=n.hide;return mS(mS({},Dg(e,!1)),{},{dataKey:r,unit:o,formatter:i,name:a||r,color:wS(e),value:hS(t,r),type:s,payload:t,chartType:l,hide:c})};function PS(e){return PS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},PS(e)}function RS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function US(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?RS(Object(n),!0).forEach(function(t){BS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):RS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function BS(e,t,n){return t=function(e){var t=function(e){if("object"!=PS(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=PS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==PS(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var FS=["Webkit","Moz","O","ms"];function YS(e){return YS="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},YS(e)}function QS(){return QS=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},QS.apply(this,arguments)}function VS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function WS(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?VS(Object(n),!0).forEach(function(t){XS(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):VS(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ZS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qS(r.key),r)}}function GS(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(GS=function(){return!!e})()}function HS(e){return HS=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},HS(e)}function $S(e,t){return $S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},$S(e,t)}function XS(e,t,n){return(t=qS(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qS(e){var t=function(e){if("object"!=YS(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=YS(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==YS(t)?t:t+""}var JS=function(e){return e.changedTouches&&!!e.changedTouches.length},KS=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),XS(n=function(e,t,n){return t=HS(t),function(e,t){if(t&&("object"===YS(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,GS()?Reflect.construct(t,n||[],HS(e).constructor):t.apply(e,n))}(this,t,[e]),"handleDrag",function(e){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(e):n.state.isSlideMoving&&n.handleSlideDrag(e)}),XS(n,"handleTouchMove",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&n.handleDrag(e.changedTouches[0])}),XS(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var e=n.props,t=e.endIndex,r=e.onDragEnd,a=e.startIndex;null==r||r({endIndex:t,startIndex:a})}),n.detachDragEndListener()}),XS(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),XS(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),XS(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),XS(n,"handleSlideDragStart",function(e){var t=JS(e)?e.changedTouches[0]:e;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:t.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$S(e,t)}(t,e),n=t,r=[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(e){var n=e.startX,r=e.endX,a=this.state.scaleValues,o=this.props,i=o.gap,s=o.data.length-1,l=Math.min(n,r),c=Math.max(n,r),u=t.getIndexInRange(a,l),d=t.getIndexInRange(a,c);return{startIndex:u-u%i,endIndex:d===s?s:d-d%i}}},{key:"getTextOfTick",value:function(e){var t=this.props,n=t.data,r=t.tickFormatter,a=t.dataKey,o=hS(n[e],a,e);return og()(r)?r(o,e):o}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(e){var t=this.state,n=t.slideMoveStartX,r=t.startX,a=t.endX,o=this.props,i=o.x,s=o.width,l=o.travellerWidth,c=o.startIndex,u=o.endIndex,d=o.onChange,f=e.pageX-n;f>0?f=Math.min(f,i+s-l-a,i+s-l-r):f<0&&(f=Math.max(f,i-r,i-a));var m=this.getIndex({startX:r+f,endX:a+f});m.startIndex===c&&m.endIndex===u||!d||d(m),this.setState({startX:r+f,endX:a+f,slideMoveStartX:e.pageX})}},{key:"handleTravellerDragStart",value:function(e,t){var n=JS(t)?t.changedTouches[0]:t;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:e,brushMoveStartX:n.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(e){var t=this.state,n=t.brushMoveStartX,r=t.movingTravellerId,a=t.endX,o=t.startX,i=this.state[r],s=this.props,l=s.x,c=s.width,u=s.travellerWidth,d=s.onChange,f=s.gap,m=s.data,p={startX:this.state.startX,endX:this.state.endX},h=e.pageX-n;h>0?h=Math.min(h,l+c-u-i):h<0&&(h=Math.max(h,l-i)),p[r]=i+h;var g=this.getIndex(p),w=g.startIndex,y=g.endIndex;this.setState(XS(XS({},r,i+h),"brushMoveStartX",e.pageX),function(){var e;d&&(e=m.length-1,("startX"===r&&(a>o?w%f===0:y%f===0)||a<o&&y===e||"endX"===r&&(a>o?y%f===0:w%f===0)||a>o&&y===e)&&d(g))})}},{key:"handleTravellerMoveKeyboard",value:function(e,t){var n=this,r=this.state,a=r.scaleValues,o=r.startX,i=r.endX,s=this.state[t],l=a.indexOf(s);if(-1!==l){var c=l+e;if(!(-1===c||c>=a.length)){var u=a[c];"startX"===t&&u>=i||"endX"===t&&u<=o||this.setState(XS({},t,u),function(){n.props.onChange(n.getIndex({startX:n.state.startX,endX:n.state.endX}))})}}}},{key:"renderBackground",value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,a=e.height,o=e.fill,i=e.stroke;return l().createElement("rect",{stroke:i,fill:o,x:t,y:n,width:r,height:a})}},{key:"renderPanorama",value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,a=e.height,o=e.data,s=e.children,c=e.padding,u=i.Children.only(s);return u?l().cloneElement(u,{x:t,y:n,width:r,height:a,margin:c,compact:!0,data:o}):null}},{key:"renderTravellerLayer",value:function(e,n){var r,a,o=this,i=this.props,s=i.y,c=i.travellerWidth,u=i.height,d=i.traveller,f=i.ariaLabel,m=i.data,p=i.startIndex,h=i.endIndex,g=Math.max(e,this.props.x),w=WS(WS({},Dg(this.props,!1)),{},{x:g,y:s,width:c,height:u}),y=f||"Min value: ".concat(null===(r=m[p])||void 0===r?void 0:r.name,", Max value: ").concat(null===(a=m[h])||void 0===a?void 0:a.name);return l().createElement(Xg,{tabIndex:0,role:"slider","aria-label":y,"aria-valuenow":e,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[n],onTouchStart:this.travellerDragStartHandlers[n],onKeyDown:function(e){["ArrowLeft","ArrowRight"].includes(e.key)&&(e.preventDefault(),e.stopPropagation(),o.handleTravellerMoveKeyboard("ArrowRight"===e.key?1:-1,n))},onFocus:function(){o.setState({isTravellerFocused:!0})},onBlur:function(){o.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(d,w))}},{key:"renderSlide",value:function(e,t){var n=this.props,r=n.y,a=n.height,o=n.stroke,i=n.travellerWidth,s=Math.min(e,t)+i,c=Math.max(Math.abs(t-e)-i,0);return l().createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:o,fillOpacity:.2,x:s,y:r,width:c,height:a})}},{key:"renderText",value:function(){var e=this.props,t=e.startIndex,n=e.endIndex,r=e.y,a=e.height,o=e.travellerWidth,i=e.stroke,s=this.state,c=s.startX,u=s.endX,d={pointerEvents:"none",fill:i};return l().createElement(Xg,{className:"recharts-brush-texts"},l().createElement(hx,QS({textAnchor:"end",verticalAnchor:"middle",x:Math.min(c,u)-5,y:r+a/2},d),this.getTextOfTick(t)),l().createElement(hx,QS({textAnchor:"start",verticalAnchor:"middle",x:Math.max(c,u)+o+5,y:r+a/2},d),this.getTextOfTick(n)))}},{key:"render",value:function(){var e=this.props,t=e.data,n=e.className,r=e.children,a=e.x,o=e.y,i=e.width,s=e.height,c=e.alwaysShowText,u=this.state,d=u.startX,f=u.endX,m=u.isTextActive,p=u.isSlideMoving,h=u.isTravellerMoving,g=u.isTravellerFocused;if(!t||!t.length||!Hh(a)||!Hh(o)||!Hh(i)||!Hh(s)||i<=0||s<=0)return null;var w=Te("recharts-brush",n),y=1===l().Children.count(r),b=function(e,t){var n=e.replace(/(\w)/,function(e){return e.toUpperCase()}),r=FS.reduce(function(e,r){return US(US({},e),{},BS({},r+n,t))},{});return r[e]=t,r}("userSelect","none");return l().createElement(Xg,{className:w,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:b},this.renderBackground(),y&&this.renderPanorama(),this.renderSlide(d,f),this.renderTravellerLayer(d,"startX"),this.renderTravellerLayer(f,"endX"),(m||p||h||g||c)&&this.renderText())}}],a=[{key:"renderDefaultTraveller",value:function(e){var t=e.x,n=e.y,r=e.width,a=e.height,o=e.stroke,i=Math.floor(n+a/2)-1;return l().createElement(l().Fragment,null,l().createElement("rect",{x:t,y:n,width:r,height:a,fill:o,stroke:"none"}),l().createElement("line",{x1:t+1,y1:i,x2:t+r-1,y2:i,fill:"none",stroke:"#fff"}),l().createElement("line",{x1:t+1,y1:i+2,x2:t+r-1,y2:i+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(e,n){return l().isValidElement(e)?l().cloneElement(e,n):og()(e)?e(n):t.renderDefaultTraveller(n)}},{key:"getDerivedStateFromProps",value:function(e,t){var n=e.data,r=e.width,a=e.x,o=e.travellerWidth,i=e.updateId,s=e.startIndex,l=e.endIndex;if(n!==t.prevData||i!==t.prevUpdateId)return WS({prevData:n,prevTravellerWidth:o,prevUpdateId:i,prevX:a,prevWidth:r},n&&n.length?function(e){var t=e.data,n=e.startIndex,r=e.endIndex,a=e.x,o=e.width,i=e.travellerWidth;if(!t||!t.length)return{};var s=t.length,l=Ov().domain(Yg()(0,s)).range([a,a+o-i]),c=l.domain().map(function(e){return l(e)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:l(n),endX:l(r),scale:l,scaleValues:c}}({data:n,width:r,x:a,travellerWidth:o,startIndex:s,endIndex:l}):{scale:null,scaleValues:null});if(t.scale&&(r!==t.prevWidth||a!==t.prevX||o!==t.prevTravellerWidth)){t.scale.range([a,a+r-o]);var c=t.scale.domain().map(function(e){return t.scale(e)});return{prevData:n,prevTravellerWidth:o,prevUpdateId:i,prevX:a,prevWidth:r,startX:t.scale(e.startIndex),endX:t.scale(e.endIndex),scaleValues:c}}return null}},{key:"getIndexInRange",value:function(e,t){for(var n=0,r=e.length-1;r-n>1;){var a=Math.floor((n+r)/2);e[a]>t?r=a:n=a}return t>=e[r]?r:n}}],r&&ZS(n.prototype,r),a&&ZS(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,a}(i.PureComponent);function ek(e){return ek="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ek(e)}function tk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tk(Object(n),!0).forEach(function(t){rk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function rk(e,t,n){return t=function(e){var t=function(e){if("object"!=ek(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ek(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ek(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}XS(KS,"displayName","Brush"),XS(KS,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var ak=Math.PI/180,ok=function(e){return 180*e/Math.PI},ik=function(e,t,n,r){return{x:e+Math.cos(-ak*r)*n,y:t+Math.sin(-ak*r)*n}},sk=function(e,t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),o=Math.floor(r/360);return e+360*Math.min(a,o)},lk=function(e,t){var n=function(e,t){var n=e.x,r=e.y,a=t.cx,o=t.cy,i=function(e,t){var n=e.x,r=e.y,a=t.x,o=t.y;return Math.sqrt(Math.pow(n-a,2)+Math.pow(r-o,2))}({x:n,y:r},{x:a,y:o});if(i<=0)return{radius:i};var s=(n-a)/i,l=Math.acos(s);return r>o&&(l=2*Math.PI-l),{radius:i,angle:ok(l),angleInRadian:l}}({x:e.x,y:e.y},t),r=n.radius,a=n.angle,o=t.innerRadius,i=t.outerRadius;if(r<o||r>i)return!1;if(0===r)return!0;var s,l=function(e){var t=e.startAngle,n=e.endAngle,r=Math.floor(t/360),a=Math.floor(n/360),o=Math.min(r,a);return{startAngle:t-360*o,endAngle:n-360*o}}(t),c=l.startAngle,u=l.endAngle,d=a;if(c<=u){for(;d>u;)d-=360;for(;d<c;)d+=360;s=d>=c&&d<=u}else{for(;d>c;)d-=360;for(;d<u;)d+=360;s=d>=u&&d<=c}return s?nk(nk({},t),{},{radius:r,angle:sk(d,t)}):null};function ck(e){return ck="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ck(e)}var uk=["offset"];function dk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fk(Object(n),!0).forEach(function(t){pk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pk(e,t,n){return t=function(e){var t=function(e){if("object"!=ck(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ck(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ck(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hk(){return hk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},hk.apply(this,arguments)}function gk(e){var t,n=e.offset,r=mk({offset:void 0===n?5:n},function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,uk)),a=r.viewBox,o=r.position,s=r.value,c=r.children,u=r.content,d=r.className,f=void 0===d?"":d,m=r.textBreakAll;if(!a||Wh()(s)&&Wh()(c)&&!(0,i.isValidElement)(u)&&!og()(u))return null;if((0,i.isValidElement)(u))return(0,i.cloneElement)(u,r);if(og()(u)){if(t=(0,i.createElement)(u,r),(0,i.isValidElement)(t))return t}else t=function(e){var t=e.value,n=e.formatter,r=Wh()(e.children)?t:e.children;return og()(n)?n(r):r}(r);var p=function(e){return"cx"in e&&Hh(e.cx)}(a),h=Dg(r,!0);if(p&&("insideStart"===o||"insideEnd"===o||"end"===o))return function(e,t,n){var r,a,o=e.position,i=e.viewBox,s=e.offset,c=e.className,u=i,d=u.cx,f=u.cy,m=u.innerRadius,p=u.outerRadius,h=u.startAngle,g=u.endAngle,w=u.clockWise,y=(m+p)/2,b=function(e,t){return Zh(t-e)*Math.min(Math.abs(t-e),360)}(h,g),v=b>=0?1:-1;"insideStart"===o?(r=h+v*s,a=w):"insideEnd"===o?(r=g-v*s,a=!w):"end"===o&&(r=g+v*s,a=w),a=b<=0?a:!a;var x=ik(d,f,y,r),_=ik(d,f,y,r+359*(a?1:-1)),E="M".concat(x.x,",").concat(x.y,"\n A").concat(y,",").concat(y,",0,1,").concat(a?0:1,",\n ").concat(_.x,",").concat(_.y),N=Wh()(e.id)?qh("recharts-radial-line-"):e.id;return l().createElement("text",hk({},n,{dominantBaseline:"central",className:Te("recharts-radial-bar-label",c)}),l().createElement("defs",null,l().createElement("path",{id:N,d:E})),l().createElement("textPath",{xlinkHref:"#".concat(N)},t))}(r,t,h);var g=p?function(e){var t=e.viewBox,n=e.offset,r=e.position,a=t,o=a.cx,i=a.cy,s=a.innerRadius,l=a.outerRadius,c=(a.startAngle+a.endAngle)/2;if("outside"===r){var u=ik(o,i,l+n,c),_x=u.x;return{x:_x,y:u.y,textAnchor:_x>=o?"start":"end",verticalAnchor:"middle"}}if("center"===r)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"middle"};if("centerTop"===r)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"start"};if("centerBottom"===r)return{x:o,y:i,textAnchor:"middle",verticalAnchor:"end"};var d=ik(o,i,(s+l)/2,c);return{x:d.x,y:d.y,textAnchor:"middle",verticalAnchor:"middle"}}(r):function(e){var t=e.viewBox,n=e.parentViewBox,r=e.offset,a=e.position,o=t,i=o.x,s=o.y,l=o.width,c=o.height,u=c>=0?1:-1,d=u*r,f=u>0?"end":"start",m=u>0?"start":"end",p=l>=0?1:-1,h=p*r,g=p>0?"end":"start",w=p>0?"start":"end";if("top"===a)return mk(mk({},{x:i+l/2,y:s-u*r,textAnchor:"middle",verticalAnchor:f}),n?{height:Math.max(s-n.y,0),width:l}:{});if("bottom"===a)return mk(mk({},{x:i+l/2,y:s+c+d,textAnchor:"middle",verticalAnchor:m}),n?{height:Math.max(n.y+n.height-(s+c),0),width:l}:{});if("left"===a){var y={x:i-h,y:s+c/2,textAnchor:g,verticalAnchor:"middle"};return mk(mk({},y),n?{width:Math.max(y.x-n.x,0),height:c}:{})}if("right"===a){var b={x:i+l+h,y:s+c/2,textAnchor:w,verticalAnchor:"middle"};return mk(mk({},b),n?{width:Math.max(n.x+n.width-b.x,0),height:c}:{})}var v=n?{width:l,height:c}:{};return"insideLeft"===a?mk({x:i+h,y:s+c/2,textAnchor:w,verticalAnchor:"middle"},v):"insideRight"===a?mk({x:i+l-h,y:s+c/2,textAnchor:g,verticalAnchor:"middle"},v):"insideTop"===a?mk({x:i+l/2,y:s+d,textAnchor:"middle",verticalAnchor:m},v):"insideBottom"===a?mk({x:i+l/2,y:s+c-d,textAnchor:"middle",verticalAnchor:f},v):"insideTopLeft"===a?mk({x:i+h,y:s+d,textAnchor:w,verticalAnchor:m},v):"insideTopRight"===a?mk({x:i+l-h,y:s+d,textAnchor:g,verticalAnchor:m},v):"insideBottomLeft"===a?mk({x:i+h,y:s+c-d,textAnchor:w,verticalAnchor:f},v):"insideBottomRight"===a?mk({x:i+l-h,y:s+c-d,textAnchor:g,verticalAnchor:f},v):sg()(a)&&(Hh(a.x)||Gh(a.x))&&(Hh(a.y)||Gh(a.y))?mk({x:i+Jh(a.x,l),y:s+Jh(a.y,c),textAnchor:"end",verticalAnchor:"end"},v):mk({x:i+l/2,y:s+c/2,textAnchor:"middle",verticalAnchor:"middle"},v)}(r);return l().createElement(hx,hk({className:Te("recharts-label",f)},h,g,{breakAll:m}),t)}gk.displayName="Label";var wk=function(e){var t=e.cx,n=e.cy,r=e.angle,a=e.startAngle,o=e.endAngle,i=e.r,s=e.radius,l=e.innerRadius,c=e.outerRadius,u=e.x,d=e.y,f=e.top,m=e.left,p=e.width,h=e.height,g=e.clockWise,w=e.labelViewBox;if(w)return w;if(Hh(p)&&Hh(h)){if(Hh(u)&&Hh(d))return{x:u,y:d,width:p,height:h};if(Hh(f)&&Hh(m))return{x:f,y:m,width:p,height:h}}return Hh(u)&&Hh(d)?{x:u,y:d,width:0,height:0}:Hh(t)&&Hh(n)?{cx:t,cy:n,startAngle:a||r||0,endAngle:o||r||0,innerRadius:l||0,outerRadius:c||s||i||0,clockWise:g}:e.viewBox?e.viewBox:{}};gk.parseViewBox=wk,gk.renderCallByParent=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=wk(e),o=Ig(r,gk).map(function(e,n){return(0,i.cloneElement)(e,{viewBox:t||a,key:"label-".concat(n)})});if(!n)return o;var s,c=function(e,t){return e?!0===e?l().createElement(gk,{key:"label-implicit",viewBox:t}):$h(e)?l().createElement(gk,{key:"label-implicit",viewBox:t,value:e}):(0,i.isValidElement)(e)?e.type===gk?(0,i.cloneElement)(e,{key:"label-implicit",viewBox:t}):l().createElement(gk,{key:"label-implicit",content:e,viewBox:t}):og()(e)?l().createElement(gk,{key:"label-implicit",content:e,viewBox:t}):sg()(e)?l().createElement(gk,hk({viewBox:t},e,{key:"label-implicit"})):null:null}(e.label,t||a);return[c].concat(function(e){if(Array.isArray(e))return dk(e)}(s=o)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(s)||function(e,t){if(e){if("string"==typeof e)return dk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dk(e,t):void 0}}(s)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())};var yk=function(e,t){var n=e.alwaysShow,r=e.ifOverflow;return n&&(r="extendDomain"),r===t},bk=a(3916),vk=a.n(bk),xk=a(9747),_k=a.n(xk),Ek=function(e){return null};Ek.displayName="Cell";var Nk=a(8090),Mk=a.n(Nk);function Ik(e){return Ik="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ik(e)}var Sk=["valueAccessor"],kk=["data","dataKey","clockWise","id","textBreakAll"];function jk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Dk(){return Dk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Dk.apply(this,arguments)}function Ck(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ak(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ck(Object(n),!0).forEach(function(t){Tk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ck(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tk(e,t,n){return t=function(e){var t=function(e){if("object"!=Ik(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Ik(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ik(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ok(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var Lk=function(e){return Array.isArray(e.value)?Mk()(e.value):e.value};function zk(e){var t=e.valueAccessor,n=void 0===t?Lk:t,r=Ok(e,Sk),a=r.data,o=r.dataKey,i=r.clockWise,s=r.id,c=r.textBreakAll,u=Ok(r,kk);return a&&a.length?l().createElement(Xg,{className:"recharts-label-list"},a.map(function(e,t){var r=Wh()(o)?n(e,t):hS(e&&e.payload,o),a=Wh()(s)?{}:{id:"".concat(s,"-").concat(t)};return l().createElement(gk,Dk({},Dg(e,!0),u,a,{parentViewBox:e.parentViewBox,value:r,textBreakAll:c,viewBox:gk.parseViewBox(Wh()(i)?e:Ak(Ak({},e),{},{clockWise:i})),key:"label-".concat(t),index:t}))})):null}zk.displayName="LabelList",zk.renderCallByParent=function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e||!e.children&&n&&!e.label)return null;var r=Ig(e.children,zk).map(function(e,n){return(0,i.cloneElement)(e,{data:t,key:"labelList-".concat(n)})});if(!n)return r;var a,o=function(e,t){return e?!0===e?l().createElement(zk,{key:"labelList-implicit",data:t}):l().isValidElement(e)||og()(e)?l().createElement(zk,{key:"labelList-implicit",data:t,content:e}):sg()(e)?l().createElement(zk,Dk({data:t},e,{key:"labelList-implicit"})):null:null}(e.label,t);return[o].concat(function(e){if(Array.isArray(e))return jk(e)}(a=r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return jk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jk(e,t):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())};var Pk=a(1331),Rk=a.n(Pk),Uk=a(3812),Bk=a.n(Uk);function Fk(e){return Fk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fk(e)}function Yk(){return Yk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yk.apply(this,arguments)}function Qk(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vk(Object(n),!0).forEach(function(t){Zk(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zk(e,t,n){return t=function(e){var t=function(e){if("object"!=Fk(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Fk(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Fk(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Gk=function(e,t,n,r,a){var o,i=n-r;return o="M ".concat(e,",").concat(t),o+="L ".concat(e+n,",").concat(t),o+="L ".concat(e+n-i/2,",").concat(t+a),(o+="L ".concat(e+n-i/2-r,",").concat(t+a))+"L ".concat(e,",").concat(t," Z")},Hk={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$k=function(e){var t=Wk(Wk({},Hk),e),n=(0,i.useRef)(),r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Qk(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qk(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,i.useState)(-1),2),a=r[0],o=r[1];(0,i.useEffect)(function(){if(n.current&&n.current.getTotalLength)try{var e=n.current.getTotalLength();e&&o(e)}catch(e){}},[]);var s=t.x,c=t.y,u=t.upperWidth,d=t.lowerWidth,f=t.height,m=t.className,p=t.animationEasing,h=t.animationDuration,g=t.animationBegin,w=t.isUpdateAnimationActive;if(s!==+s||c!==+c||u!==+u||d!==+d||f!==+f||0===u&&0===d||0===f)return null;var y=Te("recharts-trapezoid",m);return w?l().createElement(pv,{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:f,x:s,y:c},to:{upperWidth:u,lowerWidth:d,height:f,x:s,y:c},duration:h,animationEasing:p,isActive:w},function(e){var r=e.upperWidth,o=e.lowerWidth,i=e.height,s=e.x,c=e.y;return l().createElement(pv,{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:h,easing:p},l().createElement("path",Yk({},Dg(t,!0),{className:y,d:Gk(s,c,r,o,i),ref:n})))}):l().createElement("g",null,l().createElement("path",Yk({},Dg(t,!0),{className:y,d:Gk(s,c,u,d,f)})))};function Xk(e){return Xk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xk(e)}function qk(){return qk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qk.apply(this,arguments)}function Jk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kk(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jk(Object(n),!0).forEach(function(t){ej(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jk(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ej(e,t,n){return t=function(e){var t=function(e){if("object"!=Xk(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Xk(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xk(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var tj=function(e){var t=e.cx,n=e.cy,r=e.radius,a=e.angle,o=e.sign,i=e.isExternal,s=e.cornerRadius,l=e.cornerIsExternal,c=s*(i?1:-1)+r,u=Math.asin(s/c)/ak,d=l?a:a+o*u,f=l?a-o*u:a;return{center:ik(t,n,c,d),circleTangency:ik(t,n,r,d),lineTangency:ik(t,n,c*Math.cos(u*ak),f),theta:u}},nj=function(e){var t=e.cx,n=e.cy,r=e.innerRadius,a=e.outerRadius,o=e.startAngle,i=function(e,t){return Zh(t-e)*Math.min(Math.abs(t-e),359.999)}(o,e.endAngle),s=o+i,l=ik(t,n,a,o),c=ik(t,n,a,s),u="M ".concat(l.x,",").concat(l.y,"\n A ").concat(a,",").concat(a,",0,\n ").concat(+(Math.abs(i)>180),",").concat(+(o>s),",\n ").concat(c.x,",").concat(c.y,"\n ");if(r>0){var d=ik(t,n,r,o),f=ik(t,n,r,s);u+="L ".concat(f.x,",").concat(f.y,"\n A ").concat(r,",").concat(r,",0,\n ").concat(+(Math.abs(i)>180),",").concat(+(o<=s),",\n ").concat(d.x,",").concat(d.y," Z")}else u+="L ".concat(t,",").concat(n," Z");return u},rj={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},aj=function(e){var t=Kk(Kk({},rj),e),n=t.cx,r=t.cy,a=t.innerRadius,o=t.outerRadius,i=t.cornerRadius,s=t.forceCornerRadius,c=t.cornerIsExternal,u=t.startAngle,d=t.endAngle,f=t.className;if(o<a||u===d)return null;var m,p=Te("recharts-sector",f),h=o-a,g=Jh(i,h,0,!0);return m=g>0&&Math.abs(u-d)<360?function(e){var t=e.cx,n=e.cy,r=e.innerRadius,a=e.outerRadius,o=e.cornerRadius,i=e.forceCornerRadius,s=e.cornerIsExternal,l=e.startAngle,c=e.endAngle,u=Zh(c-l),d=tj({cx:t,cy:n,radius:a,angle:l,sign:u,cornerRadius:o,cornerIsExternal:s}),f=d.circleTangency,m=d.lineTangency,p=d.theta,h=tj({cx:t,cy:n,radius:a,angle:c,sign:-u,cornerRadius:o,cornerIsExternal:s}),g=h.circleTangency,w=h.lineTangency,y=h.theta,b=s?Math.abs(l-c):Math.abs(l-c)-p-y;if(b<0)return i?"M ".concat(m.x,",").concat(m.y,"\n a").concat(o,",").concat(o,",0,0,1,").concat(2*o,",0\n a").concat(o,",").concat(o,",0,0,1,").concat(2*-o,",0\n "):nj({cx:t,cy:n,innerRadius:r,outerRadius:a,startAngle:l,endAngle:c});var v="M ".concat(m.x,",").concat(m.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(f.x,",").concat(f.y,"\n A").concat(a,",").concat(a,",0,").concat(+(b>180),",").concat(+(u<0),",").concat(g.x,",").concat(g.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(w.x,",").concat(w.y,"\n ");if(r>0){var x=tj({cx:t,cy:n,radius:r,angle:l,sign:u,isExternal:!0,cornerRadius:o,cornerIsExternal:s}),_=x.circleTangency,E=x.lineTangency,N=x.theta,M=tj({cx:t,cy:n,radius:r,angle:c,sign:-u,isExternal:!0,cornerRadius:o,cornerIsExternal:s}),I=M.circleTangency,S=M.lineTangency,k=M.theta,j=s?Math.abs(l-c):Math.abs(l-c)-N-k;if(j<0&&0===o)return"".concat(v,"L").concat(t,",").concat(n,"Z");v+="L".concat(S.x,",").concat(S.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(I.x,",").concat(I.y,"\n A").concat(r,",").concat(r,",0,").concat(+(j>180),",").concat(+(u>0),",").concat(_.x,",").concat(_.y,"\n A").concat(o,",").concat(o,",0,0,").concat(+(u<0),",").concat(E.x,",").concat(E.y,"Z")}else v+="L".concat(t,",").concat(n,"Z");return v}({cx:n,cy:r,innerRadius:a,outerRadius:o,cornerRadius:Math.min(g,h/2),forceCornerRadius:s,cornerIsExternal:c,startAngle:u,endAngle:d}):nj({cx:n,cy:r,innerRadius:a,outerRadius:o,startAngle:u,endAngle:d}),l().createElement("path",qk({},Dg(t,!0),{className:p,d:m,role:"img"}))},oj=["option","shapeType","propTransformer","activeClassName","isActive"];function ij(e){return ij="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ij(e)}function sj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sj(Object(n),!0).forEach(function(t){cj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cj(e,t,n){return t=function(e){var t=function(e){if("object"!=ij(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ij(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ij(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uj(e,t){return lj(lj({},t),e)}function dj(e){var t=e.shapeType,n=e.elementProps;switch(t){case"rectangle":return l().createElement(Nv,n);case"trapezoid":return l().createElement($k,n);case"sector":return l().createElement(aj,n);case"symbols":if(function(e){return"symbols"===e}(t))return l().createElement(_y,n);break;default:return null}}function fj(e){var t,n=e.option,r=e.shapeType,a=e.propTransformer,o=void 0===a?uj:a,s=e.activeClassName,c=void 0===s?"recharts-active-shape":s,u=e.isActive,d=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,oj);if((0,i.isValidElement)(n))t=(0,i.cloneElement)(n,lj(lj({},d),function(e){return(0,i.isValidElement)(e)?e.props:e}(n)));else if(og()(n))t=n(d);else if(Rk()(n)&&!Bk()(n)){var f=o(n,d);t=l().createElement(dj,{shapeType:r,elementProps:f})}else{var m=d;t=l().createElement(dj,{shapeType:r,elementProps:m})}return u?l().createElement(Xg,{className:c},t):t}function mj(e,t){return null!=t&&"trapezoids"in e.props}function pj(e,t){return null!=t&&"sectors"in e.props}function hj(e,t){return null!=t&&"points"in e.props}function gj(e,t){var n,r,a=e.x===(null==t||null===(n=t.labelViewBox)||void 0===n?void 0:n.x)||e.x===t.x,o=e.y===(null==t||null===(r=t.labelViewBox)||void 0===r?void 0:r.y)||e.y===t.y;return a&&o}function wj(e,t){var n=e.endAngle===t.endAngle,r=e.startAngle===t.startAngle;return n&&r}function yj(e,t){var n=e.x===t.x,r=e.y===t.y,a=e.z===t.z;return n&&r&&a}function bj(e){var t=e.activeTooltipItem,n=e.graphicalItem,r=e.itemData,a=function(e,t){var n;return mj(e,t)?n="trapezoids":pj(e,t)?n="sectors":hj(e,t)&&(n="points"),n}(n,t),o=function(e,t){var n,r;return mj(e,t)?null===(n=t.tooltipPayload)||void 0===n||null===(n=n[0])||void 0===n||null===(n=n.payload)||void 0===n?void 0:n.payload:pj(e,t)?null===(r=t.tooltipPayload)||void 0===r||null===(r=r[0])||void 0===r||null===(r=r.payload)||void 0===r?void 0:r.payload:hj(e,t)?t.payload:{}}(n,t),i=r.filter(function(e,r){var i=vI()(o,e),s=n.props[a].filter(function(e){var r=function(e,t){var n;return mj(e,t)?n=gj:pj(e,t)?n=wj:hj(e,t)&&(n=yj),n}(n,t);return r(e,t)}),l=n.props[a].indexOf(s[s.length-1]);return i&&r===l});return r.indexOf(i[i.length-1])}var vj=["x","y"];function xj(e){return xj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xj(e)}function _j(){return _j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},_j.apply(this,arguments)}function Ej(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Nj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ej(Object(n),!0).forEach(function(t){Mj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ej(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Mj(e,t,n){return t=function(e){var t=function(e){if("object"!=xj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=xj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==xj(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ij(e,t){var n=e.x,r=e.y,a=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,vj),o="".concat(n),i=parseInt(o,10),s="".concat(r),l=parseInt(s,10),c="".concat(t.height||a.height),u=parseInt(c,10),d="".concat(t.width||a.width),f=parseInt(d,10);return Nj(Nj(Nj(Nj(Nj({},t),a),i?{x:i}:{}),l?{y:l}:{}),{},{height:u,width:f,name:t.name,radius:t.radius})}function Sj(e){return l().createElement(fj,_j({shapeType:"rectangle",propTransformer:Ij,activeClassName:"recharts-active-bar"},e))}var kj,jj=["value","background"];function Dj(e){return Dj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dj(e)}function Cj(){return Cj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cj.apply(this,arguments)}function Aj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Aj(Object(n),!0).forEach(function(t){Rj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Aj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Oj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Uj(r.key),r)}}function Lj(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(Lj=function(){return!!e})()}function zj(e){return zj=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},zj(e)}function Pj(e,t){return Pj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Pj(e,t)}function Rj(e,t,n){return(t=Uj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Uj(e){var t=function(e){if("object"!=Dj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Dj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Dj(t)?t:t+""}var Bj=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return Rj(e=function(e,t,n){return t=zj(t),function(e,t){if(t&&("object"===Dj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,Lj()?Reflect.construct(t,n||[],zj(e).constructor):t.apply(e,n))}(this,t,[].concat(r)),"state",{isAnimationFinished:!1}),Rj(e,"id",qh("recharts-bar-")),Rj(e,"handleAnimationEnd",function(){var t=e.props.onAnimationEnd;e.setState({isAnimationFinished:!0}),t&&t()}),Rj(e,"handleAnimationStart",function(){var t=e.props.onAnimationStart;e.setState({isAnimationFinished:!1}),t&&t()}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pj(e,t)}(t,e),n=t,r=[{key:"renderRectanglesStatically",value:function(e){var t=this,n=this.props,r=n.shape,a=n.dataKey,o=n.activeIndex,i=n.activeBar,s=Dg(this.props,!1);return e&&e.map(function(e,n){var c=n===o,u=c?i:r,d=Tj(Tj(Tj({},s),e),{},{isActive:c,option:u,index:n,dataKey:a,onAnimationStart:t.handleAnimationStart,onAnimationEnd:t.handleAnimationEnd});return l().createElement(Xg,Cj({className:"recharts-bar-rectangle"},gg(t.props,e,n),{key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value,"-").concat(n)}),l().createElement(Sj,d))})}},{key:"renderRectanglesWithAnimation",value:function(){var e=this,t=this.props,n=t.data,r=t.layout,a=t.isAnimationActive,o=t.animationBegin,i=t.animationDuration,s=t.animationEasing,c=t.animationId,u=this.state.prevData;return l().createElement(pv,{begin:o,duration:i,isActive:a,easing:s,from:{t:0},to:{t:1},key:"bar-".concat(c),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(t){var a=t.t,o=n.map(function(e,t){var n=u&&u[t];if(n){var o=eg(n.x,e.x),i=eg(n.y,e.y),s=eg(n.width,e.width),l=eg(n.height,e.height);return Tj(Tj({},e),{},{x:o(a),y:i(a),width:s(a),height:l(a)})}if("horizontal"===r){var c=eg(0,e.height)(a);return Tj(Tj({},e),{},{y:e.y+e.height-c,height:c})}var d=eg(0,e.width)(a);return Tj(Tj({},e),{},{width:d})});return l().createElement(Xg,null,e.renderRectanglesStatically(o))})}},{key:"renderRectangles",value:function(){var e=this.props,t=e.data,n=e.isAnimationActive,r=this.state.prevData;return!(n&&t&&t.length)||r&&vI()(r,t)?this.renderRectanglesStatically(t):this.renderRectanglesWithAnimation()}},{key:"renderBackground",value:function(){var e=this,t=this.props,n=t.data,r=t.dataKey,a=t.activeIndex,o=Dg(this.props.background,!1);return n.map(function(t,n){t.value;var i=t.background,s=function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(t,jj);if(!i)return null;var c=Tj(Tj(Tj(Tj(Tj({},s),{},{fill:"#eee"},i),o),gg(e.props,t,n)),{},{onAnimationStart:e.handleAnimationStart,onAnimationEnd:e.handleAnimationEnd,dataKey:r,index:n,className:"recharts-bar-background-rectangle"});return l().createElement(Sj,Cj({key:"background-bar-".concat(n),option:e.props.background,isActive:n===a},c))})}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.data,a=n.xAxis,o=n.yAxis,i=n.layout,s=Ig(n.children,rS);if(!s)return null;var c="vertical"===i?r[0].height/2:r[0].width/2,u=function(e,t){var n=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:n,errorVal:hS(e,t)}},d={clipPath:e?"url(#clipPath-".concat(t,")"):null};return l().createElement(Xg,d,s.map(function(e){return l().cloneElement(e,{key:"error-bar-".concat(t,"-").concat(e.props.dataKey),data:r,xAxis:a,yAxis:o,layout:i,offset:c,dataPointFormatter:u})}))}},{key:"render",value:function(){var e=this.props,t=e.hide,n=e.data,r=e.className,a=e.xAxis,o=e.yAxis,i=e.left,s=e.top,c=e.width,u=e.height,d=e.isAnimationActive,f=e.background,m=e.id;if(t||!n||!n.length)return null;var p=this.state.isAnimationFinished,h=Te("recharts-bar",r),g=a&&a.allowDataOverflow,w=o&&o.allowDataOverflow,y=g||w,b=Wh()(m)?this.id:m;return l().createElement(Xg,{className:h},g||w?l().createElement("defs",null,l().createElement("clipPath",{id:"clipPath-".concat(b)},l().createElement("rect",{x:g?i:i-c/2,y:w?s:s-u/2,width:g?c:2*c,height:w?u:2*u}))):null,l().createElement(Xg,{className:"recharts-bar-rectangles",clipPath:y?"url(#clipPath-".concat(b,")"):null},f?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(y,b),(!d||p)&&zk.renderCallByParent(this.props,n))}}],a=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curData:e.data,prevData:t.curData}:e.data!==t.curData?{curData:e.data}:null}}],r&&Oj(n.prototype,r),a&&Oj(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,a}(i.PureComponent);function Fj(e){return Fj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Fj(e)}function Yj(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Zj(r.key),r)}}function Qj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Vj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qj(Object(n),!0).forEach(function(t){Wj(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Wj(e,t,n){return(t=Zj(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Zj(e){var t=function(e){if("object"!=Fj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=Fj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Fj(t)?t:t+""}kj=Bj,Rj(Bj,"displayName","Bar"),Rj(Bj,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!xw.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"}),Rj(Bj,"getComposedData",function(e){var t=e.props,n=e.item,r=e.barPosition,a=e.bandSize,o=e.xAxis,i=e.yAxis,s=e.xAxisTicks,l=e.yAxisTicks,c=e.stackedData,u=e.dataStartIndex,d=e.displayedData,f=e.offset,m=function(e,t){if(!e)return null;for(var n=0,r=e.length;n<r;n++)if(e[n].item===t)return e[n].position;return null}(r,n);if(!m)return null;var p=t.layout,h=n.type.defaultProps,g=void 0!==h?Tj(Tj({},h),n.props):n.props,w=g.dataKey,y=g.children,b=g.minPointSize,v="horizontal"===p?i:o,x=c?v.scale.domain():null,_=function(e){var t=e.numericAxis,n=t.scale.domain();if("number"===t.type){var r=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return r<=0&&a>=0?0:a<0?a:r}return n[0]}({numericAxis:v}),E=Ig(y,Ek),M=d.map(function(e,t){var r,d,f,h,g,y;c?r=function(e,t){if(!t||2!==t.length||!Hh(t[0])||!Hh(t[1]))return e;var n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]),a=[e[0],e[1]];return(!Hh(e[0])||e[0]<n)&&(a[0]=n),(!Hh(e[1])||e[1]>r)&&(a[1]=r),a[0]>r&&(a[0]=r),a[1]<n&&(a[1]=n),a}(c[u+t],x):(r=hS(e,w),Array.isArray(r)||(r=[_,r]));var v=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return function(n,r){if("number"==typeof e)return e;var a=Hh(n)||function(e){return Wh()(e)}(n);return a?e(n,r):(a||(0,N.A)(!1),t)}}(b,kj.defaultProps.minPointSize)(r[1],t);if("horizontal"===p){var M,I=[i.scale(r[0]),i.scale(r[1])],S=I[0],k=I[1];d=jS({axis:o,ticks:s,bandSize:a,offset:m.offset,entry:e,index:t}),f=null!==(M=null!=k?k:S)&&void 0!==M?M:void 0,h=m.size;var j=S-k;if(g=Number.isNaN(j)?0:j,y={x:d,y:i.y,width:h,height:i.height},Math.abs(v)>0&&Math.abs(g)<Math.abs(v)){var D=Zh(g||v)*(Math.abs(v)-Math.abs(g));f-=D,g+=D}}else{var C=[o.scale(r[0]),o.scale(r[1])],A=C[0],T=C[1];d=A,f=jS({axis:i,ticks:l,bandSize:a,offset:m.offset,entry:e,index:t}),h=T-A,g=m.size,y={x:o.x,y:f,width:o.width,height:g},Math.abs(v)>0&&Math.abs(h)<Math.abs(v)&&(h+=Zh(h||v)*(Math.abs(v)-Math.abs(h)))}return Tj(Tj(Tj({},e),{},{x:d,y:f,width:h,height:g,value:c?r:r[1],payload:e,background:y},E&&E[t]&&E[t].props),{},{tooltipPayload:[zS(n,e)],tooltipPosition:{x:d+h/2,y:f+g/2}})});return Tj({data:M,layout:p},f)});var Gj=function(e,t){var n=e.x,r=e.y,a=t.x,o=t.y;return{x:Math.min(n,a),y:Math.min(r,o),width:Math.abs(a-n),height:Math.abs(o-r)}},Hj=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.scale=t}return t=e,n=[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.bandAware,r=t.position;if(void 0!==e){if(r)switch(r){case"start":default:return this.scale(e);case"middle":var a=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+a;case"end":var o=this.bandwidth?this.bandwidth():0;return this.scale(e)+o}if(n){var i=this.bandwidth?this.bandwidth()/2:0;return this.scale(e)+i}return this.scale(e)}}},{key:"isInRange",value:function(e){var t=this.range(),n=t[0],r=t[t.length-1];return n<=r?e>=n&&e<=r:e>=r&&e<=n}}],r=[{key:"create",value:function(t){return new e(t)}}],n&&Yj(t.prototype,n),r&&Yj(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,r}();Wj(Hj,"EPS",1e-4);var $j=function(e){var t=Object.keys(e).reduce(function(t,n){return Vj(Vj({},t),{},Wj({},n,Hj.create(e[n])))},{});return Vj(Vj({},t),{},{apply:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.bandAware,a=n.position;return vk()(e,function(e,n){return t[n].apply(e,{bandAware:r,position:a})})},isInRange:function(e){return _k()(e,function(e,n){return t[n].isInRange(e)})}})};function Xj(){return Xj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xj.apply(this,arguments)}function qj(e){return qj="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qj(e)}function Jj(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Kj(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jj(Object(n),!0).forEach(function(t){aD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jj(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function eD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,oD(r.key),r)}}function tD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(tD=function(){return!!e})()}function nD(e){return nD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},nD(e)}function rD(e,t){return rD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},rD(e,t)}function aD(e,t,n){return(t=oD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oD(e){var t=function(e){if("object"!=qj(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=qj(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==qj(t)?t:t+""}var iD=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=nD(t),function(e,t){if(t&&("object"===qj(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,tD()?Reflect.construct(t,n||[],nD(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rD(e,t)}(t,e),n=t,r=[{key:"render",value:function(){var e=this.props,n=e.x,r=e.y,a=e.r,o=e.alwaysShow,i=e.clipPathId,s=$h(n),c=$h(r);if(rg(void 0===o,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!s||!c)return null;var u=function(e){var t=e.x,n=e.y,r=e.xAxis,a=e.yAxis,o=$j({x:r.scale,y:a.scale}),i=o.apply({x:t,y:n},{bandAware:!0});return yk(e,"discard")&&!o.isInRange(i)?null:i}(this.props);if(!u)return null;var d=u.x,f=u.y,m=this.props,p=m.shape,h=m.className,g=Kj(Kj({clipPath:yk(this.props,"hidden")?"url(#".concat(i,")"):void 0},Dg(this.props,!0)),{},{cx:d,cy:f});return l().createElement(Xg,{className:Te("recharts-reference-dot",h)},t.renderDot(p,g),gk.renderCallByParent(this.props,{x:d-a,y:f-a,width:2*a,height:2*a}))}}],r&&eD(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(l().Component);aD(iD,"displayName","ReferenceDot"),aD(iD,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1}),aD(iD,"renderDot",function(e,t){return l().isValidElement(e)?l().cloneElement(e,t):og()(e)?e(t):l().createElement(Gy,Xj({},t,{cx:t.cx,cy:t.cy,className:"recharts-reference-dot-dot"}))});var sD=a(2426),lD=a.n(sD),cD=a(7309),uD=a.n(cD),dD=a(104),fD=a.n(dD)()(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),mD=(0,i.createContext)(void 0),pD=(0,i.createContext)(void 0),hD=(0,i.createContext)(void 0),gD=(0,i.createContext)({}),wD=(0,i.createContext)(void 0),yD=(0,i.createContext)(0),bD=(0,i.createContext)(0),vD=function(e){var t=e.state,n=t.xAxisMap,r=t.yAxisMap,a=t.offset,o=e.clipPathId,i=e.children,s=e.width,c=e.height,u=fD(a);return l().createElement(mD.Provider,{value:n},l().createElement(pD.Provider,{value:r},l().createElement(gD.Provider,{value:a},l().createElement(hD.Provider,{value:u},l().createElement(wD.Provider,{value:o},l().createElement(yD.Provider,{value:c},l().createElement(bD.Provider,{value:s},i)))))))},xD=function(e){var t=(0,i.useContext)(mD);null==t&&(0,N.A)(!1);var n=t[e];return null==n&&(0,N.A)(!1),n},_D=function(e){var t=(0,i.useContext)(pD);null==t&&(0,N.A)(!1);var n=t[e];return null==n&&(0,N.A)(!1),n},ED=function(){return(0,i.useContext)(bD)},ND=function(){return(0,i.useContext)(yD)};function MD(e){return MD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},MD(e)}function ID(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,TD(r.key),r)}}function SD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(SD=function(){return!!e})()}function kD(e){return kD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},kD(e)}function jD(e,t){return jD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},jD(e,t)}function DD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function CD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?DD(Object(n),!0).forEach(function(t){AD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):DD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function AD(e,t,n){return(t=TD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function TD(e){var t=function(e){if("object"!=MD(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=MD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==MD(t)?t:t+""}function OD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function LD(){return LD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},LD.apply(this,arguments)}function zD(e){var t=e.x,n=e.y,r=e.segment,a=e.xAxisId,o=e.yAxisId,s=e.shape,c=e.className,u=e.alwaysShow,d=(0,i.useContext)(wD),f=xD(a),m=_D(o),p=(0,i.useContext)(hD);if(!d||!p)return null;rg(void 0===u,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=function(e,t,n,r,a,o,i,s,l){var c=a.x,u=a.y,d=a.width,f=a.height;if(n){var m=l.y,p=e.y.apply(m,{position:o});if(yk(l,"discard")&&!e.y.isInRange(p))return null;var h=[{x:c+d,y:p},{x:c,y:p}];return"left"===s?h.reverse():h}if(t){var g=l.x,w=e.x.apply(g,{position:o});if(yk(l,"discard")&&!e.x.isInRange(w))return null;var y=[{x:w,y:u+f},{x:w,y:u}];return"top"===i?y.reverse():y}if(r){var b=l.segment.map(function(t){return e.apply(t,{position:o})});return yk(l,"discard")&&lD()(b,function(t){return!e.isInRange(t)})?null:b}return null}($j({x:f.scale,y:m.scale}),$h(t),$h(n),r&&2===r.length,p,e.position,f.orientation,m.orientation,e);if(!h)return null;var g,w=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return OD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?OD(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(h,2),y=w[0],b=y.x,v=y.y,x=w[1],_=x.x,E=x.y,N=CD(CD({clipPath:yk(e,"hidden")?"url(#".concat(d,")"):void 0},Dg(e,!0)),{},{x1:b,y1:v,x2:_,y2:E});return l().createElement(Xg,{className:Te("recharts-reference-line",c)},function(e,t){return l().isValidElement(e)?l().cloneElement(e,t):og()(e)?e(t):l().createElement("line",LD({},t,{className:"recharts-reference-line-line"}))}(s,N),gk.renderCallByParent(e,Gj({x:(g={x1:b,y1:v,x2:_,y2:E}).x1,y:g.y1},{x:g.x2,y:g.y2})))}var PD=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=kD(t),function(e,t){if(t&&("object"===MD(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,SD()?Reflect.construct(t,n||[],kD(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&jD(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return l().createElement(zD,this.props)}}])&&ID(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(l().Component);function RD(){return RD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},RD.apply(this,arguments)}function UD(e){return UD="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UD(e)}function BD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function FD(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?BD(Object(n),!0).forEach(function(t){ZD(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BD(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function YD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,GD(r.key),r)}}function QD(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(QD=function(){return!!e})()}function VD(e){return VD=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},VD(e)}function WD(e,t){return WD=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},WD(e,t)}function ZD(e,t,n){return(t=GD(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function GD(e){var t=function(e){if("object"!=UD(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=UD(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==UD(t)?t:t+""}AD(PD,"displayName","ReferenceLine"),AD(PD,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});var HD=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=VD(t),function(e,t){if(t&&("object"===UD(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,QD()?Reflect.construct(t,n||[],VD(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&WD(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){var e=this.props,n=e.x1,r=e.x2,a=e.y1,o=e.y2,i=e.className,s=e.alwaysShow,c=e.clipPathId;rg(void 0===s,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var u=$h(n),d=$h(r),f=$h(a),m=$h(o),p=this.props.shape;if(!(u||d||f||m||p))return null;var h=function(e,t,n,r,a){var o=a.x1,i=a.x2,s=a.y1,l=a.y2,c=a.xAxis,u=a.yAxis;if(!c||!u)return null;var d=$j({x:c.scale,y:u.scale}),f={x:e?d.x.apply(o,{position:"start"}):d.x.rangeMin,y:n?d.y.apply(s,{position:"start"}):d.y.rangeMin},m={x:t?d.x.apply(i,{position:"end"}):d.x.rangeMax,y:r?d.y.apply(l,{position:"end"}):d.y.rangeMax};return!yk(a,"discard")||d.isInRange(f)&&d.isInRange(m)?Gj(f,m):null}(u,d,f,m,this.props);if(!h&&!p)return null;var g=yk(this.props,"hidden")?"url(#".concat(c,")"):void 0;return l().createElement(Xg,{className:Te("recharts-reference-area",i)},t.renderRect(p,FD(FD({clipPath:g},Dg(this.props,!0)),h)),gk.renderCallByParent(this.props,h))}}])&&YD(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(l().Component);function $D(e){return function(e){if(Array.isArray(e))return XD(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return XD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?XD(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function XD(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}ZD(HD,"displayName","ReferenceArea"),ZD(HD,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1}),ZD(HD,"renderRect",function(e,t){return l().isValidElement(e)?l().cloneElement(e,t):og()(e)?e(t):l().createElement(Nv,RD({},t,{className:"recharts-reference-area-rect"}))});var qD=function(e,t,n,r,a){var o=Ig(e,PD),i=Ig(e,iD),s=[].concat($D(o),$D(i)),l=Ig(e,HD),c="".concat(r,"Id"),u=r[0],d=t;if(s.length&&(d=s.reduce(function(e,t){if(t.props[c]===n&&yk(t.props,"extendDomain")&&Hh(t.props[u])){var r=t.props[u];return[Math.min(e[0],r),Math.max(e[1],r)]}return e},d)),l.length){var f="".concat(u,"1"),m="".concat(u,"2");d=l.reduce(function(e,t){if(t.props[c]===n&&yk(t.props,"extendDomain")&&Hh(t.props[f])&&Hh(t.props[m])){var r=t.props[f],a=t.props[m];return[Math.min(e[0],r,a),Math.max(e[1],r,a)]}return e},d)}return a&&a.length&&(d=a.reduce(function(e,t){return Hh(t)?[Math.min(e[0],t),Math.max(e[1],t)]:e},d)),d},JD=a(228),KD=new(a.n(JD)()),eC="recharts.syncMouseEvents";function tC(e){return tC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tC(e)}function nC(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,aC(r.key),r)}}function rC(e,t,n){return(t=aC(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function aC(e){var t=function(e){if("object"!=tC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=tC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tC(t)?t:t+""}var oC=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),rC(this,"activeIndex",0),rC(this,"coordinateList",[]),rC(this,"layout","horizontal")},t=[{key:"setDetails",value:function(e){var t,n=e.coordinateList,r=void 0===n?null:n,a=e.container,o=void 0===a?null:a,i=e.layout,s=void 0===i?null:i,l=e.offset,c=void 0===l?null:l,u=e.mouseHandlerCallback,d=void 0===u?null:u;this.coordinateList=null!==(t=null!=r?r:this.coordinateList)&&void 0!==t?t:[],this.container=null!=o?o:this.container,this.layout=null!=s?s:this.layout,this.offset=null!=c?c:this.offset,this.mouseHandlerCallback=null!=d?d:this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(e){if(0!==this.coordinateList.length)switch(e.key){case"ArrowRight":if("horizontal"!==this.layout)return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break;case"ArrowLeft":if("horizontal"!==this.layout)return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse()}}},{key:"setIndex",value:function(e){this.activeIndex=e}},{key:"spoofMouse",value:function(){var e,t;if("horizontal"===this.layout&&0!==this.coordinateList.length){var n=this.container.getBoundingClientRect(),r=n.x,a=n.y,o=n.height,i=this.coordinateList[this.activeIndex].coordinate,s=(null===(e=window)||void 0===e?void 0:e.scrollX)||0,l=(null===(t=window)||void 0===t?void 0:t.scrollY)||0,c=r+i+s,u=a+this.offset.top+o/2+l;this.mouseHandlerCallback({pageX:c,pageY:u})}}}],t&&nC(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function iC(){}function sC(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function lC(e){this._context=e}function cC(e){this._context=e}function uC(e){this._context=e}lC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:sC(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1)}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:sC(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},cC.prototype={areaStart:iC,areaEnd:iC,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:this._context.moveTo(this._x2,this._y2),this._context.closePath();break;case 2:this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break;case 3:this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4)}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:sC(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}},uC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||0!==this._line&&3===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:sC(this,e,t)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};class dC{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t)}this._x0=e,this._y0=t}}function fC(e){this._context=e}function mC(e){this._context=e}function pC(e){return new mC(e)}function hC(e){return e<0?-1:1}function gC(e,t,n){var r=e._x1-e._x0,a=t-e._x1,o=(e._y1-e._y0)/(r||a<0&&-0),i=(n-e._y1)/(a||r<0&&-0),s=(o*a+i*r)/(r+a);return(hC(o)+hC(i))*Math.min(Math.abs(o),Math.abs(i),.5*Math.abs(s))||0}function wC(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function yC(e,t,n){var r=e._x0,a=e._y0,o=e._x1,i=e._y1,s=(o-r)/3;e._context.bezierCurveTo(r+s,a+s*t,o-s,i-s*n,o,i)}function bC(e){this._context=e}function vC(e){this._context=new xC(e)}function xC(e){this._context=e}function _C(e){this._context=e}function EC(e){var t,n,r=e.length-1,a=new Array(r),o=new Array(r),i=new Array(r);for(a[0]=0,o[0]=2,i[0]=e[0]+2*e[1],t=1;t<r-1;++t)a[t]=1,o[t]=4,i[t]=4*e[t]+2*e[t+1];for(a[r-1]=2,o[r-1]=7,i[r-1]=8*e[r-1]+e[r],t=1;t<r;++t)n=a[t]/o[t-1],o[t]-=n,i[t]-=n*i[t-1];for(a[r-1]=i[r-1]/o[r-1],t=r-2;t>=0;--t)a[t]=(i[t]-a[t+1])/o[t];for(o[r-1]=(e[r]+a[r-1])/2,t=0;t<r-1;++t)o[t]=2*e[t+1]-a[t+1];return[a,o]}function NC(e,t){this._context=e,this._t=t}function MC(e){return e[0]}function IC(e){return e[1]}function SC(e,t){var n=iy(!0),r=null,a=pC,o=null,i=my(s);function s(s){var l,c,u,d=(s=cI(s)).length,f=!1;for(null==r&&(o=a(u=i())),l=0;l<=d;++l)!(l<d&&n(c=s[l],l,s))===f&&((f=!f)?o.lineStart():o.lineEnd()),f&&o.point(+e(c,l,s),+t(c,l,s));if(u)return o=null,u+""||null}return e="function"==typeof e?e:void 0===e?MC:iy(e),t="function"==typeof t?t:void 0===t?IC:iy(t),s.x=function(t){return arguments.length?(e="function"==typeof t?t:iy(+t),s):e},s.y=function(e){return arguments.length?(t="function"==typeof e?e:iy(+e),s):t},s.defined=function(e){return arguments.length?(n="function"==typeof e?e:iy(!!e),s):n},s.curve=function(e){return arguments.length?(a=e,null!=r&&(o=a(r)),s):a},s.context=function(e){return arguments.length?(null==e?r=o=null:o=a(r=e),s):r},s}function kC(e,t,n){var r=null,a=iy(!0),o=null,i=pC,s=null,l=my(c);function c(c){var u,d,f,m,p,h=(c=cI(c)).length,g=!1,w=new Array(h),y=new Array(h);for(null==o&&(s=i(p=l())),u=0;u<=h;++u){if(!(u<h&&a(m=c[u],u,c))===g)if(g=!g)d=u,s.areaStart(),s.lineStart();else{for(s.lineEnd(),s.lineStart(),f=u-1;f>=d;--f)s.point(w[f],y[f]);s.lineEnd(),s.areaEnd()}g&&(w[u]=+e(m,u,c),y[u]=+t(m,u,c),s.point(r?+r(m,u,c):w[u],n?+n(m,u,c):y[u]))}if(p)return s=null,p+""||null}function u(){return SC().defined(a).curve(i).context(o)}return e="function"==typeof e?e:void 0===e?MC:iy(+e),t="function"==typeof t?t:iy(void 0===t?0:+t),n="function"==typeof n?n:void 0===n?IC:iy(+n),c.x=function(t){return arguments.length?(e="function"==typeof t?t:iy(+t),r=null,c):e},c.x0=function(t){return arguments.length?(e="function"==typeof t?t:iy(+t),c):e},c.x1=function(e){return arguments.length?(r=null==e?null:"function"==typeof e?e:iy(+e),c):r},c.y=function(e){return arguments.length?(t="function"==typeof e?e:iy(+e),n=null,c):t},c.y0=function(e){return arguments.length?(t="function"==typeof e?e:iy(+e),c):t},c.y1=function(e){return arguments.length?(n=null==e?null:"function"==typeof e?e:iy(+e),c):n},c.lineX0=c.lineY0=function(){return u().x(e).y(t)},c.lineY1=function(){return u().x(e).y(n)},c.lineX1=function(){return u().x(r).y(t)},c.defined=function(e){return arguments.length?(a="function"==typeof e?e:iy(!!e),c):a},c.curve=function(e){return arguments.length?(i=e,null!=o&&(s=i(o)),c):i},c.context=function(e){return arguments.length?(null==e?o=s=null:s=i(o=e),c):o},c}function jC(e){return jC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jC(e)}function DC(){return DC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},DC.apply(this,arguments)}function CC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function AC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?CC(Object(n),!0).forEach(function(t){TC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):CC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function TC(e,t,n){return t=function(e){var t=function(e){if("object"!=jC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=jC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==jC(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}fC.prototype={areaStart:iC,areaEnd:iC,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}},mC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t)}}},bC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:yC(this,this._t0,wC(this,this._t0))}(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(t=+t,(e=+e)!==this._x1||t!==this._y1){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,yC(this,wC(this,n=gC(this,e,t)),n);break;default:yC(this,this._t0,n=gC(this,e,t))}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}},(vC.prototype=Object.create(bC.prototype)).point=function(e,t){bC.prototype.point.call(this,t,e)},xC.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,o){this._context.bezierCurveTo(t,e,r,n,o,a)}},_C.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),2===n)this._context.lineTo(e[1],t[1]);else for(var r=EC(e),a=EC(t),o=0,i=1;i<n;++o,++i)this._context.bezierCurveTo(r[0][o],a[0][o],r[1][o],a[1][o],e[i],t[i]);(this._line||0!==this._line&&1===n)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(e,t){this._x.push(+e),this._y.push(+t)}},NC.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&2===this._point&&this._context.lineTo(this._x,this._y),(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}}this._x=e,this._y=t}};var OC={curveBasisClosed:function(e){return new cC(e)},curveBasisOpen:function(e){return new uC(e)},curveBasis:function(e){return new lC(e)},curveBumpX:function(e){return new dC(e,!0)},curveBumpY:function(e){return new dC(e,!1)},curveLinearClosed:function(e){return new fC(e)},curveLinear:pC,curveMonotoneX:function(e){return new bC(e)},curveMonotoneY:function(e){return new vC(e)},curveNatural:function(e){return new _C(e)},curveStep:function(e){return new NC(e,.5)},curveStepAfter:function(e){return new NC(e,1)},curveStepBefore:function(e){return new NC(e,0)}},LC=function(e){return e.x===+e.x&&e.y===+e.y},zC=function(e){return e.x},PC=function(e){return e.y},RC=function(e){var t=e.className,n=e.points,r=e.path,a=e.pathRef;if(!(n&&n.length||r))return null;var o=n&&n.length?function(e){var t,n=e.type,r=void 0===n?"linear":n,a=e.points,o=void 0===a?[]:a,i=e.baseLine,s=e.layout,l=e.connectNulls,c=void 0!==l&&l,u=function(e,t){if(og()(e))return e;var n="curve".concat(Pw()(e));return"curveMonotone"!==n&&"curveBump"!==n||!t?OC[n]||pC:OC["".concat(n).concat("vertical"===t?"Y":"X")]}(r,s),d=c?o.filter(function(e){return LC(e)}):o;if(Array.isArray(i)){var f=c?i.filter(function(e){return LC(e)}):i,m=d.map(function(e,t){return AC(AC({},e),{},{base:f[t]})});return t="vertical"===s?kC().y(PC).x1(zC).x0(function(e){return e.base.x}):kC().x(zC).y1(PC).y0(function(e){return e.base.y}),t.defined(LC).curve(u),t(m)}return(t="vertical"===s&&Hh(i)?kC().y(PC).x1(zC).x0(i):Hh(i)?kC().x(zC).y1(PC).y0(i):SC().x(zC).y(PC)).defined(LC).curve(u),t(d)}(e):r;return i.createElement("path",DC({},Dg(e,!1),hg(e),{className:Te("recharts-curve",t),d:o,ref:a}))};function UC(e){return UC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},UC(e)}var BC=["x","y","top","left","width","height","className"];function FC(){return FC=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},FC.apply(this,arguments)}function YC(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function QC(e,t,n){return t=function(e){var t=function(e){if("object"!=UC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=UC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==UC(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var VC=function(e,t,n,r,a,o){return"M".concat(e,",").concat(a,"v").concat(r,"M").concat(o,",").concat(t,"h").concat(n)},WC=function(e){var t=e.x,n=void 0===t?0:t,r=e.y,a=void 0===r?0:r,o=e.top,i=void 0===o?0:o,s=e.left,c=void 0===s?0:s,u=e.width,d=void 0===u?0:u,f=e.height,m=void 0===f?0:f,p=e.className,h=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?YC(Object(n),!0).forEach(function(t){QC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):YC(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({x:n,y:a,top:i,left:c,width:d,height:m},function(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,BC));return Hh(n)&&Hh(a)&&Hh(d)&&Hh(m)&&Hh(i)&&Hh(c)?l().createElement("path",FC({},Dg(h,!0),{className:Te("recharts-cross",p),d:VC(n,a,d,m,i,c)})):null};function ZC(e){var t=e.cx,n=e.cy,r=e.radius,a=e.startAngle,o=e.endAngle;return{points:[ik(t,n,r,a),ik(t,n,r,o)],cx:t,cy:n,radius:r,startAngle:a,endAngle:o}}function GC(e,t,n){var r,a,o,i;if("horizontal"===e)o=r=t.x,a=n.top,i=n.top+n.height;else if("vertical"===e)i=a=t.y,r=n.left,o=n.left+n.width;else if(null!=t.cx&&null!=t.cy){if("centric"!==e)return ZC(t);var s=t.cx,l=t.cy,c=t.innerRadius,u=t.outerRadius,d=t.angle,f=ik(s,l,c,d),m=ik(s,l,u,d);r=f.x,a=f.y,o=m.x,i=m.y}return[{x:r,y:a},{x:o,y:i}]}function HC(e){return HC="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},HC(e)}function $C(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function XC(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$C(Object(n),!0).forEach(function(t){qC(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$C(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qC(e,t,n){return t=function(e){var t=function(e){if("object"!=HC(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=HC(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==HC(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function JC(e){var t,n,r,a=e.element,o=e.tooltipEventType,s=e.isActive,l=e.activeCoordinate,c=e.activePayload,u=e.offset,d=e.activeTooltipIndex,f=e.tooltipAxisBandSize,m=e.layout,p=e.chartName,h=null!==(t=a.props.cursor)&&void 0!==t?t:null===(n=a.type.defaultProps)||void 0===n?void 0:n.cursor;if(!a||!h||!s||!l||"ScatterChart"!==p&&"axis"!==o)return null;var g=RC;if("ScatterChart"===p)r=l,g=WC;else if("BarChart"===p)r=function(e,t,n,r){var a=r/2;return{stroke:"none",fill:"#ccc",x:"horizontal"===e?t.x-a:n.left+.5,y:"horizontal"===e?n.top+.5:t.y-a,width:"horizontal"===e?r:n.width-1,height:"horizontal"===e?n.height-1:r}}(m,l,u,f),g=Nv;else if("radial"===m){var w=ZC(l),y=w.cx,b=w.cy,v=w.radius;r={cx:y,cy:b,startAngle:w.startAngle,endAngle:w.endAngle,innerRadius:v,outerRadius:v},g=aj}else r={points:GC(m,l,u)},g=RC;var x=XC(XC(XC(XC({stroke:"#ccc",pointerEvents:"none"},u),r),Dg(h,!1)),{},{payload:c,payloadIndex:d,className:Te("recharts-tooltip-cursor",h.className)});return(0,i.isValidElement)(h)?(0,i.cloneElement)(h,x):(0,i.createElement)(g,x)}var KC=["item"],eA=["children","className","width","height","style","compact","title","desc"];function tA(e){return tA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tA(e)}function nA(){return nA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},nA.apply(this,arguments)}function rA(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||uA(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function aA(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function oA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,hA(r.key),r)}}function iA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(iA=function(){return!!e})()}function sA(e){return sA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sA(e)}function lA(e,t){return lA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lA(e,t)}function cA(e){return function(e){if(Array.isArray(e))return dA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||uA(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function uA(e,t){if(e){if("string"==typeof e)return dA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?dA(e,t):void 0}}function dA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function fA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function mA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?fA(Object(n),!0).forEach(function(t){pA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):fA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pA(e,t,n){return(t=hA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hA(e){var t=function(e){if("object"!=tA(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=tA(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tA(t)?t:t+""}var gA={xAxis:["bottom","top"],yAxis:["left","right"]},wA={width:"100%",height:"100%"},yA={x:0,y:0};function bA(e){return e}var vA=function(e,t){var n=t.graphicalItems,r=t.dataStartIndex,a=t.dataEndIndex,o=(null!=n?n:[]).reduce(function(e,t){var n=t.props.data;return n&&n.length?[].concat(cA(e),cA(n)):e},[]);return o.length>0?o:e&&e.length&&Hh(r)&&Hh(a)?e.slice(r,a+1):[]};function xA(e){return"number"===e?[0,"auto"]:void 0}var _A=function(e,t,n,r){var a=e.graphicalItems,o=e.tooltipAxis,i=vA(t,e);return n<0||!a||!a.length||n>=i.length?null:a.reduce(function(a,s){var l,c,u=null!==(l=s.props.data)&&void 0!==l?l:t;return u&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(u=u.slice(e.dataStartIndex,e.dataEndIndex+1)),(c=o.dataKey&&!o.allowDuplicatedCategory?tg(void 0===u?i:u,o.dataKey,r):u&&u[n]||i[n])?[].concat(cA(a),[zS(s,c)]):a},[])},EA=function(e,t,n,r){var a=r||{x:e.chartX,y:e.chartY},o=function(e,t){return"horizontal"===t?e.x:"vertical"===t?e.y:"centric"===t?e.angle:e.radius}(a,n),i=e.orderedTooltipTicks,s=e.tooltipAxis,l=e.tooltipTicks,c=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0,o=-1,i=null!==(t=null==n?void 0:n.length)&&void 0!==t?t:0;if(i<=1)return 0;if(a&&"angleAxis"===a.axisType&&Math.abs(Math.abs(a.range[1]-a.range[0])-360)<=1e-6)for(var s=a.range,l=0;l<i;l++){var c=l>0?r[l-1].coordinate:r[i-1].coordinate,u=r[l].coordinate,d=l>=i-1?r[0].coordinate:r[l+1].coordinate,f=void 0;if(Zh(u-c)!==Zh(d-u)){var m=[];if(Zh(d-u)===Zh(s[1]-s[0])){f=d;var p=u+s[1]-s[0];m[0]=Math.min(p,(p+c)/2),m[1]=Math.max(p,(p+c)/2)}else{f=c;var h=d+s[1]-s[0];m[0]=Math.min(u,(h+u)/2),m[1]=Math.max(u,(h+u)/2)}var g=[Math.min(u,(f+u)/2),Math.max(u,(f+u)/2)];if(e>g[0]&&e<=g[1]||e>=m[0]&&e<=m[1]){o=r[l].index;break}}else{var w=Math.min(c,d),y=Math.max(c,d);if(e>(w+u)/2&&e<=(y+u)/2){o=r[l].index;break}}}else for(var b=0;b<i;b++)if(0===b&&e<=(n[b].coordinate+n[b+1].coordinate)/2||b>0&&b<i-1&&e>(n[b].coordinate+n[b-1].coordinate)/2&&e<=(n[b].coordinate+n[b+1].coordinate)/2||b===i-1&&e>(n[b].coordinate+n[b-1].coordinate)/2){o=n[b].index;break}return o}(o,i,l,s);if(c>=0&&l){var u=l[c]&&l[c].value,d=_A(e,t,c,u),f=function(e,t,n,r){var a=t.find(function(e){return e&&e.index===n});if(a){if("horizontal"===e)return{x:a.coordinate,y:r.y};if("vertical"===e)return{x:r.x,y:a.coordinate};if("centric"===e){var o=a.coordinate,i=r.radius;return mA(mA(mA({},r),ik(r.cx,r.cy,i,o)),{},{angle:o,radius:i})}var s=a.coordinate,l=r.angle;return mA(mA(mA({},r),ik(r.cx,r.cy,s,l)),{},{angle:l,radius:s})}return yA}(n,i,c,a);return{activeTooltipIndex:c,activeLabel:u,activePayload:d,activeCoordinate:f}}return null},NA=function(e,t){var n=t.axisType,r=void 0===n?"xAxis":n,a=t.AxisComp,o=t.graphicalItems,i=t.stackGroups,s=t.dataStartIndex,l=t.dataEndIndex,c=e.children,u="".concat(r,"Id"),d=Ig(c,a),f={};return d&&d.length?f=function(e,t){var n=t.axes,r=t.graphicalItems,a=t.axisType,o=t.axisIdKey,i=t.stackGroups,s=t.dataStartIndex,l=t.dataEndIndex,c=e.layout,u=e.children,d=e.stackOffset,f=vS(c,a);return n.reduce(function(t,n){var m,p=void 0!==n.type.defaultProps?mA(mA({},n.type.defaultProps),n.props):n.props,h=p.type,g=p.dataKey,w=p.allowDataOverflow,y=p.allowDuplicatedCategory,b=p.scale,v=p.ticks,x=p.includeHidden,_=p[o];if(t[_])return t;var E,N,M,I=vA(e.data,{graphicalItems:r.filter(function(e){var t;return(o in e.props?e.props[o]:null===(t=e.type.defaultProps)||void 0===t?void 0:t[o])===_}),dataStartIndex:s,dataEndIndex:l}),S=I.length;(function(e,t,n){if("number"===n&&!0===t&&Array.isArray(e)){var r=null==e?void 0:e[0],a=null==e?void 0:e[1];if(r&&a&&Hh(r)&&Hh(a))return!0}return!1})(p.domain,w,h)&&(E=TS(p.domain,null,w),!f||"number"!==h&&"auto"===b||(M=gS(I,g,"category")));var k=xA(h);if(!E||0===E.length){var j,D=null!==(j=p.domain)&&void 0!==j?j:k;if(g){if(E=gS(I,g,h),"category"===h&&f){var C=function(e){if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;r<t;r++){if(n[e[r]])return!0;n[e[r]]=!0}return!1}(E);y&&C?(N=E,E=Yg()(0,S)):y||(E=LS(D,E,n).reduce(function(e,t){return e.indexOf(t)>=0?e:[].concat(cA(e),[t])},[]))}else if("category"===h)E=y?E.filter(function(e){return""!==e&&!Wh()(e)}):LS(D,E,n).reduce(function(e,t){return e.indexOf(t)>=0||""===t||Wh()(t)?e:[].concat(cA(e),[t])},[]);else if("number"===h){var A=function(e,t,n,r,a){var o=t.map(function(t){return yS(e,t,n,a,r)}).filter(function(e){return!Wh()(e)});return o&&o.length?o.reduce(function(e,t){return[Math.min(e[0],t[0]),Math.max(e[1],t[1])]},[1/0,-1/0]):null}(I,r.filter(function(e){var t,n,r=o in e.props?e.props[o]:null===(t=e.type.defaultProps)||void 0===t?void 0:t[o],a="hide"in e.props?e.props.hide:null===(n=e.type.defaultProps)||void 0===n?void 0:n.hide;return r===_&&(x||!a)}),g,a,c);A&&(E=A)}!f||"number"!==h&&"auto"===b||(M=gS(I,g,"category"))}else E=f?Yg()(0,S):i&&i[_]&&i[_].hasStack&&"number"===h?"expand"===d?[0,1]:DS(i[_].stackGroups,s,l):bS(I,r.filter(function(e){var t=o in e.props?e.props[o]:e.type.defaultProps[o],n="hide"in e.props?e.props.hide:e.type.defaultProps.hide;return t===_&&(x||!n)}),h,c,!0);if("number"===h)E=qD(u,E,_,a,v),D&&(E=TS(D,E,w));else if("category"===h&&D){var T=D;E.every(function(e){return T.indexOf(e)>=0})&&(E=T)}}return mA(mA({},t),{},pA({},_,mA(mA({},p),{},{axisType:a,domain:E,categoricalDomain:M,duplicateDomain:N,originalDomain:null!==(m=p.domain)&&void 0!==m?m:k,isCategorical:f,layout:c})))},{})}(e,{axes:d,graphicalItems:o,axisType:r,axisIdKey:u,stackGroups:i,dataStartIndex:s,dataEndIndex:l}):o&&o.length&&(f=function(e,t){var n=t.graphicalItems,r=t.Axis,a=t.axisType,o=t.axisIdKey,i=t.stackGroups,s=t.dataStartIndex,l=t.dataEndIndex,c=e.layout,u=e.children,d=vA(e.data,{graphicalItems:n,dataStartIndex:s,dataEndIndex:l}),f=d.length,m=vS(c,a),p=-1;return n.reduce(function(e,t){var h,g=(void 0!==t.type.defaultProps?mA(mA({},t.type.defaultProps),t.props):t.props)[o],w=xA("number");return e[g]?e:(p++,m?h=Yg()(0,f):i&&i[g]&&i[g].hasStack?(h=DS(i[g].stackGroups,s,l),h=qD(u,h,g,a)):(h=TS(w,bS(d,n.filter(function(e){var t,n,r=o in e.props?e.props[o]:null===(t=e.type.defaultProps)||void 0===t?void 0:t[o],a="hide"in e.props?e.props.hide:null===(n=e.type.defaultProps)||void 0===n?void 0:n.hide;return r===g&&!a}),"number",c),r.defaultProps.allowDataOverflow),h=qD(u,h,g,a)),mA(mA({},e),{},pA({},g,mA(mA({axisType:a},r.defaultProps),{},{hide:!0,orientation:Fh()(gA,"".concat(a,".").concat(p%2),null),domain:h,originalDomain:w,isCategorical:m,layout:c}))))},{})}(e,{Axis:a,graphicalItems:o,axisType:r,axisIdKey:u,stackGroups:i,dataStartIndex:s,dataEndIndex:l})),f},MA=function(e){var t=e.children,n=e.defaultShowTooltip,r=Sg(t,KS),a=0,o=0;return e.data&&0!==e.data.length&&(o=e.data.length-1),r&&r.props&&(r.props.startIndex>=0&&(a=r.props.startIndex),r.props.endIndex>=0&&(o=r.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:a,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:Boolean(n)}},IA=function(e){return"horizontal"===e?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:"vertical"===e?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:"centric"===e?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},SA=function(e,t){return"xAxis"===t?e[t].width:"yAxis"===t?e[t].height:void 0},kA=["type","layout","connectNulls","ref"],jA=["key"];function DA(e){return DA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},DA(e)}function CA(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function AA(){return AA=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},AA.apply(this,arguments)}function TA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function OA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?TA(Object(n),!0).forEach(function(t){FA(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):TA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function LA(e){return function(e){if(Array.isArray(e))return zA(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return zA(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zA(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function zA(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function PA(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,YA(r.key),r)}}function RA(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(RA=function(){return!!e})()}function UA(e){return UA=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},UA(e)}function BA(e,t){return BA=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},BA(e,t)}function FA(e,t,n){return(t=YA(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function YA(e){var t=function(e){if("object"!=DA(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=DA(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==DA(t)?t:t+""}var QA=function(e){function t(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return FA(e=function(e,t,n){return t=UA(t),function(e,t){if(t&&("object"===DA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,RA()?Reflect.construct(t,n||[],UA(e).constructor):t.apply(e,n))}(this,t,[].concat(r)),"state",{isAnimationFinished:!0,totalLength:0}),FA(e,"generateSimpleStrokeDasharray",function(e,t){return"".concat(t,"px ").concat(e-t,"px")}),FA(e,"getStrokeDasharray",function(n,r,a){var o=a.reduce(function(e,t){return e+t});if(!o)return e.generateSimpleStrokeDasharray(r,n);for(var i=Math.floor(n/o),s=n%o,l=r-n,c=[],u=0,d=0;u<a.length;d+=a[u],++u)if(d+a[u]>s){c=[].concat(LA(a.slice(0,u)),[s-d]);break}var f=c.length%2==0?[0,l]:[l];return[].concat(LA(t.repeat(a,i)),LA(c),f).map(function(e){return"".concat(e,"px")}).join(", ")}),FA(e,"id",qh("recharts-line-")),FA(e,"pathRef",function(t){e.mainCurve=t}),FA(e,"handleAnimationEnd",function(){e.setState({isAnimationFinished:!0}),e.props.onAnimationEnd&&e.props.onAnimationEnd()}),FA(e,"handleAnimationStart",function(){e.setState({isAnimationFinished:!1}),e.props.onAnimationStart&&e.props.onAnimationStart()}),e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&BA(e,t)}(t,e),n=t,r=[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();this.setState({totalLength:e})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var e=this.getTotalLength();e!==this.state.totalLength&&this.setState({totalLength:e})}}},{key:"getTotalLength",value:function(){var e=this.mainCurve;try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}},{key:"renderErrorBar",value:function(e,t){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var n=this.props,r=n.points,a=n.xAxis,o=n.yAxis,i=n.layout,s=Ig(n.children,rS);if(!s)return null;var c=function(e,t){return{x:e.x,y:e.y,value:e.value,errorVal:hS(e.payload,t)}},u={clipPath:e?"url(#clipPath-".concat(t,")"):null};return l().createElement(Xg,u,s.map(function(e){return l().cloneElement(e,{key:"bar-".concat(e.props.dataKey),data:r,xAxis:a,yAxis:o,layout:i,dataPointFormatter:c})}))}},{key:"renderDots",value:function(e,n,r){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var a=this.props,o=a.dot,i=a.points,s=a.dataKey,c=Dg(this.props,!1),u=Dg(o,!0),d=i.map(function(e,n){var r=OA(OA(OA({key:"dot-".concat(n),r:3},c),u),{},{index:n,cx:e.x,cy:e.y,value:e.value,dataKey:s,payload:e.payload,points:i});return t.renderDotItem(o,r)}),f={clipPath:e?"url(#clipPath-".concat(n?"":"dots-").concat(r,")"):null};return l().createElement(Xg,AA({className:"recharts-line-dots",key:"dots"},f),d)}},{key:"renderCurveStatically",value:function(e,t,n,r){var a=this.props,o=a.type,i=a.layout,s=a.connectNulls,c=(a.ref,CA(a,kA)),u=OA(OA(OA({},Dg(c,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:t?"url(#clipPath-".concat(n,")"):null,points:e},r),{},{type:o,layout:i,connectNulls:s});return l().createElement(RC,AA({},u,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(e,t){var n=this,r=this.props,a=r.points,o=r.strokeDasharray,i=r.isAnimationActive,s=r.animationBegin,c=r.animationDuration,u=r.animationEasing,d=r.animationId,f=r.animateNewValues,m=r.width,p=r.height,h=this.state,g=h.prevPoints,w=h.totalLength;return l().createElement(pv,{begin:s,duration:c,isActive:i,easing:u,from:{t:0},to:{t:1},key:"line-".concat(d),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(r){var i=r.t;if(g){var s=g.length/a.length,l=a.map(function(e,t){var n=Math.floor(t*s);if(g[n]){var r=g[n],a=eg(r.x,e.x),o=eg(r.y,e.y);return OA(OA({},e),{},{x:a(i),y:o(i)})}if(f){var l=eg(2*m,e.x),c=eg(p/2,e.y);return OA(OA({},e),{},{x:l(i),y:c(i)})}return OA(OA({},e),{},{x:e.x,y:e.y})});return n.renderCurveStatically(l,e,t)}var c,u=eg(0,w)(i);if(o){var d="".concat(o).split(/[,\s]+/gim).map(function(e){return parseFloat(e)});c=n.getStrokeDasharray(u,w,d)}else c=n.generateSimpleStrokeDasharray(w,u);return n.renderCurveStatically(a,e,t,{strokeDasharray:c})})}},{key:"renderCurve",value:function(e,t){var n=this.props,r=n.points,a=n.isAnimationActive,o=this.state,i=o.prevPoints,s=o.totalLength;return a&&r&&r.length&&(!i&&s>0||!vI()(i,r))?this.renderCurveWithAnimation(e,t):this.renderCurveStatically(r,e,t)}},{key:"render",value:function(){var e,t=this.props,n=t.hide,r=t.dot,a=t.points,o=t.className,i=t.xAxis,s=t.yAxis,c=t.top,u=t.left,d=t.width,f=t.height,m=t.isAnimationActive,p=t.id;if(n||!a||!a.length)return null;var h=this.state.isAnimationFinished,g=1===a.length,w=Te("recharts-line",o),y=i&&i.allowDataOverflow,b=s&&s.allowDataOverflow,v=y||b,x=Wh()(p)?this.id:p,_=null!==(e=Dg(r,!1))&&void 0!==e?e:{r:3,strokeWidth:2},E=_.r,N=void 0===E?3:E,M=_.strokeWidth,I=void 0===M?2:M,S=(function(e){return e&&"object"===vg(e)&&"clipDot"in e}(r)?r:{}).clipDot,k=void 0===S||S,j=2*N+I;return l().createElement(Xg,{className:w},y||b?l().createElement("defs",null,l().createElement("clipPath",{id:"clipPath-".concat(x)},l().createElement("rect",{x:y?u:u-d/2,y:b?c:c-f/2,width:y?d:2*d,height:b?f:2*f})),!k&&l().createElement("clipPath",{id:"clipPath-dots-".concat(x)},l().createElement("rect",{x:u-j/2,y:c-j/2,width:d+j,height:f+j}))):null,!g&&this.renderCurve(v,x),this.renderErrorBar(v,x),(g||r)&&this.renderDots(v,k,x),(!m||h)&&zk.renderCallByParent(this.props,a))}}],a=[{key:"getDerivedStateFromProps",value:function(e,t){return e.animationId!==t.prevAnimationId?{prevAnimationId:e.animationId,curPoints:e.points,prevPoints:t.curPoints}:e.points!==t.curPoints?{curPoints:e.points}:null}},{key:"repeat",value:function(e,t){for(var n=e.length%2!=0?[].concat(LA(e),[0]):e,r=[],a=0;a<t;++a)r=[].concat(LA(r),LA(n));return r}},{key:"renderDotItem",value:function(e,t){var n;if(l().isValidElement(e))n=l().cloneElement(e,t);else if(og()(e))n=e(t);else{var r=t.key,a=CA(t,jA),o=Te("recharts-line-dot","boolean"!=typeof e?e.className:"");n=l().createElement(Gy,AA({key:r},a,{className:o}))}return n}}],r&&PA(n.prototype,r),a&&PA(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,a}(i.PureComponent);function VA(e,t,n){if(t<1)return[];if(1===t&&void 0===n)return e;for(var r=[],a=0;a<e.length;a+=t){if(void 0!==n&&!0!==n(e[a]))return;r.push(e[a])}return r}function WA(e,t,n,r,a){if(e*t<e*r||e*t>e*a)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-a)<=0}function ZA(e){return ZA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ZA(e)}function GA(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function HA(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?GA(Object(n),!0).forEach(function(t){$A(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):GA(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function $A(e,t,n){return t=function(e){var t=function(e){if("object"!=ZA(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=ZA(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ZA(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function XA(e,t,n){var r=e.tick,a=e.ticks,o=e.viewBox,i=e.minTickGap,s=e.orientation,l=e.interval,c=e.tickFormatter,u=e.unit,d=e.angle;if(!a||!a.length||!r)return[];if(Hh(l)||xw.isSsr)return function(e,t){return VA(e,t+1)}(a,"number"==typeof l&&Hh(l)?l:0);var f=[],m="top"===s||"bottom"===s?"width":"height",p=u&&"width"===m?Yv(u,{fontSize:t,letterSpacing:n}):{width:0,height:0},h=function(e,r){var a=og()(c)?c(e.value,r):e.value;return"width"===m?function(e,t,n){return function(e){var t=e.width,n=e.height,r=function(e){return(e%180+180)%180}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:0),a=r*Math.PI/180,o=Math.atan(n/t),i=a>o&&a<Math.PI-o?n/Math.sin(a):t/Math.cos(a);return Math.abs(i)}({width:e.width+t.width,height:e.height+t.height},n)}(Yv(a,{fontSize:t,letterSpacing:n}),p,d):Yv(a,{fontSize:t,letterSpacing:n})[m]},g=a.length>=2?Zh(a[1].coordinate-a[0].coordinate):1,w=function(e,t,n){var r="width"===n,a=e.x,o=e.y,i=e.width,s=e.height;return 1===t?{start:r?a:o,end:r?a+i:o+s}:{start:r?a+i:o+s,end:r?a:o}}(o,g,m);return"equidistantPreserveStart"===l?function(e,t,n,r,a){for(var o,i=(r||[]).slice(),s=t.start,l=t.end,c=0,u=1,d=s,f=function(){var t=null==r?void 0:r[c];if(void 0===t)return{v:VA(r,u)};var o,i=c,f=function(){return void 0===o&&(o=n(t,i)),o},m=t.coordinate,p=0===c||WA(e,m,f,d,l);p||(c=0,d=s,u+=1),p&&(d=m+e*(f()/2+a),c+=u)};u<=i.length;)if(o=f())return o.v;return[]}(g,w,h,a,i):(f="preserveStart"===l||"preserveStartEnd"===l?function(e,t,n,r,a,o){var i=(r||[]).slice(),s=i.length,l=t.start,c=t.end;if(o){var u=r[s-1],d=n(u,s-1),f=e*(u.coordinate+e*d/2-c);i[s-1]=u=HA(HA({},u),{},{tickCoord:f>0?u.coordinate-f*e:u.coordinate}),WA(e,u.tickCoord,function(){return d},l,c)&&(c=u.tickCoord-e*(d/2+a),i[s-1]=HA(HA({},u),{},{isShow:!0}))}for(var m=o?s-1:s,p=function(t){var r,o=i[t],s=function(){return void 0===r&&(r=n(o,t)),r};if(0===t){var u=e*(o.coordinate-e*s()/2-l);i[t]=o=HA(HA({},o),{},{tickCoord:u<0?o.coordinate-u*e:o.coordinate})}else i[t]=o=HA(HA({},o),{},{tickCoord:o.coordinate});WA(e,o.tickCoord,s,l,c)&&(l=o.tickCoord+e*(s()/2+a),i[t]=HA(HA({},o),{},{isShow:!0}))},h=0;h<m;h++)p(h);return i}(g,w,h,a,i,"preserveStartEnd"===l):function(e,t,n,r,a){for(var o=(r||[]).slice(),i=o.length,s=t.start,l=t.end,c=function(t){var r,c=o[t],u=function(){return void 0===r&&(r=n(c,t)),r};if(t===i-1){var d=e*(c.coordinate+e*u()/2-l);o[t]=c=HA(HA({},c),{},{tickCoord:d>0?c.coordinate-d*e:c.coordinate})}else o[t]=c=HA(HA({},c),{},{tickCoord:c.coordinate});WA(e,c.tickCoord,u,s,l)&&(l=c.tickCoord-e*(u()/2+a),o[t]=HA(HA({},c),{},{isShow:!0}))},u=i-1;u>=0;u--)c(u);return o}(g,w,h,a,i),f.filter(function(e){return e.isShow}))}FA(QA,"displayName","Line"),FA(QA,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!xw.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1}),FA(QA,"getComposedData",function(e){var t=e.props,n=e.xAxis,r=e.yAxis,a=e.xAxisTicks,o=e.yAxisTicks,i=e.dataKey,s=e.bandSize,l=e.displayedData,c=e.offset,u=t.layout,d=l.map(function(e,t){var l=hS(e,i);return"horizontal"===u?{x:kS({axis:n,ticks:a,bandSize:s,entry:e,index:t}),y:Wh()(l)?null:r.scale(l),value:l,payload:e}:{x:Wh()(l)?null:n.scale(l),y:kS({axis:r,ticks:o,bandSize:s,entry:e,index:t}),value:l,payload:e}});return OA({points:d,layout:u},c)});var qA=["viewBox"],JA=["viewBox"],KA=["ticks"];function eT(e){return eT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eT(e)}function tT(){return tT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tT.apply(this,arguments)}function nT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function rT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nT(Object(n),!0).forEach(function(t){cT(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nT(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function aT(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function oT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,uT(r.key),r)}}function iT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(iT=function(){return!!e})()}function sT(e){return sT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},sT(e)}function lT(e,t){return lT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},lT(e,t)}function cT(e,t,n){return(t=uT(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uT(e){var t=function(e){if("object"!=eT(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=eT(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==eT(t)?t:t+""}var dT=function(e){function t(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=function(e,t,n){return t=sT(t),function(e,t){if(t&&("object"===eT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,iT()?Reflect.construct(t,n||[],sT(e).constructor):t.apply(e,n))}(this,t,[e])).state={fontSize:"",letterSpacing:""},n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lT(e,t)}(t,e),n=t,r=[{key:"shouldComponentUpdate",value:function(e,t){var n=e.viewBox,r=aT(e,qA),a=this.props,o=a.viewBox,i=aT(a,JA);return!cg(n,o)||!cg(r,i)||!cg(t,this.state)}},{key:"componentDidMount",value:function(){var e=this.layerReference;if(e){var t=e.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];t&&this.setState({fontSize:window.getComputedStyle(t).fontSize,letterSpacing:window.getComputedStyle(t).letterSpacing})}}},{key:"getTickLineCoord",value:function(e){var t,n,r,a,o,i,s=this.props,l=s.x,c=s.y,u=s.width,d=s.height,f=s.orientation,m=s.tickSize,p=s.mirror,h=s.tickMargin,g=p?-1:1,w=e.tickSize||m,y=Hh(e.tickCoord)?e.tickCoord:e.coordinate;switch(f){case"top":t=n=e.coordinate,i=(r=(a=c+ +!p*d)-g*w)-g*h,o=y;break;case"left":r=a=e.coordinate,o=(t=(n=l+ +!p*u)-g*w)-g*h,i=y;break;case"right":r=a=e.coordinate,o=(t=(n=l+ +p*u)+g*w)+g*h,i=y;break;default:t=n=e.coordinate,i=(r=(a=c+ +p*d)+g*w)+g*h,o=y}return{line:{x1:t,y1:r,x2:n,y2:a},tick:{x:o,y:i}}}},{key:"getTickTextAnchor",value:function(){var e,t=this.props,n=t.orientation,r=t.mirror;switch(n){case"left":e=r?"start":"end";break;case"right":e=r?"end":"start";break;default:e="middle"}return e}},{key:"getTickVerticalAnchor",value:function(){var e=this.props,t=e.orientation,n=e.mirror,r="end";switch(t){case"left":case"right":r="middle";break;case"top":r=n?"start":"end";break;default:r=n?"end":"start"}return r}},{key:"renderAxisLine",value:function(){var e=this.props,t=e.x,n=e.y,r=e.width,a=e.height,o=e.orientation,i=e.mirror,s=e.axisLine,c=rT(rT(rT({},Dg(this.props,!1)),Dg(s,!1)),{},{fill:"none"});if("top"===o||"bottom"===o){var u=+("top"===o&&!i||"bottom"===o&&i);c=rT(rT({},c),{},{x1:t,y1:n+u*a,x2:t+r,y2:n+u*a})}else{var d=+("left"===o&&!i||"right"===o&&i);c=rT(rT({},c),{},{x1:t+d*r,y1:n,x2:t+d*r,y2:n+a})}return l().createElement("line",tT({},c,{className:Te("recharts-cartesian-axis-line",Fh()(s,"className"))}))}},{key:"renderTicks",value:function(e,n,r){var a=this,o=this.props,i=o.tickLine,s=o.stroke,c=o.tick,u=o.tickFormatter,d=o.unit,f=XA(rT(rT({},this.props),{},{ticks:e}),n,r),m=this.getTickTextAnchor(),p=this.getTickVerticalAnchor(),h=Dg(this.props,!1),g=Dg(c,!1),w=rT(rT({},h),{},{fill:"none"},Dg(i,!1)),y=f.map(function(e,n){var r=a.getTickLineCoord(e),o=r.line,y=r.tick,b=rT(rT(rT(rT({textAnchor:m,verticalAnchor:p},h),{},{stroke:"none",fill:s},g),y),{},{index:n,payload:e,visibleTicksCount:f.length,tickFormatter:u});return l().createElement(Xg,tT({className:"recharts-cartesian-axis-tick",key:"tick-".concat(e.value,"-").concat(e.coordinate,"-").concat(e.tickCoord)},gg(a.props,e,n)),i&&l().createElement("line",tT({},w,o,{className:Te("recharts-cartesian-axis-tick-line",Fh()(i,"className"))})),c&&t.renderTickItem(c,b,"".concat(og()(u)?u(e.value,n):e.value).concat(d||"")))});return l().createElement("g",{className:"recharts-cartesian-axis-ticks"},y)}},{key:"render",value:function(){var e=this,t=this.props,n=t.axisLine,r=t.width,a=t.height,o=t.ticksGenerator,i=t.className;if(t.hide)return null;var s=this.props,c=s.ticks,u=aT(s,KA),d=c;return og()(o)&&(d=c&&c.length>0?o(this.props):o(u)),r<=0||a<=0||!d||!d.length?null:l().createElement(Xg,{className:Te("recharts-cartesian-axis",i),ref:function(t){e.layerReference=t}},n&&this.renderAxisLine(),this.renderTicks(d,this.state.fontSize,this.state.letterSpacing),gk.renderCallByParent(this.props))}}],a=[{key:"renderTickItem",value:function(e,t,n){var r=Te(t.className,"recharts-cartesian-axis-tick-value");return l().isValidElement(e)?l().cloneElement(e,rT(rT({},t),{},{className:r})):og()(e)?e(rT(rT({},t),{},{className:r})):l().createElement(hx,tT({},t,{className:"recharts-cartesian-axis-tick-value"}),n)}}],r&&oT(n.prototype,r),a&&oT(n,a),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r,a}(i.Component);function fT(e){return fT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fT(e)}function mT(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,yT(r.key),r)}}function pT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(pT=function(){return!!e})()}function hT(e){return hT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},hT(e)}function gT(e,t){return gT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},gT(e,t)}function wT(e,t,n){return(t=yT(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function yT(e){var t=function(e){if("object"!=fT(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=fT(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==fT(t)?t:t+""}function bT(){return bT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},bT.apply(this,arguments)}function vT(e){var t=e.xAxisId,n=ED(),r=ND(),a=xD(t);return null==a?null:i.createElement(dT,bT({},a,{className:Te("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return _S(e,!0)}}))}cT(dT,"displayName","CartesianAxis"),cT(dT,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var xT=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=hT(t),function(e,t){if(t&&("object"===fT(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,pT()?Reflect.construct(t,n||[],hT(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gT(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return i.createElement(vT,this.props)}}])&&mT(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Component);function _T(e){return _T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_T(e)}function ET(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,kT(r.key),r)}}function NT(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(NT=function(){return!!e})()}function MT(e){return MT=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},MT(e)}function IT(e,t){return IT=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},IT(e,t)}function ST(e,t,n){return(t=kT(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kT(e){var t=function(e){if("object"!=_T(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=_T(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==_T(t)?t:t+""}function jT(){return jT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},jT.apply(this,arguments)}wT(xT,"displayName","XAxis"),wT(xT,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});var DT=function(e){var t=e.yAxisId,n=ED(),r=ND(),a=_D(t);return null==a?null:i.createElement(dT,jT({},a,{className:Te("recharts-".concat(a.axisType," ").concat(a.axisType),a.className),viewBox:{x:0,y:0,width:n,height:r},ticksGenerator:function(e){return _S(e,!0)}}))},CT=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,n){return t=MT(t),function(e,t){if(t&&("object"===_T(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,NT()?Reflect.construct(t,n||[],MT(e).constructor):t.apply(e,n))}(this,t,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&IT(e,t)}(t,e),n=t,(r=[{key:"render",value:function(){return i.createElement(DT,this.props)}}])&&ET(n.prototype,r),Object.defineProperty(n,"prototype",{writable:!1}),n;var n,r}(i.Component);ST(CT,"displayName","YAxis"),ST(CT,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});var AT=function(e){var t=e.chartName,n=e.GraphicalChild,r=e.defaultTooltipEventType,a=void 0===r?"axis":r,o=e.validateTooltipEventTypes,s=void 0===o?["axis"]:o,c=e.axisComponents,u=e.legendContent,d=e.formatAxisMap,f=e.defaultProps,m=function(e,r){var a=e.props,o=e.dataStartIndex,i=e.dataEndIndex,s=e.updateId;if(!kg({props:a}))return null;var l=a.children,u=a.layout,f=a.stackOffset,m=a.data,p=a.reverseStackOrder,h=IA(u),g=h.numericAxisName,w=h.cateAxisName,y=Ig(l,n),b=function(e,t,n,r,a,o){if(!e)return null;var i=(o?t.reverse():t).reduce(function(e,t){var a,o=null!==(a=t.type)&&void 0!==a&&a.defaultProps?mS(mS({},t.type.defaultProps),t.props):t.props,i=o.stackId;if(o.hide)return e;var s=o[n],l=e[s]||{hasStack:!1,stackGroups:{}};if($h(i)){var c=l.stackGroups[i]||{numericAxisId:n,cateAxisId:r,items:[]};c.items.push(t),l.hasStack=!0,l.stackGroups[i]=c}else l.stackGroups[qh("_stackId_")]={numericAxisId:n,cateAxisId:r,items:[t]};return mS(mS({},e),{},pS({},s,l))},{});return Object.keys(i).reduce(function(t,o){var s=i[o];return s.hasStack&&(s.stackGroups=Object.keys(s.stackGroups).reduce(function(t,o){var i=s.stackGroups[o];return mS(mS({},t),{},pS({},o,{numericAxisId:n,cateAxisId:r,items:i.items,stackedData:SS(e,i.items,a)}))},{})),mS(mS({},t),{},pS({},o,s))},{})}(m,y,"".concat(g,"Id"),"".concat(w,"Id"),f,p),v=c.reduce(function(e,t){var n="".concat(t.axisType,"Map");return mA(mA({},e),{},pA({},n,NA(a,mA(mA({},t),{},{graphicalItems:y,stackGroups:t.axisType===g&&b,dataStartIndex:o,dataEndIndex:i}))))},{}),x=function(e,t){var n=e.props,r=(e.graphicalItems,e.xAxisMap),a=void 0===r?{}:r,o=e.yAxisMap,i=void 0===o?{}:o,s=n.width,l=n.height,c=n.children,u=n.margin||{},d=Sg(c,KS),f=Sg(c,Wy),m=Object.keys(i).reduce(function(e,t){var n=i[t],r=n.orientation;return n.mirror||n.hide?e:mA(mA({},e),{},pA({},r,e[r]+n.width))},{left:u.left||0,right:u.right||0}),p=Object.keys(a).reduce(function(e,t){var n=a[t],r=n.orientation;return n.mirror||n.hide?e:mA(mA({},e),{},pA({},r,Fh()(e,"".concat(r))+n.height))},{top:u.top||0,bottom:u.bottom||0}),h=mA(mA({},p),m),g=h.bottom;d&&(h.bottom+=d.props.height||KS.defaultProps.height),f&&t&&(h=function(e,t,n,r){var a=n.children,o=n.width,i=n.margin,s=o-(i.left||0)-(i.right||0),l=lS({children:a,legendWidth:s});if(l){var c=r||{},u=c.width,d=c.height,f=l.align,m=l.verticalAlign,p=l.layout;if(("vertical"===p||"horizontal"===p&&"middle"===m)&&"center"!==f&&Hh(e[f]))return mS(mS({},e),{},pS({},f,e[f]+(u||0)));if(("horizontal"===p||"vertical"===p&&"center"===f)&&"middle"!==m&&Hh(e[m]))return mS(mS({},e),{},pS({},m,e[m]+(d||0)))}return e}(h,0,n,t));var w=s-h.left-h.right,y=l-h.top-h.bottom;return mA(mA({brushBottom:g},h),{},{width:Math.max(w,0),height:Math.max(y,0)})}(mA(mA({},v),{},{props:a,graphicalItems:y}),null==r?void 0:r.legendBBox);Object.keys(v).forEach(function(e){v[e]=d(a,v[e],x,e.replace("Map",""),t)});var _,E,M=v["".concat(w,"Map")],I=(_=Kh(M),{tooltipTicks:E=_S(_,!1,!0),orderedTooltipTicks:Vg()(E,function(e){return e.coordinate}),tooltipAxis:_,tooltipAxisBandSize:OS(_,E)}),S=function(e,t){var n=t.graphicalItems,r=t.stackGroups,a=t.offset,o=t.updateId,i=t.dataStartIndex,s=t.dataEndIndex,l=e.barSize,u=e.layout,d=e.barGap,f=e.barCategoryGap,m=e.maxBarSize,p=IA(u),h=p.numericAxisName,g=p.cateAxisName,w=function(e){return!(!e||!e.length)&&e.some(function(e){var t=_g(e&&e.type);return t&&t.indexOf("Bar")>=0})}(n),y=[];return n.forEach(function(n,p){var b=vA(e.data,{graphicalItems:[n],dataStartIndex:i,dataEndIndex:s}),v=void 0!==n.type.defaultProps?mA(mA({},n.type.defaultProps),n.props):n.props,x=v.dataKey,_=v.maxBarSize,E=v["".concat(h,"Id")],M=v["".concat(g,"Id")],I=c.reduce(function(e,n){var r=t["".concat(n.axisType,"Map")],a=v["".concat(n.axisType,"Id")];r&&r[a]||"zAxis"===n.axisType||(0,N.A)(!1);var o=r[a];return mA(mA({},e),{},pA(pA({},n.axisType,o),"".concat(n.axisType,"Ticks"),_S(o)))},{}),S=I[g],k=I["".concat(g,"Ticks")],j=r&&r[E]&&r[E].hasStack&&function(e,t){var n,r=(null!==(n=e.type)&&void 0!==n&&n.defaultProps?mS(mS({},e.type.defaultProps),e.props):e.props).stackId;if($h(r)){var a=t[r];if(a){var o=a.items.indexOf(e);return o>=0?a.stackedData[o]:null}}return null}(n,r[E].stackGroups),D=_g(n.type).indexOf("Bar")>=0,C=OS(S,k),A=[],T=w&&function(e){var t=e.barSize,n=e.totalSize,r=e.stackGroups,a=void 0===r?{}:r;if(!a)return{};for(var o={},i=Object.keys(a),s=0,l=i.length;s<l;s++)for(var c=a[i[s]].stackGroups,u=Object.keys(c),d=0,f=u.length;d<f;d++){var m=c[u[d]],p=m.items,h=m.cateAxisId,g=p.filter(function(e){return _g(e.type).indexOf("Bar")>=0});if(g&&g.length){var w=g[0].type.defaultProps,y=void 0!==w?mS(mS({},w),g[0].props):g[0].props,b=y.barSize,v=y[h];o[v]||(o[v]=[]);var x=Wh()(b)?t:b;o[v].push({item:g[0],stackList:g.slice(1),barSize:Wh()(x)?void 0:Jh(x,n,0)})}}return o}({barSize:l,stackGroups:r,totalSize:SA(I,g)});if(D){var O,L,z=Wh()(_)?m:_,P=null!==(O=null!==(L=OS(S,k,!0))&&void 0!==L?L:z)&&void 0!==O?O:0;A=function(e){var t=e.barGap,n=e.barCategoryGap,r=e.bandSize,a=e.sizeList,o=void 0===a?[]:a,i=e.maxBarSize,s=o.length;if(s<1)return null;var l,c=Jh(t,r,0,!0),u=[];if(o[0].barSize===+o[0].barSize){var d=!1,f=r/s,m=o.reduce(function(e,t){return e+t.barSize||0},0);(m+=(s-1)*c)>=r&&(m-=(s-1)*c,c=0),m>=r&&f>0&&(d=!0,m=s*(f*=.9));var p={offset:((r-m)/2|0)-c,size:0};l=o.reduce(function(e,t){var n={item:t.item,position:{offset:p.offset+p.size+c,size:d?f:t.barSize}},r=[].concat(uS(e),[n]);return p=r[r.length-1].position,t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:p})}),r},u)}else{var h=Jh(n,r,0,!0);r-2*h-(s-1)*c<=0&&(c=0);var g=(r-2*h-(s-1)*c)/s;g>1&&(g>>=0);var w=i===+i?Math.min(g,i):g;l=o.reduce(function(e,t,n){var r=[].concat(uS(e),[{item:t.item,position:{offset:h+(g+c)*n+(g-w)/2,size:w}}]);return t.stackList&&t.stackList.length&&t.stackList.forEach(function(e){r.push({item:e,position:r[r.length-1].position})}),r},u)}return l}({barGap:d,barCategoryGap:f,bandSize:P!==C?P:C,sizeList:T[M],maxBarSize:z}),P!==C&&(A=A.map(function(e){return mA(mA({},e),{},{position:mA(mA({},e.position),{},{offset:e.position.offset-P/2})})}))}var R=n&&n.type&&n.type.getComposedData;R&&y.push({props:mA(mA({},R(mA(mA({},I),{},{displayedData:b,props:e,dataKey:x,item:n,bandSize:C,barPosition:A,offset:a,stackedData:j,layout:u,dataStartIndex:i,dataEndIndex:s}))),{},pA(pA(pA({key:n.key||"item-".concat(p)},h,I[h]),g,I[g]),"animationId",o)),childIndex:Og(n,e.children),item:n})}),y}(a,mA(mA({},v),{},{dataStartIndex:o,dataEndIndex:i,updateId:s,graphicalItems:y,stackGroups:b,offset:x}));return mA(mA({formattedGraphicalItems:S,graphicalItems:y,offset:x,stackGroups:b},I),v)},p=function(e){function n(e){var r,a,o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),pA(o=function(e,t,n){return t=sA(t),function(e,t){if(t&&("object"===tA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,iA()?Reflect.construct(t,n||[],sA(e).constructor):t.apply(e,n))}(this,n,[e]),"eventEmitterSymbol",Symbol("rechartsEventEmitter")),pA(o,"accessibilityManager",new oC),pA(o,"handleLegendBBoxUpdate",function(e){if(e){var t=o.state,n=t.dataStartIndex,r=t.dataEndIndex,a=t.updateId;o.setState(mA({legendBBox:e},m({props:o.props,dataStartIndex:n,dataEndIndex:r,updateId:a},mA(mA({},o.state),{},{legendBBox:e}))))}}),pA(o,"handleReceiveSyncEvent",function(e,t,n){if(o.props.syncId===e){if(n===o.eventEmitterSymbol&&"function"!=typeof o.props.syncMethod)return;o.applySyncEvent(t)}}),pA(o,"handleBrushChange",function(e){var t=e.startIndex,n=e.endIndex;if(t!==o.state.dataStartIndex||n!==o.state.dataEndIndex){var r=o.state.updateId;o.setState(function(){return mA({dataStartIndex:t,dataEndIndex:n},m({props:o.props,dataStartIndex:t,dataEndIndex:n,updateId:r},o.state))}),o.triggerSyncEvent({dataStartIndex:t,dataEndIndex:n})}}),pA(o,"handleMouseEnter",function(e){var t=o.getMouseInfo(e);if(t){var n=mA(mA({},t),{},{isTooltipActive:!0});o.setState(n),o.triggerSyncEvent(n);var r=o.props.onMouseEnter;og()(r)&&r(n,e)}}),pA(o,"triggeredAfterMouseMove",function(e){var t=o.getMouseInfo(e),n=t?mA(mA({},t),{},{isTooltipActive:!0}):{isTooltipActive:!1};o.setState(n),o.triggerSyncEvent(n);var r=o.props.onMouseMove;og()(r)&&r(n,e)}),pA(o,"handleItemMouseEnter",function(e){o.setState(function(){return{isTooltipActive:!0,activeItem:e,activePayload:e.tooltipPayload,activeCoordinate:e.tooltipPosition||{x:e.cx,y:e.cy}}})}),pA(o,"handleItemMouseLeave",function(){o.setState(function(){return{isTooltipActive:!1}})}),pA(o,"handleMouseMove",function(e){e.persist(),o.throttleTriggeredAfterMouseMove(e)}),pA(o,"handleMouseLeave",function(e){o.throttleTriggeredAfterMouseMove.cancel();var t={isTooltipActive:!1};o.setState(t),o.triggerSyncEvent(t);var n=o.props.onMouseLeave;og()(n)&&n(t,e)}),pA(o,"handleOuterEvent",function(e){var t,n=function(e){var t=e&&e.type;return t&&xg[t]?xg[t]:null}(e),r=Fh()(o.props,"".concat(n));n&&og()(r)&&r(null!==(t=/.*touch.*/i.test(n)?o.getMouseInfo(e.changedTouches[0]):o.getMouseInfo(e))&&void 0!==t?t:{},e)}),pA(o,"handleClick",function(e){var t=o.getMouseInfo(e);if(t){var n=mA(mA({},t),{},{isTooltipActive:!0});o.setState(n),o.triggerSyncEvent(n);var r=o.props.onClick;og()(r)&&r(n,e)}}),pA(o,"handleMouseDown",function(e){var t=o.props.onMouseDown;og()(t)&&t(o.getMouseInfo(e),e)}),pA(o,"handleMouseUp",function(e){var t=o.props.onMouseUp;og()(t)&&t(o.getMouseInfo(e),e)}),pA(o,"handleTouchMove",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&o.throttleTriggeredAfterMouseMove(e.changedTouches[0])}),pA(o,"handleTouchStart",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&o.handleMouseDown(e.changedTouches[0])}),pA(o,"handleTouchEnd",function(e){null!=e.changedTouches&&e.changedTouches.length>0&&o.handleMouseUp(e.changedTouches[0])}),pA(o,"handleDoubleClick",function(e){var t=o.props.onDoubleClick;og()(t)&&t(o.getMouseInfo(e),e)}),pA(o,"handleContextMenu",function(e){var t=o.props.onContextMenu;og()(t)&&t(o.getMouseInfo(e),e)}),pA(o,"triggerSyncEvent",function(e){void 0!==o.props.syncId&&KD.emit(eC,o.props.syncId,e,o.eventEmitterSymbol)}),pA(o,"applySyncEvent",function(e){var t=o.props,n=t.layout,r=t.syncMethod,a=o.state.updateId,i=e.dataStartIndex,s=e.dataEndIndex;if(void 0!==e.dataStartIndex||void 0!==e.dataEndIndex)o.setState(mA({dataStartIndex:i,dataEndIndex:s},m({props:o.props,dataStartIndex:i,dataEndIndex:s,updateId:a},o.state)));else if(void 0!==e.activeTooltipIndex){var l=e.chartX,c=e.chartY,u=e.activeTooltipIndex,d=o.state,f=d.offset,p=d.tooltipTicks;if(!f)return;if("function"==typeof r)u=r(p,e);else if("value"===r){u=-1;for(var h=0;h<p.length;h++)if(p[h].value===e.activeLabel){u=h;break}}var g=mA(mA({},f),{},{x:f.left,y:f.top}),w=Math.min(l,g.x+g.width),y=Math.min(c,g.y+g.height),b=p[u]&&p[u].value,v=_A(o.state,o.props.data,u),x=p[u]?{x:"horizontal"===n?p[u].coordinate:w,y:"horizontal"===n?y:p[u].coordinate}:yA;o.setState(mA(mA({},e),{},{activeLabel:b,activeCoordinate:x,activePayload:v,activeTooltipIndex:u}))}else o.setState(e)}),pA(o,"renderCursor",function(e){var n,r=o.state,a=r.isTooltipActive,i=r.activeCoordinate,s=r.activePayload,c=r.offset,u=r.activeTooltipIndex,d=r.tooltipAxisBandSize,f=o.getTooltipEventType(),m=null!==(n=e.props.active)&&void 0!==n?n:a,p=o.props.layout,h=e.key||"_recharts-cursor";return l().createElement(JC,{key:h,activeCoordinate:i,activePayload:s,activeTooltipIndex:u,chartName:t,element:e,isActive:m,layout:p,offset:c,tooltipAxisBandSize:d,tooltipEventType:f})}),pA(o,"renderPolarAxis",function(e,t,n){var r=Fh()(e,"type.axisType"),a=Fh()(o.state,"".concat(r,"Map")),s=e.type.defaultProps,l=void 0!==s?mA(mA({},s),e.props):e.props,c=a&&a[l["".concat(r,"Id")]];return(0,i.cloneElement)(e,mA(mA({},c),{},{className:Te(r,c.className),key:e.key||"".concat(t,"-").concat(n),ticks:_S(c,!0)}))}),pA(o,"renderPolarGrid",function(e){var t=e.props,n=t.radialLines,r=t.polarAngles,a=t.polarRadius,s=o.state,l=s.radiusAxisMap,c=s.angleAxisMap,u=Kh(l),d=Kh(c),f=d.cx,m=d.cy,p=d.innerRadius,h=d.outerRadius;return(0,i.cloneElement)(e,{polarAngles:Array.isArray(r)?r:_S(d,!0).map(function(e){return e.coordinate}),polarRadius:Array.isArray(a)?a:_S(u,!0).map(function(e){return e.coordinate}),cx:f,cy:m,innerRadius:p,outerRadius:h,key:e.key||"polar-grid",radialLines:n})}),pA(o,"renderLegend",function(){var e=o.state.formattedGraphicalItems,t=o.props,n=t.children,r=t.width,a=t.height,s=o.props.margin||{},l=r-(s.left||0)-(s.right||0),c=lS({children:n,formattedGraphicalItems:e,legendWidth:l,legendContent:u});if(!c)return null;var d=c.item,f=aA(c,KC);return(0,i.cloneElement)(d,mA(mA({},f),{},{chartWidth:r,chartHeight:a,margin:s,onBBoxUpdate:o.handleLegendBBoxUpdate}))}),pA(o,"renderTooltip",function(){var e,t=o.props,n=t.children,r=t.accessibilityLayer,a=Sg(n,Lw);if(!a)return null;var s=o.state,l=s.isTooltipActive,c=s.activeCoordinate,u=s.activePayload,d=s.activeLabel,f=s.offset,m=null!==(e=a.props.active)&&void 0!==e?e:l;return(0,i.cloneElement)(a,{viewBox:mA(mA({},f),{},{x:f.left,y:f.top}),active:m,label:d,payload:m?u:[],coordinate:c,accessibilityLayer:r})}),pA(o,"renderBrush",function(e){var t=o.props,n=t.margin,r=t.data,a=o.state,s=a.offset,l=a.dataStartIndex,c=a.dataEndIndex,u=a.updateId;return(0,i.cloneElement)(e,{key:e.key||"_recharts-brush",onChange:NS(o.handleBrushChange,e.props.onChange),data:r,x:Hh(e.props.x)?e.props.x:s.left,y:Hh(e.props.y)?e.props.y:s.top+s.height+s.brushBottom-(n.bottom||0),width:Hh(e.props.width)?e.props.width:s.width,startIndex:l,endIndex:c,updateId:"brush-".concat(u)})}),pA(o,"renderReferenceElement",function(e,t,n){if(!e)return null;var r=o.clipPathId,a=o.state,s=a.xAxisMap,l=a.yAxisMap,c=a.offset,u=e.type.defaultProps||{},d=e.props,f=d.xAxisId,m=void 0===f?u.xAxisId:f,p=d.yAxisId,h=void 0===p?u.yAxisId:p;return(0,i.cloneElement)(e,{key:e.key||"".concat(t,"-").concat(n),xAxis:s[m],yAxis:l[h],viewBox:{x:c.left,y:c.top,width:c.width,height:c.height},clipPathId:r})}),pA(o,"renderActivePoints",function(e){var t=e.item,r=e.activePoint,a=e.basePoint,o=e.childIndex,i=e.isRange,s=[],l=t.props.key,c=void 0!==t.item.type.defaultProps?mA(mA({},t.item.type.defaultProps),t.item.props):t.item.props,u=c.activeDot,d=mA(mA({index:o,dataKey:c.dataKey,cx:r.x,cy:r.y,r:4,fill:wS(t.item),strokeWidth:2,stroke:"#fff",payload:r.payload,value:r.value},Dg(u,!1)),hg(u));return s.push(n.renderActiveDot(u,d,"".concat(l,"-activePoint-").concat(o))),a?s.push(n.renderActiveDot(u,mA(mA({},d),{},{cx:a.x,cy:a.y}),"".concat(l,"-basePoint-").concat(o))):i&&s.push(null),s}),pA(o,"renderGraphicChild",function(e,t,n){var r=o.filterFormatItem(e,t,n);if(!r)return null;var a=o.getTooltipEventType(),s=o.state,l=s.isTooltipActive,c=s.tooltipAxis,u=s.activeTooltipIndex,d=s.activeLabel,f=Sg(o.props.children,Lw),m=r.props,p=m.points,h=m.isRange,g=m.baseLine,w=void 0!==r.item.type.defaultProps?mA(mA({},r.item.type.defaultProps),r.item.props):r.item.props,y=w.activeDot,b=w.hide,v=w.activeBar,x=w.activeShape,_=Boolean(!b&&l&&f&&(y||v||x)),E={};"axis"!==a&&f&&"click"===f.props.trigger?E={onClick:NS(o.handleItemMouseEnter,e.props.onClick)}:"axis"!==a&&(E={onMouseLeave:NS(o.handleItemMouseLeave,e.props.onMouseLeave),onMouseEnter:NS(o.handleItemMouseEnter,e.props.onMouseEnter)});var N=(0,i.cloneElement)(e,mA(mA({},r.props),E));if(_){if(!(u>=0)){var M,I=(null!==(M=o.getItemByXY(o.state.activeCoordinate))&&void 0!==M?M:{graphicalItem:N}).graphicalItem,S=I.item,k=void 0===S?e:S,j=I.childIndex,D=mA(mA(mA({},r.props),E),{},{activeIndex:j});return[(0,i.cloneElement)(k,D),null,null]}var C,A;if(c.dataKey&&!c.allowDuplicatedCategory){var T="function"==typeof c.dataKey?function(e){return"function"==typeof c.dataKey?c.dataKey(e.payload):null}:"payload.".concat(c.dataKey.toString());C=tg(p,T,d),A=h&&g&&tg(g,T,d)}else C=null==p?void 0:p[u],A=h&&g&&g[u];if(x||v){var O=void 0!==e.props.activeIndex?e.props.activeIndex:u;return[(0,i.cloneElement)(e,mA(mA(mA({},r.props),E),{},{activeIndex:O})),null,null]}if(!Wh()(C))return[N].concat(cA(o.renderActivePoints({item:r,activePoint:C,basePoint:A,childIndex:u,isRange:h})))}return h?[N,null,null]:[N,null]}),pA(o,"renderCustomized",function(e,t,n){return(0,i.cloneElement)(e,mA(mA({key:"recharts-customized-".concat(n)},o.props),o.state))}),pA(o,"renderMap",{CartesianGrid:{handler:bA,once:!0},ReferenceArea:{handler:o.renderReferenceElement},ReferenceLine:{handler:bA},ReferenceDot:{handler:o.renderReferenceElement},XAxis:{handler:bA},YAxis:{handler:bA},Brush:{handler:o.renderBrush,once:!0},Bar:{handler:o.renderGraphicChild},Line:{handler:o.renderGraphicChild},Area:{handler:o.renderGraphicChild},Radar:{handler:o.renderGraphicChild},RadialBar:{handler:o.renderGraphicChild},Scatter:{handler:o.renderGraphicChild},Pie:{handler:o.renderGraphicChild},Funnel:{handler:o.renderGraphicChild},Tooltip:{handler:o.renderCursor,once:!0},PolarGrid:{handler:o.renderPolarGrid,once:!0},PolarAngleAxis:{handler:o.renderPolarAxis},PolarRadiusAxis:{handler:o.renderPolarAxis},Customized:{handler:o.renderCustomized}}),o.clipPathId="".concat(null!==(r=e.id)&&void 0!==r?r:qh("recharts"),"-clip"),o.throttleTriggeredAfterMouseMove=Lh()(o.triggeredAfterMouseMove,null!==(a=e.throttleDelay)&&void 0!==a?a:1e3/60),o.state={},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&lA(e,t)}(n,e),r=n,o=[{key:"componentDidMount",value:function(){var e,t;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:null!==(e=this.props.margin.left)&&void 0!==e?e:0,top:null!==(t=this.props.margin.top)&&void 0!==t?t:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var e=this.props,t=e.children,n=e.data,r=e.height,a=e.layout,o=Sg(t,Lw);if(o){var i=o.props.defaultIndex;if(!("number"!=typeof i||i<0||i>this.state.tooltipTicks.length-1)){var s=this.state.tooltipTicks[i]&&this.state.tooltipTicks[i].value,l=_A(this.state,n,i,s),c=this.state.tooltipTicks[i].coordinate,u=(this.state.offset.top+r)/2,d="horizontal"===a?{x:c,y:u}:{y:c,x:u},f=this.state.formattedGraphicalItems.find(function(e){return"Scatter"===e.item.type.name});f&&(d=mA(mA({},d),f.props.points[i].tooltipPosition),l=f.props.points[i].tooltipPayload);var m={activeTooltipIndex:i,isTooltipActive:!0,activeLabel:s,activePayload:l,activeCoordinate:d};this.setState(m),this.renderCursor(o),this.accessibilityManager.setIndex(i)}}}},{key:"getSnapshotBeforeUpdate",value:function(e,t){return this.props.accessibilityLayer?(this.state.tooltipTicks!==t.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==e.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==e.margin&&this.accessibilityManager.setDetails({offset:{left:null!==(n=this.props.margin.left)&&void 0!==n?n:0,top:null!==(r=this.props.margin.top)&&void 0!==r?r:0}}),null):null;var n,r}},{key:"componentDidUpdate",value:function(e){Cg([Sg(e.children,Lw)],[Sg(this.props.children,Lw)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var e=Sg(this.props.children,Lw);if(e&&"boolean"==typeof e.props.shared){var t=e.props.shared?"axis":"item";return s.indexOf(t)>=0?t:a}return a}},{key:"getMouseInfo",value:function(e){if(!this.container)return null;var t,n=this.container,r=n.getBoundingClientRect(),a=(t=r).top+window.scrollY-document.documentElement.clientTop,o=t.left+window.scrollX-document.documentElement.clientLeft,i={chartX:Math.round(e.pageX-o),chartY:Math.round(e.pageY-a)},s=r.width/n.offsetWidth||1,l=this.inRange(i.chartX,i.chartY,s);if(!l)return null;var c=this.state,u=c.xAxisMap,d=c.yAxisMap,f=this.getTooltipEventType(),m=EA(this.state,this.props.data,this.props.layout,l);if("axis"!==f&&u&&d){var p=Kh(u).scale,h=Kh(d).scale,g=p&&p.invert?p.invert(i.chartX):null,w=h&&h.invert?h.invert(i.chartY):null;return mA(mA({},i),{},{xValue:g,yValue:w},m)}return m?mA(mA({},i),m):null}},{key:"inRange",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,r=this.props.layout,a=e/n,o=t/n;if("horizontal"===r||"vertical"===r){var i=this.state.offset;return a>=i.left&&a<=i.left+i.width&&o>=i.top&&o<=i.top+i.height?{x:a,y:o}:null}var s=this.state,l=s.angleAxisMap,c=s.radiusAxisMap;if(l&&c){var u=Kh(l);return lk({x:a,y:o},u)}return null}},{key:"parseEventsOfWrapper",value:function(){var e=this.props.children,t=this.getTooltipEventType(),n=Sg(e,Lw),r={};return n&&"axis"===t&&(r="click"===n.props.trigger?{onClick:this.handleClick}:{onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu}),mA(mA({},hg(this.props,this.handleOuterEvent)),r)}},{key:"addListener",value:function(){KD.on(eC,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){KD.removeListener(eC,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(e,t,n){for(var r=this.state.formattedGraphicalItems,a=0,o=r.length;a<o;a++){var i=r[a];if(i.item===e||i.props.key===e.key||t===_g(i.item.type)&&n===i.childIndex)return i}return null}},{key:"renderClipPath",value:function(){var e=this.clipPathId,t=this.state.offset,n=t.left,r=t.top,a=t.height,o=t.width;return l().createElement("defs",null,l().createElement("clipPath",{id:e},l().createElement("rect",{x:n,y:r,height:a,width:o})))}},{key:"getXScales",value:function(){var e=this.state.xAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=rA(t,2),r=n[0],a=n[1];return mA(mA({},e),{},pA({},r,a.scale))},{}):null}},{key:"getYScales",value:function(){var e=this.state.yAxisMap;return e?Object.entries(e).reduce(function(e,t){var n=rA(t,2),r=n[0],a=n[1];return mA(mA({},e),{},pA({},r,a.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(e){var t;return null===(t=this.state.xAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getYScaleByAxisId",value:function(e){var t;return null===(t=this.state.yAxisMap)||void 0===t||null===(t=t[e])||void 0===t?void 0:t.scale}},{key:"getItemByXY",value:function(e){var t=this.state,n=t.formattedGraphicalItems,r=t.activeItem;if(n&&n.length)for(var a=0,o=n.length;a<o;a++){var i=n[a],s=i.props,l=i.item,c=void 0!==l.type.defaultProps?mA(mA({},l.type.defaultProps),l.props):l.props,u=_g(l.type);if("Bar"===u){var d=(s.data||[]).find(function(t){return _v(e,t)});if(d)return{graphicalItem:i,payload:d}}else if("RadialBar"===u){var f=(s.data||[]).find(function(t){return lk(e,t)});if(f)return{graphicalItem:i,payload:f}}else if(mj(i,r)||pj(i,r)||hj(i,r)){var m=bj({graphicalItem:i,activeTooltipItem:r,itemData:c.data}),p=void 0===c.activeIndex?m:c.activeIndex;return{graphicalItem:mA(mA({},i),{},{childIndex:p}),payload:hj(i,r)?c.data[m]:i.props.data[m]}}}return null}},{key:"render",value:function(){var e=this;if(!kg(this))return null;var t,n,r=this.props,a=r.children,o=r.className,i=r.width,s=r.height,c=r.style,u=r.compact,d=r.title,f=r.desc,m=aA(r,eA),p=Dg(m,!1);if(u)return l().createElement(vD,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},l().createElement(Gg,nA({},p,{width:i,height:s,title:d,desc:f}),this.renderClipPath(),Tg(a,this.renderMap)));this.props.accessibilityLayer&&(p.tabIndex=null!==(t=this.props.tabIndex)&&void 0!==t?t:0,p.role=null!==(n=this.props.role)&&void 0!==n?n:"application",p.onKeyDown=function(t){e.accessibilityManager.keyboardEvent(t)},p.onFocus=function(){e.accessibilityManager.focus()});var h=this.parseEventsOfWrapper();return l().createElement(vD,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},l().createElement("div",nA({className:Te("recharts-wrapper",o),style:mA({position:"relative",cursor:"default",width:i,height:s},c)},h,{ref:function(t){e.container=t}}),l().createElement(Gg,nA({},p,{width:i,height:s,title:d,desc:f,style:wA}),this.renderClipPath(),Tg(a,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}],o&&oA(r.prototype,o),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,o}(i.Component);pA(p,"displayName",t),pA(p,"defaultProps",mA({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},f)),pA(p,"getDerivedStateFromProps",function(e,t){var n=e.dataKey,r=e.data,a=e.children,o=e.width,i=e.height,s=e.layout,l=e.stackOffset,c=e.margin,u=t.dataStartIndex,d=t.dataEndIndex;if(void 0===t.updateId){var f=MA(e);return mA(mA(mA({},f),{},{updateId:0},m(mA(mA({props:e},f),{},{updateId:0}),t)),{},{prevDataKey:n,prevData:r,prevWidth:o,prevHeight:i,prevLayout:s,prevStackOffset:l,prevMargin:c,prevChildren:a})}if(n!==t.prevDataKey||r!==t.prevData||o!==t.prevWidth||i!==t.prevHeight||s!==t.prevLayout||l!==t.prevStackOffset||!cg(c,t.prevMargin)){var p=MA(e),h={chartX:t.chartX,chartY:t.chartY,isTooltipActive:t.isTooltipActive},g=mA(mA({},EA(t,r,s)),{},{updateId:t.updateId+1}),w=mA(mA(mA({},p),h),g);return mA(mA(mA({},w),m(mA({props:e},w),t)),{},{prevDataKey:n,prevData:r,prevWidth:o,prevHeight:i,prevLayout:s,prevStackOffset:l,prevMargin:c,prevChildren:a})}if(!Cg(a,t.prevChildren)){var y,b,v,x,_=Sg(a,KS),E=_&&null!==(y=null===(b=_.props)||void 0===b?void 0:b.startIndex)&&void 0!==y?y:u,N=_&&null!==(v=null===(x=_.props)||void 0===x?void 0:x.endIndex)&&void 0!==v?v:d,M=E!==u||N!==d,I=Wh()(r)||M?t.updateId+1:t.updateId;return mA(mA({updateId:I},m(mA(mA({props:e},t),{},{updateId:I,dataStartIndex:E,dataEndIndex:N}),t)),{},{prevChildren:a,dataStartIndex:E,dataEndIndex:N})}return null}),pA(p,"renderActiveDot",function(e,t,n){var r;return r=(0,i.isValidElement)(e)?(0,i.cloneElement)(e,t):og()(e)?e(t):l().createElement(Gy,t),l().createElement(Xg,{className:"recharts-active-dot",key:n},r)});var h=(0,i.forwardRef)(function(e,t){return l().createElement(p,nA({},e,{ref:t}))});return h.displayName=p.displayName,h}({chartName:"LineChart",GraphicalChild:QA,axisComponents:[{axisType:"xAxis",AxisComp:xT},{axisType:"yAxis",AxisComp:CT}],formatAxisMap:function(t,n,r,a,o){var i=t.width,s=t.height,l=t.layout,c=t.children,u=Object.keys(n),d={left:r.left,leftMirror:r.left,right:i-r.right,rightMirror:i-r.right,top:r.top,topMirror:r.top,bottom:s-r.bottom,bottomMirror:s-r.bottom},f=!!Sg(c,Bj);return u.reduce(function(i,s){var c,u,m,p,h,g=n[s],w=g.orientation,y=g.domain,b=g.padding,v=void 0===b?{}:b,x=g.mirror,_=g.reversed,E="".concat(w).concat(x?"Mirror":"");if("number"===g.type&&("gap"===g.padding||"no-gap"===g.padding)){var N=y[1]-y[0],M=1/0,I=g.categoricalDomain.sort(ng);if(I.forEach(function(e,t){t>0&&(M=Math.min((e||0)-(I[t-1]||0),M))}),Number.isFinite(M)){var S=M/N,k="vertical"===g.layout?r.height:r.width;if("gap"===g.padding&&(c=S*k/2),"no-gap"===g.padding){var j=Jh(t.barCategoryGap,S*k),D=S*k/2;c=D-j-(D-j)/k*j}}}u="xAxis"===a?[r.left+(v.left||0)+(c||0),r.left+r.width-(v.right||0)-(c||0)]:"yAxis"===a?"horizontal"===l?[r.top+r.height-(v.bottom||0),r.top+(v.top||0)]:[r.top+(v.top||0)+(c||0),r.top+r.height-(v.bottom||0)-(c||0)]:g.range,_&&(u=[u[1],u[0]]);var C=function(t,n,r){var a=t.scale,o=t.type,i=t.layout,s=t.axisType;if("auto"===a)return"radial"===i&&"radiusAxis"===s?{scale:Av(),realScaleType:"band"}:"radial"===i&&"angleAxis"===s?{scale:K_(),realScaleType:"linear"}:"category"===o&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:Ov(),realScaleType:"point"}:"category"===o?{scale:Av(),realScaleType:"band"}:{scale:K_(),realScaleType:"linear"};if(Ph()(a)){var l="scale".concat(Pw()(a));return{scale:(e[l]||Ov)(),realScaleType:e[l]?l:"point"}}return og()(a)?{scale:a}:{scale:Ov(),realScaleType:"point"}}(g,o,f),A=C.scale,T=C.realScaleType;A.domain(y).range(u),function(e){var t=e.domain();if(t&&!(t.length<=2)){var n=t.length,r=e.range(),a=Math.min(r[0],r[1])-MS,o=Math.max(r[0],r[1])+MS,i=e(t[0]),s=e(t[n-1]);(i<a||i>o||s<a||s>o)&&e.domain([t[0],t[n-1]])}}(A);var O=function(e,t){var n=t.realScaleType,r=t.type,a=t.tickCount,o=t.originalDomain,i=t.allowDecimals,s=n||t.scale;if("auto"!==s&&"linear"!==s)return null;if(a&&"number"===r&&o&&("auto"===o[0]||"auto"===o[1])){var l=e.domain();if(!l.length)return null;var c=WI(l,a,i);return e.domain([gI()(c),pI()(c)]),{niceTicks:c}}if(a&&"number"===r){var u=e.domain();return{niceTicks:ZI(u,a,i)}}return null}(A,Vj(Vj({},g),{},{realScaleType:T}));"xAxis"===a?(h="top"===w&&!x||"bottom"===w&&x,m=r.left,p=d[E]-h*g.height):"yAxis"===a&&(h="left"===w&&!x||"right"===w&&x,m=d[E]-h*g.width,p=r.top);var L=Vj(Vj(Vj({},g),O),{},{realScaleType:T,x:m,y:p,scale:A,width:"xAxis"===a?r.width:g.width,height:"yAxis"===a?r.height:g.height});return L.bandSize=OS(L,O),g.hide||"xAxis"!==a?g.hide||(d[E]+=(h?-1:1)*L.width):d[E]+=(h?-1:1)*L.height,Vj(Vj({},i),{},Wj({},s,L))},{})}}),TT=["x1","y1","x2","y2","key"],OT=["offset"];function LT(e){return LT="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},LT(e)}function zT(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function PT(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zT(Object(n),!0).forEach(function(t){RT(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zT(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function RT(e,t,n){return t=function(e){var t=function(e){if("object"!=LT(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=LT(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==LT(t)?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function UT(){return UT=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},UT.apply(this,arguments)}function BT(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var FT=function(e){var t=e.fill;if(!t||"none"===t)return null;var n=e.fillOpacity,r=e.x,a=e.y,o=e.width,i=e.height,s=e.ry;return l().createElement("rect",{x:r,y:a,ry:s,width:o,height:i,stroke:"none",fill:t,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function YT(e,t){var n;if(l().isValidElement(e))n=l().cloneElement(e,t);else if(og()(e))n=e(t);else{var r=t.x1,a=t.y1,o=t.x2,i=t.y2,s=t.key,c=BT(t,TT),u=Dg(c,!1),d=(u.offset,BT(u,OT));n=l().createElement("line",UT({},d,{x1:r,y1:a,x2:o,y2:i,fill:"none",key:s}))}return n}function QT(e){var t=e.x,n=e.width,r=e.horizontal,a=void 0===r||r,o=e.horizontalPoints;if(!a||!o||!o.length)return null;var i=o.map(function(r,o){var i=PT(PT({},e),{},{x1:t,y1:r,x2:t+n,y2:r,key:"line-".concat(o),index:o});return YT(a,i)});return l().createElement("g",{className:"recharts-cartesian-grid-horizontal"},i)}function VT(e){var t=e.y,n=e.height,r=e.vertical,a=void 0===r||r,o=e.verticalPoints;if(!a||!o||!o.length)return null;var i=o.map(function(r,o){var i=PT(PT({},e),{},{x1:r,y1:t,x2:r,y2:t+n,key:"line-".concat(o),index:o});return YT(a,i)});return l().createElement("g",{className:"recharts-cartesian-grid-vertical"},i)}function WT(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,a=e.y,o=e.width,i=e.height,s=e.horizontalPoints,c=e.horizontal;if(void 0!==c&&!c||!t||!t.length)return null;var u=s.map(function(e){return Math.round(e+a-a)}).sort(function(e,t){return e-t});a!==u[0]&&u.unshift(0);var d=u.map(function(e,s){var c=u[s+1]?u[s+1]-e:a+i-e;if(c<=0)return null;var d=s%t.length;return l().createElement("rect",{key:"react-".concat(s),y:e,x:r,height:c,width:o,stroke:"none",fill:t[d],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return l().createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},d)}function ZT(e){var t=e.vertical,n=void 0===t||t,r=e.verticalFill,a=e.fillOpacity,o=e.x,i=e.y,s=e.width,c=e.height,u=e.verticalPoints;if(!n||!r||!r.length)return null;var d=u.map(function(e){return Math.round(e+o-o)}).sort(function(e,t){return e-t});o!==d[0]&&d.unshift(0);var f=d.map(function(e,t){var n=d[t+1]?d[t+1]-e:o+s-e;if(n<=0)return null;var u=t%r.length;return l().createElement("rect",{key:"react-".concat(t),x:e,y:i,width:n,height:c,stroke:"none",fill:r[u],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return l().createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},f)}var GT=function(e,t){var n=e.xAxis,r=e.width,a=e.height,o=e.offset;return xS(XA(PT(PT(PT({},dT.defaultProps),n),{},{ticks:_S(n,!0),viewBox:{x:0,y:0,width:r,height:a}})),o.left,o.left+o.width,t)},HT=function(e,t){var n=e.yAxis,r=e.width,a=e.height,o=e.offset;return xS(XA(PT(PT(PT({},dT.defaultProps),n),{},{ticks:_S(n,!0),viewBox:{x:0,y:0,width:r,height:a}})),o.top,o.top+o.height,t)},$T={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function XT(e){var t,n,r,a,o,s,c,u,d=ED(),f=ND(),m=(0,i.useContext)(gD),p=PT(PT({},e),{},{stroke:null!==(t=e.stroke)&&void 0!==t?t:$T.stroke,fill:null!==(n=e.fill)&&void 0!==n?n:$T.fill,horizontal:null!==(r=e.horizontal)&&void 0!==r?r:$T.horizontal,horizontalFill:null!==(a=e.horizontalFill)&&void 0!==a?a:$T.horizontalFill,vertical:null!==(o=e.vertical)&&void 0!==o?o:$T.vertical,verticalFill:null!==(s=e.verticalFill)&&void 0!==s?s:$T.verticalFill,x:Hh(e.x)?e.x:m.left,y:Hh(e.y)?e.y:m.top,width:Hh(e.width)?e.width:m.width,height:Hh(e.height)?e.height:m.height}),h=p.x,g=p.y,w=p.width,y=p.height,b=p.syncWithTicks,v=p.horizontalValues,x=p.verticalValues,_=(c=(0,i.useContext)(mD),Kh(c)),E=(u=(0,i.useContext)(pD),uD()(u,function(e){return _k()(e.domain,Number.isFinite)})||Kh(u));if(!Hh(w)||w<=0||!Hh(y)||y<=0||!Hh(h)||h!==+h||!Hh(g)||g!==+g)return null;var N=p.verticalCoordinatesGenerator||GT,M=p.horizontalCoordinatesGenerator||HT,I=p.horizontalPoints,S=p.verticalPoints;if((!I||!I.length)&&og()(M)){var k=v&&v.length,j=M({yAxis:E?PT(PT({},E),{},{ticks:k?v:E.ticks}):void 0,width:d,height:f,offset:m},!!k||b);rg(Array.isArray(j),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(LT(j),"]")),Array.isArray(j)&&(I=j)}if((!S||!S.length)&&og()(N)){var D=x&&x.length,C=N({xAxis:_?PT(PT({},_),{},{ticks:D?x:_.ticks}):void 0,width:d,height:f,offset:m},!!D||b);rg(Array.isArray(C),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(LT(C),"]")),Array.isArray(C)&&(S=C)}return l().createElement("g",{className:"recharts-cartesian-grid"},l().createElement(FT,{fill:p.fill,fillOpacity:p.fillOpacity,x:p.x,y:p.y,width:p.width,height:p.height,ry:p.ry}),l().createElement(QT,UT({},p,{offset:m,horizontalPoints:I,xAxis:_,yAxis:E})),l().createElement(VT,UT({},p,{offset:m,verticalPoints:S,xAxis:_,yAxis:E})),l().createElement(WT,UT({},p,{horizontalPoints:I})),l().createElement(ZT,UT({},p,{verticalPoints:S})))}XT.displayName="CartesianGrid";const qT=i.forwardRef(({active:e,payload:t,className:n,indicator:r="dot",hideLabel:a=!1,hideIndicator:o=!1,label:i,labelFormatter:s,labelClassName:l,formatter:c,color:u,nameKey:d="name",labelKey:f},m)=>{if(!e||!t?.length)return null;const p=1===t.length&&"dot"!==r;return(0,P.jsxs)("div",{ref:m,className:Oe("grid min-w-[8rem] items-start gap-1.5 rounded-lg border bg-tooltip-background-light px-3 py-2 text-xs shadow-xl",n),children:[p?null:(()=>{if(a||!t?.length)return null;const[e]=t,n=s?s(i||""):e[f]||i;return n?(0,P.jsx)("div",{className:Oe("font-medium",l),children:n}):null})(),(0,P.jsx)("div",{className:"grid gap-1.5",children:t.map((e,t)=>{const n=u||e.color||"#000";return(0,P.jsxs)("div",{className:Oe("flex w-full items-stretch gap-2","dot"===r&&"items-center"),children:[!o&&(0,P.jsx)("div",{className:Oe({"size-2.5 ":"dot"===r,"w-1 h-full":"line"===r,"w-0 border-[0.5px] border-dashed":"dashed"===r}),style:{backgroundColor:"dot"===r||"line"===r?n:"",borderColor:"dashed"===r?n:""}}),(0,P.jsxs)("div",{className:"flex-1 flex justify-between items-center gap-2",children:[(0,P.jsx)("span",{children:e[d]||e.dataKey}),(0,P.jsx)("span",{className:"font-mono font-medium",children:c?c(e.value??""):e.value??""})]})]},e.dataKey||t)})})]})});qT.displayName="ChartTooltipContent";const JT="#6B7280",KT=[{stroke:"#2563EB"},{stroke:"#38BDF8"}],eO=({data:e,dataKeys:t=[],colors:n=[],showXAxis:r=!1,showYAxis:a=!1,showTooltip:o=!0,tooltipIndicator:i="dot",tooltipLabelKey:s,showCartesianGrid:l=!0,xAxisTickFormatter:c,yAxisTickFormatter:u,tickFormatter:d,xAxisDataKey:f,yAxisDataKey:m,xAxisFontSize:p="sm",xAxisFontColor:h=JT,yAxisFontColor:g=JT,chartWidth:w=350,chartHeight:y=200,withDots:b=!1,lineChartWrapperProps:v,strokeDasharray:x="3 3",gridColor:_="#E5E7EB",biaxial:E=!1,noDataComponent:N})=>{const M=n.length>0?n:KT,I={sm:"12px",md:"14px",lg:"16px"},S=I[p]||I.sm,k=(e=0)=>Array.isArray(g)?g[e]||g[0]||JT:g;return e&&0!==e.length?(0,P.jsx)(Bg,{width:w,height:y,children:(0,P.jsxs)(AT,{...v,data:e,children:[l&&(0,P.jsx)(XT,{strokeDasharray:x,horizontal:!1,stroke:_}),(0,P.jsx)(xT,{dataKey:f,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:c||d,tick:{fontSize:S,fill:h},hide:!r,interval:"equidistantPreserveStart"}),(0,P.jsx)(CT,{yAxisId:"left",dataKey:E?t[0]:m,tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:u,tick:{fontSize:S,fill:k(0)},hide:!a,orientation:"left"}),E&&t.length>1&&(0,P.jsx)(CT,{yAxisId:"right",dataKey:t[1],tickLine:!1,axisLine:!1,tickMargin:8,tickFormatter:u,tick:{fontSize:S,fill:k(1)},orientation:"right",hide:!a}),o&&(0,P.jsx)(Lw,{content:(0,P.jsx)(qT,{indicator:i,labelKey:s})}),t.map((e,t)=>{let n="left";return E&&t>0&&(n="right"),(0,P.jsx)(QA,{type:"monotone",dataKey:e,stroke:M[t].stroke,fill:M[t].stroke,strokeWidth:2,dot:b,yAxisId:n},e)})]})}):N||(0,P.jsx)(Qf,{size:"sm",variant:"help",children:"No data available"})},tO=({title:e="",description:t=(0,z.__)("Upgrade your plan anytime and get more detailed analytics data.","cartflows"),containerClass:n="",innerContainerClass:r=""})=>(0,o.createElement)("div",{className:`wcf-upgrade-to-pro-notice-container ${n}`},(0,o.createElement)("div",{className:`wcf-upgrade-to-pro-notice-inner-container ${r} `},(0,o.createElement)("div",{className:"flex justify-center mb-5"},(0,o.createElement)(Ym,null)),(0,o.createElement)($p,{size:"md",tag:"h3",title:e,className:"mb-1 justify-center"}),(0,o.createElement)(th,{size:14,color:"secondary",className:"mb-5 text-center"},t),(0,o.createElement)("div",{className:"flex justify-center"},(0,o.createElement)(Va,{tag:"a",href:getUpgradeToProUrl(),variant:"primary",size:"md",target:"_blank",rel:"noreferrer",icon:(0,o.createElement)(im,null),iconPosition:"right",className:"no-underline"},(0,z.__)("Upgrade to PRO","cartflows"))))),nO="#F06434",rO=e=>new Intl.NumberFormat(document.documentElement.lang||void 0,{notation:"compact",maximumFractionDigits:1}).format(Number(e)||0),aO=e=>cartflows_admin.woo_currency+rO(e),oO=function(e){const[{analyticsData:t}]=d(),n=t&&t.flow_stats.visits_by_date?t.flow_stats.visits_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,visits:r?Number(r?.total_visits):0}});return(0,o.createElement)("div",{className:"relative"},!wcfCartflowsTypePro()&&(0,o.createElement)(tO,{title:(0,z.__)("See Exactly How Much Traffic Your Funnels Get","cartflows"),description:(0,z.__)("Unlock Pro and track visits across every funnel in real time.","cartflows"),containerClass:"bg-border-transparent-subtle bg-opacity-25 absolute z-10 w-full h-full flex border border-border-subtle",innerContainerClass:"border border-border-subtle shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-background-primary"}),(0,o.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,o.createElement)(eO,{data:r,dataKeys:["visits"],xAxisDataKey:"date",yAxisDataKey:"visits",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:rO,chartWidth:"100%",chartHeight:305})))},iO=function(e){const[{analyticsData:t}]=d(),n=t&&t.flow_stats.revenue_by_date?t.flow_stats.revenue_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,revenue:r?Number(r.Revenue):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["revenue"],xAxisDataKey:"date",yAxisDataKey:"revenue",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:aO,chartWidth:"100%",chartHeight:305}))},sO=function(e){const[{analyticsData:t}]=d(),n=t&&t.flow_stats.orders_by_date?t.flow_stats.orders_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,orders:r?Number(r.OrderCount):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["orders"],xAxisDataKey:"date",yAxisDataKey:"orders",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:rO,chartWidth:"100%",chartHeight:305}))},lO=function(e){const[{analyticsData:t}]=d(),n=t&&t.flow_stats.offer_revenue_by_date?t.flow_stats.offer_revenue_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,offer_revenue:r?Number(r.offer_revenue):0}});return(0,o.createElement)("div",{className:"relative"},!wcfCartflowsTypePro()&&(0,o.createElement)(tO,{title:(0,z.__)("Discover How Much Your Offers Actually Earn","cartflows"),description:(0,z.__)("Unlock Pro and see exactly how upsells, downsells, and bumps drive revenue.","cartflows"),containerClass:"bg-border-transparent-subtle bg-opacity-25 absolute z-10 w-full h-full flex border border-border-subtle",innerContainerClass:"border border-border-subtle shadow-lg p-5 rounded-lg w-1/3 m-auto text-center bg-background-primary"}),(0,o.createElement)("div",{className:wcfCartflowsTypePro()?"":"blur-[2px]"},(0,o.createElement)(eO,{data:r,dataKeys:["offer_revenue"],xAxisDataKey:"date",yAxisDataKey:"offer_revenue",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:aO,chartWidth:"100%",chartHeight:305})))},cO=({variant:e="rectangular",className:t,...n})=>{const r={circular:"rounded-full bg-gray-200 ",rectangular:"rounded-md bg-gray-200"}[e],a={circular:"size-10",rectangular:"w-96 h-3"}[e];return(0,P.jsx)("div",{className:Oe(r,"animate-pulse",a,t),...n})},uO=function(){return(0,o.createElement)("div",{className:"flex flex-col gap-5"},(0,o.createElement)("div",{className:"flex justify-between gap-6 border-0 border-b border-solid border-border-subtle"},Array.from({length:4}).map((e,t)=>(0,o.createElement)("div",{key:t,className:"flex flex-col gap-2.5 items-start flex-1 px-3 pb-4 pt-2.5"},(0,o.createElement)(cO,{className:"w-24 h-3 rounded"}),(0,o.createElement)(cO,{className:"w-28 h-7 rounded"})))),(0,o.createElement)("div",{className:"p-1"},(0,o.createElement)(cO,{variant:"rectangular",className:"w-full h-64 rounded-md"})))},dO=Ua("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),fO=(0,i.forwardRef)(({id:e,label:t,defaultChecked:n=!1,checked:r,onChange:a,indeterminate:o,disabled:s,size:l="md",className:c,...u},d)=>{const f=(0,i.useMemo)(()=>e||`checkbox-${cp()}`,[e]),m=(0,i.useMemo)(()=>typeof r<"u",[r]),[p,h]=(0,i.useState)(n||!1),g="primary",w={sm:{checkbox:"size-4 rounded gap-1",icon:"size-3",text:"text-sm",description:"text-sm",gap:"gap-0.5"},md:{checkbox:"size-5 rounded gap-1",icon:"size-4",text:"text-base",description:"text-sm",gap:"gap-1"}},y={primary:{checkbox:"border-border-strong hover:border-border-interactive checked:border-border-interactive bg-white checked:bg-toggle-on checked:hover:bg-toggle-on-hover checked:hover:border-toggle-on-hover focus:ring-2 focus:ring-offset-2 focus:ring-focus",icon:"text-white"}},b=(0,i.useCallback)(()=>m?r:p,[m,r,p]),v=(0,i.useCallback)(()=>(0,i.isValidElement)(t)?t:t?.heading||t?.description?(0,P.jsxs)("div",{className:w[l].gap,children:[t?.heading&&(0,P.jsx)(Qf,{className:Oe("text-text-primary font-medium leading-4 m-0",w[l].text,w[l].gap,s&&"text-text-disabled"),htmlFor:f,children:t?.heading}),t?.description&&(0,P.jsx)(Qf,{tag:"p",className:Oe("font-normal leading-5 m-0",w[l].description,s&&"text-text-disabled"),variant:"help",children:t?.description})]}):null,[t,l,s]);return(0,P.jsxs)("div",{className:Oe("inline-flex items-center justify-center gap-2",!!t&&"items-start",s&&"cursor-not-allowed"),children:[(0,P.jsxs)("label",{className:Oe("relative flex items-center justify-center rounded-full p-0.5",!s&&"cursor-pointer"),htmlFor:f,children:[(0,P.jsx)("input",{ref:d,id:f,type:"checkbox",className:Oe("peer relative cursor-pointer appearance-none transition-all m-0 before:content-[''] checked:before:content-[''] checked:before:hidden before:hidden !border-1.5 border-solid",y[g].checkbox,w[l].checkbox,s&&"cursor-not-allowed disabled:bg-white checked:disabled:bg-white disabled:border-border-disabled checked:disabled:border-border-disabled",c),checked:b(),onChange:e=>{if(s)return;const t=e.target.checked;m||h(t),"function"==typeof a&&a(t)},disabled:s,...u}),(0,P.jsx)("span",{className:Oe("pointer-events-none inline-flex items-center absolute top-2/4 not-rtl:left-2/4 rtl:right-2/4 -translate-y-2/4 -translate-x-2/4 text-white opacity-0 transition-opacity peer-checked:opacity-100",y[g].icon,s&&"cursor-not-allowed peer-disabled:text-border-disabled"),children:o?(0,P.jsx)(dO,{className:Oe(w[l]?.icon)}):(0,P.jsx)(Fa,{className:Oe(w[l]?.icon)})})]}),!!t&&v()]})});fO.displayName="Checkbox";const mO=function(e){const{name:t,id:n,label:r,value:a,desc:s,backComp:l=!1,tooltip:c,onClick:u,notice:d,child_class:f="",isDisabled:m=!1,isPro:p=!1}=e,[h,g]=(0,i.useState)(a);(0,i.useEffect)(()=>{g(a)},[a]);const w=l?"enable":"yes",y=l?"disable":"no";return(0,o.createElement)("div",{className:"wcf-field wcf-checkbox-field text-left"},(0,o.createElement)("div",{className:"wcf-field__data flex items-center gap-2.5"},(0,o.createElement)("div",{className:`wcf-field__data--content ${f}`},(0,o.createElement)("input",{type:"hidden",name:t,value:h}),(0,o.createElement)(fO,{id:n||t,checked:w===h,onChange:function(e){let r;if(e){if(d&&!function(){switch(d.type){case"alert":return alert(d.message),!0;case"confirm":return!!confirm(d.message);case"prompt":return prompt(d.message)===d.check.toUpperCase();default:return!1}}())return;g(w),r=w}else g(y),r=y;const a={target:{checked:e,id:n||t}},o=new CustomEvent("wcf:checkbox:change",{bubbles:!0,detail:{e:a,name:t,value:r}});document.dispatchEvent(o),u&&u(a)},disabled:m,className:e.class||e.className})),r&&(0,o.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-text-primary text-left w-full md:w-80 lg:w-80"},(0,o.createElement)("label",{htmlFor:n||t,className:"mr-3"},r,c&&(0,o.createElement)(iQ,{text:c}),!wcfCartflowsPro()&&p&&(0,o.createElement)("span",{className:"ml-2 inline-flex align-middle"},(0,o.createElement)(Ym,null))))),s&&(0,o.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},fh(s)))},pO={primary:{checkbox:"border-border-strong hover:border-border-interactive checked:border-border-interactive bg-white checked:bg-toggle-on checked:hover:bg-toggle-on-hover checked:hover:border-toggle-on-hover focus:ring-2 focus:ring-offset-2 focus:ring-focus",icon:"text-white"}},hO={sm:"text-sm leading-5",md:"text-base leading-6"},gO={sm:{checkbox:"size-4",icon:"size-1.5",info:"size-4"},md:{checkbox:"size-5",icon:"size-2",info:"size-5"}},wO={xs:"py-1 px-1 text-sm gap-0.5 [&>svg]:size-4",sm:"py-1 px-1.5 text-base gap-1 [&>svg]:size-4",md:"py-2 px-2.5 text-base gap-1 [&>svg]:size-5",lg:"py-2.5 px-3 text-base gap-1 [&>svg]:size-6"},yO=({label:e,switchId:t,disabled:n=!1,children:r,size:a})=>{const o={xs:"text-xs leading-4 font-medium",sm:"text-sm leading-5 font-medium",md:"text-base leading-6 font-medium"},s={xs:"text-xs leading-4 font-normal",sm:"text-sm leading-5 font-normal",md:"text-sm leading-5 font-normal"},l={xs:"space-y-0.5",sm:"space-y-0.5",md:"space-y-1"};if((0,i.isValidElement)(e))return(0,P.jsxs)("div",{className:Oe("inline-flex items-center gap-3","items-start"),children:[r,e]});const c=!e?.heading&&!e?.description,u=e?.heading&&e?.description?"items-start":"items-center";return c?r:(0,P.jsxs)("div",{className:Oe("inline-flex",u,"gap-3"),children:[r,(()=>{const{heading:r="",description:i=""}=e||{};return(0,P.jsxs)("div",{className:Oe("space-y-0.5",l[a]),children:[r&&(0,P.jsx)(Qf,{htmlFor:t,className:Oe("m-0",o[a]),...n&&{variant:"disabled"},children:r}),i&&(0,P.jsx)(Qf,{tag:"p",variant:"help",className:Oe("text-sm font-normal leading-5 m-0",s[a]),...n&&{variant:"disabled"},children:i})]})})()]})},bO=(0,i.forwardRef)(({id:e,onChange:t,value:n,defaultValue:r=!1,size:a="sm",disabled:o=!1,label:s={heading:"",description:""},name:l,className:c,...u},d)=>{const f="lg"===a?"md":a,m=(0,i.useMemo)(()=>typeof n<"u",[n]),p=(0,i.useMemo)(()=>e||`switch-${cp()}`,[]),[h,g]=(0,i.useState)(r),w="primary",y=(0,i.useCallback)(()=>m?n:h,[m,n,h]),b={primary:{input:"bg-toggle-off checked:bg-toggle-on focus:ring focus:ring-toggle-on focus:ring-offset-2 border border-solid border-toggle-off-border checked:border-toggle-on-border shadow-toggleContainer focus:outline-none checked:focus:border-toggle-on-border focus:border-toggle-off-border",toggleDial:"bg-toggle-dial-background shadow-toggleDial"}},v={md:{container:"w-11 h-6",toggleDial:"size-4 peer-checked:translate-x-5"},sm:{container:"w-10 h-5",toggleDial:"size-3 peer-checked:translate-x-5"},xs:{container:"w-8 h-4",toggleDial:"size-2.5 peer-checked:translate-x-3.75"}};return(0,P.jsx)(yO,{label:s,switchId:p,disabled:o,size:f,children:(0,P.jsxs)("div",{className:Oe("relative group/switch inline-block cursor-pointer rounded-full shrink-0",v[f].container,c),children:[(0,P.jsx)("input",{ref:d,id:p,type:"checkbox",className:Oe("peer appearance-none absolute rounded-full cursor-pointer transition-colors duration-300 h-full w-full before:content-[''] checked:before:content-[''] m-0 checked:[background-image:none]",b[w].input,o&&"bg-toggle-off-disabled disabled:border-transparent disabled:cursor-not-allowed checked:disabled:bg-toggle-on-disabled disabled:shadow-toggle-disabled",!o&&{primary:{input:"group-hover/switch:bg-toggle-off-hover checked:group-hover/switch:bg-toggle-on-hover checked:group-hover/switch:border-toggle-on-border"}}[w].input),checked:y(),onChange:e=>{if(o)return;const n=e.target.checked;m||g(n),"function"==typeof t&&t(n)},disabled:o,name:l,...u}),(0,P.jsx)("label",{htmlFor:p,className:Oe("peer/toggle-dial bg-white border rounded-full absolute cursor-pointer shadow-md before:content[''] before:transition-opacity before:opacity-0 hover:before:opacity-10 before:hidden border-none transition-all duration-300 top-2/4 not-rtl:left-1 rtl:right-1 -translate-y-2/4 before:w-10 before:h-10 before:rounded-full before:absolute before:top-2/4 not-rtl:before:left-2/4 rtl:before:right-2/4 before:-translate-y-2/4 before:-translate-x-2/4",v[f].toggleDial,b[w].toggleDial,o&&"peer-disabled:cursor-not-allowed",!o&&{md:"group-hover/switch:size-5 group-focus-within/switch:size-5 not-rtl:group-focus-within/switch:left-0.5 rtl:group-focus-within/switch:right-0.5 not-rtl:group-hover/switch:left-0.5 rtl:group-hover/switch:right-0.5",sm:"group-hover/switch:size-4 group-focus-within/switch:size-4 not-rtl:group-focus-within/switch:left-0.5 rtl:group-focus-within/switch:right-0.5 not-rtl:group-hover/switch:left-0.5 rtl:group-hover/switch:right-0.5",xs:"group-hover/switch:size-3.25 group-focus-within/switch:size-3.25 not-rtl:group-focus-within/switch:left-0.5 rtl:group-focus-within/switch:right-0.5 not-rtl:group-hover/switch:left-0.5 rtl:group-hover/switch:right-0.5"}[f])})]})})});bO.displayName="Switch";const vO=(0,i.createContext)({}),xO=()=>(0,i.useContext)(vO),_O=({children:e,name:t,style:n="simple",size:r="md",value:a,defaultValue:o,by:s="id",as:l="div",onChange:c,className:u,disableGroup:d=!1,vertical:f=!1,columns:m=4,multiSelection:p=!1,gapClassName:h="gap-2"})=>{const g=(0,i.useMemo)(()=>typeof a<"u",[a]),w=(0,i.useMemo)(()=>t||`radio-button-group-${cp()}`,[t]);let y;y=g?a:p?o??[]:o;const[b,v]=(0,i.useState)(y),x=(0,i.useCallback)(e=>{if(p)v(t=>{let n;return n=Array.isArray(t)&&"string"==typeof e&&t.includes(e)?t.filter(t=>t!==e):[...Array.isArray(t)?t:[],..."string"==typeof e?[e]:[]],"function"==typeof c&&c(n),n});else{if(g||v(e),"function"!=typeof c)return;c(e)}},[c]);u=Oe("grid grid-cols-4",Pe[m],h,"tile"===n&&"gap-0",f&&"grid-cols-1",u);const _=Oe("tile"===n?"border border-border-subtle border-solid rounded-md shadow-sm":"gap-6",u),E=()=>(0,P.jsx)(vO.Provider,{value:{name:w,value:g?a:b,by:s,onChange:x,isControlled:g,disableAll:d,style:n,columns:m,multiSelection:p,size:r},children:i.Children.map(e,e=>(0,i.isValidElement)(e)?e:null)});return(0,P.jsx)(P.Fragment,{children:"tile"===n?(0,P.jsx)("div",{className:_,children:E()}):(0,P.jsx)(l,{...l===i.Fragment?{}:{className:u},children:E()})})};_O.displayName="RadioButton.Group";const EO=(0,i.forwardRef)(({id:e,label:t,value:n,children:r,disabled:a,icon:o=null,inlineIcon:s=!1,hideSelection:l=!1,reversePosition:c=!1,borderOn:u=!1,borderOnActive:d=!0,badgeItem:f=null,useSwitch:m=!1,info:p,minWidth:h=!0,...g},w)=>{const{buttonWrapperClasses:y,...b}=g,v=xO(),{name:x,value:_,by:E,onChange:N,disableAll:M,checked:I,multiSelection:S,size:k="md"}=v,j="primary",D=(0,i.useMemo)(()=>e||`radio-button-${cp()}`,[e]),C=(0,i.useMemo)(()=>M||a,[M,a]),A=(0,i.useMemo)(()=>S?Array.isArray(_)&&_.includes(n):typeof I<"u"?I:typeof _==typeof n&&("string"==typeof _?_===n:Array.isArray(_)?_.includes(n):_[E]===n[E]),[_,n,I]),T=(0,i.useCallback)(()=>(0,i.isValidElement)(t)?t:t?.heading?(0,P.jsxs)("div",{className:Oe(!s&&{"space-y-3":"sm"===k,"space-y-4":"md"===k},c&&(m?"ml-10":"ml-4"),s&&"flex gap-2",s&&!t.description&&"items-center"),children:[o&&(0,P.jsx)(P.Fragment,{children:o}),(0,P.jsxs)("div",{className:Oe(!o||!m||o&&f?{"space-y-0.5":"sm"===k,"space-y-1":"md"===k}:"space-y-0.5"),children:[(0,P.jsx)("p",{className:Oe("text-text-primary font-medium m-0",hO[k],a&&"text-text-disabled cursor-not-allowed"),children:t.heading}),t.description&&(0,P.jsx)("p",{className:"text-text-tertiary text-sm font-normal leading-5 m-0",children:t.description})]})]}):null,[t]);if("tile"===v.style)return(0,P.jsx)(NO,{id:e,label:t,value:n,disabled:a,size:k,children:r});const O=()=>{C||(S?m&&N(n,!A):N(n))};return(0,P.jsxs)("label",{className:Oe("inline-flex items-center relative cursor-pointer transition-all duration-300",!!t&&"items-start justify-between",h&&"min-w-[180px]",u&&"outline outline-field-border outline-1 rounded-md shadow-sm hover:outline-border-interactive",d&&u&&A&&"outline-border-interactive",{"pl-3.5 pr-2.5 py-2.5":"sm"===k&&!(o&&m),"p-3":"sm"===k&&(o&&m||o&&f),"pl-4 pr-3 py-3":"md"===k&&!(o&&m),"p-4":"md"===k&&(o&&m||o&&f)},"pr-12",C&&"cursor-not-allowed opacity-40",y),htmlFor:D,onClick:O,children:[!!t&&(0,P.jsx)("label",{className:Oe("cursor-pointer",C&&"cursor-not-allowed"),htmlFor:D,children:T()}),!!p&&(0,P.jsx)("div",{className:"absolute mr-0.5 bottom-1.5 right-3",children:(0,P.jsx)(Ja,{title:p?.heading,content:p?.description,children:(0,P.jsx)(Ba,{className:Oe("text-text-primary",gO[k]?.info)})})}),(0,P.jsxs)("label",{className:Oe("absolute mr-0.5 right-3 flex items-center cursor-pointer rounded-full gap-2",c&&"left-0",C&&"cursor-not-allowed",s&&"mr-3"),onClick:O,children:[!!f&&f,!l&&(m?(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(bO,{defaultValue:!1,size:k,onChange:()=>{S?N(n,!A):N(n)},checked:A,...b,"aria-label":t?.heading??"Switch"})}):(0,P.jsxs)("span",{className:"relative p-0.5",children:[(0,P.jsx)("input",{ref:w,id:D,type:S?"checkbox":"radio",className:Oe("peer flex relative cursor-pointer appearance-none transition-all m-0 before:content-[''] checked:before:content-[''] checked:before:hidden before:hidden !border-1.5 border-solid",!S&&"rounded-full",pO[j].checkbox,gO[k].checkbox,C&&"disabled:bg-white checked:disabled:bg-white disabled:border-border-disabled checked:disabled:border-border-disabled cursor-not-allowed"),name:x,value:n,onChange:e=>N(e.target.value),checked:A,disabled:C,...b}),(0,P.jsx)("span",{className:Oe("inline-flex items-center absolute top-2/4 not-rtl:left-2/4 rtl:right-2/4 -translate-y-2/4 -translate-x-2/4 text-white opacity-0 transition-opacity peer-checked:opacity-100",pO[j].icon,C&&"peer-disabled:text-border-disabled cursor-not-allowed"),children:S?(0,P.jsx)(Fa,{className:"sm"===k?"size-3":"size-4"}):(0,P.jsx)("div",{className:Oe("rounded-full bg-current",gO[k]?.icon)})})]}))]})]})});EO.displayName="RadioButton.Button";const NO=({id:e,children:t,value:n,disabled:r,size:a="md",...o})=>{const s=xO(),{name:l,value:c,by:u,onChange:d,disableAll:f,checked:m}=s||{},p=(0,i.useMemo)(()=>e||`radio-button-${cp()}`,[e]),h=(0,i.useMemo)(()=>f||r,[f,r]),g=(0,i.useMemo)(()=>typeof m<"u"?m:typeof c==typeof n&&("string"==typeof c?c===n:Array.isArray(c)?c.includes(n):!(!c||!u)&&c[u]===n[u]),[c,n,m,u]),w=Oe("bg-background-primary text-primary cursor-pointer flex items-center justify-center","hover:bg-button-tertiary-hover","focus:outline-none",h?"text-text-disabled cursor-not-allowed":"",wO[a],"border-0 border-r border-border-subtle border-solid");return(0,P.jsx)(P.Fragment,{children:(0,P.jsxs)("button",{type:"button",id:p,"aria-label":"Radio Button",className:Oe(w,"first:rounded-tl first:rounded-bl first:border-0 first:border-r first:border-border-subtle last:rounded-tr last:rounded-br last:border-0",g&&"bg-button-disabled"),onClick:()=>{d&&d(n)},disabled:h,...o,children:[(0,P.jsx)("input",{type:"hidden",value:n,name:l,checked:g,onChange:e=>d?.(e.target.value)}),t]})})},MO=Object.assign(EO,{Group:_O,Button:EO}),IO=function(e){const{name:t,label:n,value:r,options:a,desc:s,child_class:l="",child_className:c="",onClick:u=""}=e,[d,f]=(0,i.useState)(r);return(0,i.useEffect)(()=>{f(r)},[r]),(0,o.createElement)("div",{className:"wcf-field wcf-radio-field"},(0,o.createElement)("div",{className:"wcf-field__data block"},n&&(0,o.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-left w-full md:w-80 lg:w-80 mb-2"},(0,o.createElement)("label",{className:"text-text-primary text-base font-medium"},n)),(0,o.createElement)("div",{className:"wcf-field__data--content"},a&&(0,o.createElement)(MO.Group,{name:t,value:d,onChange:function(t){f(t);const n=new CustomEvent("wcf:radio:change",{bubbles:!0,detail:{e:{target:{value:t}},name:e.name,value:t}});document.dispatchEvent(n),u&&u(t)},vertical:!0,gapClassName:"gap-0"},a.map(e=>(0,o.createElement)(MO.Button,(0,_.A)({key:e.value,value:e.value,minWidth:!1,buttonWrapperClasses:`wcf-radio-field__option py-1.5 [&_label]:text-left ${e.desc?"[&_p:last-child]:!text-text-secondary":""} ${c||l}`},(e.label||e.desc)&&{label:{heading:e.label||"",...e.desc&&{description:e.desc}}})))))),s&&(0,o.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},fh(s)))},SO=Ua("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]),kO=Ua("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]),jO={sm:{icon:"[&>svg]:size-4",searchIcon:"[&>svg]:size-4",selectButton:"px-2.5 py-2 rounded text-xs font-medium leading-4 min-h-[2rem]",multiSelect:"pl-2 pr-2 py-1.5",displaySelected:"text-xs font-normal",dropdown:"rounded-md",dropdownItemsWrapper:"p-1.5",searchbarWrapper:"p-3 flex items-center gap-0.5",searchbar:"font-medium text-sm",searchbarIcon:"size-4",label:"text-sm font-medium"},md:{icon:"[&>svg]:size-5",searchIcon:"[&>svg]:size-5",selectButton:"px-3.5 py-2.5 rounded-md text-sm font-medium leading-4 min-h-[2.5rem]",multiSelect:"pl-2 pr-2.5 py-2",displaySelected:"text-sm font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"size-5",label:"text-sm font-medium"},lg:{icon:"[&>svg]:size-6",searchIcon:"[&>svg]:size-5",selectButton:"px-4 py-3 rounded-lg text-sm font-medium leading-5 min-h-[3rem]",multiSelect:"pl-2.5 pr-3 py-2.5",displaySelected:"text-base font-normal",dropdown:"rounded-lg",dropdownItemsWrapper:"p-2",searchbarWrapper:"p-2.5 flex items-center gap-1",searchbar:"font-medium text-sm",searchbarIcon:"size-5",label:"text-base font-medium"}},DO="group-disabled:text-field-color-disabled",CO={sm:"w-[calc(100%+0.75rem)] translate-x-[-0.375rem]",md:"w-[calc(100%+1rem)] translate-x-[-0.5rem]",lg:"w-[calc(100%+1rem)] translate-x-[-0.5rem]"},AO={sm:"py-1.5 px-2 text-xs font-normal",md:"p-2 text-sm font-normal",lg:"p-2 text-base font-normal"},TO=e=>null===e||"boolean"==typeof e?"":"string"==typeof e||"number"==typeof e?e.toString():Array.isArray(e)?e.map(TO).join(" ").trim():(0,i.isValidElement)(e)?e.props&&e.props.children?TO(e.props.children):"":"object"==typeof e&&"textContent"in e?e.textContent?.toString().toLowerCase()||"":"object"==typeof e&&"children"in e?TO(e.children):"",OO=Ua("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),LO=({variant:e="primary",size:t="md",icon:n=null,className:r=""})=>{const a={primary:"text-brand-primary-600",secondary:"text-background-primary"}[e],o={sm:"[&>svg]:size-4",md:"[&>svg]:size-5",lg:"[&>svg]:size-6",xl:"[&>svg]:size-8"}[t];return(0,P.jsx)("span",{className:Oe("flex",o,a,r),children:n||(0,P.jsx)(OO,{className:"animate-spin shrink-0"})})},zO=(0,i.createContext)({}),PO=()=>(0,i.useContext)(zO),RO=(0,i.forwardRef)(({children:e,icon:t=null,placeholder:n="Select an option",optionIcon:r=null,render:a,label:o,className:s,...l},c)=>{const{sizeValue:u,getReferenceProps:d,getValues:f,selectId:m,refs:p,isOpen:h,multiple:g,combobox:w,setSelected:y,onChange:b,isControlled:v,disabled:x,by:_}=PO(),E={sm:"xs",md:"sm",lg:"md"}[u],N=(0,i.useCallback)(()=>{if(t)return t;const e="text-field-placeholder group-disabled:text-icon-disabled";return w?(0,P.jsx)(SO,{className:e}):(0,P.jsx)(hm,{className:e})},[t]),M=(0,i.useCallback)(()=>{const t=f();if(!t)return null;if(g)return t.map((e,t)=>(0,P.jsx)(Yf,{className:"cursor-default",icon:r,type:"rounded",size:E,onMouseDown:I(e),label:"function"==typeof a?a(e):e.toString(),closable:!0,disabled:x},t));let n="string"==typeof t?t:"";if("function"==typeof a&&(n=a(t)),"function"==typeof e&&"function"!=typeof a){const r={value:t,...g?{onClose:I(t)}:{}};n=e(r)}return((0,i.isValidElement)(e)||"string"==typeof e)&&"function"!=typeof a&&(n=e),(0,P.jsx)("span",{className:Oe("truncate",jO[u].displaySelected,DO),children:n})},[f,x]),I=e=>t=>{t?.preventDefault(),t?.stopPropagation();const n=[...f()??[]],r=n.findIndex(t=>null!==t&&null!==e&&"object"==typeof t?t[_]===e[_]:t===e);-1!==r&&(n.splice(r,1),v||y(n),"function"==typeof b&&b(n))};return(0,P.jsxs)("div",{className:"w-full flex flex-col items-start gap-1.5 [&_*]:box-border box-border",children:[!!o&&(0,P.jsx)("label",{className:Oe(jO[u]?.label,"text-field-label"),htmlFor:m,children:o}),(0,P.jsxs)("button",{id:m,ref:qa(p.setReference,c),className:Oe("flex items-center justify-between w-full box-border transition-[outline,background-color,color,box-shadow] duration-200 bg-white","outline outline-1 outline-field-border border-none cursor-pointer",!h&&"focus:ring-2 focus:ring-offset-2 focus:outline-focus-border focus:ring-focus [&:hover:not(:focus):not(:disabled)]:outline-border-strong",jO[u].selectButton,g&&jO[u].multiSelect,"group disabled:outline-field-border-disabled [&:hover:has(:disabled)]:outline-field-border-disabled disabled:cursor-default",s),tabIndex:0,disabled:x,...l,...d(),children:[(0,P.jsxs)("div",{className:Oe("flex-1 grid items-center justify-start gap-1.5 overflow-hidden",f()&&"flex flex-wrap"),children:[M(),(g?!f()?.length:!f())&&(0,P.jsx)("div",{className:Oe("[grid-area:1/1/2/3] text-field-input px-1",jO[u].displaySelected,DO),children:n})]}),(0,P.jsx)("div",{className:Oe("flex items-center [&>svg]:shrink-0",jO[u].icon),children:N()})]})]})});function UO({label:e,children:t,className:n,...r}){const{index:a,totalGroups:o}=r,{sizeValue:s}=PO();return(0,P.jsxs)(i.Fragment,{children:[(0,P.jsxs)("div",{className:"flex flex-col",role:"group","aria-label":e,children:[(0,P.jsx)("div",{className:Oe("p-2 font-normal text-text-tertiary",{sm:"text-xs",md:"text-xs",lg:"text-sm"}[s],n),id:`group-${e?.toLowerCase().replace(/\s+/g,"-")}`,children:e}),(0,P.jsx)("div",{className:"flex flex-col",role:"presentation","aria-labelledby":`group-${e?.toLowerCase().replace(/\s+/g,"-")}`,children:t})]}),a<o&&!!(t&&i.Children.count(t)>0)&&(0,P.jsx)("hr",{className:Oe("h-px my-2 w-full border-border-subtle border-b border-t-0 border-solid",CO[s])})]})}function BO({children:e,className:t}){const{isOpen:n,context:r,refs:a,combobox:o,floatingStyles:s,getFloatingProps:l,sizeValue:c,setSearchKeyword:u,setActiveIndex:d,setSelectedIndex:f,value:m,selected:p,getValues:h,searchKeyword:g,listContentRef:w,by:y,searchPlaceholder:b,activeIndex:v,searchFn:x,debounceDelay:_}=PO(),E=(0,i.useMemo)(()=>{const t=h();let n=-1;if(t){let r=i.Children.toArray(e);r.length>0&&(0,i.isValidElement)(r[0])&&r[0].type===UO&&(r=i.Children.toArray(e).map(e=>(0,i.isValidElement)(e)?i.Children.toArray(e.props.children):[]).flat()),n=r.findIndex(e=>{if(!(0,i.isValidElement)(e))return!1;const n=e.props.value;return"object"==typeof n&&"object"==typeof t?n[y]===t[y]:n===t})}return n},[m,p,e,y]);(0,i.useLayoutEffect)(()=>{n||(d(E),f(E))},[E,n]),(0,i.useLayoutEffect)(()=>{n&&(o&&[-1,null].includes(v)||d(-1))},[g,n]);const N=(0,i.useMemo)(()=>{let t=0,n=0;i.Children.forEach(e,e=>{if((0,i.isValidElement)(e)&&e.type===UO){let n=!1;if(g&&!x){const t=g.toLowerCase(),r=(e.props.label?.toLowerCase()||"").includes(t),a=i.Children.toArray(e.props.children).some(e=>!!(0,i.isValidElement)(e)&&(TO(e.props.children)?.toLowerCase()).includes(t));n=r||a}else n=!0;n&&t++}}),n=Math.max(0,t-1);let r=0,a=0;return i.Children.map(e,e=>{if(!(0,i.isValidElement)(e))return null;if(e.type===UO){let t=!1;if(g&&!x){const n=g.toLowerCase();t=(e.props.label?.toLowerCase()||"").includes(n)}const o=i.Children.map(e.props.children,e=>{if(!(0,i.isValidElement)(e))return null;if(t){const t={...e.props,index:r++};return(0,i.cloneElement)(e,t)}if(g&&!x){const t=TO(e.props.children)?.toLowerCase(),n=g.toLowerCase();if(!t?.includes(n))return null}const n={...e.props,index:r++};return(0,i.cloneElement)(e,n)});if(!o?.some(e=>null!==e))return null;const s={...e.props,children:o,index:a,totalGroups:n};return a++,(0,i.cloneElement)(e,s)}if(g&&!x){const t=TO(e.props?.children)?.toLowerCase(),n=g.toLowerCase();if(!t?.includes(n))return null}return(0,i.cloneElement)(e,{...e.props,index:r++})})},[g,m,p,e,x]),M=i.Children.count(N);(0,i.useEffect)(()=>{w.current=[];let t=i.Children.toArray(e);t&&(0,i.isValidElement)(t[0])&&t[0].type===UO&&(t=i.Children.toArray(t).map(e=>(0,i.isValidElement)(e)?e.props.children:null).filter(Boolean)),i.Children.forEach(t,e=>{if(!(0,i.isValidElement)(e))return;const t=TO(e.props?.children)?.toLowerCase();if(g&&!x){const e=g.toLowerCase();if(!t?.includes(e))return}w.current.push(t)})},[g,x]);const[I,S]=(0,i.useState)(!1),k=(0,i.useCallback)(async()=>{if(x&&"function"==typeof x&&!I){S(!0);try{await x(g)}catch(e){console.error(e)}finally{S(!1)}}},[g]),j=((e,t=500)=>{const n=(0,i.useRef)(null);return(0,i.useCallback)((...r)=>{n.current&&clearTimeout(n.current),n.current=setTimeout(()=>e(...r),t)},[e,t])})(k,_);return(0,i.useEffect)(()=>{"function"==typeof x&&j()},[j]),(0,P.jsx)(P.Fragment,{children:n&&(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(ia,{context:r,modal:!1,visuallyHiddenDismiss:!0,children:(0,P.jsxs)("div",{ref:a.setFloating,className:Oe("box-border [&_*]:box-border w-full bg-white outline-none shadow-lg outline outline-1 outline-border-subtle",o&&"grid grid-cols-1 grid-rows-[auto_1fr] divide-y divide-x-0 divide-solid divide-border-subtle",jO[c].dropdown,!o&&"h-auto",o?"overflow-hidden":"overflow-y-auto overflow-x-hidden",t),style:{...s,zIndex:1},...l(),children:[o&&(0,P.jsxs)("div",{className:Oe(jO[c].searchbarWrapper),children:[I?(0,P.jsx)(LO,{className:jO[c].searchbarIcon}):(0,P.jsx)(kO,{className:Oe("text-icon-secondary shrink-0",jO[c].searchbarIcon)}),(0,P.jsx)("input",{className:Oe("px-1 w-full placeholder:text-field-placeholder border-0 focus:outline-none focus:shadow-none",jO[c].searchbar),type:"search",name:"keyword",placeholder:b,onChange:e=>u(e.target.value),value:g,autoComplete:"off"})]}),(0,P.jsxs)("div",{className:Oe("overflow-y-auto overflow-x-hidden",!o&&"w-full h-full",jO[c].dropdownItemsWrapper),children:[!!M&&N,!M&&(0,P.jsx)("div",{className:Oe("p-2 text-center font-medium text-field-placeholder",AO[c]),children:"No items found"})]})]})})})})}function FO({children:e,root:t,id:n}){return(0,P.jsx)(Jr,{id:n,root:t,children:e})}function YO({value:e,selected:t,children:n,className:r,...a}){const{sizeValue:o,getItemProps:s,onKeyDownItem:l,onClickItem:c,activeIndex:u,selectedIndex:d,updateListRef:f,getValues:m,by:p,multiple:h}=PO(),{index:g}=a,w=(0,i.useRef)(g),y=(0,i.useMemo)(()=>{if(!h)return!1;const t=m();return!!t&&t.some(t=>null!==t&&null!==e&&"object"==typeof t?t[p]===e[p]:t===e)},[e,m]),b=(0,i.useMemo)(()=>"boolean"==typeof t?t:h?y:g===d,[y,d,t]);return(0,P.jsxs)("div",{className:Oe("w-full flex items-center justify-between text-text-primary hover:bg-button-tertiary-hover rounded-md transition-all duration-150 cursor-pointer focus:outline-none focus-within:outline-none outline-none",AO[o],g===u&&"bg-button-tertiary-hover",r),ref:e=>{f(g,e)},role:"option",tabIndex:g===u?0:-1,"aria-selected":b&&g===u,...s({onClick(){c(w.current,e)},onKeyDown(t){l(t,w.current,e)}}),children:[(0,P.jsx)("span",{className:"w-full truncate",children:n}),b&&(0,P.jsx)(Fa,{className:Oe("text-icon-on-color-disabled",{sm:"size-4",md:"size-4",lg:"size-5"}[o])})]})}const QO=({id:e,size:t="md",value:n,defaultValue:r,onChange:a,by:o="id",children:s,multiple:l=!1,combobox:c=!1,disabled:u=!1,searchPlaceholder:d="Search...",searchFn:f,debounceDelay:m=500})=>{const p=(0,i.useMemo)(()=>e||`select-${cp()}`,[e]),h=(0,i.useMemo)(()=>typeof n<"u",[n]),[g,w]=(0,i.useState)(r),[y,b]=(0,i.useState)(""),v=(0,i.useCallback)(()=>h?n:g,[h,n,g]),[x,_]=(0,i.useState)(!1),[E,N]=(0,i.useState)(null),[M,I]=(0,i.useState)(null),S={sm:c?256:172,md:c?256:216,lg:c?256:216},{refs:k,floatingStyles:j,context:D}=wa({strategy:"fixed",placement:"bottom-start",open:x,onOpenChange:_,whileElementsMounted:Rn,middleware:[Gn(5),$n({padding:10}),Xn({apply({rects:e,elements:n,availableHeight:r}){Object.assign(n.floating.style,{maxHeight:`min(${r}px, ${S[t]}px)`,maxWidth:`${e.reference.width}px`})},padding:10})]}),C=(0,i.useRef)([]),A=(0,i.useRef)([]),T=(0,i.useRef)(!1),O=fa(D,{event:"mousedown"}),L=ga(D),z=ja(D,{role:"listbox"}),R=Sa(D,{listRef:C,activeIndex:E,selectedIndex:M,onNavigate:N,loop:!0}),U=function(e,t){var n;const{open:r,dataRef:a}=e,{listRef:o,activeIndex:s,onMatch:l,onTypingChange:c,enabled:u=!0,findMatch:d=null,resetMs:f=750,ignoreKeys:m=[],selectedIndex:p=null}=t,h=i.useRef(),g=i.useRef(""),w=i.useRef(null!=(n=null!=p?p:s)?n:-1),y=i.useRef(null),b=er(l),v=er(c),x=kr(d),_=kr(m);mr(()=>{r&&(clearTimeout(h.current),y.current=null,g.current="")},[r]),mr(()=>{var e;r&&""===g.current&&(w.current=null!=(e=null!=p?p:s)?e:-1)},[r,p,s]);const E=er(e=>{e?a.current.typing||(a.current.typing=e,v(e)):a.current.typing&&(a.current.typing=e,v(e))}),N=er(e=>{function t(e,t,n){const r=x.current?x.current(t,n):t.find(e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase())));return r?e.indexOf(r):-1}const n=o.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?E(!1):" "===e.key&&Dt(e)),null==n||_.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;r&&" "!==e.key&&(Dt(e),E(!0)),n.every(e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())})&&g.current===e.key&&(g.current="",w.current=y.current),g.current+=e.key,clearTimeout(h.current),h.current=setTimeout(()=>{g.current="",w.current=y.current,E(!1)},f);const a=w.current,i=t(n,[...n.slice((a||0)+1),...n.slice(0,(a||0)+1)],g.current);-1!==i?(b(i),y.current=i):" "!==e.key&&(g.current="",E(!1))}),M=i.useMemo(()=>({onKeyDown:N}),[N]),I=i.useMemo(()=>({onKeyDown:N,onKeyUp(e){" "===e.key&&E(!1)}}),[N,E]);return i.useMemo(()=>u?{reference:M,floating:I}:{},[u,M,I])}(D,{listRef:A,activeIndex:E,selectedIndex:M,onMatch:x?N:I,onTypingChange(e){T.current=e}}),{getReferenceProps:B,getFloatingProps:F,getItemProps:Y}=xa([L,z,R,O,...c?[]:[U]]),Q=(e,t)=>{if(l)return((e,t)=>{const n=[...v()??[]];-1===n.findIndex(e=>null!==e&&null!==t&&"object"==typeof e?e[o]===t[o]:e===t)&&(n.push(t),h||w(n),I(e),k.reference.current.focus(),_(!1),b(""),"function"==typeof a&&a(n))})(e,t);I(e),h||w(t),k.reference.current.focus(),_(!1),b(""),"function"==typeof a&&a(t)},V=(0,i.useCallback)((e,t)=>{C.current[e]=t},[]);return(0,P.jsx)(zO.Provider,{value:{selectedIndex:M,setSelectedIndex:I,activeIndex:E,setActiveIndex:N,selected:g,setSelected:w,handleSelect:Q,combobox:c,sizeValue:t,multiple:l,onChange:a,isTypingRef:T,getItemProps:Y,onClickItem:(e,t)=>{Q(e,t)},onKeyDownItem:(e,t,n)=>{"Enter"===e.key&&(e.preventDefault(),Q(t,n))," "===e.key&&!T.current&&(e.preventDefault(),Q(t,n))},getValues:v,selectId:p,getReferenceProps:B,isOpen:x,value:n,updateListRef:V,refs:k,listContentRef:A,by:o,getFloatingProps:F,floatingStyles:j,context:D,searchKeyword:y,setSearchKeyword:b,disabled:u,isControlled:h,searchPlaceholder:d,searchFn:f,debounceDelay:m},children:s})};QO.displayName="Select";const VO=Object.assign(QO,{Portal:FO,Button:RO,Options:BO,Option:YO,OptionGroup:UO});FO.displayName="Select.Portal",RO.displayName="Select.Button",BO.displayName="Select.Options",YO.displayName="Select.Option",UO.displayName="Select.OptionGroup";const WO=function(e){const{name:t,id:n,label:r,desc:a,tooltip:s,options:l,onSelect:c,prodata:u,after:d,sectionClass:f="",wrapperClass:m="",contentClass:p="",labelClass:h="",descClass:g="",displayAlign:w="horizontal",isDisabled:y=!1}=e,[b,v]=(0,i.useState)(e.value),x=(0,i.useRef)(null),_=f||"text-left",E=h||"text-sm font-medium text-text-primary mb-2",N=g||"text-sm font-normal text-text-tertiary mt-2";let M=m||"flex items-center gap-2.5",I=p||"";return"horizontal_inline"===w?(M="flex items-center justify-between gap-2.5",I="w-[300px]"):"horizontal"!==w&&(M="block w-full text-left"),(0,i.useEffect)(()=>{v(e.value),x.current&&(x.current.value=e.value)},[e.value]),(0,o.createElement)("div",{className:`wcf-field wcf-select-option ${_}`},(0,o.createElement)("div",{className:`wcf-field__data ${M}`},r&&(0,o.createElement)("div",{className:`wcf-field__data--label ${E}`},(0,o.createElement)("label",null,r,s&&(0,o.createElement)(iQ,{text:s}))),(0,o.createElement)("div",{className:`wcf-field__data--content ${I}`},(0,o.createElement)("input",{type:"hidden",ref:x,id:n,name:t,defaultValue:b,className:e.class?e.class:""}),(0,o.createElement)(VO,{value:b,onChange:function(n){if(u&&n in u)return;v(n),x.current&&(x.current.value=n);const r={target:{value:n,name:t}},a=new CustomEvent("wcf:select:change",{bubbles:!0,detail:{e:r,name:e.name,value:n}});document.dispatchEvent(a),e?.callback&&e.callback(r,e.name,n),c&&c(r)},disabled:y},(0,o.createElement)(VO.Button,{type:"button",className:e.class?e.class:"",render:function(e){if(!e)return null;for(const t of l||[])if(t.isopt){for(const n of t.options||[])if(String(n.value)===String(e))return n.label}else if(String(t.value)===String(e))return u&&e in u?u[e]:t.label;return e}}),(0,o.createElement)(VO.Options,null,l&&l.map(e=>{if(e.isopt)return(0,o.createElement)(VO.OptionGroup,{label:e.title,key:e.title},e.options.map(e=>(0,o.createElement)(VO.Option,{value:e.value,key:e.value},e.label)));let t=e.label,n=!1;return u&&e.value in u&&(t=u[e.value],n=!0),(0,o.createElement)(VO.Option,{value:e.value,key:e.value,className:n?"opacity-50 pointer-events-none":""},t)})))),d&&(0,o.createElement)("div",{className:`wcf-field__data--content__after ${N}`},d)),a&&(0,o.createElement)("div",{className:`wcf-field__desc ${N}`},fh(a)))},ZO=function(e){const{name:t,id:n,label:r,value:a,placeholder:s,tooltip:l,desc:c,readonly:u,icon:d,textFieldType:f="text",onChangeCB:m,sectionClass:p=!1,wrapperClass:h=!1,contentClass:g,labelClass:w="",descClass:y="text-sm font-normal text-text-tertiary mt-2",displayAlign:b="horizontal",attr:v}=e,[x,_]=(0,i.useState)(a),E=(0,i.useRef)(null),N=p||"text-left",M=`${e.class?e.class:""} ${u?"bg-background-secondary":""} w-full`;let I=h||"flex items-center justify-between gap-2.5",S=w||"text-sm font-medium text-text-primary text-left";const k=null!=g?g:r&&"horizontal"===b?"w-1/2":"w-full";return"horizontal"!==b&&(I="block w-full text-left",S+=" mb-2"),(0,i.useEffect)(()=>{_(a),E.current&&(E.current.value=null!=a?a:"")},[a]),(0,o.createElement)("div",{className:`wcf-field wcf-text-field ${N} `},(0,o.createElement)("div",{className:`wcf-field__data ${I}`},r&&(0,o.createElement)("div",{className:`wcf-field__data--label ${S}`},(0,o.createElement)("label",{className:"whitespace-nowrap"},r,l&&(0,o.createElement)(iQ,{text:l}))),(0,o.createElement)("div",{className:`wcf-field__data--content ${k}`},(0,o.createElement)("input",{type:"hidden",ref:E,className:e.class?e.class:"",defaultValue:null!=x?x:""}),(0,o.createElement)(dp,{ref:v?.ref,type:f,value:kh(x),id:n,name:t,onChange:function(e){_(e),E.current&&(E.current.value=e);const n=new CustomEvent("wcf:text:change",{bubbles:!0,detail:{e:{target:{value:e,name:t}},name:t,value:e}});document.dispatchEvent(n),m&&m(e)},placeholder:s,readOnly:u,size:"md",className:M}))),d&&(0,o.createElement)("div",{className:"wcf-text-field__icon"},(0,o.createElement)("span",{className:d})),c&&(0,o.createElement)("div",{className:`wcf-field__desc ${y}`},fh(c)))},GO=(0,i.forwardRef)(({id:e,defaultValue:t="",value:n,size:r="sm",className:a="",disabled:o=!1,onChange:s=()=>{},error:l=!1,onError:c=()=>{},...u},d)=>{const f=(0,i.useMemo)(()=>e||`input-textarea-${cp()}`,[e]),m=(0,i.useMemo)(()=>typeof n<"u",[n]),[p,h]=(0,i.useState)(t),g=(0,i.useCallback)(()=>m?n:p,[m,n,p]),w=o?"hover:border-border-disabled":"hover:border-border-strong",y=l?"focus:border-focus-error-border focus:ring-field-color-error border-focus-error-border":"";return(0,P.jsx)("textarea",{ref:d,id:f,className:Oe("py-2 rounded border border-solid border-border-subtle bg-field-secondary-background font-normal placeholder-text-tertiary text-text-primary focus:outline-none transition ease-in-out duration-200",o?"border-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled":"",{sm:"px-3 rounded text-xs",md:"px-3 rounded-md text-sm",lg:"px-4 rounded-lg text-base"}[r],"focus:border-focus-border focus:ring-2 focus:ring-toggle-on focus:ring-offset-2",w,y,a),disabled:o,onChange:e=>{if(o)return;const t=e.target.value;m||h(t),"function"==typeof s&&s(t)},onInvalid:c,value:g(),...u})});GO.displayName="TextArea";const HO=function(e){const{name:t,value:n,label:r,desc:a,id:s,placeholder:l,tooltip:c,rows:u,cols:d,sectionClass:f=!1,wrapperClass:m=!1,labelClass:p="",descClass:h="text-sm font-normal text-text-tertiary mt-2",displayAlign:g="horizontal"}=e,w=f||"text-left",y=`${e.class?e.class:""} !w-full !max-w-full input-field !px-3 !py-2.5 !text-sm font-normal`;let b=m||"flex flex-col gap-2.5",v=p||"text-sm font-medium text-text-primary text-left mb-2";"horizontal"!==g&&(b="block w-full text-left",v+=" mb-2");const[x,_]=(0,i.useState)(n);return(0,i.useEffect)(()=>{_(n)},[n]),(0,o.createElement)("div",{className:`wcf-field wcf-textarea-field ${w} `},(0,o.createElement)("div",{className:`wcf-field__data ${b}`},r&&(0,o.createElement)("div",{className:`wcf-field__data--label ${v}`},(0,o.createElement)("label",null,r,c&&(0,o.createElement)(iQ,{text:c}))),(0,o.createElement)("div",{className:"wcf-field__data--content w-full"},(0,o.createElement)(GO,{id:s,name:t,value:kh(x),onChange:function(e){_(e);const n=new CustomEvent("wcf:textarea:change",{bubbles:!0,detail:{e:{target:{value:e,name:t}},name:t,value:e}});document.dispatchEvent(n)},placeholder:l,rows:u||"10",cols:d||"60",className:y}))),a&&(0,o.createElement)("div",{className:`wcf-field__desc ${h}`},fh(a)))},$O=function(e){const{name:t,value:n,label:r,id:a,tooltip:s,displayAlign:l="horizontal",language:c="javascript",sectionClass:u=!1,wrapperClass:d=!1,labelClass:f=""}=e,m=function(e){if(!e)return e;const t=document.createElement("textarea");return t.innerHTML=e,t.value}(n),p=(0,i.useRef)(null),h=(0,i.useRef)(null),g=(0,i.useRef)(null);(0,i.useEffect)(()=>{if(!p.current||!window.wp?.codeEditor||h.current)return;const e=wp.codeEditor.defaultSettings?JSON.parse(JSON.stringify(wp.codeEditor.defaultSettings)):{};let n;e.codemirror={...e.codemirror,mode:"css"===c?"css":"javascript",lineNumbers:!0,indentUnit:4,tabSize:4};try{n=wp.codeEditor.initialize(p.current,e),h.current=n.codemirror}catch(e){return}h.current.on("change",e=>{const n=e.getValue(),r=new CustomEvent("wcf:code:change",{bubbles:!0,detail:{name:t,value:n}});document.dispatchEvent(r)});const r=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&h.current&&h.current.refresh()})},{threshold:.1});return g.current&&r.observe(g.current),()=>{h.current&&(h.current.toTextArea(),h.current=null),r.disconnect()}},[]);const w=u||"text-left",y=f||"text-sm font-medium text-text-primary text-left mb-2";let b=d||"flex items-center gap-2.5";return"horizontal"!==l&&(b="block w-full text-left"),(0,o.createElement)("div",{ref:g,className:`wcf-field wcf-code-field ${w}`},(0,o.createElement)("div",{className:`wcf-field__data ${b}`},r&&(0,o.createElement)("div",{className:`wcf-field__data--label ${y}`},(0,o.createElement)("label",{htmlFor:a},r,s&&(0,o.createElement)(iQ,{text:s}))),(0,o.createElement)("div",{className:"wcf-field__data--content"},(0,o.createElement)("textarea",{ref:p,id:a,name:t,defaultValue:m}))))};function XO({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const qO=i.forwardRef(XO);function JO({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"}))}const KO=i.forwardRef(JO);function eL({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))}const tL=i.forwardRef(eL),nL=(0,i.forwardRef)((e,t)=>{const[{settingsProcess:n},r]=g();"saved"===n&&setTimeout(()=>{document.getElementsByClassName("wcf-button--save-global-settings")[0].blur(),r({status:"RESET"})},2e3);const a=e.icon?e.icon:"",i=e.iconClass?e.iconClass:"",s=e.className||e.class||"",l="processing"===n?"wcf-disabled":"";return(0,o.createElement)("div",{className:"wcf-field wcf-submit wcf-submit-field"},(0,o.createElement)(Va,{ref:t,type:"submit",variant:"primary",className:`wcf-button--save-global-settings ${s} ${l}`,onClick:function(e){const t=e.target.closest("form");!t||t.checkValidity()?r({status:"PROCESSING"}):t.reportValidity()},loading:"processing"===n,icon:function(){if("processing"===n)return(0,o.createElement)(gQ,{className:i});switch(a){case"plus":return(0,o.createElement)(KO,{className:`w-4 h-4 stroke-2 ${i}`});case"loader":return(0,o.createElement)(Wf,{className:`w-4 h-4 stroke-2 ${i}`});case"close":return(0,o.createElement)(tL,{className:`w-4 h-4 stroke-2 ${i}`});case"check":return(0,o.createElement)(qO,{className:`w-4 h-4 stroke-2 ${i}`});default:return null}}()},"saved"===n&&(0,o.createElement)("span",{className:"wcf-success-notice"},(0,o.createElement)(qO,{className:"w-4 h-4 stroke-2 inline-block mr-1"}),(0,o.createElement)("span",{className:"wcf-success-message"},(0,z.__)("Settings Saved","cartflows"))),"processing"===n&&(0,z.__)("Saving…","cartflows"),!n&&(0,z.__)("Save Settings","cartflows")))}),rL=nL;function aL(e){return aL="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},aL(e)}function oL(e){var t=function(e){if("object"!=aL(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=aL(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==aL(t)?t:t+""}function iL(e,t,n){return(t=oL(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function lL(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?sL(Object(n),!0).forEach(function(t){iL(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):sL(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,oL(r.key),r)}}var uL=a(3662);function dL(e){return dL=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},dL(e)}function fL(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(fL=function(){return!!e})()}function mL(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function pL(e,t){if(e){if("string"==typeof e)return mL(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mL(e,t):void 0}}function hL(e){return function(e){if(Array.isArray(e))return mL(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||pL(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var gL=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),wL=Math.abs,yL=String.fromCharCode,bL=Object.assign;function vL(e){return e.trim()}function xL(e,t,n){return e.replace(t,n)}function _L(e,t){return e.indexOf(t)}function EL(e,t){return 0|e.charCodeAt(t)}function NL(e,t,n){return e.slice(t,n)}function ML(e){return e.length}function IL(e){return e.length}function SL(e,t){return t.push(e),e}var kL=1,jL=1,DL=0,CL=0,AL=0,TL="";function OL(e,t,n,r,a,o,i){return{value:e,root:t,parent:n,type:r,props:a,children:o,line:kL,column:jL,length:i,return:""}}function LL(e,t){return bL(OL("",null,null,"",null,null,0),e,{length:-e.length},t)}function zL(){return AL=CL>0?EL(TL,--CL):0,jL--,10===AL&&(jL=1,kL--),AL}function PL(){return AL=CL<DL?EL(TL,CL++):0,jL++,10===AL&&(jL=1,kL++),AL}function RL(){return EL(TL,CL)}function UL(){return CL}function BL(e,t){return NL(TL,e,t)}function FL(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function YL(e){return kL=jL=1,DL=ML(TL=e),CL=0,[]}function QL(e){return TL="",e}function VL(e){return vL(BL(CL-1,GL(91===e?e+2:40===e?e+1:e)))}function WL(e){for(;(AL=RL())&&AL<33;)PL();return FL(e)>2||FL(AL)>3?"":" "}function ZL(e,t){for(;--t&&PL()&&!(AL<48||AL>102||AL>57&&AL<65||AL>70&&AL<97););return BL(e,UL()+(t<6&&32==RL()&&32==PL()))}function GL(e){for(;PL();)switch(AL){case e:return CL;case 34:case 39:34!==e&&39!==e&&GL(AL);break;case 40:41===e&&GL(e);break;case 92:PL()}return CL}function HL(e,t){for(;PL()&&e+AL!==57&&(e+AL!==84||47!==RL()););return"/*"+BL(t,CL-1)+"*"+yL(47===e?e:PL())}function $L(e){for(;!FL(RL());)PL();return BL(e,CL)}var XL="-ms-",qL="-moz-",JL="-webkit-",KL="comm",ez="rule",tz="decl",nz="@keyframes";function rz(e,t){for(var n="",r=IL(e),a=0;a<r;a++)n+=t(e[a],a,e,t)||"";return n}function az(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case tz:return e.return=e.return||e.value;case KL:return"";case nz:return e.return=e.value+"{"+rz(e.children,r)+"}";case ez:e.value=e.props.join(",")}return ML(n=rz(e.children,r))?e.return=e.value+"{"+n+"}":""}function oz(e){return QL(iz("",null,null,null,[""],e=YL(e),0,[0],e))}function iz(e,t,n,r,a,o,i,s,l){for(var c=0,u=0,d=i,f=0,m=0,p=0,h=1,g=1,w=1,y=0,b="",v=a,x=o,_=r,E=b;g;)switch(p=y,y=PL()){case 40:if(108!=p&&58==EL(E,d-1)){-1!=_L(E+=xL(VL(y),"&","&\f"),"&\f")&&(w=-1);break}case 34:case 39:case 91:E+=VL(y);break;case 9:case 10:case 13:case 32:E+=WL(p);break;case 92:E+=ZL(UL()-1,7);continue;case 47:switch(RL()){case 42:case 47:SL(lz(HL(PL(),UL()),t,n),l);break;default:E+="/"}break;case 123*h:s[c++]=ML(E)*w;case 125*h:case 59:case 0:switch(y){case 0:case 125:g=0;case 59+u:-1==w&&(E=xL(E,/\f/g,"")),m>0&&ML(E)-d&&SL(m>32?cz(E+";",r,n,d-1):cz(xL(E," ","")+";",r,n,d-2),l);break;case 59:E+=";";default:if(SL(_=sz(E,t,n,c,u,a,s,b,v=[],x=[],d),o),123===y)if(0===u)iz(E,t,_,_,v,o,d,s,x);else switch(99===f&&110===EL(E,3)?100:f){case 100:case 108:case 109:case 115:iz(e,_,_,r&&SL(sz(e,_,_,0,0,a,s,b,a,v=[],d),x),a,x,d,s,r?v:x);break;default:iz(E,_,_,_,[""],x,0,s,x)}}c=u=m=0,h=w=1,b=E="",d=i;break;case 58:d=1+ML(E),m=p;default:if(h<1)if(123==y)--h;else if(125==y&&0==h++&&125==zL())continue;switch(E+=yL(y),y*h){case 38:w=u>0?1:(E+="\f",-1);break;case 44:s[c++]=(ML(E)-1)*w,w=1;break;case 64:45===RL()&&(E+=VL(PL())),f=RL(),u=d=ML(b=E+=$L(UL())),y++;break;case 45:45===p&&2==ML(E)&&(h=0)}}return o}function sz(e,t,n,r,a,o,i,s,l,c,u){for(var d=a-1,f=0===a?o:[""],m=IL(f),p=0,h=0,g=0;p<r;++p)for(var w=0,y=NL(e,d+1,d=wL(h=i[p])),b=e;w<m;++w)(b=vL(h>0?f[w]+" "+y:xL(y,/&\f/g,f[w])))&&(l[g++]=b);return OL(e,t,n,0===a?ez:s,l,c,u)}function lz(e,t,n){return OL(e,t,n,KL,yL(AL),NL(e,2,-2),0)}function cz(e,t,n,r){return OL(e,t,n,tz,NL(e,0,r),NL(e,r+1,-1),r)}var uz=function(e,t,n){for(var r=0,a=0;r=a,a=RL(),38===r&&12===a&&(t[n]=1),!FL(a);)PL();return BL(e,CL)},dz=new WeakMap,fz=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||dz.get(n))&&!r){dz.set(e,!0);for(var a=[],o=function(e,t){return QL(function(e,t){var n=-1,r=44;do{switch(FL(r)){case 0:38===r&&12===RL()&&(t[n]=1),e[n]+=uz(CL-1,t,n);break;case 2:e[n]+=VL(r);break;case 4:if(44===r){e[++n]=58===RL()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=yL(r)}}while(r=PL());return e}(YL(e),t))}(t,a),i=n.props,s=0,l=0;s<o.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=a[s]?o[s].replace(/&\f/g,i[c]):i[c]+" "+o[s]}}},mz=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function pz(e,t){switch(function(e,t){return 45^EL(e,0)?(((t<<2^EL(e,0))<<2^EL(e,1))<<2^EL(e,2))<<2^EL(e,3):0}(e,t)){case 5103:return JL+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return JL+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return JL+e+qL+e+XL+e+e;case 6828:case 4268:return JL+e+XL+e+e;case 6165:return JL+e+XL+"flex-"+e+e;case 5187:return JL+e+xL(e,/(\w+).+(:[^]+)/,JL+"box-$1$2"+XL+"flex-$1$2")+e;case 5443:return JL+e+XL+"flex-item-"+xL(e,/flex-|-self/,"")+e;case 4675:return JL+e+XL+"flex-line-pack"+xL(e,/align-content|flex-|-self/,"")+e;case 5548:return JL+e+XL+xL(e,"shrink","negative")+e;case 5292:return JL+e+XL+xL(e,"basis","preferred-size")+e;case 6060:return JL+"box-"+xL(e,"-grow","")+JL+e+XL+xL(e,"grow","positive")+e;case 4554:return JL+xL(e,/([^-])(transform)/g,"$1"+JL+"$2")+e;case 6187:return xL(xL(xL(e,/(zoom-|grab)/,JL+"$1"),/(image-set)/,JL+"$1"),e,"")+e;case 5495:case 3959:return xL(e,/(image-set\([^]*)/,JL+"$1$`$1");case 4968:return xL(xL(e,/(.+:)(flex-)?(.*)/,JL+"box-pack:$3"+XL+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+JL+e+e;case 4095:case 3583:case 4068:case 2532:return xL(e,/(.+)-inline(.+)/,JL+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(ML(e)-1-t>6)switch(EL(e,t+1)){case 109:if(45!==EL(e,t+4))break;case 102:return xL(e,/(.+:)(.+)-([^]+)/,"$1"+JL+"$2-$3$1"+qL+(108==EL(e,t+3)?"$3":"$2-$3"))+e;case 115:return~_L(e,"stretch")?pz(xL(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==EL(e,t+1))break;case 6444:switch(EL(e,ML(e)-3-(~_L(e,"!important")&&10))){case 107:return xL(e,":",":"+JL)+e;case 101:return xL(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+JL+(45===EL(e,14)?"inline-":"")+"box$3$1"+JL+"$2$3$1"+XL+"$2box$3")+e}break;case 5936:switch(EL(e,t+11)){case 114:return JL+e+XL+xL(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return JL+e+XL+xL(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return JL+e+XL+xL(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return JL+e+XL+e+e}return e}var hz=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case tz:e.return=pz(e.value,e.length);break;case nz:return rz([LL(e,{value:xL(e.value,"@","@"+JL)})],r);case ez:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return rz([LL(e,{props:[xL(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return rz([LL(e,{props:[xL(t,/:(plac\w+)/,":"+JL+"input-$1")]}),LL(e,{props:[xL(t,/:(plac\w+)/,":-moz-$1")]}),LL(e,{props:[xL(t,/:(plac\w+)/,XL+"input-$1")]})],r)}return""})}}],gz=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,a,o=e.stylisPlugins||hz,i={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;s.push(e)});var l,c,u,d,f=[az,(d=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],m=(c=[fz,mz].concat(o,f),u=IL(c),function(e,t,n,r){for(var a="",o=0;o<u;o++)a+=c[o](e,t,n,r)||"";return a});a=function(e,t,n,r){l=n,rz(oz(e?e+"{"+t.styles+"}":t.styles),m),r&&(p.inserted[t.name]=!0)};var p={key:t,sheet:new gL({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:a};return p.sheet.hydrate(s),p},wz=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},yz={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function bz(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var vz=/[A-Z]|^ms/g,xz=/_EMO_([^_]+?)_([^]*?)_EMO_/g,_z=function(e){return 45===e.charCodeAt(1)},Ez=function(e){return null!=e&&"boolean"!=typeof e},Nz=bz(function(e){return _z(e)?e:e.replace(vz,"-$&").toLowerCase()}),Mz=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(xz,function(e,t,n){return Sz={name:t,styles:n,next:Sz},t})}return 1===yz[e]||_z(e)||"number"!=typeof t||0===t?t:t+"px"};function Iz(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var a=n;if(1===a.anim)return Sz={name:a.name,styles:a.styles,next:Sz},a.name;var o=n;if(void 0!==o.styles){var i=o.next;if(void 0!==i)for(;void 0!==i;)Sz={name:i.name,styles:i.styles,next:Sz},i=i.next;return o.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=Iz(e,t,n[a])+";";else for(var o in n){var i=n[o];if("object"!=typeof i){var s=i;null!=t&&void 0!==t[s]?r+=o+"{"+t[s]+"}":Ez(s)&&(r+=Nz(o)+":"+Mz(o,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=Iz(e,t,i);switch(o){case"animation":case"animationName":r+=Nz(o)+":"+l+";";break;default:r+=o+"{"+l+"}"}}else for(var c=0;c<i.length;c++)Ez(i[c])&&(r+=Nz(o)+":"+Mz(o,i[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=Sz,l=n(e);return Sz=s,Iz(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Sz,kz=/label:\s*([^\s;{]+)\s*(;|$)/g;function jz(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,a="";Sz=void 0;var o=e[0];null==o||void 0===o.raw?(r=!1,a+=Iz(n,t,o)):a+=o[0];for(var i=1;i<e.length;i++)a+=Iz(n,t,e[i]),r&&(a+=o[i]);kz.lastIndex=0;for(var s,l="";null!==(s=kz.exec(a));)l+="-"+s[1];var c=function(e){for(var t,n=0,r=0,a=e.length;a>=4;++r,a-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(a){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(a)+l;return{name:c,styles:a,next:Sz}}var Dz,Cz,Az=!!i.useInsertionEffect&&i.useInsertionEffect,Tz=Az||function(e){return e()},Oz=(Az||i.useLayoutEffect,i.createContext("undefined"!=typeof HTMLElement?gz({key:"css"}):null)),Lz=(Oz.Provider,function(e){return(0,i.forwardRef)(function(t,n){var r=(0,i.useContext)(Oz);return e(t,r,n)})}),zz=i.createContext({}),Pz={}.hasOwnProperty,Rz="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Uz=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return wz(t,n,r),Tz(function(){return function(e,t,n){wz(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+r:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}}(t,n,r)}),null},Bz=Lz(function(e,t,n){var r=e.css;"string"==typeof r&&void 0!==t.registered[r]&&(r=t.registered[r]);var a=e[Rz],o=[r],s="";"string"==typeof e.className?s=function(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}(t.registered,o,e.className):null!=e.className&&(s=e.className+" ");var l=jz(o,void 0,i.useContext(zz));s+=t.key+"-"+l.name;var c={};for(var u in e)Pz.call(e,u)&&"css"!==u&&u!==Rz&&(c[u]=e[u]);return c.className=s,n&&(c.ref=n),i.createElement(i.Fragment,null,i.createElement(Uz,{cache:t,serialized:l,isStringTag:"string"==typeof a}),i.createElement(a,c))}),Fz=Bz,Yz=(a(4146),function(e,t){var n=arguments;if(null==t||!Pz.call(t,"css"))return i.createElement.apply(void 0,n);var r=n.length,a=new Array(r);a[0]=Fz,a[1]=function(e,t){var n={};for(var r in t)Pz.call(t,r)&&(n[r]=t[r]);return n[Rz]=e,n}(e,t);for(var o=2;o<r;o++)a[o]=n[o];return i.createElement.apply(null,a)});function Qz(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return jz(t)}function Vz(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,i,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(e){c=!0,a=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw a}}return s}}(e,t)||pL(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Wz(e,t){if(null==e)return{};var n,r,a=(0,E.A)(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}Dz=Yz||(Yz={}),Cz||(Cz=Dz.JSX||(Dz.JSX={}));var Zz=i.useLayoutEffect,Gz=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Hz=function(){};function $z(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}function Xz(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];var o=[].concat(r);if(t&&e)for(var i in t)t.hasOwnProperty(i)&&t[i]&&o.push("".concat($z(e,i)));return o.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var qz=function(e){return t=e,Array.isArray(t)?e.filter(Boolean):"object"===aL(e)&&null!==e?[e]:[];var t},Jz=function(e){return e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme,lL({},Wz(e,Gz))},Kz=function(e,t,n){var r=e.cx,a=e.getStyles,o=e.getClassNames,i=e.className;return{css:a(t,e),className:r(null!=n?n:{},o(t,e),i)}};function eP(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function tP(e){return eP(e)?window.pageYOffset:e.scrollTop}function nP(e,t){eP(e)?window.scrollTo(0,t):e.scrollTop=t}function rP(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Hz,a=tP(e),o=t-a,i=0;!function t(){var s=function(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}(i+=10,a,o,n);nP(e,s),i<n?window.requestAnimationFrame(t):r(e)}()}function aP(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),a=t.offsetHeight/3;r.bottom+a>n.bottom?nP(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+a,e.scrollHeight)):r.top-a<n.top&&nP(e,Math.max(t.offsetTop-a,0))}function oP(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var iP=!1,sP={get passive(){return iP=!0}},lP="undefined"!=typeof window?window:{};lP.addEventListener&&lP.removeEventListener&&(lP.addEventListener("p",Hz,sP),lP.removeEventListener("p",Hz,!1));var cP=iP;function uP(e){return null!=e}function dP(e,t,n){return e?t:n}var fP=["children","innerProps"],mP=["children","innerProps"];var pP,hP=function(e){return"auto"===e?"bottom":e},gP=(0,i.createContext)(null),wP=function(e){var t=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,a=e.menuPlacement,o=e.menuPosition,s=e.menuShouldScrollIntoView,l=e.theme,c=((0,i.useContext)(gP)||{}).setPortalPlacement,u=(0,i.useRef)(null),d=Vz((0,i.useState)(r),2),f=d[0],m=d[1],p=Vz((0,i.useState)(null),2),h=p[0],g=p[1],w=l.spacing.controlHeight;return Zz(function(){var e=u.current;if(e){var t="fixed"===o,i=function(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,a=e.placement,o=e.shouldScroll,i=e.isFixedPosition,s=e.controlHeight,l=function(e){var t=getComputedStyle(e),n="absolute"===t.position,r=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var a=e;a=a.parentElement;)if(t=getComputedStyle(a),(!n||"static"!==t.position)&&r.test(t.overflow+t.overflowY+t.overflowX))return a;return document.documentElement}(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var u,d=l.getBoundingClientRect().height,f=n.getBoundingClientRect(),m=f.bottom,p=f.height,h=f.top,g=n.offsetParent.getBoundingClientRect().top,w=i||eP(u=l)?window.innerHeight:u.clientHeight,y=tP(l),b=parseInt(getComputedStyle(n).marginBottom,10),v=parseInt(getComputedStyle(n).marginTop,10),x=g-v,_=w-h,E=x+y,N=d-y-h,M=m-w+y+b,I=y+h-v,S=160;switch(a){case"auto":case"bottom":if(_>=p)return{placement:"bottom",maxHeight:t};if(N>=p&&!i)return o&&rP(l,M,S),{placement:"bottom",maxHeight:t};if(!i&&N>=r||i&&_>=r)return o&&rP(l,M,S),{placement:"bottom",maxHeight:i?_-b:N-b};if("auto"===a||i){var k=t,j=i?x:E;return j>=r&&(k=Math.min(j-b-s,t)),{placement:"top",maxHeight:k}}if("bottom"===a)return o&&nP(l,M),{placement:"bottom",maxHeight:t};break;case"top":if(x>=p)return{placement:"top",maxHeight:t};if(E>=p&&!i)return o&&rP(l,I,S),{placement:"top",maxHeight:t};if(!i&&E>=r||i&&x>=r){var D=t;return(!i&&E>=r||i&&x>=r)&&(D=i?x-v:E-v),o&&rP(l,I,S),{placement:"top",maxHeight:D}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(a,'".'))}return c}({maxHeight:r,menuEl:e,minHeight:n,placement:a,shouldScroll:s&&!t,isFixedPosition:t,controlHeight:w});m(i.maxHeight),g(i.placement),null==c||c(i.placement)}},[r,a,o,s,n,c,w]),t({ref:u,placerProps:lL(lL({},e),{},{placement:h||hP(a),maxHeight:f})})},yP=function(e,t){var n=e.theme,r=n.spacing.baseUnit,a=n.colors;return lL({textAlign:"center"},t?{}:{color:a.neutral40,padding:"".concat(2*r,"px ").concat(3*r,"px")})},bP=yP,vP=yP,xP=["size"],_P=["innerProps","isRtl","size"],EP={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},NP=function(e){var t=e.size,n=Wz(e,xP);return Yz("svg",(0,_.A)({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:EP},n))},MP=function(e){return Yz(NP,(0,_.A)({size:20},e),Yz("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},IP=function(e){return Yz(NP,(0,_.A)({size:20},e),Yz("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},SP=function(e,t){var n=e.isFocused,r=e.theme,a=r.spacing.baseUnit,o=r.colors;return lL({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*a,":hover":{color:n?o.neutral80:o.neutral40}})},kP=SP,jP=SP,DP=function(){var e=Qz.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(pP||(pP=function(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"]))),CP=function(e){var t=e.delay,n=e.offset;return Yz("span",{css:Qz({animation:"".concat(DP," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},AP=["data"],TP=["innerRef","isDisabled","isHidden","inputClassName"],OP={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},LP={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":lL({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},OP)},zP=function(e){return lL({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},OP)},PP=function(e){var t=e.children,n=e.innerProps;return Yz("div",n,t)},RP={ClearIndicator:function(e){var t=e.children,n=e.innerProps;return Yz("div",(0,_.A)({},Kz(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),t||Yz(MP,null))},Control:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,a=e.innerRef,o=e.innerProps,i=e.menuIsOpen;return Yz("div",(0,_.A)({ref:a},Kz(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":i}),o,{"aria-disabled":n||void 0}),t)},DropdownIndicator:function(e){var t=e.children,n=e.innerProps;return Yz("div",(0,_.A)({},Kz(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),t||Yz(IP,null))},DownChevron:IP,CrossIcon:MP,Group:function(e){var t=e.children,n=e.cx,r=e.getStyles,a=e.getClassNames,o=e.Heading,i=e.headingProps,s=e.innerProps,l=e.label,c=e.theme,u=e.selectProps;return Yz("div",(0,_.A)({},Kz(e,"group",{group:!0}),s),Yz(o,(0,_.A)({},i,{selectProps:u,theme:c,getStyles:r,getClassNames:a,cx:n}),l),Yz("div",null,t))},GroupHeading:function(e){var t=Jz(e);t.data;var n=Wz(t,AP);return Yz("div",(0,_.A)({},Kz(e,"groupHeading",{"group-heading":!0}),n))},IndicatorsContainer:function(e){var t=e.children,n=e.innerProps;return Yz("div",(0,_.A)({},Kz(e,"indicatorsContainer",{indicators:!0}),n),t)},IndicatorSeparator:function(e){var t=e.innerProps;return Yz("span",(0,_.A)({},t,Kz(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,n=e.value,r=Jz(e),a=r.innerRef,o=r.isDisabled,i=r.isHidden,s=r.inputClassName,l=Wz(r,TP);return Yz("div",(0,_.A)({},Kz(e,"input",{"input-container":!0}),{"data-value":n||""}),Yz("input",(0,_.A)({className:t({input:!0},s),ref:a,style:zP(i),disabled:o},l)))},LoadingIndicator:function(e){var t=e.innerProps,n=e.isRtl,r=e.size,a=void 0===r?4:r,o=Wz(e,_P);return Yz("div",(0,_.A)({},Kz(lL(lL({},o),{},{innerProps:t,isRtl:n,size:a}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),Yz(CP,{delay:0,offset:n}),Yz(CP,{delay:160,offset:!0}),Yz(CP,{delay:320,offset:!n}))},Menu:function(e){var t=e.children,n=e.innerRef,r=e.innerProps;return Yz("div",(0,_.A)({},Kz(e,"menu",{menu:!0}),{ref:n},r),t)},MenuList:function(e){var t=e.children,n=e.innerProps,r=e.innerRef,a=e.isMulti;return Yz("div",(0,_.A)({},Kz(e,"menuList",{"menu-list":!0,"menu-list--is-multi":a}),{ref:r},n),t)},MenuPortal:function(e){var t=e.appendTo,n=e.children,r=e.controlElement,a=e.innerProps,o=e.menuPlacement,s=e.menuPosition,l=(0,i.useRef)(null),c=(0,i.useRef)(null),u=Vz((0,i.useState)(hP(o)),2),d=u[0],f=u[1],m=(0,i.useMemo)(function(){return{setPortalPlacement:f}},[]),p=Vz((0,i.useState)(null),2),h=p[0],g=p[1],w=(0,i.useCallback)(function(){if(r){var e=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(r),t="fixed"===s?0:window.pageYOffset,n=e[d]+t;n===(null==h?void 0:h.offset)&&e.left===(null==h?void 0:h.rect.left)&&e.width===(null==h?void 0:h.rect.width)||g({offset:n,rect:e})}},[r,s,d,null==h?void 0:h.offset,null==h?void 0:h.rect.left,null==h?void 0:h.rect.width]);Zz(function(){w()},[w]);var y=(0,i.useCallback)(function(){"function"==typeof c.current&&(c.current(),c.current=null),r&&l.current&&(c.current=Rn(r,l.current,w,{elementResize:"ResizeObserver"in window}))},[r,w]);Zz(function(){y()},[y]);var b=(0,i.useCallback)(function(e){l.current=e,y()},[y]);if(!t&&"fixed"!==s||!h)return null;var v=Yz("div",(0,_.A)({ref:b},Kz(lL(lL({},e),{},{offset:h.offset,position:s,rect:h.rect}),"menuPortal",{"menu-portal":!0}),a),n);return Yz(gP.Provider,{value:m},t?(0,wn.createPortal)(v,t):v)},LoadingMessage:function(e){var t=e.children,n=void 0===t?"Loading...":t,r=e.innerProps,a=Wz(e,mP);return Yz("div",(0,_.A)({},Kz(lL(lL({},a),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},NoOptionsMessage:function(e){var t=e.children,n=void 0===t?"No options":t,r=e.innerProps,a=Wz(e,fP);return Yz("div",(0,_.A)({},Kz(lL(lL({},a),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},MultiValue:function(e){var t=e.children,n=e.components,r=e.data,a=e.innerProps,o=e.isDisabled,i=e.removeProps,s=e.selectProps,l=n.Container,c=n.Label,u=n.Remove;return Yz(l,{data:r,innerProps:lL(lL({},Kz(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":o})),a),selectProps:s},Yz(c,{data:r,innerProps:lL({},Kz(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:s},t),Yz(u,{data:r,innerProps:lL(lL({},Kz(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},i),selectProps:s}))},MultiValueContainer:PP,MultiValueLabel:PP,MultiValueRemove:function(e){var t=e.children,n=e.innerProps;return Yz("div",(0,_.A)({role:"button"},n),t||Yz(MP,{size:14}))},Option:function(e){var t=e.children,n=e.isDisabled,r=e.isFocused,a=e.isSelected,o=e.innerRef,i=e.innerProps;return Yz("div",(0,_.A)({},Kz(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":a}),{ref:o,"aria-disabled":n},i),t)},Placeholder:function(e){var t=e.children,n=e.innerProps;return Yz("div",(0,_.A)({},Kz(e,"placeholder",{placeholder:!0}),n),t)},SelectContainer:function(e){var t=e.children,n=e.innerProps,r=e.isDisabled,a=e.isRtl;return Yz("div",(0,_.A)({},Kz(e,"container",{"--is-disabled":r,"--is-rtl":a}),n),t)},SingleValue:function(e){var t=e.children,n=e.isDisabled,r=e.innerProps;return Yz("div",(0,_.A)({},Kz(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),t)},ValueContainer:function(e){var t=e.children,n=e.innerProps,r=e.isMulti,a=e.hasValue;return Yz("div",(0,_.A)({},Kz(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":a}),n),t)}},UP=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function BP(e,t){return e===t||!(!UP(e)||!UP(t))}function FP(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!BP(e[n],t[n]))return!1;return!0}for(var YP={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},QP=function(e){return Yz("span",(0,_.A)({css:YP},e))},VP={guidance:function(e){var t=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,a=e.context,o=e.isInitialFocus;switch(a){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return o?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var t=e.action,n=e.label,r=void 0===n?"":n,a=e.labels,o=e.isDisabled;switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(a.length>1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return"option ".concat(r,o?" is disabled. Select another option.":", selected.");default:return""}},onFocus:function(e){var t=e.context,n=e.focused,r=e.options,a=e.label,o=void 0===a?"":a,i=e.selectValue,s=e.isDisabled,l=e.isSelected,c=e.isAppleDevice,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&i)return"value ".concat(o," focused, ").concat(u(i,n),".");if("menu"===t&&c){var d=s?" disabled":"",f="".concat(l?" selected":"").concat(d);return"".concat(o).concat(f,", ").concat(u(r,n),".")}return""},onFilter:function(e){var t=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(t?" for search term "+t:"",".")}},WP=function(e){var t=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,a=e.focusableOptions,o=e.isFocused,s=e.selectValue,l=e.selectProps,c=e.id,u=e.isAppleDevice,d=l.ariaLiveMessages,f=l.getOptionLabel,m=l.inputValue,p=l.isMulti,h=l.isOptionDisabled,g=l.isSearchable,w=l.menuIsOpen,y=l.options,b=l.screenReaderStatus,v=l.tabSelectsValue,x=l.isLoading,_=l["aria-label"],E=l["aria-live"],N=(0,i.useMemo)(function(){return lL(lL({},VP),d||{})},[d]),M=(0,i.useMemo)(function(){var e,n="";if(t&&N.onChange){var r=t.option,a=t.options,o=t.removedValue,i=t.removedValues,l=t.value,c=o||r||(e=l,Array.isArray(e)?null:e),u=c?f(c):"",d=a||i||void 0,m=d?d.map(f):[],p=lL({isDisabled:c&&h(c,s),label:u,labels:m},t);n=N.onChange(p)}return n},[t,N,h,s,f]),I=(0,i.useMemo)(function(){var e="",t=n||r,o=!!(n&&s&&s.includes(n));if(t&&N.onFocus){var i={focused:t,label:f(t),isDisabled:h(t,s),isSelected:o,options:a,context:t===n?"menu":"value",selectValue:s,isAppleDevice:u};e=N.onFocus(i)}return e},[n,r,f,h,N,a,s,u]),S=(0,i.useMemo)(function(){var e="";if(w&&y.length&&!x&&N.onFilter){var t=b({count:a.length});e=N.onFilter({inputValue:m,resultsMessage:t})}return e},[a,m,w,N,y,b,x]),k="initial-input-focus"===(null==t?void 0:t.action),j=(0,i.useMemo)(function(){var e="";if(N.guidance){var t=r?"value":w?"menu":"input";e=N.guidance({"aria-label":_,context:t,isDisabled:n&&h(n,s),isMulti:p,isSearchable:g,tabSelectsValue:v,isInitialFocus:k})}return e},[_,n,r,p,h,g,w,N,s,v,k]),D=Yz(i.Fragment,null,Yz("span",{id:"aria-selection"},M),Yz("span",{id:"aria-focused"},I),Yz("span",{id:"aria-results"},S),Yz("span",{id:"aria-guidance"},j));return Yz(i.Fragment,null,Yz(QP,{id:c},k&&D),Yz(QP,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},o&&!k&&D))},ZP=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],GP=new RegExp("["+ZP.map(function(e){return e.letters}).join("")+"]","g"),HP={},$P=0;$P<ZP.length;$P++)for(var XP=ZP[$P],qP=0;qP<XP.letters.length;qP++)HP[XP.letters[qP]]=XP.base;var JP=function(e){return e.replace(GP,function(e){return HP[e]})},KP=function(e,t){void 0===t&&(t=FP);var n=null;function r(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var o=e.apply(this,r);return n={lastResult:o,lastArgs:r,lastThis:this},o}return r.clear=function(){n=null},r}(JP),eR=function(e){return e.replace(/^\s+|\s+$/g,"")},tR=function(e){return"".concat(e.label," ").concat(e.value)},nR=["innerRef"];function rR(e){var t=e.innerRef,n=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var a=Object.entries(e).filter(function(e){var t=Vz(e,1)[0];return!n.includes(t)});return a.reduce(function(e,t){var n=Vz(t,2),r=n[0],a=n[1];return e[r]=a,e},{})}(Wz(e,nR),"onExited","in","enter","exit","appear");return Yz("input",(0,_.A)({ref:t},n,{css:Qz({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var aR=["boxSizing","height","overflow","paddingRight","position"],oR={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function iR(e){e.cancelable&&e.preventDefault()}function sR(e){e.stopPropagation()}function lR(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function cR(){return"ontouchstart"in window||navigator.maxTouchPoints}var uR=!("undefined"==typeof window||!window.document||!window.document.createElement),dR=0,fR={capture:!1,passive:!1},mR=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},pR={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function hR(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,a=function(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,a=e.onTopArrive,o=e.onTopLeave,s=(0,i.useRef)(!1),l=(0,i.useRef)(!1),c=(0,i.useRef)(0),u=(0,i.useRef)(null),d=(0,i.useCallback)(function(e,t){if(null!==u.current){var i=u.current,c=i.scrollTop,d=i.scrollHeight,f=i.clientHeight,m=u.current,p=t>0,h=d-f-c,g=!1;h>t&&s.current&&(r&&r(e),s.current=!1),p&&l.current&&(o&&o(e),l.current=!1),p&&t>h?(n&&!s.current&&n(e),m.scrollTop=d,g=!0,s.current=!0):!p&&-t>c&&(a&&!l.current&&a(e),m.scrollTop=0,g=!0,l.current=!0),g&&function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()}(e)}},[n,r,a,o]),f=(0,i.useCallback)(function(e){d(e,e.deltaY)},[d]),m=(0,i.useCallback)(function(e){c.current=e.changedTouches[0].clientY},[]),p=(0,i.useCallback)(function(e){var t=c.current-e.changedTouches[0].clientY;d(e,t)},[d]),h=(0,i.useCallback)(function(e){if(e){var t=!!cP&&{passive:!1};e.addEventListener("wheel",f,t),e.addEventListener("touchstart",m,t),e.addEventListener("touchmove",p,t)}},[p,m,f]),g=(0,i.useCallback)(function(e){e&&(e.removeEventListener("wheel",f,!1),e.removeEventListener("touchstart",m,!1),e.removeEventListener("touchmove",p,!1))},[p,m,f]);return(0,i.useEffect)(function(){if(t){var e=u.current;return h(e),function(){g(e)}}},[t,h,g]),function(e){u.current=e}}({isEnabled:void 0===r||r,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}),o=function(e){var t=e.isEnabled,n=e.accountForScrollbars,r=void 0===n||n,a=(0,i.useRef)({}),o=(0,i.useRef)(null),s=(0,i.useCallback)(function(e){if(uR){var t=document.body,n=t&&t.style;if(r&&aR.forEach(function(e){var t=n&&n[e];a.current[e]=t}),r&&dR<1){var o=parseInt(a.current.paddingRight,10)||0,i=document.body?document.body.clientWidth:0,s=window.innerWidth-i+o||0;Object.keys(oR).forEach(function(e){var t=oR[e];n&&(n[e]=t)}),n&&(n.paddingRight="".concat(s,"px"))}t&&cR()&&(t.addEventListener("touchmove",iR,fR),e&&(e.addEventListener("touchstart",lR,fR),e.addEventListener("touchmove",sR,fR))),dR+=1}},[r]),l=(0,i.useCallback)(function(e){if(uR){var t=document.body,n=t&&t.style;dR=Math.max(dR-1,0),r&&dR<1&&aR.forEach(function(e){var t=a.current[e];n&&(n[e]=t)}),t&&cR()&&(t.removeEventListener("touchmove",iR,fR),e&&(e.removeEventListener("touchstart",lR,fR),e.removeEventListener("touchmove",sR,fR)))}},[r]);return(0,i.useEffect)(function(){if(t){var e=o.current;return s(e),function(){l(e)}}},[t,s,l]),function(e){o.current=e}}({isEnabled:n});return Yz(i.Fragment,null,n&&Yz("div",{onClick:mR,css:pR}),t(function(e){a(e),o(e)}))}var gR={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},wR=function(e){var t=e.name,n=e.onFocus;return Yz("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:gR,value:"",onChange:function(){}})};function yR(e){var t;return"undefined"!=typeof window&&null!=window.navigator&&e.test((null===(t=window.navigator.userAgentData)||void 0===t?void 0:t.platform)||window.navigator.platform)}function bR(){return yR(/^Mac/i)}var vR={clearIndicator:jP,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var n=e.isDisabled,r=e.isFocused,a=e.theme,o=a.colors,i=a.borderRadius;return lL({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:n?o.neutral5:o.neutral0,borderColor:n?o.neutral10:r?o.primary:o.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:r?o.primary:o.neutral30}})},dropdownIndicator:kP,group:function(e,t){var n=e.theme.spacing;return t?{}:{paddingBottom:2*n.baseUnit,paddingTop:2*n.baseUnit}},groupHeading:function(e,t){var n=e.theme,r=n.colors,a=n.spacing;return lL({label:"group",cursor:"default",display:"block"},t?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*a.baseUnit,paddingRight:3*a.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var n=e.isDisabled,r=e.theme,a=r.spacing.baseUnit,o=r.colors;return lL({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:n?o.neutral10:o.neutral20,marginBottom:2*a,marginTop:2*a})},input:function(e,t){var n=e.isDisabled,r=e.value,a=e.theme,o=a.spacing,i=a.colors;return lL(lL({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},LP),t?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:i.neutral80})},loadingIndicator:function(e,t){var n=e.isFocused,r=e.size,a=e.theme,o=a.colors,i=a.spacing.baseUnit;return lL({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},t?{}:{color:n?o.neutral60:o.neutral20,padding:2*i})},loadingMessage:vP,menu:function(e,t){var n,r=e.placement,a=e.theme,o=a.borderRadius,i=a.spacing,s=a.colors;return lL((iL(n={label:"menu"},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(r),"100%"),iL(n,"position","absolute"),iL(n,"width","100%"),iL(n,"zIndex",1),n),t?{}:{backgroundColor:s.neutral0,borderRadius:o,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:i.menuGutter,marginTop:i.menuGutter})},menuList:function(e,t){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return lL({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:r,paddingTop:r})},menuPortal:function(e){var t=e.rect,n=e.offset,r=e.position;return{left:t.left,position:r,top:n,width:t.width,zIndex:1}},multiValue:function(e,t){var n=e.theme,r=n.spacing,a=n.borderRadius,o=n.colors;return lL({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:o.neutral10,borderRadius:a/2,margin:r.baseUnit/2})},multiValueLabel:function(e,t){var n=e.theme,r=n.borderRadius,a=n.colors,o=e.cropWithEllipsis;return lL({overflow:"hidden",textOverflow:o||void 0===o?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:r/2,color:a.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var n=e.theme,r=n.spacing,a=n.borderRadius,o=n.colors,i=e.isFocused;return lL({alignItems:"center",display:"flex"},t?{}:{borderRadius:a/2,backgroundColor:i?o.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:o.dangerLight,color:o.danger}})},noOptionsMessage:bP,option:function(e,t){var n=e.isDisabled,r=e.isFocused,a=e.isSelected,o=e.theme,i=o.spacing,s=o.colors;return lL({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:a?s.primary:r?s.primary25:"transparent",color:n?s.neutral20:a?s.neutral0:"inherit",padding:"".concat(2*i.baseUnit,"px ").concat(3*i.baseUnit,"px"),":active":{backgroundColor:n?void 0:a?s.primary:s.primary50}})},placeholder:function(e,t){var n=e.theme,r=n.spacing,a=n.colors;return lL({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:a.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},singleValue:function(e,t){var n=e.isDisabled,r=e.theme,a=r.spacing,o=r.colors;return lL({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:n?o.neutral40:o.neutral80,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},valueContainer:function(e,t){var n=e.theme.spacing,r=e.isMulti,a=e.hasValue,o=e.selectProps.controlShouldRenderValue;return lL({alignItems:"center",display:r&&a&&o?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(2*n.baseUnit,"px")})}},xR={borderRadius:4,colors:{primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},_R={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:oP(),captureMenuScroll:!oP(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var n=lL({ignoreCase:!0,ignoreAccents:!0,stringify:tR,trim:!0,matchFrom:"any"},void 0),r=n.ignoreCase,a=n.ignoreAccents,o=n.stringify,i=n.trim,s=n.matchFrom,l=i?eR(t):t,c=i?eR(o(e)):o(e);return r&&(l=l.toLowerCase(),c=c.toLowerCase()),a&&(l=KP(l),c=JP(c)),"start"===s?c.substr(0,l.length)===l:c.indexOf(l)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function ER(e,t,n,r){return{type:"option",data:t,isDisabled:CR(e,t,n),isSelected:AR(e,t,n),label:jR(e,t),value:DR(e,t),index:r}}function NR(e,t){return e.options.map(function(n,r){if("options"in n){var a=n.options.map(function(n,r){return ER(e,n,t,r)}).filter(function(t){return SR(e,t)});return a.length>0?{type:"group",data:n,options:a,index:r}:void 0}var o=ER(e,n,t,r);return SR(e,o)?o:void 0}).filter(uP)}function MR(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,hL(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function IR(e,t){return e.reduce(function(e,n){return"group"===n.type?e.push.apply(e,hL(n.options.map(function(e){return{data:e.data,id:"".concat(t,"-").concat(n.index,"-").concat(e.index)}}))):e.push({data:n.data,id:"".concat(t,"-").concat(n.index)}),e},[])}function SR(e,t){var n=e.inputValue,r=void 0===n?"":n,a=t.data,o=t.isSelected,i=t.label,s=t.value;return(!OR(e)||!o)&&TR(e,{label:i,value:s,data:a},r)}var kR=function(e,t){var n;return(null===(n=e.find(function(e){return e.data===t}))||void 0===n?void 0:n.id)||null},jR=function(e,t){return e.getOptionLabel(t)},DR=function(e,t){return e.getOptionValue(t)};function CR(e,t,n){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,n)}function AR(e,t,n){if(n.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,n);var r=DR(e,t);return n.some(function(t){return DR(e,t)===r})}function TR(e,t,n){return!e.filterOption||e.filterOption(t,n)}var OR=function(e){var t=e.hideSelectedOptions,n=e.isMulti;return void 0===t?n:t},LR=1,zR=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,uL.A)(e,t)}(n,e);var t=function(e){var t=fL();return function(){var n,r=dL(e);if(t){var a=dL(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return function(e,t){if(t&&("object"==aL(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,n)}}(n);function n(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(r=t.call(this,e)).state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(e){r.controlRef=e},r.focusedOptionRef=null,r.getFocusedOptionRef=function(e){r.focusedOptionRef=e},r.menuListRef=null,r.getMenuListRef=function(e){r.menuListRef=e},r.inputRef=null,r.getInputRef=function(e){r.inputRef=e},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(e,t){var n=r.props,a=n.onChange,o=n.name;t.name=o,r.ariaOnChange(e,t),a(e,t)},r.setValue=function(e,t,n){var a=r.props,o=a.closeMenuOnSelect,i=a.isMulti,s=a.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:s}),o&&(r.setState({inputIsHiddenAfterUpdate:!i}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(e,{action:t,option:n})},r.selectOption=function(e){var t=r.props,n=t.blurInputOnSelect,a=t.isMulti,o=t.name,i=r.state.selectValue,s=a&&r.isOptionSelected(e,i),l=r.isOptionDisabled(e,i);if(s){var c=r.getOptionValue(e);r.setValue(i.filter(function(e){return r.getOptionValue(e)!==c}),"deselect-option",e)}else{if(l)return void r.ariaOnChange(e,{action:"select-option",option:e,name:o});a?r.setValue([].concat(hL(i),[e]),"select-option",e):r.setValue(e,"select-option")}n&&r.blurInput()},r.removeValue=function(e){var t=r.props.isMulti,n=r.state.selectValue,a=r.getOptionValue(e),o=n.filter(function(e){return r.getOptionValue(e)!==a}),i=dP(t,o,o[0]||null);r.onChange(i,{action:"remove-value",removedValue:e}),r.focusInput()},r.clearValue=function(){var e=r.state.selectValue;r.onChange(dP(r.props.isMulti,[],null),{action:"clear",removedValues:e})},r.popValue=function(){var e=r.props.isMulti,t=r.state.selectValue,n=t[t.length-1],a=t.slice(0,t.length-1),o=dP(e,a,a[0]||null);n&&r.onChange(o,{action:"pop-value",removedValue:n})},r.getFocusedOptionId=function(e){return kR(r.state.focusableOptionsWithIds,e)},r.getFocusableOptionsWithIds=function(){return IR(NR(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Xz.apply(void 0,[r.props.classNamePrefix].concat(t))},r.getOptionLabel=function(e){return jR(r.props,e)},r.getOptionValue=function(e){return DR(r.props,e)},r.getStyles=function(e,t){var n=r.props.unstyled,a=vR[e](t,n);a.boxSizing="border-box";var o=r.props.styles[e];return o?o(a,t):a},r.getClassNames=function(e,t){var n,a;return null===(n=(a=r.props.classNames)[e])||void 0===n?void 0:n.call(a,t)},r.getElementId=function(e){return"".concat(r.state.instancePrefix,"-").concat(e)},r.getComponents=function(){return e=r.props,lL(lL({},RP),e.components);var e},r.buildCategorizedOptions=function(){return NR(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return MR(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(e,t){r.setState({ariaSelection:lL({value:e},t)})},r.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(e){r.blockOptionHover=!1},r.onControlMouseDown=function(e){if(!e.defaultPrevented){var t=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&r.onMenuClose():t&&r.openMenu("first"):(t&&(r.openAfterFocus=!0),r.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},r.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button||r.props.isDisabled)){var t=r.props,n=t.isMulti,a=t.menuIsOpen;r.focusInput(),a?(r.setState({inputIsHiddenAfterUpdate:!n}),r.onMenuClose()):r.openMenu("first"),e.preventDefault()}},r.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(r.clearValue(),e.preventDefault(),r.openAfterFocus=!1,"touchend"===e.type?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(e){"boolean"==typeof r.props.closeMenuOnScroll?e.target instanceof HTMLElement&&eP(e.target)&&r.props.onMenuClose():"function"==typeof r.props.closeMenuOnScroll&&r.props.closeMenuOnScroll(e)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(e){var t=e.touches,n=t&&t.item(0);n&&(r.initialTouchX=n.clientX,r.initialTouchY=n.clientY,r.userIsDragging=!1)},r.onTouchMove=function(e){var t=e.touches,n=t&&t.item(0);if(n){var a=Math.abs(n.clientX-r.initialTouchX),o=Math.abs(n.clientY-r.initialTouchY);r.userIsDragging=a>5||o>5}},r.onTouchEnd=function(e){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(e.target)&&r.menuListRef&&!r.menuListRef.contains(e.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(e){r.userIsDragging||r.onControlMouseDown(e)},r.onClearIndicatorTouchEnd=function(e){r.userIsDragging||r.onClearIndicatorMouseDown(e)},r.onDropdownIndicatorTouchEnd=function(e){r.userIsDragging||r.onDropdownIndicatorMouseDown(e)},r.handleInputChange=function(e){var t=r.props.inputValue,n=e.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(n,{action:"input-change",prevInputValue:t}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(e){r.props.onFocus&&r.props.onFocus(e),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(e){var t=r.props.inputValue;r.menuListRef&&r.menuListRef.contains(document.activeElement)?r.inputRef.focus():(r.props.onBlur&&r.props.onBlur(e),r.onInputChange("",{action:"input-blur",prevInputValue:t}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1}))},r.onOptionHover=function(e){if(!r.blockOptionHover&&r.state.focusedOption!==e){var t=r.getFocusableOptions().indexOf(e);r.setState({focusedOption:e,focusedOptionId:t>-1?r.getFocusedOptionId(e):null})}},r.shouldHideSelectedOptions=function(){return OR(r.props)},r.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),r.focus()},r.onKeyDown=function(e){var t=r.props,n=t.isMulti,a=t.backspaceRemovesValue,o=t.escapeClearsValue,i=t.inputValue,s=t.isClearable,l=t.isDisabled,c=t.menuIsOpen,u=t.onKeyDown,d=t.tabSelectsValue,f=t.openMenuOnFocus,m=r.state,p=m.focusedOption,h=m.focusedValue,g=m.selectValue;if(!(l||"function"==typeof u&&(u(e),e.defaultPrevented))){switch(r.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||i)return;r.focusValue("previous");break;case"ArrowRight":if(!n||i)return;r.focusValue("next");break;case"Delete":case"Backspace":if(i)return;if(h)r.removeValue(h);else{if(!a)return;n?r.popValue():s&&r.clearValue()}break;case"Tab":if(r.isComposing)return;if(e.shiftKey||!c||!d||!p||f&&r.isOptionSelected(p,g))return;r.selectOption(p);break;case"Enter":if(229===e.keyCode)break;if(c){if(!p)return;if(r.isComposing)return;r.selectOption(p);break}return;case"Escape":c?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:i}),r.onMenuClose()):s&&o&&r.clearValue();break;case" ":if(i)return;if(!c){r.openMenu("first");break}if(!p)return;r.selectOption(p);break;case"ArrowUp":c?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":c?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!c)return;r.focusOption("pageup");break;case"PageDown":if(!c)return;r.focusOption("pagedown");break;case"Home":if(!c)return;r.focusOption("first");break;case"End":if(!c)return;r.focusOption("last");break;default:return}e.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++LR),r.state.selectValue=qz(e.value),e.menuIsOpen&&r.state.selectValue.length){var a=r.getFocusableOptionsWithIds(),o=r.buildFocusableOptions(),i=o.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=a,r.state.focusedOption=o[i],r.state.focusedOptionId=kR(a,o[i])}return r}return function(e,t,n){t&&cL(e.prototype,t),n&&cL(e,n),Object.defineProperty(e,"prototype",{writable:!1})}(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&aP(this.menuListRef,this.focusedOptionRef),(bR()||yR(/^iPhone/i)||yR(/^iPad/i)||bR()&&navigator.maxTouchPoints>1)&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(e){var t=this.props,n=t.isDisabled,r=t.menuIsOpen,a=this.state.isFocused;(a&&!n&&e.isDisabled||a&&r&&!e.menuIsOpen)&&this.focusInput(),a&&n&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):a||n||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(aP(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,n=this.state,r=n.selectValue,a=n.isFocused,o=this.buildFocusableOptions(),i="first"===e?0:o.length-1;if(!this.props.isMulti){var s=o.indexOf(r[0]);s>-1&&(i=s)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:o[i],focusedOptionId:this.getFocusedOptionId(o[i])},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,n=t.selectValue,r=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var a=n.indexOf(r);r||(a=-1);var o=n.length-1,i=-1;if(n.length){switch(e){case"previous":i=0===a?0:-1===a?o:a-1;break;case"next":a>-1&&a<o&&(i=a+1)}this.setState({inputIsHidden:-1!==i,focusedValue:n[i]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state.focusedOption,r=this.getFocusableOptions();if(r.length){var a=0,o=r.indexOf(n);n||(o=-1),"up"===e?a=o>0?o-1:r.length-1:"down"===e?a=(o+1)%r.length:"pageup"===e?(a=o-t)<0&&(a=0):"pagedown"===e?(a=o+t)>r.length-1&&(a=r.length-1):"last"===e&&(a=r.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:r[a],focusedValue:null,focusedOptionId:this.getFocusedOptionId(r[a])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(xR):lL(lL({},xR),this.props.theme):xR}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,n=this.getStyles,r=this.getClassNames,a=this.getValue,o=this.selectOption,i=this.setValue,s=this.props,l=s.isMulti,c=s.isRtl,u=s.options;return{clearValue:e,cx:t,getStyles:n,getClassNames:r,getValue:a,hasValue:this.hasValue(),isMulti:l,isRtl:c,options:u,selectOption:o,selectProps:s,setValue:i,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e,t){return CR(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return AR(this.props,e,t)}},{key:"filterOption",value:function(e,t){return TR(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,r=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:r})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,r=e.inputId,a=e.inputValue,o=e.tabIndex,s=e.form,l=e.menuIsOpen,c=e.required,u=this.getComponents().Input,d=this.state,f=d.inputIsHidden,m=d.ariaSelection,p=this.commonProps,h=r||this.getElementId("input"),g=lL(lL(lL({"aria-autocomplete":"list","aria-expanded":l,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":c,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},l&&{"aria-controls":this.getElementId("listbox")}),!n&&{"aria-readonly":!0}),this.hasValue()?"initial-input-focus"===(null==m?void 0:m.action)&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return n?i.createElement(u,(0,_.A)({},p,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:h,innerRef:this.getInputRef,isDisabled:t,isHidden:f,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:o,form:s,type:"text",value:a},g)):i.createElement(rR,(0,_.A)({id:h,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Hz,onFocus:this.onInputFocus,disabled:t,tabIndex:o,inputMode:"none",form:s,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),n=t.MultiValue,r=t.MultiValueContainer,a=t.MultiValueLabel,o=t.MultiValueRemove,s=t.SingleValue,l=t.Placeholder,c=this.commonProps,u=this.props,d=u.controlShouldRenderValue,f=u.isDisabled,m=u.isMulti,p=u.inputValue,h=u.placeholder,g=this.state,w=g.selectValue,y=g.focusedValue,b=g.isFocused;if(!this.hasValue()||!d)return p?null:i.createElement(l,(0,_.A)({},c,{key:"placeholder",isDisabled:f,isFocused:b,innerProps:{id:this.getElementId("placeholder")}}),h);if(m)return w.map(function(t,s){var l=t===y,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return i.createElement(n,(0,_.A)({},c,{components:{Container:r,Label:a,Remove:o},isFocused:l,isDisabled:f,key:u,index:s,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(p)return null;var v=w[0];return i.createElement(s,(0,_.A)({},c,{data:v,isDisabled:f}),this.formatOptionLabel(v,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,a=n.isLoading,o=this.state.isFocused;if(!this.isClearable()||!e||r||!this.hasValue()||a)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return i.createElement(e,(0,_.A)({},t,{innerProps:s,isFocused:o}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,n=this.props,r=n.isDisabled,a=n.isLoading,o=this.state.isFocused;return e&&a?i.createElement(e,(0,_.A)({},t,{innerProps:{"aria-hidden":"true"},isDisabled:r,isFocused:o})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var r=this.commonProps,a=this.props.isDisabled,o=this.state.isFocused;return i.createElement(n,(0,_.A)({},r,{isDisabled:a,isFocused:o}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,r=this.state.isFocused,a={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return i.createElement(e,(0,_.A)({},t,{innerProps:a,isDisabled:n,isFocused:r}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),n=t.Group,r=t.GroupHeading,a=t.Menu,o=t.MenuList,s=t.MenuPortal,l=t.LoadingMessage,c=t.NoOptionsMessage,u=t.Option,d=this.commonProps,f=this.state.focusedOption,m=this.props,p=m.captureMenuScroll,h=m.inputValue,g=m.isLoading,w=m.loadingMessage,y=m.minMenuHeight,b=m.maxMenuHeight,v=m.menuIsOpen,x=m.menuPlacement,E=m.menuPosition,N=m.menuPortalTarget,M=m.menuShouldBlockScroll,I=m.menuShouldScrollIntoView,S=m.noOptionsMessage,k=m.onMenuScrollToTop,j=m.onMenuScrollToBottom;if(!v)return null;var D,C=function(t,n){var r=t.type,a=t.data,o=t.isDisabled,s=t.isSelected,l=t.label,c=t.value,m=f===a,p=o?void 0:function(){return e.onOptionHover(a)},h=o?void 0:function(){return e.selectOption(a)},g="".concat(e.getElementId("option"),"-").concat(n),w={id:g,onClick:h,onMouseMove:p,onMouseOver:p,tabIndex:-1,role:"option","aria-selected":e.state.isAppleDevice?void 0:s};return i.createElement(u,(0,_.A)({},d,{innerProps:w,data:a,isDisabled:o,isSelected:s,key:g,label:l,type:r,value:c,isFocused:m,innerRef:m?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())D=this.getCategorizedOptions().map(function(t){if("group"===t.type){var a=t.data,o=t.options,s=t.index,l="".concat(e.getElementId("group"),"-").concat(s),c="".concat(l,"-heading");return i.createElement(n,(0,_.A)({},d,{key:l,data:a,options:o,Heading:r,headingProps:{id:c,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return C(e,"".concat(s,"-").concat(e.index))}))}if("option"===t.type)return C(t,"".concat(t.index))});else if(g){var A=w({inputValue:h});if(null===A)return null;D=i.createElement(l,d,A)}else{var T=S({inputValue:h});if(null===T)return null;D=i.createElement(c,d,T)}var O={minMenuHeight:y,maxMenuHeight:b,menuPlacement:x,menuPosition:E,menuShouldScrollIntoView:I},L=i.createElement(wP,(0,_.A)({},d,O),function(t){var n=t.ref,r=t.placerProps,s=r.placement,l=r.maxHeight;return i.createElement(a,(0,_.A)({},d,O,{innerRef:n,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:s}),i.createElement(hR,{captureEnabled:p,onTopArrive:k,onBottomArrive:j,lockEnabled:M},function(t){return i.createElement(o,(0,_.A)({},d,{innerRef:function(n){e.getMenuListRef(n),t(n)},innerProps:{role:"listbox","aria-multiselectable":d.isMulti,id:e.getElementId("listbox")},isLoading:g,maxHeight:l,focusedOption:f}),D)}))});return N||"fixed"===E?i.createElement(s,(0,_.A)({},d,{appendTo:N,controlElement:this.controlRef,menuPlacement:x,menuPosition:E}),L):L}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,r=t.isDisabled,a=t.isMulti,o=t.name,s=t.required,l=this.state.selectValue;if(s&&!this.hasValue()&&!r)return i.createElement(wR,{name:o,onFocus:this.onValueInputFocus});if(o&&!r){if(a){if(n){var c=l.map(function(t){return e.getOptionValue(t)}).join(n);return i.createElement("input",{name:o,type:"hidden",value:c})}var u=l.length>0?l.map(function(t,n){return i.createElement("input",{key:"i-".concat(n),name:o,type:"hidden",value:e.getOptionValue(t)})}):i.createElement("input",{name:o,type:"hidden",value:""});return i.createElement("div",null,u)}var d=l[0]?this.getOptionValue(l[0]):"";return i.createElement("input",{name:o,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,n=t.ariaSelection,r=t.focusedOption,a=t.focusedValue,o=t.isFocused,s=t.selectValue,l=this.getFocusableOptions();return i.createElement(WP,(0,_.A)({},e,{id:this.getElementId("live-region"),ariaSelection:n,focusedOption:r,focusedValue:a,isFocused:o,selectValue:s,focusableOptions:l,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,n=e.IndicatorsContainer,r=e.SelectContainer,a=e.ValueContainer,o=this.props,s=o.className,l=o.id,c=o.isDisabled,u=o.menuIsOpen,d=this.state.isFocused,f=this.commonProps=this.getCommonProps();return i.createElement(r,(0,_.A)({},f,{className:s,innerProps:{id:l,onKeyDown:this.onKeyDown},isDisabled:c,isFocused:d}),this.renderLiveRegion(),i.createElement(t,(0,_.A)({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:c,isFocused:d,menuIsOpen:u}),i.createElement(a,(0,_.A)({},f,{isDisabled:c}),this.renderPlaceholderOrValue(),this.renderInput()),i.createElement(n,(0,_.A)({},f,{isDisabled:c}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(e,t){var n=t.prevProps,r=t.clearFocusValueOnUpdate,a=t.inputIsHiddenAfterUpdate,o=t.ariaSelection,i=t.isFocused,s=t.prevWasFocused,l=t.instancePrefix,c=e.options,u=e.value,d=e.menuIsOpen,f=e.inputValue,m=e.isMulti,p=qz(u),h={};if(n&&(u!==n.value||c!==n.options||d!==n.menuIsOpen||f!==n.inputValue)){var g=d?function(e,t){return MR(NR(e,t))}(e,p):[],w=d?IR(NR(e,p),"".concat(l,"-option")):[],y=r?function(e,t){var n=e.focusedValue,r=e.selectValue.indexOf(n);if(r>-1){if(t.indexOf(n)>-1)return n;if(r<t.length)return t[r]}return null}(t,p):null,b=function(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}(t,g);h={selectValue:p,focusedOption:b,focusedOptionId:kR(w,b),focusableOptionsWithIds:w,focusedValue:y,clearFocusValueOnUpdate:!1}}var v=null!=a&&e!==n?{inputIsHidden:a,inputIsHiddenAfterUpdate:void 0}:{},x=o,_=i&&s;return i&&!_&&(x={value:dP(m,p,p[0]||null),options:p,action:"initial-input-focus"},_=!s),"initial-input-focus"===(null==o?void 0:o.action)&&(x=null),lL(lL(lL({},h),v),{},{prevProps:e,ariaSelection:x,prevWasFocused:_})}}]),n}(i.Component);zR.defaultProps=_R;var PR=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"],RR=["defaultOptions","cacheOptions","loadOptions","options","isLoading","onInputChange","filterOption"],UR=(0,i.forwardRef)(function(e,t){var n=function(e){var t=e.defaultOptions,n=void 0!==t&&t,r=e.cacheOptions,a=void 0!==r&&r,o=e.loadOptions;e.options;var s=e.isLoading,l=void 0!==s&&s,c=e.onInputChange,u=e.filterOption,d=void 0===u?null:u,f=Wz(e,RR),m=f.inputValue,p=(0,i.useRef)(void 0),h=(0,i.useRef)(!1),g=Vz((0,i.useState)(Array.isArray(n)?n:void 0),2),w=g[0],y=g[1],b=Vz((0,i.useState)(void 0!==m?m:""),2),v=b[0],x=b[1],_=Vz((0,i.useState)(!0===n),2),E=_[0],N=_[1],M=Vz((0,i.useState)(void 0),2),I=M[0],S=M[1],k=Vz((0,i.useState)([]),2),j=k[0],D=k[1],C=Vz((0,i.useState)(!1),2),A=C[0],T=C[1],O=Vz((0,i.useState)({}),2),L=O[0],z=O[1],P=Vz((0,i.useState)(void 0),2),R=P[0],U=P[1],B=Vz((0,i.useState)(void 0),2),F=B[0],Y=B[1];a!==F&&(z({}),Y(a)),n!==R&&(y(Array.isArray(n)?n:void 0),U(n)),(0,i.useEffect)(function(){return h.current=!0,function(){h.current=!1}},[]);var Q=(0,i.useCallback)(function(e,t){if(!o)return t();var n=o(e,t);n&&"function"==typeof n.then&&n.then(t,function(){return t()})},[o]);(0,i.useEffect)(function(){!0===n&&Q(v,function(e){h.current&&(y(e||[]),N(!!p.current))})},[]);var V=(0,i.useCallback)(function(e,t){var n=function(e,t,n){if(n){var r=n(e,t);if("string"==typeof r)return r}return e}(e,t,c);if(!n)return p.current=void 0,x(""),S(""),D([]),N(!1),void T(!1);if(a&&L[n])x(n),S(n),D(L[n]),N(!1),T(!1);else{var r=p.current={};x(n),N(!0),T(!I),Q(n,function(e){h&&r===p.current&&(p.current=void 0,N(!1),S(n),D(e||[]),T(!1),z(e?lL(lL({},L),{},iL({},n,e)):L))})}},[a,Q,I,L,c]),W=A?[]:v&&I?j:w||[];return lL(lL({},f),{},{options:W,isLoading:E||l,onInputChange:V,filterOption:d})}(e),r=function(e){var t=e.defaultInputValue,n=void 0===t?"":t,r=e.defaultMenuIsOpen,a=void 0!==r&&r,o=e.defaultValue,s=void 0===o?null:o,l=e.inputValue,c=e.menuIsOpen,u=e.onChange,d=e.onInputChange,f=e.onMenuClose,m=e.onMenuOpen,p=e.value,h=Wz(e,PR),g=Vz((0,i.useState)(void 0!==l?l:n),2),w=g[0],y=g[1],b=Vz((0,i.useState)(void 0!==c?c:a),2),v=b[0],x=b[1],_=Vz((0,i.useState)(void 0!==p?p:s),2),E=_[0],N=_[1],M=(0,i.useCallback)(function(e,t){"function"==typeof u&&u(e,t),N(e)},[u]),I=(0,i.useCallback)(function(e,t){var n;"function"==typeof d&&(n=d(e,t)),y(void 0!==n?n:e)},[d]),S=(0,i.useCallback)(function(){"function"==typeof m&&m(),x(!0)},[m]),k=(0,i.useCallback)(function(){"function"==typeof f&&f(),x(!1)},[f]),j=void 0!==l?l:w,D=void 0!==c?c:v,C=void 0!==p?p:E;return lL(lL({},h),{},{inputValue:j,menuIsOpen:D,onChange:M,onInputChange:I,onMenuClose:k,onMenuOpen:S,value:C})}(n);return i.createElement(zR,(0,_.A)({ref:t},r))}),BR=UR;const FR=e=>e.isSelected?"#F3F4F6":e.isFocused?"#F9FAFB":"transparent",YR=function(e){const{label:t,name:n,desc:r,value:a,tooltip:s,placeholder:l,onChangeCB:c,options:u,isMulti:d=!1,isSearchable:f=!0,attr:m}=e,[p,h]=(0,i.useState)(a);(0,i.useEffect)(()=>{h(a)},[a]);const g={control:e=>({...e,borderColor:"#E5E7EB",boxShadow:"","&:hover":{borderColor:"none"}}),option:(e,t)=>({...e,backgroundColor:FR(t),color:"#111827",cursor:"pointer","&:active":{backgroundColor:"#F3F4F6"}})};return(0,o.createElement)("div",{className:"wcf-select2-field"},(0,o.createElement)("div",{className:"wcf-selection-field"},t&&(0,o.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-text-primary mb-2"},(0,o.createElement)("label",null,t,s&&(0,o.createElement)(iQ,{text:s}))),(0,o.createElement)(BR,(0,_.A)({className:"wcf-select2-input",classNamePrefix:"wcf",name:n,isClearable:!0,value:p,getOptionLabel:e=>e.label,getOptionValue:e=>e.value,loadOptions:e=>new Promise(t=>{setTimeout(()=>{t((e=>u.filter(t=>t.label.toLowerCase().includes(e.toLowerCase())))(e))},1e3)}),onChange:t=>{h(t);const n=new CustomEvent("wcf:select2:change",{bubbles:!0,detail:{e:{},name:e.name,value:t}});document.dispatchEvent(n),c&&c(t)},placeholder:l,defaultOptions:u,cacheOptions:!0,isMulti:d,delimiter:d?",":void 0,styles:g,isSearchable:f},m))),r&&(0,o.createElement)("div",{className:"wcf-field__desc text-sm font-regular"},fh(r)))};var QR=a(5901);const VR=(0,i.createContext)(),WR=({reducer:e,initialState:t,children:n})=>(0,o.createElement)(VR.Provider,{value:(0,i.useReducer)(e,t)},n),ZR=()=>(0,i.useContext)(VR);function GR({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"}))}const HR=i.forwardRef(GR);function $R({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 14.25 6-6m4.5-3.493V21.75l-3.75-1.5-3.75 1.5-3.75-1.5-3.75 1.5V4.757c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0 1 11.186 0c1.1.128 1.907 1.077 1.907 2.185ZM9.75 9h.008v.008H9.75V9Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm4.125 4.5h.008v.008h-.008V13.5Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const XR=i.forwardRef($R);function qR({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v12m-3-2.818.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const JR=i.forwardRef(qR);function KR({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 12.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5ZM12 18.75a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5Z"}))}const eU=i.forwardRef(KR);function tU({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const nU=i.forwardRef(tU);function rU({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const aU=i.forwardRef(rU);function oU({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 iU=i.forwardRef(oU),sU=function(e){const[{options:t},n]=ZR(),{index:r,field_name:a,product_data:s,productOptdata:l}=e,c=""===s.discount_type?"disable":"enable",[u,d]=(0,i.useState)(c),[f,m]=(0,i.useState)(s.discount_type),[p,h]=(0,i.useState)(s.discount_value||""),[g,w]=(0,i.useState)(!1),[y,b]=(0,i.useState)(l.product_name||""),[v,x]=(0,i.useState)(l.product_subtext||""),[_,E]=(0,i.useState)(l.highlight_text||""),[N,M]=(0,i.useState)("yes"===l.enable_highlight),I=t["wcf-checkout-products"],S=t["wcf-product-options"],k=t["wcf-enable-product-options"],j=r===I.length-1;(0,i.useEffect)(()=>{m(s.discount_type),h(s.discount_value||"")},[s.discount_type,s.discount_value]),(0,i.useEffect)(()=>{b(l.product_name||""),x(l.product_subtext||""),E(l.highlight_text||""),M("yes"===l.enable_highlight)},[l.product_name,l.product_subtext,l.highlight_text,l.enable_highlight]);const D=[{value:"",label:(0,z.__)("Original","cartflows"),icon:(0,o.createElement)(HR,{className:"w-4 h-4"})},{value:"discount_percent",label:(0,z.__)("Percentage","cartflows"),icon:(0,o.createElement)(XR,{className:"w-4 h-4"})},{value:"discount_price",label:(0,z.__)("Price","cartflows"),icon:(0,o.createElement)(JR,{className:"w-4 h-4"})}],C=D.find(e=>e.value===f)||D[0];return function(){const e=s.discount_type,t=parseFloat(s.discount_value),n=parseFloat(s.regular_price);let r=0;"discount_percent"===e?t>0&&(r=n-n*t/100):"discount_price"===e&&t>0&&(r=n-t),s.sell_price=r.toFixed(2)}(),(0,o.createElement)("div",{key:s.unique_id},(0,o.createElement)("div",{className:`wcf-product-selection--selected-product flex items-center p-3 gap-3 ${function(){let e="";return"yes"===l.add_to_cart?e+=g?"relative border-[0.5px] border-b-0 border-solid border-brand-300 bg-brand-25 ":"relative border-[0.5px] border-solid border-brand-300 bg-brand-25 ":e+=g?"border-[0.5px] border-b-0 border-solid border-border-subtle bg-background-secondary ":"border-[0.5px] border-solid border-border-subtle bg-background-secondary ",e+=j&&!g?" rounded-b-md":"",e}()}`},(0,o.createElement)("div",{className:"wcf-product-selection--product-title whitespace-nowrap text-sm font-medium text-text-primary w-1/2"},(0,o.createElement)("div",{className:"flex gap-3 items-center"},(0,o.createElement)("div",{className:"wcf-product-selection--sortable-toggle flex cursor-move text-text-tertiary"},(0,o.createElement)(eU,{className:"w-6 h-6 stroke-1","aria-hidden":"true"}),(0,o.createElement)(eU,{className:"w-6 h-6 stroke-1 -ml-4","aria-hidden":"true"})),(0,o.createElement)("div",{className:"wcf-product-selection--product-image w-20 h-20"},(0,o.createElement)("img",{src:s&&s.img_url?s.img_url:cartflows_admin.image_placeholder,className:"product-image rounded-md w-full h-full aspect-{3/2} object-contain",alt:fh(s.name)})),(0,o.createElement)("div",{className:"wcf-product-selection--product-title_text cursor-default"},(0,o.createElement)("div",{className:"wcf-product-repeater-field__title whitespace-normal text-left","data-product_id":s.product},fh(s.name)),(0,o.createElement)("div",{className:"wcf-product-repeater-field__reg-price mt-1"},(0,o.createElement)("div",{className:"flex gap-2"},(0,o.createElement)("span",{className:"wcf-product--reg-price "+("enable"===c&&0<s.discount_value?"line-through text-text-tertiary":""),title:(0,z.__)("Regular Price of the product","cartflows")},cartflows_admin.woo_currency+s.regular_price),"enable"===c&&0<s.discount_value&&(0,o.createElement)("span",{className:"wcf-product--sale-price",title:(0,z.__)("Price after discount.","cartflows")},cartflows_admin.woo_currency+s.sell_price)))))),(0,o.createElement)("div",{className:"wcf-product-selection--set-default whitespace-nowrap text-sm text-text-secondary w-[10%] flex justify-center items-center"},function(e){let a="";return wcfCartflowsPro()&&"yes"===k?"force-all"===S?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(bO,{size:"sm",value:!0,disabled:!0,name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`}),(0,o.createElement)("input",{type:"hidden",name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`,value:"yes"})):"single-selection"===S?(("yes"===e.add_to_cart||e.chosen)&&(a=e.unique_id),(0,o.createElement)(MO.Group,{name:"wcf_default_add_to_cart[]",value:a,onChange:()=>{t["wcf-checkout-products"][r].add_to_cart="yes",t["wcf-product-options-data"]={[e.unique_id]:{add_to_cart:"yes"}}},style:"simple",size:"sm",columns:1},(0,o.createElement)(MO.Button,{value:e.unique_id,hideSelection:!1,minWidth:!1,buttonWrapperClasses:"p-0 flex items-center justify-center"}))):"multiple-selection"===S?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(bO,{size:"sm",value:"yes"===e.add_to_cart,onChange:r=>{n({type:"SET_OPTION",name:"wcf-product-options-data",value:{...t["wcf-product-options-data"],[e.unique_id]:{...t["wcf-product-options-data"]?.[e.unique_id],add_to_cart:r?"yes":"no"}}})}}),(0,o.createElement)("input",{type:"hidden",name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`,value:e.add_to_cart})):void 0:(0,o.createElement)(o.Fragment,null,(0,o.createElement)(bO,{size:"sm",value:!0,disabled:!0,name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`}),(0,o.createElement)("input",{type:"hidden",name:`wcf-product-options-data[${e.unique_id}][add_to_cart]`,value:"yes"}))}(l)),(0,o.createElement)("div",{className:"wcf-product-selection--product-qty whitespace-nowrap text-sm text-text-secondary w-[10%]"},(0,o.createElement)("div",{className:"w-16 shrink-0"},(0,o.createElement)(dp,{type:"number",size:"md",name:`wcf-checkout-products[${r}][quantity]`,value:s.quantity,min:1,onChange:e=>{const t=[...I];t[r]={...t[r],quantity:parseInt(e,10)||1},n({type:"UPDATE_CHECKOUT_PRODUCTS",field_name:a,products:t})}}))),(0,o.createElement)("div",{className:"wcf-product-selection--product-discount flex items-center gap-2 whitespace-nowrap text-sm text-text-secondary w-2/3"},(0,o.createElement)("input",{type:"hidden",name:`wcf-checkout-products[${r}][discount_type]`,value:f}),(0,o.createElement)("div",{className:"w-16 shrink-0"},(0,o.createElement)(dp,{type:"number",size:"md",name:`wcf-checkout-products[${r}][discount_value]`,value:"disable"===u?"":p,disabled:"disable"===u,placeholder:"disable"===u?"":"0",min:1,step:"any",onChange:e=>h(e)})),(0,o.createElement)(Nm,{placement:"bottom-start"},(0,o.createElement)(Nm.Trigger,null,(0,o.createElement)("button",{type:"button",className:"appearance-none bg-background-primary border border-solid border-border-subtle shadow-sm rounded-md h-10 w-[130px] px-2 py-2 flex items-center justify-between gap-1 cursor-pointer focus:outline-none focus:ring-2 focus:ring-brand-600 focus:ring-offset-2"},(0,o.createElement)("span",{className:"flex items-center gap-1"},(0,o.createElement)("span",{className:"size-4 shrink-0 flex items-center"},C.icon),(0,o.createElement)("span",{className:"text-sm font-normal text-text-primary"},C.label)),(0,o.createElement)(hm,{className:"size-3.5 shrink-0 text-icon-secondary"}))),(0,o.createElement)(Nm.ContentWrapper,{className:"z-50"},(0,o.createElement)(Nm.Content,null,(0,o.createElement)(Nm.List,null,D.map(e=>(0,o.createElement)(Nm.Item,{key:e.value,active:f===e.value,onClick:()=>{m(e.value),function(e,t,n){d(""===n?"disable":"enable")}(0,0,e.value)}},(0,o.createElement)("span",{className:"flex items-center gap-2 text-sm"},e.icon,e.label)))))))),(0,o.createElement)("div",{className:"wcf-product-selection-actions flex gap-2 relative whitespace-nowrap text-right text-sm font-medium w-[10%] justify-center"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(nU,{className:"w-4 h-4"}),onClick:()=>w(!g),className:`${"yes"===k?"visible":"invisible"} ${g?"bg-brand-50 text-brand-500":""}`,type:"button"}),(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(aU,{className:"w-4 h-4"}),onClick:function(){const e=s.unique_id;e&&n({type:"REMOVE_CHECKOUT_PRODUCT",field_name:a,unique_id:e})},"data-index":r,type:"button",className:"text-icon-secondary hover:text-support-error"})),(0,o.createElement)("input",{name:`wcf-checkout-products[${r}][product]`,type:"hidden",className:"wcf-checkout-product-id",value:s.product}),(0,o.createElement)("input",{name:`wcf-checkout-products[${r}][unique_id]`,type:"hidden",className:"wcf-checkout-product-unique",value:s.unique_id})),g&&(0,o.createElement)("div",{className:"wcf-product-field-item-settings flex flex-col gap-5 p-6 bg-background-primary "+(g&&"yes"===l.add_to_cart?"border-[0.5px] border-t-0 border-solid border-brand-300":"border-[0.5px] border-t-0 border-solid border-border-subtle"),id:"product-option-index-"+r,"data-id":s.product_id},(0,o.createElement)("div",{className:"flex flex-col gap-1.5"},(0,o.createElement)(dp,{name:`wcf-product-options-data[${l.unique_id}][product_name]`,label:(0,z.__)("Product Name","cartflows"),value:y,size:"md",onChange:e=>b(e)}),(0,o.createElement)(Qf,{variant:"help",size:"sm",tag:"p"},(0,o.createElement)(iU,null),(0,z.__)("Use {{product_name}} and {{quantity}} to dynamically fetch respective product details.","cartflows"))),(0,o.createElement)("div",{className:"flex flex-col gap-1.5"},(0,o.createElement)(dp,{name:`wcf-product-options-data[${l.unique_id}][product_subtext]`,label:(0,z.__)("Subtext","cartflows"),value:v,size:"md",onChange:e=>x(e)}),(0,o.createElement)(Qf,{variant:"help",size:"sm",tag:"p"},(0,o.createElement)(iU,null),(0,z.__)("Use {{quantity}}, {{discount_value}}, {{discount_percent}} to dynamically fetch respective product details.","cartflows"))),(0,o.createElement)("div",{className:"flex"},(0,o.createElement)(fO,{id:`wcf-product-options-data-enable-highlight-${l.unique_id}`,checked:N,label:{heading:(0,z.__)("Enable Highlight","cartflows")},size:"sm",onChange:e=>M(e)})),(0,o.createElement)("input",{type:"hidden",name:`wcf-product-options-data[${l.unique_id}][enable_highlight]`,value:N?"yes":"no"}),(0,o.createElement)("div",{className:N?"":"hidden"},(0,o.createElement)(dp,{name:`wcf-product-options-data[${l.unique_id}][highlight_text]`,label:(0,z.__)("Highlight Text","cartflows"),value:_,size:"md",onChange:e=>E(e)})),(0,o.createElement)("input",{name:`wcf-product-options-data[${l.unique_id}][unique_id]`,type:"hidden",className:"wcf-product-options-unique-id",value:l.unique_id})))},lU=function(){return(0,o.createElement)("a",{className:"wcf-create-new-product text-sm font-medium text-brand-500 hover:text-brand-600 inline-flex items-center gap-1.5 cursor-pointer mt-5 w-full focus:outline-none focus:ring-0 focus:text-brand-500 no-underline",rel:"noreferrer",target:"_blank",href:cartflows_admin.create_product_src},(0,o.createElement)(KO,{className:"w-4 h-4 stroke-2","aria-hidden":"true"}),(0,z.__)("Create New Product","cartflows"))},cU=function(e){const[{options:t},n]=ZR(),{name:r,value:a}=e,s=t[r],[l,c]=(0,i.useState)(),[u,d]=(0,i.useState)(""),[f,m]=(0,i.useState)(!1),p=(0,z.__)("Add","cartflows"),[h,g]=(0,i.useState)({isInProcessing:!1,buttonText:p}),{isInProcessing:w,buttonText:y}=h,b=t["wcf-product-options"],v=t["wcf-product-options-data"];(0,i.useEffect)(()=>(n({type:"UPDATE_CHECKOUT_PRODUCTS",field_name:r,products:a}),()=>{}),[]);let x=0;const _=wcfCartflowsPro()?function(){const e={};v&&Object.keys(v).map(t=>{const n=v[t];return e[t]={...n},""});const t=[],n={enable_highlight:"no",highlight_text:"",product_name:"",product_subtext:"",add_to_cart:"yes"};return x=0,s.map(function(r){if(r?.unique_id){let a={...n};const o=r.unique_id;e[o]&&(a={...e[o]}),a.product_id=r?.product,a.product_name=a.product_name?a.product_name:r?.name,a.product_title=r?.name,a.unique_id=r.unique_id,"single-selection"!==b&&(a.add_to_cart=a.add_to_cart?a.add_to_cart:"yes"),"single-selection"===b&&(a.add_to_cart&&"no"!==a.add_to_cart&&x++,e[o]||(a.add_to_cart="no")),t.push(a)}return"single-selection"===b&&0===x&&(t[0].add_to_cart="yes"),""}),t}():[];return(0,o.createElement)("div",{className:"wcf-checkout-product-selection-field"},s&&0===s.length&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("input",{name:"wcf-checkout-products",type:"hidden",value:""}),(0,o.createElement)("div",{className:"flex flex-col items-center justify-center py-8 px-4 border border-dashed border-border-subtle rounded-lg bg-background-secondary"},(0,o.createElement)(th,{size:"sm",className:"text-text-tertiary text-center"},(0,z.__)("No products added yet. Search and add products below.","cartflows")))),s&&s.length>0&&(0,o.createElement)("div",{className:"border border-solid border-border-subtle rounded-lg"},(0,o.createElement)("div",{className:"wcf-product-selection--header bg-background-secondary border-b border-border-subtle flex items-center gap-3 p-3"},(0,o.createElement)(th,{size:"xs",weight:"medium",className:"text-text-secondary w-2/5"},(0,z.__)("Product","cartflows")),(0,o.createElement)(th,{size:"xs",weight:"medium",className:"text-text-secondary w-[10%] text-center"},(0,z.__)("Default","cartflows")),(0,o.createElement)(th,{size:"xs",weight:"medium",className:"text-text-secondary w-[10%] text-center"},(0,z.__)("Qty","cartflows")),(0,o.createElement)(th,{size:"xs",weight:"medium",className:"text-text-secondary w-2/3"},(0,z.__)("Discount","cartflows")),(0,o.createElement)("div",{className:"w-[10%]"})),(0,o.createElement)(QR.ReactSortable,{list:s,setList:e=>n({type:"UPDATE_CHECKOUT_PRODUCTS",field_name:r,products:e}),direction:"vertical",filter:".wcf-field, .wcf-product-selection-actions",preventOnFilter:!1,className:"wcf-checkout-product-selection-field__content"},s.map((e,t)=>("yes"===e.add_to_cart&&x++,(0,o.createElement)(sU,{key:e.unique_id,index:t,field_name:r,product_data:e,productOptdata:_.length>0?_[t]:[]}))))),(0,o.createElement)("div",{className:"wcf-checkout-product-selection-field__add-new flex items-end gap-3 mt-8"},(0,o.createElement)("div",{className:"flex-1"},(0,o.createElement)(nQ,{name:"",desc:"",class:f?"border border-brand-600":"",field:"product",value:u,allowed_products:"",include_products:"braintree-subscription, braintree-variable-subscription",excluded_products:"grouped",excluded_product_ids:cartflows_admin?.restrict_duplicate_checkout_products?(s||[]).map(e=>Number(e.product)):[],placeholder:(0,z.__)("Search for a Product","cartflows"),onChangeCB:c})),(0,o.createElement)(Va,{type:"button",variant:"outline",size:"md",icon:(0,o.createElement)(KO,{className:"w-4 h-4"}),iconPosition:"left",loading:w,disabled:w,onClick:function(e){const a=l?.value;a?(e.target.blur(),g({isInProcessing:!0,buttonText:(0,z.__)("Adding…","cartflows")}),L()({path:`/cartflows/v1/admin/product-data/${a}`}).then(e=>{const o={product:a,quantity:"1",discount_type:"",discount_value:"",unique_id:Math.random().toString(36).substring(2,10),name:l?.label,img_url:e?.img_url,regular_price:e?.regular_price};if(n({type:"ADD_CHECKOUT_PRODUCT",field_name:r,product_data:o}),d(null),wcfCartflowsPro()){const e=t["wcf-product-options-data"];e[o.unique_id]={enable_highlight:"no",highlight_text:"",product_name:"",product_subtext:""},n({type:"SET_OPTION",name:"wcf-product-options-data",value:e})}g({isInProcessing:!1,buttonText:p})}),c(null)):(m(!0),e.target.blur(),setTimeout(()=>{m(!1)},3e3))},className:"shrink-0"},y)),f&&(0,o.createElement)(th,{size:"sm",className:"text-support-error mt-1"},(0,z.__)("Please search and select at-least one product to add.","cartflows")),(0,o.createElement)(lU,null))},uU=window.wp.components,dU=function(e){const{name:t,label:n,value:r,isActive:a=!0,tooltip:s,sectionClass:l="",wrapperClass:c="",labelClass:u="",displayAlign:d="horizontal",withBg:f=!1,showOverlay:m=!1}=e,[p,h]=(0,i.useState)(!1),[g,w]=(0,i.useState)(r),[y,b]=(0,i.useState)(!1),v=(0,i.useRef)(null);(0,i.useEffect)(()=>{w(r)},[r]);const x=`wcf-colorpicker-${String(t).replace(/[\[\]]/g,"-")}`,_=l||"text-left",E="horizontal"!==d?"block w-full text-left":c||"flex justify-between items-center gap-2.5",N="horizontal"!==d?`${u||"text-sm font-medium text-text-primary"} mb-2`:`${u||"text-sm font-medium text-text-primary"}`,M=e=>{e.stopPropagation(),document.dispatchEvent(new CustomEvent("closeAllColorPickers",{detail:{name:t}})),h(!p)},I=t=>{const n=t||"";w(n);const r=new CustomEvent("wcf:color:change",{bubbles:!0,detail:{e:"color",name:e.name,value:n}});document.dispatchEvent(r)};return(0,i.useEffect)(()=>{const e=e=>{!v.current||v.current.contains(e.target)||e.target.closest(".wcf-colorpicker-swatch-wrap")||e.target.closest(".wcf-colorpicker-reset")||h(!1)},n=e=>{e.detail.name!==t?h(!1):h(!p)};return document.addEventListener("closeAllColorPickers",n),document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("closeAllColorPickers",n)}},[t]),(0,i.useEffect)(()=>{if(!p)return;const e=e=>{"Escape"===e.key&&h(!1)};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}},[p]),(0,o.createElement)("div",{className:`wcf-field wcf-color-field ${_} ${a?"":"wcf-hide"}`},(0,o.createElement)("div",{className:`wcf-field__data ${E}`},n&&(0,o.createElement)("div",{className:`wcf-field__data--label ${N}`},(0,o.createElement)("label",null,n),s&&(0,o.createElement)(iQ,{text:s})),(0,o.createElement)("div",{className:"wcf-field__data--content "+(f?"bg-background-primary px-2 py-2 !text-sm font-normal !rounded-md text-text-tertiary border border-solid !border-border-subtle w-fit":"")},(0,o.createElement)("div",{className:"wcf-colorpicker-selector flex items-center gap-2 sm:justify-end"},(0,o.createElement)("div",{className:"wcf-colorpicker-swatch-wrap inline-flex items-center bg-background-primary border border-solid border-border-subtle rounded-sm cursor-pointer text-text-tertiary focus-visible:ring-1 focus-visible:ring-border-interactive focus-visible:outline-none overflow-hidden",onClick:M,onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),M(e))},role:"button",tabIndex:"0","aria-haspopup":"true","aria-expanded":p,"aria-controls":x,id:`${x}-trigger`},(0,o.createElement)("span",{className:"wcf-colorpicker-swatch inline-flex items-center justify-center border-0 border-r border-solid border-border-subtle",style:{width:"36px",height:"30px",background:g||"#fafafa",boxShadow:g?"inset 0 0 0 3px #fff":"none"},"aria-hidden":"true"},!g&&(0,o.createElement)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxjaXJjbGUgY3g9IjEwIiBjeT0iMTAiIHI9IjEwIiBmaWxsPSJ1cmwoI2EpIi8+PGNpcmNsZSBjeD0iMTAiIGN5PSIxMCIgcj0iOS41IiBzdHJva2U9IiMxRDI5MzkiIHN0cm9rZS1vcGFjaXR5PSIuMTYiLz48ZGVmcz48cGF0dGVybiBpZD0iYSIgcGF0dGVybkNvbnRlbnRVbml0cz0ib2JqZWN0Qm91bmRpbmdCb3giIHdpZHRoPSIxIiBoZWlnaHQ9IjEiPjx1c2UgeGxpbms6aHJlZj0iI2IiIHRyYW5zZm9ybT0ibWF0cml4KC4wMDk0OCAwIDAgLjAwOTQ4IC0uNjM3IC0uNjQ0KSIvPjwvcGF0dGVybj48aW1hZ2UgaWQ9ImIiIHdpZHRoPSIyNTYiIGhlaWdodD0iMjU2IiB4bGluazpocmVmPSJkYXRhOmltYWdlL3BuZztiYXNlNjQsaVZCT1J3MEtHZ29BQUFBTlNVaEVVZ0FBQVFBQUFBRUFDQVlBQUFCY2NxaG1BQUFBQVhOU1IwSUFyczRjNlFBQUNzVkpSRUZVZUY3dDNiRnRKbHNPUk9GL25yTXhLTUpOUTFrSU1nVkZJRStwcmZPd09WUVpSRTEvNHdzWHpTRVBEMiszcUQ4Zlh6L3ZyK0xmUC8vODU3UDQ4ZGUvLy83dnY4M1BPMS84bS94NWV2NzlBUUFBYWdvSWdMY0JEQUFNaElFVkJGd0hJQUFBQUFBQVFCNkJkUUkrZlFiMC9NOGVBUmtBQTJBQWVmOTdyVGRBQUFBQUFBQ0FQQUxyQktUQXoxYmdwLy8vTXdBR3dBRHkvbWNFWUFEYjc0R2YzZ0dmL3Z3TWdBRXdBQWFRUjRBQk1JQThlMTQrQlQ5dVFBemcrRC9nNlFycStXOHZZUUVBQUl3QWhjS3NHekFBQUFBQUFFQWVnWFVDVXRCYkJSWC8yL2ovK2Z6K2ZjdkwzeVdPQkw1TllQSHY0ZzhBRnBwWTZGSjB3SFVBQVFBQUFBQUE1QkZZSjZBN0ROOHg1Tm0vUHdJekFBYkFBQW9DckRkQUFBQUFBQUNBUEFMckJEUUNHQUh5N0RjQytKYmJoMFErSkNvSWN0MkFqQUJHQUNOQVVjRHJCZ3dBQUFBQUFKQkhZSjJBMXdybWZIY1FlZlgxZHhBTWdBRXdnS0lDMXhzZ0FBQUFBQUJBSG9GMUFsSndDcDVuZjYvZzEvbkhBQmdBQXlnSXNONEFBUUFBQU9ESkFQRG53YnZmcDc1V09PY2JZUXArdmF3RTh5V2ZML21LQ2xvSE1BQUFBQUFBUUI2QmRRS3VYK0tJdnhFZ3I5NlhFUUFBM0lFMEJiUU9ZQ09BRWNBSVVCQUFBTHhHOHhxdEtDQUdkbXRnRElBQk1JQUNZQXlBQVRDQW9vQVlBQVBRZ1lvQ1d1OUFBQUFBQUFBQWNRUUFzSHNONmc3QUhRQUF4L2g1dmRZQkJBQUFBQUFBa0VkZ25ZQm0wTnNaVlB4djQ4OEFHQUFEeVB1ZkVZQUJkSmN3T3VCdEIzeDYvQzBFOFIyRDd4Z0tBMWdIQ0FBQUFBQUFRQjZCZFFJYVlZd3dlZlpiQ3VwdkE3cEVkSWxZRU9TNkFSa0JqQUJHZ0tLQTF3MFlBQUFBQUFBZ2o4QTZBYThWelBudUlQTHE2KzhnR0FBRFlBQkZCYTQzUUFBQUFBQUFnRHdDNndTazRCUTh6LzVld2Evemp3RXdBQVpRRUdDOUFRSUFBQUFBQU9RUldDZmd0WUk1M3dpU1YxOC9nakFBQnNBQWlncGNiNEFBQUFBQUFBQjVCTllKU01FcGVKNzl2WUpmNTUrTlFINlp4eS96RkFTNEx1RDJmQUFBQUFBQWdEd0NMWUdNRUZaaTVkbTN2NWI3T3Y4WkFBTmdBQVdCMWhzZ0FBQUFBQUJBSG9GMUFsNHJtUE9OUUhuMTlTTVFBMkFBREtDb3dQVUdDQUFBQUFBQWtFZGduWUFVbklMbjJkOHIrSFgrTVFBR3dBQUtBcXczUUFBQUFBQUFnRHdDNndTOFZqRG5HMEh5NnV0SEVBYkFBQmhBVVlIckRSQUFBQUFBQUNDUHdEb0JLVGdGejdPL1YvRHIvR01BRElBQkZBUlliNEEyQXRrSVpDTlFBWURyRHQ2ZUR3QUFBQUFBa0VlZ0pkQzZRbmwrZHdoNTlkemZJVEFBQnNBQWlncGVid0FBQUFBQUFBQjVCTllKYUFTeEZUalAvcjlnSy9EbjkrL2Jrd01BQUFEdzVQdzNBaGdCakFBRkFkWU5HQUFBQUFBQUlJL0FPZ0dOQUVhQVBQdmRBYndBd0h2d3BvQUErQmJBUmdBamdCR2dJTmg2QXdRQUFBQUFBTWdqc0U1QUNucXJvT0ovRzM4R3dBQVlRTjcvNXUvQUFBQUFBT0RKQVBqNCtua3ZudjlGNFc0VlR2ekZ2NmxmRzRGc0JMSVJxS2lnZFFBREFBQUFBQURrRVZnbm9MY1lQbVRLcy85K29VZGJmd3lBQVRDQWdnQnRBVjQzSUFBQUFBQUFnRHdDNndTOEpyRHpqU0I1OWZVakNBTmdBQXlncU1EMUJnZ0FBQUFBQUpCSFlKMkFGSnlDNTluZksvaDEvakVBQnNBQUNnS3NOMEFBQUFBQUFJQThBdXNFdkZZdzV4dEI4dXJyUnhBR3dBQVlRRkdCNncwUUFBQUFBQUFnajhBNkFTazRCYyt6djFmdzYveXpFTVJDRUF0QkNnSmNGM0I3UGdBQUFBQUFRQjZCbGtCR0NCdHQ4dXpiLzhNYzEvblBBQmdBQXlnSXRONEFBUUFBQUFBQThnaXNFL0Jhd1p4dkJNcXJyeCtCR0FBRFlBQkZCYTQzUUFBQUFBQUFnRHdDNndTazRCUTh6LzVld2Evemp3RXdBQVpRRUdDOUFRSUFBQUFBQU9RUldDZmd0WUk1M3dpU1YxOC9nakFBQnNBQWlncGNiNEFBQUFBQUFBQjVCTllKU01FcGVKNzl2WUpmNXg4RFlBQU1vQ0RBZWdPMEVjaEdJQnVCQ2dCY2QvRDJmQUFBQUFBQWdEd0NMWUhXRmNyenUwUElxK2YrRG9FQk1BQUdVRlR3ZWdNQUFBQUFBQURJSTdCT1FDT0lyY0I1OXY4Rlc0RS92bjdlbnh3QUFBQ0FKK2UvRWNBSVlBUW9DTEJ1d0FBQUFBQUFBSGtFMWdsb0JEQUM1Tm52RHVBRkFONkROd1VFd0xjQU5nSVlBWXdBQmNIV0d5QUFBQUFBQUVBZWdYVUNVdEJiQlJYLzIvZ3pBQWJBQVBMK04zOEhCZ0FBQUFCUEJzRG45KzliOGZ3dkNuZXJjT0l2L2szOTJnaGtJNUNOUUVVRnJRTVlBQUFBQUFBZ2o4QTZBYjNGOENGVG52MzNDejNhK21NQURJQUJGQVJvQy9DNkFRRUFBQUFBQU9RUldDZmdOWUdkYndUSnE2OGZRUmdBQTJBQVJRV3VOMEFBQUFBQUFJQThBdXNFcE9BVVBNLytYc0d2ODQ4Qk1BQUdVQkJndlFFQ0FBQUFBQURrRVZnbjRMV0NPZDhJa2xkZlA0SXdBQWJBQUlvS1hHK0FBQUFBQUFBQWVRVFdDVWpCS1hpZS9iMkNYK2VmaFNBV2dsZ0lVaERndW9EYjh3RUFBQUFBQVBJSXRBUXlRdGhvazJmZi9oL211TTUvQnNBQUdFQkJvUFVHQ0FBQUFBQUFrRWRnbllEWEN1WjhJMUJlZmYwSXhBQVlBQU1vS25DOUFRSUFBQUFBQU9RUldDY2dCYWZnZWZiM0NuNmRmd3lBQVRDQWdnRHJEUkFBQUFBQUFDQ1B3RG9CcnhYTStVYVF2UHI2RVlRQk1BQUdVRlRnZWdNRUFBQUFBQURJSTdCT1FBcE93ZlBzN3hYOE92OFlBQU5nQUFVQjFodWdqVUEyQXRrSVZBRGd1b08zNXdNQUFBQUFBT1FSYUFtMHJsQ2UzeDFDWGozM2R3Z01nQUV3Z0tLQzF4c0FBQUFBQUFCQUhvRjFBaHBCYkFYT3MvOHYyQXI4K2YzNzl1UUFBQUFBUERuL2pRQkdBQ05BUVlCMUF3WUFBQUFBQU1nanNFNUFJNEFSSU05K2R3QXZBUEFldkNrZ0FMNEZzQkhBQ0dBRUtBaTIzZ0FCQUFBQUFBRHlDS3dUa0lMZUtxajQzOGFmQVRBQUJwRDN2L2s3TUFBQUFBQjRNZ0Erdm43ZWkrZC9VYmhiaFJOLzhXL3ExMFlnRzRGc0JDb3FhQjNBQUFBQUFBQUFlUVRXQ2VndGhnK1o4dXkvWCtqUjFoOERZQUFNb0NCQVc0RFhEUWdBQUFBQUFDQ1B3RG9Ccnduc2ZDTklYbjM5Q01JQUdBQURLQ3B3dlFFQ0FBQUFBQURrRVZnbklBV240SG4yOXdwK25YOE1nQUV3Z0lJQTZ3MFFBQUFBQUFBZ2o4QTZBYThWelBsR2tMejYraEdFQVRBQUJsQlU0SG9EQkFBQUFBQUF5Q093VGtBS1RzSHo3TzhWL0RyL0xBU3hFTVJDa0lJQTF3WGNuZzhBQUFBQUFKQkhvQ1dRRWNKR216ejc5djh3eDNYK013QUd3QUFLQXEwM1FBQUFBQUFBZ0R3QzZ3UzhWakRuRzRIeTZ1dEhJQWJBQUJoQVVZSHJEUkFBQUFBQUFDQ1B3RG9CS1RnRno3Ty9WL0RyL0dNQURJQUJGQVJZYjRBQUFBQUFBQUI1Qk5ZSmVLMWd6amVDNU5YWGp5QU1nQUV3Z0tJQzF4c2dBQUFBQUFCQUhvRjFBbEp3Q3A1bmY2L2cxL25IQUJnQUF5Z0lzTjRBYlFTeUVjaEdvQUlBMXgyOFBSOEFBQUFBQUNDUFFFdWdkWVh5L080UTh1cTV2ME5nQUF5QUFSUVZ2TjRBQUFBQUFBQUE4Z2lzRTlBSVlpdHdudjEvd1ZiZ2o2K2Y5eWNIQUFBQTRNbjVid1F3QWhnQkNnS3NHekFBQUFBQUFFQWVnWFVDR2dHTUFIbjJ1d040QVlEMzRFMEJBZkF0Z0kwQVJnQWpRRUd3OVFZSUFBQUFBQUNRUjJDZGdCVDBWa0hGL3piK0RJQUJNSUM4LzgzZmdRRUFBQURBa3dIdytmMzdWanovaThMZEtwejRpMzlUdnpZQzJRaGtJMUJSUWVzQUJnQUFBQUFBeUNPd1RrQnZNWHpJbEdmLy9VS1B0djRZQUFOZ0FBVUIyZ0s4YmtBQUFBQUFBQUI1Qk5ZSmVFMWc1eHRCOHVyclJ4QUd3QUFZUUZHQjZ3MFFBQUFBQUFBZ2o4QTZBU2s0QmMrenYxZnc2L3hqQUF5QUFSUUVXRytBQUFBQUFBQUFlUVRXQ1hpdFlNNDNndVRWMTQ4Z0RJQUJNSUNpQXRjYklBQUFBQUFBUUI2QmRRSlNjQXFlWjMrdjROZjU5MysraWozaGFMdmRwUUFBQUFCSlJVNUVya0pnZ2c9PSIvPjwvZGVmcz48L3N2Zz4=",alt:"",className:"!w-5 !h-5 opacity-40"})),(0,o.createElement)("span",{className:"wcf-colorpicker-label text-xs font-normal text-text-secondary px-[7px] py-[5px] whitespace-nowrap"},(0,z.__)("Select Color","cartflows")),(0,o.createElement)("input",{type:"hidden",name:t,value:g})),(0,o.createElement)(iQ,{text:(0,z.__)("Reset","cartflows"),classes:"!ml-0",icon:(0,o.createElement)("button",{type:"button",onClick:()=>{g&&(b(!0),setTimeout(()=>b(!1),500),I(""))},disabled:!g,"aria-label":(0,z.__)("Reset color","cartflows"),className:"wcf-colorpicker-reset bg-transparent border-0 p-1.5 cursor-pointer text-text-tertiary hover:text-text-secondary disabled:cursor-not-allowed disabled:opacity-40 disabled:hover:text-text-tertiary focus-visible:ring-1 focus-visible:ring-border-interactive focus-visible:outline-none rounded-sm"},(0,o.createElement)(Wf,{className:`w-4 h-4 stroke-2 transform ${y?"rotate-180":""} transition-transform duration-500`,"aria-hidden":"true"}))})),(0,o.createElement)("div",{className:"wcf-color-picker relative",ref:v},p?(0,o.createElement)("div",{className:"wcf-color-picker-popover absolute z-10 right-0 top-3",id:x},m&&(0,o.createElement)("div",{className:"wcf-color-picker-cover fixed inset-0",onClick:()=>{h(!1)}}),(0,o.createElement)("div",{className:"bg-background-primary shadow-lg relative rounded-md overflow-hidden"},(0,o.createElement)(uU.ColorPicker,{color:g,onChange:I,enableAlpha:!1}))):null))))},fU=e=>e.isSelected?"#F3F4F6":e.isFocused?"#F9FAFB":"transparent",mU=function(e){const{name:t,label:n,value:r,desc:a,tooltip:s,font_weight_name:l="",font_weight_value:c="",sectionClass:u=!1,wrapperClass:d=!1,labelClass:f="",displayAlign:m="horizontal"}=e,p=u||"text-left";let h=d||"flex items-center gap-2.5",g=f||"text-sm font-medium text-text-primary";"horizontal"!==m&&(h="block w-full text-left",g+=" mb-2");const w=cartflows_admin.cf_font_family,y=r||"Default",[b,v]=(0,i.useState)({value:r,label:r&&r.match(/'([^']+)'/)?r.match(/'([^']+)'/)[1]:y}),[x,_]=(0,i.useState)(c),E=function(e){let t=e.value;const n=[];if(void 0===t||""===t)return n.push({value:"",label:"Default"}),n;const r=t.match("'(.*)'"),a={};r&&r[1]&&(t=r[1]);const o={};return cartflows_admin.google_fonts[t]?(cartflows_admin.google_fonts[t].variants.map(e=>(e.includes("italic")||(o[e]=cartflows_admin.font_weights[e]),"")),Object.keys(o).map(e=>{const t=o[e];return n.push({value:e,label:t}),""}),a[t.replace(" ","+")]=o):cartflows_admin.system_fonts[t]&&(cartflows_admin.system_fonts[t].variants.map(e=>(e.includes("italic")||(o[e]=cartflows_admin.font_weights[e]),"")),Object.keys(o).map(e=>{const t=o[e];return n.push({val:e,label:t}),""})),n};let N=E(b);const M={control:(e,t)=>({...e,borderColor:"#E5E7EB",boxShadow:t.isFocused?"none":"",borderRadius:"6px","&:hover":{borderColor:"none"}}),option:(e,t)=>({...e,backgroundColor:fU(t),color:"#111827",cursor:"pointer","&:active":{backgroundColor:"#F3F4F6"}})};return(0,o.createElement)("div",{className:`wcf-field wcf-font-family-field ${p} `},(0,o.createElement)("div",{className:`wcf-field__data ${h}`},n&&(0,o.createElement)("div",{className:`wcf-field__data--label ${g}`},(0,o.createElement)("label",null,n,s&&(0,o.createElement)(iQ,{text:s}))),(0,o.createElement)("div",{className:"wcf-selection-field"},(0,o.createElement)(BR,{name:t,className:"wcf-select2-input",classNamePrefix:"wcf",cacheOptions:!0,defaultOptions:w,value:b,loadOptions:e=>new Promise(t=>{setTimeout(()=>{t((e=>{const t=w[1].options,n=w[2].options,r=w[0];return t.concat(n,r).filter(t=>t.label.toLowerCase().includes(e.toLowerCase()))})(e))},1e3)}),onChange:t=>{v(t);const n=E(t);N=n;const r=new CustomEvent("wcf:font:change",{bubbles:!0,detail:{name:e.name,value:t.value}});document.dispatchEvent(r)},styles:M}))),a&&(0,o.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},fh(a)),""!==l&&(0,o.createElement)("div",{className:"wcf-font-weight-field mt-5"},(0,o.createElement)(WO,{name:l,className:"wcf-select-input",value:x,onChange:function(e){_(e)},options:N,label:"Font Weight",displayAlign:m})))};function pU({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"}))}const hU=i.forwardRef(pU),{__}=wp.i18n,gU=function(e){const{name:t,tooltip:n,value:r,label:a,objName:s,objValue:l,singleButton:c=!1,sectionClass:u="",wrapperClass:d="",labelClass:f,desc:m,descClass:p,displayAlign:h="horizontal"}=e,[g,w]=(0,i.useState)(r),[y,b]=(0,i.useState)(l),[v,x]=(0,i.useState)(!r),_=(0,i.useRef)(null),E=u||"text-left",N=p||"text-sm font-normal text-text-tertiary mt-2";let M=d||"flex items-center gap-2.5",I=f||"text-sm font-medium text-text-primary mb-2";"horizontal"!==h&&(M="block w-full text-left",I+=" mb-2");const S=e=>{e.preventDefault(),_.current||(_.current=wp.media({multiple:!1}),_.current.on("select",function(){const n=_.current.state().get("selection").first().toJSON(),r=n.sizes?.medium?.url||n.url;w(r),b(n),x(!r),k(e,t,r),k(e,s,n)})),_.current.open()},k=(e,t,n)=>{e.preventDefault();const r=new CustomEvent("wcf:image-selector:change",{bubbles:!0,detail:{e,img_obj:t,url:n}});document.dispatchEvent(r)};return(0,o.createElement)("div",{className:`wcf-field wcf-image-selector-field ${E}`},(0,o.createElement)("div",{className:`wcf-field__data ${M}`},a&&(0,o.createElement)("div",{className:`wcf-field__data--label ${I}`},(0,o.createElement)("label",null,a,n&&(0,o.createElement)(iQ,{text:n}))),(0,o.createElement)("div",{className:"wcf-field__data--content"},(0,o.createElement)("div",{className:"wcf-image-selector-field__input p-0"},g&&!v&&(0,o.createElement)("div",{className:"text-center border-solid border-border-muted mb-3 leading-4"},(0,o.createElement)("img",{src:g,className:"saved-image",name:t,width:"150",alt:__("Image Preview","cartflows")})),(0,o.createElement)("input",{type:"hidden",id:t,className:"wcf-image",name:t,value:g}),(0,o.createElement)("input",{type:"hidden",className:"wcf-image-obj",name:s,value:JSON.stringify(y)}),!c&&v&&(0,o.createElement)("div",{className:"mt-2 flex flex-col items-center justify-center gap-3 rounded border border-dashed border-border-subtle hover:border-primary-500 px-6 py-6 cursor-pointer",onClick:S},(0,o.createElement)(hU,{className:"h-5 w-5 text-text-tertiary","aria-hidden":"true"}),(0,o.createElement)(Gp,{direction:"column",align:"center",gap:"xs",className:"text-center"},(0,o.createElement)(th,{as:"p",size:14,weight:500,color:"primary",className:"m-0"},__("Drag and drop or browse files","cartflows")),(0,o.createElement)(th,{as:"p",size:12,color:"secondary",className:"m-0"},__("PNG, JPG, GIF up to 10MB","cartflows")))),(0,o.createElement)(Gp,{gap:"sm",className:"wcf-image-selector-field-buttons m-0 p-0"},c&&(0,o.createElement)(Va,{variant:"outline",size:"sm",className:"wcf-select-image",onClick:S},__(g?"Change Image":"Select Image","cartflows")),g&&(0,o.createElement)(Va,{variant:"outline",size:"sm",className:"wcf-remove-image",onClick:e=>{e.preventDefault(),w(""),x(!0),b(""),k(e,t,""),k(e,s,"")}},__("Remove Image","cartflows")))))),m&&(0,o.createElement)(Gp,{align:"center",gap:"xs",className:`wcf-field__desc ${N}`},(0,o.createElement)(iU,{className:"w-3 h-3 text-text-secondary shrink-0"}),fh(m)))},wU=function(e){const{name:t,id:n,label:r,desc:a,value:s,tooltip:l,placeholder:c,min:u,max:d,width:f,afterfield:m,readonly:p,wrapperClass:h=!1,labelClass:g,sectionClass:w,descClass:y,displayAlign:b="horizontal",step:v="1"}=e,[x,_]=(0,i.useState)(s),E=(0,i.useRef)(null),N=w||"text-left",M=g||"text-sm font-medium text-text-primary mb-2",I=y||"text-sm font-normal text-text-tertiary mt-2";let S=h||"flex items-center gap-2.5";return"horizontal"!==b&&(S="block w-full text-left"),(0,i.useEffect)(()=>{_(s),E.current&&(E.current.value=null!=s?s:"")},[s]),(0,o.createElement)("div",{className:`wcf-field wcf-number-field ${N}`},(0,o.createElement)("div",{className:`wcf-field__data ${S}`},r&&(0,o.createElement)("div",{className:`wcf-field__data--label ${M}`},(0,o.createElement)("label",null,r,l&&(0,o.createElement)(iQ,{text:l}))),(0,o.createElement)("div",{className:"wcf-field__data--content flex items-center"},(0,o.createElement)("input",{type:"hidden",ref:E,className:e.class?e.class:"",defaultValue:null!=x?x:""}),(0,o.createElement)(dp,{type:"number",name:t,value:x,id:n,onChange:function(e){let n=e;if("any"===v&&n?.includes(".")){const[e,t]=n.split(".");t.length>2&&(n=`${e}.${t.substring(0,2)}`)}const r=document.getElementsByName(t);r[0]&&r[0].setAttribute("value",n),E.current&&(E.current.value=n),_(n);const a=new CustomEvent("wcf:number:change",{bubbles:!0,detail:{e:{target:{value:n,name:t}},name:t,value:n}});document.dispatchEvent(a)},placeholder:c,min:u,max:d,readOnly:p,disabled:p,inputMode:"numeric",step:v,style:{width:f},size:"md",className:`${e.class?e.class:"!w-full"}`}),m&&(0,o.createElement)("span",{className:"wcf-field__data--after-field ml-1 font-medium"},m))),a&&(0,o.createElement)("div",{className:`wcf-field__desc ${I}`},fh(a)))},yU=Ua("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),bU=Ua("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),vU=(0,i.createContext)(void 0);function xU(){const e=(0,i.useContext)(vU);if(void 0===e)throw new Error("useDayPicker() must be used within a custom component.");return e}const _U={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function EU(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const NU={date:EU({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:EU({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:EU({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},MU={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function IU(e){return(t,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&e.formattingValues){const t=e.defaultFormattingWidth||e.defaultWidth,a=n?.width?String(n.width):t;r=e.formattingValues[a]||e.formattingValues[t]}else{const t=e.defaultWidth,a=n?.width?String(n.width):e.defaultWidth;r=e.values[a]||e.values[t]}return r[e.argumentCallback?e.argumentCallback(t):t]}}const SU={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:IU({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:IU({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:e=>e-1}),month:IU({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:IU({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:IU({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function kU(e){return(t,n={})=>{const r=n.width,a=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(a);if(!o)return null;const i=o[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(s)?function(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}(s,e=>e.test(i)):function(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}(s,e=>e.test(i));let c;return c=e.valueCallback?e.valueCallback(l):l,c=n.valueCallback?n.valueCallback(c):c,{value:c,rest:t.slice(i.length)}}}const jU={ordinalNumber:(DU={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)},(e,t={})=>{const n=e.match(DU.matchPattern);if(!n)return null;const r=n[0],a=e.match(DU.parsePattern);if(!a)return null;let o=DU.valueCallback?DU.valueCallback(a[0]):a[0];return o=t.valueCallback?t.valueCallback(o):o,{value:o,rest:e.slice(r.length)}}),era:kU({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:kU({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:e=>e+1}),month:kU({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:kU({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:kU({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})};var DU;const CU={code:"en-US",formatDistance:(e,t,n)=>{let r;const a=_U[e];return r="string"==typeof a?a:1===t?a.one:a.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:NU,formatRelative:(e,t,n,r)=>MU[e],localize:SU,match:jU,options:{weekStartsOn:0,firstWeekContainsDate:1}};let AU={};function TU(){return AU}Math.pow(10,8);const OU=6048e5,LU=Symbol.for("constructDateFrom");function zU(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&LU in e?e[LU](t):e instanceof Date?new e.constructor(t):new Date(t)}function PU(e,t){return zU(t||e,e)}function RU(e){const t=PU(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function UU(e,...t){const n=zU.bind(null,e||t.find(e=>"object"==typeof e));return t.map(n)}function BU(e,t){const n=PU(e,t?.in);return n.setHours(0,0,0,0),n}function FU(e,t,n){const[r,a]=UU(n?.in,e,t),o=BU(r),i=BU(a),s=+o-RU(o),l=+i-RU(i);return Math.round((s-l)/864e5)}function YU(e,t){const n=PU(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}function QU(e,t){const n=TU(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=PU(e,t?.in),o=a.getDay(),i=(o<r?7:0)+o-r;return a.setDate(a.getDate()-i),a.setHours(0,0,0,0),a}function VU(e,t){return QU(e,{...t,weekStartsOn:1})}function WU(e,t){const n=PU(e,t?.in),r=n.getFullYear(),a=zU(n,0);a.setFullYear(r+1,0,4),a.setHours(0,0,0,0);const o=VU(a),i=zU(n,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const s=VU(i);return n.getTime()>=o.getTime()?r+1:n.getTime()>=s.getTime()?r:r-1}function ZU(e,t){const n=PU(e,t?.in),r=+VU(n)-+function(e,t){const n=WU(e,t),r=zU(t?.in||e,0);return r.setFullYear(n,0,4),r.setHours(0,0,0,0),VU(r)}(n);return Math.round(r/OU)+1}function GU(e,t){const n=PU(e,t?.in),r=n.getFullYear(),a=TU(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=zU(t?.in||e,0);i.setFullYear(r+1,0,o),i.setHours(0,0,0,0);const s=QU(i,t),l=zU(t?.in||e,0);l.setFullYear(r,0,o),l.setHours(0,0,0,0);const c=QU(l,t);return+n>=+s?r+1:+n>=+c?r:r-1}function HU(e,t){const n=PU(e,t?.in),r=+QU(n,t)-+function(e,t){const n=TU(),r=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,a=GU(e,t),o=zU(t?.in||e,0);return o.setFullYear(a,0,r),o.setHours(0,0,0,0),QU(o,t)}(n,t);return Math.round(r/OU)+1}function $U(e,t){return(e<0?"-":"")+Math.abs(e).toString().padStart(t,"0")}const XU={y(e,t){const n=e.getFullYear(),r=n>0?n:1-n;return $U("yy"===t?r%100:r,t.length)},M(e,t){const n=e.getMonth();return"M"===t?String(n+1):$U(n+1,2)},d:(e,t)=>$U(e.getDate(),t.length),a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(e,t)=>$U(e.getHours()%12||12,t.length),H:(e,t)=>$U(e.getHours(),t.length),m:(e,t)=>$U(e.getMinutes(),t.length),s:(e,t)=>$U(e.getSeconds(),t.length),S(e,t){const n=t.length,r=e.getMilliseconds();return $U(Math.trunc(r*Math.pow(10,n-3)),t.length)}},qU={G:function(e,t,n){const r=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){const t=e.getFullYear(),r=t>0?t:1-t;return n.ordinalNumber(r,{unit:"year"})}return XU.y(e,t)},Y:function(e,t,n,r){const a=GU(e,r),o=a>0?a:1-a;return"YY"===t?$U(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):$U(o,t.length)},R:function(e,t){return $U(WU(e),t.length)},u:function(e,t){return $U(e.getFullYear(),t.length)},Q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return $U(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){const r=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return $U(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){const r=e.getMonth();switch(t){case"M":case"MM":return XU.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){const r=e.getMonth();switch(t){case"L":return String(r+1);case"LL":return $U(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){const a=HU(e,r);return"wo"===t?n.ordinalNumber(a,{unit:"week"}):$U(a,t.length)},I:function(e,t,n){const r=ZU(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):$U(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getDate(),{unit:"date"}):XU.d(e,t)},D:function(e,t,n){const r=function(e,t){const n=PU(e,t?.in);return FU(n,YU(n))+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):$U(r,t.length)},E:function(e,t,n){const r=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){const a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return $U(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){const a=e.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return $U(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,n){const r=e.getDay(),a=0===r?7:r;switch(t){case"i":return String(a);case"ii":return $U(a,t.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const r=e.getHours();let a;switch(a=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,n){const r=e.getHours();let a;switch(a=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",t){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),n.ordinalNumber(t,{unit:"hour"})}return XU.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getHours(),{unit:"hour"}):XU.H(e,t)},K:function(e,t,n){const r=e.getHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):$U(r,t.length)},k:function(e,t,n){let r=e.getHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):$U(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):XU.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getSeconds(),{unit:"second"}):XU.s(e,t)},S:function(e,t){return XU.S(e,t)},X:function(e,t,n){const r=e.getTimezoneOffset();if(0===r)return"Z";switch(t){case"X":return KU(r);case"XXXX":case"XX":return eB(r);default:return eB(r,":")}},x:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"x":return KU(r);case"xxxx":case"xx":return eB(r);default:return eB(r,":")}},O:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+JU(r,":");default:return"GMT"+eB(r,":")}},z:function(e,t,n){const r=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+JU(r,":");default:return"GMT"+eB(r,":")}},t:function(e,t,n){return $U(Math.trunc(+e/1e3),t.length)},T:function(e,t,n){return $U(+e,t.length)}};function JU(e,t=""){const n=e>0?"-":"+",r=Math.abs(e),a=Math.trunc(r/60),o=r%60;return 0===o?n+String(a):n+String(a)+t+$U(o,2)}function KU(e,t){return e%60==0?(e>0?"-":"+")+$U(Math.abs(e)/60,2):eB(e,t)}function eB(e,t=""){const n=e>0?"-":"+",r=Math.abs(e);return n+$U(Math.trunc(r/60),2)+t+$U(r%60,2)}const tB=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},nB=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},rB={p:nB,P:(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return tB(e,t);let o;switch(r){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;default:o=t.dateTime({width:"full"})}return o.replace("{{date}}",tB(r,t)).replace("{{time}}",nB(a,t))}},aB=/^D+$/,oB=/^Y+$/,iB=["D","DD","YY","YYYY"];function sB(e){return e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}const lB=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,cB=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,uB=/^'([^]*?)'?$/,dB=/''/g,fB=/[a-zA-Z]/;function mB(e,t,n){const r=TU(),a=n?.locale??r.locale??CU,o=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0,s=PU(e,n?.in);if(!function(e){return!(!sB(e)&&"number"!=typeof e||isNaN(+PU(e)))}(s))throw new RangeError("Invalid time value");let l=t.match(cB).map(e=>{const t=e[0];return"p"===t||"P"===t?(0,rB[t])(e,a.formatLong):e}).join("").match(lB).map(e=>{if("''"===e)return{isToken:!1,value:"'"};const t=e[0];if("'"===t)return{isToken:!1,value:pB(e)};if(qU[t])return{isToken:!0,value:e};if(t.match(fB))throw new RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});a.localize.preprocessor&&(l=a.localize.preprocessor(s,l));const c={firstWeekContainsDate:o,weekStartsOn:i,locale:a};return l.map(r=>{if(!r.isToken)return r.value;const o=r.value;return(!n?.useAdditionalWeekYearTokens&&function(e){return oB.test(e)}(o)||!n?.useAdditionalDayOfYearTokens&&function(e){return aB.test(e)}(o))&&function(e,t,n){const r=function(e,t,n){const r="Y"===e[0]?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(e,t,n);if(console.warn(r),iB.includes(e))throw new RangeError(r)}(o,t,String(e)),(0,qU[o[0]])(s,o,a.localize,c)}).join("")}function pB(e){const t=e.match(uB);return t?t[1].replace(dB,"'"):e}const hB={...CU,labels:{labelDayButton:(e,t,n,r)=>{let a;a=r&&"function"==typeof r.format?r.format.bind(r):(e,t)=>mB(e,t,{locale:CU,...n});let o=a(e,"PPPP");return t.today&&(o=`Today, ${o}`),t.selected&&(o=`${o}, selected`),o},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:e=>`Week ${e}`,labelYearDropdown:"Choose the Year",labelGrid:(e,t,n)=>{let r;return r=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>mB(e,n,{locale:CU,...t}),r(e,"LLLL yyyy")},labelGridcell:(e,t,n,r)=>{let a;a=r&&"function"==typeof r.format?r.format.bind(r):(e,t)=>mB(e,t,{locale:CU,...n});let o=a(e,"PPPP");return t?.today&&(o=`Today, ${o}`),o},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(e,t,n)=>{let r;return r=n&&"function"==typeof n.format?n.format.bind(n):(e,n)=>mB(e,n,{locale:CU,...t}),r(e,"cccc")}}};Symbol.for("constructDateFrom");const gB={},wB={};function yB(e,t){try{const n=(gB[e]||=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format)(t).split("GMT")[1];return n in wB?wB[n]:vB(n,n.split(":"))}catch{if(e in wB)return wB[e];const t=e?.match(bB);return t?vB(e,t.slice(1)):NaN}}const bB=/([+-]\d\d):?(\d\d)?/;function vB(e,t){const n=+(t[0]||0),r=+(t[1]||0),a=+(t[2]||0)/60;return wB[e]=60*n+r>0?60*n+r+a:60*n-r-a}class xB extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(yB(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),NB(this),EB(this)):this.setTime(Date.now())}static tz(e,...t){return t.length?new xB(...t,e):new xB(Date.now(),e)}withTimeZone(e){return new xB(+this,e)}getTimezoneOffset(){const e=-yB(this.timeZone,this);return e>0?Math.floor(e):Math.ceil(e)}setTime(e){return Date.prototype.setTime.apply(this,arguments),EB(this),+this}[Symbol.for("constructDateFrom")](e){return new xB(+new Date(e),this.timeZone)}}const _B=/^(get|set)(?!UTC)/;function EB(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(60*-yB(e.timeZone,e)))}function NB(e){const t=yB(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);const a=-new Date(+e).getTimezoneOffset(),o=a- -new Date(+r).getTimezoneOffset(),i=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();o&&i&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+o);const s=a-n;s&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);const l=new Date(+e);l.setUTCSeconds(0);const c=a>0?l.getSeconds():(l.getSeconds()-60)%60,u=Math.round(-60*yB(e.timeZone,e))%60;(u||c)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+u),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+u+c));const d=yB(e.timeZone,e),f=d>0?Math.floor(d):Math.ceil(d),m=-new Date(+e).getTimezoneOffset()-f-s;if(f!==n&&m){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+m);const t=yB(e.timeZone,e),n=f-(t>0?Math.floor(t):Math.ceil(t));n&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+n),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+n))}}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!_B.test(e))return;const t=e.replace(_B,"$1UTC");xB.prototype[t]&&(e.startsWith("get")?xB.prototype[e]=function(){return this.internal[t]()}:(xB.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),function(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),NB(e)}(this),+this},xB.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),EB(this),+this}))});class MB extends xB{static tz(e,...t){return t.length?new MB(...t,e):new MB(Date.now(),e)}toISOString(){const[e,t,n]=this.tzComponents(),r=`${e}${t}:${n}`;return this.internal.toISOString().slice(0,-1)+r}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[e,t,n,r]=this.internal.toUTCString().split(" ");return`${e?.slice(0,-1)} ${n} ${t} ${r}`}toTimeString(){const e=this.internal.toUTCString().split(" ")[4],[t,n,r]=this.tzComponents();return`${e} GMT${t}${n}${r} (${function(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}(this.timeZone,this)})`}toLocaleString(e,t){return Date.prototype.toLocaleString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleDateString(e,t){return Date.prototype.toLocaleDateString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}toLocaleTimeString(e,t){return Date.prototype.toLocaleTimeString.call(this,e,{...t,timeZone:t?.timeZone||this.timeZone})}tzComponents(){const e=this.getTimezoneOffset();return[e>0?"-":"+",String(Math.floor(Math.abs(e)/60)).padStart(2,"0"),String(Math.abs(e)%60).padStart(2,"0")]}withTimeZone(e){return new MB(+this,e)}[Symbol.for("constructDateFrom")](e){return new MB(+new Date(e),this.timeZone)}}function IB(e,t,n){const r=PU(e,n?.in);return isNaN(t)?zU(n?.in||e,NaN):t?(r.setDate(r.getDate()+t),r):r}function SB(e,t,n){const r=PU(e,n?.in);if(isNaN(t))return zU(n?.in||e,NaN);if(!t)return r;const a=r.getDate(),o=zU(n?.in||e,r.getTime());return o.setMonth(r.getMonth()+t+1,0),a>=o.getDate()?o:(r.setFullYear(o.getFullYear(),o.getMonth(),a),r)}function kB(e,t,n){const[r,a]=UU(n?.in,e,t);return 12*(r.getFullYear()-a.getFullYear())+(r.getMonth()-a.getMonth())}function jB(e,t){const[n,r]=UU(e,t.start,t.end);return{start:n,end:r}}function DB(e,t){const n=TU(),r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,a=PU(e,t?.in),o=a.getDay(),i=6+(o<r?-7:0)-(o-r);return a.setDate(a.getDate()+i),a.setHours(23,59,59,999),a}function CB(e,t){const n=PU(e,t?.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function AB(e,t){return+PU(e)>+PU(t)}function TB(e,t){return+PU(e)<+PU(t)}function OB(e,t,n){const r=PU(e,n?.in),a=r.getFullYear(),o=r.getDate(),i=zU(n?.in||e,0);i.setFullYear(a,t,15),i.setHours(0,0,0,0);const s=function(e,t){const n=PU(e,t?.in),r=n.getFullYear(),a=n.getMonth(),o=zU(n,0);return o.setFullYear(r,a+1,0),o.setHours(0,0,0,0),o.getDate()}(i);return r.setMonth(t,Math.min(o,s)),r}function LB(e,t){const n=PU(e,t?.in);return n.setDate(1),n.setHours(0,0,0,0),n}function zB(e,t){const n=t.startOfMonth(e),r=n.getDay();return 1===r?n:0===r?t.addDays(n,-6):t.addDays(n,-1*(r-1))}class PB{constructor(e,t){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?MB.tz(this.options.timeZone):new this.Date,this.newDate=(e,t,n)=>this.overrides?.newDate?this.overrides.newDate(e,t,n):this.options.timeZone?new MB(e,t,n,this.options.timeZone):new Date(e,t,n),this.addDays=(e,t)=>this.overrides?.addDays?this.overrides.addDays(e,t):IB(e,t),this.addMonths=(e,t)=>this.overrides?.addMonths?this.overrides.addMonths(e,t):SB(e,t),this.addWeeks=(e,t)=>this.overrides?.addWeeks?this.overrides.addWeeks(e,t):function(e,t,n){return IB(e,7*t,n)}(e,t),this.addYears=(e,t)=>this.overrides?.addYears?this.overrides.addYears(e,t):function(e,t,n){return SB(e,12*t,n)}(e,t),this.differenceInCalendarDays=(e,t)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(e,t):FU(e,t),this.differenceInCalendarMonths=(e,t)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(e,t):kB(e,t),this.eachMonthOfInterval=e=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(e):function(e,t){const{start:n,end:r}=jB(t?.in,e);let a=+n>+r;const o=a?+n:+r,i=a?r:n;i.setHours(0,0,0,0),i.setDate(1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,a=!a);const l=[];for(;+i<=o;)l.push(zU(n,i)),i.setMonth(i.getMonth()+s);return a?l.reverse():l}(e),this.eachYearOfInterval=e=>{const t=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(e):function(e,t){const{start:n,end:r}=jB(t?.in,e);let a=+n>+r;const o=a?+n:+r,i=a?r:n;i.setHours(0,0,0,0),i.setMonth(0,1);let s=t?.step??1;if(!s)return[];s<0&&(s=-s,a=!a);const l=[];for(;+i<=o;)l.push(zU(n,i)),i.setFullYear(i.getFullYear()+s);return a?l.reverse():l}(e),n=new Set(t.map(e=>this.getYear(e)));if(n.size===t.length)return t;const r=[];return n.forEach(e=>{r.push(new Date(e,0,1))}),r},this.endOfBroadcastWeek=e=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(e):function(e,t){const n=zB(e,t),r=function(e,t){const n=t.startOfMonth(e),r=n.getDay()>0?n.getDay():7,a=t.addDays(e,1-r),o=t.addDays(a,34);return t.getMonth(e)===t.getMonth(o)?5:4}(e,t);return t.addDays(n,7*r-1)}(e,this),this.endOfISOWeek=e=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(e):function(e,t){return DB(e,{...t,weekStartsOn:1})}(e),this.endOfMonth=e=>this.overrides?.endOfMonth?this.overrides.endOfMonth(e):CB(e),this.endOfWeek=(e,t)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(e,t):DB(e,this.options),this.endOfYear=e=>this.overrides?.endOfYear?this.overrides.endOfYear(e):function(e,t){const n=PU(e,t?.in),r=n.getFullYear();return n.setFullYear(r+1,0,0),n.setHours(23,59,59,999),n}(e),this.format=(e,t,n)=>{const r=this.overrides?.format?this.overrides.format(e,t,this.options):mB(e,t,this.options);return this.options.numerals&&"latn"!==this.options.numerals?this.replaceDigits(r):r},this.getISOWeek=e=>this.overrides?.getISOWeek?this.overrides.getISOWeek(e):ZU(e),this.getMonth=(e,t)=>this.overrides?.getMonth?this.overrides.getMonth(e,this.options):function(e,t){return PU(e,t?.in).getMonth()}(e,this.options),this.getYear=(e,t)=>this.overrides?.getYear?this.overrides.getYear(e,this.options):function(e,t){return PU(e,t?.in).getFullYear()}(e,this.options),this.getWeek=(e,t)=>this.overrides?.getWeek?this.overrides.getWeek(e,this.options):HU(e,this.options),this.isAfter=(e,t)=>this.overrides?.isAfter?this.overrides.isAfter(e,t):AB(e,t),this.isBefore=(e,t)=>this.overrides?.isBefore?this.overrides.isBefore(e,t):TB(e,t),this.isDate=e=>this.overrides?.isDate?this.overrides.isDate(e):sB(e),this.isSameDay=(e,t)=>this.overrides?.isSameDay?this.overrides.isSameDay(e,t):function(e,t,n){const[r,a]=UU(n?.in,e,t);return+BU(r)===+BU(a)}(e,t),this.isSameMonth=(e,t)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(e,t):function(e,t,n){const[r,a]=UU(n?.in,e,t);return r.getFullYear()===a.getFullYear()&&r.getMonth()===a.getMonth()}(e,t),this.isSameYear=(e,t)=>this.overrides?.isSameYear?this.overrides.isSameYear(e,t):function(e,t,n){const[r,a]=UU(n?.in,e,t);return r.getFullYear()===a.getFullYear()}(e,t),this.max=e=>this.overrides?.max?this.overrides.max(e):function(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=zU.bind(null,e));const t=PU(e,r);(!n||n<t||isNaN(+t))&&(n=t)}),zU(r,n||NaN)}(e),this.min=e=>this.overrides?.min?this.overrides.min(e):function(e,t){let n,r=t?.in;return e.forEach(e=>{r||"object"!=typeof e||(r=zU.bind(null,e));const t=PU(e,r);(!n||n>t||isNaN(+t))&&(n=t)}),zU(r,n||NaN)}(e),this.setMonth=(e,t)=>this.overrides?.setMonth?this.overrides.setMonth(e,t):OB(e,t),this.setYear=(e,t)=>this.overrides?.setYear?this.overrides.setYear(e,t):function(e,t,n){const r=PU(e,n?.in);return isNaN(+r)?zU(n?.in||e,NaN):(r.setFullYear(t),r)}(e,t),this.startOfBroadcastWeek=(e,t)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(e,this):zB(e,this),this.startOfDay=e=>this.overrides?.startOfDay?this.overrides.startOfDay(e):BU(e),this.startOfISOWeek=e=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(e):VU(e),this.startOfMonth=e=>this.overrides?.startOfMonth?this.overrides.startOfMonth(e):LB(e),this.startOfWeek=(e,t)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(e,this.options):QU(e,this.options),this.startOfYear=e=>this.overrides?.startOfYear?this.overrides.startOfYear(e):YU(e),this.options={locale:hB,...e},this.overrides=t}getDigitMap(){const{numerals:e="latn"}=this.options,t=new Intl.NumberFormat("en-US",{numberingSystem:e}),n={};for(let e=0;e<10;e++)n[e.toString()]=t.format(e);return n}replaceDigits(e){const t=this.getDigitMap();return e.replace(/\d/g,e=>t[e]||e)}formatNumber(e){return this.replaceDigits(e.toString())}getMonthYearOrder(){const e=this.options.locale?.code;return e&&PB.yearFirstLocales.has(e)?"year-first":"month-first"}formatMonthYear(e){const{locale:t,timeZone:n,numerals:r}=this.options,a=t?.code;if(a&&PB.yearFirstLocales.has(a))try{return new Intl.DateTimeFormat(a,{month:"long",year:"numeric",timeZone:n,numberingSystem:r}).format(e)}catch{}const o="year-first"===this.getMonthYearOrder()?"y LLLL":"LLLL y";return this.format(e,o)}}PB.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const RB=new PB;var UB,BB,FB,YB;function QB(e,t,n=!1,r=RB){let{from:a,to:o}=e;const{differenceInCalendarDays:i,isSameDay:s}=r;return a&&o?(i(o,a)<0&&([a,o]=[o,a]),i(t,a)>=(n?1:0)&&i(o,t)>=(n?1:0)):!n&&o?s(o,t):!(n||!a)&&s(a,t)}function VB(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}function WB(e){return Boolean(e&&"object"==typeof e&&"from"in e)}function ZB(e){return Boolean(e&&"object"==typeof e&&"after"in e)}function GB(e){return Boolean(e&&"object"==typeof e&&"before"in e)}function HB(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}function $B(e,t){return Array.isArray(e)&&e.every(t.isDate)}function XB(e,t,n=RB){const r=Array.isArray(t)?t:[t],{isSameDay:a,differenceInCalendarDays:o,isAfter:i}=n;return r.some(t=>{if("boolean"==typeof t)return t;if(n.isDate(t))return a(e,t);if($B(t,n))return t.some(t=>a(e,t));if(WB(t))return QB(t,e,!1,n);if(HB(t))return Array.isArray(t.dayOfWeek)?t.dayOfWeek.includes(e.getDay()):t.dayOfWeek===e.getDay();if(VB(t)){const n=o(t.before,e)>0,r=o(t.after,e)<0;return i(t.before,t.after)?r&&n:n||r}return ZB(t)?o(e,t.after)>0:GB(t)?o(t.before,e)>0:"function"==typeof t&&t(e)})}function qB(e){return i.createElement("button",{...e})}function JB(e){return i.createElement("span",{...e})}function KB(e){const{size:t=24,orientation:n="left",className:r}=e;return i.createElement("svg",{className:r,width:t,height:t,viewBox:"0 0 24 24"},"up"===n&&i.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),"down"===n&&i.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),"left"===n&&i.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),"right"===n&&i.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function eF(e){const{day:t,modifiers:n,...r}=e;return i.createElement("td",{...r})}function tF(e){const{day:t,modifiers:n,...r}=e,a=i.useRef(null);return i.useEffect(()=>{n.focused&&a.current?.focus()},[n.focused]),i.createElement("button",{ref:a,...r})}function nF(e){const{options:t,className:n,components:r,classNames:a,...o}=e,s=[a[UB.Dropdown],n].join(" "),l=t?.find(({value:e})=>e===o.value);return i.createElement("span",{"data-disabled":o.disabled,className:a[UB.DropdownRoot]},i.createElement(r.Select,{className:s,...o},t?.map(({value:e,label:t,disabled:n})=>i.createElement(r.Option,{key:e,value:e,disabled:n},t))),i.createElement("span",{className:a[UB.CaptionLabel],"aria-hidden":!0},l?.label,i.createElement(r.Chevron,{orientation:"down",size:18,className:a[UB.Chevron]})))}function rF(e){return i.createElement("div",{...e})}function aF(e){return i.createElement("div",{...e})}function oF(e){const{calendarMonth:t,displayIndex:n,...r}=e;return i.createElement("div",{...r},e.children)}function iF(e){const{calendarMonth:t,displayIndex:n,...r}=e;return i.createElement("div",{...r})}function sF(e){return i.createElement("table",{...e})}function lF(e){return i.createElement("div",{...e})}function cF(e){const{components:t}=xU();return i.createElement(t.Dropdown,{...e})}function uF(e){const{onPreviousClick:t,onNextClick:n,previousMonth:r,nextMonth:a,...o}=e,{components:s,classNames:l,labels:{labelPrevious:c,labelNext:u}}=xU(),d=(0,i.useCallback)(e=>{a&&n?.(e)},[a,n]),f=(0,i.useCallback)(e=>{r&&t?.(e)},[r,t]);return i.createElement("nav",{...o},i.createElement(s.PreviousMonthButton,{type:"button",className:l[UB.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":!r||void 0,"aria-label":c(r),onClick:f},i.createElement(s.Chevron,{disabled:!r||void 0,className:l[UB.Chevron],orientation:"left"})),i.createElement(s.NextMonthButton,{type:"button",className:l[UB.NextMonthButton],tabIndex:a?void 0:-1,"aria-disabled":!a||void 0,"aria-label":u(a),onClick:d},i.createElement(s.Chevron,{disabled:!a||void 0,orientation:"right",className:l[UB.Chevron]})))}function dF(e){const{components:t}=xU();return i.createElement(t.Button,{...e})}function fF(e){return i.createElement("option",{...e})}function mF(e){const{components:t}=xU();return i.createElement(t.Button,{...e})}function pF(e){const{rootRef:t,...n}=e;return i.createElement("div",{...n,ref:t})}function hF(e){return i.createElement("select",{...e})}function gF(e){const{week:t,...n}=e;return i.createElement("tr",{...n})}function wF(e){return i.createElement("th",{...e})}function yF(e){return i.createElement("thead",{"aria-hidden":!0},i.createElement("tr",{...e}))}function bF(e){const{week:t,...n}=e;return i.createElement("th",{...n})}function vF(e){return i.createElement("th",{...e})}function xF(e){return i.createElement("tbody",{...e})}function _F(e){const{components:t}=xU();return i.createElement(t.Dropdown,{...e})}function EF(){const e={};for(const t in UB)e[UB[t]]=`rdp-${UB[t]}`;for(const t in BB)e[BB[t]]=`rdp-${BB[t]}`;for(const t in FB)e[FB[t]]=`rdp-${FB[t]}`;for(const t in YB)e[YB[t]]=`rdp-${YB[t]}`;return e}function NF(e,t,n){return(n??new PB(t)).formatMonthYear(e)}!function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"}(UB||(UB={})),function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"}(BB||(BB={})),function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"}(FB||(FB={})),function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"}(YB||(YB={}));const MF=NF;function IF(e,t,n){return(n??new PB(t)).format(e,"d")}function SF(e,t=RB){return t.format(e,"LLLL")}function kF(e,t,n){return(n??new PB(t)).format(e,"cccccc")}function jF(e,t=RB){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function DF(){return""}function CF(e,t=RB){return t.format(e,"yyyy")}const AF=CF;function TF(e,t,n,r){let a=(r??new PB(n)).format(e,"PPPP");return t.today&&(a=`Today, ${a}`),t.selected&&(a=`${a}, selected`),a}const OF=TF;function LF(e,t,n){return(n??new PB(t)).formatMonthYear(e)}const zF=LF;function PF(e,t,n,r){let a=(r??new PB(n)).format(e,"PPPP");return t?.today&&(a=`Today, ${a}`),a}function RF(e){return"Choose the Month"}function UF(){return""}const BF="Go to the Next Month";function FF(e,t){return BF}function YF(e){return"Go to the Previous Month"}function QF(e,t,n){return(n??new PB(t)).format(e,"cccc")}function VF(e,t){return`Week ${e}`}function WF(e){return"Week Number"}function ZF(e){return"Choose the Year"}const GF=(e,t,n)=>t||(n?"function"==typeof n?n:(...e)=>n:e);function HF(e,t){const n=t.locale?.labels??{};return{...r,...e??{},labelDayButton:GF(TF,e?.labelDayButton,n.labelDayButton),labelMonthDropdown:GF(RF,e?.labelMonthDropdown,n.labelMonthDropdown),labelNext:GF(FF,e?.labelNext,n.labelNext),labelPrevious:GF(YF,e?.labelPrevious,n.labelPrevious),labelWeekNumber:GF(VF,e?.labelWeekNumber,n.labelWeekNumber),labelYearDropdown:GF(ZF,e?.labelYearDropdown,n.labelYearDropdown),labelGrid:GF(LF,e?.labelGrid,n.labelGrid),labelGridcell:GF(PF,e?.labelGridcell,n.labelGridcell),labelNav:GF(UF,e?.labelNav,n.labelNav),labelWeekNumberHeader:GF(WF,e?.labelWeekNumberHeader,n.labelWeekNumberHeader),labelWeekday:GF(QF,e?.labelWeekday,n.labelWeekday)}}function $F(e,t,n,r,a){const{startOfMonth:o,startOfYear:i,endOfYear:s,eachMonthOfInterval:l,getMonth:c}=a;return l({start:i(e),end:s(e)}).map(e=>{const i=r.formatMonthDropdown(e,a);return{value:c(e),label:i,disabled:t&&e<o(t)||n&&e>o(n)||!1}})}function XF(e,t,n,r,a=!1){if(!e)return;if(!t)return;const{startOfYear:o,endOfYear:i,eachYearOfInterval:s,getYear:l}=r,c=s({start:o(e),end:i(t)});return a&&c.reverse(),c.map(e=>{const t=n.formatYearDropdown(e,r);return{value:l(e),label:t,disabled:!1}})}const qF=e=>e instanceof HTMLElement?e:null,JF=e=>[...e.querySelectorAll("[data-animated-month]")??[]],KF=e=>qF(e.querySelector("[data-animated-caption]")),eY=e=>qF(e.querySelector("[data-animated-weeks]"));function tY(e,t,n,r){const{month:a,defaultMonth:o,today:i=r.today(),numberOfMonths:s=1}=e;let l=a||o||i;const{differenceInCalendarMonths:c,addMonths:u,startOfMonth:d}=r;return n&&c(n,l)<s-1&&(l=u(n,-1*(s-1))),t&&c(l,t)<0&&(l=t),d(l)}class nY{constructor(e,t,n=RB){this.date=e,this.displayMonth=t,this.outside=Boolean(t&&!n.isSameMonth(e,t)),this.dateLib=n,this.isoDate=n.format(e,"yyyy-MM-dd"),this.displayMonthId=n.format(t,"yyyy-MM"),this.dateMonthId=n.format(e,"yyyy-MM")}isEqualTo(e){return this.dateLib.isSameDay(e.date,this.date)&&this.dateLib.isSameMonth(e.displayMonth,this.displayMonth)}}class rY{constructor(e,t){this.days=t,this.weekNumber=e}}class aY{constructor(e,t){this.date=e,this.weeks=t}}function oY(e,t){const[n,r]=(0,i.useState)(e);return[void 0===t?n:t,r]}var iY;function sY(e){return!e[BB.disabled]&&!e[BB.hidden]&&!e[BB.outside]}function lY(e,t,n,r,a,o,i,s=0){if(s>365)return;const l=function(e,t,n,r,a,o,i){const{ISOWeek:s,broadcastCalendar:l}=o,{addDays:c,addMonths:u,addWeeks:d,addYears:f,endOfBroadcastWeek:m,endOfISOWeek:p,endOfWeek:h,max:g,min:w,startOfBroadcastWeek:y,startOfISOWeek:b,startOfWeek:v}=i,x={day:c,week:d,month:u,year:f,startOfWeek:e=>l?y(e,i):s?b(e):v(e),endOfWeek:e=>l?m(e):s?p(e):h(e)};let _=x[e](n,"after"===t?1:-1);return"before"===t&&r?_=g([r,_]):"after"===t&&a&&(_=w([a,_])),_}(e,t,n.date,r,a,o,i),c=Boolean(o.disabled&&XB(l,o.disabled,i)),u=Boolean(o.hidden&&XB(l,o.hidden,i)),d=new nY(l,l,i);return c||u?lY(e,t,d,r,a,o,i,s+1):d}function cY(e,t,n,r,a){const{autoFocus:o}=e,[s,l]=(0,i.useState)(),c=function(e,t,n,r){let a,o=-1;for(const i of e){const e=t(i);sY(e)&&(e[BB.focused]&&o<iY.FocusedModifier?(a=i,o=iY.FocusedModifier):r?.isEqualTo(i)&&o<iY.LastFocused?(a=i,o=iY.LastFocused):n(i.date)&&o<iY.Selected?(a=i,o=iY.Selected):e[BB.today]&&o<iY.Today&&(a=i,o=iY.Today))}return a||(a=e.find(e=>sY(t(e)))),a}(t.days,n,r||(()=>!1),s),[u,d]=(0,i.useState)(o?c:void 0);return{isFocusTarget:e=>Boolean(c?.isEqualTo(e)),setFocused:d,focused:u,blur:()=>{l(u),d(void 0)},moveFocus:(n,r)=>{if(!u)return;const o=lY(n,r,u,t.navStart,t.navEnd,e,a);if(o){if(e.disableNavigation&&!t.days.some(e=>e.isEqualTo(o)))return;t.goToDay(o),d(o)}}}}function uY(e,t,n=RB){return QB(e,t.from,!1,n)||QB(e,t.to,!1,n)||QB(t,e.from,!1,n)||QB(t,e.to,!1,n)}function dY(e,t){const{disabled:n,excludeDisabled:r,resetOnSelect:a,selected:o,required:i,onSelect:s}=e,[l,c]=oY(o,s?o:void 0),u=s?o:l;return{selected:u,select:(o,l,d)=>{const{min:f,max:m}=e;let p;if(o){const e=u?.from,n=u?.to,r=!!e&&!!n,s=!!e&&!!n&&t.isSameDay(e,n)&&t.isSameDay(o,e);p=!a||!r&&u?.from?function(e,t,n=0,r=0,a=!1,o=RB){const{from:i,to:s}=t||{},{isSameDay:l,isAfter:c,isBefore:u}=o;let d;if(i||s){if(i&&!s)d=l(i,e)?0===n?{from:i,to:e}:a?{from:i,to:void 0}:void 0:u(e,i)?{from:e,to:i}:{from:i,to:e};else if(i&&s)if(l(i,e)&&l(s,e))d=a?{from:i,to:s}:void 0;else if(l(i,e))d={from:i,to:n>0?void 0:e};else if(l(s,e))d={from:e,to:n>0?void 0:e};else if(u(e,i))d={from:e,to:s};else if(c(e,i))d={from:i,to:e};else{if(!c(e,s))throw new Error("Invalid range");d={from:i,to:e}}}else d={from:e,to:n>0?void 0:e};if(d?.from&&d?.to){const t=o.differenceInCalendarDays(d.to,d.from);(r>0&&t>r||n>1&&t<n)&&(d={from:e,to:void 0})}return d}(o,u,f,m,i,t):!i&&s?void 0:{from:o,to:void 0}}return r&&n&&p?.from&&p.to&&function(e,t,n=RB){const r=Array.isArray(t)?t:[t],a=r.filter(e=>"function"!=typeof e),o=a.some(t=>"boolean"==typeof t?t:n.isDate(t)?QB(e,t,!1,n):$B(t,n)?t.some(t=>QB(e,t,!1,n)):WB(t)?!(!t.from||!t.to)&&uY(e,{from:t.from,to:t.to},n):HB(t)?function(e,t,n=RB){const r=Array.isArray(t)?t:[t];let a=e.from;const o=n.differenceInCalendarDays(e.to,e.from),i=Math.min(o,6);for(let e=0;e<=i;e++){if(r.includes(a.getDay()))return!0;a=n.addDays(a,1)}return!1}(e,t.dayOfWeek,n):VB(t)?n.isAfter(t.before,t.after)?uY(e,{from:n.addDays(t.after,1),to:n.addDays(t.before,-1)},n):XB(e.from,t,n)||XB(e.to,t,n):!(!ZB(t)&&!GB(t))&&(XB(e.from,t,n)||XB(e.to,t,n)));if(o)return!0;const i=r.filter(e=>"function"==typeof e);if(i.length){let t=e.from;const r=n.differenceInCalendarDays(e.to,e.from);for(let e=0;e<=r;e++){if(i.some(e=>e(t)))return!0;t=n.addDays(t,1)}}return!1}({from:p.from,to:p.to},n,t)&&(p.from=o,p.to=void 0),s||c(p),s?.(p,o,l,d),p},isSelected:e=>u&&QB(u,e,!1,t)}}function fY(e,t){return e instanceof MB&&e.timeZone===t?e:new MB(e,t)}function mY(e,t,n){if(!n)return fY(e,t);const r=fY(e,t),a=new MB(r.getFullYear(),r.getMonth(),r.getDate(),12,0,0,t);return new Date(a.getTime())}function pY(e,t,n){return"boolean"==typeof e||"function"==typeof e?e:e instanceof Date?mY(e,t,n):Array.isArray(e)?e.map(e=>e instanceof Date?mY(e,t,n):e):WB(e)?{...e,from:e.from?fY(e.from,t):e.from,to:e.to?fY(e.to,t):e.to}:VB(e)?{before:mY(e.before,t,n),after:mY(e.after,t,n)}:ZB(e)?{after:mY(e.after,t,n)}:GB(e)?{before:mY(e.before,t,n)}:e}function hY(e,t,n){return e?Array.isArray(e)?e.map(e=>pY(e,t,n)):pY(e,t,n):e}function gY(e){let r=e;const a=r.timeZone;if(a&&(r={...e,timeZone:a},r.today&&(r.today=fY(r.today,a)),r.month&&(r.month=fY(r.month,a)),r.defaultMonth&&(r.defaultMonth=fY(r.defaultMonth,a)),r.startMonth&&(r.startMonth=fY(r.startMonth,a)),r.endMonth&&(r.endMonth=fY(r.endMonth,a)),"single"===r.mode&&r.selected?r.selected=fY(r.selected,a):"multiple"===r.mode&&r.selected?r.selected=r.selected?.map(e=>fY(e,a)):"range"===r.mode&&r.selected&&(r.selected={from:r.selected.from?fY(r.selected.from,a):r.selected.from,to:r.selected.to?fY(r.selected.to,a):r.selected.to}),void 0!==r.disabled&&(r.disabled=hY(r.disabled,a)),void 0!==r.hidden&&(r.hidden=hY(r.hidden,a)),r.modifiers)){const e={};Object.keys(r.modifiers).forEach(t=>{e[t]=hY(r.modifiers?.[t],a)}),r.modifiers=e}const{components:o,formatters:s,labels:l,dateLib:c,locale:u,classNames:d}=(0,i.useMemo)(()=>{const e={...hB,...r.locale},a=r.broadcastCalendar?1:r.weekStartsOn,o=r.noonSafe&&r.timeZone?function(e,t={}){const{weekStartsOn:n,locale:r}=t,a=n??r?.options?.weekStartsOn??0,o=t=>{const n="number"==typeof t||"string"==typeof t?new Date(t):t;return new MB(n.getFullYear(),n.getMonth(),n.getDate(),12,0,0,e)},i=e=>{const t=o(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0)};return{today:()=>o(MB.tz(e)),newDate:(t,n,r)=>new MB(t,n,r,12,0,0,e),startOfDay:e=>o(e),startOfWeek:(e,t)=>{const n=o(e),r=t?.weekStartsOn??a,i=(n.getDay()-r+7)%7;return n.setDate(n.getDate()-i),n},startOfISOWeek:e=>{const t=o(e),n=(t.getDay()-1+7)%7;return t.setDate(t.getDate()-n),t},startOfMonth:e=>{const t=o(e);return t.setDate(1),t},startOfYear:e=>{const t=o(e);return t.setMonth(0,1),t},endOfWeek:(e,t)=>{const n=o(e),r=(((t?.weekStartsOn??a)+6)%7-n.getDay()+7)%7;return n.setDate(n.getDate()+r),n},endOfISOWeek:e=>{const t=o(e),n=(7-t.getDay())%7;return t.setDate(t.getDate()+n),t},endOfMonth:e=>{const t=o(e);return t.setMonth(t.getMonth()+1,0),t},endOfYear:e=>{const t=o(e);return t.setMonth(11,31),t},eachMonthOfInterval:t=>{const n=o(t.start),r=o(t.end),a=[],i=new MB(n.getFullYear(),n.getMonth(),1,12,0,0,e),s=12*r.getFullYear()+r.getMonth();for(;12*i.getFullYear()+i.getMonth()<=s;)a.push(new MB(i,e)),i.setMonth(i.getMonth()+1,1);return a},addDays:(e,t)=>{const n=o(e);return n.setDate(n.getDate()+t),n},addWeeks:(e,t)=>{const n=o(e);return n.setDate(n.getDate()+7*t),n},addMonths:(e,t)=>{const n=o(e);return n.setMonth(n.getMonth()+t),n},addYears:(e,t)=>{const n=o(e);return n.setFullYear(n.getFullYear()+t),n},eachYearOfInterval:t=>{const n=o(t.start),r=o(t.end),a=[],i=new MB(n.getFullYear(),0,1,12,0,0,e);for(;i.getFullYear()<=r.getFullYear();)a.push(new MB(i,e)),i.setFullYear(i.getFullYear()+1,0,1);return a},getWeek:(e,t)=>HU(i(e),{weekStartsOn:t?.weekStartsOn??a,firstWeekContainsDate:t?.firstWeekContainsDate??r?.options?.firstWeekContainsDate??1}),getISOWeek:e=>ZU(i(e)),differenceInCalendarDays:(e,t)=>FU(i(e),i(t)),differenceInCalendarMonths:(e,t)=>kB(i(e),i(t))}}(r.timeZone,{weekStartsOn:a,locale:e}):void 0,i=r.dateLib&&o?{...o,...r.dateLib}:r.dateLib??o,s=new PB({locale:e,weekStartsOn:a,firstWeekContainsDate:r.firstWeekContainsDate,useAdditionalWeekYearTokens:r.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:r.useAdditionalDayOfYearTokens,timeZone:r.timeZone,numerals:r.numerals},i);return{dateLib:s,components:(c=r.components,{...t,...c}),formatters:(l=r.formatters,l?.formatMonthCaption&&!l.formatCaption&&(l.formatCaption=l.formatMonthCaption),l?.formatYearCaption&&!l.formatYearDropdown&&(l.formatYearDropdown=l.formatYearCaption),{...n,...l}),labels:HF(r.labels,s.options),locale:e,classNames:{...EF(),...r.classNames}};var l,c},[r.locale,r.broadcastCalendar,r.weekStartsOn,r.firstWeekContainsDate,r.useAdditionalWeekYearTokens,r.useAdditionalDayOfYearTokens,r.timeZone,r.numerals,r.dateLib,r.noonSafe,r.components,r.formatters,r.labels,r.classNames]);r.today||(r={...r,today:c.today()});const{captionLayout:f,mode:m,navLayout:p,numberOfMonths:h=1,onDayBlur:g,onDayClick:w,onDayFocus:y,onDayKeyDown:b,onDayMouseEnter:v,onDayMouseLeave:x,onNextClick:_,onPrevClick:E,showWeekNumber:N,styles:M}=r,{formatCaption:I,formatDay:S,formatMonthDropdown:k,formatWeekNumber:j,formatWeekNumberHeader:D,formatWeekdayName:C,formatYearDropdown:A}=s,T=function(e,t){const[n,r]=function(e,t){let{startMonth:n,endMonth:r}=e;const{startOfYear:a,startOfDay:o,startOfMonth:i,endOfMonth:s,addYears:l,endOfYear:c,newDate:u,today:d}=t,{fromYear:f,toYear:m,fromMonth:p,toMonth:h}=e;!n&&p&&(n=p),!n&&f&&(n=t.newDate(f,0,1)),!r&&h&&(r=h),!r&&m&&(r=u(m,11,31));const g="dropdown"===e.captionLayout||"dropdown-years"===e.captionLayout;return n?n=i(n):f?n=u(f,0,1):!n&&g&&(n=a(l(e.today??d(),-100))),r?r=s(r):m?r=u(m,11,31):!r&&g&&(r=c(e.today??d())),[n?o(n):n,r?o(r):r]}(e,t),{startOfMonth:a,endOfMonth:o}=t,s=tY(e,n,r,t),[l,c]=oY(s,e.month?s:void 0);(0,i.useEffect)(()=>{const a=tY(e,n,r,t);c(a)},[e.timeZone]);const{months:u,weeks:d,days:f,previousMonth:m,nextMonth:p}=(0,i.useMemo)(()=>{const a=function(e,t,n,r){const{numberOfMonths:a=1}=n,o=[];for(let n=0;n<a;n++){const a=r.addMonths(e,n);if(t&&a>t)break;o.push(a)}return o}(l,r,{numberOfMonths:e.numberOfMonths},t),i=function(e,t,n,r){const a=e[0],o=e[e.length-1],{ISOWeek:i,fixedWeeks:s,broadcastCalendar:l}=n??{},{addDays:c,differenceInCalendarDays:u,differenceInCalendarMonths:d,endOfBroadcastWeek:f,endOfISOWeek:m,endOfMonth:p,endOfWeek:h,isAfter:g,startOfBroadcastWeek:w,startOfISOWeek:y,startOfWeek:b}=r,v=l?w(a,r):i?y(a):b(a),x=l?f(o):i?m(p(o)):h(p(o)),_=t&&(l?f(t):i?m(t):h(t)),E=u(_&&g(x,_)?_:x,v),N=d(o,a)+1,M=[];for(let e=0;e<=E;e++){const t=c(v,e);M.push(t)}const I=(l?35:42)*N;if(s&&M.length<I){const e=I-M.length;for(let t=0;t<e;t++){const e=c(M[M.length-1],1);M.push(e)}}return M}(a,e.endMonth?o(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),s=function(e,t,n,r){const{addDays:a,endOfBroadcastWeek:o,endOfISOWeek:i,endOfMonth:s,endOfWeek:l,getISOWeek:c,getWeek:u,startOfBroadcastWeek:d,startOfISOWeek:f,startOfWeek:m}=r,p=e.reduce((e,p)=>{const h=n.broadcastCalendar?d(p,r):n.ISOWeek?f(p):m(p),g=n.broadcastCalendar?o(p):n.ISOWeek?i(s(p)):l(s(p)),w=t.filter(e=>e>=h&&e<=g),y=n.broadcastCalendar?35:42;if(n.fixedWeeks&&w.length<y){const e=t.filter(e=>{const t=y-w.length;return e>g&&e<=a(g,t)});w.push(...e)}const b=w.reduce((e,t)=>{const a=n.ISOWeek?c(t):u(t),o=e.find(e=>e.weekNumber===a),i=new nY(t,p,r);return o?o.days.push(i):e.push(new rY(a,[i])),e},[]),v=new aY(p,b);return e.push(v),e},[]);return n.reverseMonths?p.reverse():p}(a,i,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),c=function(e){return e.reduce((e,t)=>e.concat(t.weeks.slice()),[].slice())}(s),u=function(e){const t=[];return e.reduce((e,n)=>{const r=n.weeks.reduce((e,t)=>e.concat(t.days.slice()),t.slice());return e.concat(r.slice())},t.slice())}(s),d=function(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=r,c=a?o??1:1,u=i(e);return t&&l(u,t)<=0?void 0:s(u,-c)}(l,n,e,t),f=function(e,t,n,r){if(n.disableNavigation)return;const{pagedNavigation:a,numberOfMonths:o=1}=n,{startOfMonth:i,addMonths:s,differenceInCalendarMonths:l}=r,c=a?o:1,u=i(e);return t&&l(t,e)<o?void 0:s(u,c)}(l,r,e,t);return{months:s,weeks:c,days:u,previousMonth:d,nextMonth:f}},[t,l.getTime(),r?.getTime(),n?.getTime(),e.disableNavigation,e.broadcastCalendar,e.endMonth?.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:h,onMonthChange:g}=e,w=e=>{if(h)return;let t=a(e);n&&t<a(n)&&(t=a(n)),r&&t>a(r)&&(t=a(r)),c(t),g?.(t)},y={months:u,weeks:d,days:f,navStart:n,navEnd:r,previousMonth:m,nextMonth:p,goToMonth:w,goToDay:e=>{(e=>d.some(t=>t.days.some(t=>t.isEqualTo(e))))(e)||w(e.date)}};return y}(r,c),{days:O,months:L,navStart:z,navEnd:P,previousMonth:R,nextMonth:U,goToMonth:B}=T,F=function(e,t,n,r,a){const{disabled:o,hidden:i,modifiers:s,showOutsideDays:l,broadcastCalendar:c,today:u=a.today()}=t,{isSameDay:d,isSameMonth:f,startOfMonth:m,isBefore:p,endOfMonth:h,isAfter:g}=a,w=n&&m(n),y=r&&h(r),b={[BB.focused]:[],[BB.outside]:[],[BB.disabled]:[],[BB.hidden]:[],[BB.today]:[]},v={};for(const t of e){const{date:e,displayMonth:n}=t,r=Boolean(n&&!f(e,n)),m=Boolean(w&&p(e,w)),h=Boolean(y&&g(e,y)),x=Boolean(o&&XB(e,o,a)),_=Boolean(i&&XB(e,i,a))||m||h||!c&&!l&&r||c&&!1===l&&r,E=d(e,u);r&&b.outside.push(t),x&&b.disabled.push(t),_&&b.hidden.push(t),E&&b.today.push(t),s&&Object.keys(s).forEach(n=>{const r=s?.[n];r&&XB(e,r,a)&&(v[n]?v[n].push(t):v[n]=[t])})}return e=>{const t={[BB.focused]:!1,[BB.disabled]:!1,[BB.hidden]:!1,[BB.outside]:!1,[BB.today]:!1},n={};for(const n in b){const r=b[n];t[n]=r.some(t=>t===e)}for(const t in v)n[t]=v[t].some(t=>t===e);return{...t,...n}}}(O,r,z,P,c),{isSelected:Y,select:Q,selected:V}=function(e,t){const n=function(e,t){const{selected:n,required:r,onSelect:a}=e,[o,i]=oY(n,a?n:void 0),s=a?n:o,{isSameDay:l}=t;return{selected:s,select:(e,t,n)=>{let o=e;return!r&&s&&s&&l(e,s)&&(o=void 0),a||i(o),a?.(o,e,t,n),o},isSelected:e=>!!s&&l(s,e)}}(e,t),r=function(e,t){const{selected:n,required:r,onSelect:a}=e,[o,i]=oY(n,a?n:void 0),s=a?n:o,{isSameDay:l}=t,c=e=>s?.some(t=>l(t,e))??!1,{min:u,max:d}=e;return{selected:s,select:(e,t,n)=>{let o=[...s??[]];if(c(e)){if(s?.length===u)return;if(r&&1===s?.length)return;o=s?.filter(t=>!l(t,e))}else o=s?.length===d?[e]:[...o,e];return a||i(o),a?.(o,e,t,n),o},isSelected:c}}(e,t),a=dY(e,t);switch(e.mode){case"single":return n;case"multiple":return r;case"range":return a;default:return}}(r,c)??{},{blur:W,focused:Z,isFocusTarget:G,moveFocus:H,setFocused:$}=cY(r,T,F,Y??(()=>!1),c),{labelDayButton:X,labelGridcell:q,labelGrid:J,labelMonthDropdown:K,labelNav:ee,labelPrevious:te,labelNext:ne,labelWeekday:re,labelWeekNumber:ae,labelWeekNumberHeader:oe,labelYearDropdown:ie}=l,se=(0,i.useMemo)(()=>function(e,t,n,r){const a=r??e.today(),o=n?e.startOfBroadcastWeek(a,e):t?e.startOfISOWeek(a):e.startOfWeek(a),i=[];for(let t=0;t<7;t++){const n=e.addDays(o,t);i.push(n)}return i}(c,r.ISOWeek,r.broadcastCalendar,r.today),[c,r.ISOWeek,r.broadcastCalendar,r.today]),le=void 0!==m||void 0!==w,ce=(0,i.useCallback)(()=>{R&&(B(R),E?.(R))},[R,B,E]),ue=(0,i.useCallback)(()=>{U&&(B(U),_?.(U))},[B,U,_]),de=(0,i.useCallback)((e,t)=>n=>{n.preventDefault(),n.stopPropagation(),$(e),t.disabled||(Q?.(e.date,t,n),w?.(e.date,t,n))},[Q,w,$]),fe=(0,i.useCallback)((e,t)=>n=>{$(e),y?.(e.date,t,n)},[y,$]),me=(0,i.useCallback)((e,t)=>n=>{W(),g?.(e.date,t,n)},[W,g]),pe=(0,i.useCallback)((e,t)=>n=>{const a={ArrowLeft:[n.shiftKey?"month":"day","rtl"===r.dir?"after":"before"],ArrowRight:[n.shiftKey?"month":"day","rtl"===r.dir?"before":"after"],ArrowDown:[n.shiftKey?"year":"week","after"],ArrowUp:[n.shiftKey?"year":"week","before"],PageUp:[n.shiftKey?"year":"month","before"],PageDown:[n.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(a[n.key]){n.preventDefault(),n.stopPropagation();const[e,t]=a[n.key];H(e,t)}b?.(e.date,t,n)},[H,b,r.dir]),he=(0,i.useCallback)((e,t)=>n=>{v?.(e.date,t,n)},[v]),ge=(0,i.useCallback)((e,t)=>n=>{x?.(e.date,t,n)},[x]),we=(0,i.useCallback)(e=>t=>{const n=Number(t.target.value),r=c.setMonth(c.startOfMonth(e),n);B(r)},[c,B]),ye=(0,i.useCallback)(e=>t=>{const n=Number(t.target.value),r=c.setYear(c.startOfMonth(e),n);B(r)},[c,B]),{className:be,style:ve}=(0,i.useMemo)(()=>({className:[d[UB.Root],r.className].filter(Boolean).join(" "),style:{...M?.[UB.Root],...r.style}}),[d,r.className,r.style,M]),xe=function(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([e,n])=>{e.startsWith("data-")&&(t[e]=n)}),t}(r),_e=(0,i.useRef)(null);!function(e,t,{classNames:n,months:r,focused:a,dateLib:o}){const s=(0,i.useRef)(null),l=(0,i.useRef)(r),c=(0,i.useRef)(!1);(0,i.useLayoutEffect)(()=>{const i=l.current;if(l.current=r,!(t&&e.current&&e.current instanceof HTMLElement&&0!==r.length&&0!==i.length&&r.length===i.length))return;const u=o.isSameMonth(r[0].date,i[0].date),d=o.isAfter(r[0].date,i[0].date),f=d?n[YB.caption_after_enter]:n[YB.caption_before_enter],m=d?n[YB.weeks_after_enter]:n[YB.weeks_before_enter],p=s.current,h=e.current.cloneNode(!0);if(h instanceof HTMLElement?(JF(h).forEach(e=>{if(!(e instanceof HTMLElement))return;const t=qF(e.querySelector("[data-animated-month]"));t&&e.contains(t)&&e.removeChild(t);const n=KF(e);n&&n.classList.remove(f);const r=eY(e);r&&r.classList.remove(m)}),s.current=h):s.current=null,c.current||u||a)return;const g=p instanceof HTMLElement?JF(p):[],w=JF(e.current);if(w?.every(e=>e instanceof HTMLElement)&&g&&g.every(e=>e instanceof HTMLElement)){c.current=!0;const t=[];e.current.style.isolation="isolate";const r=(y=e.current,qF(y.querySelector("[data-animated-nav]")));r&&(r.style.zIndex="1"),w.forEach((a,o)=>{const i=g[o];if(!i)return;a.style.position="relative",a.style.overflow="hidden";const s=KF(a);s&&s.classList.add(f);const l=eY(a);l&&l.classList.add(m);const u=()=>{c.current=!1,e.current&&(e.current.style.isolation=""),r&&(r.style.zIndex=""),s&&s.classList.remove(f),l&&l.classList.remove(m),a.style.position="",a.style.overflow="",a.contains(i)&&a.removeChild(i)};t.push(u),i.style.pointerEvents="none",i.style.position="absolute",i.style.overflow="hidden",i.setAttribute("aria-hidden","true");const p=(e=>qF(e.querySelector("[data-animated-weekdays]")))(i);p&&(p.style.opacity="0");const h=KF(i);h&&(h.classList.add(d?n[YB.caption_before_exit]:n[YB.caption_after_exit]),h.addEventListener("animationend",u));const w=eY(i);w&&w.classList.add(d?n[YB.weeks_before_exit]:n[YB.weeks_after_exit]),a.insertBefore(i,a.firstChild)})}var y})}(_e,Boolean(r.animate),{classNames:d,months:L,focused:Z,dateLib:c});const Ee={dayPickerProps:r,selected:V,select:Q,isSelected:Y,months:L,nextMonth:U,previousMonth:R,goToMonth:B,getModifiers:F,components:o,classNames:d,styles:M,labels:l,formatters:s};return i.createElement(vU.Provider,{value:Ee},i.createElement(o.Root,{rootRef:r.animate?_e:void 0,className:be,style:ve,dir:r.dir,id:r.id,lang:r.lang??u.code,nonce:r.nonce,title:r.title,role:r.role,"aria-label":r["aria-label"],"aria-labelledby":r["aria-labelledby"],...xe},i.createElement(o.Months,{className:d[UB.Months],style:M?.[UB.Months]},!r.hideNavigation&&!p&&i.createElement(o.Nav,{"data-animated-nav":r.animate?"true":void 0,className:d[UB.Nav],style:M?.[UB.Nav],"aria-label":ee(),onPreviousClick:ce,onNextClick:ue,previousMonth:R,nextMonth:U}),L.map((e,t)=>i.createElement(o.Month,{"data-animated-month":r.animate?"true":void 0,className:d[UB.Month],style:M?.[UB.Month],key:t,displayIndex:t,calendarMonth:e},"around"===p&&!r.hideNavigation&&0===t&&i.createElement(o.PreviousMonthButton,{type:"button",className:d[UB.PreviousMonthButton],tabIndex:R?void 0:-1,"aria-disabled":!R||void 0,"aria-label":te(R),onClick:ce,"data-animated-button":r.animate?"true":void 0},i.createElement(o.Chevron,{disabled:!R||void 0,className:d[UB.Chevron],orientation:"rtl"===r.dir?"right":"left"})),i.createElement(o.MonthCaption,{"data-animated-caption":r.animate?"true":void 0,className:d[UB.MonthCaption],style:M?.[UB.MonthCaption],calendarMonth:e,displayIndex:t},f?.startsWith("dropdown")?i.createElement(o.DropdownNav,{className:d[UB.Dropdowns],style:M?.[UB.Dropdowns]},(()=>{const t="dropdown"===f||"dropdown-months"===f?i.createElement(o.MonthsDropdown,{key:"month",className:d[UB.MonthsDropdown],"aria-label":K(),classNames:d,components:o,disabled:Boolean(r.disableNavigation),onChange:we(e.date),options:$F(e.date,z,P,s,c),style:M?.[UB.Dropdown],value:c.getMonth(e.date)}):i.createElement("span",{key:"month"},k(e.date,c)),n="dropdown"===f||"dropdown-years"===f?i.createElement(o.YearsDropdown,{key:"year",className:d[UB.YearsDropdown],"aria-label":ie(c.options),classNames:d,components:o,disabled:Boolean(r.disableNavigation),onChange:ye(e.date),options:XF(z,P,s,c,Boolean(r.reverseYears)),style:M?.[UB.Dropdown],value:c.getYear(e.date)}):i.createElement("span",{key:"year"},A(e.date,c));return"year-first"===c.getMonthYearOrder()?[n,t]:[t,n]})(),i.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},I(e.date,c.options,c))):i.createElement(o.CaptionLabel,{className:d[UB.CaptionLabel],role:"status","aria-live":"polite"},I(e.date,c.options,c))),"around"===p&&!r.hideNavigation&&t===h-1&&i.createElement(o.NextMonthButton,{type:"button",className:d[UB.NextMonthButton],tabIndex:U?void 0:-1,"aria-disabled":!U||void 0,"aria-label":ne(U),onClick:ue,"data-animated-button":r.animate?"true":void 0},i.createElement(o.Chevron,{disabled:!U||void 0,className:d[UB.Chevron],orientation:"rtl"===r.dir?"left":"right"})),t===h-1&&"after"===p&&!r.hideNavigation&&i.createElement(o.Nav,{"data-animated-nav":r.animate?"true":void 0,className:d[UB.Nav],style:M?.[UB.Nav],"aria-label":ee(),onPreviousClick:ce,onNextClick:ue,previousMonth:R,nextMonth:U}),i.createElement(o.MonthGrid,{role:"grid","aria-multiselectable":"multiple"===m||"range"===m,"aria-label":J(e.date,c.options,c)||void 0,className:d[UB.MonthGrid],style:M?.[UB.MonthGrid]},!r.hideWeekdays&&i.createElement(o.Weekdays,{"data-animated-weekdays":r.animate?"true":void 0,className:d[UB.Weekdays],style:M?.[UB.Weekdays]},N&&i.createElement(o.WeekNumberHeader,{"aria-label":oe(c.options),className:d[UB.WeekNumberHeader],style:M?.[UB.WeekNumberHeader],scope:"col"},D()),se.map(e=>i.createElement(o.Weekday,{"aria-label":re(e,c.options,c),className:d[UB.Weekday],key:String(e),style:M?.[UB.Weekday],scope:"col"},C(e,c.options,c)))),i.createElement(o.Weeks,{"data-animated-weeks":r.animate?"true":void 0,className:d[UB.Weeks],style:M?.[UB.Weeks]},e.weeks.map(e=>i.createElement(o.Week,{className:d[UB.Week],key:e.weekNumber,style:M?.[UB.Week],week:e},N&&i.createElement(o.WeekNumber,{week:e,style:M?.[UB.WeekNumber],"aria-label":ae(e.weekNumber,{locale:u}),className:d[UB.WeekNumber],scope:"row",role:"rowheader"},j(e.weekNumber,c)),e.days.map(e=>{const{date:t}=e,n=F(e);if(n[BB.focused]=!n.hidden&&Boolean(Z?.isEqualTo(e)),n[FB.selected]=Y?.(t)||n.selected,WB(V)){const{from:e,to:r}=V;n[FB.range_start]=Boolean(e&&r&&c.isSameDay(t,e)),n[FB.range_end]=Boolean(e&&r&&c.isSameDay(t,r)),n[FB.range_middle]=QB(V,t,!0,c)}const a=function(e,t={},n={}){let r={...t?.[UB.Day]};return Object.entries(e).filter(([,e])=>!0===e).forEach(([e])=>{r={...r,...n?.[e]}}),r}(n,M,r.modifiersStyles),s=function(e,t,n={}){return Object.entries(e).filter(([,e])=>!0===e).reduce((e,[r])=>(n[r]?e.push(n[r]):t[BB[r]]?e.push(t[BB[r]]):t[FB[r]]&&e.push(t[FB[r]]),e),[t[UB.Day]])}(n,d,r.modifiersClassNames),l=le||n.hidden?void 0:q(t,n,c.options,c);return i.createElement(o.Day,{key:`${e.isoDate}_${e.displayMonthId}`,day:e,modifiers:n,className:s.join(" "),style:a,role:"gridcell","aria-selected":n.selected||void 0,"aria-label":l,"data-day":e.isoDate,"data-month":e.outside?e.dateMonthId:void 0,"data-selected":n.selected||void 0,"data-disabled":n.disabled||void 0,"data-hidden":n.hidden||void 0,"data-outside":e.outside||void 0,"data-focused":n.focused||void 0,"data-today":n.today||void 0},!n.hidden&&le?i.createElement(o.DayButton,{className:d[UB.DayButton],style:M?.[UB.DayButton],type:"button",day:e,modifiers:n,disabled:!n.focused&&n.disabled||void 0,"aria-disabled":n.focused&&n.disabled||void 0,tabIndex:G(e)?0:-1,"aria-label":X(t,n,c.options,c),onClick:de(e,n),onBlur:me(e,n),onFocus:fe(e,n),onKeyDown:pe(e,n),onMouseEnter:he(e,n),onMouseLeave:ge(e,n)},S(t,c.options,c)):!n.hidden&&S(e.date,c.options,c))})))))))),r.footer&&i.createElement(o.Footer,{className:d[UB.Footer],style:M?.[UB.Footer],role:"status","aria-live":"polite"},r.footer)))}function wY(e,t){return+PU(e)===+PU(t)}!function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"}(iY||(iY={}));const yY=()=>(0,P.jsx)("span",{className:"bg-icon-interactive h-1 w-1 absolute rounded-full inline-block bottom-0 left-1/2 right-1/2"}),bY=e=>mB(e,"E").slice(0,1),vY=(e,t=24)=>Array.from({length:t},(t,n)=>e+n),xY=e=>"multiple"===e?[]:"range"===e?{from:void 0,to:void 0}:void 0,_Y=({width:e,className:t,classNames:n,selectedDates:r,setSelectedDates:a,showOutsideDays:o=!0,mode:s="single",variant:l="normal",alignment:c="horizontal",numberOfMonths:u,disabled:d,...f})=>{const m=i.isValidElement(f.footer)||"function"==typeof f.footer,[p,h]=(0,i.useState)(!1),[g,w]=(0,i.useState)(!1),[y,b]=(0,i.useState)((new Date).getFullYear()),[v,x]=(0,i.useState)(y-y%24);void 0===r&&(r="multiple"===s?[]:"range"===s?{from:void 0,to:void 0}:void 0);const _=({weekdays:e})=>(0,P.jsx)("div",{className:"flex justify-between",children:e.map((e,t)=>(0,P.jsx)("button",{className:"h-10 w-10 px-1.5 py-2 text-center text-text-secondary text-sm font-normal content-center bg-transparent border-none shrink-0",children:e},t))}),E=e=>(0,P.jsx)("div",{className:"flex flex-col bsf-force-ui-month-weeks",children:e.children[1].props.children.map((e,t)=>(0,P.jsx)("div",{className:"flex flex-row justify-between",children:e},t))}),N=Oe("relative bg-background-primary shadow-datepicker-wrapper",e,"vertical"===c?"flex flex-col":"flex flex-row gap-3","normal"===l?"rounded-tr-md rounded-tl-md border border-solid border-border-subtle":"","presets"===l?"rounded-tr-md border border-solid border-border-subtle":"","dualdate"===l?"rounded-tr-md rounded-tl-md border border-solid border-border-subtle":"",m?"rounded-b-none":"rounded-bl-md rounded-br-md");return(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(gY,{mode:s,selected:r,onSelect:(e,t)=>{if("range"===s){const n=r;if(!n?.from&&!n?.to||n?.from&&n?.to)return n.from&&wY(t,n?.from)||n.to&&wY(t,n?.to)?void a({from:void 0,to:void 0}):void a({from:t,to:void 0});if(n?.from&&!n?.to)return t<n.from?void a({from:t,to:n.from}):void a({from:n.from,to:t});a(e)}else"multiple"===s?r.some(e=>mB(e,"yyyy-MM-dd")===mB(t,"yyyy-MM-dd"))?a(r.filter(e=>mB(e,"yyyy-MM-dd")!==mB(t,"yyyy-MM-dd"))):a([...r,t]):"single"===s&&a(e)},hideNavigation:!0,captionLayout:"label",className:Oe(t),formatters:{formatWeekdayName:bY},classNames:{months:N,month:"flex flex-col p-2 gap-1 text-center w-full",caption:"relative flex justify-center items-center",table:"w-full border-separate border-spacing-0",head_row:"flex mb-1",head_cell:"text-muted-foreground rounded-md w-10 font-normal text-sm",row:"flex w-full mt-2",cell:"h-10 w-10 text-center text-sm p-0 relative",...n},numberOfMonths:u,showOutsideDays:!0,components:{MonthCaption:function(e){const{goToMonth:t,nextMonth:n,previousMonth:r}=xU(),a=mB(e.calendarMonth.date,"yyyy"),o=mB(e.calendarMonth.date,"MMMM"),i=new Date(e.calendarMonth.date);i.setDate(i.getDate()-i.getDay());const s=Array.from({length:7},(e,t)=>{const n=new Date(i);return n.setDate(i.getDate()+t),bY(n)});let l;return l=g?`${v} - ${v+23}`:p?a:`${o} ${a}`,(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)("div",{className:"flex justify-between",children:[(0,P.jsx)(Va,{variant:"ghost",onClick:()=>{if(g)x(v-24);else if(p){const n=new Date(y-1,e.calendarMonth.date.getMonth());b(n.getFullYear()),t(n)}else t(r)},className:"bg-background-primary border-none cursor-pointer","aria-label":"Previous Button",icon:(0,P.jsx)(yU,{className:"h-4 w-4 text-button-tertiary-color"})}),(0,P.jsx)(Va,{variant:"ghost",onClick:()=>{u>1||(p?(w(!0),h(!1)):g?w(!1):h(!p))},children:l}),(0,P.jsx)(Va,{variant:"ghost",onClick:()=>{if(g)x(v+24);else if(p){const n=new Date(y+1,e.calendarMonth.date.getMonth());b(n.getFullYear()),t(n)}else t(n)},className:"bg-background-primary border-none cursor-pointer","aria-label":"Next Button",icon:(0,P.jsx)(bU,{className:"h-4 w-4 text-button-tertiary-color"})})]}),g&&(0,P.jsx)("div",{className:"grid grid-cols-4 w-full",children:vY(v).map(n=>(0,P.jsxs)(Va,{variant:"ghost",onClick:()=>(n=>{b(n),w(!1),h(!0),t(new Date(n,e.calendarMonth.date.getMonth()))})(n),className:Oe("h-10 w-full text-center font-normal relative",n===y&&n!==(new Date).getFullYear()&&"bg-background-brand text-text-on-color hover:bg-background-brand hover:text-black",n===(new Date).getFullYear()&&"font-semibold"),children:[n,n===(new Date).getFullYear()&&yY()]},n))}),p&&!g&&(0,P.jsx)("div",{className:"grid grid-cols-4 gap-2 my-12",children:Array.from({length:12},(n,r)=>(0,P.jsxs)(Va,{variant:"ghost",onClick:()=>{h(!1),t(new Date(y,r))},className:Oe("px-1.5 py-2 h-10 w-[4.375rem] text-center font-normal relative",r===e.calendarMonth.date.getMonth()&&r!==(new Date).getMonth()&&y===e.calendarMonth.date.getFullYear()&&e.calendarMonth.date.getFullYear()!==(new Date).getFullYear()&&"bg-background-brand text-text-on-color hover:bg-background-brand hover:text-black",r===(new Date).getMonth()&&(new Date).getFullYear()===y&&"font-semibold"),children:[mB(new Date(0,r),"MMM"),(new Date).getMonth()===r&&(new Date).getFullYear()===y&&yY()]},r))}),!p&&!g&&(0,P.jsx)(_,{weekdays:s})]})},DayButton:({day:e,modifiers:t,...n})=>{const{selected:a,today:i,disabled:s,outside:l,range_middle:c,range_start:u,range_end:d}=t,f=u||d||c,m=new Date,p=r?.to,h=mB(e.displayMonth,"yyyy-MM")===mB(m,"yyyy-MM"),g=p&&mB(p,"yyyy-MM")===mB(e.date,"yyyy-MM"),w=function(e,t,n){return SB(e,-t,n)}(m,1),y=mB(e.date,"yyyy-MM")===mB(w,"yyyy-MM"),b=h||g||f,v=!o&&l,x=Oe("h-10 w-10 flex items-center justify-center transition text-text-secondary relative text-sm","border-none rounded",!a&&!f||l?"bg-transparent hover:bg-button-tertiary-hover":"bg-background-brand text-text-on-color",c&&b&&!l?"bg-brand-background-50 text-text-secondary rounded-none":"",s?"opacity-50 cursor-not-allowed text-text-disabled":"cursor-pointer",l&&!f||!b&&l||l&&!y||l?"bg-transparent opacity-50 text-text-disabled cursor-auto":"");return(0,P.jsxs)("button",{className:Oe(x,i&&"font-semibold",v&&"opacity-0",u&&"fui-range-start",d&&"fui-range-end",c&&"fui-range-middle",{"[&:is([data-hover=true])]:bg-brand-background-50 [&:is([data-hover=true])]:rounded-none":!f&&!a}),disabled:s||l,onClick:e=>{"function"==typeof n.onClick&&n.onClick(e)},onMouseEnter:e=>{"function"==typeof n.onMouseEnter&&n.onMouseEnter(e),e.currentTarget.setAttribute("data-hover","true")},onMouseLeave:e=>{"function"==typeof n.onMouseLeave&&n.onMouseLeave(e),e.currentTarget.setAttribute("data-hover","false")},"aria-label":mB(e.date,"EEEE, MMMM do, yyyy"),"data-selected":a,"data-day":mB(e.date,"yyyy-MM-dd"),children:[n.children,i&&b&&(0,P.jsx)("span",{className:"absolute h-1 w-1 bg-background-brand rounded-full bottom-1"})]})},Day:e=>{const t=Object.entries(e).reduce((e,[t,n])=>(t.startsWith("data-")&&(e[t]=n),e),{});return(0,P.jsx)("div",{...t,className:Oe(e.className,"inline-flex"),children:e.children})},Weekdays:()=>(0,P.jsx)(P.Fragment,{}),Week:e=>(0,P.jsx)("div",{className:Oe("bsf-force-ui-month-week flex flex-row",e.className),children:e.children}),Months:e=>(0,P.jsx)(P.Fragment,{children:(0,P.jsx)("div",{className:Oe("bsf-force-ui-date-picker-month",N),children:e?.children?.map((e,t)=>e?(0,P.jsx)(i.Fragment,{children:e.map((e,t)=>(0,P.jsxs)(i.Fragment,{children:[t>0&&(0,P.jsx)("div",{className:"border border-solid border-border-subtle border-l-0"}),e]},t))},t):null)})}),MonthGrid:e=>p||g?(0,P.jsx)(P.Fragment,{}):(0,P.jsx)(E,{...e})},..."range"===s?{required:!1}:{},...f,onDayMouseEnter:(e,t,n)=>{if("range"!==s)return;const a=r;if(a?.from&&a?.to||!a?.from&&!a?.to)return void Array.from(document.querySelectorAll("[data-hover]")).forEach(e=>{e.setAttribute("data-hover","false")});const o=n.target,i=new Date(o.dataset.day),c=TB(i,a.from),u=AB(i,a.to);let d;switch(l){case"dualdate":case"presets":d=o.closest(".bsf-force-ui-date-picker-month");break;default:d=o.closest(".bsf-force-ui-month-weeks")}const f=Array.from(d.querySelectorAll("button"));u&&f.sort((e,t)=>AB(new Date(e.dataset.day),new Date(t.dataset.day))?-1:1),c&&f.sort((e,t)=>TB(new Date(e.dataset.day),new Date(t.dataset.day))?1:-1);const m=f.indexOf(o),p=f.findIndex(e=>"true"===e.getAttribute("data-selected")),h=[],g=Math.min(m,p),w=Math.max(m,p);for(let e=g;e<=w;e++)f[e]?.disabled||h.push(f[e]);f.forEach(e=>{e.setAttribute("data-hover",h.includes(e)?"true":"false")})},disabled:d})})};function EY(e){return BU(Date.now(),e)}function NY(e){return zU(e,Date.now())}function MY(e){const t=NY(e?.in),n=t.getFullYear(),r=t.getMonth(),a=t.getDate(),o=NY(e?.in);return o.setFullYear(n,r,a-1),o.setHours(0,0,0,0),o}function IY(e,t,n){return IB(e,-t,n)}const SY=({selectionType:e="single",variant:t="normal",presets:n=[],onCancel:r,onApply:a,onDateSelect:o,applyButtonText:s="Apply",cancelButtonText:l="Cancel",showOutsideDays:c=!0,isFooter:u=!0,selected:d,disabled:f,...m})=>{const[p,h]=(0,i.useState)(()=>{if(!d)return xY(e);const t="multiple"===e&&Array.isArray(d),n="single"===e&&d instanceof Date;return t||"range"===e&&"from"in d&&"to"in d||n?d:xY(e)}),g=e=>{h(e),o&&o(e)},w=[{label:"Today",range:{from:EY(),to:EY()}},{label:"Yesterday",range:{from:MY(),to:MY()}},{label:"This Week",range:{from:QU(new Date,{weekStartsOn:1}),to:DB(new Date,{weekStartsOn:1})}},{label:"Last 7 Days",range:{from:BU(IY(new Date,6)),to:BU(new Date)}},{label:"This Month",range:{from:LB(new Date),to:CB(new Date)}},{label:"Last 30 Days",range:{from:BU(IY(new Date,29)),to:BU(new Date)}}],y=n.length>0?n:w,b=()=>{h("multiple"===e?[]:{from:void 0,to:void 0}),r&&r()},v=()=>{a&&a(p)};return"normal"===t?(0,P.jsx)(_Y,{...m,mode:e,variant:t,width:"w-[18.5rem]",selectedDates:p,showOutsideDays:c,setSelectedDates:g,footer:u&&(0,P.jsxs)("div",{className:"flex bg-background-primary justify-end p-2 gap-3 border border-solid border-border-subtle border-t-0 rounded-md rounded-tl-none rounded-tr-none",children:[(0,P.jsx)(Va,{variant:"outline",onClick:b,children:l}),(0,P.jsx)(Va,{onClick:v,children:s})]}),disabled:f}):"dualdate"===t?(0,P.jsx)(_Y,{mode:e,numberOfMonths:2,alignment:"horizontal",selectedDates:p,setSelectedDates:g,showOutsideDays:c,variant:t,width:"w-auto",footer:(0,P.jsxs)("div",{className:"flex bg-background-primary justify-end p-2 gap-3 border border-solid border-border-subtle border-t-0 rounded-md rounded-tl-none rounded-tr-none",children:[(0,P.jsx)(Va,{variant:"outline",onClick:b,children:l}),(0,P.jsx)(Va,{onClick:v,children:s})]}),disabled:f,...m}):"presets"===t?(0,P.jsxs)("div",{className:"flex flex-row shadow-datepicker-wrapper",children:[(0,P.jsx)("div",{className:"flex flex-col gap-1 p-3 items-start border border-solid border-border-subtle border-r-0 rounded-tl-md rounded-bl-md bg-background-primary",children:y.map((e,t)=>{const n=p&&"from"in p&&"to"in p&&p.from?.getTime()===e.range.from.getTime()&&p.to?.getTime()===e.range.to.getTime();return(0,P.jsx)(Va,{onClick:()=>(e=>{h(e)})(e.range),variant:"ghost",className:Oe("text-left font-medium text-sm text-nowrap w-full",n&&"bg-brand-background-50"),children:e.label},t)})}),(0,P.jsx)(_Y,{...m,mode:e,selectedDates:p,setSelectedDates:g,variant:t,showOutsideDays:c,width:"w-auto",numberOfMonths:2,footer:(0,P.jsxs)("div",{className:"flex justify-end p-2 gap-3 border-l border-r border-t-0 border-b border-solid border-border-subtle bg-background-primary rounded-br-md",children:[(0,P.jsx)(Va,{variant:"outline",onClick:b,children:l}),(0,P.jsx)(Va,{onClick:v,children:s})]}),disabled:f})]}):void 0};function kY({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"}))}const jY=i.forwardRef(kY),DY=e=>{if(!e)return null;if(e instanceof Date)return e;if("string"==typeof e&&/^\d{4}-\d{2}-\d{2}$/.test(e)){const[t,n,r]=e.split("-").map(Number);return new Date(t,n-1,r)}return new Date(e)},CY=e=>e?e.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"mmm dd, yyyy",AY=()=>{const e=new Date,t=new Date(e),n=new Date(e);n.setDate(n.getDate()-1);const r=new Date(e),a=r.getDay(),o=0===a?6:a-1;r.setDate(e.getDate()-o);const i=new Date(r);i.setDate(r.getDate()+6);const s=new Date(r);s.setDate(s.getDate()-7);const l=new Date(s);l.setDate(s.getDate()+6);const c=new Date(e.getFullYear(),e.getMonth(),1),u=new Date(e),d=new Date(e.getFullYear(),e.getMonth()-1,1),f=new Date(e.getFullYear(),e.getMonth(),0);return[{label:(0,z.__)("Today","cartflows"),range:{from:t,to:t}},{label:(0,z.__)("Yesterday","cartflows"),range:{from:n,to:n}},{label:(0,z.__)("This Week","cartflows"),range:{from:r,to:i}},{label:(0,z.__)("Last Week","cartflows"),range:{from:s,to:l}},{label:(0,z.__)("This Month","cartflows"),range:{from:c,to:u}},{label:(0,z.__)("Last Month","cartflows"),range:{from:d,to:f}}]},TY=function(e){const{label:t,value:n,tooltip:r,desc:a,onChangeCB:s,sectionClass:l="",wrapperClass:c="",fieldParentWrapperClass:u="w-full",placeholder:d=(0,z.__)("Select Date Range","cartflows")}=e,[f,m]=(0,i.useState)(!1),p=(0,i.useRef)(null),h=(0,i.useRef)(null),[g,w]=(0,i.useState)({from:DY(n?.startDate),to:DY(n?.endDate)});return(0,i.useEffect)(()=>{w({from:DY(n?.startDate),to:DY(n?.endDate)})},[n?.startDate,n?.endDate]),(0,i.useEffect)(()=>{const e=e=>{h.current&&!h.current.contains(e.target)&&p.current&&!p.current.contains(e.target)&&m(!1)};return f&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[f]),(0,o.createElement)("div",{className:`wcf-field wcf-date-field ${l}`},(0,o.createElement)("div",{className:`wcf-field__data flex items-center gap-2.5 ${c}`},t&&(0,o.createElement)("div",{className:"wcf-field__data--label text-sm font-medium"},(0,o.createElement)("label",null,t,r&&(0,o.createElement)(iQ,{text:r}))),(0,o.createElement)("div",{className:`wcf-field__data--content relative ${u}`},(0,o.createElement)(Va,{ref:p,icon:(0,o.createElement)(jY,{className:"h-4 w-4 text-text-secondary","aria-hidden":"true"}),iconPosition:"right",size:"sm",tag:"button",type:"button",variant:"outline",className:"whitespace-nowrap text-text-secondary font-normal",onClick:()=>m(e=>!e)},g?.from&&g?.to?`${CY(g.from)} - ${CY(g.to)}`:d),f&&(0,o.createElement)("div",{ref:h,className:"absolute z-[9999] rounded-lg shadow-lg top-full right-0 mt-1 overflow-x-auto"},(0,o.createElement)(SY,{key:"range",applyButtonText:(0,z.__)("Apply","cartflows"),cancelButtonText:(0,z.__)("Cancel","cartflows"),onApply:e=>{w(e),m(!1),s&&s({startDate:e.from,endDate:e.to})},onCancel:()=>{m(!1)},presets:AY(),selected:g,selectionType:"range",showOutsideDays:!0,variant:"presets"})))),a&&(0,o.createElement)("div",{className:"wcf-field__desc text-sm font-regular"},fh(a)))},OY=Ua("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),LY=Ua("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),zY=function(e){var t,n;const{content:r,custom_class:a="",icon:i=""}=e,s=function(e){switch(e){case"info":return{icon:Ba,color:"text-text-secondary"};case"error":return{icon:OY,color:"text-support-error"};case"success":return{icon:LY,color:"text-support-success"};case"warning":return{icon:Ya,color:"text-support-warning"};default:return null}}(i),l=null!==(t=s?.icon)&&void 0!==t?t:null,c=null!==(n=s?.color)&&void 0!==n?n:"";return(0,o.createElement)("div",{className:`wcf-field wcf-doc-field ${a}`},r&&(0,o.createElement)("div",{className:"wcf-field__doc-content flex items-center gap-1 text-sm font-normal text-text-primary mt-2 text-left"},l&&(0,o.createElement)(l,{size:16,className:c}),fh(r)))},PY=function(e){const{label:t,desc:n,sectionClass:r,descClass:a,labelClass:i=""}=e,s=r&&""!==r?r:"text-left",l=""!==i?i:"block text-base font-medium text-text-primary mb-5",c=""!==a?a:"text-sm font-normal text-text-secondary mt-2";return(0,o.createElement)("div",{className:`wcf-field wcf-section-heading-field ${s}`},t&&(0,o.createElement)("div",{className:"wcf-field__data--label"},(0,o.createElement)("label",{className:l},t)),n&&(0,o.createElement)("div",{className:`wcf-field__desc ${c}`},fh(n)))},RY=function(e){const{notice:t="",feature:n="this",plan_required:r="pro"}=e;return""!==t?(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-pro-notice"},(0,o.createElement)("p",{className:"wcf-pro-update-notice"},fh(t)))):wcfCartflowsTypePlusPro()||"pro"===r?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-pro-notice"},(0,o.createElement)("p",{className:"wcf-pro-update-notice"},fh((0,z.sprintf)( |
| 6 |
// translators: %1$s: anchor tag start, %2$s: anchor tag end, %3$s: feature name. |
| 7 |
// translators: %1$s: anchor tag start, %2$s: anchor tag end, %3$s: feature name. |
| 8 |
(0,z.__)("Please upgrade to the %1$s CartFlows Pro %2$s to use %3$s feature.","cartflows"),`<a href="${getUtmUrl("https://cartflows.com",{utm_campaign:"feature"})}" target="_blank">`,"</a>",n)))))):(0,o.createElement)(o.Fragment,null,(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-pro-notice"},(0,o.createElement)("p",{className:"wcf-pro-update-notice"},fh((0,z.sprintf)( |
| 9 |
// translators: %1$s: anchor tag start, %2$s: anchor tag end, %3$s: feature name. |
| 10 |
// translators: %1$s: anchor tag start, %2$s: anchor tag end, %3$s: feature name. |
| 11 |
(0,z.__)("Please upgrade to the %1$s CartFlows Higher Plan %2$s to use %3$s feature.","cartflows"),`<a href="${getUtmUrl("https://cartflows.com",{utm_campaign:"feature"})}" target="_blank">`,"</a>",n))))))},UY=window.lodash,BY={sm:"text-xs [&>svg]:size-4 rounded",md:"text-sm [&>svg]:size-5 rounded-md",lg:"text-base [&>svg]:size-6 rounded-md"},FY={input:{sm:"py-1.5 px-2 rounded",md:"p-2.5 rounded-md",lg:"p-3 rounded-md"},content:{sm:"p-1.5",md:"p-1.5",lg:"p-2"},title:{sm:"p-2 text-xs",md:"p-2 text-sm",lg:"p-2 text-sm"},item:{sm:"text-sm text-text-secondary rounded",md:"text-base text-text-secondary rounded-md",lg:"text-base text-text-secondary rounded-md"},icon:{sm:"p-1 text-sm [&>svg]:size-4 text-icon-secondary",md:"p-2 text-base [&>svg]:size-5 text-icon-secondary",lg:"p-2 text-base [&>svg]:size-5 text-icon-secondary"},dialog:{sm:"mt-1 rounded-md",md:"mt-1.5 rounded-lg",lg:"mt-1.5 rounded-lg"},slashIcon:{sm:"px-2 py-0.5",md:"px-3 py-1",lg:"px-3.5 py-1"}},YY={primary:"bg-field-primary-background outline outline-1 outline-field-border hover:outline-border-strong focus-within:outline-focus-border focus-within:hover:outline-focus-border",secondary:"bg-field-secondary-background outline outline-1 outline-field-border hover:outline-border-strong focus-within:outline-focus-border focus-within:hover:outline-focus-border",ghost:"bg-field-secondary-background outline outline-1 outline-transparent focus-within:outline-focus-border"},QY={ghost:"cursor-not-allowed text-text-disabled placeholder:text-text-disabled",primary:"outline-border-disabled hover:outline-border-disabled bg-field-background-disabled cursor-not-allowed text-text-disabled placeholder:text-text-disabled",secondary:"outline-border-disabled hover:outline-border-disabled cursor-not-allowed text-text-disabled placeholder:text-text-disabled"},VY=(0,i.createContext)({}),WY=()=>(0,i.useContext)(VY),ZY=(0,i.forwardRef)(({className:e,size:t="sm",open:n=!1,setOpen:r,onOpenChange:a,loading:o=!1,clearAfterSelect:s=!0,closeAfterSelect:l=!0,variant:c="primary",filter:u=!0,...d},f)=>{const[m,p]=(0,i.useState)(""),[h,g]=(0,i.useState)(o??!1),[w,y]=(0,i.useState)(null),b=i.useRef([]),v=(0,i.useMemo)(()=>"function"==typeof r?r:a,[r,a]),{refs:x,floatingStyles:_,context:E}=wa({open:n,onOpenChange:v,placement:"bottom-start",whileElementsMounted:Rn,middleware:[Gn(2),$n({padding:10}),Xn({apply({rects:e,elements:t,availableHeight:n}){t.floating.style.maxHeight=`${n}px`,t.floating.style.width=`${e.reference.width}px`,t.floating.style.fontFamily=window.getComputedStyle(t.reference).fontFamily}})]}),N=Sa(E,{listRef:b,activeIndex:w,onNavigate:y,loop:!0,openOnArrowKeyDown:!1}),M=ga(E),{getReferenceProps:I,getFloatingProps:S,getItemProps:k}=xa([M,N]);return(0,i.useEffect)(()=>{const e=Re(),t=t=>{const n="Mac OS"===e?t.metaKey:t.ctrlKey;if("/"===t.key&&n&&(t.preventDefault(),x.reference&&x.reference.current)){const e=x.reference.current instanceof HTMLElement?x.reference.current.querySelector("input"):null;e&&e.focus()}};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[x.reference]),(0,i.useEffect)(()=>{n||y(null)},[n]),(0,P.jsx)(VY.Provider,{value:{size:t,open:n,onOpenChange:v,refs:x,floatingStyles:_,context:E,getReferenceProps:I,getFloatingProps:S,getItemProps:k,activeIndex:w,setActiveIndex:y,listRef:b,searchTerm:m,setSearchTerm:p,isLoading:h,setIsLoading:g,clearAfterSelect:s,closeAfterSelect:l,variant:c,filter:u},children:(0,P.jsx)("div",{className:Oe("searchbox-wrapper box-border relative w-full",e),...d,ref:f})})});ZY.displayName="SearchBox";const GY=(0,i.forwardRef)(({className:e,type:t="text",placeholder:n="Search...",disabled:r=!1,onChange:a=()=>{},...o},i)=>{const{size:s,refs:l,getReferenceProps:c,searchTerm:u,setSearchTerm:d,open:f,setActiveIndex:m,listRef:p,onOpenChange:h,variant:g}=WY(),w="lg"===s?"sm":"xs";return(0,P.jsxs)("div",{ref:l.setReference,className:Oe("w-full group relative flex justify-center items-center gap-1.5 focus-within:z-10 transition-all ease-in-out duration-200",YY[g],FY.input[s],r?QY[g]:"focus-within:ring-2 focus-within:ring-focus focus-within:ring-offset-2 focus-within:border-focus-border focus-within:hover:border-focus-border",e),...c(),children:[(0,P.jsx)("span",{className:Oe(BY[s],r?"text-icon-disabled":"text-icon-secondary group-hover:text-icon-primary group-focus-within:text-icon-primary","flex justify-center items-center"),children:(0,P.jsx)(kO,{})}),(0,P.jsx)("input",{type:t,ref:i,className:Oe(BY[s],"flex-grow font-medium bg-transparent border-none outline-none border-transparent focus:ring-0 p-0 min-h-fit",r&&"text-field-placeholder focus-within:text-field-input group-hover:text-field-input placeholder:text-field-placeholder"),disabled:r,value:u,onChange:e=>{const t=e.target.value;d(t),a(t),"function"==typeof h&&(t.trim()?h(!0):h(!1))},onFocus:()=>{r||"function"!=typeof h||u?.trim()&&h(!0)},onKeyDown:e=>{if(!r){if("ArrowDown"===e.key||"ArrowUp"===e.key)return void(f&&(e.preventDefault(),"ArrowDown"===e.key?m(e=>null===e?0:e):"ArrowUp"===e.key&&m(e=>{const t=p?.current?.length||0;return null===e&&t>0?t-1:e})));"Escape"===e.key&&h(!1)}},placeholder:n,...(0,UY.omit)(o,["size","open","onOpenChange","loading"])}),(0,P.jsx)(Yf,{label:"Mac OS"===Re()?"⌘/":"Ctrl /",size:w,type:"rounded",variant:"neutral",className:"bg-background-primary"})]})});GY.displayName="SearchBox.Input";const HY=({className:e,children:t,...n})=>{const{size:r,open:a,refs:o,floatingStyles:i,getFloatingProps:s,context:l}=WY();return a?(0,P.jsx)(ia,{context:l,initialFocus:-1,returnFocus:!0,children:(0,P.jsx)("div",{ref:o.setFloating,style:{...i},className:Oe("bg-background-primary rounded-md border border-solid border-border-subtle shadow-soft-shadow-lg overflow-y-auto text-wrap focus:outline-none",FY.dialog[r],e),...s(),...n,children:t})}):null};HY.displayName="SearchBox.Content";const $Y=({children:e,id:t,root:n})=>(0,P.jsx)(Jr,{id:t,root:n,children:e});$Y.displayName="SearchBox.Portal";const XY=({children:e,className:t})=>{const{searchTerm:n,isLoading:r,listRef:a,filter:o=!0}=WY();if(!o)return(0,P.jsx)(gr,{elementsRef:a,children:(0,P.jsx)("div",{className:t,children:e})});const s=i.Children.toArray(e).map(e=>{if(i.isValidElement(e)&&e.type===JY){const t=i.Children.toArray(e.props.children).filter(e=>i.isValidElement(e)&&"string"==typeof e.props.children&&e.props.children.toLowerCase().includes(n.toLowerCase()));return t.length>0?(0,i.cloneElement)(e,{children:t}):null}return e}).filter(Boolean);return r?(0,P.jsx)(eQ,{}):(0,P.jsx)(gr,{elementsRef:a,children:(0,P.jsx)("div",{className:t,children:s.some(e=>i.isValidElement(e)&&e.type!==tQ)?s:(0,P.jsx)(qY,{})})})};XY.displayName="SearchBox.List";const qY=({children:e="No results found.",className:t})=>{const{size:n}=WY();return(0,P.jsx)("div",{className:Oe("flex justify-center items-center",FY.item[n],"text-text-tertiary p-4",t),children:e})};qY.displayName="SearchBox.Empty";const JY=({heading:e,children:t})=>{const{size:n}=WY();return(0,P.jsxs)("div",{className:Oe(FY.content[n],FY.item[n]),children:[e&&(0,P.jsx)("div",{className:Oe(FY.title[n],"text-text-tertiary"),children:e}),t]})};JY.displayName="SearchBox.Group";const KY=(0,i.forwardRef)(({className:e,icon:t,children:n,onClick:r,...a},o)=>{const{size:s,setSearchTerm:l,clearAfterSelect:c,getItemProps:u,activeIndex:d,onOpenChange:f,closeAfterSelect:m}=WY(),{ref:p,index:h}=function(e){void 0===e&&(e={});const{label:t}=e,{register:n,unregister:r,map:a,elementsRef:o,labelsRef:s}=i.useContext(hr),[l,c]=i.useState(null),u=i.useRef(null),d=i.useCallback(e=>{if(u.current=e,null!==l&&(o.current[l]=e,s)){var n;const r=void 0!==t;s.current[l]=r?t:null!=(n=null==e?void 0:e.textContent)?n:null}},[l,o,s,t]);return mr(()=>{const e=u.current;if(e)return n(e),()=>{r(e)}},[n,r]),mr(()=>{const e=u.current?a.get(u.current):null;null!=e&&c(e)},[a]),i.useMemo(()=>({ref:d,index:null==l?-1:l}),[l,d])}(),g=d===h;return(0,P.jsxs)("button",{type:"button",ref:e=>{"function"==typeof o?o(e):o&&(o.current=e),p(e)},className:Oe("flex w-full items-center justify-start gap-1 p-1 cursor-pointer border-none bg-transparent text-left focus:outline-none",g&&"bg-background-secondary",!g&&"hover:bg-background-secondary focus:bg-background-secondary",FY.item[s],e),...u?.({role:"option","aria-selected":g,onClick:()=>{"function"==typeof r&&r(),c&&l(""),m&&f(!1)},...a}),children:[t&&(0,P.jsx)("span",{className:Oe(FY.icon[s],"flex items-center justify-center"),children:t}),(0,P.jsx)("span",{className:Oe("flex-grow py-0.5 px-1 font-normal",FY.item[s]),children:n})]})});KY.displayName="SearchBox.Item";const eQ=({loadingIcon:e=(0,P.jsx)(LO,{})})=>{const{size:t}=WY(),n=i.isValidElement(e)?(0,i.cloneElement)(e,{size:t}):e;return(0,P.jsx)("div",{className:Oe("flex justify-center p-4",BY[t],FY.item[t]),children:n})};eQ.displayName="SearchBox.Loading";const tQ=(0,i.forwardRef)(({className:e,...t},n)=>(0,P.jsx)("hr",{ref:n,className:Oe("border-0 border-t border-border-subtle border-solid m-0",e),...t}));tQ.displayName="SearchBox.Separator",ZY.Input=GY,ZY.Loading=eQ,ZY.Separator=tQ,ZY.Content=HY,ZY.List=XY,ZY.Empty=qY,ZY.Group=JY,ZY.Item=KY,ZY.Portal=$Y;const nQ=function(e){const{label:t,name:n,desc:r,value:a,allowed_products:s=[],include_products:l=[],excluded_products:c=[],excluded_product_ids:u=[],tooltip:d,placeholder:f,onChangeCB:m,nameComp:p,attr:h,isMulti:g=!1,showLabelOnly:w=!1,sectionClass:y="",wrapperClass:b="",labelClass:v="",descClass:x=""}=e,[E,N]=(0,i.useState)(a),[M,I]=(0,i.useState)([]),[S,k]=(0,i.useState)(!1),[j,D]=(0,i.useState)(!1),[C,A]=(0,i.useState)(!1),T=(0,i.useRef)(null),O=(0,i.useRef)("");(0,i.useEffect)(()=>{N(a)},[a]);const P=e=>e?.label?w||!e.value?e.label:`${e.label} (#${e.value})`:"";return(0,o.createElement)("div",{className:`wcf-select2-field wcf-product-field ${y}`},(0,o.createElement)("div",{className:`wcf-selection-field ${b}`},t&&(0,o.createElement)("label",{className:`block text-sm font-medium text-left mb-2 ${v}`},t,d&&(0,o.createElement)(iQ,{text:d})),g?(E||[]).map(e=>(0,o.createElement)("input",{key:e.value,type:"hidden",name:`${n}[]`,value:e.value})):(0,o.createElement)("input",{type:"hidden",name:p?n:`${n}[]`,value:E?.value||""}),g&&(E||[]).length>0&&(0,o.createElement)("div",{className:"mb-2 flex flex-wrap gap-1.5"},(E||[]).map(t=>(0,o.createElement)(Yf,{key:t.value,label:P(t),size:"sm",type:"pill",variant:"neutral",closable:!0,onClose:()=>(t=>{const n=(E||[]).filter(e=>e.value!==t.value);N(n);const r=new CustomEvent("wcf:product:change",{bubbles:!0,detail:{e:{},name:e.name,value:n}});document.dispatchEvent(r),m&&m(n)})(t)}))),!g&&E?.label&&(0,o.createElement)("div",{className:"mb-2 flex"},(0,o.createElement)(Yf,{label:P(E),size:"sm",type:"pill",variant:"neutral",closable:!0,onClose:()=>{N(null);const t=new CustomEvent("wcf:product:change",{bubbles:!0,detail:{e:{},name:e.name,value:null}});document.dispatchEvent(t),m&&m(null)}})),(0,o.createElement)(ZY,(0,_.A)({open:S,setOpen:e=>{e&&O.current.length<3||k(e)},filter:!1,size:"md",variant:"secondary",clearAfterSelect:!0,closeAfterSelect:!0},h),(0,o.createElement)(ZY.Input,{ref:T,placeholder:f||(0,z.__)("Search for a Product","cartflows"),onChange:async e=>{if(O.current=e,e.length>=3){D(!0);const t=new window.FormData;t.append("allowed_products",s),t.append("include_products",l),t.append("exclude_products",c),t.append("action","cartflows_json_search_products"),t.append("security",cartflows_admin.json_search_products_nonce),t.append("term",e);const n=await L()({url:cartflows_admin.ajax_url,method:"POST",body:t})||[],r=Array.isArray(u)&&u.length>0?n.filter(e=>!u.includes(Number(e.value))):n;I(r),A(n.length>0&&0===r.length),D(!1)}else I([]),A(!1),D(!1)},className:"[&>span:last-of-type]:hidden !w-auto"}),(0,o.createElement)(ZY.Portal,null,(0,o.createElement)(ZY.Content,null,(0,o.createElement)(ZY.List,null,j&&(0,o.createElement)(ZY.Loading,null),!j&&M.length>0&&(0,o.createElement)(ZY.Group,null,M.map(t=>(0,o.createElement)(ZY.Item,{key:t.value,onClick:()=>(t=>{const n=g?[...E||[],t]:t;N(n);const r=new CustomEvent("wcf:product:change",{bubbles:!0,detail:{e:{},name:e.name,value:n}});document.dispatchEvent(r),m&&m(n)})(t)},(0,o.createElement)("div",{className:"wcf-select-option--row flex w-full items-center justify-between cursor-pointer"},(0,o.createElement)("div",{className:"wcf-select-option--row-option flex items-center gap-3"},(0,o.createElement)("span",null,t?.label||""," ",t.value?"(#"+t?.value+")":""),t?.stock_status&&(0,o.createElement)("span",{className:`wcf-badge ${t.in_stock?"wcf-badge--success":"wcf-badge--error"} text-xs leading-[0.5rem] capitalize !py-1.5 !px-2 cursor-pointer`},t?.stock_status||"")),t.price_range&&(0,o.createElement)("div",null,(0,o.createElement)("span",{className:"text-xs leading-3 font-normal cursor-pointer"},t?.price_range)))))),!j&&0===M.length&&S&&(0,o.createElement)(ZY.Empty,null,C?(0,z.__)("All matching products are already added.","cartflows"):(0,z.__)("No products found.","cartflows"))))))),r&&(0,o.createElement)("div",{className:`wcf-field-desc text-sm font-normal text-text-tertiary mt-3 ${x}`},fh(r)))},rQ=function(e){const{label:t,name:n,desc:r,value:a,tooltip:s,placeholder:l,onChangeCB:c,nameComp:u,isMulti:d=!1,sectionClass:f="",wrapperClass:m="",descClass:p="",fieldClass:h="",attr:g}=e,w=e=>!d&&Array.isArray(e)?e[0]||null:e,[y,b]=(0,i.useState)(()=>w(a)),[v,x]=(0,i.useState)([]),[E,N]=(0,i.useState)(!1),[M,I]=(0,i.useState)(!1),S=(0,i.useRef)(null),k=(0,i.useRef)("");return(0,i.useEffect)(()=>{b(w(a))},[a]),(0,o.createElement)("div",{className:`wcf-select2-field wcf-coupon-field ${f}`},(0,o.createElement)("div",{className:`wcf-coupon-field-wrapper ${m}`},t&&(0,o.createElement)("label",{className:`block text-sm font-medium text-left mb-2 ${h}`},t,s&&(0,o.createElement)(iQ,{text:s})),d?(y||[]).map(e=>(0,o.createElement)("input",{key:e.value,type:"hidden",name:`${n}[]`,value:e.value})):(0,o.createElement)("input",{type:"hidden",name:u?n:`${n}[]`,value:y?.value||""}),d&&(y||[]).length>0&&(0,o.createElement)("div",{className:"mb-2 flex flex-wrap gap-1.5"},(y||[]).map(t=>(0,o.createElement)(Yf,{key:t.value,label:t.label,size:"sm",type:"pill",variant:"neutral",closable:!0,onClose:()=>(t=>{const n=(y||[]).filter(e=>e.value!==t.value);b(n);const r=new CustomEvent("wcf:coupon:change",{bubbles:!0,detail:{e:{},name:e.name,value:n}});document.dispatchEvent(r),c&&c(n)})(t)}))),!d&&y?.label&&(0,o.createElement)("div",{className:"mb-2 flex"},(0,o.createElement)(Yf,{label:y.label,size:"sm",type:"pill",variant:"neutral",closable:!0,onClose:()=>{b(null);const t=new CustomEvent("wcf:coupon:change",{bubbles:!0,detail:{e:{},name:e.name,value:null}});document.dispatchEvent(t),c&&c(null)}})),(0,o.createElement)(ZY,(0,_.A)({open:E,setOpen:e=>{e&&k.current.length<3||N(e)},filter:!1,size:"md",variant:"secondary",clearAfterSelect:!0,closeAfterSelect:!0},g),(0,o.createElement)(ZY.Input,{ref:S,placeholder:l||(0,z.__)("Search for a coupon","cartflows"),onChange:async e=>{if(k.current=e,e.length>=3){I(!0);const t=new window.FormData;t.append("action","cartflows_json_search_coupons"),t.append("security",cartflows_admin.json_search_coupons_nonce),t.append("term",e);const n=await L()({url:cartflows_admin.ajax_url,method:"POST",body:t});x(n||[]),I(!1)}else x([]),I(!1)},className:"[&>span:last-of-type]:hidden [&>span:last-of-type]:absolute !w-auto"}),(0,o.createElement)(ZY.Portal,null,(0,o.createElement)(ZY.Content,null,(0,o.createElement)(ZY.List,null,M&&(0,o.createElement)(ZY.Loading,null),!M&&v.length>0&&(0,o.createElement)(ZY.Group,null,v.map(t=>(0,o.createElement)(ZY.Item,{key:t.value,onClick:()=>(t=>{const n=d?[...y||[],t]:t;b(n);const r=new CustomEvent("wcf:coupon:change",{bubbles:!0,detail:{e:{},name:e.name,value:n}});document.dispatchEvent(r),c&&c(n)})(t)},(0,o.createElement)("span",null,t?.label||"")))),!M&&0===v.length&&E&&(0,o.createElement)(ZY.Empty,null,(0,z.__)("No coupons found.","cartflows"))))))),r&&(0,o.createElement)("div",{className:`wcf-field-desc flex items-start gap-1 text-sm font-normal text-text-tertiary mt-3 text-left ${p}`},(0,o.createElement)(iU,{className:"w-4 h-4 shrink-0 mt-px"}),(0,o.createElement)("span",null,fh(r))))};function aQ({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"}))}const oQ=i.forwardRef(aQ),iQ=function(e){const{text:t,position:n="default",classes:r="text-text-tertiary",icon:a="",portalId:i="wcf-settings-app",triggers:s=["hover","focus"],arrow:l=!0,interactive:c=!1}=e,u="default"===n?"bottom":n;return(0,o.createElement)(Ja,{content:"string"==typeof t?fh(t):t,placement:u,arrow:l,interactive:c,tooltipPortalId:i,triggers:s,className:"z-[999999]"},(0,o.createElement)("div",{className:Gf()(r,"wcf-tooltip-icon cursor-pointer ml-1")},""===a?(0,o.createElement)(oQ,{className:"w-3.5 h-3.5 stroke-2"}):a))},sQ=function(e){const{subClass:t="",label:n,desc:r}=e;return(0,o.createElement)("div",{className:"wcf-field wcf-sub-heading-field"},n&&(0,o.createElement)("div",{className:`wcf-field__data--label ${t}`},(0,o.createElement)("label",null,n)),r&&(0,o.createElement)("div",{className:"wcf-field__desc text-sm font-regular"},fh(r)))},lQ=function(e){const{name:t,id:n,label:r,value:a,placeholder:s,tooltip:l,desc:c,type:u,min:d,max:f,readonly:m,icon:p,onChangeCB:h,iconOnClick:g,afterClickIcon:w,attr:y}=e,[b,v]=(0,i.useState)(a),[x,E]=(0,i.useState)(u||"password"),[N,M]=(0,i.useState)(p||"");return(0,i.useEffect)(()=>{v(a),E(u),M(p)},[a]),(0,o.createElement)("div",{className:"wcf-field wcf-password-field text-left"},(0,o.createElement)("div",{className:"wcf-field__data flex items-center justify-between gap-2.5"},r&&(0,o.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-text-primary text-left"},(0,o.createElement)("label",{className:"whitespace-nowrap"},r,l&&(0,o.createElement)(iQ,{text:l}))),(0,o.createElement)("div",{className:"wcf-field__data--content w-1/2"},(0,o.createElement)(dp,(0,_.A)({type:x,name:t,value:b,id:n,onChange:function(n){v(n);const r=new CustomEvent("wcf:password:change",{bubbles:!0,detail:{e:{target:{value:n,name:t}},name:e.name,value:n}});document.dispatchEvent(r),h&&h(n)},placeholder:s,min:d,max:f,readOnly:m,size:"md",className:`${e.class?e.class:""} w-full`,suffix:N?(0,o.createElement)("span",{className:`${N} pointer-events-auto cursor-pointer`,onClick:function(){g&&"show_field_value"===g&&("text"===x?(E("password"),M(p)):(E("text"),M(w)))},role:"button",tabIndex:0}):null},y)))),c&&(0,o.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},fh(c)))},cQ=function(){return(0,o.createElement)("div",{className:"wcf-field wcf-separator-field border-x-0 border-t-0 border-b border-solid border-border-subtle"})},uQ=function(e){const t=e.data;let n=e.value;const r=e.displayAs?e.displayAs:"tr";let a="";switch(""===n&&(n=t.value),t.type){case"text":a=(0,o.createElement)(ZO,{id:t.name,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass,class:t?.class,name:t.name,value:t.value?t.value:n,label:t.label,placeholder:t.placeholder,readonly:t.readonly,desc:t.desc,tooltip:t.tooltip,displayAlign:t.display_align});break;case"number":a=(0,o.createElement)(wU,{type:t.type,id:t.name,class:t?.class,name:t.name,value:n,label:t.label,placeholder:t.placeholder,readonly:t.readonly,min:t.min,max:t.max,desc:t.desc,tooltip:t.tooltip,afterfield:t.afterfield,width:t.width,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass,displayAlign:t?.display_align});break;case"checkbox":a=(0,o.createElement)(mO,{id:t.name,name:t.name,className:t?.class,value:n,label:t.label,desc:t.desc,notice:t.notice,backComp:t.backComp,tooltip:t.tooltip,child_className:t.child_class,isDisabled:t.isDisabled,displayAlign:t.display_align,isPro:t.is_pro});break;case"toggle":a=(0,o.createElement)(mQ,{id:t.name,name:t.name,className:t.class,value:n,label:t.label,desc:t.desc,notice:t.notice,backComp:t.backComp,tooltip:t.tooltip,child_className:t.child_class,displayAlign:t.display_align,fullWidth:t.is_fullwidth,isDisabled:t?.is_disabled});break;case"radio":a=(0,o.createElement)(IO,{id:t.name,name:t.name,value:void 0===n?"":n,label:t.label,options:t.options,desc:t.desc,tooltip:t.tooltip,child_className:t.child_class});break;case"textarea":a=(0,o.createElement)(HO,{id:t.name,name:t.name,className:t?.class,value:n,label:t.label,desc:t.desc,tooltip:t.tooltip,rows:t.rows,cols:t.cols,displayAlign:t.display_align});break;case"code":a=(0,o.createElement)($O,{id:t.name,name:t.name,value:n,label:t.label,tooltip:t.tooltip,displayAlign:t.display_align,language:t.language});break;case"select":a=(0,o.createElement)(WO,{id:t.name,name:t.name,class:t.class,value:n,label:t.label,options:t.options,desc:t.desc,tooltip:t.tooltip,prodata:t?.pro_options,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,contentClass:t?.contentClass,labelClass:t?.labelClass,descClass:t?.descClass,displayAlign:t?.display_align,isDisabled:t.isDisabled});break;case"select_card":a=(0,o.createElement)(pQ,{id:t.name,name:t.name,value:n,label:t.label,options:t.options,desc:t.desc,tooltip:t.tooltip,prodata:t?.pro_options,layout:t?.layout,showRadio:t?.display_radio});break;case"select2":a=(0,o.createElement)(YR,{id:t.name,name:t.name,value:n,label:t.label,placeholder:t.placeholder,desc:t.desc,tooltip:t.tooltip,options:t.options,isMulti:t.isMulti,displayAlign:t.display_align,isSearchable:t?.enable_search});break;case"product":a=(0,o.createElement)("div",null,(0,o.createElement)(nQ,{name:t.name,label:t.label,desc:t.desc,field:t.fieldtype,allowed_products:t.allowed_product_types?t.allowed_product_types:"",include_products:t.include_product_types?t.include_product_types:"",excluded_products:t.excluded_product_types?t.excluded_product_types:"",placeholder:t.placeholder,tooltip:t.tooltip,value:n,nameComp:t.nameComp,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass}));break;case"coupon":a=(0,o.createElement)("div",null,(0,o.createElement)(rQ,{name:t.name,label:t.label,desc:t.desc,field:t.fieldtype,placeholder:t.placeholder,tooltip:t.tooltip,value:n,nameComp:t.nameComp}));break;case"product-repeater":a=(0,o.createElement)(cU,{id:t.name,name:t.name,value:n,label:t.label,products:t.products});break;case"font-family":a=(0,o.createElement)(mU,{id:t.name,name:t.name,value:n,label:t.label,desc:t.desc,tooltip:t.tooltip,font_weight_name:t.font_weight_name,font_weight_value:t.font_weight_value,displayAlign:t.display_align});break;case"separator":a=(0,o.createElement)(cQ,null);break;case"sub-heading":a=(0,o.createElement)(sQ,{subclassName:t.subClass,label:t.label,desc:t.desc});break;case"color-picker":a=(0,o.createElement)(dU,{id:t.name,name:t.name,label:t.label,value:n,desc:t.desc,tooltip:t.tooltip,displayAlign:t.display_align,withBg:t.withBg});break;case"password":a=(0,o.createElement)(lQ,{type:t.type,id:t.name,name:t.name,value:t.value?t.value:n,label:t.label,placeholder:t.placeholder,readonly:t.readonly,desc:t.desc,tooltip:t.tooltip,class:t.class,icon:t.icon,iconOnClick:t.iconclick,afterClickIcon:t.afterIcon});break;case"image-selector":const r=t?.objName?t?.objName:"product_img_obj",i=e?.options&&e?.options[r]?e?.options[r]:t?.value;a=(0,o.createElement)(gU,{id:t.name,name:t.name,label:t.label,value:n,desc:t.desc,tooltip:t.tooltip,isNameArray:t.isNameArray,objName:r,objValue:i,singleButton:t?.singleButton,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass,displayAlign:t?.display_align});break;case"doc":a=(0,o.createElement)(zY,{content:t?.content,icon:t?.icon||""});break;case"pro-notice":a=(0,o.createElement)("p",{className:"wcf-pro-update-notice"},(0,z.sprintf)(/* translators: %s is replaced with feature name */ /* translators: %s is replaced with feature name */ |
| 12 |
(0,z.__)("Please upgrade to the CartFlows Higher Plan to use the %s feature.","cartflows"),t.feature));break;case"heading":a=(0,o.createElement)(PY,{label:t.label,desc:t.desc,sectionClass:t?.sectionClass,labelClass:t?.labelClass,descClass:t?.descClass});break;case"checkout-link-generator":a=(0,o.createElement)(xQ,{stepId:t.step_id});break;case"wp-editor":a=(0,o.createElement)(dQ,{name:t.name,value:n,label:t.label,desc:t.desc,tooltip:t.tooltip,rows:t.rows,cols:t.cols,id:t.id,sectionClass:t?.sectionClass,wrapperClass:t?.wrapperClass,labelClass:t?.labelClass,descClass:t?.descClass,displayAlign:t?.display_align})}return"tr"===r?(0,o.createElement)("tr",{className:`wcf-field-row-${e.field} ${e.class?e.class:""} ${e.isActive?"":"wcf-hide"}`,key:t.name},(0,o.createElement)("th",{scope:"row",className:"py-2"},(0,o.createElement)(o.Fragment,null,a))):(0,o.createElement)("div",{key:t.name,className:`wcf-${e.tabName}-tab--row wcf-field-row-${e.field} mb-4 last:mb-0 ${e.class?e.class:""} ${e.isActive?"":"hidden"}`},a)},dQ=function(e){const{name:t,value:n,label:r,desc:a,id:s,tooltip:l,rows:c,cols:u,sectionClass:d=!1,wrapperClass:f=!1,labelClass:m,descClass:p,displayAlign:h="horizontal"}=e,[g,w]=(0,i.useState)(n),y=d||"text-left",b=p||"text-sm font-normal text-text-tertiary mt-2";let v=f||"flex items-center gap-2.5",x=m||"text-sm font-medium text-text-primary text-left mb-2";function _(t,n){w(n);const r=new CustomEvent("wcf:wpeditor:change",{bubbles:!0,detail:{e:t,name:e.name,value:n}});document.dispatchEvent(r)}return"horizontal"!==h&&(v="block w-full text-left",x+=" mb-2"),(0,i.useEffect)(()=>{let e=!0;return e&&(wp.editor.initialize(s,{tinymce:!0,quicktags:!0,mediaButtons:!1}),jQuery(document).on("tinymce-editor-setup",function(e,n){n.settings.toolbar1="bold,italic,underline,blockquote,strikethrough,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,cartflows_ob",n.on("change",function(){_(e,n.getContent())}),n.on("keyup",function(){_(e,n.getContent())}),n.settings.forced_root_block=!1,"desc_text"===t&&n.addButton("cartflows_ob",{type:"menubutton",text:"",icon:"cartflows-logo cartflows-logo-icon",menu:[{text:"Product Name",value:"{{product_name}}",onclick(){n.insertContent(this.value())}},{text:"Product Desc",value:"{{product_desc}}",onclick(){n.insertContent(this.value())}},{text:"Product Price",value:"{{product_price}}",onclick(){n.insertContent(this.value())}},{text:"Product Quantity",value:"{{quantity}}",onclick(){n.insertContent(this.value())}}].sort(function(e,t){return e.text.localeCompare(t.text)})})})),()=>{e=!1,tinymce.activeEditor.destroy()}},[]),(0,o.createElement)("div",{className:`wcf-field wcf-wp-editor-field ${y}`},(0,o.createElement)("div",{className:`wcf-field__data ${v}`},r&&(0,o.createElement)("div",{className:`wcf-field__data--label ${x}`},(0,o.createElement)("label",null,r,l&&(0,o.createElement)(iQ,{text:l}))),(0,o.createElement)("div",{className:"wcf-field__data--content"},(0,o.createElement)("textarea",{className:e.class,name:t,value:g,id:s,rows:c||"10",cols:u||"60",onChange:function(t){w(t.target.value);const n=new CustomEvent("wcf:wpeditor:change",{bubbles:!0,detail:{e:t,name:e.name,value:t.target.value}});document.dispatchEvent(n)}}))),a&&(0,o.createElement)("div",{className:`wcf-field__desc ${b}`},fh(a)))},fQ=function(e){const{name:t,value:n,fields:r}=e,[a,i]=l().useState(n);function s(e){i(e.target.value)}return(0,o.createElement)(o.Fragment,null,r.map((e,n)=>(0,o.createElement)(ZO,{key:n,name:t+`[${e.name}]`,label:e.label,placeholder:e.placeholder,value:kh(a[e.name]),onChange:s,tooltip:e.tooltip})))},mQ=function({onChange:e,...t}){const{name:n,id:r,label:a,value:s,desc:l,backComp:c=!1,onClick:u,notice:d,isDisabled:f=!1,tooltip:m,sectionClass:p="",wrapperClass:h="",labelClass:g="",descClass:w="",displayAlign:y="horizontal",fullWidth:b=!0}=t,[v,x]=(0,i.useState)(s),[_,E]=(0,i.useState)(!1),[N,M]=(0,i.useState)(""),I=p||"text-left",S=g||"text-sm font-medium text-text-primary",k=w||"text-sm font-normal text-text-secondary mt-2";let j=h||"flex items-center py-1 "+(b?"justify-between":"");"horizontal"!==y&&(j="block w-full text-left"),(0,i.useEffect)(()=>{x(s)},[s]);const D=c?"enable":"yes",C=c?"disable":"no",A=(0,i.useCallback)(t=>{const r=t?D:C;x(r);const a=new CustomEvent("wcf:toggle:change",{bubbles:!0,detail:{name:n,value:r}});document.dispatchEvent(a),e&&e({name:n,value:r}),u&&u()},[D,C,n,e,u]);function T(){"prompt"===d.type&&N!==d.check.toUpperCase()||(E(!1),M(""),"alert"!==d.type&&A(!0))}function O(){E(!1),M("")}return(0,o.createElement)("div",{className:`wcf-field wcf-toggle-field ${I} `},(0,o.createElement)("div",{className:`wcf-field__data ${j}`},a&&(0,o.createElement)("div",{className:"wcf-field__data--content-left flex-1 min-w-0"},(0,o.createElement)("div",{className:`wcf-field__data--label ${S}`},(0,o.createElement)("label",null,a,m&&(0,o.createElement)(iQ,{text:m}))),l&&(0,o.createElement)("div",{className:`wcf-field__desc ${k}`},fh(l))),(0,o.createElement)("div",{className:"wcf-field__data--content-right ml-2"},(0,o.createElement)("div",{className:"flex justify-center"},(0,o.createElement)("input",{type:"hidden",name:n,value:v}),(0,o.createElement)(bO,{id:r||n,value:D===v,onChange:function(e){if(e&&d)return"alert"===d.type?void E(!0):"confirm"===d.type||"prompt"===d.type?(M(""),void E(!0)):void 0;A(e)},disabled:f})))),!a&&l&&(0,o.createElement)("div",{className:`wcf-field__desc ${k}`},fh(l)),function(){if(!d)return null;const e="prompt"===d.type,t="alert"===d.type,n=!e||N===d.check.toUpperCase();return(0,o.createElement)($m,{open:_,setOpen:e=>{e||O()},exitOnClickOutside:!1,exitOnEsc:!0,className:"wcf-toggle-notice-popup"},(0,o.createElement)($m.Panel,{className:"sm:max-w-lg w-full"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)($m.Header,{className:"flex items-center justify-between !space-y-0"},(0,o.createElement)("div",{className:"flex items-center gap-2"},(0,o.createElement)(uh,{className:"w-8 h-8 text-support-warning","aria-hidden":"true"}),(0,o.createElement)($m.Title,null,t?(0,z.__)("Notice","cartflows"):(0,z.__)("Confirmation Required","cartflows"))),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)($m.Body,null,(0,o.createElement)("p",{className:"text-sm text-text-secondary m-0"},d.message),e&&(0,o.createElement)("div",{className:"mt-4"},(0,o.createElement)(dp,{value:N,onChange:e=>M(e),placeholder:d.check.toUpperCase(),size:"md"}))),(0,o.createElement)($m.Footer,{className:"flex gap-3 justify-end"},t?(0,o.createElement)(Va,{variant:"primary",size:"md",onClick:O},(0,z.__)("OK","cartflows")):(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:O},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(Va,{variant:"primary",size:"md",destructive:!0,onClick:T,disabled:!n},(0,z.__)("Confirm","cartflows"))))))}())},pQ=function(e){const{name:t,label:n,desc:r,tooltip:a,options:s,layout:l="horizontal",value:c,showRadio:u=!0,after:d}=e;(0,i.useEffect)(()=>{void 0===c&&m("")},[]);const[f,m]=(0,i.useState)(c);function p(t){m(t);const n=new CustomEvent("wcf:selectioncard:change",{bubbles:!0,detail:{e:{},name:e.name,newValue:t}});document.dispatchEvent(n)}function h(e){return e.tooltip?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(iQ,{text:e.tooltip}),e.label):e.desc?{heading:e.label,description:e.desc}:e.label}return(0,o.createElement)("div",{className:"wcf-field wcf-select-option--card"},(0,o.createElement)("div",{className:"wcf-field__data flex flex-col gap-6"},n&&r&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-field__data--content-left"},n&&(0,o.createElement)("div",{className:"wcf-field__data--label text-sm font-medium text-text-primary text-left"},(0,o.createElement)("label",null,n,a&&(0,o.createElement)(iQ,{text:a})))),(0,o.createElement)("div",{className:"wcf-field__desc text-sm text-left font-normal text-text-tertiary"},fh(r))),(0,o.createElement)("div",{className:"wcf-field__data--content-right w-full"},"horizontal"===l?(0,o.createElement)("div",{className:"grid gap-[13px]",style:{gridTemplateColumns:`repeat(${s.length}, minmax(0, 1fr))`}},s.map(e=>{const n=f===e.value;return(0,o.createElement)("label",{key:e.value,className:"flex flex-col items-center gap-3 p-3 rounded-md cursor-pointer transition-all relative border border-solid "+(n?"border-brand-300 bg-brand-25":"border-border-subtle hover:border-border-interactive")},(0,o.createElement)("input",{type:"radio",name:t,value:e.value,checked:n,onChange:()=>p(e.value),className:"sr-only"}),u&&(0,o.createElement)("span",{className:"absolute top-2.5 right-2.5 size-4 rounded-full border border-solid flex items-center justify-center "+(n?"bg-toggle-on border-toggle-on":"bg-background-primary border-field-border")},n&&(0,o.createElement)("span",{className:"size-1.5 rounded-full bg-background-primary"})),e.image&&(0,o.createElement)("img",{src:e.image,alt:e.label,className:"wcf-selection-card--image size-11"}),(0,o.createElement)("span",{className:"text-sm font-semibold text-center leading-5 whitespace-nowrap flex items-center gap-1 "+(n?"text-brand-500":"text-text-primary")},e.tooltip&&(0,o.createElement)(iQ,{text:e.tooltip,classes:n?"text-brand-500":"hover:text-brand-500"}),e.label))})):(0,o.createElement)(MO.Group,{name:t,value:f,onChange:p,style:"simple",vertical:!0,columns:1,gapClassName:"gap-0"},s.map((e,t)=>(0,o.createElement)(MO.Button,(0,_.A)({key:t,value:e.value,label:h(e)},e.image&&{icon:(0,o.createElement)("img",{src:e.image,alt:e.label,className:"wcf-selection-card--image w-12 h-12"})},{minWidth:!1,buttonWrapperClasses:"[&_label]:text-left "+(e.desc?"[&_p:last-child]:!text-text-secondary":"")}))))),d&&(0,o.createElement)("div",{className:"wcf-field__data--content__after"},d)),!n&&r&&(0,o.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-tertiary mt-2"},fh(r)))},hQ=function(e){const{name:t,id:n,label:r,desc:a,tooltip:s,options:l,onSelect:c,after:u,isSearchable:d=!1}=e,[f,m]=(0,i.useState)(()=>l.find(t=>t.value===e.value)||null),p=(0,i.useRef)(null);return(0,o.createElement)("div",{className:"wcf-field wcf-select-with-icons-option"},(0,o.createElement)("div",{className:"wcf-field__data"},r&&(0,o.createElement)("div",{className:"wcf-field__data--label text-sm font-normal text-left"},(0,o.createElement)("label",null,r,s&&(0,o.createElement)(iQ,{text:s}))),(0,o.createElement)("div",{className:"wcf-field__data--content"},(0,o.createElement)("input",{type:"hidden",ref:p,name:t,defaultValue:f?.value||""}),(0,o.createElement)(VO,{id:n,value:f,onChange:function(t){m(t),p.current&&(p.current.value=t.value);const n=new CustomEvent("wcf:select:change",{bubbles:!0,detail:{e:t,name:e.name,value:t.value,icon:t.icon}});document.dispatchEvent(n),e?.callback&&e.callback(t,e.name,t.value),c&&c()},by:"value",combobox:d,size:"sm"},(0,o.createElement)(VO.Button,{placeholder:"",render:e=>(0,o.createElement)(iQ,{text:e?.label||"",icon:e?.icon||(0,o.createElement)(HR,{className:"w-5 h-5"}),classes:"!ml-0"}),type:"button",className:e.class}),(0,o.createElement)(VO.Options,null,l.map(e=>(0,o.createElement)(VO.Option,{key:e.value,value:e},(0,o.createElement)(iQ,{text:e.label,icon:e.icon,classes:"group-hover:text-text-on-color !ml-0"})))))),u&&(0,o.createElement)("div",{className:"wcf-field__data--content__after"},u)),a&&(0,o.createElement)("div",{className:"wcf-field__desc text-sm font-regular"},fh(a)))},gQ=e=>(0,o.createElement)("span",{className:`inline-block h-18 w-18 animate-spin rounded-full border-2 border-solid border-brand-500 border-r-transparent align-[-0.125em] mr-1 ${e.className?e.className:""}`});function wQ({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"}))}const yQ=i.forwardRef(wQ),bQ={billing:["billing_country","billing_address_2","billing_address_1","billing_city","billing_state","billing_postcode"],shipping:["shipping_country","shipping_address_2","shipping_address_1","shipping_city","shipping_state","shipping_postcode"]},vQ=function({preSelectedStepId:e=null,isStoreCheckout:t=!1}){const[n,r]=(0,i.useState)([]),[a,s]=(0,i.useState)(e||""),[l,c]=(0,i.useState)(""),[u,d]=(0,i.useState)([]),[f,m]=(0,i.useState)({}),[p,h]=(0,i.useState)([]),[g,w]=(0,i.useState)(null),[y,b]=(0,i.useState)([]),[v,x]=(0,i.useState)([]),[_,E]=(0,i.useState)([]),[N,M]=(0,i.useState)(!0),[I,S]=(0,i.useState)(!1),[k,j]=(0,i.useState)(!1);(0,i.useEffect)(()=>{L()({path:"/cartflows-pro/v1/admin/checkout-link-data/steps"}).then(t=>{if(r(t),M(!1),e){const n=t.find(t=>t.id===parseInt(e,10));n&&c(n.permalink)}}).catch(()=>M(!1))},[]),(0,i.useEffect)(()=>{L()({path:"/cartflows-pro/v1/admin/checkout-link-data/coupons"}).then(e=>b(e)).catch(()=>{})},[]),(0,i.useEffect)(()=>{t&&L()({path:"/cartflows-pro/v1/admin/checkout-link-data/products"}).then(e=>x(e)).catch(()=>{})},[t]),(0,i.useEffect)(()=>{if(!a)return d([]),m({}),h([]),void c("");S(!0);const e=n.find(e=>e.id===parseInt(a,10));e&&c(e.permalink),L()({path:`/cartflows-pro/v1/admin/checkout-link-data/fields/${a}`}).then(e=>{d(e);const t={};e.forEach(e=>{t[e.id]=""}),m(t),h([]),S(!1)}).catch(()=>S(!1))},[a]);const D=(0,i.useMemo)(()=>{const e=u.find(e=>"country"===e.type);return e?.states||{}},[u]),C=(0,i.useMemo)(()=>{const e=(e,t)=>{const n=u.some(t=>t.section===e&&"address"===t.group),r=u.filter(t=>t.section===e&&"address"!==t.group).map(t=>({label:t.label,value:t.id,section:e}));return{label:t,options:[...n?[{label:t+" "+(0,z.__)("Address","cartflows"),value:`__${e}_address__`,type:"address_group",section:e}]:[],...r]}};return[e("billing",(0,z.__)("Billing","cartflows")),e("shipping",(0,z.__)("Shipping","cartflows"))].filter(e=>e.options.length>0)},[u]),A=(0,i.useCallback)(()=>{if(!l||!a)return"";const e=[];if(p.filter(e=>"address_group"!==e.type).forEach(t=>{const n=f[t.value];n&&""!==n.trim()&&e.push(`${encodeURIComponent(t.value)}=${encodeURIComponent(n)}`)}),p.filter(e=>"address_group"===e.type).forEach(t=>{(bQ[t.section]||[]).forEach(t=>{const n=f[t];n&&""!==n.trim()&&e.push(`${encodeURIComponent(t)}=${encodeURIComponent(n)}`)})}),g?.value&&e.push(`coupon=${encodeURIComponent(g.value)}`),_.length>0){const t=_.map(e=>e.value).join(",");e.push(`wcf-add-to-cart=${encodeURIComponent(t)}`)}if(0===e.length)return l;const t=l.includes("?")?"&":"?";return`${l}${t}${e.join("&")}`},[l,a,p,f,g,_]),T=(e,t)=>{m(n=>({...n,[e]:t}))};return(0,o.createElement)("div",{className:"wcf-checkout-link-generator"},!e&&(0,o.createElement)("div",{className:"wcf-field__data flex items-start gap-6 mb-6"},(0,o.createElement)("div",{className:"wcf-field__data--content-left flex-[0_0_35%]"},(0,o.createElement)("label",{className:"text-sm font-medium text-text-primary"},(0,z.__)("Checkout Step","cartflows")),(0,o.createElement)("p",{className:"text-sm text-text-secondary mt-1"},(0,z.__)("Choose the checkout page to build a link for.","cartflows"))),(0,o.createElement)("div",{className:"wcf-field__data--content-right flex-1"},N?(0,o.createElement)("div",{className:"animate-pulse h-9 bg-background-secondary rounded-md w-full"}):(0,o.createElement)("select",{className:"input-field !pl-3 !pr-6 !py-2 !text-sm font-normal !rounded-md text-text-primary !border-border-subtle w-full",value:a,onChange:e=>s(e.target.value)},(0,o.createElement)("option",{value:""},(0,z.__)("— Select a Step —","cartflows")),n.map(e=>(0,o.createElement)("option",{key:e.id,value:e.id},e.title))))),a&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("hr",{className:"border-border-subtle mb-6"}),I?(0,o.createElement)("div",{className:"space-y-3"},[1,2,3].map(e=>(0,o.createElement)("div",{key:e,className:"animate-pulse h-10 bg-background-secondary rounded-md"}))):(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-field__data flex items-start gap-6 mb-2"},(0,o.createElement)("div",{className:"wcf-field__data--content-left flex-[0_0_35%]"},(0,o.createElement)("label",{className:"text-sm font-medium text-text-primary"},(0,z.__)("Select Fields","cartflows")),(0,o.createElement)("p",{className:"text-xs text-text-secondary mt-1"},(0,z.__)("Select the checkout fields to include in the URL.","cartflows"))),(0,o.createElement)("div",{className:"wcf-field__data--content-right flex-1"},(0,o.createElement)(YR,{name:"wcf_clg_fields",isMulti:!0,isSearchable:!0,options:C,value:p,placeholder:(0,z.__)("Select fields…","cartflows"),onChangeCB:e=>{const t=e||[],n=p.filter(e=>"address_group"===e.type&&!t.find(t=>t.value===e.value));if(n.length>0){const e={};n.forEach(t=>{(bQ[t.section]||[]).forEach(t=>{e[t]=""})}),m(t=>({...t,...e}))}h(t)},className:"!m-0"}))),p.length>0&&(0,o.createElement)("div",{className:"mb-4 border-t border-border-subtle pb-4"},p.filter(e=>"address_group"!==e.type).map(t=>((t,n,r)=>{const a=u.find(e=>e.id===t),i="country"===a?.type&&a?.options&&Object.keys(a.options).length>0;return(0,o.createElement)("div",{key:t,className:"wcf-field__data flex items-center gap-6 py-3 border-0"},(0,o.createElement)("div",{className:"wcf-field__data--content-left flex-[0_0_35%]"},(0,o.createElement)("label",{htmlFor:`wcf_clg_${t}`,className:"text-sm font-medium text-text-primary"},n),r&&(0,o.createElement)("span",{className:"block text-xs text-text-secondary mt-0.5"},"billing"===r?(0,z.__)("Billing","cartflows"):(0,z.__)("Shipping","cartflows"))),(0,o.createElement)("div",{className:"wcf-field__data--content-right flex-1 "+(e?"":"!ml-5")},i?(0,o.createElement)("select",{id:`wcf_clg_${t}`,name:`wcf_clg_${t}`,className:"input-field !pl-3.5 !pr-6 !py-2.5 !text-sm font-normal !rounded-md text-text-primary !border-border-subtle w-full",value:f[t]||"",onChange:e=>T(t,e.target.value)},(0,o.createElement)("option",{value:""},(0,z.__)("Select Country","cartflows")),Object.entries(a.options).map(([e,t])=>(0,o.createElement)("option",{key:e,value:e},t))):(0,o.createElement)(ZO,{name:`wcf_clg_${t}`,id:`wcf_clg_${t}`,value:f[t]||"",placeholder:(0,z.__)("Enter value","cartflows"),onChangeCB:e=>T(t,e),sectionClass:"!p-0",wrapperClass:"block w-full"})))})(t.value,t.label,t.section)),p.filter(e=>"address_group"===e.type).map(e=>(e=>{const t=`${e}_state`,n=f[`${e}_country`]||"",r=n&&D[n]||{},a="billing"===e?(0,z.__)("Billing Address","cartflows"):(0,z.__)("Shipping Address","cartflows"),i=(bQ[e]||[]).map(e=>u.find(t=>t.id===e)).filter(Boolean),s="block w-full rounded-md border border-border-subtle bg-white px-3.5 py-2.5 text-sm text-text-primary focus:outline-none focus:ring-1 focus:ring-border-strong",l=s;return(0,o.createElement)("div",{key:e,className:"mt-4 rounded-lg border border-border-subtle overflow-hidden"},(0,o.createElement)("div",{className:"px-4 py-3 bg-background-secondary border-b border-border-subtle"},(0,o.createElement)("span",{className:"text-sm font-semibold text-text-primary"},a)),(0,o.createElement)("div",{className:"divide-y divide-border-subtle"},i.map(e=>{const a=e.id,i="country"===e.type,c=a===t;return(0,o.createElement)("div",{key:a,className:"flex items-center gap-4 px-4 py-3"},(0,o.createElement)("label",{htmlFor:`wcf_clg_${a}`,className:"w-36 shrink-0 text-sm text-text-secondary"},e.label),(0,o.createElement)("div",{className:"flex-1 min-w-0"},i&&(0,o.createElement)("select",{id:`wcf_clg_${a}`,className:l,value:f[a]||"",onChange:e=>{T(a,e.target.value),T(t,"")}},(0,o.createElement)("option",{value:""},(0,z.__)("Select Country","cartflows")),Object.entries(e.options).map(([e,t])=>(0,o.createElement)("option",{key:e,value:e},t))),c&&(0,o.createElement)("select",{id:`wcf_clg_${a}`,className:`${l} disabled:opacity-50 disabled:cursor-not-allowed`,value:f[a]||"",disabled:!n,onChange:e=>T(a,e.target.value)},(0,o.createElement)("option",{value:""},n?(0,z.__)("Select State","cartflows"):(0,z.__)("Select a country first","cartflows")),Object.entries(r).map(([e,t])=>(0,o.createElement)("option",{key:e,value:e},t))),!i&&!c&&(0,o.createElement)("input",{type:"text",id:`wcf_clg_${a}`,name:`wcf_clg_${a}`,className:s,value:f[a]||"",placeholder:(0,z.__)("Enter value","cartflows"),onChange:e=>T(a,e.target.value)})))})))})(e.section))),(0,o.createElement)("hr",{className:"border-border-subtle mb-4"}),(0,o.createElement)("div",{className:"wcf-field__data flex items-start gap-6 mb-6"},(0,o.createElement)("div",{className:"wcf-field__data--content-left flex-[0_0_35%]"},(0,o.createElement)("label",{className:"text-sm font-medium text-text-primary"},(0,z.__)("Coupon","cartflows")),(0,o.createElement)("p",{className:"text-xs text-text-secondary mt-1"},(0,z.__)("Select a coupon to apply at checkout.","cartflows"))),(0,o.createElement)("div",{className:"wcf-field__data--content-right flex-1"},(0,o.createElement)(YR,{name:"wcf_clg_coupon",isMulti:!1,isSearchable:!0,isClearable:!0,options:y,value:g,placeholder:(0,z.__)("Select Coupon","cartflows"),onChangeCB:e=>w(e||null),className:"!m-0"}),g&&(()=>{const e=y.find(e=>e.value===g.value);return e?(0,o.createElement)("div",{className:"mt-3 rounded-md border border-border-subtle overflow-hidden"},(0,o.createElement)("div",{className:"px-4 py-2.5 bg-background-secondary border-b border-border-subtle"},(0,o.createElement)("span",{className:"text-xs font-semibold text-text-primary"},(0,z.__)("Coupon Details","cartflows"))),(0,o.createElement)("div",{className:"px-4 py-3 text-xs text-text-secondary space-y-2"},(0,o.createElement)("div",{className:"flex gap-2"},(0,o.createElement)("span",{className:"font-medium text-text-primary"},(0,z.__)("Type:","cartflows")),(0,o.createElement)("span",null,e.discount_type)),(0,o.createElement)("div",{className:"flex gap-2"},(0,o.createElement)("span",{className:"font-medium text-text-primary"},(0,z.__)("Amount:","cartflows")),(0,o.createElement)("span",null,e.amount)),e.expiry_date&&(0,o.createElement)("div",{className:"flex gap-2"},(0,o.createElement)("span",{className:"font-medium text-text-primary"},(0,z.__)("Expires:","cartflows")),(0,o.createElement)("span",null,e.expiry_date)),e.description&&(0,o.createElement)("div",{className:"flex gap-2"},(0,o.createElement)("span",{className:"font-medium text-text-primary"},(0,z.__)("Description:","cartflows")),(0,o.createElement)("span",null,e.description)))):null})())),t&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("hr",{className:"border-border-subtle mb-4"}),(0,o.createElement)("div",{className:"wcf-field__data flex items-start gap-6 mb-6"},(0,o.createElement)("div",{className:"wcf-field__data--content-left flex-[0_0_35%]"},(0,o.createElement)("label",{className:"text-sm font-medium text-text-primary"},(0,z.__)("Select Products","cartflows")),(0,o.createElement)("p",{className:"text-xs text-text-secondary mt-1"},(0,z.__)("Choose products to add to the cart when this checkout link is visited. Selected products will be added to the cart automatically when the link is opened.","cartflows"))),(0,o.createElement)("div",{className:"wcf-field__data--content-right flex-1"},(0,o.createElement)(YR,{name:"wcf_clg_products",isMulti:!0,isSearchable:!0,isClearable:!0,options:v,value:_,placeholder:(0,z.__)("Select products…","cartflows"),onChangeCB:e=>E(e||[]),className:"!m-0"})))),(0,o.createElement)("hr",{className:"border-border-subtle mb-6"}),(0,o.createElement)("div",{className:"wcf-field__data flex items-start gap-6 mb-4"},(0,o.createElement)("div",{className:"wcf-field__data--content-left flex-[0_0_35%]"},(0,o.createElement)("label",{className:"text-sm font-medium text-text-primary"},(0,z.__)("Checkout URL","cartflows"))),(0,o.createElement)("div",{className:"wcf-field__data--content-right flex-1"},(0,o.createElement)("textarea",{className:"w-full input-field font-mono !text-xs !text-text-secondary !py-3 !px-3 !border-border-subtle !rounded-md bg-background-secondary",rows:4,readOnly:!0,value:A()}))),(0,o.createElement)("div",{className:"flex justify-end"},(0,o.createElement)(Va,{variant:"primary",size:"sm",type:"button",icon:k?(0,o.createElement)(qO,{className:"w-4 h-4"}):(0,o.createElement)(yQ,{className:"w-4 h-4"}),onClick:()=>{const e=A();if(e)if(navigator.clipboard)navigator.clipboard.writeText(e).then(()=>{j(!0),setTimeout(()=>j(!1),2e3)});else{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),j(!0),setTimeout(()=>j(!1),2e3)}}},k?(0,z.__)("Copied!","cartflows"):(0,z.__)("Copy URL","cartflows"))))))},xQ=function(){const[{step_data:e,flow_type:t}]=ZR(),n=e?.id||null,r="storeCheckout"===t;return(0,o.createElement)("div",{className:"wcf-field wcf-checkout-link-generator-field"},(0,o.createElement)(vQ,{preSelectedStepId:n,isStoreCheckout:r}))},_Q=(0,i.createContext)(null);const EQ=e=>!e.isLayoutDirty&&e.willUpdate(!1);function NQ(){const e=new Set,t=new WeakMap,n=()=>e.forEach(EQ);return{add:r=>{e.add(r),t.set(r,r.addEventListener("willUpdate",n))},remove:r=>{e.delete(r);const a=t.get(r);a&&(a(),t.delete(r)),n()},dirty:n}}const MQ=e=>!0===e,IQ=({children:e,id:t,inherit:n=!0})=>{const r=(0,i.useContext)($c),a=(0,i.useContext)(_Q),[o,s]=function(){const e=function(){const e=(0,i.useRef)(!1);return Od(()=>(e.current=!0,()=>{e.current=!1}),[]),e}(),[t,n]=(0,i.useState)(0),r=(0,i.useCallback)(()=>{e.current&&n(t+1)},[t]);return[(0,i.useCallback)(()=>$o.postRender(r),[r]),t]}(),l=(0,i.useRef)(null),c=r.id||a;null===l.current&&((e=>MQ(!0===e)||"id"===e)(n)&&c&&(t=t?c+"-"+t:c),l.current={id:t,group:MQ(n)&&r.group||NQ()});const u=(0,i.useMemo)(()=>({...l.current,forceRender:o}),[s]);return(0,P.jsx)($c.Provider,{value:u,children:e})},SQ=(0,i.createContext)({}),kQ=()=>(0,i.useContext)(SQ),jQ=(0,i.createContext)(null),DQ=({children:e,activeItem:t=null,onChange:n,className:r,size:a="sm",orientation:o="horizontal",variant:s="pill",iconPosition:l="left",width:c="full"})=>{const u=cp(),d=kQ()?.activeItem||t,f=(0,i.useCallback)((e,t)=>{n&&n({event:e,value:t})},[n]);let m,p="rounded-full",h="p-1",g="ring-1 ring-tab-border";"vertical"===o?m="gap-0.5":("rounded"===s||"pill"===s)&&("xs"===a||"sm"===a?m="gap-0.5":("md"===a||"lg"===a)&&(m="gap-1")),"rounded"===s||"vertical"===o?p="rounded-md":"underline"===s&&(p="rounded-none",h="p-0",g="border-t-0 border-r-0 border-l-0 border-b border-solid border-tab-border","xs"===a?m="gap-0":"sm"===a?m="gap-2.5":("md"===a||"lg"===a)&&(m="gap-3"));const w=Oe(`box-border [&>*]:box-border flex items-center ${"full"===c?"w-full":""} ${"vertical"===o?"flex-col":""}`,p,h,m,g,"underline"!==s?"bg-tab-background":"",r);return(0,P.jsx)("div",{className:w,children:(0,P.jsx)(jQ.Provider,{value:{activeItem:d,onChange:f,size:a,variant:s,orientation:o,iconPosition:l,width:c},children:(0,P.jsx)(IQ,{id:u,children:i.Children.map(e,e=>(0,i.isValidElement)(e)?i.cloneElement(e):null)})})})};DQ.displayName="Tabs.Group";const CQ=(0,i.forwardRef)(({slug:e,text:t,icon:n,className:r,disabled:a=!1,badge:o=null,...s},l)=>{const c=(0,i.useContext)(jQ);if(!c)throw new Error("Tab should be used inside Tabs Group");const{activeItem:u,onChange:d,size:f,variant:m,orientation:p,iconPosition:h,width:g}=c,w={xs:"px-1.5 py-0.5 text-xs [&_svg]:size-3",sm:"underline"===m?"py-1.5 text-sm [&_svg]:size-4":"px-3 py-1.5 text-sm [&_svg]:size-4",md:"underline"===m?"py-2 text-base [&_svg]:size-5":"px-3.5 py-1.5 text-base [&_svg]:size-5",lg:"underline"===m?"p-2.5 text-lg [&_svg]:size-6":"px-3.5 py-1.5 text-lg [&_svg]:size-6"}[f],y=Oe("relative border-none bg-transparent text-text-secondary cursor-pointer flex items-center justify-center transition-[box-shadow,color,background-color] duration-200","full"===g?"flex-1":"","vertical"===p?"w-full justify-between":"");let b="rounded-full";"rounded"===m?b="rounded-md":"underline"===m&&(b="rounded-none");const v=Oe(y,"border-none",b,"hover:text-text-primary","focus:outline-none",w,u===e?"bg-background-primary text-text-primary shadow-sm":"",a?"text-text-disabled cursor-not-allowed hover:text-text-disabled":"",r),x=Oe("flex items-center gap-1");return(0,P.jsxs)(kf.button,{ref:l,className:v,disabled:a,onClick:n=>{d(n,{slug:e,text:t})},...s,layoutRoot:!0,children:[u===e&&"underline"===m&&(0,P.jsx)(kf.span,{layoutId:"underline",layoutDependency:u,className:"absolute right-0 left-0 -bottom-px h-px bg-border-interactive"}),(0,P.jsxs)("span",{className:x,children:["left"===h&&n&&(0,P.jsx)("span",{className:"mr-1 contents center-center transition duration-150",children:n}),t,"right"===h&&n&&(0,P.jsx)("span",{className:"ml-1 contents center-center transition duration-150",children:n})]}),o&&(0,i.isValidElement)(o)&&o]})});CQ.displayName="Tabs.Tab";const AQ=({activeItem:e,children:t})=>(0,P.jsx)(SQ.Provider,{value:{activeItem:e},children:t}),TQ=({slug:e,children:t})=>{const n=kQ();if(!n)throw new Error("TabPanel should be used inside Tabs");return e===n.activeItem?(0,P.jsx)(P.Fragment,{children:t}):null};function OQ({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M10 17a.75.75 0 0 1-.75-.75V5.612L5.29 9.77a.75.75 0 0 1-1.08-1.04l5.25-5.5a.75.75 0 0 1 1.08 0l5.25 5.5a.75.75 0 1 1-1.08 1.04l-3.96-4.158V16.25A.75.75 0 0 1 10 17Z",clipRule:"evenodd"}))}TQ.displayName="Tabs.Panel",AQ.Group=DQ,AQ.Tab=CQ,AQ.Panel=TQ;const LQ=i.forwardRef(OQ);function zQ(e,t){const n=new Date(e.getTime()),r=[];for(;n<=t;)r.push(new Date(n).toISOString().slice(0,10)),n.setDate(n.getDate()+1);return r}function PQ(){const e=new Date,t=new Date;return t.setDate(t.getDate()-7),zQ(t,e)}const RQ=function(){const[{analyticsData:e},t]=d(),[n,r]=(0,i.useState)("total_revenue"),[a,s]=(0,i.useState)(),[l,c]=(0,i.useState)(),[u,f]=(0,i.useState)(),[m,p]=(0,i.useState)(),[h,g]=(0,i.useState)(PQ),[w,y]=(0,i.useState)(!0),b=new Date,v=b.toISOString().slice(0,10);b.setDate(b.getDate()-7);const x=b.toISOString().slice(0,10),_="active"===cartflows_admin.woocommerce_status,E=function(e){s(void 0!==e?.total_revenue?e?.total_revenue:0),c(void 0!==e?.total_offers_revenue?e?.total_offers_revenue:0),f(void 0!==e?.total_orders?e?.total_orders:0),p(void 0!==e?.total_visits?e?.total_visits:0),y(!1)};(0,i.useEffect)(()=>{let n=!0;return e?E(e?.flow_stats):(async()=>{const e=new window.FormData;let r=new Date,a=new Date;a.setDate(a.getDate()-7),g(zQ(a,r)),a=Th(a),r=Th(r),e.append("date_to",r),e.append("date_from",a),e.append("action","cartflows_get_all_flows_stats"),e.append("security",cartflows_admin.get_all_flows_stats_nonce),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{n&&(t({type:"SET_ANALYTICS_DATA",analyticsData:e.data}),E(e?.data?.flow_stats))})})(),()=>{n=!1}},[]);const N=[{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:a,percentChange:e?.flow_stats?.total_revenue_change||null},{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:u,percentChange:e?.flow_stats?.total_orders_change||null},{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:m,percentChange:e?.flow_stats?.total_visits_change||null},{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:l,percentChange:e?.flow_stats?.total_offers_revenue_change||null}],M=e=>["total_views","offer_revenue"].includes(e)&&!wcfCartflowsTypePro(),I=e=>M(e.slug)?"-":0!==parseInt(e.value)?fh(e.value.toString()):["total_revenue","offer_revenue"].includes(e.slug)?(cartflows_admin?.woo_currency||"")+"0.00":"0";return(0,o.createElement)("div",{className:"bg-background-primary px-6 py-6 flex flex-col gap-5 border border-solid border-border-subtle rounded-lg shadow-sm wcf-analytics"},(0,o.createElement)("div",{className:"flex items-center justify-between"},(0,o.createElement)($p,{size:"xs",tag:"h3",title:(0,z.__)("Overview","cartflows"),className:"[&_h3]:text-text-primary tracking-[-0.144px]"}),(0,o.createElement)(TY,{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-text-tertiary !rounded-md !border-border-subtle focus:!ring-brand-100 focus:!border-brand-500 focus:!shadow-none !outline-0 !outline-none",value:{endDate:v,startDate:x},onChangeCB:function(e){let n=new Date(e.startDate),r=new Date(e.endDate);s(),c(),f(),p(),y(!0),g(zQ(n,r)),n=Th(n),r=Th(r);const a=new window.FormData;a.append("date_to",r),a.append("date_from",n),a.append("action","cartflows_get_all_flows_stats"),a.append("security",cartflows_admin.get_all_flows_stats_nonce),L()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then(e=>{t({type:"SET_ANALYTICS_DATA",analyticsData:e.data}),E(e?.data?.flow_stats)})}})),(!e||w)&&(0,o.createElement)(uO,null),e&&!w&&(0,o.createElement)(o.Fragment,null,_?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(AQ.Group,{variant:"underline",size:"sm",width:"auto",activeItem:n,onChange:({value:e})=>r(e.slug),className:"[&>div]:gap-24"},N.map(e=>(0,o.createElement)(AQ.Tab,{key:e.slug,slug:e.slug,className:"!items-start !justify-start !bg-transparent !shadow-none min-w-[172px] !px-3 !pb-4 !pt-2.5",text:(0,o.createElement)("div",{className:"flex flex-col gap-2 items-start"},(0,o.createElement)("div",{className:"flex items-center gap-5"},(0,o.createElement)("div",{className:"gap-1"},(0,o.createElement)(th,{as:"span",size:14,weight:500,className:"whitespace-nowrap"},e.name),e.tooltip&&(0,o.createElement)(iQ,{text:e.tooltip})),M(e.slug)&&(0,o.createElement)(Ym,null)),(0,o.createElement)("div",{className:"flex items-center gap-2"},(0,o.createElement)(th,{as:"span",size:30,weight:600,color:"primary"},I(e)),e.percentChange&&(0,o.createElement)(Yf,{label:e.percentChange,variant:"green",size:"xs",type:"pill",icon:(0,o.createElement)(LQ,{className:"size-3"})})))}))),(0,o.createElement)("div",{className:"p-1"},function(){switch(n){case"total_views":default:return(0,o.createElement)(oO,{dateRange:h});case"total_revenue":return(0,o.createElement)(iO,{dateRange:h});case"total_orders":return(0,o.createElement)(sO,{dateRange:h});case"offer_revenue":return(0,o.createElement)(lO,{dateRange:h})}}())):(0,o.createElement)("div",{className:"text-center px-8 py-12"},(0,o.createElement)("div",{className:"flex justify-center mb-3"},(0,o.createElement)(uh,{className:"h-10 w-10 text-brand-500"})),(0,o.createElement)("h3",{className:"mt-2 text-base font-medium text-text-primary"},(0,z.__)("WooCommerce plugin is required.","cartflows")),(0,o.createElement)("p",{className:"mt-1 text-sm text-text-secondary"},(0,z.__)("You need WooCommerce plugin installed and activated to view the overview","cartflows")))))},UQ=(0,i.createContext)(void 0),BQ=()=>{const e=(0,i.useContext)(UQ);if(!e)throw new Error("Table components must be used within Table component");return e},FQ=({children:e,className:t,checkboxSelection:n=!1,...r})=>{const a={checkboxSelection:n},o=i.Children.toArray(e).find(e=>i.isValidElement(e)&&e.type===GQ),s=i.Children.toArray(e).filter(e=>i.isValidElement(e)&&e.type!==GQ);return(0,P.jsx)(UQ.Provider,{value:a,children:(0,P.jsxs)("div",{className:"flow-root border-0.5 border-solid border-border-subtle rounded-md divide-y-0.5 divide-x-0 divide-solid divide-border-subtle overflow-hidden",children:[(0,P.jsx)("div",{className:"overflow-x-auto w-full",children:(0,P.jsx)("div",{className:"relative",children:(0,P.jsx)("table",{className:Oe("table-fixed min-w-full border-collapse border-spacing-0",t),...r,children:s})})}),o]})})},YQ=({children:e,className:t,selected:n,onChangeSelection:r,indeterminate:a,disabled:o,...i})=>{const{checkboxSelection:s}=BQ();return(0,P.jsx)("thead",{className:Oe("bg-background-secondary border-x-0 border-t-0 border-b-0.5 border-solid border-border-subtle",t),...i,children:(0,P.jsxs)("tr",{children:[s&&(0,P.jsx)("th",{scope:"col",className:"relative px-5.5 w-11 overflow-hidden",children:(0,P.jsx)("div",{className:"absolute inset-0 grid grid-cols-1 place-content-center",children:(0,P.jsx)(fO,{size:"sm",checked:n,indeterminate:a,disabled:o,onChange:e=>{"function"==typeof r&&r(e)},"aria-label":n?"Deselect all":"Select all"})})}),e]})})},QQ=({children:e,className:t,...n})=>(0,P.jsx)("th",{scope:"col",className:Oe("p-3 text-left text-sm font-medium leading-5 text-text-primary",t),...n,children:e}),VQ=({children:e,className:t,...n})=>(0,P.jsx)("tbody",{className:Oe("bg-background-primary divide-y-0.5 divide-x-0 divide-solid divide-border-subtle",t),...n,children:e}),WQ=({children:e,selected:t,value:n,className:r,onChangeSelection:a,...o})=>{const{checkboxSelection:i}=BQ();return(0,P.jsxs)("tr",{className:Oe("hover:bg-background-secondary",t&&"bg-background-secondary",r),...o,children:[i&&(0,P.jsx)("td",{className:"relative px-5.5 w-11 overflow-hidden",children:(0,P.jsx)("div",{className:"absolute inset-0 grid grid-cols-1 place-content-center",children:(0,P.jsx)(fO,{size:"sm",checked:t,onChange:e=>{"function"==typeof a&&a(e,n)},"aria-label":"Select row"})})}),e]})},ZQ=({children:e,className:t,...n})=>(0,P.jsx)("td",{className:Oe("px-3 py-3.5 text-sm font-normal leading-5 text-text-secondary",t),...n,children:e}),GQ=({children:e,className:t,...n})=>{const{checkboxSelection:r}=BQ();return(0,P.jsx)("div",{className:Oe("px-3 py-3",r&&"px-4",t),...n,children:e})};function HQ({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 19.5 15-15m0 0H8.25m11.25 0v11.25"}))}FQ.displayName="Table",YQ.displayName="Table.Head",QQ.displayName="Table.HeadCell",VQ.displayName="Table.Body",WQ.displayName="Table.Row",ZQ.displayName="Table.Cell",GQ.displayName="Table.Footer",FQ.Head=YQ,FQ.HeadCell=QQ,FQ.Body=VQ,FQ.Row=WQ,FQ.Cell=ZQ,FQ.Footer=GQ;const $Q=i.forwardRef(HQ),XQ=a.p+"images/dashboard-recent-orders.cc607510.png",qQ=e=>{switch(e){case"Processing":case"Completed":return"green";case"Failed":return"red";case"Refunded":return"neutral";default:return"yellow"}},JQ=function(){const[{analyticsData:e}]=d(),t=e&&e.recent_orders?e.recent_orders:[],n="active"===cartflows_admin.woocommerce_status;return(0,o.createElement)("div",{className:"wcf-recent-orders shrink-0 p-6 bg-background-primary border-0.5 border-solid border-border-subtle rounded-lg shadow-sm overflow-hidden flex flex-col gap-3"},(0,o.createElement)("div",{className:"flex items-center justify-between py-1"},(0,o.createElement)($p,{size:"xs",tag:"h3",title:(0,z.__)("Recent Orders","cartflows"),className:"tracking-[-0.1px]"}),t.length>0&&(0,o.createElement)(Va,{variant:"ghost",size:"xs",tag:"a",href:cartflows_admin.woo_order_url,target:"_blank",rel:"noreferrer",icon:(0,o.createElement)($Q,null),iconPosition:"right",className:"no-underline hover:no-underline"},(0,z.__)("View all","cartflows"))),n?(0,o.createElement)("div",{className:"overflow-x-auto"},(0,o.createElement)(FQ,{className:"min-w-full"},(0,o.createElement)(FQ.Head,null,(0,o.createElement)(FQ.HeadCell,{className:"w-[24%] pr-9"},(0,z.__)("Customer","cartflows")),(0,o.createElement)(FQ.HeadCell,{className:"w-[21%]"},(0,z.__)("Date","cartflows")),(0,o.createElement)(FQ.HeadCell,{className:"w-[19%]"},(0,z.__)("Status","cartflows")),(0,o.createElement)(FQ.HeadCell,{className:"w-[23%]"},(0,z.__)("Payment Method","cartflows")),(0,o.createElement)(FQ.HeadCell,{className:"w-[13%]"},(0,z.__)("Value","cartflows"))),(0,o.createElement)(FQ.Body,null,0===t.length?(0,o.createElement)(FQ.Row,null,(0,o.createElement)(FQ.Cell,{colSpan:5,className:"py-12"},(0,o.createElement)("div",{className:"flex flex-col items-center gap-3"},(0,o.createElement)("img",{src:XQ,alt:"",width:"78",height:"72"}),(0,o.createElement)("div",{className:"flex flex-col items-center gap-1"},(0,o.createElement)("p",{className:"text-lg font-semibold text-text-primary m-0"},(0,z.__)("Find recent order here","cartflows")),(0,o.createElement)("p",{className:"text-sm text-text-tertiary m-0"},(0,z.__)("Once you have received orders, come back to find it again easily","cartflows")))))):t.map(e=>(0,o.createElement)(FQ.Row,{key:e.order_id},(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap pr-9 py-4"},(0,o.createElement)("div",{className:"flex flex-col gap-1"},(0,o.createElement)("span",{className:"font-medium text-sm leading-5 text-text-primary"},e.customer_name),(0,o.createElement)("span",{className:"text-xs leading-4 text-text-tertiary"},e.customer_email))),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},(0,o.createElement)("div",{className:"flex flex-col gap-0.5"},(0,o.createElement)("span",null,e.order_date),(0,o.createElement)("span",null,(0,z.sprintf)(/* translators: %s: order time */ /* translators: %s: order time */ |
| 13 |
(0,z.__)("at %s","cartflows"),e.order_time)))),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap py-4"},(0,o.createElement)("div",{className:"flex"},(0,o.createElement)(Yf,{label:e.order_status,type:"pill",variant:qQ(e.order_status),size:"xs"}))),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap py-4"},e.payment_method),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap py-4"},fh(e.order_total))))))):(0,o.createElement)("div",{className:"text-center px-8 py-12"},(0,o.createElement)("div",{className:"flex justify-center mb-3"},(0,o.createElement)(uh,{className:"h-10 w-10 text-brand-500"})),(0,o.createElement)("h3",{className:"mt-2 text-base font-medium text-text-primary"},(0,z.__)("WooCommerce plugin is required.","cartflows")),(0,o.createElement)("p",{className:"mt-1 text-sm text-text-secondary"},(0,z.__)("You need WooCommerce plugin installed and activated to view the recent orders","cartflows"))))},KQ=a.p+"images/dashboard-top-funnels.8c4601cc.png",eV=({dummy_data_type:e="funnel"})=>{const t="undefined"!=typeof cartflows_admin&&cartflows_admin?.woo_currency||"$",n=[{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:`${t}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:`${t}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:`${t}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:`${t}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:`${t}8,700.00`}];return(0,o.createElement)(FQ,{className:"min-w-full"},(0,o.createElement)(FQ.Head,null,(0,o.createElement)(FQ.HeadCell,null,"step"===e?(0,z.__)("Step Name","cartflows"):(0,z.__)("Funnel Name","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Total Visits","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Unique Visits","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Conversions","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Conversion Rate","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Revenue","cartflows"))),(0,o.createElement)(FQ.Body,null,n.map(t=>(0,o.createElement)(FQ.Row,{key:t.id},(0,o.createElement)(FQ.Cell,{className:"whitespace-wrap font-medium"},"step"===e?t.step_title:t.flow_title),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},t.total_visits),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},t.unique_visits),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},t.conversions),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},t.conversion_rate+"%"),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},fh(t.revenue))))))},tV=()=>{const e="undefined"!=typeof cartflows_admin&&cartflows_admin?.woo_currency||"$",t=[{id:1,product_title:"Premium Membership",product_type:"checkout",total_orders:245,conversions:198,conversion_rate:"80.8",revenue:`${e}24,500.00`},{id:2,product_title:"Business Course Bundle",product_type:"bump",total_orders:156,conversions:134,conversion_rate:"85.9",revenue:`${e}31,200.00`},{id:3,product_title:"eBook Collection",product_type:"upsell",total_orders:389,conversions:312,conversion_rate:"80.2",revenue:`${e}7,800.00`},{id:4,product_title:"Advanced Training Package",product_type:"downsell",total_orders:178,conversions:145,conversion_rate:"81.5",revenue:`${e}21,750.00`},{id:5,product_title:"Starter Kit",product_type:"optin",total_orders:423,conversions:367,conversion_rate:"86.8",revenue:`${e}18,350.00`}];return(0,o.createElement)(FQ,{className:"min-w-full"},(0,o.createElement)(FQ.Head,null,(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Product Name","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("No. of Orders","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Conversions","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Conversion Rate","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Revenue","cartflows"))),(0,o.createElement)(FQ.Body,null,t.map(e=>{return(0,o.createElement)(FQ.Row,{key:e.id},(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap font-medium"},(0,o.createElement)("div",{className:"flex items-center gap-2"},(0,o.createElement)("span",null,e.product_title),e.product_type&&((t=e.product_type)?(0,o.createElement)("span",{className:"wcf-badge bg-brand-25 border border-brand-300 text-brand-600 rounded-2xl text-[11px] leading-4 cursor-default font-normal ml-2 capitalize"},t||""):null))),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e.total_orders),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e.conversions),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e.conversion_rate+" %"),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},fh(e.revenue)));var t})))},nV=()=>(0,o.createElement)(FQ,{className:"min-w-full"},(0,o.createElement)(FQ.Head,null,(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Funnel Name","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Opt-in Step","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Opt-in Form","cartflows")),(0,o.createElement)(FQ.HeadCell,{className:"!hidden"},(0,z.__)("Popup","cartflows")),(0,o.createElement)(FQ.HeadCell,{className:"!hidden"},(0,z.__)("Lead Magnets","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Conversion Rate","cartflows")),(0,o.createElement)(FQ.HeadCell,{className:"!hidden"},(0,z.__)("Date & Time","cartflows"))),(0,o.createElement)(FQ.Body,null,[{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(e=>(0,o.createElement)(FQ.Row,{key:e.id},(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap font-medium"},e.flow_title),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e.step_title),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e.optin_form),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap !hidden"}),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap !hidden"}),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e.conversion_rate+"%"),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap !hidden"}))))),rV=function(){const[{analyticsData:e}]=d(),t="active"===cartflows_admin.woocommerce_status,n=e?.flow_stats?.top_performing_funnels,r=(0,i.useMemo)(()=>n&&Object.values(n).map((e,t)=>(0,o.createElement)(FQ.Row,{key:e?.flow_id||t},(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap font-medium"},fh(e?.flow_title||"(no title)")),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e?.total_visits),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e?.unique_visits),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e?.conversions),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e?.conversion_rate+"%"),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},fh(e?.revenue)))),[n]);return(0,o.createElement)("div",{className:"wcf-top-performing-funnels shrink-0 p-6 bg-background-primary border-0.5 border-solid border-border-subtle rounded-lg shadow-sm overflow-hidden flex flex-col gap-3"},(0,o.createElement)("div",{className:"flex items-center justify-between"},(0,o.createElement)($p,{size:"xs",tag:"h3",title:(0,z.__)("Top Performing Funnels","cartflows"),className:"tracking-[-0.1px]"}),n?.length>0&&(0,o.createElement)(Va,{variant:"ghost",size:"xs",tag:"a",href:cartflows_admin.admin_url+"?page=cartflows&path=analytics&type=flows",target:"_blank",rel:"noreferrer",icon:(0,o.createElement)($Q,null),iconPosition:"right",className:"no-underline"},(0,z.__)("View all","cartflows"))),t?wcfCartflowsTypePro()?(0,o.createElement)("div",{className:"overflow-x-auto"},(0,o.createElement)(FQ,{className:"min-w-full"},(0,o.createElement)(FQ.Head,null,(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Funnel Name","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Total Visits","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Unique Visits","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Conversions","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Conversion Rate","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Revenue","cartflows"))),(0,o.createElement)(FQ.Body,null,n&&0!==Object.keys(n).length?r:(0,o.createElement)(FQ.Row,null,(0,o.createElement)(FQ.Cell,{colSpan:6,className:"py-12"},(0,o.createElement)("div",{className:"flex flex-col items-center gap-3"},(0,o.createElement)("img",{src:KQ,alt:"",width:"78",height:"72"}),(0,o.createElement)("div",{className:"flex flex-col items-center gap-1"},(0,o.createElement)("p",{className:"text-lg font-semibold text-text-primary m-0"},(0,z.__)("Find top performing funnels here","cartflows")),(0,o.createElement)("p",{className:"text-sm text-text-tertiary m-0"},(0,z.__)("Once you set up funnels, come back here to top performing funnels","cartflows"))))))))):(0,o.createElement)("div",{className:"overflow-hidden relative rounded-lg"},(0,o.createElement)(tO,{title:(0,z.__)("See Which Funnels Earn the Most Revenue","cartflows"),description:(0,z.__)("Unlock Pro and instantly see each funnel’s revenue, visits, and conversion rate.","cartflows"),containerClass:"absolute z-10 inset-0 flex items-center justify-center bg-[rgba(244,244,245,0.32)] backdrop-blur-[2.5px]",innerContainerClass:"border border-border-subtle shadow-[0px_10px_32px_0px_rgba(149,160,178,0.2)] p-6 rounded-xl max-w-sm w-full text-center bg-background-primary"}),(0,o.createElement)("div",{className:"pointer-events-none select-none"},(0,o.createElement)(eV,null))):(0,o.createElement)("div",{className:"text-center px-8 py-12"},(0,o.createElement)("div",{className:"flex justify-center mb-3"},(0,o.createElement)(uh,{className:"h-10 w-10 text-brand-500"})),(0,o.createElement)("h3",{className:"mt-2 text-base font-medium text-text-primary"},(0,z.__)("WooCommerce plugin is required.","cartflows")),(0,o.createElement)("p",{className:"mt-1 text-sm text-text-secondary"},(0,z.__)("You need WooCommerce plugin installed and activated to view the recent orders","cartflows"))))},aV=function(){const[e,t]=(0,i.useState)({errorFor:!1,errorMsg:!1}),[n,r]=(0,i.useState)({}),{errorFor:a,errorMsg:s}=e,l=(e,t)=>{r(n=>({...n,[e]:t}))},c=(e,t,n)=>{const r=new window.FormData;r.append("action","cartflows_activate_plugin"),r.append("init",t),r.append("security",cartflows_admin.activate_plugin_nonce),l(e,(0,z.__)("Activating…","cartflows")),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{l(e,(0,z.__)("Activated","cartflows")),n&&(window.location=n)})},u={"woo-cart-abandonment-recovery":{id:0,subtitle:(0,z.__)("Recover abandonded carts with ease.","cartflows")},"modern-cart":{id:1,subtitle:(0,z.__)("Fast and customizable cart for your website.","cartflows")},"power-coupons":{id:2,subtitle:(0,z.__)("Convert more with automated coupons.","cartflows")},"variation-swatches-woo":{id:3,subtitle:(0,z.__)("Product choices made visual and clickable.","cartflows")}},d=Object.keys(u),f=cartflows_admin.integrations.plugins.filter(e=>d.includes(e.slug)).sort((e,t)=>u[e.slug].id-u[t.slug].id),m=(e,r)=>{const i=(e=>"active"===e.status||n[e.slug]===(0,z.__)("Activated","cartflows"))(e),d=(e=>n[e.slug]?n[e.slug]:e.isPro&&"not-installed"===e.status?(0,z.__)("Let's Go","cartflows"):(e=>{switch(e){case"active":return(0,z.__)("Active","cartflows");case"inactive":return(0,z.__)("Activate","cartflows");default:return(0,z.__)("Install","cartflows")}})(e.status))(e),f=[(0,z.__)("Installing…","cartflows"),(0,z.__)("Activating…","cartflows")].includes(n[e.slug]);return(0,o.createElement)("div",{key:r,className:"bg-background-primary rounded-lg shadow-sm p-2 flex flex-col gap-5"},(0,o.createElement)("div",{className:"flex items-start justify-between px-1 py-1"},e.logoPath&&(0,o.createElement)("img",{src:e.logoPath.icon_path,className:"w-6 h-6 min-w-6 min-h-6",alt:e.title}),(0,o.createElement)("div",{className:"flex items-center gap-2"},i?(0,o.createElement)("span",{className:"text-xs font-semibold text-support-success"},(0,z.__)("Activated","cartflows")):(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"!px-0 !text-brand-600 font-semibold leading-4",disabled:f,onClick:()=>(e=>{const{slug:n,isPro:r,link:a,status:o,path:i,redirection:s}=e;if("true"!==String(r).toLowerCase()||"not-installed"!==o)switch(((e,t="plugin")=>"activated"===e?"":"installed"===e||"inactive"===e?"cartflows_recommended_"+t+"_activate":"cartflows_recommended_"+t+"_install")(o,"plugin")){case"cartflows_recommended_plugin_activate":c(n,i,s);break;case"cartflows_recommended_plugin_install":l(n,(0,z.__)("Installing…","cartflows")),((e,n,r)=>{new Promise((a,o)=>{wp.updates.queue.push({action:"install-plugin",data:{slug:e,success(t){l(e,(0,z.__)("Installed","cartflows")),a(t),c(e,n,r)},error(n){o(n),l(e,(0,z.__)("Failed","cartflows")),t({errorFor:`${e}_error`,errorMsg:n?.errorMessage}),setTimeout(()=>{l(e,null),t({errorFor:!1,errorMsg:!1})},1500)}}}),wp.updates.queueChecker()})})(n,i,s)}else window.open(a,"_blank","noopener,noreferrer")})(e)},d),a===`${e.slug}_error`&&s&&(0,o.createElement)("p",{id:`${e.slug}_error`,className:"text-[10px] text-brand-500"},s))),(0,o.createElement)("div",{className:"flex flex-col gap-0.5 px-1 py-1"},(0,o.createElement)("p",{className:"text-sm font-medium text-text-primary m-0"},e.title),(0,o.createElement)("p",{className:"text-xs text-text-tertiary m-0"},u[e.slug]?.subtitle||e.subtitle)))};return(0,o.createElement)("div",{className:"wcf-extend-your-store shrink-0 bg-background-primary border-0.5 border-solid border-border-subtle rounded-lg shadow-sm overflow-hidden p-4"},(0,o.createElement)("div",{className:"flex flex-col gap-3 w-full"},(0,o.createElement)("div",{className:"flex items-center w-full"},(0,o.createElement)($p,{size:"xs",tag:"h3",title:(0,z.__)("Extend Your Website","cartflows"),className:"[&_h3]:text-text-primary"})),(0,o.createElement)("div",{className:"bg-background-secondary rounded-md p-1 grid grid-cols-1 sm:grid-cols-2 gap-1"},f.map((e,t)=>m(e,t)))))};function oV({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const iV=i.forwardRef(oV),sV=a.p+"images/upgrade.823abf92.png",lV=[(0,z.__)("One-Click Upsells: Add revenue to every order automatically.","cartflows"),(0,z.__)("Order Bumps: Sell more at checkout.","cartflows"),(0,z.__)("A/B Split Testing: Find your top-converting funnel.","cartflows"),(0,z.__)("Advanced Analytics: See exactly what earns more.","cartflows")],cV=function(){const e=getUpgradeToProUrl();return(0,o.createElement)("div",{className:"wcf-upgrade-to-pro-card bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm overflow-hidden p-3"},(0,o.createElement)("div",{className:"flex items-center justify-center"},(0,o.createElement)("img",{src:sV,alt:(0,z.__)("CartFlows Pro upgrade illustration","cartflows"),className:"w-full max-h-52 object-contain"})),(0,o.createElement)("div",{className:"p-2 pt-4 flex flex-col gap-4"},(0,o.createElement)("div",{className:"flex flex-col gap-2"},(0,o.createElement)($p,{tag:"h3",size:"xs",title:(0,z.__)("Sell More with CartFlows Pro","cartflows")}),(0,o.createElement)(th,{size:14,color:"secondary"},(0,z.__)("Turn every visitor into more revenue with smarter funnels.","cartflows"))),(0,o.createElement)("ul",{className:"list-none p-0 m-0 flex flex-col gap-2.5"},lV.map((e,t)=>(0,o.createElement)("li",{key:t,className:"flex items-start gap-2"},(0,o.createElement)(iV,{className:"w-4 h-4 text-brand-500 shrink-0 mt-0.5"}),(0,o.createElement)(th,{size:14,color:"secondary"},e)))),(0,o.createElement)(Va,{tag:"a",href:e,variant:"primary",size:"md",className:"text-center justify-center no-underline",target:"_blank",rel:"noreferrer"},(0,z.__)("Upgrade Now","cartflows"))))};function uV({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 dV=i.forwardRef(uV),fV="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5NSIgaGVpZ2h0PSI5NSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PGcgZmlsbD0iI2YwNjMzNSI+PHBhdGggZD0iTTU4Ljk0MiA1LjYwOWMtMy40NDQgMy4zNTQtNS41ODcgOC4wMzYtNS41ODcgMTMuMjJ2MzAuNzE4YTguMTkgOC4xOSAwIDAgMS04LjE4OCA4LjE4OEgyNC41NzRhOC4xOSA4LjE5IDAgMCAxLTguMTg4LTguMTg4IDguMTkgOC4xOSAwIDAgMSA4LjE4OC04LjE4OGgyMi41ODNWMjQuOTc0SDI0LjU3NGEyNC42MiAyNC42MiAwIDAgMC00LjA5OS4zNEM4Ljg2IDI3LjI2IDAgMzcuMzc3IDAgNDkuNTQ3YzAgMTAuNyA2Ljg0MyAxOS44MDMgMTYuMzg2IDIzLjE3NmEyNC42MSAyNC42MSAwIDAgMCA4LjE4OSAxLjM5OWgyMC41OTJhMjQuNjIgMjQuNjIgMCAwIDAgOC4xODktMS4zOTlDNjIuODk3IDY5LjM1IDY5Ljc0IDYwLjI0NyA2OS43NCA0OS41NDd2LTguMTg4YzkuMDUgMCAxNi4zODYtNy4zMzcgMTYuMzg2LTE2LjM4Nkg2OS43NHYtNi4xNDVjMC0xLjEzLjkxNS0yLjA0NCAyLjA0NS0yLjA0NGg0LjA5OGM0Ljk5NiAwIDkuNTI1LTEuOTgyIDEyLjg0My01LjIxMiAyLjk4Ny0yLjkwNSA0Ljk5Ni02LjgwNyA1LjQ3MS0xMS4xNzRINzEuNzg2YTE4LjM3NyAxOC4zNzcgMCAwIDAtMTIuODQ0IDUuMjExTTI0LjU3NSA3OC4yMThhOC4xOTEgOC4xOTEgMCAxIDAgMCAxNi4zODMgOC4xOTEgOC4xOTEgMCAwIDAgMC0xNi4zODNNNDkuMTQ5IDc4LjIxOGE4LjE5MiA4LjE5MiAwIDEgMCAwIDE2LjM4MyA4LjE5MiA4LjE5MiAwIDAgMCAwLTE2LjM4MyIvPjwvZz48L3N2Zz4=",mV=[{icon:JR,value:"₹18,450",label:(0,z.__)("Recovered Revenue","cartflows")},{icon:Lm,value:"₹52,300",label:(0,z.__)("Recoverable Revenue","cartflows")},{icon:dV,value:"28%",label:(0,z.__)("Recovery Rate","cartflows")}],pV=function(){return(0,o.createElement)("div",{className:"wcf-summarized-report bg-background-primary border border-solid border-border-subtle rounded-lg shadow-sm overflow-hidden"},(0,o.createElement)("div",{className:"border-b border-solid border-border-subtle flex items-start gap-3 px-6 py-5"},(0,o.createElement)("img",{src:fV,alt:"",className:"w-[31px] h-[31px] rounded-sm shrink-0"}),(0,o.createElement)($p,{size:"md",tag:"h3",className:"tracking-[-0.1px]"},(0,z.__)("Summarized Report","cartflows"))),(0,o.createElement)("div",{className:"relative"},(0,o.createElement)("div",null,mV.map((e,t)=>{const n=e.icon;return(0,o.createElement)("div",{key:t,className:"flex items-center gap-4 px-7 py-4"+(t<mV.length-1?" border-b border-solid border-border-subtle":"")},(0,o.createElement)("div",{className:"flex items-center justify-center w-[50px] h-[56px] rounded-[28px] bg-background-primary shrink-0"},(0,o.createElement)(n,{className:"w-[30px] h-[30px] text-icon-secondary"})),(0,o.createElement)("div",{className:"flex flex-col gap-1"},(0,o.createElement)($p,{size:"md",tag:"span",className:"tracking-[-0.1px]"},e.value),(0,o.createElement)(th,{size:16,color:"tertiary"},e.label)))})),(0,o.createElement)("div",{className:"border-t border-solid border-border-subtle px-7 py-4 flex items-center justify-center"},(0,o.createElement)("a",{href:"https://wordpress.org/plugins/woo-cart-abandonment-recovery/",target:"_blank",rel:"noreferrer",className:"flex items-center gap-1 no-underline"},(0,o.createElement)($Q,{className:"w-[22px] h-[22px] text-primary-500"}),(0,o.createElement)(th,{size:18,weight:"medium",className:"text-primary-500"},(0,z.__)("View Detailed Report","cartflows")))),(0,o.createElement)("div",{className:"absolute inset-0 bg-background-primary/80 backdrop-blur-[2.5px] flex flex-col items-center justify-center gap-3 p-6"},(0,o.createElement)("img",{src:fV,alt:"",className:"w-[38px] h-[38px] rounded-sm"}),(0,o.createElement)("div",{className:"flex flex-col items-center gap-1 text-center"},(0,o.createElement)($p,{size:"sm",tag:"h4"},(0,z.__)("Recover Your Lost Revenue Now!","cartflows")),(0,o.createElement)(th,{size:14,color:"secondary"},(0,z.__)("Automatically convert abandoned carts into revenue.","cartflows"))),(0,o.createElement)(Va,{tag:"a",href:"https://wordpress.org/plugins/woo-cart-abandonment-recovery/",target:"_blank",rel:"noreferrer",variant:"primary",size:"sm",icon:(0,o.createElement)(im,null),iconPosition:"right",className:"no-underline"},(0,z.__)("Install to View Full Report","cartflows")))))};function hV({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25"}))}const gV=i.forwardRef(hV);function wV({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"}))}const yV=i.forwardRef(wV);function bV({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"}))}const vV=i.forwardRef(bV);function xV({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.59 14.37a6 6 0 0 1-5.84 7.38v-4.8m5.84-2.58a14.98 14.98 0 0 0 6.16-12.12A14.98 14.98 0 0 0 9.631 8.41m5.96 5.96a14.926 14.926 0 0 1-5.841 2.58m-.119-8.54a6 6 0 0 0-7.381 5.84h4.8m2.581-5.84a14.927 14.927 0 0 0-2.58 5.84m2.699 2.7c-.103.021-.207.041-.311.06a15.09 15.09 0 0 1-2.448-2.448 14.9 14.9 0 0 1 .06-.312m-2.24 2.39a4.493 4.493 0 0 0-1.757 4.306 4.493 4.493 0 0 0 4.306-1.758M16.5 9a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z"}))}const _V=i.forwardRef(xV),EV=[{icon:gV,label:(0,z.__)("Knowledge Base","cartflows"),href:getKbDocUrl("https://cartflows.com/docs")},{icon:oQ,label:(0,z.__)("Help Center","cartflows"),href:getUtmUrl("https://cartflows.com/support",{utm_campaign:"support"})},{icon:yV,label:(0,z.__)("Join the Community","cartflows"),href:"https://www.facebook.com/groups/cartflows"},{icon:vV,label:(0,z.__)("Rate Us","cartflows"),href:"https://wordpress.org/support/plugin/cartflows/reviews/#new-post"}],NV=function(){const e=(cartflows_admin?.admin_base_url||"")+"index.php?page=cartflows-onboarding",t=[...cartflows_admin?.is_onboarding_completed?[]:[{icon:_V,label:(0,z.__)("Launch Setup","cartflows"),href:e,internal:!0}],...EV];return(0,o.createElement)("div",{className:"wcf-quick-access bg-background-primary border border-solid border-border-subtle rounded-lg shadow-sm p-3 flex flex-col gap-3"},(0,o.createElement)($p,{size:"xs",tag:"h3",title:(0,z.__)("Quick Access","cartflows"),className:"[&_h3]:text-text-primary"}),(0,o.createElement)("div",{className:"flex flex-col gap-1 bg-field-primary-background p-1 rounded-lg"},t.map(({icon:e,label:t,href:n,internal:r})=>(0,o.createElement)("a",(0,_.A)({key:n,href:n},r?{}:{target:"_blank",rel:"noreferrer"},{className:"flex items-center gap-1 px-2 py-[9px] bg-background-primary rounded-md shadow-sm no-underline hover:bg-background-secondary transition-colors"}),(0,o.createElement)(e,{className:"size-[22px] text-icon-primary shrink-0"}),(0,o.createElement)(th,{size:14,weight:500},t)))))},MV=function(){const[{setup_checklist_data:e}]=d(),t=!function(e){return ah(e).every(e=>Object.values(e).every(e=>e.completed))}(e),n=!!cartflows_admin?.is_pro;return(0,o.createElement)("div",{className:"wcf-home-page-wrapper"},t&&(0,o.createElement)("div",{className:"wcf-col--row mb-6 md:mb-8"},(0,o.createElement)("div",{className:"wcf-col w-full"},(0,o.createElement)(lh,null))),(0,o.createElement)("div",{className:"wcf-col--row flex flex-col lg:flex-row w-full gap-6 md:gap-8 justify-between"},(0,o.createElement)("div",{className:"wcf-col w-full flex flex-col gap-6 md:gap-8 lg:w-[64.5%]"},(0,o.createElement)(RQ,null),(0,o.createElement)(JQ,null),(0,o.createElement)(rV,null)),(0,o.createElement)("div",{className:"wcf-col w-full flex flex-col gap-6 md:gap-8 lg:w-[33%]"},(0,o.createElement)("div",{className:"hidden"},!n&&(0,o.createElement)(pV,null)),!n&&(0,o.createElement)(cV,null),(0,o.createElement)(aV,null),(0,o.createElement)(NV,null))))},IV={xs:{general:"text-xs min-w-6 h-6",ellipse:"text-xs min-w-6",icon:"size-4"},sm:{general:"text-xs min-w-8 h-8",ellipse:"text-xs min-w-8",icon:"size-4"},md:{general:"text-sm min-w-10 h-10",ellipse:"text-sm min-w-10",icon:"size-5"},lg:{general:"text-base min-w-12 h-12",ellipse:"text-base min-w-12",icon:"size-6"}},SV="group disabled:border-field-border-disabled opacity-50",kV=(0,i.createContext)({size:"sm",disabled:!1}),jV=()=>(0,i.useContext)(kV),DV=({size:e="sm",disabled:t=!1,children:n,className:r,...a})=>(0,P.jsx)(kV.Provider,{value:{size:e,disabled:t},children:(0,P.jsx)("nav",{role:"navigation",className:Oe("flex w-full justify-center box-border m-0",r),...a,children:n})});DV.displayName="Pagination";const CV=(0,i.forwardRef)(({className:e,...t},n)=>(0,P.jsx)("ul",{ref:n,className:Oe("m-0 p-0 w-full flex justify-center flex-row items-center gap-1","list-none",e),...t}));CV.displayName="Pagination.Content";const AV=(0,i.forwardRef)(({isActive:e=!1,className:t,children:n,...r},a)=>{const{disabled:o}=jV();return(0,P.jsx)("li",{ref:a,className:Oe("flex",o&&SV),children:(0,P.jsx)(TV,{isActive:e,disabled:o,className:t,...r,children:n})})});AV.displayName="Pagination.Item";const TV=({isActive:e=!1,tag:t="a",children:n,className:r,...a})=>{const{size:o,disabled:i}=jV(),s=e=>e.preventDefault();return(0,P.jsx)(Va,{tag:t,size:o,variant:"ghost",className:Oe("no-underline bg-transparent p-0 m-0 border-none","flex justify-center items-center rounded text-button-secondary","focus:outline focus:outline-1 focus:outline-border-subtle focus:bg-button-tertiary-hover",IV[o].general,!i&&e&&"text-button-primary active:text-button-primary bg-brand-background-50",i&&[SV,"group-disabled:text-field-color-disabled","focus:ring-transparent cursor-not-allowed"],r),disabled:i,...a,"aria-current":e?"page":void 0,onClick:e=>Le(a.onClick||(()=>{}),i?s:()=>{})(e),children:(0,P.jsx)("span",{className:"px-1 flex",children:n})})},OV=e=>{const{size:t,disabled:n}=jV();return(0,P.jsx)("li",{className:Oe("flex",n&&SV),"aria-label":"Go to previous page",children:(0,P.jsx)(TV,{className:Oe("[&>span]:flex [&>span]:items-center"),...e,children:(0,P.jsx)(yU,{className:Oe(IV[t].icon)})})})};OV.displayName="Pagination.Previous";const LV=e=>{const{size:t,disabled:n}=jV();return(0,P.jsx)("li",{className:Oe("flex",n&&SV),"aria-label":"Go to next page",children:(0,P.jsx)(TV,{className:Oe("[&>span]:flex [&>span]:items-center"),...e,children:(0,P.jsx)(bU,{className:Oe(IV[t].icon)})})})};LV.displayName="Pagination.Next";const zV=e=>{const{size:t,disabled:n}=jV();return(0,P.jsx)("li",{className:Oe("flex",n&&SV),children:(0,P.jsx)("span",{className:Oe("flex justify-center",IV[t].ellipse,n&&SV),"aria-hidden":"true",...e,children:"•••"})})};zV.displayName="Pagination.Ellipsis",DV.Content=CV,DV.Item=AV,DV.Previous=OV,DV.Next=LV,DV.Ellipsis=zV;const PV=(e,t={})=>{const n={page:"cartflows",path:"flows"};return["post_status","s","mode","filter","from","to","per_page","paged"].forEach(t=>{const r=e.get(t);r&&(n[t]=r)}),Object.entries(t).forEach(([e,t])=>{null==t?delete n[e]:n[e]=t}),"?"+Object.entries(n).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join("&")},RV=[10,20,50,100],UV=function({currentPage:e,maxPages:t,perPage:n,onPerPageChange:r}){const[,a]=d(),i=new URLSearchParams((0,b.useLocation)().search),s=(0,b.useHistory)(),l=e=>{a({type:"SET_FLOWS",flows:null}),s.push({pathname:"admin.php",search:PV(i,{paged:e})})};if(1>=t)return"";const c=((e,t,n=1)=>{const r=2*n;if(r+5>=t)return Array.from({length:t},(e,t)=>t+1);const a=Math.max(e-n,1)>2,o=Math.min(e+n,t)<t-1,i=t,s=[];if(!a&&o){const e=3+r,t=Array.from({length:e},(e,t)=>t+1);s.push(...t,"ellipsis",i)}else if(a&&!o){const e=3+r,n=Array.from({length:e},(n,r)=>t-e+r+1);s.push(1,"ellipsis",...n)}else if(a&&o){const t=Array.from({length:r+1},(t,r)=>e-n+r);s.push(1,"ellipsis",...t,"ellipsis",i)}return s})(e,t);return(0,o.createElement)("div",{className:"flex items-center justify-between flex-wrap gap-4 w-full"},(0,o.createElement)("div",{className:"flex items-center gap-3"},(0,o.createElement)(th,{size:14,color:"secondary"},(0,z.__)("Page","cartflows")," ",e," ",(0,z.__)("out of","cartflows")," ",t),(0,o.createElement)("div",{className:"w-20"},(0,o.createElement)(VO,{value:n,onChange:r,size:"sm"},(0,o.createElement)(VO.Button,{render:e=>e}),(0,o.createElement)(VO.Options,{className:"z-999999"},RV.map(e=>(0,o.createElement)(VO.Option,{key:e,value:e},e)))))),(0,o.createElement)(DV,{className:"!w-fit",size:"sm"},(0,o.createElement)(DV.Content,null,(0,o.createElement)(DV.Previous,{onClick:()=>l(e-1),disabled:1===e,className:1===e?"opacity-50 text-text-tertiary cursor-not-allowed":""}),c.map((t,n)=>"ellipsis"===t?(0,o.createElement)(DV.Ellipsis,{key:`ellipsis-${n}`}):(0,o.createElement)(DV.Item,{key:t,isActive:e===t,onClick:()=>l(t)},t)),(0,o.createElement)(DV.Next,{onClick:()=>l(e+1),disabled:e===t,className:e===t?"opacity-50 text-text-tertiary cursor-not-allowed":""}))))};function BV({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const FV=i.forwardRef(BV);function YV({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 QV=i.forwardRef(YV);function VV({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 WV=i.forwardRef(VV),ZV=({importBtnString:e=""})=>{const[t,n]=(0,i.useState)(!1),[r,a]=(0,i.useState)(!1),[s,c]=(0,i.useState)(null),[u,d]=(0,i.useState)({selectedFile:"",processText:(0,z.__)("Import Funnel","cartflows"),process:!1}),{selectedFile:f,process:m}=u;function p(){d({...u,selectedFile:""}),a(!1),c(null),n(!1)}const[h,g]=l().useState(!1),w=function(e){e.preventDefault(),e.stopPropagation(),"dragenter"===e.type||"dragover"===e.type?g(!0):"dragleave"===e.type&&g(!1)};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"outline",size:"sm",icon:(0,o.createElement)(hU,{className:"!size-3.5","aria-hidden":"true"}),iconPosition:"left",onClick:()=>n(!t)},e||(0,z.__)("Import","cartflows")),(0,o.createElement)($m,{open:t,setOpen:e=>{e||p()},exitOnClickOutside:!1,className:"wcf-json-importer"},(0,o.createElement)($m.Panel,{className:"sm:max-w-lg w-full"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)($m.Header,{className:"flex items-center justify-between !space-y-0"},(0,o.createElement)($m.Title,null,(0,z.__)("Import Funnel","cartflows")),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)($m.Body,null,(0,o.createElement)("p",{className:"text-sm text-text-secondary mb-4"},(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,o.createElement)("form",{method:"post",encType:"multipart/form-data",onDragEnter:w},(0,o.createElement)("div",{className:"flex items-center justify-center w-full"},(0,o.createElement)("label",{htmlFor:"dropzone-file",className:Gf()("flex flex-col items-center justify-center w-full border-2 border-border-subtle border-dashed rounded-lg cursor-pointer hover:border-border-strong",h?"bg-background-primary":"")},(0,o.createElement)("div",{className:"flex flex-col items-center justify-center pt-5 pb-6"},(0,o.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-text-tertiary","aria-hidden":"true"},(0,o.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,o.createElement)("p",{className:"mt-2 block text-sm font-medium text-text-primary"},(0,o.createElement)("span",{className:"font-semibold"},f?(0,z.__)("Change a file","cartflows"):(0,z.__)("Upload a file","cartflows"))," ",(0,z.__)("or drag and drop","cartflows")),(0,o.createElement)("p",{className:"mt-2 block text-xs font-normal text-text-secondary"},(0,z.__)("JSON file up to 5MB","cartflows"))),(0,o.createElement)("input",{id:"dropzone-file",type:"file",className:"hidden",accept:"application/JSON",name:"file",onChange:function(e){d({...u,selectedFile:e.target.files[0]})}}))),f&&(0,o.createElement)("div",{className:"rounded-md bg-alert-background-green p-4 mt-5"},(0,o.createElement)("div",{className:"flex items-center justify-between"},(0,o.createElement)("div",{className:"wcf-import-flow--file-info flex items-center gap-1"},(0,o.createElement)("div",{className:"flex-shrink-0"},(0,o.createElement)(WV,{className:"w-6 h-6 text-text-tertiary","aria-hidden":"true"})),(0,o.createElement)("div",{className:"wcf-import-flow--message"},(0,o.createElement)("p",{className:"text-sm font-medium text-support-success"},(0,z.sprintf)(/* translators: %s is replaced with the file name. */ /* translators: %s is replaced with the file name. */ |
| 14 |
(0,z.__)("File Selected: %s","cartflows"),f.name)))),(0,o.createElement)("div",{className:"wcf-import-flow--close-btn"},(0,o.createElement)("div",{className:"-mx-1.5 -my-1.5"},(0,o.createElement)("button",{type:"button",className:"inline-flex rounded-md bg-alert-background-green p-1.5 text-support-success hover:bg-alert-background-green 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,d({...u,selectedFile:null})}},(0,o.createElement)("span",{className:"sr-only"},"Dismiss"),(0,o.createElement)(tL,{className:"h-5 w-5","aria-hidden":"true"})))))),h&&(0,o.createElement)("div",{className:"absolute w-full h-full rounded-2xl inset-0",onDragEnter:w,onDragLeave:w,onDragOver:w,onDrop:function(e){e.preventDefault(),e.stopPropagation(),g(!1),e.dataTransfer.files&&e.dataTransfer.files[0]&&d({...u,selectedFile:e.dataTransfer.files[0]})}})),r&&(0,o.createElement)("div",{className:"mt-4 sm:flex sm:items-start"},(0,o.createElement)("div",{className:"mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-alert-background-danger sm:mx-0 sm:h-10 sm:w-10"},(0,o.createElement)(uh,{className:"h-6 w-6 text-brand-600","aria-hidden":"true"})),(0,o.createElement)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},(0,o.createElement)("h3",{className:"text-lg font-medium leading-6 text-text-primary"},(0,z.__)("Replace Store Checkout Funnel?","cartflows")),(0,o.createElement)("div",{className:"mt-2"},(0,o.createElement)("p",{className:"text-sm text-text-secondary"},s?.message||(0,z.__)("A Store Checkout funnel already exists. Importing will replace the current Store Checkout funnel.","cartflows")))))),(0,o.createElement)($m.Footer,{className:"flex gap-3 justify-end"},(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:p},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(Va,{variant:"primary",size:"md",disabled:m,onClick:r?function(){if(!s)return;d({...u,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(s.flow_data)),e.append("check_store_checkout","yes"),e.append("force_import","yes"),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{d({...u,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(!f||m)return;if("application/json"!==f.type)return void alert((0,z.__)("Please select the valid json file.","cartflows"));d({...u,process:!0,processText:(0,z.__)("Importing..","cartflows")});const e=new FileReader;e.readAsText(f,"UTF-8"),e.onload=e=>{let t=e.target.result;if("string"==typeof t)try{t=JSON.parse(t)}catch(e){}const n=function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){return!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",n?"yes":"no"),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(e=>{e.data.requires_confirmation?(c(e.data),a(!0),d({...u,process:!1,processText:(0,z.__)("Import Funnel","cartflows")})):(d({...u,processText:"Redirecting..",process:!1}),n&&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)})}}},m&&(0,o.createElement)(gQ,null),!m&&(r?(0,z.__)("Replace & Import","cartflows"):u.processText))))))};function GV(e){if(e)return(0,o.createElement)($m,{open:e.isOpen,setOpen:t=>{t||e.onClose()},exitOnClickOutside:!1,exitOnEsc:!1,className:"wcf-confirm-popup"},(0,o.createElement)($m.Panel,{className:"wcf-confirm-popup-wrapper !p-3 !gap-4"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)("div",{className:"flex gap-2.5 p-2"},(0,o.createElement)(uh,{className:"w-6 h-6 text-support-warning shrink-0 mt-0.5","aria-hidden":"true"}),(0,o.createElement)("div",{className:"flex flex-col gap-1.5 flex-1 min-w-0"},(0,o.createElement)("div",{className:"flex items-center justify-between"},(0,o.createElement)($m.Title,{className:"!text-lg"},e.title),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)("p",{className:"text-sm text-text-secondary m-0"},e.description))),(0,o.createElement)($m.Footer,{className:"!p-2 flex gap-3 justify-end"},(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:e.onClose},e.cancelBtnText),(0,o.createElement)(Va,{variant:"primary",size:"md",onClick:e.onConfirm,disabled:e.isLoading},e.isLoading?(0,o.createElement)(gQ,{className:"border-white border-r-transparent"}):e.actionBtnText))))}const HV=(0,i.createContext)();function $V(){return(0,i.useContext)(HV)}const XV=function(e){const{bulk_actions:t,selected_ids:n}=e,[,r]=d(),[a,s]=(0,i.useState)(!1);let l=new URLSearchParams((0,b.useLocation)().search).get("paged");l||(l=1);const c=$V();return(0,o.createElement)(Gp,{direction:"row",align:"center",className:"gap-3"},t.map(t=>{const i="trash"===t.value||"delete_permanently"===t.value;return(0,o.createElement)(Gp.Item,{key:t.value},(0,o.createElement)(Va,(0,_.A)({variant:"outline",size:"sm",icon:t.icon,iconPosition:"left",onClick:()=>async function(t){let a="",o="";const i=n.map(String);if(0===i.length||"-1"===t)return;const l=i.length,u={trash:(0,z.__)("Trash","cartflows"),restore:(0,z.__)("Restore","cartflows"),delete_permanently:(0,z.__)("Delete Permanently","cartflows"),draft:(0,z.__)("Draft","cartflows"),publish:(0,z.__)("Publish","cartflows"),export:(0,z.__)("Export","cartflows")}[t]||t.replace("_"," "),d={trash:(0,z._n)("Funnel trashed successfully!","Funnels trashed successfully!",l,"cartflows"),restore:(0,z._n)("Funnel restored successfully!","Funnels restored successfully!",l,"cartflows"),delete_permanently:(0,z._n)("Funnel deleted successfully!","Funnels deleted successfully!",l,"cartflows"),draft:(0,z._n)("Funnel moved to draft!","Funnels moved to draft!",l,"cartflows"),publish:(0,z._n)("Funnel published successfully!","Funnels published successfully!",l,"cartflows"),export:(0,z._n)("Funnel exported successfully!","Funnels exported successfully!",l,"cartflows")};if(!await c({title:(0,z.sprintf)( |
| 15 |
// translators: %s: action name. |
| 16 |
// translators: %s: action name. |
| 17 |
(0,z.__)("%s This Flow","cartflows"),u),description:(0,z.sprintf)( |
| 18 |
// translators: %s: action status name. |
| 19 |
// translators: %s: action status name. |
| 20 |
(0,z.__)("Do you want to %s this flow? Are you sure?","cartflows"),u),actionBtnText:(0,z.__)("Confirm","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")}))return;const f=new window.FormData;switch(s(!0),t){case"trash":a="cartflows_trash_flows_in_bulk",o=cartflows_admin.trash_flows_in_bulk_nonce,f.append("new_status","trash");break;case"restore":case"publish":a="cartflows_update_flow_post_status",o=cartflows_admin.update_flow_post_status_nonce,f.append("new_status","publish");break;case"delete_permanently":a="cartflows_delete_flows_permanently",o=cartflows_admin.delete_flows_permanently_nonce;break;case"draft":a="cartflows_update_flow_post_status",o=cartflows_admin.update_flow_post_status_nonce,f.append("new_status","draft");break;case"export":a="cartflows_export_flows_in_bulk",o=cartflows_admin.export_flows_in_bulk_nonce}f.append("action",a),f.append("security",o),f.append("flow_ids",[i]),L()({url:cartflows_admin.ajax_url,method:"POST",body:f}).then(n=>{if("export"===t&&n.success){const e=new Date,t="cartflows-flows-export-"+e.getDate()+"-"+(e.getMonth()+1)+"-"+e.getFullYear()+".json",r=JSON.stringify(n.data.flows),a=new Blob([r],{type:"application/json"});if(document.documentMode)window.navigator.msSaveOrOpenBlob(a,t);else{const e=document.createElement("a");e.href=URL.createObjectURL(a),e.download=t,e.click()}}if(s(!1),e.closeCallback(),n.success){const e=d[t];e&&pp.success(e)}else pp.error(n?.data?.message||(0,z.__)("Something went wrong.","cartflows"));r({type:"SET_FLOWS",flows:null})})}(t.value),disabled:a},i?{destructive:!0}:{}),t.label))}),a&&(0,o.createElement)(Gp.Item,null,(0,o.createElement)(LO,{variant:"primary",size:"sm"})))},qV=function({selectedIds:e=[],bulkActions:t=[],onClearSelection:n,flows_count:r=0}){const[{active_flows_count:a,trash_flows_count:s,draft_flows_count:l},c]=d(),u=(0,b.useHistory)(),f=new URLSearchParams((0,b.useLocation)().search),m=f.get("post_status"),p=f.get("s"),h=f.get("mode"),g=f.get("filter"),[w,y]=(0,i.useState)(p||""),[v,x]=(0,i.useState)({isProcessing:!1,buttonText:(0,z.__)("Export All","cartflows")});(0,i.useEffect)(()=>{y(p||"")},[p]);const _=m||"active_flow",E=!!m||!!p||!!h||"date"===g,N=e=>{c({type:"SET_FLOWS",flows:null}),u.push({pathname:"admin.php",search:PV(f,e)})},M=[{key:"active_flow",label:(0,z.sprintf)(/* translators: %d: count */ /* translators: %d: count */ |
| 21 |
(0,z.__)("Published (%d)","cartflows"),a)},{key:"draft",label:(0,z.sprintf)(/* translators: %d: count */ /* translators: %d: count */ |
| 22 |
(0,z.__)("Draft (%d)","cartflows"),l)},{key:"trash",label:(0,z.sprintf)(/* translators: %d: count */ /* translators: %d: count */ |
| 23 |
(0,z.__)("Trash (%d)","cartflows"),s)}];return e.length>0?(0,o.createElement)(Gp,{direction:"row",align:"center",className:"gap-3"},(0,o.createElement)(Gp.Item,null,(0,o.createElement)(th,{size:14,color:"secondary",className:"whitespace-nowrap"},(0,z.sprintf)(/* translators: %d: number of selected items */ /* translators: %d: number of selected items */ |
| 24 |
(0,z.__)("%d selected","cartflows"),e.length))),(0,o.createElement)(XV,{bulk_actions:t,selected_ids:e,closeCallback:n})):(0,o.createElement)(Gp,{direction:"row",align:"center",className:"gap-3"},E&&(0,o.createElement)(Gp.Item,null,(0,o.createElement)(Va,{variant:"outline",size:"sm",onClick:()=>{c({type:"SET_FLOWS",flows:null});const e=f.get("per_page"),t={page:"cartflows",path:"flows"};e&&(t.per_page=e),u.push({pathname:"admin.php",search:"?"+Object.entries(t).map(([e,t])=>`${encodeURIComponent(e)}=${encodeURIComponent(t)}`).join("&")})},icon:(0,o.createElement)(tL,{className:"w-4 h-4"}),iconPosition:"left",className:"min-w-fit",destructive:!0},(0,z.__)("Clear Filters","cartflows"))),(0,o.createElement)(Gp.Item,null,(0,o.createElement)("div",{className:"min-w-[160px]"},(0,o.createElement)(VO,{key:`${a}-${l}-${s}`,value:_,onChange:e=>{N({post_status:"active_flow"===e?null:e,paged:null})},size:"sm"},(0,o.createElement)(VO.Button,null,(e=>{const t=M.find(t=>t.key===e);return t?t.label:(0,z.__)("All Funnels","cartflows")})(_)),(0,o.createElement)(VO.Options,{className:"z-999999"},M.map(e=>(0,o.createElement)(VO.Option,{key:e.key,value:e.key},e.label)))))),(0,o.createElement)(Gp.Item,null,(0,o.createElement)(TY,{value:{endDate:null,startDate:null},onChangeCB:e=>{null!==e.startDate?N({filter:"date",from:e.startDate.toISOString(),to:e.endDate.toISOString(),paged:null}):N({filter:null,from:null,to:null,paged:null})},placeholder:(0,z.__)("Filter by Date","cartflows"),sectionClass:"",wrapperClass:"",fieldParentWrapperClass:""})),(0,o.createElement)(Gp.Item,null,(0,o.createElement)(dp,{type:"text",size:"sm",placeholder:(0,z.__)("Search funnels…","cartflows"),value:w,onChange:y,onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),0!==w.length&&w.length<3||N({s:0===w.length?null:w,paged:null}))},prefix:(0,o.createElement)(FV,{className:"w-4 h-4 text-icon-secondary"}),className:"min-w-[200px]"})),(0,o.createElement)(Gp.Item,null,(0,o.createElement)(ZV,null)),(0,o.createElement)(Gp.Item,null,(0,o.createElement)(Va,{variant:"outline",size:"sm",icon:(0,o.createElement)(QV,{className:"!size-3.5"}),iconPosition:"left",loading:v.isProcessing,disabled:0===r||v.isProcessing,onClick:r>0?e=>{e.preventDefault(),x({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),L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(e=>{if(e.success){const t=new Date,n="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,n);else{const e=document.createElement("a");e.href=URL.createObjectURL(r),e.download=n,e.click()}x({isProcessing:!1,buttonText:(0,z.__)("Export All","cartflows")})}}})}:()=>{}},v.isProcessing?v.buttonText:(0,z.__)("Export All","cartflows")," ("+r+")")))},JV=function({flows_count:e,selectedIds:t,bulkActions:n,onClearSelection:r}){const[a,s]=(0,i.useState)("hide"),[l,c]=(0,i.useState)(""),[{page_builder:u}]=g();return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Gp,{direction:"row",align:"center",justify:"between",className:"w-full"},(0,o.createElement)(Gp.Item,null,(0,o.createElement)(Gp,{direction:"row",align:"center",className:"gap-6"},(0,o.createElement)(Gp.Item,null,(0,o.createElement)("h1",{className:"text-xl whitespace-nowrap font-semibold text-text-primary leading-[30px] tracking-[-0.005em] m-0"},(0,z.__)("Funnels","cartflows"))),(0,o.createElement)(Gp.Item,null,(0,o.createElement)(Va,{variant:"primary",size:"sm",tag:C,to:{pathname:"admin.php",search:"?page=cartflows&path=library"},icon:(0,o.createElement)(KO,{className:"w-4 h-4"}),iconPosition:"left",className:"no-underline",onClick:e=>{"bricks-builder"===u&&(e.preventDefault(),s("show"))}},(0,z.__)("Create New Funnel","cartflows"))))),(0,o.createElement)(Gp.Item,null,(0,o.createElement)(qV,{selectedIds:t,bulkActions:n,onClearSelection:r,flows_count:e}))),(0,o.createElement)(Mp,{visibility:a,setVisibility:s,type:"blank",flowName:l,setFlowName:c}))},KV=window.moment;var eW=a.n(KV),tW=a(4601);function nW({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14"}))}const rW=i.forwardRef(nW);function aW({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 15 6-6m0 0-6-6m6 6H9a6 6 0 0 0 0 12h3"}))}const oW=i.forwardRef(aW);function iW({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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"}),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const sW=i.forwardRef(iW);function lW({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))}const cW=i.forwardRef(lW);function uW({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 dW=i.forwardRef(uW);function fW({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const mW=i.forwardRef(fW);function pW({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 hW=i.forwardRef(pW),gW=function({flow:e,selected:t,onChangeSelection:n}){const r=e.ID,a=e.post_title,i=e.actions,s="Publish"===e.post_status?(0,z.__)(" Published ","cartflows"):e.post_status,l=e.post_modified_gmt,c=e.flow_test_mode,u=e.step_count||0,f=void 0!==e.revenue?e.revenue:cartflows_admin.woo_currency+"0",[{active_flows_count:m},p]=d(),h=new URLSearchParams((0,b.useLocation)().search).get("post_status"),g=$V(),w=async e=>{if(e.preventDefault(),!await g({title:(0,z.__)("Trash Funnel","cartflows"),description:(0,z.__)("Do you really want to trash this funnel?","cartflows"),actionBtnText:(0,z.__)("Delete","cartflows"),cancelBtnText:(0,z.__)("Cancel","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",r),window.wcfAction="deleteFlow",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{pp.success((0,z.__)("Funnel deleted successfully!","cartflows")),p({type:"SET_FLOWS",flows:null})}))},y=async e=>{if(e.preventDefault(),!await g({title:(0,z.__)("Restore Funnel","cartflows"),description:(0,z.__)("Do you really want to restore this funnel?","cartflows"),actionBtnText:(0,z.__)("Restore","cartflows"),cancelBtnText:(0,z.__)("Cancel","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",r),window.wcfAction="restoreFlow",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(e=>{e.success&&(pp.success((0,z.__)("Funnel restored successfully!","cartflows")),p({type:"SET_FLOWS",flows:null}))}))};return(0,o.createElement)(FQ.Row,{key:r,selected:t,value:r,className:"hover:!bg-background-primary"},(0,o.createElement)(FQ.Cell,{className:"w-4 p-3 text-center"},(0,o.createElement)(fO,{size:"sm",checked:t,onChange:e=>n(e,r),"aria-label":(0,z.__)("Select row","cartflows")})),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap px-3 py-3"},(0,o.createElement)("a",{className:"wcf-flow-row__link flex flex-col gap-1 no-underline cursor-pointer hover:text-link-primary",href:i?.edit.link,title:a},(0,o.createElement)("span",{className:"block text-sm font-medium text-text-primary hover:text-link-primary hover:underline"},function(){let e=Ch(a,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length);return""===a&&(e=(0,z.__)("(no title)","cartflows")),"Draft"===s&&(e=(0,o.createElement)("span",{className:"wcf-draft-flow-title"},(0,o.createElement)("span",{className:"flex"},e,(0,o.createElement)(rW,{className:"h-5 w-5"}),(0,o.createElement)("span",{className:"wcf-draft-flow-status"},(0,z.__)("Draft","cartflows"))))),e}()),(0,o.createElement)("span",{className:"block text-[12px] font-normal text-text-secondary"},(0,z.sprintf)(/* translators: %d: number of steps */ /* translators: %d: number of steps */ |
| 25 |
(0,z.__)("(%d Steps)","cartflows"),u)))),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap px-3 py-3"},(0,o.createElement)(Ja,{content:(0,o.createElement)("span",null,(0,z.sprintf)(/* translators: %s date */ /* translators: %s date */ |
| 26 |
(0,z.__)("Last Modified: %s","cartflows"),l)),placement:"top",variant:"dark",arrow:!0,tooltipPortalId:"wcf-settings-app",className:"z-999999"},(0,o.createElement)("span",{className:"text-sm text-text-secondary"},eW().utc(l).local().startOf("seconds").fromNow()))),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap px-3 py-3"},(0,o.createElement)(Yf,{label:c?(0,z.__)("Sandbox","cartflows"):(0,z.__)("Live","cartflows"),type:"pill",variant:c?"yellow":"green",size:"sm",className:"w-fit"})),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap px-3 py-3"},"active"===cartflows_admin.woocommerce_status&&f?(0,o.createElement)("span",{className:"text-sm text-text-secondary"},fh(f)):(0,o.createElement)(Ja,{content:(0,z.__)("WooCommerce Required to display the revenue.","cartflows"),placement:"top",variant:"dark",arrow:!0,tooltipPortalId:"wcf-settings-app",className:"z-999999"},(0,o.createElement)("span",null,(0,o.createElement)(dW,{className:"w-18 h-18 stroke-2 text-support-error hover:text-text-error","aria-hidden":"true"})))),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap px-3 py-3"},(0,o.createElement)("div",{className:"wcf-flow-row__action-btns flex relative items-center gap-2 justify-end"},("trash"===h?[{key:"restore",label:(0,z.__)("Restore Flow","cartflows"),icon:(0,o.createElement)(oW,{className:"size-4","aria-hidden":"true"}),onClick:y},{key:"delete",label:(0,z.__)("Delete Flow","cartflows"),icon:(0,o.createElement)(aU,{className:"size-4","aria-hidden":"true"}),onClick:w}]:[{key:"view",label:(0,z.__)("View Funnel","cartflows"),icon:(0,o.createElement)(sW,{className:"size-4","aria-hidden":"true"}),tag:"a",href:i?.view.link,extraProps:i?.view.attr},{key:"edit",label:(0,z.__)("Edit Funnel","cartflows"),icon:(0,o.createElement)(cW,{className:"size-4","aria-hidden":"true"}),tag:"a",href:i?.edit.link}]).map(e=>(0,o.createElement)(Ja,{key:e.key,content:e.label,placement:"top",variant:"dark",arrow:!0,tooltipPortalId:"wcf-settings-app"},(0,o.createElement)(Va,(0,_.A)({variant:"ghost",size:"xs",icon:e.icon,className:"p-1.5 text-text-primary [&>svg]:size-4"},e.tag?{tag:e.tag,href:e.href}:{},e.extraProps||{},{onClick:e.onClick})))),"trash"!==h&&(0,o.createElement)(Nm,{placement:"bottom-end",className:"wcf-flow-row__actions-menu"},(0,o.createElement)(Nm.Trigger,null,(0,o.createElement)(Va,{variant:"ghost",size:"xs","aria-label":(0,z.__)("More Options","cartflows"),icon:(0,o.createElement)(eU,{className:"size-3.5","aria-hidden":"true"})})),(0,o.createElement)(Nm.ContentWrapper,{className:"z-50"},(0,o.createElement)(Nm.Content,{className:"wcf-actions-menu__dropdown_menu",size:"sm"},(0,o.createElement)(Nm.List,null,("draft"===h||"Draft"===s)&&(0,o.createElement)(Nm.Item,{onClick: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",[r]),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{pp.success((0,z.__)("Funnel published successfully!","cartflows")),p({type:"SET_FLOWS",flows:null})})},className:"hover:bg-primary-25 hover:text-primary-600"},(0,o.createElement)(mW,{className:"size-4"}),(0,z.__)("Publish","cartflows")),(0,o.createElement)(Nm.Item,{onClick:async e=>{if(e.preventDefault(),!wcfCartflowsPro()&&m>=3)return null;if(!await g({title:(0,z.__)("Duplicate Funnel","cartflows"),description:(0,z.__)("Do you really want to duplicate this funnel?","cartflows"),actionBtnText:(0,z.__)("Duplicate","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")}))return;const t=new window.FormData;t.append("action","cartflows_clone_flow"),t.append("security",cartflows_admin.clone_flow_nonce),t.append("id",r),window.wcfAction="cloneFlow",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{pp.success((0,z.__)("Funnel cloned successfully!","cartflows")),p({type:"SET_FLOWS",flows:null})}))},disabled:!wcfCartflowsPro()&&m>=3,className:"hover:bg-primary-25 hover:text-primary-600 aria-disabled:text-text-on-button-disabled aria-disabled:hover:text-text-on-button-disabled aria-disabled:hover:bg-transparent"},(0,o.createElement)(hW,{className:"size-4"}),wcfCartflowsPro()||m<3?(0,z.__)("Duplicate","cartflows"):(0,z.__)("Duplicate (Pro)","cartflows")),(0,o.createElement)(Nm.Item,{onClick:e=>{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",r),window.wcfAction="exportFlow",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(e=>{if(e.success){const t=e.data.flow_name||`flow-${r}.json`,n=JSON.stringify(e.data.flows),a=new Blob([n],{type:"application/json"});if(document.documentMode)window.navigator.msSaveOrOpenBlob(a,t);else{const e=document.createElement("a");e.href=URL.createObjectURL(a),e.download=t,e.click()}pp.success((0,z.__)("Funnel exported successfully!","cartflows"))}}))},className:"hover:bg-primary-25 hover:text-primary-600"},(0,o.createElement)(QV,{className:"size-4"}),(0,z.__)("Export","cartflows")),(0,o.createElement)(Nm.Separator,null),"trash"!==h?(0,o.createElement)(Nm.Item,{onClick:async e=>{if(e.preventDefault(),!await g({title:(0,z.__)("Trash Funnel","cartflows"),description:(0,z.__)("Do you really want to trash this Funnel?","cartflows"),actionBtnText:(0,z.__)("Trash","cartflows"),cancelBtnText:(0,z.__)("Cancel","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",r),window.wcfAction="deleteFlow",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(e=>{e.success&&(pp.success((0,z.__)("Funnel trashed successfully!","cartflows")),p({type:"SET_FLOWS",flows:null}))}))},className:"hover:bg-alert-background-danger hover:text-support-error"},(0,o.createElement)(aU,{className:"size-4"}),(0,z.__)("Move to Trash","cartflows")):(0,o.createElement)(Nm.Item,{onClick:y,className:"hover:bg-primary-25 hover:text-primary-600"},(0,o.createElement)(oW,{className:"size-4"}),(0,z.__)("Restore","cartflows")),"trash"===h&&(0,o.createElement)(Nm.Item,{onClick:w,className:"hover:bg-alert-background-danger hover:text-support-error"},(0,o.createElement)(aU,{className:"size-4"}),(0,z.__)("Delete","cartflows")))))))))};function wW({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-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 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z"}))}const yW=i.forwardRef(wW);function bW({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 vW=i.forwardRef(bW);function xW({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))}const _W=i.forwardRef(xW),EW=a.p+"images/searching.d25c54d6.png",NW=function(){const[{flows_data:e,active_flows_count:t,draft_flows_count:n,trash_flows_count:r,flows_pagination:a},s]=d(),l=new URLSearchParams((0,b.useLocation)().search),c=(0,b.useHistory)();let u=l.get("paged");const f=l.get("post_status"),m=l.get("s"),p=l.get("filter"),h=l.get("mode"),w=parseInt(l.get("per_page"))||10,y=l.get("from"),v=l.get("to"),[x,_]=(0,i.useState)(!1),[E,N]=(0,i.useState)([]),[M,I]=(0,i.useState)("hide"),[S,k]=(0,i.useState)(""),[{page_builder:j}]=g(),D=(0,i.useRef)(!1),A=(0,i.useRef)(""),[T,O]=(0,i.useState)(0),P=[u,w,f,m,h,p,"date"===p?y:"","date"===p?v:""].join("|");let R=!0;(e||x)&&(R=!1),u||(u=1);const U=[{value:"draft",label:(0,z.__)("Draft","cartflows"),icon:(0,o.createElement)(yW,{className:"w-18 h-18 stroke-2","data-action":"draft"})},{value:"trash",label:(0,z.__)("Trash","cartflows"),icon:(0,o.createElement)(aU,{className:"w-18 h-18 stroke-2","data-action":"trash"})},{value:"export",label:(0,z.__)("Export","cartflows"),icon:(0,o.createElement)(vW,{className:"w-18 h-18 stroke-2","data-action":"export"})}],B=[{value:"restore",label:(0,z.__)("Restore","cartflows"),icon:(0,o.createElement)(oW,{className:"w-18 h-18 stroke-2","data-action":"restore"})},{value:"delete_permanently",label:(0,z.__)("Delete","cartflows"),icon:(0,o.createElement)(aU,{className:"w-18 h-18 stroke-2","data-action":"delete_permanently"})}],F=[{value:"publish",label:(0,z.__)("Publish","cartflows"),icon:(0,o.createElement)(mW,{className:"w-18 h-18 stroke-2","data-action":"publish"})},{value:"export",label:(0,z.__)("Export","cartflows"),icon:(0,o.createElement)(vW,{className:"w-18 h-18 stroke-2","data-action":"export"})},{value:"trash",label:(0,z.__)("Move to Trash","cartflows"),icon:(0,o.createElement)(aU,{className:"w-18 h-18 stroke-2","data-action":"trash"})},{value:"delete_permanently",label:(0,z.__)("Delete","cartflows"),icon:(0,o.createElement)(aU,{className:"w-18 h-18 stroke-2","data-action":"delete_permanently"})}];let Y=[];"Publish"===f||null===f?Y=U:"trash"===f?Y=B:"draft"===f&&(Y=F),(0,i.useEffect)(()=>{if(null!==e)return;if(A.current=P,D.current)return;D.current=!0,N([]);const t=P,n=new window.FormData;if(n.append("paged",u),n.append("per_page",w),f&&n.append("post_status",f),m&&n.append("s",m),h&&n.append("mode",h),"date"===p){const e=new Date(y),t=new Date(v);n.append("start_date",Th(e)),n.append("end_date",Th(t))}_(!1),(async()=>{L()({path:"/cartflows/v1/admin/flows/",method:"POST",body:n}).then(e=>{t===A.current&&(s({type:"SET_FLOWS_DATA",flows:e.items,pagination:e.pagination,found_posts:e.found_posts,active_flows_count:e.active_flows_count,trash_flows_count:e.trash_flows_count,draft_flows_count:e.draft_flows_count}),!1===e.status?_(!0):_(!1))}).finally(()=>{D.current=!1,t!==A.current&&O(e=>e+1)})})()},[e,P,T]);const Q=(e,t)=>{N(e?[...E,t]:E.filter(e=>e!==t))};if(!R&&0===t&&0===n&&0===r){const e=[(0,z.__)("One Click Upsells","cartflows"),(0,z.__)("Checkout Editor","cartflows"),(0,z.__)("Order Bumps","cartflows"),(0,z.__)("Dynamic Offers","cartflows"),(0,z.__)("A/B Split Testing","cartflows"),(0,z.__)("Cart Abandonment","cartflows"),(0,z.__)("Conversion Templates","cartflows"),(0,z.__)("Insights","cartflows")];return(0,o.createElement)("main",{className:"wcf-no-flows-found-screen"},(0,o.createElement)("div",{className:"grid grid-cols-1 gap-4 items-start lg:grid-cols-5 lg:gap-10 xl:gap-10 rounded-lg bg-background-primary overflow-hidden border-0.5 border-solid border-border-subtle shadow-sm px-10 py-10"},(0,o.createElement)("div",{className:"grid grid-cols-1 gap-4 lg:col-span-2 h-full"},(0,o.createElement)("div",{className:"wcf-video-container"},(0,o.createElement)("iframe",{className:"wcf-video rounded-md",src:"https://www.youtube.com/embed/tCm60PWOd0M?showinfo=0&autoplay=0&mute=0&rel=0",allow:"autoplay",title:"YouTube video player",frameBorder:"0",allowFullScreen:!0}))),(0,o.createElement)("div",{className:"grid grid-cols-1 gap-4 lg:col-span-3 h-full"},(0,o.createElement)("div",{className:"flex flex-col justify-center h-full"},(0,o.createElement)("h2",{className:"text-text-primary text-3xl pb-3 font-semibold text-left m-0"},(0,z.__)("Create your first funnel","cartflows")),(0,o.createElement)("p",{className:"text-base text-text-secondary pb-5 m-0"},(0,z.__)("Build a sales funnel with everything you need to generate leads and grow sales.","cartflows")),(0,o.createElement)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 pb-6"},e.map(e=>(0,o.createElement)("div",{key:e,className:"flex items-center gap-1.5 text-base text-field-label"},(0,o.createElement)(_W,{className:"w-3 h-3 stroke-2 text-text-tertiary flex-shrink-0"}),e))),(0,o.createElement)("span",{className:"relative z-0 inline-flex flex-col sm:flex-row justify-start items-center w-full gap-4"},(0,o.createElement)(Va,{variant:"primary",size:"sm",tag:C,to:{pathname:"admin.php",search:"?page=cartflows&path=library"},icon:(0,o.createElement)(KO,{className:"w-18 h-18 stroke-2"}),iconPosition:"left",className:"no-underline",onClick:e=>{"bricks-builder"===j&&(e.preventDefault(),I("show"))}},(0,z.__)("Create Funnel","cartflows")),(0,o.createElement)("span",{className:"divider w-px sm:h-9 bg-background-secondary"}),(0,o.createElement)(ZV,{importBtnString:(0,z.__)("Import from JSON file","cartflows")}))))),(0,o.createElement)(Mp,{visibility:M,setVisibility:I,type:"blank",flowName:S,setFlowName:k}))}const V=!R&&e&&0===e.length,W=!R&&e&&e.length>0;return(0,o.createElement)("div",{className:"wcf-flows-page-wrapper flex flex-col gap-6"},(0,o.createElement)(Gp,{direction:"column",className:"rounded-xl bg-background-primary border-0.5 border-solid border-border-subtle shadow-sm-blur-2 p-4 gap-4"},(0,o.createElement)(Gp.Item,{className:"p-1"},(0,o.createElement)(JV,{flows_count:t+n,selectedIds:E,bulkActions:Y,onClearSelection:()=>N([])})),(0,o.createElement)(Gp.Item,{className:"border-t border-border-subtle"},V&&(0,o.createElement)("div",{className:"wcf-no-flows-found text-center bg-background-primary p-20"},(0,o.createElement)("div",{className:"wcf-no-flows--content-block mx-auto max-w-2xl flex flex-col items-center gap-3"},(0,o.createElement)("img",{src:EW,alt:"",width:"120",height:"100"}),(0,o.createElement)("div",{className:"flex flex-col items-center gap-1"},(0,o.createElement)("p",{className:"text-lg font-semibold text-text-primary m-0"},null!==m?(0,z.sprintf)(/* translators: %s Search term */ /* translators: %s Search term */ |
| 27 |
(0,z.__)('No matching results found for the search term "%s".',"cartflows"),m):(0,z.__)("No funnels found for the selected filter.","cartflows")),(0,o.createElement)("p",{className:"text-sm text-text-tertiary m-0"},(0,z.__)("Please try using different keywords, date range, or filters to refine your results.","cartflows"))),(0,o.createElement)("div",{className:"wcf-no-flows--divider relative mt-3 mx-auto max-w-xs w-full"},(0,o.createElement)("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true"},(0,o.createElement)("div",{className:"w-full border-t border-dashed border-border-subtle"})),(0,o.createElement)("div",{className:"relative flex justify-center"},(0,o.createElement)("span",{className:"bg-background-primary px-2 text-sm text-text-tertiary lowercase"},(0,z.__)("or","cartflows")))),(0,o.createElement)("div",{className:"mt-3"},(0,o.createElement)(Va,{variant:"primary",size:"sm",tag:C,to:{pathname:"admin.php",search:"?page=cartflows&path=library"},icon:(0,o.createElement)(KO,{className:"w-18 h-18 stroke-2"}),iconPosition:"left",className:"no-underline"},(0,z.__)("Create New","cartflows"))))),(R||W)&&(0,o.createElement)("div",{className:"wcf-flows-table bg-background-primary "+("trash"===f?"wcf-flows-table-trash":"")},(0,o.createElement)(FQ,null,(0,o.createElement)(FQ.Head,null,(0,o.createElement)(FQ.HeadCell,{className:"w-4 p-3 text-center"},(0,o.createElement)(fO,{size:"sm",checked:!R&&E.length>0,indeterminate:!R&&E.length>0&&E.length<(e?.length||0),onChange:t=>{const n=E.length>0&&E.length<e.length;N(t||n?e.map(e=>e.ID):[])},"aria-label":E.length>0?(0,z.__)("Deselect all","cartflows"):(0,z.__)("Select all","cartflows")})),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Name","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Last Updated","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Mode","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Sales","cartflows")),(0,o.createElement)(FQ.HeadCell,{className:"w-[181px] text-right"},(0,z.__)("Actions","cartflows"))),(0,o.createElement)(FQ.Body,null,R?Array.from({length:10},(e,t)=>(0,o.createElement)(FQ.Row,{key:t,className:"relative"},(0,o.createElement)(FQ.Cell,{className:"w-4 p-3 text-center"},(0,o.createElement)(cO,{className:"mx-auto size-4 rounded-md"})),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap px-3 py-3"},(0,o.createElement)("div",{className:"flex flex-col gap-1.5"},(0,o.createElement)(cO,{className:"h-4 w-full rounded-md"}),(0,o.createElement)(cO,{className:"h-3 w-16 rounded-md"}))),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap px-3 py-3"},(0,o.createElement)(cO,{className:"h-4 w-24 rounded-md"})),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap px-3 py-3"},(0,o.createElement)(cO,{className:"h-5 w-16 rounded-full"})),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap px-3 py-3"},(0,o.createElement)(cO,{className:"h-4 w-12 rounded-md"})),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap px-3 py-3"},(0,o.createElement)(cO,{className:"h-5 w-full rounded-md"})))):e&&e.map(e=>(0,o.createElement)(gW,{key:e.ID,flow:e,selected:E.includes(e.ID),onChangeSelection:Q}))),(R||parseInt(a?.max_pages)>1)&&(0,o.createElement)(FQ.Footer,{className:"flex flex-col md:flex-row md:justify-between"},R?(0,o.createElement)("div",{className:"w-full flex items-center justify-between"},(0,o.createElement)(cO,{className:"h-8 w-24 rounded-md"}),(0,o.createElement)(cO,{className:"h-8 w-32 rounded-md"})):(0,o.createElement)(UV,{currentPage:parseInt(u),maxPages:parseInt(a?.max_pages),perPage:w,onPerPageChange:e=>{s({type:"SET_FLOWS",flows:null});const t=new URLSearchParams;t.set("page","cartflows"),t.set("path","flows"),t.set("paged","1"),t.set("per_page",String(e)),f&&t.set("post_status",f),m&&t.set("s",m),h&&t.set("mode",h),"date"===p&&(t.set("filter","date"),t.set("from",l.get("from")),t.set("to",l.get("to"))),c.push({pathname:"admin.php",search:"?"+t.toString()})}})))))))},MW=Ua("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]),IW=Ua("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]),SW=(0,i.createContext)({isCollapsed:!1,setIsCollapsed:()=>{},collapsible:!0}),kW=({children:e,className:t,onCollapseChange:n,collapsible:r=!0,borderOn:a=!0,collapsed:o=!1,...s})=>{const l=(0,i.useRef)(null),[c,u]=(0,i.useState)(()=>!r&&o?o:Be("sidebar-collapsed")||window.innerWidth<1280);return(0,i.useEffect)(()=>{"function"==typeof n&&n(c)},[c,n]),(0,i.useEffect)(()=>{if(!r&&o)return;const e=()=>{const e=window.innerWidth<1280;if(r)if(e)u(!0),Ue("sidebar-collapsed",!0);else{const e=Be("sidebar-collapsed");u(e||!1)}else u(!1),(e=>{if(!(typeof window>"u"))try{localStorage.removeItem(e)}catch(e){console.error(e)}})("sidebar-collapsed")};return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[r]),(0,P.jsx)(SW.Provider,{value:{isCollapsed:c,setIsCollapsed:u,collapsible:r},children:(0,P.jsx)("div",{ref:l,className:Oe("h-full overflow-auto w-72 px-4 py-4 gap-4 flex flex-col bg-background-primary",a&&"border-0 border-r border-solid border-border-subtle","transition-all duration-200",c&&"w-16 px-2",t),...s,children:e})})};kW.displayName="Sidebar";const jW=({children:e})=>(0,P.jsx)("div",{className:"space-y-2",children:e});jW.displayName="Sidebar.Header";const DW=({children:e})=>(0,P.jsx)("div",{className:Oe("space-y-4 grow items-start"),children:e});DW.displayName="Sidebar.Body";const CW=({children:e})=>{const{isCollapsed:t,setIsCollapsed:n,collapsible:r}=(0,i.useContext)(SW);return(0,P.jsxs)("div",{className:"space-y-4",children:[e,r&&(0,P.jsx)("button",{className:Oe("bg-transparent w-full border-0 p-0 m-0 flex items-center gap-2 text-base cursor-pointer",t&&"justify-center"),onClick:()=>{n(!t),Ue("sidebar-collapsed",!t)},"aria-label":t?"Expand sidebar":"Collapse sidebar",children:t?(0,P.jsx)(P.Fragment,{children:(0,P.jsx)(Ja,{title:"Expand",children:(0,P.jsx)(MW,{className:"size-5"})})}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(IW,{className:"size-5"})," Collapse"]})})]})};CW.displayName="Sidebar.Footer";const AW=({children:e,className:t})=>(0,P.jsx)("div",{className:Oe("w-full",t),children:e});AW.displayName="Sidebar.Item";const TW=Object.assign(kW,{Header:jW,Body:DW,Footer:CW,Item:AW}),OW=function(e){const{settings:t}=e,[{options:n}]=d();return(0,o.createElement)("table",{className:"wcf-global-settings-content-table w-full"},(0,o.createElement)("tbody",null,t?.fields&&Object.keys(t.fields).map(e=>{const r=t.fields[e],a=n[r.name]?n[r.name]:"",i=Ah.isActiveControl(r,n);return(0,o.createElement)(uQ,{key:e,data:r,value:a,isActive:i,field:e})})))},LW=Ua("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),zW=({type:e="simple",defaultValue:t=[],autoClose:n=!1,disabled:r=!1,children:a,className:o})=>{const[s,l]=(0,i.useState)(Array.isArray(t)?t:[t]);return(0,P.jsx)("div",{className:Oe("boxed"===e?"space-y-3":"",o),children:i.Children.map(a,t=>{if(i.isValidElement(t)&&"value"in t.props){const a=!1!==t.props.collapsible,o=!a||s.includes(t.props.value);return i.cloneElement(t,{isOpen:o,onToggle:a?()=>(e=>{l(t=>n?t.includes(e)?[]:[e]:t.includes(e)?t.filter(t=>t!==e):[...t,e])})(t.props.value):void 0,type:e,disabled:r||t.props.disabled})}return t})})};zW.displayName="Accordion";const PW=({isOpen:e,onToggle:t,type:n="simple",disabled:r=!1,children:a,className:o})=>{const s={simple:"border-0",separator:"border-0 border-b border-solid border-border-subtle",boxed:"border border-solid border-border-subtle rounded-md"}[n];return(0,P.jsx)("div",{className:Oe(s,o),children:i.Children.map(a,a=>i.isValidElement(a)?i.cloneElement(a,{isOpen:e,onToggle:t,type:n,disabled:r}):a)})};PW.displayName="Accordion.Item";const RW=({onClick:e,onToggle:t,isOpen:n,iconType:r="arrow",collapsible:a=!0,disabled:o=!1,tag:i="h3",type:s="simple",children:l,className:c,...u})=>{const d={simple:"px-2 py-3",separator:"px-2 py-4",boxed:"px-3 py-4"}[s];return(0,P.jsx)(i,{className:"flex m-0 hover:bg-background-secondary transition duration-150 ease-in-out",children:(0,P.jsxs)("button",{className:Oe("flex w-full items-center justify-between text-sm font-medium transition-all appearance-none bg-transparent border-0 cursor-pointer gap-3",d,o&&"cursor-not-allowed opacity-40",c),onClick:Le(e,!o&&a?t:void 0),"aria-expanded":n,"aria-disabled":o,disabled:o,...u,children:[(0,P.jsx)("div",{className:"flex items-center gap-2 text-text-primary font-semibold text-left",children:l}),a?"arrow"===r?(0,P.jsx)(hm,{className:Oe("flex-shrink-0 text-icon-secondary size-5 transition-transform duration-300 ease-in-out",n?"rotate-180":"rotate-0"),"aria-hidden":"true"}):"plus-minus"===r?(0,P.jsx)(kf.span,{initial:{opacity:0,rotate:n?-180:0},animate:{opacity:1,rotate:n?0:180},exit:{opacity:0},transition:{duration:.3,ease:"easeInOut"},className:"flex items-center flex-shrink-0 text-icon-secondary","aria-hidden":"true",children:n?(0,P.jsx)(dO,{}):(0,P.jsx)(LW,{})},n?"minus":"plus"):null:null]})})};RW.displayName="Accordion.Trigger";const UW=({isOpen:e,disabled:t=!1,type:n="simple",children:r,className:a})=>{const o={simple:"px-2 pb-3",separator:"px-2 pb-4",boxed:"px-3 pb-4"}[n];return(0,P.jsx)(pm,{initial:!1,children:e&&(0,P.jsx)(kf.div,{variants:{open:{height:"auto",opacity:1,overflow:"unset",transition:{overflow:{delay:1}}},closed:{height:0,opacity:0,overflow:"hidden"}},initial:"closed",animate:"open",exit:"closed",transition:{duration:.3,ease:"easeInOut"},className:Oe("text-text-secondary w-full text-sm transition-[height, opacity, transform] ease-in box-border",t&&"opacity-40",a),"aria-hidden":!e,role:"region",children:(0,P.jsx)("div",{className:Oe(o),children:r})},"content")})};UW.displayName="Accordion.Content";const BW=Object.assign(zW,{Item:PW,Trigger:RW,Content:UW}),FW=a.p+"images/facebook.45f6105e.png",YW=a.p+"images/google.7d03dc5b.png",QW={_cartflows_facebook:FW,_cartflows_google_analytics:YW,_cartflows_google_auto_address:YW,_cartflows_tiktok:a.p+"images/tiktok-logo.ba162390.png",_cartflows_pinterest:a.p+"images/pinterest.63ab968b.png",_cartflows_google_ads:a.p+"images/googleads.b4896752.png",_cartflows_snapchat:a.p+"images/snapchat.b0f205c4.png"},VW=function({title:e,settings:t,meta_key:n}){const r=t.title.replace(/ /g,"_").toLowerCase(),a=t.title.replace(/ /g,"-").toLowerCase(),i=QW[n]||"";return(0,o.createElement)(BW,{type:"boxed",className:`wcf-${a} mb-5`},(0,o.createElement)(BW.Item,{value:r},(0,o.createElement)(BW.Trigger,{iconType:"arrow",onClick:e=>e.preventDefault()},(0,o.createElement)("div",{className:"flex items-center gap-2"},i&&(0,o.createElement)("img",{src:i,alt:e,className:"w-5 h-5 object-contain"}),(0,o.createElement)("span",{className:"text-base font-medium text-text-primary"},e))),(0,o.createElement)(BW.Content,null,(0,o.createElement)(OW,{settings:t,meta_key:n}))))},WW=function({roles:e}){const[{options:t},n]=d();return(0,o.createElement)("div",{className:"wcf-user-role--container flex flex-col gap-2"},Object.keys(e).map(r=>{var a;const i=e[r],s=i?.fields?.["roles-structure"];if(!s)return null;const l=s.name,c=null!==(a=t[l])&&void 0!==a?a:"no_access";return(0,o.createElement)("div",{key:r,className:"wcf-user-role__row flex items-center justify-between gap-6 py-3 border-0 border-b border-solid border-border-subtle last:border-b-0"},(0,o.createElement)("div",{className:"wcf-user-role__name w-40 shrink-0 text-sm font-medium text-text-primary"},i.role_name),(0,o.createElement)("div",{className:"wcf-user-role__access"},(0,o.createElement)(AQ.Group,{activeItem:c,size:"sm",variant:"rounded",width:"auto",iconPosition:"right",onChange:({value:e})=>((e,t)=>{window.wcfUnsavedChanges=!0,n({type:"SET_OPTION",name:e,value:t})})(l,e.slug)},s.options.map(e=>(0,o.createElement)(AQ.Tab,{key:e.value,slug:e.value,text:e.label,type:"button",className:e.value===c?"ring-1 ring-brand-500 !bg-brand-25 !text-brand-600":"",icon:e.tooltip?(0,o.createElement)(Ja,{content:e.tooltip,placement:"top",arrow:!0},(0,o.createElement)("span",{className:"inline-flex"},(0,o.createElement)(Ba,{className:"size-3.5 cursor-help "+(e.value===c?"text-brand-600":"text-text-tertiary")}))):null}))),(0,o.createElement)("input",{type:"hidden",name:l,value:c})))}),(0,o.createElement)(zY,{content:(0,z.sprintf)( |
| 28 |
// translators: %1$s: link html start, %2$s: link html end |
| 29 |
// translators: %1$s: link html start, %2$s: link html end |
| 30 |
(0,z.__)("For more information about the user role manager settings please %1$sClick here.%2$s","cartflows"),`<a href="${getKbDocUrl("https://cartflows.com/docs/user-role-manager/",{utm_campaign:"user_role_manager"})}" class="text-brand-500 hover:text-brand-600" target="_blank">`,"</a>")}))},ZW=({design:e="inline",theme:t="light",variant:n="neutral",className:r="",title:a="",content:o="",icon:i=null,onClose:s,action:l={label:"",onClick:()=>{},type:"link"}})=>{const c=()=>{"function"==typeof s&&s()},u={neutral:"ring-alert-border-neutral bg-alert-background-neutral",custom:"ring-alert-border-neutral bg-alert-background-neutral",info:"ring-alert-border-info bg-alert-background-info",success:"ring-alert-border-green bg-alert-background-green",warning:"ring-alert-border-warning bg-alert-background-warning",error:"ring-alert-border-danger bg-alert-background-danger"},d="bg-background-inverse ring-background-inverse",f={light:"text-icon-secondary",dark:"text-icon-inverse"},m=()=>{l?.onClick?.(c)};return"stack"===e?(0,P.jsx)("div",{className:Oe("flex items-center justify-start p-4 gap-2 relative ring-1 rounded-md shadow-lg","dark"===t?d:u?.[n],r),children:(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Ga({variant:n,icon:i,theme:t})}),(0,P.jsxs)("div",{className:"flex flex-col items-start justify-start gap-0.5 mr-7",children:[$a({title:a,theme:t}),Xa({content:o,theme:t}),l?.label&&"function"==typeof l?.onClick&&(0,P.jsx)("div",{className:"mt-2.5",children:Ha({actionLabel:l?.label,actionType:l?.type??"button",onAction:m,theme:t})})]}),(0,P.jsx)("div",{className:"absolute right-4 top-4 [&_svg]:size-5",children:(0,P.jsx)("button",{className:Oe("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",f[t]??f.light),onClick:()=>c(),"aria-label":"Close alert",children:(0,P.jsx)(Ff,{})})})]})}):(0,P.jsxs)("div",{className:Oe("flex items-center justify-between p-3 gap-2 relative ring-1 rounded-lg shadow-lg","dark"===t?d:u?.[n],r),children:[(0,P.jsxs)("div",{className:"flex items-center justify-start gap-2",children:[(0,P.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Ga({variant:n,icon:i,theme:t})}),(0,P.jsxs)("p",{className:"content-start space-x-1 my-0 mr-10 px-1",children:[$a({title:a,theme:t,inline:!0}),Xa({content:o,theme:t,inline:!0})]})]}),(0,P.jsxs)("div",{className:"flex h-full justify-start gap-4 [&_svg]:size-4",children:[l?.label&&"function"==typeof l?.onClick&&(0,P.jsx)("div",{className:"self-center flex h-5",children:Ha({actionLabel:l?.label,actionType:l?.type??"button",onAction:m,theme:t})}),"function"==typeof s&&(0,P.jsx)("button",{className:Oe("self-start bg-transparent m-0 border-none p-0.5 focus:outline-none active:outline-none cursor-pointer size-5",f[t]??f.light),onClick:()=>c(),"aria-label":"Close alert",children:(0,P.jsx)(Ff,{})})]})]})};function GW({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))}const HW=i.forwardRef(GW),$W=function({webhook:e,availableEvents:t,onSave:n,onCancel:r}){const a=!!e,[s,l]=(0,i.useState)(e?e.name:""),[c,u]=(0,i.useState)(e?e.url:""),[d,f]=(0,i.useState)(e&&e.events||[]),[m,p]=(0,i.useState)(!e||e.enabled),[h,g]=(0,i.useState)(e?e.max_retries:3),[w]=(0,i.useState)(e?e.secret:""),[y,b]=(0,i.useState)(!1),[v,x]=(0,i.useState)(""),[_,E]=(0,i.useState)(!1),N=Object.keys(t),M=N.length>0&&d.length===N.length;return(0,o.createElement)("div",{className:"wcf-webhook--container w-full"},(0,o.createElement)("div",{className:"wcf-back-to-webhooks-cta-container mb-6 flex flex-col gap-2 items-start"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(HW,null),iconPosition:"left",onClick:r,className:"!p-0"},(0,z.__)("Back to Webhooks","cartflows")),(0,o.createElement)($p,{tag:"h4",size:"sm",title:a?(0,z.__)("Edit Webhook","cartflows"):(0,z.__)("Add New Webhook","cartflows"),className:"[&_h4]:text-text-primary"})),v&&(0,o.createElement)("div",{className:"mb-4"},(0,o.createElement)(ZW,{variant:"error",design:"inline",content:v,onClose:()=>x("")})),(0,o.createElement)("div",{className:"wcf-webhook-wrapper"},(0,o.createElement)("div",{className:"wcf-webhook-fields-wrapper space-y-6"},(0,o.createElement)("div",{className:"wcf-field wcf-text-field text-left"},(0,o.createElement)("div",{className:"wcf-field__data flex flex-col items-start gap-2 justify-between"},(0,o.createElement)(Qf,{tag:"label",size:"md",htmlFor:"webhook-name",className:"text-text-primary font-medium"},(0,z.__)("Name","cartflows")),(0,o.createElement)("div",{className:"w-full"},(0,o.createElement)(dp,{id:"webhook-name",type:"text",size:"md",value:s,onChange:e=>l(e),placeholder:(0,z.__)("e.g. CRM Integration","cartflows")})))),(0,o.createElement)("div",{className:"wcf-field wcf-text-field text-left"},(0,o.createElement)("div",{className:"wcf-field__data flex flex-col items-start gap-2 justify-between"},(0,o.createElement)(Qf,{tag:"label",size:"md",htmlFor:"webhook-endpoint-url",className:"text-text-primary font-medium"},(0,z.__)("Endpoint URL","cartflows")),(0,o.createElement)("div",{className:"w-full"},(0,o.createElement)(dp,{id:"webhook-endpoint-url",type:"url",size:"md",value:c,onChange:e=>u(e),placeholder:"https://example.com/webhook"})))),(0,o.createElement)("div",{className:"wcf-field wcf-checkbox-field text-left"},(0,o.createElement)("div",{className:"wcf-field__data flex flex-col items-start gap-3 justify-between"},(0,o.createElement)("div",{className:"wcf-field__data--content-left"},(0,o.createElement)(Qf,{tag:"span",size:"md",className:"text-text-primary font-medium"},(0,z.__)("Events","cartflows")),(0,o.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-secondary mt-1"},(0,z.__)("Select events that will trigger this webhook.","cartflows"))),(0,o.createElement)("div",{className:"wcf-field__data--content-right w-full"},(0,o.createElement)("div",{className:"mb-2 flex items-center"},(0,o.createElement)(fO,{id:"webhook-select-all-events",checked:M,onChange:()=>{d.length===N.length?f([]):f(N)},size:"sm",label:{heading:(0,z.__)("Select All","cartflows")}})),(0,o.createElement)("div",{className:"flex flex-col gap-2 border border-solid border-border-subtle rounded-md p-3"},Object.entries(t).map(([e,t])=>(0,o.createElement)("div",{key:e,className:"flex items-center"},(0,o.createElement)(fO,{id:`webhook-event-${e}`,checked:d.includes(e),onChange:()=>{return t=e,void(d.includes(t)?f(d.filter(e=>e!==t)):f([...d,t]));var t},size:"sm",label:{heading:t}}))))))),(0,o.createElement)("div",{className:"wcf-field wcf-toggle-field text-left"},(0,o.createElement)("div",{className:"wcf-field__data flex items-center gap-6 justify-between"},(0,o.createElement)(Qf,{tag:"span",size:"md",className:"text-text-primary font-medium"},(0,z.__)("Enabled","cartflows")),(0,o.createElement)(bO,{id:"webhook-enabled",size:"sm",value:!!m,onChange:e=>p(e)}))),(0,o.createElement)("div",{className:"wcf-field wcf-text-field text-left"},(0,o.createElement)("div",{className:"wcf-field__data flex flex-col items-start gap-2 justify-between"},(0,o.createElement)("div",{className:"wcf-field__data--content-left"},(0,o.createElement)(Qf,{tag:"label",size:"md",htmlFor:"webhook-max-retries",className:"text-text-primary font-medium"},(0,z.__)("Max Retries","cartflows")),(0,o.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-secondary mt-1"},(0,z.__)("Number of retry attempts for failed deliveries (0-5).","cartflows"))),(0,o.createElement)("div",{className:"w-full"},(0,o.createElement)(dp,{id:"webhook-max-retries",type:"number",min:"0",max:"5",size:"md",value:String(h),onChange:e=>{const t=parseInt(e);g(Math.min(5,Math.max(0,Number.isNaN(t)?0:t)))}})))),a&&w&&(0,o.createElement)("div",{className:"wcf-field wcf-text-field text-left"},(0,o.createElement)("div",{className:"wcf-field__data flex flex-col items-start gap-2 justify-between"},(0,o.createElement)("div",{className:"wcf-field__data--content-left"},(0,o.createElement)(Qf,{tag:"span",size:"md",className:"text-text-primary font-medium"},(0,z.__)("Secret Key","cartflows")),(0,o.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-secondary mt-1"},(0,z.__)("Used to sign webhook payloads (HMAC-SHA256).","cartflows"))),(0,o.createElement)("div",{className:"wcf-field__data--content-right w-full"},(0,o.createElement)("div",{className:"flex items-center gap-2"},(0,o.createElement)("code",{className:"text-xs bg-background-secondary px-3 py-2 rounded-md border border-solid border-border-subtle font-mono text-text-primary break-all"},w),(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(yW,null),onClick:()=>{w&&(navigator.clipboard.writeText(w),E(!0),setTimeout(()=>E(!1),2e3))},"aria-label":(0,z.__)("Copy to clipboard","cartflows"),title:(0,z.__)("Copy to clipboard","cartflows")}),_&&(0,o.createElement)("span",{className:"text-xs text-support-success"},(0,z.__)("Copied!","cartflows"))))))),(0,o.createElement)("div",{className:"wcf-webhook-actions-wrapper flex items-center gap-3 mt-8 pt-6"},(0,o.createElement)(Va,{variant:"primary",size:"sm",onClick:()=>{if(x(""),!s.trim())return void x((0,z.__)("Please enter a webhook name.","cartflows"));if(!c.trim())return void x((0,z.__)("Please enter a webhook URL.","cartflows"));try{new URL(c)}catch{return void x((0,z.__)("Please enter a valid URL.","cartflows"))}if(0===d.length)return void x((0,z.__)("Please select at least one event.","cartflows"));const t={name:s.trim(),url:c.trim(),events:d,enabled:m,max_retries:h},r=a?"/cartflows/v1/admin/webhooks/"+e.id:"/cartflows/v1/admin/webhooks/",o=a?"PUT":"POST";b(!0),L()({path:r,method:o,data:t}).then(e=>{e.success?n():x(e.message||(0,z.__)("Failed to save webhook.","cartflows"))}).catch(e=>{x(e.message||(0,z.__)("Something went wrong.","cartflows"))}).finally(()=>{b(!1)})},loading:y,disabled:y},a?(0,z.__)("Update Webhook","cartflows"):(0,z.__)("Create Webhook","cartflows")),(0,o.createElement)(Va,{variant:"outline",size:"sm",onClick:r},(0,z.__)("Cancel","cartflows")))))};function XW({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 12 3.269 3.125A59.769 59.769 0 0 1 21.485 12 59.768 59.768 0 0 1 3.27 20.875L5.999 12Zm0 0h7.5"}))}const qW=i.forwardRef(XW),JW=function(){const e=$V(),[t,n]=(0,i.useState)([]),[r,a]=(0,i.useState)({}),[s,l]=(0,i.useState)(!0),[c,u]=(0,i.useState)(!1),[d,f]=(0,i.useState)(null),[m,p]=(0,i.useState)(null),[h,g]=(0,i.useState)(null),w=(0,i.useCallback)(()=>{l(!0),L()({path:"/cartflows/v1/admin/webhooks/"}).then(e=>{e.success&&n(e.webhooks||[]),l(!1)})},[]),y=(0,i.useCallback)(()=>{L()({path:"/cartflows/v1/admin/webhooks/events"}).then(e=>{e.success&&a(e.events||{})})},[]);(0,i.useEffect)(()=>{w(),y()},[w,y]);return c?(0,o.createElement)($W,{webhook:d,availableEvents:r,onSave:()=>{u(!1),f(null),w()},onCancel:()=>{u(!1),f(null)}}):(0,o.createElement)("div",{className:"wcf-webhooks w-full"},(0,o.createElement)("div",{className:"flex items-start justify-between gap-4 mb-6"},(0,o.createElement)("div",{className:"flex flex-col gap-1"},(0,o.createElement)($p,{tag:"h4",size:"sm",title:(0,z.__)("Webhooks","cartflows"),className:"[&_h4]:text-text-primary"})),(0,o.createElement)(Va,{variant:"primary",size:"sm",icon:(0,o.createElement)(KO,null),iconPosition:"left",onClick:()=>{f(null),u(!0)},className:"whitespace-nowrap"},(0,z.__)("Add New Webhook","cartflows"))),s?(0,o.createElement)("div",{className:"flex items-center justify-center py-12"},(0,o.createElement)(Wf,{className:"w-6 h-6 animate-spin text-text-tertiary"})):0===t.length?(0,o.createElement)("div",{className:"text-center py-4 border border-dashed border-border-subtle rounded-lg"},(0,o.createElement)("p",{className:"text-sm text-text-tertiary m-0"},(0,z.__)('No webhooks configured yet. Click "Add New Webhook" to get started.',"cartflows"))):(0,o.createElement)("div",{className:"overflow-x-auto"},(0,o.createElement)(FQ,{className:"min-w-full"},(0,o.createElement)(FQ.Head,null,(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Name","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("URL","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Events","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Status","cartflows")),(0,o.createElement)(FQ.HeadCell,{className:"whitespace-nowrap"},(0,z.__)("Last Delivery","cartflows")),(0,o.createElement)(FQ.HeadCell,{className:"text-right"},(0,z.__)("Actions","cartflows"))),(0,o.createElement)(FQ.Body,null,t.map(t=>(0,o.createElement)(FQ.Row,{key:t.id},(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap font-medium text-text-primary"},t.name),(0,o.createElement)(FQ.Cell,{className:"text-text-secondary max-w-xs truncate"},t.url),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap text-text-secondary"},t.events?t.events.length:0," ",(0,z.__)("events","cartflows")),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},(0,o.createElement)(bO,{size:"sm",value:!!t.enabled,onChange:()=>(e=>{L()({path:"/cartflows/v1/admin/webhooks/"+e.id,method:"PUT",data:{enabled:!e.enabled}}).then(e=>{e.success&&w()})})(t)})),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},(0,o.createElement)("div",{className:"flex items-center gap-2"},(e=>{const t=e.last_delivery;return t&&t.status?"success"===t.status?(0,o.createElement)(Yf,{label:(0,z.__)("Success","cartflows"),type:"pill",variant:"green",size:"xs",disableHover:!0}):(0,o.createElement)("span",{title:t.error||""},(0,o.createElement)(Yf,{label:(0,z.__)("Failed","cartflows"),type:"pill",variant:"red",size:"xs",disableHover:!0})):(0,o.createElement)(Yf,{label:(0,z.__)("Never triggered","cartflows"),type:"pill",variant:"neutral",size:"xs",disableHover:!0})})(t),h&&h.id===t.id&&(0,o.createElement)("span",{className:"text-xs "+(h.success?"text-support-success":"text-support-error")},h.success?(0,z.__)("Test sent!","cartflows"):h.error))),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap text-right"},(0,o.createElement)("div",{className:"flex items-center justify-end gap-1"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:m===t.id?(0,o.createElement)(Wf,{className:"animate-spin"}):(0,o.createElement)(qW,null),onClick:()=>(e=>{p(e),g(null),L()({path:"/cartflows/v1/admin/webhooks/"+e+"/test",method:"POST"}).then(t=>{p(null),g({id:e,success:t.success,response_code:t.response_code,error:t.error}),w(),setTimeout(()=>g(null),5e3)})})(t.id),disabled:m===t.id,"aria-label":(0,z.__)("Send Test","cartflows"),title:(0,z.__)("Send Test","cartflows")}),(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(cW,null),onClick:()=>(e=>{f(e),u(!0)})(t),"aria-label":(0,z.__)("Edit","cartflows"),title:(0,z.__)("Edit","cartflows")}),(0,o.createElement)(Va,{variant:"ghost",size:"xs",destructive:!0,icon:(0,o.createElement)(aU,null),onClick:()=>(async t=>{await e({title:(0,z.__)("Delete Webhook","cartflows"),description:(0,z.__)("Are you sure you want to delete this webhook?","cartflows"),actionBtnText:(0,z.__)("Delete","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})&&L()({path:"/cartflows/v1/admin/webhooks/"+t,method:"DELETE"}).then(e=>{e.success&&w()})})(t.id),"aria-label":(0,z.__)("Delete","cartflows"),title:(0,z.__)("Delete","cartflows")})))))))))},KW=e=>{const{pluginName:t,isPopupOpen:n,setIsPopupOpen:r,previousVersionSelect:a,setIsConfirming:s}=e,[l,c]=(0,i.useState)(n);return(0,i.useEffect)(()=>{c(e=>e!==n?n:e)},[n]),(0,o.createElement)($m,{open:l,setOpen:e=>{c(e),e||r(!1)},exitOnClickOutside:!1},(0,o.createElement)($m.Panel,{className:"!p-3 !gap-4"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)("div",{className:"flex gap-2.5 p-2"},(0,o.createElement)(uh,{className:"w-6 h-6 text-support-warning shrink-0 mt-0.5","aria-hidden":"true"}),(0,o.createElement)("div",{className:"flex flex-col gap-1.5 flex-1 min-w-0"},(0,o.createElement)("div",{className:"flex items-center justify-between"},(0,o.createElement)($m.Title,{className:"!text-lg"},(0,z.__)("Rollback to Previous Version","cartflows")),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)("p",{className:"text-sm text-text-secondary m-0"},(0,z.sprintf)( |
| 31 |
// translators: %1$s is the selected product of CartFlows, %2$s is the selected version of CartFlows. |
| 32 |
// translators: %1$s is the selected product of CartFlows, %2$s is the selected version of CartFlows. |
| 33 |
(0,z.__)("Are you sure you want to rollback to %1$s v%2$s?","cartflows"),t,a)))),(0,o.createElement)($m.Footer,{className:"!p-2 flex gap-3 justify-end"},(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:()=>{r(!1)}},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(Va,{variant:"primary",size:"md",onClick:()=>{const e=cartflows_admin.rollback_url.replace("VERSION",a);r(!1),s(!0),window.location.href=e}},(0,z.__)("Rollback","cartflows")))))},eZ=()=>{const e=cartflows_admin.cartflows_previous_versions,[t,n]=(0,i.useState)(e[0].value),[r,a]=(0,i.useState)(!1),[s,l]=(0,i.useState)(!1),[c,u]=(0,i.useState)("");return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("section",{className:"wcf-version-control py-2"},(0,o.createElement)("div",{className:"flex flex-col sm:flex-row gap-6 items-start sm:items-center justify-between"},(0,o.createElement)("div",{className:"wcf-version-control--content flex flex-col gap-1"},(0,o.createElement)("h3",{className:"text-base font-medium text-text-primary m-0"},(0,z.__)("Rollback to Previous Version","cartflows")),(0,o.createElement)("p",{className:"text-sm text-text-secondary m-0"},(0,z.__)("Experiencing an issue with the current version of Cartflows? Roll back to a previous version to help troubleshoot the problem.","cartflows"))),(0,o.createElement)("div",{className:"wcf-version-control--action flex gap-2 items-center shrink-0"},(0,o.createElement)(VO,{value:t,onChange:e=>n(e),size:"md"},(0,o.createElement)(VO.Button,{placeholder:t,className:"!w-24",type:"button"}),(0,o.createElement)(VO.Options,null,e.map(e=>(0,o.createElement)(VO.Option,{key:e.value,value:e.value},e.label)))),(0,o.createElement)(Va,{variant:"primary",size:"md",onClick:()=>{u("CartFlows"),a(!0)},disabled:s,loading:s},(0,z.__)("Rollback","cartflows"))))),(0,o.createElement)(KW,{pluginName:c,isPopupOpen:r,setIsPopupOpen:a,previousVersionSelect:t,setIsConfirming:l}))},tZ=({buttonLink:e,ctaText:t}={})=>{const[{license_status:n}]=g(),r=t||(0,z.__)("Upgrade to CartFlows Pro","cartflows"),a=new URLSearchParams((0,b.useLocation)().search).get("tab"),i=cartflows_admin.cf_pro_status;return wcfCartflowsTypePro()||"inactive"!==i||"pro"!==wcfInactivepluginType()?wcfCartflowsTypePlusPro()?"Activated"!==n?"analytics"===a?(0,o.createElement)(bp,{buttonLink:e,title:r}):(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)(_p,{title:(0,z.__)("Activate the License","cartflows")}))):null:wcfInactiveProPlus()?(0,o.createElement)(yp,null):(0,o.createElement)(bp,{buttonLink:e,title:r}):(0,o.createElement)(yp,null)},nZ=({title:e,description:t,buttonLink:n,className:r=""})=>(0,o.createElement)("div",{className:r},(0,o.createElement)(Gp,{direction:"row",align:"stretch",gap:"xs",className:"bg-brand-25 border border-solid border-brand-200 rounded-lg p-3 shadow-sm"},(0,o.createElement)(Gp,{direction:"row",align:"center",gap:"xs",className:"flex-1"},(0,o.createElement)(Gp,{direction:"column",gap:"xs",className:"flex-1"},(0,o.createElement)(th,{size:14,weight:600,color:"primary",lineHeight:20},e),(0,o.createElement)(th,{size:14,weight:400,color:"secondary",lineHeight:20},t)),(0,o.createElement)(Gp,{align:"center",gap:"xs",className:"shrink-0"},(0,o.createElement)(tZ,{buttonLink:n})))));function rZ({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5V6.75a4.5 4.5 0 1 1 9 0v3.75M3.75 21.75h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H3.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"}))}const aZ=i.forwardRef(rZ);function oZ({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))}const iZ=i.forwardRef(oZ),sZ=function(){const[{license_status:e},t]=g(),n=e&&"Activated"===e,[r,a]=(0,i.useState)(""),[s,l]=(0,i.useState)(!1),[c,u]=(0,i.useState)(!1),[d,f]=(0,i.useState)(n);return(0,o.createElement)("div",{className:"wcf-license-setting"},(0,o.createElement)("div",{className:"flex flex-col gap-4 max-w-[637px]"},(0,o.createElement)("div",{className:"w-10 h-10 flex items-center justify-center border border-solid border-gray-300 rounded bg-background-primary p-2"},(0,o.createElement)(aZ,{className:"w-7 h-7 text-text-secondary"})),(0,o.createElement)($p,{tag:"h2",size:"md",title:(0,z.__)("Your License","cartflows"),description:fh((0,z.sprintf)( |
| 34 |
// translators: %1$s: link html open, %2$s: link html close |
| 35 |
// translators: %1$s: link html open, %2$s: link html close |
| 36 |
(0,z.__)("Activate %1$sCartflows Pro%2$s addon to get professional support and automatic updates from your WordPress dashboard. Please enter your valid license key below to activate Cartflows Pro!","cartflows"),`<a href="${getUtmUrl("https://cartflows.com/",{utm_campaign:"license"})}" target="_blank" rel="noreferrer" class="text-brand-500 underline font-medium hover:text-brand-600">`,"</a>")),className:"pb-2 [&_h2]:text-text-primary [&>p]:!text-text-secondary [&>p]:!text-sm"}),(0,o.createElement)("div",{className:"flex flex-col gap-2.5"},(0,o.createElement)("div",{className:"flex gap-2 items-start"},(0,o.createElement)("div",{className:"flex-1"},(0,o.createElement)(dp,{prefix:(0,o.createElement)(iZ,null),placeholder:d?"**************************":(0,z.__)("Paste your license key here","cartflows"),value:r,onChange:e=>a(e),size:"md",disabled:d,error:!!s})),(0,o.createElement)(Va,{variant:d?"primary":"outline",size:"md",onClick:e=>{if(e.preventDefault(),l(!1),!d&&""===r.trim())return void l((0,z.__)("Please enter a valid license key!","cartflows"));u(!0);const n=d,o=n?"cartflows_deactivate_license":"cartflows_activate_license",i=n?cartflows_admin.license_deactivation_nonce:cartflows_admin.license_activation_nonce,s=new window.FormData;s.append("action",o),s.append("license_key",r),s.append("security",i),L()({url:cartflows_admin.ajax_url,method:"POST",body:s}).then(e=>{if(u(!1),e.success)n?(f(!1),a(""),t({status:"UPDATE_LICENSE_STATUS",license_status:"Deactivated"})):(f(!0),t({status:"UPDATE_LICENSE_STATUS",license_status:"Activated"}));else{const t=e.data?.error||e.data||"";l(t||(0,z.__)("Unknown error occurred while activating the license.","cartflows"))}})},disabled:c,className:d?"bg-support-error hover:bg-support-error border-support-error hover:border-support-error":"!bg-brand-25 !border-brand-300 !text-brand-500 hover:!bg-brand-50 hover:!border-brand-400",icon:c?(0,o.createElement)(Wf,{className:"animate-spin"}):null,iconPosition:"left"},d?(0,z.__)("Deactivate","cartflows"):(0,z.__)("Activate","cartflows"))),s&&(0,o.createElement)("p",{className:"text-sm text-support-error"},fh(s)),(0,o.createElement)("a",{href:getUtmUrl("https://cartflows.com/support/",{utm_campaign:"license"}),target:"_blank",rel:"noreferrer",className:"text-sm font-semibold text-brand-500 hover:text-brand-600 no-underline w-fit"},(0,z.__)("Need help?","cartflows")))))},lZ=function(e){const[{globaldata:t},n]=d(),[r,a]=(0,i.useState)(!1),[s,l]=(0,i.useState)((0,z.__)("Regenerate Now","cartflows")),[c,u]=(0,i.useState)({buttonText:(0,z.__)("Reset Settings","cartflows"),buttonProcess:!1}),{buttonText:f,buttonProcess:m}=c;let p=[],h="",g=[];switch(e.tab){case"general":p=t.settings.general,h="_cartflows_common";break;case"integrations":p.title="",h="";break;case"permalink":p=t.settings.permalink;break;case"other":p=t.settings.other;break;case"user_role_manager":p=t.settings.user_role_manager,h="_cartflows_common",g=p.roles;break;case"offer":p=t.settings.offer;break;case"webhooks":p=t.settings.webhooks;break;case"automations":p=t.settings.automations;break;case"version_control":p=t.settings.version_control;break;case"global_scripts":p=t.settings.global_scripts;break;case"checkout_links":break;default:p=t.general,h="_cartflows_common"}return"license"===e.tab?wcfCartflowsPro()?(0,o.createElement)(sZ,null):null:(0,o.createElement)("div",{className:"wcf-general-settings h-full"},!wcfCartflowsPro()&&"offer"===e.tab&&(0,o.createElement)(nZ,{title:(0,z.__)("Unlock Premium Features with CartFlows PRO!","cartflows"),description:(0,z.__)("Get the tools you need to create powerful sales funnels, increase conversions, and grow your business with ease.","cartflows")}),"integrations"===e.tab&&(0,o.createElement)("div",{className:"mx-auto max-w-7xl wcf-facebook-pixel-setting-wrapper"},(0,o.createElement)(VW,{title:(0,z.__)("Facebook Pixel","cartflows"),settings:t.settings["facebook-pixel"],meta_key:"_cartflows_facebook"}),(0,o.createElement)(VW,{title:(0,z.__)("Google Analytics Pixel","cartflows"),settings:t.settings["ga-analytics"],meta_key:"_cartflows_google_analytics"}),(0,o.createElement)(VW,{title:(0,z.__)("Google Ads Pixel","cartflows"),settings:t.settings["google-ads"],meta_key:"_cartflows_google_ads"}),(0,o.createElement)(VW,{title:(0,z.__)("Tiktok Pixel","cartflows"),settings:t.settings["tiktok-pixel"],meta_key:"_cartflows_tiktok"}),(0,o.createElement)(VW,{title:(0,z.__)("Pinterest Tag","cartflows"),settings:t.settings["pinterest-tag"],meta_key:"_cartflows_pinterest"}),(0,o.createElement)(VW,{title:(0,z.__)("Snapchat Pixel","cartflows"),settings:t.settings["snapchat-pixel"],meta_key:"_cartflows_snapchat"}),(0,o.createElement)(VW,{title:(0,z.__)("Google Auto Address","cartflows"),settings:t.settings["g-address-autocomplete"],meta_key:"_cartflows_google_auto_address"})),"other"===e.tab&&(0,o.createElement)("div",{className:"wcf-field wcf-re-generate-css-field pb-2"},(0,o.createElement)("div",{className:"wcf-field__data flex items-center gap-6 justify-between"},(0,o.createElement)("div",{className:"wcf-field__data--content-left flex-1 min-w-0"},(0,o.createElement)("div",{className:"wcf-field__data--label text-base font-medium text-left text-text-primary"},(0,o.createElement)("label",null,(0,z.__)("Regenerate Inline CSS","cartflows"))),(0,o.createElement)("div",{className:"wcf-field__desc text-sm font-normal text-text-secondary mt-2"},fh((0,z.sprintf)( |
| 37 |
// translators: %1$1s: link html start, %2$2s: link html end |
| 38 |
// translators: %1$1s: link html start, %2$2s: link html end |
| 39 |
(0,z.__)("If you are using the CartFlows Shortcode and using the Design Settings, then this option will regenerate the steps inline CSS. To learn more, %1$1s Click here %2$2s.","cartflows"),`<a href="${getKbDocUrl("https://cartflows.com/docs/regenerate-the-steps-dynamic-css-for-shortcodes/")}" target="_blank">`,"</a>")))),(0,o.createElement)("div",{className:"wcf-field__data--content-right shrink-0"},(0,o.createElement)(Va,{variant:"outline",size:"sm",type:"button",icon:(0,o.createElement)(Wf,{className:"w-4 h-4 stroke-2"}),loading:r,disabled:r,onClick:function(e){e.preventDefault(),l((0,z.__)(" Regenerating….","cartflows")),a(!0);const t=new window.FormData;t.append("action","cartflows_regenerate_css_for_steps"),t.append("security",cartflows_admin.regenerate_css_for_steps_nonce),L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(t=>{t.success&&(l((0,z.__)("Regenerated","cartflows")),setTimeout(()=>{l((0,z.__)("Regenerate Now","cartflows"))},3e3),a(!1),e.target.blur())})}},s)))),"webhooks"===e.tab&&(0,o.createElement)(JW,null),"version_control"===e.tab&&(0,o.createElement)(eZ,null),"user_role_manager"===e.tab&&(0,o.createElement)(WW,{roles:g}),"checkout_links"===e.tab&&(0,o.createElement)(vQ,null),"permalink"===e.tab&&(0,o.createElement)("div",{className:"wcf-field wcf-permalink-reset-field"},(0,o.createElement)("div",{className:"wcf-field__data flex items-center gap-6 justify-between"},(0,o.createElement)("div",{className:"wcf-field__data--content-left flex-1 min-w-0"},(0,o.createElement)("div",{className:"wcf-field__data--label text-base font-medium text-left text-text-primary"},(0,o.createElement)("label",null,(0,z.__)("Permalink Structure","cartflows")))),(0,o.createElement)("div",{className:"wcf-field__data--content-right shrink-0"},(0,o.createElement)(Va,{name:"reset",id:"reset",variant:"outline",size:"sm",type:"submit",icon:"saved"===m?(0,o.createElement)(qO,{className:"w-4 h-4 stroke-2"}):(0,o.createElement)(Wf,{className:"w-4 h-4 stroke-2"}),loading:"processing"===m,disabled:"processing"===m,onClick:function(e){e.preventDefault(),u({buttonText:(0,z.__)("Updating","cartflows"),buttonProcess:"processing"});const t=new window.FormData;t.append("action","cartflows_save_global_settings"),t.append("security",cartflows_admin.save_global_settings_nonce),t.append("setting_tab","permalink"),t.append("reset",!0),L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{L()({path:"/cartflows/v1/admin/commonsettings/"}).then(e=>{n({type:"SET_SETTINGS",commondata:e})}),u({buttonText:(0,z.__)("Reset successfully","cartflows"),buttonProcess:"saved"}),setTimeout(()=>{u({buttonText:(0,z.__)("Reset Settings","cartflows"),buttonProcess:!1})},3e3)})}},f)))),p?.fields&&(0,o.createElement)("div",{className:"wcf-general-settings--table-wrapper"},(0,o.createElement)(OW,{settings:p,meta_key:h})),"permalink"===e.tab&&(0,o.createElement)(zY,{content:(0,z.sprintf)( |
| 40 |
// translators: %1$s: link html start, %2$s: link html end |
| 41 |
// translators: %1$s: link html start, %2$s: link html end |
| 42 |
(0,z.__)("For more information about the CartFlows Permalink settings please %1$sClick here.%2$s","cartflows"),`<a href="${getKbDocUrl("https://cartflows.com/docs/cartflows-permalink-settings/")}" target="_blank">`,"</a>")}))},cZ=({title:e,description:t,actions:n=null,afterHeader:r=null,cardWrapper:a=!0,fullWidth:i=!1,children:s})=>(0,o.createElement)("div",{className:"flex-1 min-w-0 flex flex-col gap-6 mt-8 "+(i?"w-full pr-6 md:pr-8":"max-w-[45rem] mx-auto")},(0,o.createElement)(Gp,{direction:"column",className:"gap-3"},(0,o.createElement)("div",{className:"flex items-start justify-between gap-3"},(0,o.createElement)(Gp,{direction:"column",className:"gap-0.5 flex-1 min-w-0"},e&&(0,o.createElement)($p,{tag:"h4",size:"sm",title:e,className:"[&_h4]:text-text-primary"}),t&&(0,o.createElement)(th,{size:14,weight:400,color:"secondary"},t)),n&&(0,o.createElement)("div",{className:"shrink-0 flex items-center"},n)),r),a?(0,o.createElement)("div",{className:"bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm p-6"},s):s),uZ=function(){return(0,o.createElement)("div",{className:"wcf-settings-page flex gap-6 items-start -m-6 md:-m-8"},(0,o.createElement)("div",{className:"h-full min-h-screen flex flex-col w-auto sticky top-0 lg:top-4 sidebar after:content-[''] after:fixed after:left-0 after:top-0 after:w-16 lg:after:w-[420px] after:h-screen after:bg-background-primary after:-z-10"},(0,o.createElement)("div",{className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow bg-background-primary border-0 border-r border-solid border-border-subtle"},(0,o.createElement)("div",{className:"flex flex-col gap-5"},[["w-16",["w-16"]],["w-28",["w-20","w-14","w-24","w-32"]],["w-40",["w-24","w-24"]],["w-20",["w-28","w-20"]]].map(([e,t],n)=>(0,o.createElement)("div",{key:n,className:"flex flex-col"},(0,o.createElement)(cO,{className:`${e} h-2.5 mb-2 lg:block hidden`}),(0,o.createElement)("div",{className:"flex flex-col gap-0.5"},t.map((e,t)=>(0,o.createElement)("div",{key:t,className:"flex items-center gap-2.5 px-3 py-2 lg:justify-start justify-center"},(0,o.createElement)(cO,{className:"w-5 h-5 rounded"}),(0,o.createElement)(cO,{className:`h-3 ${e} lg:block hidden`}))))))))),(0,o.createElement)("div",{className:"flex-1 min-w-0 flex flex-col gap-6 max-w-[43.5rem] mx-auto mt-8"},(0,o.createElement)("div",{className:"flex justify-between items-center"},(0,o.createElement)(cO,{className:"w-28 h-5"}),(0,o.createElement)(cO,{className:"w-28 h-8 rounded-lg"})),(0,o.createElement)("div",{className:"bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm p-6 flex flex-col gap-6"},["w-32","w-40","w-28","w-36"].map((e,t)=>(0,o.createElement)("div",{key:t,className:"flex flex-col gap-2"},(0,o.createElement)(cO,{className:`${e} h-3.5`}),(0,o.createElement)(cO,{className:"w-full h-10"}))))))};function dZ(){const[{options:e},t]=d(),n=function(n){const{name:r,value:a}=n.detail;void 0!==e[r]&&(window.wcfUnsavedChanges=!0,t({type:"SET_OPTION",name:r,value:a}))},r=[{type:"select"},{type:"select2"},{type:"checkbox"},{type:"text"},{type:"textarea"},{type:"code"},{type:"number"},{type:"radio"},{type:"color"},{type:"font"},{type:"product"},{type:"coupon"},{type:"toggle"},{type:"selectioncard"}];(0,i.useEffect)(()=>(e&&r.map(function(e){return document.addEventListener(`wcf:${e.type}:change`,n),""}),()=>{r.map(function(e){return document.removeEventListener(`wcf:${e.type}:change`,n),""})}),[e])}function fZ({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 mZ=i.forwardRef(fZ);function pZ({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"}))}const hZ=i.forwardRef(pZ);function gZ({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"}))}const wZ=i.forwardRef(gZ);function yZ({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"}))}const bZ=i.forwardRef(yZ);function vZ({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"}))}const xZ=i.forwardRef(vZ);function _Z({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.348 14.652a3.75 3.75 0 0 1 0-5.304m5.304 0a3.75 3.75 0 0 1 0 5.304m-7.425 2.121a6.75 6.75 0 0 1 0-9.546m9.546 0a6.75 6.75 0 0 1 0 9.546M5.106 18.894c-3.808-3.807-3.808-9.98 0-13.788m13.788 0c3.808 3.807 3.808 9.98 0 13.788M12 12h.008v.008H12V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"}))}const EZ=i.forwardRef(_Z);function NZ({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"}))}const MZ=i.forwardRef(NZ);function IZ({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"}))}const SZ=i.forwardRef(IZ),kZ=function(e){const{fontSize:t,width:n,style:r}=e;return(0,o.createElement)("div",{className:"wcf-skeleton bg-background-secondary block leading-5 wcf-skeleton--text wcf-skeleton--wave",style:{fontSize:t,width:n,...r}})},jZ=function(e){const{height:t,style:n}=e;return(0,o.createElement)("div",{className:"wcf-skeleton-base wcf-skeleton--spacer h-6",style:{height:t,...n}})},DZ=function(e){const{width:t,height:n,style:r}=e;return(0,o.createElement)("div",{className:"wcf-skeleton block leading-5 wcf-skeleton--rect bg-background-secondary rounded-md animate-pulse",style:{width:t,height:n,...r}})},CZ=()=>(0,o.createElement)("div",{className:"bg-background-secondary rounded w-full flex justify-center items-center mb-4 border border-border-subtle h-[70vh]"},(0,o.createElement)("div",{className:"flex items-center justify-center flex-col w-3/4"},(0,o.createElement)(kZ,{fontSize:"25px",width:"300px",style:{marginBottom:"10px"}}),(0,o.createElement)(kZ,{width:"80%",fontSize:"15px",style:{marginBottom:"5px"}}),(0,o.createElement)(kZ,{width:"80%",fontSize:"15px",style:{marginBottom:"5px"}}),(0,o.createElement)(kZ,{width:"65%",fontSize:"15px",style:{marginBottom:"5px"}}),(0,o.createElement)(jZ,{height:"10px"}),(0,o.createElement)(kZ,{width:"60%",fontSize:"15px",style:{marginBottom:"5px"}}),(0,o.createElement)(kZ,{width:"50%",fontSize:"15px",style:{marginBottom:"5px"}}),(0,o.createElement)(kZ,{width:"35%",fontSize:"15px",style:{marginBottom:"5px"}}))),AZ=a.p+"images/ottokit_banner.030a4b67.png",TZ=({sureTriggersStatus:e,setSureTriggersStatus:t,sureTriggersConnected:n,setSureTriggersConnected:r})=>{const[{globaldata:a},s]=d(),[l,c]=(0,i.useState)(!0),[u,f]=(0,i.useState)(!1),m=[(0,z.__)("Send orders to 100+ popular apps.","cartflows"),(0,z.__)("Build automated workflows that run instantly.","cartflows"),(0,z.__)("Create custom app integrations using our Custom App feature.","cartflows"),(0,z.__)("Keep your tools in sync automatically.","cartflows")],p=e=>{e&&(r(!0),s({type:"SET_SURETRIGGERS_CONFIG",config:e}),c(!1))};(0,i.useEffect)(()=>{const e=a?.settings?.automations;if(e){const t=e?.suretriggers;if(t){const e=t.connected;n||r(e),n&&t.data&&p(t.data)}c(!1)}},[a,n]);const h=e=>{t("activating"),f(!0);const n=new window.FormData;n.append("action","cartflows_activate_plugin"),n.append("init",e),n.append("security",cartflows_admin.activate_plugin_nonce),L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(e=>{f(!1),e.data&&e.data.success?t("active"):t("fail")})},g=()=>{const e=new window.FormData;e.append("action","cartflows_get_suretriggers_data"),e.append("security",cartflows_admin.get_suretriggers_data_nonce),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(r=>{if(r&&r?.success)if(t("active"),f(!1),r?.data?.connected)p(r?.data?.data);else{const a={width:800,height:720},o={left:(screen.width-a.width)/2,top:(screen.height-a.height)/2},i=window.open(r?.data?.redirection,"",`width=${a.width},height=${a.height},top=${o.top},left=${o.left},scrollbars=0`);let s=0;const l=setInterval(()=>{t("connecting"),f(!0),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.success?e?.data?.connected&&(i.close(),clearInterval(l),n||(t("active"),p(e?.data?.data)),f(!1)):s++}),(s>=240||i.closed)&&(i.closed||i.close(),clearInterval(l),t("active"),f(!1))},500)}else t("fail")})};let w;return w=l?(0,o.createElement)(CZ,null):(0,o.createElement)("div",{className:"bg-background-primary border border-solid border-border-subtle rounded-lg shadow-sm p-4 mt-8 mr-6"},(0,o.createElement)("div",{className:"bg-background-secondary p-2"},(0,o.createElement)("div",{className:"flex flex-col md:flex-row gap-10 items-center bg-background-primary p-6"},(0,o.createElement)("div",{className:"flex-shrink-0 aspect-square rounded-lg overflow-hidden flex items-center justify-center"},(0,o.createElement)("img",{src:AZ,alt:"OttoKit",className:"w-[300px]"})),(0,o.createElement)("div",{className:"flex-1 flex flex-col gap-4"},(0,o.createElement)($p,{tag:"h2",size:"md",title:(0,z.__)("Automate Your Funnels with OttoKit","cartflows")}),(0,o.createElement)("p",{className:"m-0 text-base leading-6 text-text-secondary"},(0,z.__)("Every order should trigger something — a Slack alert, a CRM lead, a follow-up email, or a new row in Google Sheets.","cartflows")),(0,o.createElement)("ul",{className:"list-disc pl-5 m-0 space-y-2 text-base leading-6 text-text-secondary marker:text-text-tertiary"},m.map((e,t)=>(0,o.createElement)("li",{key:t},e))),(0,o.createElement)("div",{className:"pt-2"},n?(0,o.createElement)(Va,{variant:"primary",size:"md",onClick:()=>window.open("https://app.ottokit.com/recipes?page=1&search=cartflows","_blank","noopener,noreferrer")},(0,z.__)("Open Settings","cartflows")):(0,o.createElement)(Va,{variant:"primary",size:"md",onClick:function(r){if(r.preventDefault(),"not-installed"===e){t("installing"),f(!0);const e=new window.FormData;e.append("action","cartflows_install_plugin"),e.append("slug","suretriggers"),e.append("_ajax_nonce",cartflows_admin.plugin_installer_nonce),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.success?h("suretriggers/suretriggers.php"):(f(!1),t("fail"))})}else"active"!==e?h("suretriggers/suretriggers.php"):"active"!==e||n||g()},disabled:u},u&&(0,o.createElement)(gQ,{className:"!border-[#172A39] !border-r-transparent"}),function(e){let t="";switch(e){case"active":t=n?(0,z.__)("Activated","cartflows"):(0,z.__)("Connect Your Website","cartflows");break;case"inactive":t=(0,z.__)("Activate","cartflows");break;case"not-installed":t=(0,z.__)("Install OttoKit for Free","cartflows");break;case"installing":t=(0,z.__)("Installing…","cartflows");break;case"activating":t=(0,z.__)("Activating…","cartflows");break;case"fail":t=(0,z.__)("Failed","cartflows");break;case"reload":t=(0,z.__)("Reloading","cartflows");break;case"connect":t=(0,z.__)("Connect Your Website","cartflows");break;case"connecting":t=(0,z.__)("Connecting","cartflows");break;default:t=(0,z.__)("Install","cartflows")}return t}(e))))))),(0,o.createElement)("section",{"aria-labelledby":(0,z.__)("Automations","cartflows")},w)},OZ=function(){const[{globaldata:e}]=d(),[t,n]=(0,i.useState)(e?.settings?.automations?.suretriggers?.status||cartflows_admin?.suretriggers_status),[r,a]=(0,i.useState)(e?.settings?.automations?.suretriggers?.connected||!1);return(0,o.createElement)("div",{className:"wcf-automation-page-wrapper"},(0,o.createElement)(TZ,{sureTriggersStatus:t,setSureTriggersStatus:n,sureTriggersConnected:r,setSureTriggersConnected:a}))},LZ=Ua("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),zZ=Ua("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),PZ=Ua("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]),RZ=({title:e,description:t})=>(0,o.createElement)("div",{className:"flex flex-col items-center justify-center text-center py-12 px-6"},(0,o.createElement)("div",{className:"size-12 rounded-lg border border-dashed border-border-subtle flex items-center justify-center mb-4"},(0,o.createElement)(LZ,{className:"size-5 text-text-tertiary"})),(0,o.createElement)($p,{size:"xs",tag:"h3",title:e}),(0,o.createElement)(th,{as:"p",size:14,color:"help",className:"mt-1"},t)),UZ=[{label:(0,z.__)("Account","cartflows"),items:[{name:(0,z.__)("License","cartflows"),slug:"license",icon:iZ,proOnly:!0}]},{label:(0,z.__)("Funnel Settings","cartflows"),items:[{name:(0,z.__)("General","cartflows"),slug:"general",icon:nU},{name:(0,z.__)("Order","cartflows"),slug:"offer",icon:mZ},{name:(0,z.__)("Permalink","cartflows"),slug:"permalink",icon:hZ},{name:(0,z.__)("User Role Manager","cartflows"),slug:"user_role_manager",icon:wZ}]},{label:(0,z.__)("Integrations & Extensions","cartflows"),items:[{name:(0,z.__)("Integrations","cartflows"),slug:"integrations",icon:({className:e})=>(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e},(0,o.createElement)("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1.5"}),(0,o.createElement)("rect",{x:"3",y:"7",width:"14",height:"14",rx:"2"}))},{name:(0,z.__)("Automations","cartflows"),slug:"automations",icon:bZ},{name:(0,z.__)("Extensions","cartflows"),slug:"addons",icon:xZ},{name:(0,z.__)("Webhooks","cartflows"),slug:"webhooks",icon:EZ}]},{label:(0,z.__)("Utilities","cartflows"),items:[{name:(0,z.__)("Global CSS & Scripts","cartflows"),slug:"global_scripts",icon:MZ},{name:(0,z.__)("Version Control","cartflows"),slug:"version_control",icon:({className:e})=>(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:e},(0,o.createElement)("circle",{cx:"18",cy:"18",r:"3"}),(0,o.createElement)("circle",{cx:"6",cy:"6",r:"3"}),(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 6h3a2 2 0 0 1 2 2v7"}),(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 18H8a2 2 0 0 1-2-2V9"}))},{name:(0,z.__)("Advanced","cartflows"),slug:"other",icon:SZ},{name:(0,z.__)("Logs","cartflows"),slug:"log",icon:WV}]}],BZ=["version_control","automations","addons","license","log","webhooks"],FZ={automations:OZ,addons:function(){const[e,t]=(0,i.useState)({errorFor:!1,errorMsg:!1}),{errorFor:n,errorMsg:r}=e,a=(e,t="plugin")=>"activated"===e?"":"installed"===e||"inactive"===e?"cartflows_recommended_"+t+"_activate":"cartflows_recommended_"+t+"_install",s=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,n=e.target.dataset.is_pro,r=e.target.dataset.page_link,a=e.target.dataset.status;if("true"!==n.toLowerCase()||"not-installed"!==a)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":f(e);break;case"cartflows_recommended_theme_install":e.target.innerText=(0,z.__)("Installing…","cartflows"),u(e,"install-theme"),f(e)}},u=(e,n)=>new Promise((r,a)=>{wp.updates.queue.push({action:n,data:{slug:e.target.dataset.slug,success(t){e.target.innerText=(0,z.__)("Installed","cartflows"),r(t,e.target.dataset),d(e)},error(n){a(n,e.target.dataset),e.target.innerText=(0,z.__)("Failed","cartflows"),t({errorFor:`${e.target.dataset.slug}_error`,errorMsg:n?.errorMessage}),setTimeout(function(){e.target.innerText=(0,z.__)("Install","cartflows"),t({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"),L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{e.target.className="text-support-success pointer-events-none text-sm font-semibold border-0 bg-transparent shadow-none p-0",e.target.innerText=(0,z.__)("Activated","cartflows"),e.target.dataset.redirection&&(window.location=e.target.dataset.redirection)})},f=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"),L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{e.target.className="wcf-activated-theme text-support-success pointer-events-none text-sm font-semibold border-0 bg-transparent shadow-none p-0",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.className="text-sm font-semibold text-text-primary py-2 px-4 border border-solid border-border-subtle rounded-lg bg-background-primary hover:bg-background-secondary cursor-pointer")})})},m=cartflows_admin.integrations.plugins.map((e,t)=>(0,o.createElement)("div",{key:t,className:"box-border bg-background-primary relative border border-solid border-border-subtle rounded-md p-5 flex flex-col gap-4 snap-start"},(0,o.createElement)("div",{className:"flex items-center justify-between"},e.logoPath&&(0,o.createElement)("img",{src:e.logoPath.icon_path,className:"w-10 h-10 min-w-[40px] min-h-[40px]",alt:e.title}),e.hot_badge&&(0,o.createElement)(Yf,{label:(0,z.__)("Hot","cartflows"),variant:"yellow",size:"xs",type:"pill"})),(0,o.createElement)("div",{className:"flex flex-col gap-2"},(0,o.createElement)("div",{className:"text-base font-medium text-text-primary"},e.title),(0,o.createElement)("p",{className:"text-sm font-normal text-text-secondary leading-relaxed m-0"},e.subtitle)),(0,o.createElement)("div",{className:"flex items-center gap-3 mt-auto"},(0,o.createElement)("button",{"data-slug":e.slug,"data-redirection":e.redirection,"data-action":a(e.status,"plugin"),"data-status":e.status,"data-is_pro":e.isPro,"data-page_link":e.link,"data-init":e.path,type:"button",onClick:l,className:Gf()("active"===e.status?"text-support-success pointer-events-none text-sm font-semibold border-0 bg-transparent shadow-none p-0":"text-sm font-semibold text-text-primary py-2 px-4 border border-solid border-border-subtle rounded-lg bg-background-primary hover:bg-background-secondary cursor-pointer")},e.isPro&&"not-installed"===e.status?(0,z.__)("Let's Go","cartflows"):s(e.status)),n===`${e.slug}_error`&&r&&(0,o.createElement)("p",{id:`${e.slug}_error`,className:"text-xs text-brand-500"},r)))),p=cartflows_admin.integrations.themes.map((e,t)=>(0,o.createElement)("div",{key:t,className:Gf()(e.isPro?"bg-field-primary-background":"bg-background-primary","box-border relative border border-solid border-border-subtle rounded-md p-5 flex flex-col gap-4 snap-start")},(0,o.createElement)("div",null,e.logoPath&&(0,o.createElement)("img",{src:e.logoPath.icon_path,className:"w-10 h-10 min-w-[40px] min-h-[40px]",alt:e.title})),(0,o.createElement)("div",{className:"flex flex-col gap-2"},(0,o.createElement)("div",{className:"text-base font-medium text-text-primary"},e.title),(0,o.createElement)("p",{className:"text-sm font-normal text-text-secondary leading-relaxed m-0"},e.subtitle)),(0,o.createElement)("div",{className:"flex items-center gap-3 mt-auto"},(0,o.createElement)("button",{"data-slug":e.slug,"data-redirection":e.redirection,"data-action":a(e.status,"theme"),type:"button",onClick:c,className:Gf()("active"===e.status?"wcf-activated-theme text-support-success pointer-events-none text-sm font-semibold border-0 bg-transparent shadow-none p-0":"text-sm font-semibold text-text-primary py-2 px-4 border border-solid border-border-subtle rounded-lg bg-background-primary hover:bg-background-secondary cursor-pointer")},s(e.status)),n===`${e.slug}_error`&&r&&(0,o.createElement)("p",{id:`${e.slug}_error`,className:"text-xs text-brand-500"},r))));return(0,o.createElement)("div",{className:"flex flex-col gap-8 bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm p-6 max-w-4xl mx-auto mt-6"},(0,o.createElement)("div",{className:"recommended-plugins-block"},(0,o.createElement)($p,{tag:"h4",size:"sm",title:(0,z.__)("Extensions","cartflows"),description:(0,z.__)("WooCommerce Extensions that will elevate your online store from good to exceptional.","cartflows"),className:"[&_h4]:text-text-primary [&_h4]:!font-medium"}),(0,o.createElement)("div",{className:"grid grid-flow-row auto-rows-min grid-cols-1 gap-1 sm:grid-cols-2 p-1 bg-background-secondary rounded-md mt-4"},m)),(0,o.createElement)("div",{className:"recommended-themes-wrapper recommended-themes-block"},(0,o.createElement)($p,{tag:"h4",size:"sm",title:(0,z.__)("Recommended Themes","cartflows"),description:(0,z.__)("Carefully curated themes to power beautiful, fast, and conversion-focused online stores.","cartflows"),className:"[&_h4]:text-text-primary [&_h4]:!font-medium"}),(0,o.createElement)("div",{className:"grid grid-flow-row auto-rows-min grid-cols-1 gap-1 sm:grid-cols-2 p-1 bg-background-secondary rounded-md mt-4"},p)))},log:function(){const e=cartflows_admin?.logs||{},t=Object.keys(e),n=t.length>0,[r,a]=(0,i.useState)(""),[s,l]=(0,i.useState)(""),[c,u]=(0,i.useState)((0,z.__)("Copy","cartflows")),[d,f]=(0,i.useState)((0,z.__)("Download","cartflows")),[m,p]=(0,i.useState)((0,z.__)("Delete","cartflows")),[h,g]=(0,i.useState)(!1),[w,y]=(0,i.useState)(!1);return n?(0,o.createElement)("div",{className:"flex-1 min-w-0 flex flex-col gap-6 max-w-4xl mx-auto mt-8"},(0,o.createElement)("div",{className:"flex justify-between items-center"},(0,o.createElement)($p,{tag:"h4",size:"sm",title:(0,z.__)("Logs","cartflows"),className:"[&_h4]:text-text-primary"})),(0,o.createElement)("div",{className:"bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm"},(0,o.createElement)("div",{className:"flex items-center justify-between gap-3 p-4 border-0 border-b border-solid border-border-subtle"},(0,o.createElement)(Nm,null,(0,o.createElement)(Nm.Trigger,null,(0,o.createElement)("button",{type:"button",className:"inline-flex items-center justify-between gap-2 w-72 px-3 py-2 text-sm text-text-primary bg-background-primary border border-solid border-border-subtle rounded-md hover:border-border-strong transition-colors cursor-pointer text-left truncate"},(0,o.createElement)("span",{className:"truncate"},e[s]||(0,z.__)("Select log","cartflows")),(0,o.createElement)(hm,{className:"size-4 shrink-0 text-text-tertiary"}))),(0,o.createElement)(Nm.Portal,null,(0,o.createElement)(Nm.ContentWrapper,null,(0,o.createElement)(Nm.Content,{className:"w-max max-w-lg max-h-72 overflow-y-auto"},(0,o.createElement)(Nm.List,{className:"!text-xs"},(0,o.createElement)(Nm.Item,{onClick:function(){l(""),a("")},className:"!text-xs !py-1.5"},(0,z.__)("Select log","cartflows")),t.map(t=>(0,o.createElement)(Nm.Item,{key:t,onClick:()=>function(e){l(e);const t=new window.FormData;t.append("action","cartflows_show_cf_log"),t.append("security",cartflows_admin.show_cf_log_nonce),t.append("log_key",e),L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(e=>{a(e.log_content)})}(t),className:"!text-xs !py-1.5"},e[t]))))))),(0,o.createElement)("div",{className:"flex items-center gap-2"},(0,o.createElement)(Va,{type:"button",variant:"outline",size:"xs",disabled:!s,onClick:async()=>{try{await async function(e){if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(e);else{const t=document.createElement("textarea");t.value=e,t.style.position="absolute",t.style.left="-999999px",document.body.prepend(t),t.select();try{document.execCommand("copy")}catch(e){}finally{t.remove()}}}(r),u((0,z.__)("Copied!","cartflows")),setTimeout(()=>{u((0,z.__)("Copy","cartflows"))},1e3)}catch(e){}},icon:(0,o.createElement)(zZ,{className:"size-3.5"})},c),(0,o.createElement)(Va,{type:"button",variant:"outline",size:"xs",disabled:!s||w,onClick:function(t){if(t.preventDefault(),w)return;y(!0);const n=new window.FormData;f((0,z.__)("Downloading…","cartflows")),n.append("action","cartflows_download_cf_log"),n.append("security",cartflows_admin.download_cf_log_nonce),n.append("log_key",s),L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(t=>{if(!t||!t.success||!t.data)return void pp.error((0,z.__)("Log file could not be downloaded. Please try again.","cartflows"));const n=t.data.file_content||"",r=e[s],a=new Blob([n],{type:"text/log"}),o=document.createElement("a");o.href=URL.createObjectURL(a),o.download=r,o.click(),pp.success((0,z.__)("Log file downloaded.","cartflows"))}).catch(()=>{pp.error((0,z.__)("Log file could not be downloaded. Please try again.","cartflows"))}).finally(()=>{y(!1),f((0,z.__)("Download","cartflows"))})},icon:(0,o.createElement)(PZ,{className:"size-3.5"})},d),(0,o.createElement)(Va,{type:"button",variant:"outline",size:"xs",destructive:!0,disabled:!s||h,onClick:function(e){if(e.preventDefault(),h)return;g(!0);const t=new window.FormData;p((0,z.__)("Deleting…","cartflows")),t.append("action","cartflows_delete_cf_log"),t.append("security",cartflows_admin.delete_cf_log_nonce),t.append("log_key",s),L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(e=>{e&&e.success?(pp.success((0,z.__)("Log file deleted successfully.","cartflows")),setTimeout(()=>window.location.reload(),1200)):(g(!1),p((0,z.__)("Delete","cartflows")),pp.error((0,z.__)("Log file could not be deleted. Please try again.","cartflows")))}).catch(()=>{g(!1),p((0,z.__)("Delete","cartflows")),pp.error((0,z.__)("Log file could not be deleted. Please try again.","cartflows"))})},icon:(0,o.createElement)(Qa,{className:"size-3.5"})},m))),s?(0,o.createElement)("div",{className:"overflow-auto max-h-[60vh] p-4"},(0,o.createElement)("pre",{id:"wcf-log--text",className:"wcf-log--text text-xs font-mono leading-relaxed text-text-secondary whitespace-pre-wrap break-all m-0"},r)):(0,o.createElement)(RZ,{title:(0,z.__)("No log file selected","cartflows"),description:(0,z.__)("Select a log file from the dropdown to view its contents.","cartflows")}))):(0,o.createElement)("div",{className:"flex-1 min-w-0 flex flex-col gap-6 max-w-4xl mx-auto mt-8"},(0,o.createElement)($p,{tag:"h4",size:"sm",title:(0,z.__)("Logs","cartflows"),className:"[&_h4]:text-text-primary"}),(0,o.createElement)("div",{className:"bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm p-6"},(0,o.createElement)(RZ,{title:(0,z.__)("No logs found","cartflows"),description:(0,z.__)("Log files will appear here when CartFlows generates debug logs.","cartflows")})))}},YZ=["webhooks"];function QZ({initialTab:e}){const[{globaldata:t},n]=d(),[,r]=g(),a=(0,b.useHistory)(),s=(0,b.useLocation)(),c=new URLSearchParams(s.search).get("tab"),[u,f]=(0,i.useState)(c||e||"general"),[m,p]=(0,i.useState)(!1);(0,i.useEffect)(()=>{const e=new URLSearchParams(s.search).get("tab");e&&e!==u&&f(e)},[s.search]),dZ();let h=!0;void 0===t.length&&(h=!1),(0,i.useEffect)(()=>{t.length<1&&L()({path:"/cartflows/v1/admin/commonsettings/"}).then(e=>{n({type:"SET_SETTINGS",commondata:e}),n({type:"SET_PAGE_BUILDER",pagebuilder:e.options["_cartflows_common[default_page_builder]"]})})},[]);const w=cartflows_admin?.current_user_can_manage_cartflows;if(!w)return(0,o.createElement)("div",{className:"flex items-center justify-center p-12 text-center"},(0,o.createElement)($p,{tag:"h3",size:"md",title:(0,z.__)("Access Restricted","cartflows"),description:(0,z.__)("You do not have permission to manage CartFlows settings.","cartflows")}));if(h)return(0,o.createElement)(uZ,null);const y=UZ.map(e=>({...e,items:e.items.filter(e=>!e.proOnly||wcfCartflowsPro())})).filter(e=>e.items.length>0),v=y.flatMap(e=>e.items),x=v.find(e=>e.slug===u),_=t?.settings?.[u]?.description||"";return(0,o.createElement)("form",{className:"wcf-settings-page flex gap-6 items-start -m-6 md:-m-8",onSubmit:e=>{e.preventDefault(),p(!0);const t=new window.FormData(e.target);t.append("action","cartflows_save_global_settings"),t.append("security",cartflows_admin.save_global_settings_nonce),L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(e=>{e?.success&&e?.data?.redirect_to?window.location.replace(e.data.redirect_to):(r({status:"SAVED"}),p(!1),e.success&&(pp.success((0,z.__)("Settings saved successfully!","cartflows")),L()({path:"/cartflows/v1/admin/commonsettings/"}).then(e=>{n({type:"SET_SETTINGS",commondata:e}),n({type:"SET_PAGE_BUILDER",pagebuilder:e.options["_cartflows_common[default_page_builder]"]})})))})}},(0,o.createElement)("input",{type:"hidden",name:"setting_tab",defaultValue:u,key:u}),(0,o.createElement)("div",{className:"h-full min-h-screen flex flex-col w-auto sticky top-0 lg:top-4 sidebar after:content-[''] after:fixed after:left-0 after:top-0 after:w-16 lg:after:w-[420px] after:h-screen after:bg-background-primary after:-z-10"},(0,o.createElement)(TW,{borderOn:!0,className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow"},(0,o.createElement)(TW.Body,{className:"!p-0"},(0,o.createElement)(TW.Item,{className:"!p-0"},(0,o.createElement)("div",{className:"flex flex-col"},y.map((e,t)=>(0,o.createElement)(l().Fragment,{key:e.label},t>0&&(0,o.createElement)("div",{className:"border-0 border-t border-solid border-border-subtle"}),(0,o.createElement)("div",{className:"flex flex-col px-3 py-2"},(0,o.createElement)("p",{className:"text-sm font-normal text-text-tertiary p-1 m-0 lg:block hidden"},e.label),(0,o.createElement)(ym,{size:"sm",className:"!p-0"},(0,o.createElement)(ym.List,{open:!0,className:"!gap-0 !p-0"},e.items.map(e=>{const t=e.icon,n=u===e.slug;return(0,o.createElement)(ym.Item,{key:e.slug,active:n,onClick:()=>{e.link?a.push({pathname:"admin.php",search:e.link}):(e=>{if(e===u)return;f(e);const t=new URLSearchParams(s.search);t.set("tab",e),a.push({search:t.toString()})})(e.slug)},className:"cursor-pointer rounded-md lg:justify-start justify-center "+(n?"bg-side-nav-active hover:bg-side-nav-active":"hover:bg-background-secondary")},(0,o.createElement)(t,{className:"!size-5 shrink-0"}),(0,o.createElement)("span",{className:"!text-base lg:block hidden text-text-primary"},e.name))}))))))))))),function(e,t,n,r){const a=FZ[e];if(a)return(0,o.createElement)("div",{className:"w-full"},(0,o.createElement)(a,null));const i="offer"===e&&!wcfCartflowsPro(),s=BZ.includes(e)||i?null:(0,o.createElement)(Va,{variant:"primary",type:"submit",size:"sm",disabled:n},n?(0,z.__)("Saving…","cartflows"):(0,z.__)("Save Settings","cartflows"));return(0,o.createElement)(cZ,{title:t?.name||"",description:r||"",actions:s,cardWrapper:!i,fullWidth:YZ.includes(e)},(0,o.createElement)(lZ,{tab:e}))}(u,x,m,_))}const VZ=function({initialTab:e}){return(0,o.createElement)(u,{initialState:m,reducer:p},(0,o.createElement)(QZ,{initialTab:e}))},WZ=function(){const e="not-installed"===cartflows_admin.woocommerce_status?(0,z.__)("Install WooCommerce","cartflows"):(0,z.__)("Activate WooCommerce","cartflows"),[t,n]=(0,i.useState)(e),[r,a]=(0,i.useState)(!1);return setTimeout(function(){!function(){const e=document.getElementById("wpwrap");e&&e.removeAttribute("inert")}()},1e3),(0,o.createElement)($m,{open:!0,setOpen:()=>{},exitOnClickOutside:!1,exitOnEsc:!1},(0,o.createElement)($m.Panel,{className:"sm:max-w-lg w-full"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)($m.Header,{className:"flex items-center gap-3 !space-y-0"},(0,o.createElement)("div",{className:"mx-auto flex h-12 w-12 flex-shrink-0 items-center justify-center rounded-full bg-alert-background-danger sm:mx-0 sm:h-10 sm:w-10"},(0,o.createElement)(uh,{className:"h-6 w-6 text-text-error","aria-hidden":"true"})),(0,o.createElement)("div",null,(0,o.createElement)($m.Title,null,(0,z.__)("Plugin Required","cartflows")),(0,o.createElement)("div",{className:"mt-2"},(0,o.createElement)("p",{className:"text-sm text-text-secondary m-0"},(0,z.__)("You need WooCommerce plugin installed and activated to access this page.","cartflows"))))),(0,o.createElement)($m.Footer,{className:"flex gap-3 justify-end"},(0,o.createElement)(Va,{variant:"primary",size:"md",className:"no-underline text-center",icon:r?(0,o.createElement)(Wf,{className:"animate-spin"}):null,iconPosition:"left",onClick:e=>{if(e.preventDefault(),"not-installed"===cartflows_admin.woocommerce_status)n((0,z.__)("Installing","cartflows")),a(!0),wp.updates.queue.push({action:"install-plugin",data:{slug:"woocommerce"}}),wp.updates.queueChecker();else{n((0,z.__)("Activating","cartflows")),a(!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),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.data&&e.data.success?n((0,z.__)("Activated","cartflows")):n((0,z.__)("Failed","cartflows")),n((0,z.__)("Redirecting","cartflows")),window.location.reload()})}}},t))))},ZZ=(0,sp.compose)((0,lp.withSelect)(e=>{const{getFlowsCount:t,getCFProStatus:n,getLicenseStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:n(),license_status:r()}}))(({visibility:e,setVisibility:t,errorMessage:n,title:r})=>{const a=r||(0,z.__)("Error","cartflows");return(0,wn.createPortal)((0,o.createElement)("div",{className:`wcf-name-your-flow ${e}`},(0,o.createElement)($m,{open:"show"===e,setOpen:e=>{e||t("hide")},exitOnClickOutside:!0},(0,o.createElement)($m.Panel,{className:"sm:max-w-lg w-full"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)($m.Header,{className:"flex items-center justify-between !space-y-0"},(0,o.createElement)($m.Title,{className:"wcf-name-your-flow--title"},a),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)($m.Body,null,(0,o.createElement)("div",{className:"wcf-name-your-flow__body"},(0,o.createElement)("p",null,n))),(0,o.createElement)($m.Footer,{className:"wcf-name-your-flow--footer bg-brand-25 flex justify-end gap-4"},(0,o.createElement)(Va,{variant:"outline",size:"md",className:"no-underline text-center",onClick:()=>t("hide")},(0,z.__)("Close","cartflows")))))),document.getElementById("wcf-json-importer"))}),GZ=(0,sp.compose)((0,lp.withSelect)(e=>{const{getFlowsCount:t,getCFProStatus:n,getWooCommerceStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:n(),woocommerce_status:r()}}))(({preview:e,cf_pro_status:t,woocommerce_status:n,flowName:r,isStoreCheckout:a})=>{const[{license_status:s}]=g(),[l,c]=(0,i.useState)({isProcessing:!1,buttonText:"Import Funnel"}),{isProcessing:u,buttonText:d}=l,[f,m]=(0,i.useState)(!1),[p,h]=(0,i.useState)("hide"),[w,y]=(0,i.useState)(""),[b,v]=(0,i.useState)(""),x=function(e){e.preventDefault(),f?E():_()},_=function(){m(!0),document.addEventListener("click",E)},E=function(){m(!1),document.removeEventListener("click",E)};if("pro"===e.type){if(!wcfCartflowsTypePro())return"inactive"===t&&"pro"===wcfInactivepluginType()?(0,o.createElement)(yp,null):(0,o.createElement)(bp,null);if(wcfCartflowsTypePro()&&"Activated"!==s)return(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)(_p,null)))}return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ZZ,{visibility:p,setVisibility:h,errorMessage:w,title:b}),(0,o.createElement)("div",{className:"wcf-flow-import__button wcf-store-checkout-import__button"},(0,o.createElement)(Va,{variant:"primary",size:"md",loading:u,disabled:u,onClick:t=>{t.preventDefault(),u||((e,t,n,r,a,i,s,l,c,u,d)=>{if("active"!==i)return"inactive"===i?(l((0,o.createElement)(hp,null)),void s("show ")):(l((0,o.createElement)(gp,null)),void s("show "));t({isProcessing:!0,buttonText:"Importing Complete Funnel.."});const f=new window.FormData;f.append("action","cartflows_import_flow"),f.append("flow_name",n),f.append("security",cartflows_admin.import_flow_nonce),f.append("flow",JSON.stringify(e)),f.append("store_checkout",r),f.append("creation_method","ready_made_template"),L()({url:cartflows_admin.ajax_url,method:"POST",body:f}).then(e=>{e.success?(t({isProcessing:!1,buttonText:"Imported! Redirecting..."}),pp.success((0,z.__)("Funnel imported successfully!","cartflows")),setTimeout(()=>{let t=`admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e.data.new_flow_id}`;r&&(t=`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e.data.new_flow_id}`),window.location=`${cartflows_admin.admin_base_url+t}`},3e3)):"call_to_action"in e.data?(l((0,o.createElement)(o.Fragment,null,(0,o.createElement)("span",{className:"wcf-message wcf-message--error",dangerouslySetInnerHTML:{__html:e.data.call_to_action}}),d&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("a",{className:"wcf-error-message--toggle",onClick:u},(0,z.__)("Click for more info","cartflows")),(0,o.createElement)("div",{className:"wcf-error--info",dangerouslySetInnerHTML:{__html:e.data.message}})))),s("show ")):t({isProcessing:!1,buttonText:e.data.message})})})(e,c,r,a,0,n,h,y,0,x,f)}},d)))}),HZ=(0,sp.compose)((0,lp.withSelect)(e=>{const{getFlowsCount:t,getCFProStatus:n,getLicenseStatus:r,getWooCommerceStatus:a}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:n(),license_status:r(),woocommerce_status:a()}}))(({flowName:e,isStoreCheckout:t})=>{const[n,r]=(0,i.useState)((0,z.__)("Create Store Checkout","cartflows")),[a,s]=(0,i.useState)(!1);return(0,o.createElement)("div",{className:"wcf-name-your-flow__actions"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)("button",{className:"wcf-button wcf-primary-button",onClick:n=>{n.preventDefault(),jQuery(n.target).closest(".wcf-name-your-flow__inner").find(".input-field").attr("disabled","disabled"),((e,t,n,r,a)=>{if(n)return;e("Creating Flow.."),r(!0);const o=new window.FormData;o.append("action","cartflows_create_flow"),o.append("security",cartflows_admin.create_flow_nonce),o.append("flow_name",t),o.append("store_checkout",a),o.append("creation_method","scratch"),L()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then(t=>{console.log(t),t.success?(e((0,z.__)("Created! Redirecting…","cartflows")),r(!1),pp.success((0,z.__)("Funnel created successfully!","cartflows")),setTimeout(()=>{let e=`admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t.data.flow_id}`;a&&(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")),pp.error((0,z.__)("Failed to create funnel.","cartflows")))})})(r,e,a,s,t)}},n)))}),$Z=({preview:e,type:t,flowName:n,setErrorDesc:r,setVisibility:a})=>(0,o.createElement)($m.Footer,{className:"wcf-name-your-flow--footer bg-brand-25 flex justify-end gap-4"},"import"===t&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"outline",size:"md",className:"no-underline text-center",onClick:()=>a("hide")},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(GZ,{preview:e,flowName:n,setErrorDesc:r,isStoreCheckout:!0})),"blank"===t&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"outline",size:"md",className:"no-underline text-center",onClick:()=>a("hide")},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(HZ,{flowName:n,isStoreCheckout:!0}))),XZ=e=>{const{cf_pro_status:t,setVisibility:n,preview:r,type:a,flowName:s,setFlowName:l}=e,[{flows_limit_over:c}]=g(),[u,d]=(0,i.useState)(""),[f,m]=(0,i.useState)(0);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)($m.Header,{className:"flex items-center justify-between !space-y-0"},(0,o.createElement)($m.Title,{className:"wcf-name-your-flow--title"},c?(0,z.__)("Upgrade To CartFlows Pro","cartflows"):(0,z.__)("Name Your Store Checkout","cartflows")),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)($m.Body,null,c?(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-name-your-flow__footer"},(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required wcf-upgrade-pro"},(0,o.createElement)("div",{className:"wcf-flow-import__message"},(0,o.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,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)("a",{href:getKbDocUrl("https://cartflows.com/"),target:"_blank",className:"wcf-button wcf-button--primary",rel:"noreferrer"},(0,z.__)("Upgrade To Cartflows Pro","cartflows")))))))):(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",null,(0,o.createElement)("div",{className:"flex justify-between py-2"},(0,o.createElement)("div",{className:"wcf-name-your-flow--field-title"},(0,o.createElement)("label",{className:"flex gap-1 text-base font-normal text-text-primary"},(0,z.__)("Store Checkout Name","cartflows"))),(0,o.createElement)("div",{className:"wcf-name-your-flow--word-count"},(0,o.createElement)("span",{className:"text-xs font-normal "+(40===f?"text-brand-500":"text-text-tertiary")},f,"/40"))),(0,o.createElement)("input",{type:"text",className:"input-field w-full !px-4 !py-2 text-sm font-normal !rounded-md text-text-tertiary !border-border-subtle focus:ring focus:!ring-brand-100 focus:!border-brand-500 focus:!shadow-none !outline-0 !outline-none",value:s,onChange:e=>{const{value:t}=e.target;t.length<=40&&(m(t.length),l(t))},placeholder:(0,z.__)("Enter Store Checkout Name","cartflows")})),""!==u&&(0,o.createElement)("div",{className:"mt-5"},(0,o.createElement)("p",{className:"text-sm font-regular text-text-secondary"},u)))),(0,o.createElement)($Z,{cf_pro_status:t,setVisibility:n,preview:r,type:a,flowName:s,setFlowName:l,setErrorDesc:d}))},qZ=(0,sp.compose)((0,lp.withSelect)(e=>{const{getFlowsCount:t,getCFProStatus:n,getLicenseStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:n(),license_status:r()}}))(({visibility:e,setVisibility:t,preview:n,type:r,flowName:a,setFlowName:i,cf_pro_status:s})=>(0,o.createElement)($m,{open:"show"===e,setOpen:e=>{e||t("hide")},exitOnClickOutside:!0},(0,o.createElement)($m.Panel,{className:"wcf-name-your-flow__inner sm:max-w-lg w-full"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)(XZ,{cf_pro_status:s,setVisibility:t,preview:n,type:r,flowName:a,setFlowName:i})))),JZ=a.p+"images/launch.70174609.png",KZ=function(){const[e,t]=(0,i.useState)("hide"),[n,r]=(0,i.useState)(""),[{page_builder:a}]=g(),s=[(0,z.__)("Improved user experience","cartflows"),(0,z.__)("Flexibility and customization","cartflows"),(0,z.__)("Brand consistency","cartflows"),(0,z.__)("Competitive advantage","cartflows"),(0,z.__)("Increased trust and credibility","cartflows")];return(0,o.createElement)("main",{className:"wcf-no-flows-found-screen"},(0,o.createElement)("div",{className:"grid grid-cols-1 gap-4 items-start lg:grid-cols-5 lg:gap-10 xl:gap-10 rounded-lg bg-background-primary overflow-hidden border-0.5 border-solid border-border-subtle shadow-sm px-10 py-10"},(0,o.createElement)("div",{className:"grid grid-cols-1 gap-4 lg:col-span-2 h-full"},(0,o.createElement)("div",{className:"wcf-video-container"},(0,o.createElement)("iframe",{className:"wcf-video rounded-md",src:"https://www.youtube.com/embed/tCm60PWOd0M?showinfo=0&autoplay=0&mute=0&rel=0",allow:"autoplay",title:"YouTube video player",frameBorder:"0",allowFullScreen:!0}))),(0,o.createElement)("div",{className:"grid grid-cols-1 gap-4 lg:col-span-3 h-full"},(0,o.createElement)("div",{className:"relative h-full",style:{backgroundImage:`url(${JZ})`,backgroundRepeat:"no-repeat",backgroundPosition:"right bottom",backgroundSize:"120px"}},(0,o.createElement)("div",{className:"flex flex-col justify-center h-full"},(0,o.createElement)("h2",{className:"text-text-primary text-3xl pb-3 font-semibold text-left m-0"},(0,z.__)("Create a global store checkout","cartflows")),(0,o.createElement)("p",{className:"text-base text-text-secondary pb-5 m-0"},(0,z.__)("A well-designed checkout page can help streamline the checkout process, reduce cart abandonment rates and increase conversions.","cartflows")),(0,o.createElement)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-2 pb-6"},s.map(e=>(0,o.createElement)("div",{key:e,className:"flex items-center gap-1.5 text-base text-field-label"},(0,o.createElement)(_W,{className:"w-3 h-3 stroke-2 text-text-tertiary flex-shrink-0"}),e))),(0,o.createElement)("div",null,(0,o.createElement)(Va,{variant:"primary",size:"sm",tag:C,to:{pathname:"admin.php",search:"?page=cartflows&path=store-checkout-library"},icon:(0,o.createElement)(KO,{className:"w-18 h-18 stroke-2"}),iconPosition:"left",className:"no-underline w-fit",onClick:e=>{"bricks-builder"===a&&(e.preventDefault(),t("show"))}},(0,z.__)("Create Store Checkout","cartflows"))))))),(0,o.createElement)(qZ,{visibility:e,setVisibility:t,type:"blank",flowName:n,setFlowName:r}))},eG=function(){return(0,o.createElement)("div",{className:"wcf-flows-page-wrapper"},(0,o.createElement)(KZ,null))},tG=function(e){const[{analyticsData:t}]=d(),n=t&&t.flow_stats.avg_order_value_by_date?t.flow_stats.avg_order_value_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,avg_order_value:r?Number(r.avg_order_value):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["avg_order_value"],xAxisDataKey:"date",yAxisDataKey:"avg_order_value",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:aO,chartWidth:"100%",chartHeight:305}))},nG=function(e){const[{analyticsData:t}]=d(),n=t&&t.flow_stats.bump_revenue_by_date?t.flow_stats.bump_revenue_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,bump_revenue:r?Number(r.bump_revenue):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["bump_revenue"],xAxisDataKey:"date",yAxisDataKey:"bump_revenue",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:aO,chartWidth:"100%",chartHeight:305}))},rG=function(e){const[{analyticsData:t}]=d(),n=t&&t.flow_stats.revenue_per_visit_by_date?t.flow_stats.revenue_per_visit_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,revenue_per_visit:r?Number(r.revenue_per_visit):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["revenue_per_visit"],xAxisDataKey:"date",yAxisDataKey:"revenue_per_visit",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:aO,chartWidth:"100%",chartHeight:305}))},aG=function(e){const[{analyticsData:t}]=d(),n=t&&t.flow_stats.revenue_per_unique_visitor_by_date?t.flow_stats.revenue_per_unique_visitor_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,revenue_per_unique_visitor:r?Number(r.revenue_per_unique_visitor):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["revenue_per_unique_visitor"],xAxisDataKey:"date",yAxisDataKey:"revenue_per_unique_visitor",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:aO,chartWidth:"100%",chartHeight:305}))};function oG({title:e,titleId:t,...n},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M11.47 2.47a.75.75 0 0 1 1.06 0l7.5 7.5a.75.75 0 1 1-1.06 1.06l-6.22-6.22V21a.75.75 0 0 1-1.5 0V4.81l-6.22 6.22a.75.75 0 1 1-1.06-1.06l7.5-7.5Z",clipRule:"evenodd"}))}const iG=i.forwardRef(oG);function sG({title:e,titleId:t,...n},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M12 2.25a.75.75 0 0 1 .75.75v16.19l6.22-6.22a.75.75 0 1 1 1.06 1.06l-7.5 7.5a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 1 1 1.06-1.06l6.22 6.22V3a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"}))}const lG=i.forwardRef(sG),cG=function({trend:e}){if(!e||null===e.percentage||e.percentage<=0)return null;const t=e.isIncrease;return(0,o.createElement)("div",{className:"inline-flex items-center gap-0.5 px-2 py-0.5 rounded-full text-xs font-medium "+(t?"bg-alert-background-green text-support-success border border-alert-border-green":"bg-alert-background-danger text-text-error border border-alert-border-danger")},t?(0,o.createElement)(iG,{className:"w-3 h-3"}):(0,o.createElement)(lG,{className:"w-3 h-3"}),(0,o.createElement)("span",null,e.percentage,"%"))},uG=function({item:e,isActive:t,onClick:n,trend:r,showProBadge:a=!1,statSuffix:i=""}){const s=null!==e.stat_raw&&void 0!==e.stat_raw,l=cartflows_admin?.woo_currency||"";let c;return c=e.stat?fh(e.stat.toString()):s?l+"0.00":"0",i&&(c+=i),(0,o.createElement)("div",{className:"wcf-analytics--stats-tab flex flex-col gap-2 px-4 py-4 rounded-lg border border-solid bg-background-primary shadow-none hover:shadow-md transition-shadow duration-200 relative cursor-pointer "+(t?"border-brand-500 bg-primary-25 shadow-md":"border-border-subtle hover:border-brand-300 hover:shadow-sm"),onClick:n},(0,o.createElement)("div",{className:"flex items-center gap-1"},(0,o.createElement)(th,{as:"span",size:12,weight:600,className:"whitespace-nowrap "+(t?"text-primary-500":"text-text-secondary")},e.name),(0,o.createElement)(iQ,{text:e.tooltip,classes:"text-text-tertiary sm:block lg:block"}),a&&(0,o.createElement)(Ym,null)),(0,o.createElement)("div",{className:"flex items-end justify-between gap-2"},(0,o.createElement)(th,{as:"div",size:20,weight:600,color:"primary",className:"tracking-tight"},c),(0,o.createElement)(cG,{trend:r})))},dG="__all__",fG=e=>""===e?dG:e,mG=e=>dG===e?"":e,pG=function({title:e,selectedFlow:t,onFlowChange:n,flowOptions:r,flowsLoading:a,dateValue:i,onDateChange:s,comparisonPeriod:l,onComparisonPeriodChange:c,comparisonPeriodOptions:u}){return(0,o.createElement)("div",{className:"bg-background-primary flex justify-between items-center"},(0,o.createElement)($p,{size:"lg",tag:"h2",title:e,className:"[&_h2]:text-text-primary"}),(0,o.createElement)("div",{className:"wcf-metabox--filters-wrapper flex gap-3 flex-col md:flex-row max-h-[40px]"},(0,o.createElement)("div",{className:"w-48"},(0,o.createElement)(VO,{value:fG(t.value),onChange:e=>{const t=mG(e),a=r.find(e=>e.value===t);n(a||{value:t,label:t})},disabled:a,size:"sm"},(0,o.createElement)(VO.Button,{type:"button",render:e=>{if(a)return(0,z.__)("Loading flows…","cartflows");const t=r.find(t=>t.value===mG(e));return t?(0,o.createElement)(Ja,{content:kh(t.label),placement:"bottom",variant:"dark"},(0,o.createElement)("span",{className:"block w-full truncate"},kh(t.label))):(0,z.__)("Select Flow","cartflows")}}),(0,o.createElement)(VO.Options,null,r&&r.map(e=>{const t=fG(e.value);return(0,o.createElement)(VO.Option,{value:t,key:t,className:"[&>span]:!whitespace-normal [&>span]:!overflow-visible"},kh(e.label))})))),(0,o.createElement)("div",{className:"flex flex-col sm:flex-row items-start gap-2"},(0,o.createElement)("label",{className:"sm:hidden visible font-medium"},(0,z.__)("Custom Filter:","cartflows")),(0,o.createElement)(TY,{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-text-tertiary !rounded-md !border-border-subtle focus:!ring-brand-100 focus:!border-brand-500 focus:!shadow-none !outline-0 !outline-none",value:i,onChangeCB:s})),(0,o.createElement)("div",{className:"min-w-48"},(0,o.createElement)(VO,{value:l,onChange:c,size:"sm"},(0,o.createElement)(VO.Button,{type:"button",render:e=>{const t=u.find(t=>t.value===e);return t?t.label:e}}),(0,o.createElement)(VO.Options,null,u&&u.map(e=>(0,o.createElement)(VO.Option,{value:e.value,key:e.value},e.label)))))))},hG=a.p+"images/analytics-empty-funnels.24d2c110.png",gG=function({flowsConversions:e}){const t=(0,i.useMemo)(()=>e&&Object.values(e).map((e,t)=>(0,o.createElement)(FQ.Row,{key:e?.flow_id||t},(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap font-medium"},fh(e?.flow_title||"(no title)")),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e?.total_visits),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e?.unique_visits),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e?.conversions),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e?.conversion_rate+"%"),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},fh(e?.revenue)))),[e]);return(0,o.createElement)("div",{className:"mt-8 bg-background-primary rounded-lg shadow-sm p-6"},(0,o.createElement)($p,{size:"sm",tag:"h2",title:(0,z.__)("All Funnels","cartflows"),className:"[&_h2]:text-text-primary mb-4"}),(0,o.createElement)("div",{className:"overflow-x-auto"},(0,o.createElement)(FQ,{className:"min-w-full"},(0,o.createElement)(FQ.Head,null,(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Funnel Name","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Total Visits","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Unique Visits","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Conversions","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Conversion Rate","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Revenue","cartflows"))),(0,o.createElement)(FQ.Body,null,e&&0!==Object.keys(e).length?t:(0,o.createElement)(FQ.Row,null,(0,o.createElement)(FQ.Cell,{colSpan:6,className:"py-12"},(0,o.createElement)("div",{className:"flex flex-col items-center gap-3"},(0,o.createElement)("img",{src:hG,alt:"",width:"78",height:"72"}),(0,o.createElement)("div",{className:"flex flex-col items-center gap-1"},(0,o.createElement)("p",{className:"text-lg font-semibold text-text-primary m-0"},(0,z.__)("Find all the funnel analytics here","cartflows")),(0,o.createElement)("p",{className:"text-sm text-text-tertiary m-0"},(0,z.__)("Set up funnels to start tracking their performance and view analytics here.","cartflows"))))))))))},wG=()=>{const e="undefined"!=typeof cartflows_admin&&cartflows_admin?.woo_currency||"$";return[{name:(0,z.__)("Total Visitors","cartflows"),stat:"12,485",stat_raw:null,tooltip:"",graphType:"total_visitors",trend:{percentage:12,isIncrease:!0}},{name:(0,z.__)("Total Orders","cartflows"),stat:"1,284",stat_raw:null,tooltip:"",graphType:"total_orders",trend:{percentage:8,isIncrease:!0}},{name:(0,z.__)("Total Revenue","cartflows"),stat:`${e}48,240`,stat_raw:48240,tooltip:"",graphType:"total_revenue",trend:{percentage:15,isIncrease:!0}},{name:(0,z.__)("Avg. Order Value","cartflows"),stat:`${e}37.56`,stat_raw:37.56,tooltip:"",graphType:"avg_revenue",trend:{percentage:4,isIncrease:!0}},{name:(0,z.__)("Bump Revenue","cartflows"),stat:`${e}6,820`,stat_raw:6820,tooltip:"",graphType:"bump_revenue",trend:{percentage:6,isIncrease:!1}},{name:(0,z.__)("Offer Revenue","cartflows"),stat:`${e}9,410`,stat_raw:9410,tooltip:"",graphType:"offer_revenue",trend:{percentage:11,isIncrease:!0}},{name:(0,z.__)("Revenue Per Visit","cartflows"),stat:`${e}3.86`,stat_raw:3.86,tooltip:"",graphType:"per_visit_revenue",trend:{percentage:9,isIncrease:!0}},{name:(0,z.__)("RPUV","cartflows"),stat:`${e}6.12`,stat_raw:6.12,tooltip:"",graphType:"per_unique_visitor_revenue",trend:{percentage:3,isIncrease:!0}}]},yG=[{date:"Day 1",value:820},{date:"Day 2",value:1150},{date:"Day 3",value:980},{date:"Day 4",value:1420},{date:"Day 5",value:1680},{date:"Day 6",value:1510},{date:"Day 7",value:1935}],bG={flows:{title:(0,z.__)("Funnel Analytics","cartflows"),nudgeTitle:(0,z.__)("Discover What’s Actually Driving Your Funnel Revenue","cartflows"),nudgeDescription:(0,z.__)("See average order value, revenue per visit, and bump offer breakdowns for every funnel and step. Upgrade to CartFlows Pro and make smarter decisions with real data.","cartflows")},conversion:{title:(0,z.__)("Conversions Analytics","cartflows"),nudgeTitle:(0,z.__)("Find Out Exactly Where Customers Convert and Why","cartflows"),nudgeDescription:(0,z.__)("See conversions broken down by step, product, and device — and spot every drop-off point. Upgrade to CartFlows Pro and fix what’s costing you sales.","cartflows")},optin:{title:(0,z.__)("Opt-in Analytics","cartflows"),nudgeTitle:(0,z.__)("See Which Opt-in Funnels Grow Your List Fastest","cartflows"),nudgeDescription:(0,z.__)("Track every form’s submissions and conversion rates side by side — and know exactly which funnels build your list most effectively. Upgrade to Pro to see it all.","cartflows")}},vG={flows:wG,conversion:()=>[{name:(0,z.__)("Total Visitors","cartflows"),stat:"12,485",stat_raw:null,tooltip:"",graphType:"total_visitors",trend:{percentage:11,isIncrease:!0}},{name:(0,z.__)("Total Conversions","cartflows"),stat:"894",stat_raw:null,tooltip:"",graphType:"total_conversions",trend:{percentage:14,isIncrease:!0}},{name:(0,z.__)("Bump Conversions","cartflows"),stat:"156",stat_raw:null,tooltip:"",graphType:"total_bump_conversions",trend:{percentage:7,isIncrease:!0}},{name:(0,z.__)("Offer Conversions","cartflows"),stat:"213",stat_raw:null,tooltip:"",graphType:"offer_conversions",trend:{percentage:9,isIncrease:!0}},{name:(0,z.__)("Laptop Conversions","cartflows"),stat:"521",stat_raw:null,tooltip:"",graphType:"laptop_conversion_rate",trend:{percentage:5,isIncrease:!0}},{name:(0,z.__)("Mobile Conversions","cartflows"),stat:"373",stat_raw:null,tooltip:"",graphType:"mobile_conversion_rate",trend:{percentage:3,isIncrease:!1}}],optin:()=>[{name:(0,z.__)("Total Submissions","cartflows"),stat:"1,842",stat_raw:null,tooltip:"",graphType:"total_submissions",trend:{percentage:13,isIncrease:!0}},{name:(0,z.__)("Conversion Rate","cartflows"),stat:"24.8%",stat_raw:null,tooltip:"",graphType:"conversion_rate",trend:{percentage:6,isIncrease:!0}}]},xG=function({page:e="flows"}){const t=bG[e]||bG.flows,n=(vG[e]||wG)(),r=new Date,a=new Date;a.setDate(r.getDate()-7);const i={title:t.title,selectedFlow:{value:"",label:(0,z.__)("All Funnels","cartflows")},onFlowChange:()=>{},flowOptions:[],flowsLoading:!1,dateValue:{startDate:a,endDate:r},onDateChange:()=>{},comparisonPeriod:"previous-period",onComparisonPeriodChange:()=>{},comparisonPeriodOptions:[{value:"previous-period",label:(0,z.__)("vs. Previous Period","cartflows")}]};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("section",{"aria-labelledby":"section-1-title",className:"blur-[2px] pointer-events-none select-none","aria-hidden":"true"},(0,o.createElement)("div",{className:"p-6 rounded-xl bg-background-primary overflow-hidden shadow-sm flex flex-col gap-3 justify-center h-full"},(0,o.createElement)(pG,i),(0,o.createElement)("div",{className:"p-2 flex flex-col gap-2 bg-background-secondary rounded-lg"},(0,o.createElement)("div",{className:"wcf-analytics--stats-tabs-container"},(0,o.createElement)("div",{className:"wcf-analytics--stats-tabs m-0"},(0,o.createElement)("div",{className:"gap-2 grid sm:grid-cols-4 grid-cols-2 w-full box-border"},n.map((e,t)=>(0,o.createElement)(uG,{key:e.graphType,item:e,isActive:0===t,onClick:()=>{},trend:e.trend,showProBadge:!1}))))),(0,o.createElement)("div",{className:"bg-background-primary rounded-lg shadow-sm"},(0,o.createElement)("div",{className:"wcf-analytics--tab-content"},(0,o.createElement)(eO,{data:yG,dataKeys:["value"],xAxisDataKey:"date",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,chartWidth:"100%",chartHeight:305})))),"conversion"===e&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"mt-8 bg-background-primary rounded-lg shadow-sm p-6"},(0,o.createElement)($p,{size:"sm",tag:"h2",title:(0,z.__)("Funnel Name","cartflows"),className:"[&_h2]:text-text-primary mb-4"}),(0,o.createElement)("div",{className:"overflow-x-auto"},(0,o.createElement)(eV,{dummy_data_type:"step"}))),(0,o.createElement)("div",{className:"mt-8 bg-background-primary rounded-lg shadow-sm p-6"},(0,o.createElement)($p,{size:"sm",tag:"h2",title:(0,z.__)("Product Details","cartflows"),className:"[&_h2]:text-text-primary mb-4"}),(0,o.createElement)("div",{className:"overflow-x-auto"},(0,o.createElement)(tV,null)))),"optin"===e&&(0,o.createElement)("div",{className:"mt-8 bg-background-primary rounded-lg shadow-sm p-6"},(0,o.createElement)($p,{size:"sm",tag:"h2",title:(0,z.__)("Overview","cartflows"),className:"[&_h2]:text-text-primary mb-4"}),(0,o.createElement)("div",{className:"overflow-x-auto"},(0,o.createElement)(nV,null))),"flows"===e&&(0,o.createElement)("div",{className:"mt-8 bg-background-primary rounded-lg shadow-sm p-6"},(0,o.createElement)($p,{size:"sm",tag:"h2",title:(0,z.__)("All Funnels","cartflows"),className:"[&_h2]:text-text-primary mb-4"}),(0,o.createElement)("div",{className:"overflow-x-auto"},(0,o.createElement)(eV,null))))),(0,o.createElement)("div",{className:"fixed top-0 right-0 bottom-0 left-0 sm:left-[36px] min-[961px]:left-[160px] [body.folded_&]:left-[36px] z-10 bg-black/30 pointer-events-none"},(0,o.createElement)("div",{className:"h-full flex items-center justify-center px-4"},(0,o.createElement)(tO,{title:t.nudgeTitle,description:t.nudgeDescription,containerClass:"pointer-events-auto",innerContainerClass:"border border-border-subtle shadow-lg p-8 rounded-lg max-w-md w-full text-center bg-background-primary"}))))},_G=()=>{const[{publishedFlows:e},t]=d();return(0,i.useEffect)(()=>{e&&(e.data||e.loading)||(async()=>{t({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 n=await L()({url:cartflows_admin.ajax_url,method:"POST",body:e});if(n&&n.data&&n.data.flows){const e=[{value:"",label:(0,z.__)("All Funnels","cartflows")},...n.data.flows.map(e=>({value:e.flow_id,label:e.flow_title}))];t({type:"SET_PUBLISHED_FLOWS",publishedFlows:{data:e,loading:!1,error:null}})}}catch(e){console.error("Error fetching flows:",e),t({type:"SET_PUBLISHED_FLOWS",publishedFlows:{data:[{value:"",label:(0,z.__)("All Funnels","cartflows")}],loading:!1,error:e}})}})()},[t,e]),{flows:e?.data||[{value:"",label:(0,z.__)("All Funnels","cartflows")}],loading:e?.loading||!1,error:e?.error||null}},EG=(e,t)=>{if(t===e||!t||0===t||"0.00"===t)return{percentage:0,isIncrease:!0};const n=(e-t)/t*100;return{percentage:Math.ceil(Math.abs(n)),isIncrease:n>=0}},NG=(e,t)=>{const n=new Date(e.getTime()),r=[];for(;n<=t;)r.push(new Date(n).toISOString().slice(0,10)),n.setDate(n.getDate()+1);return r},MG=__=>[{value:"previous-period",label:__("Previous Period","cartflows")},{value:"previous-year",label:__("Previous Year","cartflows")}];function IG(){var e,t,n,r,a,s,l,c,u,f,m,p,h,g;const[{analyticsData:w},y]=d(),b=w?.flow_stats||{},v=b?.comparison||[],x=w?.flow_stats?.flows_conversions,[_,E]=(0,i.useState)("total_visitors"),[N,M]=(0,i.useState)(),[I,S]=(0,i.useState)(!0),[k,j]=(0,i.useState)({value:"",label:(0,z.__)("All Funnels","cartflows")}),[D,C]=(0,i.useState)("previous-period"),[A,T]=(0,i.useState)({from:null,to:null}),{flows:O,loading:P}=_G(),R=(0,i.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]),[]),U=(e,t,n="",r="previous-period")=>{S(!0);const a=new window.FormData;a.append("date_to",t),a.append("date_from",e),n&&a.append("flow_id",n),a.append("comparison_range_type",r),a.append("screen_type","funnels"),a.append("action","cartflows_get_all_flows_stats"),a.append("security",cartflows_admin.get_all_flows_stats_nonce),L()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then(e=>{y({type:"SET_ANALYTICS_DATA",analyticsData:e.data}),S(!1)})},B=[{name:(0,z.__)("Total Visitors","cartflows"),stat:null!==(e=b?.total_visits)&&void 0!==e?e:0,stat_raw:null,tooltip:(0,z.__)("This shows the total number of times people visited any step in your funnel.","cartflows"),graphType:"total_visitors"},{name:(0,z.__)("Total Orders","cartflows"),stat:null!==(t=b?.total_orders)&&void 0!==t?t:0,stat_raw:null,tooltip:(0,z.__)("This shows the total number of orders placed through your CartFlows checkout pages.","cartflows"),graphType:"total_orders"},{name:(0,z.__)("Total Revenue","cartflows"),stat:null!==(n=b?.total_revenue)&&void 0!==n?n:0,stat_raw:null!==(r=b?.total_revenue_raw)&&void 0!==r?r:0,tooltip:(0,z.__)("This shows the total amount of money earned from all steps combined.","cartflows"),graphType:"total_revenue"},{name:(0,z.__)("Avg. Order Value","cartflows"),stat:null!==(a=b?.avg_order_value)&&void 0!==a?a:0,stat_raw:null!==(s=b?.avg_order_value_raw)&&void 0!==s?s:0,tooltip:(0,z.__)("Average value of each order (Total Revenue / Total Orders).","cartflows"),graphType:"avg_revenue"},{name:(0,z.__)("Bump Revenue","cartflows"),stat:null!==(l=b?.total_bump_revenue)&&void 0!==l?l:0,stat_raw:null!==(c=b?.total_bump_revenue_raw)&&void 0!==c?c:0,tooltip:(0,z.__)("This shows the total amount of money earned from all order bump offers.","cartflows"),graphType:"bump_revenue"},{name:(0,z.__)("Offer Revenue","cartflows"),stat:null!==(u=b?.total_offers_revenue)&&void 0!==u?u:0,stat_raw:null!==(f=b?.total_offers_revenue_raw)&&void 0!==f?f:0,tooltip:(0,z.__)("This shows the total amount of money earned from your Upsell and Downsell offers.","cartflows"),graphType:"offer_revenue"},{name:(0,z.__)("Revenue Per Visit","cartflows"),stat:null!==(m=b?.revenue_per_visit)&&void 0!==m?m:0,stat_raw:null!==(p=b?.revenue_per_visit_raw)&&void 0!==p?p:0,tooltip:(0,z.__)("Revenue per each visit (Total Revenue / Total Visitors).","cartflows"),graphType:"per_visit_revenue"},{name:(0,z.__)("RPUV","cartflows"),stat:null!==(h=b?.revenue_per_unique_visitor)&&void 0!==h?h:0,stat_raw:null!==(g=b?.revenue_per_unique_visitor_raw)&&void 0!==g?g:0,tooltip:(0,z.__)("This shows average revenue generated per individual visitor.","cartflows"),graphType:"per_unique_visitor_revenue"}];(0,i.useEffect)(()=>{const e=new Date,t=new Date;t.setDate(t.getDate()-7),M(NG(t,e));const n=t.toISOString().slice(0,10),r=e.toISOString().slice(0,10);T({from:n,to:r}),U(n,r,"",D)},[y]),(0,i.useEffect)(()=>{A.from&&A.to&&U(A.from,A.to,k.value,D)},[k]),(0,i.useEffect)(()=>{A.from&&A.to&&U(A.from,A.to,k.value,D)},[D]);const F=new Date,Y=F.toISOString().slice(0,10);F.setDate(F.getDate()-7);const Q=F.toISOString().slice(0,10),V=MG(z.__);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("section",{"aria-labelledby":"section-1-title"},(0,o.createElement)("div",{className:"p-6 rounded-xl bg-background-primary overflow-hidden shadow-sm flex flex-col gap-3 justify-center h-full"},(0,o.createElement)(pG,{title:(0,z.__)("Funnel Analytics","cartflows"),selectedFlow:k,onFlowChange:j,flowOptions:O,flowsLoading:P,dateValue:{endDate:Y,startDate:Q},onDateChange:function(e){const t=new Date(e.startDate),n=new Date(e.endDate);M(NG(t,n));const r=t.toISOString().slice(0,10),a=n.toISOString().slice(0,10);T({from:r,to:a}),U(r,a,k.value,D)},comparisonPeriod:D,onComparisonPeriodChange:C,comparisonPeriodOptions:V}),(0,o.createElement)("div",{className:"p-2 flex flex-col gap-2 bg-background-secondary rounded-lg"},(0,o.createElement)("div",{className:"wcf-analytics--stats-tabs-container"},(0,o.createElement)("div",{className:"wcf-analytics--stats-tabs m-0"},(0,o.createElement)("div",{className:"gap-2 grid sm:grid-cols-4 grid-cols-2 w-full box-border"},B.map(e=>{const t=R(e.graphType),n=v?.[t]||0,r=EG(null!==e?.stat_raw?e?.stat_raw:e?.stat,n);return(0,o.createElement)(uG,{key:e.name,item:e,isActive:_===e.graphType,onClick:()=>E(e.graphType),trend:r})})))),(0,o.createElement)("div",{className:"bg-background-primary rounded-lg shadow-sm"},(I||!w)&&(0,o.createElement)(cO,{variant:"rectangular",className:"h-64 w-full rounded"}),w&&!I&&(0,o.createElement)("div",{className:"wcf-analytics--tab-content"},function(){let e="";switch(N||function(){const e=new Date,t=new Date;t.setDate(t.getDate()-7),M(NG(t,e))}(),_){case"total_visitors":default:e=(0,o.createElement)(oO,{dateRange:N});break;case"total_revenue":e=(0,o.createElement)(iO,{dateRange:N});break;case"total_orders":e=(0,o.createElement)(sO,{dateRange:N});break;case"offer_revenue":e=(0,o.createElement)(lO,{dateRange:N});break;case"avg_revenue":e=(0,o.createElement)(tG,{dateRange:N});break;case"bump_revenue":e=(0,o.createElement)(nG,{dateRange:N});break;case"per_visit_revenue":e=(0,o.createElement)(rG,{dateRange:N});break;case"per_unique_visitor_revenue":e=(0,o.createElement)(aG,{dateRange:N})}return e}())))),(0,o.createElement)(gG,{flowsConversions:x})))}const SG=function(){return wcfCartflowsTypePro()?(0,o.createElement)(IG,null):(0,o.createElement)(xG,{page:"flows"})},kG=function(e){const[{analyticsData:t}]=d(),n=t&&t?.flow_stats?.submissions_by_date?t?.flow_stats?.submissions_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,submissions:r?Number(r.submissions):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["submissions"],xAxisDataKey:"date",yAxisDataKey:"submissions",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:rO,chartWidth:"100%",chartHeight:305}))},jG=function(e){const[{analyticsData:t}]=d(),n=t&&t?.flow_stats?.conversion_rate_by_date?t?.flow_stats?.conversion_rate_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,conversions:r?Number(r.conversions):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["conversions"],xAxisDataKey:"date",yAxisDataKey:"conversions",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:rO,chartWidth:"100%",chartHeight:305}))},DG=function(e){const[{analyticsData:t}]=d(),n=t&&t.flow_stats.optin_conversion_rate_by_date?t.flow_stats.optin_conversion_rate_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,conversions:r?Number(r.conversions):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["conversions"],xAxisDataKey:"date",yAxisDataKey:"conversions",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:rO,chartWidth:"100%",chartHeight:305}))},CG=a.p+"images/analytics-empty-overview.e1013b57.png",AG=function({optinFlowConversions:e}){const t=(0,i.useMemo)(()=>e&&Object.values(e).map((e,t)=>(0,o.createElement)(FQ.Row,{key:e?.step_id||t},(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap font-medium"},fh(e?.flow_title||"(no title)")),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},fh(e?.step_title||"(no title)")),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e?.optin_form),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap !hidden"},e?.popup),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap !hidden"},e?.lead_magnets),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap"},e?.conversion_rate+"%"),(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap !hidden"},e?.date_time))),[e]);return(0,o.createElement)("div",{className:"mt-8 bg-background-primary rounded-lg shadow-sm p-6"},(0,o.createElement)($p,{size:"sm",tag:"h2",title:(0,z.__)("Overview","cartflows"),className:"[&_h2]:text-text-primary mb-4"}),(0,o.createElement)("div",{className:"overflow-x-auto"},(0,o.createElement)(FQ,{className:"min-w-full"},(0,o.createElement)(FQ.Head,null,(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Funnel Name","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Opt-in Step","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Opt-in Form","cartflows")),(0,o.createElement)(FQ.HeadCell,{className:"!hidden"},(0,z.__)("Popup","cartflows")),(0,o.createElement)(FQ.HeadCell,{className:"!hidden"},(0,z.__)("Lead Magnets","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Conversion Rate","cartflows")),(0,o.createElement)(FQ.HeadCell,{className:"!hidden"},(0,z.__)("Date & Time","cartflows"))),(0,o.createElement)(FQ.Body,null,e&&0!==Object.keys(e).length?t:(0,o.createElement)(FQ.Row,null,(0,o.createElement)(FQ.Cell,{colSpan:4,className:"py-12"},(0,o.createElement)("div",{className:"flex flex-col items-center gap-3"},(0,o.createElement)("img",{src:CG,alt:"",width:"78",height:"72"}),(0,o.createElement)("div",{className:"flex flex-col items-center gap-1"},(0,o.createElement)("p",{className:"text-lg font-semibold text-text-primary m-0"},(0,z.__)("View how visitors convert across opt-in step.","cartflows")),(0,o.createElement)("p",{className:"text-sm text-text-tertiary m-0"},(0,z.__)("Analytics data will appear here once your funnels start receiving traffic.","cartflows"))))))))))};function TG(){const[{analyticsData:e},t]=d(),n=e?.flow_stats,r=e?.flow_stats?.optin_flow_conversions,a=e?.flow_stats?.comparison||[],[s,l]=(0,i.useState)("total_submissions"),[c,u]=(0,i.useState)(),[f,m]=(0,i.useState)(!0),[p,h]=(0,i.useState)({value:"",label:(0,z.__)("All Funnels","cartflows")}),[g,w]=(0,i.useState)("previous-period"),[y,b]=(0,i.useState)({from:null,to:null}),[v,x]=(0,i.useState)(!1),{flows:_,loading:E}=_G(),N=(0,i.useCallback)(e=>({total_submissions:"total_submissions",conversion_rate:"conversion_rate"}[e]),[]),M=(0,i.useCallback)((e,n,r="",a="previous-period")=>{m(!0);const o=new window.FormData;o.append("date_to",n),o.append("date_from",e),r&&o.append("flow_id",r),o.append("comparison_range_type",a),o.append("screen_type","optins"),o.append("action","cartflows_get_all_flows_stats"),o.append("security",cartflows_admin.get_all_flows_stats_nonce),L()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then(e=>{t({type:"SET_ANALYTICS_DATA",analyticsData:e.data}),m(!1)})},[t]),I=(0,i.useCallback)(({startDate:e,endDate:t})=>{const n=new Date(e),r=new Date(t);u(NG(n,r));const a=n.toISOString().slice(0,10),o=r.toISOString().slice(0,10);b({from:a,to:o}),M(a,o,p.value,g)},[p.value,M,g]),S=(0,i.useMemo)(()=>{var e,t;return[{name:(0,z.__)("Total Submissions","cartflows"),stat:null!==(e=n?.total_submissions)&&void 0!==e?e:0,tooltip:(0,z.__)("This shows the total opt-in form submissions.","cartflows"),graphType:"total_submissions"},{name:(0,z.__)("Conversion Rate","cartflows"),stat:null!==(t=n?.conversion_rate)&&void 0!==t?t:0,tooltip:(0,z.__)("This shows the percentage of visitors who completed the opt-in.","cartflows"),graphType:"conversion_rate"}]},[p.value,n]),k=(0,i.useCallback)(function(){if(!c)return null;switch(s){case"total_submissions":default:return(0,o.createElement)(kG,{dateRange:c});case"conversion_rate":return(0,o.createElement)(jG,{dateRange:c});case"list_growth":return(0,o.createElement)(DG,{dateRange:c})}},[s,c]);(0,i.useEffect)(()=>{const e=new Date,t=new Date;t.setDate(t.getDate()-7),u(NG(t,e));const n=t.toISOString().slice(0,10),r=e.toISOString().slice(0,10);b({from:n,to:r}),M(n,r,"",g),x(!0)},[]),(0,i.useEffect)(()=>{v&&y.from&&y.to&&M(y.from,y.to,p.value,g)},[p.value,v]),(0,i.useEffect)(()=>{v&&y.from&&y.to&&M(y.from,y.to,p.value,g)},[g]);const j=new Date,D=j.toISOString().slice(0,10);j.setDate(j.getDate()-7);const C=j.toISOString().slice(0,10),A=MG(z.__);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("section",{"aria-labelledby":"section-1-title h-full"},(0,o.createElement)("div",{className:"p-6 rounded-xl bg-background-primary overflow-hidden shadow-sm flex flex-col gap-3 justify-center h-full"},(0,o.createElement)(pG,{title:(0,z.__)("Opt-in Analytics","cartflows"),selectedFlow:p,onFlowChange:h,flowOptions:_,flowsLoading:E,dateValue:{endDate:D,startDate:C},onDateChange:I,comparisonPeriod:g,onComparisonPeriodChange:w,comparisonPeriodOptions:A}),(0,o.createElement)("div",{className:"p-2 flex flex-col gap-2 bg-background-secondary rounded-lg"},(0,o.createElement)("div",{className:"wcf-analytics--stats-tabs-container"},(0,o.createElement)("div",{className:"wcf-analytics--stats-tabs m-0"},(0,o.createElement)("div",{className:"gap-2 grid sm:grid-cols-4 grid-cols-2 w-full"},S.map(e=>{const t=N(e.graphType),n=a?.[t]||0,r=EG(e.stat,n),i="conversion_rate"===e.graphType?"%":"";return(0,o.createElement)(uG,{key:e.name,item:e,isActive:s===e.graphType,onClick:()=>l(e.graphType),trend:r,statSuffix:i})})))),(0,o.createElement)("div",{className:"bg-background-primary rounded-lg shadow-sm"},(f||!e)&&(0,o.createElement)(cO,{variant:"rectangular",className:"h-64 w-full rounded"}),e&&!f&&(0,o.createElement)("div",{className:"wcf-analytics--tab-content"},k())))),(0,o.createElement)(AG,{optinFlowConversions:r})))}const OG=function(){return wcfCartflowsTypePro()?(0,o.createElement)(TG,null):(0,o.createElement)(xG,{page:"optin"})},LG=function(e){const[{analyticsData:t}]=d(),n=t&&t?.flow_stats?.desktop_conversions_by_date?t?.flow_stats?.desktop_conversions_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,desktopConversions:r?Number(r.desktop_conversions):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["desktopConversions"],xAxisDataKey:"date",yAxisDataKey:"desktopConversions",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:rO,chartWidth:"100%",chartHeight:305}))},zG=function(e){const[{analyticsData:t}]=d(),n=t&&t?.flow_stats?.mobile_conversions_by_date?t?.flow_stats?.mobile_conversions_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,mobileConversions:r?Number(r.mobile_conversions):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["mobileConversions"],xAxisDataKey:"date",yAxisDataKey:"mobileConversions",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:rO,chartWidth:"100%",chartHeight:305}))},PG=function(e){const[{analyticsData:t}]=d(),n=t&&t?.flow_stats?.conversions_by_date?t?.flow_stats?.conversions_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,conversions:r?Number(r.conversions):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["conversions"],xAxisDataKey:"date",yAxisDataKey:"conversions",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:rO,chartWidth:"100%",chartHeight:305}))},RG=function(e){const[{analyticsData:t}]=d(),n=t&&t?.flow_stats?.bump_conversions_by_date?t?.flow_stats?.bump_conversions_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,bumpConversions:r?Number(r.bump_conversions):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["bumpConversions"],xAxisDataKey:"date",yAxisDataKey:"bumpConversions",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:rO,chartWidth:"100%",chartHeight:305}))},UG=function(e){const[{analyticsData:t}]=d(),n=t&&t?.flow_stats?.offer_conversions_by_date?t?.flow_stats?.offer_conversions_by_date:[],r=e.dateRange.map(e=>{const t=new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),r=n.find(t=>t.OrderDate===e);return{date:t,offerConversions:r?Number(r.offer_conversions):0}});return(0,o.createElement)("div",null,(0,o.createElement)(eO,{data:r,dataKeys:["offerConversions"],xAxisDataKey:"date",yAxisDataKey:"offerConversions",colors:[{stroke:nO}],showXAxis:!0,showYAxis:!0,yAxisTickFormatter:rO,chartWidth:"100%",chartHeight:305}))};function BG(){const[e,t]=(0,i.useState)(()=>new Set),n=(0,i.useCallback)(e=>{t(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);return[e,n]}const FG=[(0,z.__)("Steps","cartflows"),(0,z.__)("Total Visits","cartflows"),(0,z.__)("Unique Visits","cartflows"),(0,z.__)("Conversions","cartflows"),(0,z.__)("Conversion Rate","cartflows"),(0,z.__)("Revenue","cartflows")],YG=a.p+"images/analytics-empty-funnel.c7e015e2.png",QG=function({title:e,subtitle:t}){return(0,o.createElement)(FQ.Row,null,(0,o.createElement)(FQ.Cell,{colSpan:FG.length,className:"py-12"},(0,o.createElement)("div",{className:"flex flex-col items-center gap-3"},(0,o.createElement)("img",{src:YG,alt:"",width:"78",height:"72"}),(0,o.createElement)("div",{className:"flex flex-col items-center gap-1"},(0,o.createElement)("p",{className:"text-lg font-semibold text-text-primary m-0"},e),(0,o.createElement)("p",{className:"text-sm text-text-tertiary m-0"},t)))))},VG=["thankyou","optin","landing"],WG=e=>{const t=e?.["visits-ab"]?Object.entries(e["visits-ab"]):[],n=e?.["visits-ab-archived"]?Object.entries(e["visits-ab-archived"]):[];return{variations:t,archived:n,isAbStep:t.length>0||n.length>0}},ZG=(e,t,n)=>{const r=String(e)===String(t);return{isControl:r,label:r?(0,z.__)("Control","cartflows"):(0,z.sprintf)(/* translators: %d: variation index */ /* translators: %d: variation index */ |
| 43 |
(0,z.__)("Variation-%d","cartflows"),n),variant:r?"red":"neutral"}},GG=(e,t,n)=>{var r;if(!e||VG.includes(t))return"-";const a=null!==(r=e.revenue)&&void 0!==r?r:0;return n?`${window?.cartflows_admin?.woo_currency||""}${a}`:fh(String(a))},HG=(e,t,n=!1)=>{var r,a,o,i;if(!e)return["-","-","-","-","-"];const s="thankyou"===t;return[null!==(r=e.total_visits)&&void 0!==r?r:0,null!==(a=e.unique_visits)&&void 0!==a?a:0,s?"-":null!==(o=e.conversions)&&void 0!==o?o:0,s?"-":`${null!==(i=e.conversion_rate)&&void 0!==i?i:0} %`,GG(e,t,n)]},$G=Ua("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),XG=function({note:e}){return e?(0,o.createElement)(Ja,{content:e,placement:"top",arrow:!0},(0,o.createElement)($G,{className:"w-3.5 h-3.5 text-text-tertiary"})):null},qG=function({cells:e,rowKey:t}){return e.map((e,n)=>(0,o.createElement)(FQ.Cell,{key:`${t}-c-${n}`,className:"whitespace-nowrap"},e))},JG=function({rowKey:e,label:t,cells:n,rowClass:r=""}){return(0,o.createElement)(FQ.Row,{className:r},(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap font-medium"},(0,o.createElement)("div",{className:"flex items-center gap-2"},t)),(0,o.createElement)(qG,{cells:n,rowKey:e}))},KG=function({rowKey:e,flow:t}){const n=t?.visits,r=n?.title||t?.title||t?.name||"-";return(0,o.createElement)(JG,{rowKey:e,label:(0,o.createElement)(o.Fragment,null,(0,o.createElement)("span",null,r),(0,o.createElement)(XG,{note:n?.note})),cells:HG(n,t?.type)})},eH=function({rowKey:e,flow:t,isExpanded:n,onToggle:r}){const a=t?.visits,i=a?.title||t?.title||t?.name||"-",s=n?hm:bU;return(0,o.createElement)(JG,{rowKey:e,label:(0,o.createElement)("button",{type:"button",className:"flex items-center gap-2 bg-transparent border-0 p-0 cursor-pointer text-text-primary",onClick:r,"aria-expanded":n,"aria-label":n?(0,z.__)("Collapse variations","cartflows"):(0,z.__)("Expand variations","cartflows")},(0,o.createElement)(s,{className:"w-4 h-4 text-text-tertiary"}),(0,o.createElement)("span",null,i),(0,o.createElement)(XG,{note:a?.note})),cells:HG(a,t?.type)})},tH=function({rowKey:e,flow:t,stepId:n,variation:r,vIdx:a}){const i=ZG(n,t?.id,a);return(0,o.createElement)(JG,{rowKey:e,rowClass:"bg-background-secondary",label:(0,o.createElement)("div",{className:"flex items-center gap-2 pl-6"},(0,o.createElement)("span",null,r?.title||"-"),(0,o.createElement)(Yf,{label:i.label,size:"xs",variant:i.variant,type:"rounded",disableHover:!0}),(0,o.createElement)(XG,{note:r?.note})),cells:HG(r,t?.type,!0)})},nH=function({rowKey:e,flow:t,variation:n}){return(0,o.createElement)(JG,{rowKey:e,rowClass:"bg-background-secondary",label:(0,o.createElement)("div",{className:"flex items-center gap-2 pl-6"},(0,o.createElement)("span",null,n?.title||"-"),n?.archived_date&&(0,o.createElement)(Yf,{label:n.archived_date,size:"xs",variant:"inverse",type:"rounded",disableHover:!0}),(0,o.createElement)(XG,{note:n?.note})),cells:HG(n,t?.type,!0)})},rH=function({flowStats:e,selectedFlow:t}){const n=e?.steps_conversion?.visits||[],[r,a]=BG(),s=(0,i.useMemo)(()=>n.flatMap((e,t)=>function(e,t,n,r){const a=e?.id||`step-${t}`,{variations:i,archived:s,isAbStep:l}=WG(e);if(!l)return[(0,o.createElement)(KG,{key:a,rowKey:a,flow:e})];const c=n.has(a),u=[(0,o.createElement)(eH,{key:a,rowKey:a,flow:e,isExpanded:c,onToggle:()=>r(a)})];return c?(i.forEach(([t,n],r)=>{const i=`${a}-ab-${t}`;u.push((0,o.createElement)(tH,{key:i,rowKey:i,flow:e,stepId:t,variation:n,vIdx:r}))}),s.forEach(([t,n])=>{const r=`${a}-arc-${t}`;u.push((0,o.createElement)(nH,{key:r,rowKey:r,flow:e,variation:n}))}),u):u}(e,t,r,a)),[n,r,a]);return(0,o.createElement)("div",{className:"mt-8 bg-background-primary rounded-lg shadow-sm p-6"},(0,o.createElement)($p,{size:"sm",tag:"h2",title:e?.steps_conversion?.flow_name||(0,z.__)("Funnel Name","cartflows"),className:"[&_h2]:text-text-primary mb-4"}),(0,o.createElement)("div",{className:"overflow-x-auto"},(0,o.createElement)(FQ,{className:"min-w-full"},(0,o.createElement)(FQ.Head,null,FG.map(e=>(0,o.createElement)(FQ.HeadCell,{key:e},e))),(0,o.createElement)(FQ.Body,null,t.value?n?.length?s:(0,o.createElement)(QG,{title:(0,z.__)("No data available","cartflows"),subtitle:(0,z.__)("There is no conversion data for the selected funnel and date range.","cartflows")}):(0,o.createElement)(QG,{title:(0,z.__)("Select a funnel to view step conversions","cartflows"),subtitle:(0,z.__)("See how visitors move through your funnels and convert at each step.","cartflows")})))))},aH=a.p+"images/analytics-empty-product.0a1c7ceb.png",oH=function({flowStats:e,selectedFlow:t}){const n=e?.products||[],r=(0,i.useMemo)(()=>n&&n.map((e,t)=>{const n=[e?.total_orders?e?.total_orders:"0",e?.conversions?e?.conversions:"0",e?.conversion_rate?e?.conversion_rate+" %":"0 %",fh(e?.revenue)];return(0,o.createElement)(FQ.Row,{key:e?.product_id||t},(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap font-medium"},(0,o.createElement)("div",{className:"flex items-center gap-2"},(0,o.createElement)("span",null,e?.product_title||e?.name||"-"),e?.product_type&&((r=e.product_type)?(0,o.createElement)(Yf,{label:r,size:"xs",type:"pill",variant:"neutral",className:"capitalize",disableHover:!0}):null))),n.map((e,t)=>(0,o.createElement)(FQ.Cell,{className:"whitespace-nowrap",key:t},e)));var r}),[n]);return(0,o.createElement)("div",{className:"mt-8 bg-background-primary rounded-lg shadow-sm p-6"},(0,o.createElement)($p,{size:"sm",tag:"h2",title:(0,z.__)("Product Details","cartflows"),className:"[&_h2]:text-text-primary mb-4"}),(0,o.createElement)("div",{className:"overflow-x-auto"},(0,o.createElement)(FQ,{className:"min-w-full"},(0,o.createElement)(FQ.Head,null,(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Product Name","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("No. of Orders","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Conversions","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Conversion Rate","cartflows")),(0,o.createElement)(FQ.HeadCell,null,(0,z.__)("Revenue","cartflows"))),(0,o.createElement)(FQ.Body,null,t.value?n&&0!==n.length?r:(0,o.createElement)(FQ.Row,null,(0,o.createElement)(FQ.Cell,{colSpan:5,className:"py-12"},(0,o.createElement)("div",{className:"flex flex-col items-center gap-3"},(0,o.createElement)("img",{src:aH,alt:"",width:"86",height:"72"}),(0,o.createElement)("div",{className:"flex flex-col items-center gap-1"},(0,o.createElement)("p",{className:"text-lg font-semibold text-text-primary m-0"},(0,z.__)("No data available","cartflows")),(0,o.createElement)("p",{className:"text-sm text-text-tertiary m-0"},(0,z.__)("There are no product conversion records for the selected filters.","cartflows")))))):(0,o.createElement)(FQ.Row,null,(0,o.createElement)(FQ.Cell,{colSpan:5,className:"py-12"},(0,o.createElement)("div",{className:"flex flex-col items-center gap-3"},(0,o.createElement)("img",{src:aH,alt:"",width:"86",height:"72"}),(0,o.createElement)("div",{className:"flex flex-col items-center gap-1"},(0,o.createElement)("p",{className:"text-lg font-semibold text-text-primary m-0"},(0,z.__)("Select a funnel to view product conversions","cartflows")),(0,o.createElement)("p",{className:"text-sm text-text-tertiary m-0"},(0,z.__)("Product conversion metrics for items sold through your funnels will appear here.","cartflows"))))))))))};function iH(){const[{analyticsData:e},t]=d(),n=e?.flow_stats||{},r=n?.comparison||[],[a,s]=(0,i.useState)(),[l,c]=(0,i.useState)(!0),[u,f]=(0,i.useState)("total_visitors"),[m,p]=(0,i.useState)({value:"",label:(0,z.__)("All Funnels","cartflows")}),[h,g]=(0,i.useState)("previous-period"),[w,y]=(0,i.useState)({from:null,to:null}),[b,v]=(0,i.useState)(!1),{flows:x,loading:_}=_G(),E=(0,i.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]),[]),N=(0,i.useCallback)((e,n,r,a="previous-period")=>{c(!0);const o=new window.FormData;o.append("date_to",n),o.append("date_from",e),r&&o.append("flow_id",r),o.append("comparison_range_type",a),o.append("screen_type","conversions"),o.append("action","cartflows_get_all_flows_stats"),o.append("security",cartflows_admin.get_all_flows_stats_nonce),L()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then(e=>{t({type:"SET_ANALYTICS_DATA",analyticsData:e.data}),c(!1)}).catch(e=>{console.error("API Error:",e),c(!1)})},[t]),M=(0,i.useCallback)(({startDate:e,endDate:t})=>{const n=e.toISOString().split("T")[0],r=t.toISOString().split("T")[0];s(NG(e,t)),y({from:n,to:r}),N(n,r,m.value,h)},[m.value,N,h]);(0,i.useEffect)(()=>{const e=new Date,t=new Date;t.setDate(t.getDate()-7),s(NG(t,e));const n=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:n,to:r}),N(n,r,"",h),v(!0)},[]),(0,i.useEffect)(()=>{b&&w.from&&w.to&&N(w.from,w.to,m.value,h)},[m.value,b]),(0,i.useEffect)(()=>{b&&w.from&&w.to&&N(w.from,w.to,m.value,h)},[h]);const I=new Date,S=I.toISOString().slice(0,10);I.setDate(I.getDate()-7);const k=I.toISOString().slice(0,10),j=MG(z.__),D=(0,i.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"),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"),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"),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"),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"),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"),graphType:"mobile_conversion_rate"}],[m.value,n]),C=(0,i.useCallback)(function(){if(!a)return null;switch(u){case"total_visitors":return(0,o.createElement)(oO,{dateRange:a});case"total_conversions":return(0,o.createElement)(PG,{dateRange:a});case"total_bump_conversions":return(0,o.createElement)(RG,{dateRange:a});case"offer_conversions":return(0,o.createElement)(UG,{dateRange:a});case"laptop_conversion_rate":return(0,o.createElement)(LG,{dateRange:a});case"mobile_conversion_rate":return(0,o.createElement)(zG,{dateRange:a});default:return(0,o.createElement)(sO,{dateRange:a})}},[u,a]);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("section",{"aria-labelledby":"section-1-title h-full"},(0,o.createElement)("div",{className:"p-6 rounded-xl bg-background-primary overflow-hidden shadow-sm flex flex-col gap-3 justify-center h-full"},(0,o.createElement)(pG,{title:(0,z.__)("Conversions Analytics","cartflows"),selectedFlow:m,onFlowChange:p,flowOptions:x,flowsLoading:_,dateValue:{endDate:S,startDate:k},onDateChange:M,comparisonPeriod:h,onComparisonPeriodChange:g,comparisonPeriodOptions:j}),(0,o.createElement)("div",{className:"p-2 flex flex-col gap-2 bg-background-secondary rounded-lg"},(0,o.createElement)("div",{className:"wcf-analytics--stats-tabs-container"},(0,o.createElement)("div",{className:"wcf-analytics--stats-tabs m-0"},(0,o.createElement)("div",{className:"gap-2 grid sm:grid-cols-4 grid-cols-2 w-full box-border"},D.map(e=>{const t=E(e.graphType),n=r?.[t]||0,a=EG(e.stat,n);return(0,o.createElement)(uG,{key:e.name,item:e,isActive:u===e.graphType,onClick:()=>f(e.graphType),trend:a})})))),(0,o.createElement)("div",{className:"bg-background-primary rounded-lg shadow-sm"},(l||!e)&&(0,o.createElement)(cO,{variant:"rectangular",className:"h-64 w-full rounded"}),e&&!l&&(0,o.createElement)("div",{className:"wcf-analytics--tab-content"},C())))),(0,o.createElement)(rH,{flowStats:n,selectedFlow:m}),(0,o.createElement)(oH,{flowStats:n,selectedFlow:m})))}const sH=function(){return wcfCartflowsTypePro()?(0,o.createElement)(iH,null):(0,o.createElement)(xG,{page:"conversion"})},lH=function(){const e=(0,b.useLocation)();let t;switch(new URLSearchParams(e.search).get("type")||"flows"){case"flows":default:t=(0,o.createElement)(SG,null);break;case"optin":t=(0,o.createElement)(OG,null);break;case"conversion":t=(0,o.createElement)(sH,null)}return(0,o.createElement)("div",null,t)},cH=cartflows_admin.default_page_builder,uH=cartflows_admin.required_plugins,dH=cartflows_admin.required_plugins[cH],fH={};fH[cH]=Object.values(cartflows_admin.flows_and_steps);const mH={};mH[cH]=Object.values(cartflows_admin.store_checkout_flows_and_steps);const pH={default_page_builder:cH,page_builder_group_data:uH,page_builder_group:dH,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:{...fH},store_checkout_flows:{...mH},all_step_templates:(()=>{const e=[],t=cartflows_admin.flows_and_steps;return t&&t.forEach(t=>{t.steps.forEach(n=>{n.template_ID=t.ID,n.template_type=t.type,e.push(n)})}),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"}},hH={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},gH={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})},{registerStore:wH}=wp.data;wH("wcf/importer",{reducer:(e=pH,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:gH,selectors:hH});const yH=(0,sp.compose)((0,lp.withDispatch)(e=>{const{setPreview:t}=e("wcf/importer");return{setPreview(e){t(e)}}}))(function({item:e,setPreview:t}){const{thumbnail_image_url:n,title:r,type:a}=e;return(0,o.createElement)("div",{className:"wcf-flow-template--item group relative cursor-pointer transition ease-in-out delay-150 rounded-lg shadow-md",onClick:()=>t(e)},"pro"===a&&(0,o.createElement)("div",{className:"z-10 absolute top-5 right-5"},(0,o.createElement)(Ym,null)),(0,o.createElement)("div",{className:"wcf-item__inner bg-background-primary border border-border-subtle"},(0,o.createElement)("div",{className:"wcf-item__thumbnail-wrap sm:max-h-96 max-h-56 overflow-hidden relative"},(0,o.createElement)("div",{className:"wcf-item__thumbnail overflow-hidden"},(0,o.createElement)("img",{className:"wcf-flow-template--thumbnail-image w-full",src:n,title:r,alt:r})),(0,o.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,o.createElement)("div",{className:"mx-auto my-0 text-center flex flex-col gap-4 relative top-1/2"},(0,o.createElement)("div",{className:"wcf-item__btn"},(0,o.createElement)(Va,{variant:"primary",size:"sm",icon:(0,o.createElement)(xp,{className:"w-4 h-4 stroke-2"}),className:"mx-auto"},(0,z.__)("View All Steps","cartflows")))))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap border-0 border-t border-solid border-border-subtle"},(0,o.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},r))))});function bH({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 12h-15m0 0 6.75 6.75M4.5 12l6.75-6.75"}))}const vH=i.forwardRef(bH);function xH({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 _H=i.forwardRef(xH),EH=function({item:e,setPreviewImageURL:t,currentPreviewID:n,setCurrentPreviewID:r}){const{ID:a,title:i,type:s,thumbnail_image_url:l,featured_image_url:c}=e,u="wcf-item__inner rounded-lg cursor-pointer border border-solid "+(n===a?"!border-brand-500":"border-border-subtle");return(0,o.createElement)("div",{className:"wcf-item wcf-item--preview mb-8"},"pro"===s&&(0,o.createElement)("div",{className:"mb-1"},(0,o.createElement)(Ym,null)),(0,o.createElement)("div",{className:u,onClick:()=>{t(c),r(a)}},(0,o.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,o.createElement)("div",{className:"wcf-item__thumbnail max-h-[200px] overflow-hidden"},(0,o.createElement)("img",{className:"wcf-item__thumbnail-image w-full rounded-lg",src:`${l}`,alt:(0,z.__)("Funnel thumbnail image","cartflows")}))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap p-4 bg-background-primary border-t border-border-subtle rounded-bl-lg rounded-br-lg"},(0,o.createElement)("div",{className:"wcf-item__step-type text-xs font-normal text-field-placeholder mb-1"},(d=s,{landing:(0,z.__)("Landing","cartflows"),checkout:(0,z.__)("Checkout","cartflows"),thankyou:(0,z.__)("Thank You","cartflows"),optin:(0,z.__)("Opt-In","cartflows"),"optin-thankyou":(0,z.__)("Thank You","cartflows")}[d]||d)),(0,o.createElement)("div",{className:"wcf-item__heading text-text-primary text-sm font-medium"},i))));var d},NH=(0,sp.compose)((0,lp.withSelect)(e=>{const{getPreview:t}=e("wcf/importer");return{preview:t()}}),(0,lp.withDispatch)(e=>{const{setPreview:t}=e("wcf/importer");return{setPreview:t}}))(function({preview:e,setPreview:t}){const{featured_image_url:n,steps:r}=e,a=cartflows_admin.template_library_url+"preview/?flow="+e.ID,s=Object.values(r),l=s.length?s[0].ID:"",[c,u]=(0,i.useState)(n),[d,f]=(0,i.useState)(l),[m,p]=(0,i.useState)("hide"),[h,g]=(0,i.useState)("");return window.scrollTo(0,0),(0,o.createElement)(i.Fragment,null,(0,o.createElement)("div",{className:"wcf-flow-preview-wrap"},(0,o.createElement)("div",{className:"wcf-flow-preview--header bg-background-primary flex justify-between items-center mb-9 -m-8 sm:px-8 py-6 sm:flex-row flex-col gap-3"},(0,o.createElement)("div",{className:"wcf-flow-preview--left-section flex justify-between items-center gap-4"},(0,o.createElement)(Va,{variant:"ghost",size:"sm",icon:(0,o.createElement)(vH,{className:"w-5 h-5 stroke-2"}),onClick:()=>t({})}),(0,o.createElement)("h3",{className:"text-xl text-text-primary font-semibold"},(0,z.__)("Funnel Preview","cartflows"))),(0,o.createElement)("div",{className:"wcf-flow-preview--right-section"},(0,o.createElement)("div",{className:"wcf-flow-preview__actions flex justify-between items-center gap-4"},(0,o.createElement)(Va,{variant:"outline",size:"md",tag:"a",href:a,target:"_blank",rel:"noreferrer",className:"no-underline",icon:(0,o.createElement)(xp,{className:"w-5 h-5 stroke-2"})},(0,z.__)("Live Preview","cartflows")),(0,o.createElement)(Va,{variant:"primary",size:"md",icon:(0,o.createElement)(_H,{className:"w-5 h-5 stroke-2"}),onClick:()=>{p("hide"===m?"show":"hide")}},(0,z.__)("Import Funnel","cartflows")),(0,o.createElement)(Mp,{visibility:m,setVisibility:p,preview:e,type:"import",flowName:h,setFlowName:g})))),(0,o.createElement)("div",{className:"wcf-flow-preview flex sm:flex-row flex-col-reverse p-6 bg-background-primary shadow-sm rounded-md"},(0,o.createElement)("div",{className:"wcf-flow-preview__item w-full sm:w-4/5 sm:px-6 p-0 border-0 border-r border-solid border-border-subtle"},(0,o.createElement)("div",{className:"border border-solid border-border-subtle rounded-lg"},(0,o.createElement)("div",{className:"wcf-window--header bg-background-primary p-2 flex items-center rounded-tl-lg rounded-tr-lg"},(0,o.createElement)("div",{className:"wcf-window--buttons flex justify-start gap-1 items-center w-2/4"},(0,o.createElement)("span",{className:"bg-background-secondary rounded-full p-1"}),(0,o.createElement)("span",{className:"bg-background-secondary rounded-full p-1"}),(0,o.createElement)("span",{className:"bg-background-secondary rounded-full p-1"})),(0,o.createElement)("div",{className:"wcf-window--title capitalize text-xs font-medium text-text-secondary w-2/4 -ml-12"},`${s.find(e=>e.ID===d).type} Page`)),(0,o.createElement)("div",{className:"wcf-flow-preview__inner max-h-screen overflow-y-auto"},(0,o.createElement)("div",{className:"wcf-flow-preview__thumbnail-wrap"},(0,o.createElement)("img",{className:"wcf-flow-preview__thumbnail w-full",src:c,alt:(0,z.__)("Funnel Preview","cartflows")}))))),(0,o.createElement)("div",{className:"wcf-flow-preview__list w-full sm:w-[20%] sm:px-6 p-0"},s.map(e=>(0,o.createElement)(EH,{key:e.ID,item:e,setPreviewImageURL:u,currentPreviewID:d,setCurrentPreviewID:f}))))))}),MH=({preview:e,type:t,flowName:n,setVisibility:r})=>(0,o.createElement)($m.Footer,{className:"wcf-name-your-flow--footer bg-brand-25 flex justify-end gap-4"},"import"===t&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"outline",size:"md",className:"no-underline text-center",onClick:()=>r("hide")},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(GZ,{preview:e,flowName:n,isStoreCheckout:!0})),"blank"===t&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"outline",size:"md",className:"no-underline text-center",onClick:()=>r("hide")},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(HZ,{flowName:n,isStoreCheckout:!0}))),IH=e=>{const{cf_pro_status:t,setVisibility:n,preview:r,type:a,setFlowName:i}=e;return(0,o.createElement)(o.Fragment,null,(0,o.createElement)($m.Header,{className:"flex items-center justify-between !space-y-0"},(0,o.createElement)($m.Title,{className:"wcf-name-your-flow--title"},(0,z.__)("Create Store Checkout","cartflows")),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)($m.Body,null,(0,o.createElement)("div",{className:"wcf-name-your-store-flow--content"},(0,o.createElement)("p",{className:"text-sm font-medium leading-6 text-text-primary mb-4"},(0,z.__)("Set up a Store Checkout in just one click:","cartflows")),(0,o.createElement)("ul",{className:"text-sm text-text-secondary mb-4 list-inside"},(0,o.createElement)("li",{className:"flex gap-2 items-center"},(0,o.createElement)(mW,{className:"h-18 w-18 text-brand-600","aria-hidden":"true"}),(0,z.__)("Checkout Page","cartflows")),(0,o.createElement)("li",{className:"flex gap-2 items-center"},(0,o.createElement)(mW,{className:"h-18 w-18 text-brand-600","aria-hidden":"true"}),(0,z.__)("Thank You Page","cartflows"))),(0,o.createElement)("p",{className:"text-sm text-text-secondary"},(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,o.createElement)(MH,{cf_pro_status:t,setVisibility:n,preview:r,type:a,flowName:"Store Checkout",setFlowName:i}))},SH=(0,sp.compose)((0,lp.withSelect)(e=>{const{getFlowsCount:t,getCFProStatus:n,getLicenseStatus:r}=e("wcf/importer");return{flowsCount:t(),cf_pro_status:n(),license_status:r()}}))(({visibility:e,setVisibility:t,preview:n,type:r,flowName:a,setFlowName:i,cf_pro_status:s})=>(0,o.createElement)($m,{open:"show"===e,setOpen:e=>{e||t("hide")},exitOnClickOutside:!0},(0,o.createElement)($m.Panel,{className:"wcf-name-your-flow__inner sm:max-w-lg w-full"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)(IH,{cf_pro_status:s,setVisibility:t,preview:n,type:r,flowName:a,setFlowName:i})))),kH=(0,sp.compose)((0,lp.withSelect)(()=>({page_builder_group:cartflows_admin.required_plugins[cartflows_admin?.page_builder],default_page_builder:cartflows_admin?.page_builder})),(0,lp.withDispatch)(e=>{const{setRequiredPlugins:t,setAllFlows:n}=e("wcf/importer");return{setRequiredPlugins:t,setAllFlows:n}}))(({setRequiredPlugins:e,setAllFlows:t,default_page_builder:n,page_builder_group:r})=>{const[{page_builder:a}]=g(),[s,l]=(0,i.useState)(!1),c=new URLSearchParams((0,b.useLocation)()?.search);let u=c.get("path")?c.get("path"):"";"store-checkout-library"===u&&(u="store-checkout");const d=r.title;let f=`Please click here and activate ${d}`,m="";if("divi"===n){m=r["theme-status"];const e=r["plugin-status"];"deactivate"===m||"install"===e?f=`Please activate ${d}`:"deactivate"!==m&&"not-installed"!==m||"install"!==e||(f=`Please install and activate ${d}`)}function p(n){const r=new window.FormData;r.append("action","cartflows_activate_plugin"),r.append("init",n.init),r.append("security",cartflows_admin.activate_plugin_nonce),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{l(!1),e(a,"no"),t([]),window.location.reload()})}const[h,w]=(0,i.useState)("hide"),[y,v]=(0,i.useState)("");return(0,o.createElement)("div",{className:"wcf-flow-importer wcf-flow-library--other"},(0,o.createElement)("div",{className:"wcf-flow-library-importer__header bg-background-primary px-8 py-6 flex justify-between items-center border-b border-border-subtle"},(0,o.createElement)("h3",{className:"wcf-flow-importer__header-title text-xl font-semibold text-text-primary"},"store-checkout"===u?(0,z.__)("Store Checkout Templates","cartflows"):(0,z.__)("Funnel Templates","cartflows"))),(0,o.createElement)("div",{className:"wcf-flow-library-importer__list bg-background-primary px-10 py-14"},"store-checkout"===u?(0,o.createElement)(SH,{visibility:h,setVisibility:w,type:"blank",flowName:y,setFlowName:v}):(0,o.createElement)(Mp,{visibility:h,setVisibility:w,type:"blank",flowName:y,setFlowName:v}),(0,o.createElement)("div",{className:"wcf-item wcf-item--start-from-blank flex gap-6 mx-auto max-w-4xl"},(0,o.createElement)("div",{className:"wcf-item__inner relative cursor-pointer group bg-gray-25 p-5 text-center flex flex-col border border-border-subtle hover:border-brand-300 rounded-md items-center justify-center h-72 w-2/3",onClick:()=>{w("hide"===h?"show":"hide")}},(0,o.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,o.createElement)("div",{className:"wcf-item__thumbnail"},(0,o.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon bg-background-primary p-6 rounded-full"},(0,o.createElement)(KO,{className:"wcf-icon-start-from-blank w-7 h-7 stroke-1 text-text-tertiary group-hover:text-brand-300"})))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap border-t border-border-subtle absolute bottom-0 w-full"},(0,o.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows")))),(0,o.createElement)("div",{className:"wcf_item__info flex flex-col gap-6 justify-center w-3/4"},(0,o.createElement)("h3",{className:"wcf_item__info--title text-xl text-text-primary font-semibold"},(0,z.__)("It seems that the page builder you selected is inactive.","cartflows")),(0,o.createElement)("p",{className:"wcf_item__info--notice text-base text-text-secondary font-normal"},s&&(0,o.createElement)("span",{className:"text-sm text-text-secondary"},(0,z.__)("Processing…","cartflows")),(0,o.createElement)("a",{href:"#",onClick:function(e){e.preventDefault(),l(!0);const t=cartflows_admin.required_plugins[n].plugins;let r=0,a=0;for(const e of t)"install"===e.status&&r++,"activate"===e.status&&a++;r?function(e){for(const t of e)"install"===t.status&&wp.updates.queue.push({action:"install-plugin",data:{slug:t.slug,init:t.init,name:t.name,success(){p(t)},error(){}}});wp.updates.queueChecker()}(t):a&&function(e){for(const t of e)"activate"===t.status&&p(t)}(t)},className:"text-brand-500 hover:text-brand-600"},f),(0,z.__)(" to see CartFlows templates. If you prefer another page builder tool, you can ","cartflows"),(0,o.createElement)(C,{key:`?page=${cartflows_admin.home_slug}&path=settings&tab=general`,to:{pathname:"admin.php",search:`?page=${cartflows_admin.home_slug}&path=settings&tab=general`},onClick:function(e){e.preventDefault(),window.location=e.target.href},className:"text-brand-500 hover:text-brand-600"},(0,z.__)("select it here","cartflows")),"."),(0,o.createElement)("span",{className:"wcf_item__info--desc text-base text-text-secondary 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,o.createElement)("a",{className:"wcf_item__info--doc text-text-secondary hover:text-brand-500 flex items-center gap-2 text-sm",href:getKbDocUrl("https://cartflows.com/docs/how-to-use-cartflows-with-your-own-template/"),target:"_blank",rel:"noreferrer"},(0,z.__)("Learn How ","cartflows"),(0,o.createElement)("i",{className:"dashicons dashicons-external"}))))))}),jH=(0,i.memo)(e=>{const t=(0,z.__)("Sync Library","cartflows"),{template:n}=e,r=n||"",[a,s]=(0,i.useState)({isProcessing:!1,buttonText:t}),{isProcessing:l,buttonText:c}=a,u=async(e,t)=>{const n=new window.FormData;n.append("action","cartflows_import_sites"),n.append("page_no",e),n.append("template",r),n.append("security",cartflows_admin.import_sites_nonce),await L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(n=>{n.success&&(s({isProcessing:!0,buttonText:(0,z.sprintf)(/* translators: %d is replaced with the condition number */ /* translators: %d is replaced with the condition number */ |
| 44 |
(0,z.__)("Importing page %d","cartflows"),e)}),e===t&&(async()=>{const e=new window.FormData;e.append("action","cartflows_update_library_complete"),e.append("template",r),e.append("security",cartflows_admin.update_library_complete_nonce),s({isProcessing:!0,buttonText:(0,z.__)("Sync Complete","cartflows")}),await L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.success&&s({isProcessing:!1,buttonText:(0,z.__)("Sync Complete","cartflows")})}).catch(()=>{})})())}).catch(()=>{})};return(0,o.createElement)(Va,{variant:"outline",size:"md",loading:l,icon:(0,o.createElement)(Wf,{className:"w-4 h-4 stroke-1"}),className:"wcf-sync whitespace-nowrap sm:whitespace-normal",onClick:e=>{e.preventDefault(),s({isProcessing:!0,buttonText:(0,z.__)("Syncing Library…","cartflows")}),(async()=>{try{const e=new window.FormData;e.append("action","cartflows_sync_library"),e.append("template",r),e.append("security",cartflows_admin.sync_library_nonce),await L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.success&&("updated"===e.data?(s({isProcessing:!1,buttonText:(0,z.__)("Library Synced","cartflows")}),setTimeout(()=>{s({isProcessing:!1,buttonText:t})},5e3)):(async()=>{const e=new window.FormData;e.append("action","cartflows_request_count"),e.append("template",r),e.append("security",cartflows_admin.request_count_nonce),await L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(async e=>{if(e.success){s({isProcessing:!0,buttonText:"Importing Pages.."});const t=e.data.count;for(let e=1;e<=t;e++)u(e,t)}else s({isProcessing:!1,buttonText:t})}).catch(()=>{})})())}).catch(()=>{})}catch(e){}})()}},c)}),DH=()=>{const[e,t]=(0,i.useState)("hide"),[n,r]=(0,i.useState)("");return(0,o.createElement)("div",{className:"wcf-flow-library-importer wcf-flow-library--other"},(0,o.createElement)("div",{className:"wcf-flow-library-importer__list bg-background-primary px-10 py-14"},(0,o.createElement)(Mp,{visibility:e,setVisibility:t,type:"blank",flowName:n,setFlowName:r}),(0,o.createElement)("div",{className:"wcf-item wcf-item--start-from-blank flex gap-6 mx-auto max-w-4xl"},(0,o.createElement)("div",{className:"wcf-item__inner relative cursor-pointer group bg-gray-25 p-5 text-center flex flex-col border border-border-subtle hover:border-brand-300 rounded-md items-center justify-center h-72 w-2/3",onClick:()=>{t("hide"===e?"show":"hide")}},(0,o.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,o.createElement)("div",{className:"wcf-item__thumbnail"},(0,o.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon bg-background-primary p-6 rounded-full"},(0,o.createElement)(KO,{className:"w-7 h-7 stroke-1 text-text-tertiary group-hover:text-brand-300"})))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap border-t border-border-subtle absolute bottom-0 w-full"},(0,o.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows")))),(0,o.createElement)("div",{className:"wcf_item__info flex flex-col gap-6 justify-center w-3/4"},(0,o.createElement)("h3",{className:"wcf_item__info--title text-xl text-text-primary font-semibold"},(0,z.__)("No Results Found.","cartflows")),(0,o.createElement)("span",{className:"wcf_item__info--desc text-base text-text-secondary font-normal mt-2"},(0,z.__)("Don't see a funnel that you would like to import?","cartflows")),(0,o.createElement)("a",{className:"wcf_item__info--doc text-sm text-text-secondary font-normal hover:text-brand-300 flex gap-1",href:getUtmUrl("https://cartflows.com/funnel-suggestions/",{utm_campaign:"suggestions"}),target:"_blank",rel:"noreferrer"},(0,z.__)("Please suggest us ","cartflows"),(0,o.createElement)(xp,{className:"w-5 h-5 stroke-1 text-text-tertiary hover:text-brand-300"}))))))},CH=function(){return(0,o.createElement)("div",{className:"wcf-flow-importer__list wcf-items-list grid grid-cols-2 sm:grid-cols-4 gap-6 is-placeholder mb-9"},Array.from({length:12}).map((e,t)=>(0,o.createElement)("div",{key:t,className:"wcf-item"},(0,o.createElement)("div",{className:"bg-background-primary border border-border-subtle rounded-lg overflow-hidden"},(0,o.createElement)(cO,{className:"w-full h-52"}),(0,o.createElement)("div",{className:"p-4 border-t border-border-subtle"},(0,o.createElement)(cO,{className:"w-full h-4"}))))))},AH=(0,sp.compose)((0,lp.withDispatch)(e=>{const{setAllFlows:t}=e("wcf/importer");return{setAllFlows:t}}))(function({setAllFlows:e}){let t="no";const n=(0,b.useHistory)(),[{page_builder:r}]=g(),[a,s]=(0,i.useState)(""),[l,c]=(0,i.useState)(!1),{currentPageBuilderData:u,requiredPluginsData:d,preview:f,all_flows:m,flows_list:p}=(0,lp.useSelect)(e=>({currentPageBuilderData:e("wcf/importer").getCurrentPageBuilderData(r),requiredPluginsData:e("wcf/importer").getRequiredPluginsData(),preview:e("wcf/importer").getPreview(),all_flows:e("wcf/importer").getAllFlows(),flows_list:e("wcf/importer").getFlowsList(r)}));if("yes"===d[r]&&u&&u?.plugins&&u?.plugins.map(function(e){return"install"!==e.status&&"activate"!==e.status||(t="yes"),""}),"yes"===t)return(0,o.createElement)(kH,null);(0,i.useEffect)(()=>{let t=!0;if(!m[r]){const n=new window.FormData;n.append("action","cartflows_get_flows_list"),n.append("security",cartflows_admin.get_flows_list_nonce),c(!0),(async()=>{L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(n=>{if(c(!1),t&&n?.data?.flows){const t=Object.values(n.data.flows);w(t),e(t,r)}})})()}return()=>{t=!1}},[m]);const[h,w]=(0,i.useState)(p),[y,v]=(0,i.useState)("hide"),[x,_]=(0,i.useState)("");return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-flow-importer"},Object.keys(f).length?(0,o.createElement)(NH,null):(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-flow-importer__header bg-background-primary px-8 py-6 flex justify-between items-start sm:items-center mb-9 -m-8 sm:flex-row flex-col gap-3"},(0,o.createElement)("h3",{className:"wcf-flow-importer__header-title text-xl font-semibold text-text-primary m-0 flex items-center gap-2"},(0,o.createElement)(Va,{variant:"ghost",size:"xs","aria-label":(0,z.__)("Back to Funnels","cartflows"),icon:(0,o.createElement)(HW,{className:"w-6 h-6 stroke-1 text-text-primary"}),onClick:()=>{n.push("admin.php?page=cartflows&path=flows")}}),(0,z.__)("Choose a Funnel Template","cartflows")),(0,o.createElement)("div",{className:"wcf-flow-importer__actions gap-4 flex justify-between items-center"},(0,o.createElement)("div",{className:"wcf-flow-importer__actions-content-left"},(0,o.createElement)("div",{className:"wcf-flow-importer__actions-search w-56"},(0,o.createElement)(dp,{type:"text",value:a,onChange:function(e){if(s(e),e&&e.length>=3){const t=e.toLowerCase(),n=p.filter(function(e){return(e.title&&e.title.toLowerCase()||"").includes(t)});w(n)}else w(p)},placeholder:(0,z.__)("Search Templates","cartflows"),size:"md",prefix:(0,o.createElement)(FV,{className:"size-4 text-field-placeholder"}),suffix:a.length>=3?(0,o.createElement)(tL,{className:"size-4 cursor-pointer text-field-placeholder pointer-events-auto",onClick:()=>{s(""),w(p)}}):null}))),(0,o.createElement)("div",{className:"divider w-px bg-background-secondary h-7"}),(0,o.createElement)("div",{className:"wcf-flow-importer__actions-content-right"},(0,o.createElement)("div",{className:"wcf-flow-importer__actions-buttons"},(0,o.createElement)(jH,null))))),l&&(0,o.createElement)(CH,null),p.length>0&&0===h.length&&(0,o.createElement)(DH,null),!(p.length>0&&0===h.length)&&(0,o.createElement)("div",{className:"wcf-flow-importer__list wcf-items-list grid grid-cols-1 sm:grid-cols-4 gap-6 p-6 bg-background-primary shadow-sm rounded-md"},(0,o.createElement)(Mp,{visibility:y,setVisibility:v,type:"blank",flowName:x,setFlowName:_}),(0,o.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-background-primary rounded-lg relative start-scratch"},(0,o.createElement)("div",{className:"wcf-item__inner relative cursor-pointer bg-background-secondary text-center h-full flex flex-col gap-4 items-center justify-center shadow-md",onClick:()=>{v("hide"===y?"show":"hide")}},(0,o.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,o.createElement)("div",{className:"wcf-item__thumbnail"},(0,o.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon bg-background-primary p-6 rounded-full"},(0,o.createElement)(KO,{className:"w-7 h-7 stroke-2 text-text-tertiary"})))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap border-t border-border-subtle absolute bottom-0 w-full"},(0,o.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows"))))),p.length>0&&0<h.length&&h.map(e=>(0,o.createElement)(yH,{key:e.ID,item:e}))))))}),TH=e=>{const t=(0,b.useHistory)(),[n,r]=(0,i.useState)("hide"),[a,s]=(0,i.useState)(""),l=e.page_builder;return(0,o.createElement)("div",{className:"wcf-flow-library-importer wcf-flow-library--other"},(0,o.createElement)("div",{className:"wcf-flow-library-importer__header bg-background-primary px-8 py-6 flex justify-between items-center border-b border-border-subtle"},(0,o.createElement)("h3",{className:"wcf-flow-importer__header-title text-xl font-semibold text-text-primary m-0 flex items-center gap-2"},(0,o.createElement)(Va,{variant:"ghost",size:"xs","aria-label":(0,z.__)("Back to Funnels","cartflows"),icon:(0,o.createElement)(HW,{className:"w-6 h-6 stroke-1 text-text-primary"}),onClick:()=>{t.push("admin.php?page=cartflows&path=flows")}}),(0,z.__)("Start from Scratch","cartflows"))),(0,o.createElement)("div",{className:"wcf-flow-library-importer__list bg-background-primary px-10 py-14"},(0,o.createElement)(Mp,{visibility:n,setVisibility:r,type:"blank",flowName:a,setFlowName:s}),(0,o.createElement)("div",{className:"wcf-item wcf-item--start-from-blank flex gap-6 mx-auto max-w-4xl"},(0,o.createElement)("div",{className:"wcf-item__inner relative cursor-pointer group bg-gray-25 p-5 text-center flex flex-col border border-border-subtle hover:border-brand-300 rounded-md items-center justify-center h-72 w-2/3",onClick:()=>{r("hide"===n?"show":"hide")}},(0,o.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,o.createElement)("div",{className:"wcf-item__thumbnail"},(0,o.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon bg-background-primary p-6 rounded-full"},(0,o.createElement)(KO,{className:"w-7 h-7 stroke-1 text-text-tertiary group-hover:text-brand-300"})))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap border-t border-border-subtle absolute bottom-0 w-full"},(0,o.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows")))),(0,o.createElement)("div",{className:"wcf_item__info flex flex-col gap-6 justify-center w-3/4"},(0,o.createElement)("h3",{className:"wcf_item__info--title text-xl text-text-primary font-semibold"},"bricks-builder"===l&&(0,z.__)("It seems that you are using the Bricks Builder.","cartflows"),"other"===l&&(0,z.__)("It seems that you are using the page builder other than Elementor, Beaver Builder, Block Builder.","cartflows")),(0,o.createElement)("span",{className:"wcf_item__info--desc text-base text-text-secondary font-normal mt-2"},"bricks-builder"===l&&(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"===l&&(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,o.createElement)("span",{className:"mt-2"},(0,o.createElement)("a",{className:"wcf_item__info--doc text-text-secondary hover:text-brand-500 flex items-center gap-2 text-sm",href:getKbDocUrl("https://cartflows.com/docs/how-to-use-cartflows-with-your-own-template/"),target:"_blank",rel:"noreferrer"},(0,z.__)("Learn How ","cartflows"),(0,o.createElement)(xp,{className:"w-18 h-18 stroke-1"})))))))},OH=()=>{const[{page_builder:e}]=g();return"bricks-builder"!==e&&"other"!==e?(0,o.createElement)(AH,null):(0,o.createElement)(TH,{page_builder:e})},LH=function({item:e,setPreviewImageURL:t,currentPreviewID:n,setCurrentPreviewID:r}){const{ID:a,title:i,type:s,thumbnail_image_url:l,featured_image_url:c}=e,u="wcf-item__inner rounded-lg cursor-pointer border border-solid "+(n===a?"!border-brand-500":"border-border-subtle");return(0,o.createElement)("div",{className:"wcf-item wcf-item--preview mb-8"},"pro"===s&&(0,o.createElement)("div",{className:"mb-1"},(0,o.createElement)(Ym,null)),(0,o.createElement)("div",{className:u,onClick:()=>{t(c),r(a)}},(0,o.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,o.createElement)("div",{className:"wcf-item__thumbnail max-h-[200px] overflow-hidden"},(0,o.createElement)("img",{className:"wcf-item__thumbnail-image w-full rounded-lg",src:`${l}`,alt:(0,z.__)("Store Checkout thumbnail","cartflows")}))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap p-4 bg-background-primary border-t border-border-subtle rounded-bl-lg rounded-br-lg"},(0,o.createElement)("div",{className:"wcf-item__step-type text-xs font-normal text-field-placeholder mb-1"},(d=s,{landing:(0,z.__)("Landing","cartflows"),checkout:(0,z.__)("Checkout","cartflows"),thankyou:(0,z.__)("Thank You","cartflows"),optin:(0,z.__)("Opt-In","cartflows"),"optin-thankyou":(0,z.__)("Thank You","cartflows")}[d]||d)),(0,o.createElement)("div",{className:"wcf-item__heading text-text-primary text-sm font-medium"},i))));var d},zH=(0,sp.compose)((0,lp.withSelect)(e=>{const{getPreview:t}=e("wcf/importer");return{preview:t()}}),(0,lp.withDispatch)(e=>{const{setPreview:t}=e("wcf/importer");return{setPreview:t}}))(function({preview:e,setPreview:t}){const{featured_image_url:n,steps:r}=e,a=cartflows_admin.template_library_url+"preview/?flow="+e.ID,s=[];Object.values(r).forEach(function(e){["checkout","thankyou"].includes(e.type)&&s.push(e)});const l=s.length?s[0].ID:"",[c,u]=(0,i.useState)(n),[d,f]=(0,i.useState)(l),[m,p]=(0,i.useState)("");return window.scrollTo(0,0),(0,o.createElement)(i.Fragment,null,(0,o.createElement)("div",{className:"wcf-flow-preview-wrap"},(0,o.createElement)("div",{className:"wcf-flow-preview--header bg-background-primary flex justify-between items-center mb-9 -m-8 sm:px-8 py-6 sm:flex-row flex-col gap-3"},(0,o.createElement)("div",{className:"wcf-flow-preview--left-section flex justify-between items-center gap-4"},(0,o.createElement)(Va,{variant:"ghost",size:"sm",icon:(0,o.createElement)(vH,{className:"w-5 h-5 stroke-2"}),onClick:()=>t({})}),(0,o.createElement)("span",{className:"wcf-flows-header__text sr-only"}," ",(0,z.__)("Back","cartflows")," "),(0,o.createElement)("h3",{className:"text-xl text-text-primary font-semibold"},(0,z.__)("Funnel Preview","cartflows"))),(0,o.createElement)("div",{className:"wcf-flow-preview--right-section"},(0,o.createElement)("div",{className:"wcf-flow-preview__actions flex justify-between items-center gap-4"},(0,o.createElement)(Va,{variant:"outline",size:"md",tag:"a",href:a,target:"_blank",rel:"noreferrer",className:"no-underline",icon:(0,o.createElement)(xp,{className:"w-5 h-5 stroke-2"})},(0,z.__)("Live Preview","cartflows")),(0,o.createElement)(GZ,{preview:e,flowName:(0,z.__)("Store Checkout","cartflows"),inputFieldVisibility:m,setInputFieldVisibility:p,isStoreCheckout:!0})))),(0,o.createElement)("div",{className:"wcf-flow-preview flex sm:flex-row flex-col-reverse p-6 bg-background-primary shadow-sm rounded-md"},(0,o.createElement)("div",{className:"wcf-flow-preview__item w-full sm:w-4/5 sm:px-6 p-0 border-0 border-r border-solid border-border-subtle"},(0,o.createElement)("div",{className:"border border-solid border-border-subtle rounded-lg"},(0,o.createElement)("div",{className:"wcf-window--header bg-background-primary p-2 flex items-center rounded-tl-lg rounded-tr-lg"},(0,o.createElement)("div",{className:"wcf-window--buttons flex justify-start gap-1 items-center w-2/4"},(0,o.createElement)("span",{className:"bg-background-secondary rounded-full p-1"}),(0,o.createElement)("span",{className:"bg-background-secondary rounded-full p-1"}),(0,o.createElement)("span",{className:"bg-background-secondary rounded-full p-1"})),(0,o.createElement)("div",{className:"wcf-window--title capitalize text-xs font-medium text-text-secondary w-2/4 -ml-12"},`${s.find(e=>e.ID===d).type} Page`)),(0,o.createElement)("div",{className:"wcf-flow-preview__inner max-h-screen overflow-y-auto"},(0,o.createElement)("div",{className:"wcf-flow-preview__thumbnail-wrap"},(0,o.createElement)("img",{className:"wcf-flow-preview__thumbnail w-full",src:c,alt:(0,z.__)("Funnel Preview","cartflows")}))))),(0,o.createElement)("div",{className:"wcf-flow-preview__list w-full sm:w-[20%] sm:px-6 p-0"},s.map(e=>(0,o.createElement)(LH,{key:e.ID,item:e,setPreviewImageURL:u,currentPreviewID:d,setCurrentPreviewID:f}))))))}),PH=()=>{const[e,t]=(0,i.useState)("hide"),[n,r]=(0,i.useState)("");return(0,o.createElement)("div",{className:"wcf-flow-library-importer wcf-flow-library--other"},(0,o.createElement)("div",{className:"wcf-flow-library-importer__list bg-background-primary px-10 py-14"},(0,o.createElement)(SH,{visibility:e,setVisibility:t,type:"blank",flowName:n,setFlowName:r}),(0,o.createElement)("div",{className:"wcf-item wcf-item--start-from-blank flex gap-6 mx-auto max-w-4xl"},(0,o.createElement)("div",{className:"wcf-item__inner relative cursor-pointer group bg-gray-25 p-5 text-center flex flex-col border border-border-subtle hover:border-brand-300 rounded-md items-center justify-center h-72 w-2/3",onClick:()=>{t("hide"===e?"show":"hide")}},(0,o.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,o.createElement)("div",{className:"wcf-item__thumbnail"},(0,o.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon bg-background-primary p-6 rounded-full"},(0,o.createElement)(KO,{className:"w-7 h-7 stroke-1 text-text-tertiary group-hover:text-brand-300"})))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap border-t border-border-subtle absolute bottom-0 w-full"},(0,o.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows")))),(0,o.createElement)("div",{className:"wcf_item__info flex flex-col gap-6 justify-center w-3/4"},(0,o.createElement)("h3",{className:"wcf_item__info--title text-xl text-text-primary font-semibold"},(0,o.createElement)("h3",{className:"wcf_item__info--title"},(0,z.__)("No Results Found.","cartflows"))),(0,o.createElement)("span",{className:"wcf_item__info--desc text-base text-text-secondary font-normal mt-2"},(0,z.__)("Don't see a funnel that you would like to import?","cartflows")),(0,o.createElement)("a",{className:"wcf_item__info--doc text-sm text-text-secondary font-normal hover:text-brand-300 flex gap-1",href:getUtmUrl("https://cartflows.com/funnel-suggestions/",{utm_campaign:"suggestions"}),target:"_blank",rel:"noreferrer"},(0,z.__)("Please suggest us ","cartflows"),(0,o.createElement)(xp,{className:"w-5 h-5 stroke-1 text-text-tertiary hover:text-brand-300"}))))))},RH=()=>{const[e,t]=(0,i.useState)("hide"),[n,r]=(0,i.useState)("");return(0,o.createElement)("div",{className:"wcf-flow-importer wcf-search-404"},(0,o.createElement)("div",{className:"wcf-flow-importer__list wcf-items-list wcf-row wcf-flow-row"},(0,o.createElement)(SH,{visibility:e,setVisibility:t,type:"blank",flowName:n,setFlowName:r}),(0,o.createElement)("div",{className:"wcf-item wcf-item__start-from-blank"},(0,o.createElement)("div",{className:"wcf-item__inner",onClick:()=>{t("hide"===e?"show":"hide")}},(0,o.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,o.createElement)("div",{className:"wcf-item__thumbnail"},(0,o.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon"},(0,o.createElement)("span",{className:"wcf-icon dashicons dashicons-plus wcf-icon-start-from-blank"})))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap"},(0,o.createElement)("div",{className:"wcf-item__heading"},(0,z.__)("Start from scratch","cartflows")))),(0,o.createElement)("div",{className:"wcf_item__info"},(0,o.createElement)("h3",{className:"wcf_item__info--title"},(0,z.__)("Oops!!! No template Found.","cartflows")),(0,o.createElement)("span",{className:"wcf_item__info--desc"},(0,z.__)("Seems like no template is available for chosen editor.","cartflows"))))))},UH=(0,sp.compose)((0,lp.withDispatch)(e=>{const{setAllFlows:t}=e("wcf/importer");return{setAllFlows:t}}))(function({setAllFlows:e}){let t="no";const n=(0,b.useHistory)(),[{page_builder:r}]=d(),[a,s]=(0,i.useState)(""),[l,c]=(0,i.useState)(!1),{currentPageBuilderData:u,requiredPluginsData:f,preview:m,store_checkout_flows:p,flows_list:h}=(0,lp.useSelect)(e=>({currentPageBuilderData:e("wcf/importer").getCurrentPageBuilderData(r),requiredPluginsData:e("wcf/importer").getRequiredPluginsData(),preview:e("wcf/importer").getPreview(),store_checkout_flows:e("wcf/importer").getStoreCheckoutFlows(),flows_list:e("wcf/importer").getFlowsList(r)}));if("yes"===f[r]&&u&&u?.plugins&&u?.plugins.map(function(e){return"install"!==e.status&&"activate"!==e.status||(t="yes"),""}),"yes"===t)return(0,o.createElement)(kH,null);(0,i.useEffect)(()=>{let t=!0;if(!p[r]){const n=new window.FormData;n.append("action","cartflows_get_flows_list"),n.append("security",cartflows_admin.get_flows_list_nonce),c(!0),(async()=>{L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(n=>{if(c(!1),t&&n?.data?.flows){const t=Object.values(n.data.flows);w(t),e(t,r)}})})()}return()=>{t=!1}},[p]);const[g,w]=(0,i.useState)(h),[y,v]=(0,i.useState)("hide"),[x,_]=(0,i.useState)("");return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-flow-importer"},Object.keys(m).length?(0,o.createElement)(zH,null):(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-flow-importer__header bg-background-primary px-8 py-6 flex justify-between items-start sm:items-center mb-9 -m-8 sm:flex-row flex-col gap-3"},(0,o.createElement)("h3",{className:"wcf-flow-importer__header-title text-xl font-semibold text-text-primary m-0 flex items-center gap-2"},(0,o.createElement)(Va,{variant:"ghost",size:"xs","aria-label":(0,z.__)("Back to Store Checkout","cartflows"),icon:(0,o.createElement)(HW,{className:"w-6 h-6 stroke-1 text-text-primary"}),onClick:()=>{n.push("admin.php?page=cartflows&path=store-checkout")}}),(0,z.__)("Store Checkout Templates","cartflows")),(0,o.createElement)("div",{className:"wcf-flow-importer__actions gap-4 flex justify-between items-center"},(0,o.createElement)("div",{className:"wcf-flow-importer__actions-content-left"},(0,o.createElement)("div",{className:"wcf-flow-importer__actions-search w-56"},(0,o.createElement)(dp,{type:"text",value:a,onChange:function(e){if(s(e),e&&e.length>=3){const t=e.toLowerCase(),n=h.filter(function(e){return(e.title&&e.title.toLowerCase()||"").includes(t)});w(n)}else w(h)},placeholder:(0,z.__)("Search Templates","cartflows"),size:"md",prefix:(0,o.createElement)(FV,{className:"size-4 text-field-placeholder"}),suffix:a.length>=3?(0,o.createElement)(tL,{className:"size-4 cursor-pointer text-field-placeholder pointer-events-auto",onClick:()=>{s(""),w(h)}}):null}))),(0,o.createElement)("div",{className:"divider w-px bg-border-subtle h-7"}),(0,o.createElement)("div",{className:"wcf-flow-importer__actions-content-right"},(0,o.createElement)("div",{className:"wcf-flow-importer__actions-buttons"},(0,o.createElement)(jH,{template:"store-checkout"}))))),l&&(0,o.createElement)(CH,null),!l&&h.length<1&&g.length<1&&(0,o.createElement)(RH,null),h.length>0&&0===g.length&&(0,o.createElement)(PH,null),!(h.length>0&&0===g.length)&&(0,o.createElement)("div",{className:"wcf-flow-importer__list wcf-items-list grid grid-cols-1 sm:grid-cols-4 gap-6 p-6 bg-background-primary shadow-sm rounded-md"},(0,o.createElement)(SH,{visibility:y,setVisibility:v,type:"blank",flowName:x,setFlowName:_}),(0,o.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-background-primary rounded-lg relative"},(0,o.createElement)("div",{className:"wcf-item__inner relative cursor-pointer bg-background-secondary text-center h-full flex flex-col gap-4 items-center justify-center",onClick:()=>{v("hide"===y?"show":"hide")}},(0,o.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,o.createElement)("div",{className:"wcf-item__thumbnail"},(0,o.createElement)("div",{className:"wcf-flow-importer__start-from-blank-icon bg-background-primary p-6 rounded-full"},(0,o.createElement)(KO,{className:"w-7 h-7 stroke-2 text-text-tertiary"})))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap border-t border-border-subtle absolute bottom-0 w-full"},(0,o.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows"))))),h.length>0&&0<g.length&&g.map(e=>(0,o.createElement)(yH,{key:e.ID,item:e}))))))}),BH=e=>{const t=(0,b.useHistory)(),[n,r]=(0,i.useState)("hide"),[a,s]=(0,i.useState)(""),l=e.page_builder;return(0,o.createElement)("div",{className:"wcf-store-library-importer wcf-store-library--other"},(0,o.createElement)("div",{className:"wcf-store-library-importer__header bg-background-primary px-8 py-6 flex justify-between items-center border-b border-border-subtle"},(0,o.createElement)("div",{className:"wcf-store-importer__header-title text-xl font-semibold text-text-primary m-0 flex items-center gap-2"},(0,o.createElement)(Va,{variant:"ghost",size:"xs","aria-label":(0,z.__)("Back to Store Checkout","cartflows"),icon:(0,o.createElement)(HW,{className:"w-6 h-6 stroke-1 text-text-primary"}),onClick:()=>{t.push("admin.php?page=cartflows&path=store-checkout")}}),(0,z.__)("Start from Scratch","cartflows"))),(0,o.createElement)("div",{className:"wcf-store-library-importer__list bg-background-primary px-10 py-14"},(0,o.createElement)(qZ,{visibility:n,setVisibility:r,type:"blank",flowName:a,setFlowName:s}),(0,o.createElement)("div",{className:"wcf-item wcf-item--start-from-blank flex gap-6 mx-auto max-w-4xl"},(0,o.createElement)("div",{className:"wcf-item__inner relative cursor-pointer group bg-gray-25 p-5 text-center flex flex-col border border-border-subtle hover:border-brand-300 rounded-md items-center justify-center h-72 w-2/3",onClick:()=>{r("hide"===n?"show":"hide")}},(0,o.createElement)("div",{className:"wcf-item__thumbnail-wrap"},(0,o.createElement)("div",{className:"wcf-item__thumbnail"},(0,o.createElement)("div",{className:"wcf-store-importer__start-from-blank-icon bg-background-primary p-6 rounded-full"},(0,o.createElement)(KO,{className:"w-7 h-7 stroke-1 text-text-tertiary group-hover:text-brand-300"})))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap border-t border-border-subtle absolute bottom-0 w-full"},(0,o.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},(0,z.__)("Start from scratch","cartflows")))),(0,o.createElement)("div",{className:"wcf_item__info flex flex-col gap-6 justify-center w-3/4"},(0,o.createElement)("h3",{className:"wcf_item__info--title text-xl text-text-primary font-semibold"},"bricks-builder"===l&&(0,z.__)("It seems that you are using the Bricks Builder.","cartflows"),"other"===l&&(0,z.__)("It seems that you are using the page builder other than Elementor, Beaver Builder, Block Builder.","cartflows")),(0,o.createElement)("span",{className:"wcf_item__info--desc text-base text-text-secondary font-normal mt-2"},"bricks-builder"===l&&(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"===l&&(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,o.createElement)("span",{className:"mt-2"},(0,o.createElement)("a",{className:"wcf_item__info--doc text-text-secondary hover:text-brand-500 flex items-center gap-2 text-sm",href:getKbDocUrl("https://cartflows.com/docs/how-to-use-cartflows-with-your-own-template/"),target:"_blank",rel:"noreferrer"},(0,z.__)("Learn How ","cartflows"),(0,o.createElement)(xp,{className:"w-18 h-18 stroke-1"})))))))},FH=()=>{const[{page_builder:e}]=d();return"other"!==e&&"bricks-builder"!==e?(0,o.createElement)(UH,null):(0,o.createElement)(BH,{page_builder:e})},YH={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:[]},QH=(e,t,n)=>{if(!t)return e;const r=(e.options?.["wcf-order-bumps"]||[]).map(e=>e.id===t?{...e,...n}:e),a=r.find(e=>e.id===t)||null;return{...e,options:{...e.options,"wcf-order-bumps":r},current_ob:a||e.current_ob}},VH=(e,t,n,r)=>{if("wcf-order-bumps"!==n||!Array.isArray(e)||!t)return e;const a=e.findIndex(e=>String(e?.id)===String(t));if(-1===a)return e;const o=e.slice();return o[a]={...o[a],order_bumps:r},o},WH=(e,t)=>{switch(t.type){case"SET_FLOW_DATA":t.data.options.post_title=t.data.title,t.data.options.post_name=t.data.slug;const n={};return Array.isArray(t.data.steps)&&t.data.steps.forEach(e=>{const t=e?.ob_ab_stats;t&&"object"==typeof t&&Object.keys(t).forEach(e=>{n[e]={...n[e]||{},...t[e]}})}),{...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,ob_ab_stats:n},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 r=e.options;return r[t.name]=t.value,{...e,options:r};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 a=[],o=[];e.steps.map(function(e){return"checkout"===e.type&&a.push(e),"landing"===e.type&&o.push(e),""});let i=[];return i=i.concat(a,o),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 l=e.options[t.name].findIndex(e=>e.id===t.ob_id);return e.options[t.name][l].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 c=e.current_ob;return c[t.name]=t.value,{...e,current_ob:c};case"UPDATE_OPTIONS":return{...e,options:t.options};case"ADD_CHECKOUT_PRODUCT":const u=e.options[t.field_name];return u&&(u.push(t.product_data),e.options[t.field_name]=u),{...e};case"ADD_OPTIN_PRODUCT":case"ADD_OFFER_PRODUCT":return e.options[t.field_name]=t.product_data,{...e};case"ADD_OB_PRODUCT":return QH(e,e.current_ob?.id,{product:t.product.product,product_image:t.product.product_image,desc_text:t.product.desc_text});case"REMOVE_OB_PRODUCT":return QH(e,e.current_ob?.id,{product:"",product_image:cartflows_admin.image_placeholder,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."});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,f=e.options[t.field_name];return d&&f&&(e.options[t.field_name]=f.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,steps:VH(e.steps,e.step_id,t.name,t.order_bumps)};case"REMOVE_ORDER_BUMP":const m=t.ob_id,p=e.options[t.name].filter(function(e){return e.id!==m});return e.options[t.name]=p,{...e,steps:VH(e.steps,e.step_id,t.name,p)};case"SET_CURRENT_OB":const h=e.options["wcf-order-bumps"].findIndex(e=>e.id===t.ob_id);return e.options["wcf-order-bumps"][h]=t.current_ob,{...e,ob_id:t.ob_id,current_ob:t.current_ob};case"ADD_NEW_OB_GROUP":const g=e.current_ob[t.name];return g&&(g.push(t.newGroup),e.current_ob[t.name]=g),{...e};case"ADD_NEW_GROUP":const w=e.options[t.name];return w&&(w.push(t.newGroup),e.options[t.name]=w),{...e};case"ADD_NEW_OB_RULE":const y=e.current_ob[t.name],b=t.group_id;if(y&&b){for(const e of y)if(b===e.group_id){e.rules.push(t.newRule);break}e.current_ob[t.name]=y}return{...e};case"ADD_NEW_RULE":const v=e.options[t.name],x=t.group_id;if(v&&x){for(const e of v)if(x===e.group_id){e.rules.push(t.newRule);break}e.options[t.name]=v}return{...e};case"REMOVE_OB_RULE":const _=e.current_ob[t.name];for(let e=0;e<_.length;e++)if(t.group_id===_[e].group_id){const n=_[e].rules;for(let r=0;r<n.length;r++)if(n[r].rule_id===t.rule_id){_[e].rules.splice(r,1);break}0===_[e].rules.length&&_.splice(e,1)}return e.current_ob[t.name]=_,{...e};case"REMOVE_RULE":const E=e.options[t.name];for(let e=0;e<E.length;e++)if(t.group_id===E[e].group_id){const n=E[e].rules;for(let r=0;r<n.length;r++)if(n[r].rule_id===t.rule_id){E[e].rules.splice(r,1);break}0===E[e].rules.length&&E.splice(e,1)}return e.options[t.name]=E,{...e};case"RESET_OB_RULE_VALUE":const N=e.current_ob[t.name];for(const e of N)if(t.group_id===e.group_id){const n=e.rules;for(const e of n)if(t.rule_id===e.rule_id){e.value="";break}break}return e.current_ob[t.name]=N,{...e};case"RESET_RULE_VALUE":const M=e.options[t.name];for(const e of M)if(t.group_id===e.group_id){const n=e.rules;for(const e of n)if(t.rule_id===e.rule_id){e.value="";break}break}return e.options[t.name]=M,{...e};case"SET_RULES_GROUPS":return e.options[t.fieldName]=t.groups,{...e};case"SET_OB_RULES_GROUPS":return e.current_ob[t.fieldName]=t.groups,{...e};case"SET_OB":return e.options[t.fieldName]=t.obs,{...e};case"SET_SURETRIGGERS_CONFIG":return t.config&&setSureTriggersConfig(t.config),{...e,suretriggers_config:t};default:return e}};function ZH({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 6a7.5 7.5 0 1 0 7.5 7.5h-7.5V6Z"}),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 10.5H21A7.5 7.5 0 0 0 13.5 3v7.5Z"}))}const GH=i.forwardRef(ZH);function HH({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"}))}const $H=i.forwardRef(HH);function XH({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 18.75h-9m9 0a3 3 0 0 1 3 3h-15a3 3 0 0 1 3-3m9 0v-3.375c0-.621-.503-1.125-1.125-1.125h-.871M7.5 18.75v-3.375c0-.621.504-1.125 1.125-1.125h.872m5.007 0H9.497m5.007 0a7.454 7.454 0 0 1-.982-3.172M9.497 14.25a7.454 7.454 0 0 0 .981-3.172M5.25 4.236c-.982.143-1.954.317-2.916.52A6.003 6.003 0 0 0 7.73 9.728M5.25 4.236V4.5c0 2.108.966 3.99 2.48 5.228M5.25 4.236V2.721C7.456 2.41 9.71 2.25 12 2.25c2.291 0 4.545.16 6.75.47v1.516M7.73 9.728a6.726 6.726 0 0 0 2.748 1.35m8.272-6.842V4.5c0 2.108-.966 3.99-2.48 5.228m2.48-5.492a46.32 46.32 0 0 1 2.916.52 6.003 6.003 0 0 1-5.395 4.972m0 0a6.726 6.726 0 0 1-2.749 1.35m0 0a6.772 6.772 0 0 1-3.044 0"}))}const qH=i.forwardRef(XH);function JH({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 7.5-2.25-1.313M21 7.5v2.25m0-2.25-2.25 1.313M3 7.5l2.25-1.313M3 7.5l2.25 1.313M3 7.5v2.25m9 3 2.25-1.313M12 12.75l-2.25-1.313M12 12.75V15m0 6.75 2.25-1.313M12 21.75V19.5m0 2.25-2.25-1.313m0-16.875L12 2.25l2.25 1.313M21 14.25v2.25l-2.25 1.313m-13.5 0L3 16.5v-2.25"}))}const KH=i.forwardRef(JH);function e$({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 11.25-3-3m0 0-3 3m3-3v7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}const t$=i.forwardRef(e$),n$=function(e){const{id:t,control_id:n,onClickEvents:r,actions:a,type:i,setShowAbtestUpgradePopup:s=()=>{}}=e,[{license_status:l}]=g();return(0,o.createElement)(Nm,{placement:"bottom-end",className:"wcf-step-row__actions-menu"},(0,o.createElement)(Nm.Trigger,null,(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"text-text-secondary hover:text-text-primary","aria-label":(0,z.__)("More Options","cartflows")},(0,o.createElement)(eU,{className:"h-5 w-5","aria-hidden":"true"}))),(0,o.createElement)(Nm.ContentWrapper,{className:"z-20"},(0,o.createElement)(Nm.Content,{size:"sm",className:"wcf-step-actions-menu__dropdown_menu"},(0,o.createElement)(Nm.List,null,a.map(e=>{var a;const c=e.text;let u=!1,d=!1;if((!wcfCartflowsPro()&&e?.pro||"abtest"===e.slug&&!wcfCartflowsTypePro())&&(u=!0),wcfCartflowsPro()&&e?.pro&&"Activated"!==l&&(d=!0),"automation"===e.slug&&"downsell"!==i&&"upsell"!==i&&"checkout"!==i)return null;const f=u||d,m=f&&"abtest"===e.slug;return(0,o.createElement)(Nm.Item,{key:e?.text,disabled:f&&!m,className:`wcf-step__action-btn hover:!bg-brand-25 hover:!text-brand-600 aria-disabled:!text-text-on-button-disabled aria-disabled:hover:!text-text-on-button-disabled aria-disabled:hover:!bg-transparent ${null!==(a=e.class)&&void 0!==a?a:""} ${m?"!cursor-not-allowed !text-text-on-button-disabled hover:!text-text-on-button-disabled hover:!bg-transparent":""}`,onClick:()=>{if(m)s("show");else if(!f)if("#"===e?.link&&r[e.slug]){const a={preventDefault:()=>{},target:{getAttribute:r=>"data-action"===r?e.ajaxcall:"data-id"===r?t:"data-control-id"===r?n:null},currentTarget:{getAttribute:r=>"data-action"===r?e.ajaxcall:"data-id"===r?t:"data-control-id"===r?n:null}};r[e.slug](a)}else e?.link&&"#"!==e?.link&&(window.location.href=e.link)}},(0,o.createElement)("span",{className:"flex items-center gap-2"},function(e){let t="";switch(e){case"clone":t=(0,o.createElement)(hW,{className:"w-4 h-4 stroke-[1.5]"});break;case"delete":t=(0,o.createElement)(aU,{className:"w-4 h-4 stroke-[1.5]"});break;case"abtest":t=(0,o.createElement)(GH,{className:"w-4 h-4 stroke-[1.5]"});break;case"archived":t=(0,o.createElement)($H,{className:"w-4 h-4 stroke-[1.5]"});break;case"winner":t=(0,o.createElement)(qH,{className:"w-4 h-4 stroke-[1.5]"});break;case"automation":t=(0,o.createElement)(KH,{className:"w-4 h-4 stroke-[1.5]"});break;default:t=(0,o.createElement)(t$,{className:"w-4 h-4 stroke-[1.5]"})}return t}(e.slug),(0,o.createElement)("span",{className:"wcf-step-row__btn-text"},c," ",(u||d)&&(0,o.createElement)("span",{className:"text-brand-600"},(0,z.__)("(Pro)","cartflows")),e?.tag&&(0,o.createElement)("span",{className:"wcf-step-row__btn-text--tag text-brand-brand-600"}," ",e?.tag," "))))})))))},r$="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfNzI3XzIzNzEpIj4KPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjExMiIgaGVpZ2h0PSIxMTIiIHJ4PSI2IiBmaWxsPSIjRjlGQUZCIi8+CjwvZz4KPGNpcmNsZSBjeD0iMTciIGN5PSIxNiIgcj0iMyIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNMTQgMjkuNEMxNCAyNy4xNTk4IDE0IDI2LjAzOTcgMTQuNDM2IDI1LjE4NEMxNC44MTk1IDI0LjQzMTQgMTUuNDMxNCAyMy44MTk1IDE2LjE4NCAyMy40MzZDMTcuMDM5NyAyMyAxOC4xNTk4IDIzIDIwLjQgMjNIMTA3LjZDMTA5Ljg0IDIzIDExMC45NiAyMyAxMTEuODE2IDIzLjQzNkMxMTIuNTY5IDIzLjgxOTUgMTEzLjE4MSAyNC40MzE0IDExMy41NjQgMjUuMTg0QzExNCAyNi4wMzk3IDExNCAyNy4xNTk4IDExNCAyOS40VjU0LjZDMTE0IDU2Ljg0MDIgMTE0IDU3Ljk2MDMgMTEzLjU2NCA1OC44MTZDMTEzLjE4MSA1OS41Njg2IDExMi41NjkgNjAuMTgwNSAxMTEuODE2IDYwLjU2NEMxMTAuOTYgNjEgMTA5Ljg0IDYxIDEwNy42IDYxSDIwLjRDMTguMTU5OCA2MSAxNy4wMzk3IDYxIDE2LjE4NCA2MC41NjRDMTUuNDMxNCA2MC4xODA1IDE0LjgxOTUgNTkuNTY4NiAxNC40MzYgNTguODE2QzE0IDU3Ljk2MDMgMTQgNTYuODQwMiAxNCA1NC42VjI5LjRaIiBmaWxsPSIjRTVFN0VCIi8+CjxjaXJjbGUgY3g9IjkxIiBjeT0iNDIiIHI9IjE1IiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBkPSJNOTAuMDI5MSAzMC45MzI3QzkwLjI3OTQgMjkuOTE4OSA5MS43MjA2IDI5LjkxODkgOTEuOTcwOSAzMC45MzI3TDkzLjgyNTEgMzguNDQzN0M5My45MTQxIDM4LjgwNDMgOTQuMTk1NyAzOS4wODU5IDk0LjU1NjMgMzkuMTc0OUwxMDIuMDY3IDQxLjAyOTFDMTAzLjA4MSA0MS4yNzk0IDEwMy4wODEgNDIuNzIwNiAxMDIuMDY3IDQyLjk3MDlMOTQuNTU2MyA0NC44MjUxQzk0LjE5NTcgNDQuOTE0MSA5My45MTQxIDQ1LjE5NTcgOTMuODI1MSA0NS41NTYzTDkxLjk3MDkgNTMuMDY3M0M5MS43MjA2IDU0LjA4MTEgOTAuMjc5NCA1NC4wODExIDkwLjAyOTEgNTMuMDY3M0w4OC4xNzQ5IDQ1LjU1NjNDODguMDg1OSA0NS4xOTU3IDg3LjgwNDMgNDQuOTE0MSA4Ny40NDM3IDQ0LjgyNTFMNzkuOTMyNyA0Mi45NzA5Qzc4LjkxODkgNDIuNzIwNiA3OC45MTg5IDQxLjI3OTQgNzkuOTMyNyA0MS4wMjkxTDg3LjQ0MzcgMzkuMTc0OUM4Ny44MDQzIDM5LjA4NTkgODguMDg1OSAzOC44MDQzIDg4LjE3NDkgMzguNDQzN0w5MC4wMjkxIDMwLjkzMjdaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjAgMzZDMjAgMzUuNDQ3NyAyMC40NDc3IDM1IDIxIDM1SDUzQzUzLjU1MjMgMzUgNTQgMzUuNDQ3NyA1NCAzNkM1NCAzNi41NTIzIDUzLjU1MjMgMzcgNTMgMzdIMjFDMjAuNDQ3NyAzNyAyMCAzNi41NTIzIDIwIDM2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTIwIDQxQzIwIDQwLjQ0NzcgMjAuNDQ3NyA0MCAyMSA0MEg0NUM0NS41NTIzIDQwIDQ2IDQwLjQ0NzcgNDYgNDFDNDYgNDEuNTUyMyA0NS41NTIzIDQyIDQ1IDQySDIxQzIwLjQ0NzcgNDIgMjAgNDEuNTUyMyAyMCA0MVoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMCA0OEMyMCA0Ni44OTU0IDIxLjA2NiA0NiAyMi4zODEgNDZIMzQuNjE5QzM1LjkzNCA0NiAzNyA0Ni44OTU0IDM3IDQ4QzM3IDQ5LjEwNDYgMzUuOTM0IDUwIDM0LjYxOSA1MEgyMi4zODFDMjEuMDY2IDUwIDIwIDQ5LjEwNDYgMjAgNDhaIiBmaWxsPSIjOUNBM0FGIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTcgMTZDOTcgMTQuODk1NCA5OC4wNjYgMTQgOTkuMzgxIDE0SDExMS42MTlDMTEyLjkzNCAxNCAxMTQgMTQuODk1NCAxMTQgMTZDMTE0IDE3LjEwNDYgMTEyLjkzNCAxOCAxMTEuNjE5IDE4SDk5LjM4MUM5OC4wNjYgMTggOTcgMTcuMTA0NiA5NyAxNloiIGZpbGw9IiM5Q0EzQUYiLz4KPHBhdGggZD0iTTIyIDc5LjRDMjIgNzcuMTU5OCAyMiA3Ni4wMzk3IDIyLjQzNiA3NS4xODRDMjIuODE5NSA3NC40MzE0IDIzLjQzMTQgNzMuODE5NSAyNC4xODQgNzMuNDM2QzI1LjAzOTcgNzMgMjYuMTU5OCA3MyAyOC40IDczSDU0LjZDNTYuODQwMiA3MyA1Ny45NjAzIDczIDU4LjgxNiA3My40MzZDNTkuNTY4NiA3My44MTk1IDYwLjE4MDUgNzQuNDMxNCA2MC41NjQgNzUuMTg0QzYxIDc2LjAzOTcgNjEgNzcuMTU5OCA2MSA3OS40Vjk3LjZDNjEgOTkuODQwMiA2MSAxMDAuOTYgNjAuNTY0IDEwMS44MTZDNjAuMTgwNSAxMDIuNTY5IDU5LjU2ODYgMTAzLjE4MSA1OC44MTYgMTAzLjU2NEM1Ny45NjAzIDEwNCA1Ni44NDAyIDEwNCA1NC42IDEwNEgyOC40QzI2LjE1OTggMTA0IDI1LjAzOTcgMTA0IDI0LjE4NCAxMDMuNTY0QzIzLjQzMTQgMTAzLjE4MSAyMi44MTk1IDEwMi41NjkgMjIuNDM2IDEwMS44MTZDMjIgMTAwLjk2IDIyIDk5Ljg0MDIgMjIgOTcuNlY3OS40WiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDg4QzcwIDg3LjQ0NzcgNzAuNDQ3NyA4NyA3MSA4N0gxMDNDMTAzLjU1MiA4NyAxMDQgODcuNDQ3NyAxMDQgODhDMTA0IDg4LjU1MjMgMTAzLjU1MiA4OSAxMDMgODlINzFDNzAuNDQ3NyA4OSA3MCA4OC41NTIzIDcwIDg4WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDgzQzcwIDgyLjQ0NzcgNzAuNDQ3NyA4MiA3MSA4MkgxMDNDMTAzLjU1MiA4MiAxMDQgODIuNDQ3NyAxMDQgODNDMTA0IDgzLjU1MjMgMTAzLjU1MiA4NCAxMDMgODRINzFDNzAuNDQ3NyA4NCA3MCA4My41NTIzIDcwIDgzWiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDc3QzcwIDc2LjQ0NzcgNzAuNDQ3NyA3NiA3MSA3Nkg4N0M4Ny41NTIzIDc2IDg4IDc2LjQ0NzcgODggNzdDODggNzcuNTUyMyA4Ny41NTIzIDc4IDg3IDc4SDcxQzcwLjQ0NzcgNzggNzAgNzcuNTUyMyA3MCA3N1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03MCA5M0M3MCA5Mi40NDc3IDcwLjQ0NzcgOTIgNzEgOTJIOTVDOTUuNTUyMyA5MiA5NiA5Mi40NDc3IDk2IDkzQzk2IDkzLjU1MjMgOTUuNTUyMyA5NCA5NSA5NEg3MUM3MC40NDc3IDk0IDcwIDkzLjU1MjMgNzAgOTNaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzAgMTAwQzcwIDk4Ljg5NTQgNzEuMDY2IDk4IDcyLjM4MSA5OEg4NC42MTlDODUuOTM0IDk4IDg3IDk4Ljg5NTQgODcgMTAwQzg3IDEwMS4xMDUgODUuOTM0IDEwMiA4NC42MTkgMTAySDcyLjM4MUM3MS4wNjYgMTAyIDcwIDEwMS4xMDUgNzAgMTAwWiIgZmlsbD0iIzlDQTNBRiIvPgo8ZGVmcz4KPGZpbHRlciBpZD0iZmlsdGVyMF9kXzcyN18yMzcxIiB4PSI2IiB5PSI4IiB3aWR0aD0iMTE2IiBoZWlnaHQ9IjExOCIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlTW9ycGhvbG9neSByYWRpdXM9IjQiIG9wZXJhdG9yPSJlcm9kZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MSIvPgo8ZmVPZmZzZXQgZHk9IjQiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIvPgo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMTYgMCIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MSIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MSIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K",a$="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfNzI3XzIzNzMpIj4KPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjExMiIgaGVpZ2h0PSIxMTIiIHJ4PSI2IiBmaWxsPSIjRjlGQUZCIi8+CjwvZz4KPHBhdGggZD0iTTggMTcuNkM4IDE0LjIzOTcgOCAxMi41NTk1IDguNjUzOTYgMTEuMjc2MUM5LjIyOTIgMTAuMTQ3MSAxMC4xNDcxIDkuMjI5MiAxMS4yNzYxIDguNjUzOTZDMTIuNTU5NSA4IDE0LjIzOTcgOCAxNy42IDhIMTEwLjRDMTEzLjc2IDggMTE1LjQ0IDggMTE2LjcyNCA4LjY1Mzk2QzExNy44NTMgOS4yMjkyIDExOC43NzEgMTAuMTQ3MSAxMTkuMzQ2IDExLjI3NjFDMTIwIDEyLjU1OTUgMTIwIDE0LjIzOTcgMTIwIDE3LjZWNDBIOFYxNy42WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMCAyNkMyMCAyNC44OTU0IDIxLjA2NiAyNCAyMi4zODEgMjRIMzQuNjE5QzM1LjkzNCAyNCAzNyAyNC44OTU0IDM3IDI2QzM3IDI3LjEwNDYgMzUuOTM0IDI4IDM0LjYxOSAyOEgyMi4zODFDMjEuMDY2IDI4IDIwIDI3LjEwNDYgMjAgMjZaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjAgMzNDMjAgMzIuNDQ3NyAyMC40NDc3IDMyIDIxIDMySDUzQzUzLjU1MjMgMzIgNTQgMzIuNDQ3NyA1NCAzM0M1NCAzMy41NTIzIDUzLjU1MjMgMzQgNTMgMzRIMjFDMjAuNDQ3NyAzNCAyMCAzMy41NTIzIDIwIDMzWiIgZmlsbD0iI0U1RTdFQiIvPgo8Y2lyY2xlIGN4PSIxNyIgY3k9IjE2IiByPSIzIiBmaWxsPSIjRDFENURCIi8+CjxjaXJjbGUgY3g9Ijk2IiBjeT0iMzEiIHI9IjMiIGZpbGw9IiNFNUU3RUIiLz4KPGNpcmNsZSBjeD0iODciIGN5PSIzMSIgcj0iMyIgZmlsbD0iI0U1RTdFQiIvPgo8Y2lyY2xlIGN4PSIxMDUiIGN5PSIzMSIgcj0iMyIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDE2LjAwMDJDNzAgMTUuNDQ4IDcwLjQ0NzcgMTUuMDAwMiA3MSAxNS4wMDAySDc5Qzc5LjU1MjMgMTUuMDAwMiA4MCAxNS40NDggODAgMTYuMDAwMkM4MCAxNi41NTI1IDc5LjU1MjMgMTcuMDAwMiA3OSAxNy4wMDAySDcxQzcwLjQ0NzcgMTcuMDAwMiA3MCAxNi41NTI1IDcwIDE2LjAwMDJaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNODQgMTYuMDAwMkM4NCAxNS40NDggODQuNDQ3NyAxNS4wMDAyIDg1IDE1LjAwMDJIOTNDOTMuNTUyMyAxNS4wMDAyIDk0IDE1LjQ0OCA5NCAxNi4wMDAyQzk0IDE2LjU1MjUgOTMuNTUyMyAxNy4wMDAyIDkzIDE3LjAwMDJIODVDODQuNDQ3NyAxNy4wMDAyIDg0IDE2LjU1MjUgODQgMTYuMDAwMloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05OCAxNkM5OCAxNS40NDc3IDk4LjQ0NzcgMTUgOTkgMTVIMTA3QzEwNy41NTIgMTUgMTA4IDE1LjQ0NzcgMTA4IDE2QzEwOCAxNi41NTIzIDEwNy41NTIgMTcgMTA3IDE3SDk5Qzk4LjQ0NzcgMTcgOTggMTYuNTUyMyA5OCAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTIwIDU2QzIwIDU0Ljg5NTQgMjAuODk1NCA1NCAyMiA1NEg2M0M2NC4xMDQ2IDU0IDY1IDU0Ljg5NTQgNjUgNTZWNThDNjUgNTkuMTA0NiA2NC4xMDQ2IDYwIDYzIDYwSDIyQzIwLjg5NTQgNjAgMjAgNTkuMTA0NiAyMCA1OFY1NloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTIwIDY2QzIwIDY0Ljg5NTQgMjAuODk1NCA2NCAyMiA2NEg2M0M2NC4xMDQ2IDY0IDY1IDY0Ljg5NTQgNjUgNjZWNjhDNjUgNjkuMTA0NiA2NC4xMDQ2IDcwIDYzIDcwSDIyQzIwLjg5NTQgNzAgMjAgNjkuMTA0NiAyMCA2OFY2NloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTIwIDg2QzIwIDg0Ljg5NTQgMjAuODk1NCA4NCAyMiA4NEg2M0M2NC4xMDQ2IDg0IDY1IDg0Ljg5NTQgNjUgODZWOThDNjUgOTkuMTA0NiA2NC4xMDQ2IDEwMCA2MyAxMDBIMjJDMjAuODk1NCAxMDAgMjAgOTkuMTA0NiAyMCA5OFY4NloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0yMCA0OUMyMCA0OC40NDc3IDIwLjQ0NzcgNDggMjEgNDhIMzdDMzcuNTUyMyA0OCAzOCA0OC40NDc3IDM4IDQ5QzM4IDQ5LjU1MjMgMzcuNTUyMyA1MCAzNyA1MEgyMUMyMC40NDc3IDUwIDIwIDQ5LjU1MjMgMjAgNDlaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjAgNzlDMjAgNzguNDQ3NyAyMC40NDc3IDc4IDIxIDc4SDM3QzM3LjU1MjMgNzggMzggNzguNDQ3NyAzOCA3OUMzOCA3OS41NTIzIDM3LjU1MjMgODAgMzcgODBIMjFDMjAuNDQ3NyA4MCAyMCA3OS41NTIzIDIwIDc5WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNMjAgMTA2QzIwIDEwNC44OTUgMjAuODk1NCAxMDQgMjIgMTA0SDYzQzY0LjEwNDYgMTA0IDY1IDEwNC44OTUgNjUgMTA2VjEwOEM2NSAxMDkuMTA1IDY0LjEwNDYgMTEwIDYzIDExMEgyMkMyMC44OTU0IDExMCAyMCAxMDkuMTA1IDIwIDEwOFYxMDZaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGQ9Ik03NCA5M0M3NCA5MS44OTU0IDc0Ljg5NTQgOTEgNzYgOTFIOTNDOTQuMTA0NiA5MSA5NSA5MS44OTU0IDk1IDkzVjk1Qzk1IDk2LjEwNDYgOTQuMTA0NiA5NyA5MyA5N0g3NkM3NC44OTU0IDk3IDc0IDk2LjEwNDYgNzQgOTVWOTNaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik05NyA5M0M5NyA5MS44OTU0IDk3Ljg5NTQgOTEgOTkgOTFIMTA2QzEwNy4xMDUgOTEgMTA4IDkxLjg5NTQgMTA4IDkzVjk1QzEwOCA5Ni4xMDQ2IDEwNy4xMDUgOTcgMTA2IDk3SDk5Qzk3Ljg5NTQgOTcgOTcgOTYuMTA0NiA5NyA5NVY5M1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZD0iTTc0IDU2Qzc0IDU0Ljg5NTQgNzQuODk1NCA1NCA3NiA1NEgxMDZDMTA3LjEwNSA1NCAxMDggNTQuODk1NCAxMDggNTZWODRDMTA4IDg1LjEwNDYgMTA3LjEwNSA4NiAxMDYgODZINzZDNzQuODk1NCA4NiA3NCA4NS4xMDQ2IDc0IDg0VjU2WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03NiA1M0gxMDZDMTA3LjY1NyA1MyAxMDkgNTQuMzQzMSAxMDkgNTZWODRDMTA5IDg1LjY1NjkgMTA3LjY1NyA4NyAxMDYgODdINzZDNzQuMzQzMSA4NyA3MyA4NS42NTY5IDczIDg0VjU2QzczIDU0LjM0MzEgNzQuMzQzMSA1MyA3NiA1M1pNNzYgNTRDNzQuODk1NCA1NCA3NCA1NC44OTU0IDc0IDU2Vjg0Qzc0IDg1LjEwNDYgNzQuODk1NCA4NiA3NiA4NkgxMDZDMTA3LjEwNSA4NiAxMDggODUuMTA0NiAxMDggODRWNTZDMTA4IDU0Ljg5NTQgMTA3LjEwNSA1NCAxMDYgNTRINzZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzcgODFDNzcgODAuNDQ3NyA3Ny40NDc3IDgwIDc4IDgwSDgzQzgzLjU1MjMgODAgODQgODAuNDQ3NyA4NCA4MUM4NCA4MS41NTIzIDgzLjU1MjMgODIgODMgODJINzhDNzcuNDQ3NyA4MiA3NyA4MS41NTIzIDc3IDgxWiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTc3IDc2Qzc3IDc1LjQ0NzcgNzcuNDQ3NyA3NSA3OCA3NUg4N0M4Ny41NTIzIDc1IDg4IDc1LjQ0NzcgODggNzZDODggNzYuNTUyMyA4Ny41NTIzIDc3IDg3IDc3SDc4Qzc3LjQ0NzcgNzcgNzcgNzYuNTUyMyA3NyA3NloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik04NiA2NkM4NiA2NS40NDc3IDg2LjQ0NzcgNjUgODcgNjVIOTRDOTQuNTUyMyA2NSA5NSA2NS40NDc3IDk1IDY2Qzk1IDY2LjU1MjMgOTQuNTUyMyA2NyA5NCA2N0g4N0M4Ni40NDc3IDY3IDg2IDY2LjU1MjMgODYgNjZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNODYgNjlDODYgNjguNDQ3NyA4Ni40NDc3IDY4IDg3IDY4SDg4Qzg4LjU1MjMgNjggODkgNjguNDQ3NyA4OSA2OUM4OSA2OS41NTIzIDg4LjU1MjMgNzAgODggNzBIODdDODYuNDQ3NyA3MCA4NiA2OS41NTIzIDg2IDY5WiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTc3IDU5Qzc3IDU4LjQ0NzcgNzcuNDQ3NyA1OCA3OCA1OEg4NUM4NS41NTIzIDU4IDg2IDU4LjQ0NzcgODYgNTlDODYgNTkuNTUyMyA4NS41NTIzIDYwIDg1IDYwSDc4Qzc3LjQ0NzcgNjAgNzcgNTkuNTUyMyA3NyA1OVoiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05NyA4MUM5NyA4MC40NDc3IDk3LjQ0NzcgODAgOTggODBIMTA0QzEwNC41NTIgODAgMTA1IDgwLjQ0NzcgMTA1IDgxQzEwNSA4MS41NTIzIDEwNC41NTIgODIgMTA0IDgySDk4Qzk3LjQ0NzcgODIgOTcgODEuNTUyMyA5NyA4MVoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05OSA3NkM5OSA3NS40NDc3IDk5LjQ0NzcgNzUgMTAwIDc1SDEwNEMxMDQuNTUyIDc1IDEwNSA3NS40NDc3IDEwNSA3NkMxMDUgNzYuNTUyMyAxMDQuNTUyIDc3IDEwNCA3N0gxMDBDOTkuNDQ3NyA3NyA5OSA3Ni41NTIzIDk5IDc2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTk5IDY4Qzk5IDY3LjQ0NzcgOTkuNDQ3NyA2NyAxMDAgNjdIMTA0QzEwNC41NTIgNjcgMTA1IDY3LjQ0NzcgMTA1IDY4QzEwNSA2OC41NTIzIDEwNC41NTIgNjkgMTA0IDY5SDEwMEM5OS40NDc3IDY5IDk5IDY4LjU1MjMgOTkgNjhaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTcgNTlDOTcgNTguNDQ3NyA5Ny40NDc3IDU4IDk4IDU4SDEwNEMxMDQuNTUyIDU4IDEwNSA1OC40NDc3IDEwNSA1OUMxMDUgNTkuNTUyMyAxMDQuNTUyIDYwIDEwNCA2MEg5OEM5Ny40NDc3IDYwIDk3IDU5LjU1MjMgOTcgNTlaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGQ9Ik03NyA2NkM3NyA2NC44OTU0IDc3Ljg5NTQgNjQgNzkgNjRIODJDODMuMTA0NiA2NCA4NCA2NC44OTU0IDg0IDY2VjY5Qzg0IDcwLjEwNDYgODMuMTA0NiA3MSA4MiA3MUg3OUM3Ny44OTU0IDcxIDc3IDcwLjEwNDYgNzcgNjlWNjZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzMgNDlDNzMgNDguNDQ3NyA3My40NDc3IDQ4IDc0IDQ4SDkwQzkwLjU1MjMgNDggOTEgNDguNDQ3NyA5MSA0OUM5MSA0OS41NTIzIDkwLjU1MjMgNTAgOTAgNTBINzRDNzMuNDQ3NyA1MCA3MyA0OS41NTIzIDczIDQ5WiIgZmlsbD0iI0QxRDVEQiIvPgo8ZGVmcz4KPGZpbHRlciBpZD0iZmlsdGVyMF9kXzcyN18yMzczIiB4PSI2IiB5PSI4IiB3aWR0aD0iMTE2IiBoZWlnaHQ9IjExOCIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlTW9ycGhvbG9neSByYWRpdXM9IjQiIG9wZXJhdG9yPSJlcm9kZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MyIvPgo8ZmVPZmZzZXQgZHk9IjQiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIvPgo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMTYgMCIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MyIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd183MjdfMjM3MyIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K",o$="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfMTAzM18xMDEyNSkiPgo8cmVjdCB4PSI4IiB5PSI4IiB3aWR0aD0iMTEyIiBoZWlnaHQ9IjExMiIgcng9IjYiIGZpbGw9IiNGOUZBRkIiLz4KPC9nPgo8Y2lyY2xlIGN4PSIxNyIgY3k9IjE2IiByPSIzIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNODQgMTZDODQgMTUuNDQ3NyA4NC40NDc3IDE1IDg1IDE1SDkzQzkzLjU1MjMgMTUgOTQgMTUuNDQ3NyA5NCAxNkM5NCAxNi41NTIzIDkzLjU1MjMgMTcgOTMgMTdIODVDODQuNDQ3NyAxNyA4NCAxNi41NTIzIDg0IDE2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDE2QzcwIDE1LjQ0NzcgNzAuNDQ3NyAxNSA3MSAxNUg3OUM3OS41NTIzIDE1IDgwIDE1LjQ0NzcgODAgMTZDODAgMTYuNTUyMyA3OS41NTIzIDE3IDc5IDE3SDcxQzcwLjQ0NzcgMTcgNzAgMTYuNTUyMyA3MCAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik05OCAxNkM5OCAxNS40NDc3IDk4LjQ0NzcgMTUgOTkgMTVIMTA3QzEwNy41NTIgMTUgMTA4IDE1LjQ0NzcgMTA4IDE2QzEwOCAxNi41NTIzIDEwNy41NTIgMTcgMTA3IDE3SDk5Qzk4LjQ0NzcgMTcgOTggMTYuNTUyMyA5OCAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZD0iTTI3IDUxQzI3IDQ4Ljc5MDkgMjguNzkwOSA0NyAzMSA0N0g5N0M5OS4yMDkxIDQ3IDEwMSA0OC43OTA5IDEwMSA1MVY3OUMxMDEgODEuMjA5MSA5OS4yMDkxIDgzIDk3IDgzSDMxQzI4Ljc5MDkgODMgMjcgODEuMjA5MSAyNyA3OVY1MVoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMzEgNDZIOTdDOTkuNzYxNCA0NiAxMDIgNDguMjM4NiAxMDIgNTFWNzlDMTAyIDgxLjc2MTQgOTkuNzYxNCA4NCA5NyA4NEgzMUMyOC4yMzg2IDg0IDI2IDgxLjc2MTQgMjYgNzlWNTFDMjYgNDguMjM4NiAyOC4yMzg2IDQ2IDMxIDQ2Wk0zMSA0N0MyOC43OTA5IDQ3IDI3IDQ4Ljc5MDkgMjcgNTFWNzlDMjcgODEuMjA5MSAyOC43OTA5IDgzIDMxIDgzSDk3Qzk5LjIwOTEgODMgMTAxIDgxLjIwOTEgMTAxIDc5VjUxQzEwMSA0OC43OTA5IDk5LjIwOTEgNDcgOTcgNDdIMzFaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik0zMCA1My4yQzMwIDUyLjA3OTkgMzAgNTEuNTE5OCAzMC4yMTggNTEuMDkyQzMwLjQwOTcgNTAuNzE1NyAzMC43MTU3IDUwLjQwOTcgMzEuMDkyIDUwLjIxOEMzMS41MTk4IDUwIDMyLjA3OTkgNTAgMzMuMiA1MEg1Ni44QzU3LjkyMDEgNTAgNTguNDgwMiA1MCA1OC45MDggNTAuMjE4QzU5LjI4NDMgNTAuNDA5NyA1OS41OTAzIDUwLjcxNTcgNTkuNzgyIDUxLjA5MkM2MCA1MS41MTk4IDYwIDUyLjA3OTkgNjAgNTMuMlY3Ni44QzYwIDc3LjkyMDEgNjAgNzguNDgwMiA1OS43ODIgNzguOTA4QzU5LjU5MDMgNzkuMjg0MyA1OS4yODQzIDc5LjU5MDMgNTguOTA4IDc5Ljc4MkM1OC40ODAyIDgwIDU3LjkyMDEgODAgNTYuOCA4MEgzMy4yQzMyLjA3OTkgODAgMzEuNTE5OCA4MCAzMS4wOTIgNzkuNzgyQzMwLjcxNTcgNzkuNTkwMyAzMC40MDk3IDc5LjI4NDMgMzAuMjE4IDc4LjkwOEMzMCA3OC40ODAyIDMwIDc3LjkyMDEgMzAgNzYuOFY1My4yWiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYzIDYzQzYzIDYyLjQ0NzcgNjMuNDQ3NyA2MiA2NCA2Mkg4OEM4OC41NTIzIDYyIDg5IDYyLjQ0NzcgODkgNjNDODkgNjMuNTUyMyA4OC41NTIzIDY0IDg4IDY0SDY0QzYzLjQ0NzcgNjQgNjMgNjMuNTUyMyA2MyA2M1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02MyA1OUM2MyA1OC40NDc3IDYzLjQ0NzcgNTggNjQgNThIOTRDOTQuNTUyMyA1OCA5NSA1OC40NDc3IDk1IDU5Qzk1IDU5LjU1MjMgOTQuNTUyMyA2MCA5NCA2MEg2NEM2My40NDc3IDYwIDYzIDU5LjU1MjMgNjMgNTlaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNjMgNTRDNjMgNTMuNDQ3NyA2My40NDc3IDUzIDY0IDUzSDc2Qzc2LjU1MjMgNTMgNzcgNTMuNDQ3NyA3NyA1NEM3NyA1NC41NTIzIDc2LjU1MjMgNTUgNzYgNTVINjRDNjMuNDQ3NyA1NSA2MyA1NC41NTIzIDYzIDU0WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTgzIDc1QzgzIDc0LjQ0NzcgODMuMzUxOCA3NCA4My43ODU3IDc0SDkzLjIxNDNDOTMuNjQ4MiA3NCA5NCA3NC40NDc3IDk0IDc1Qzk0IDc1LjU1MjMgOTMuNjQ4MiA3NiA5My4yMTQzIDc2SDgzLjc4NTdDODMuMzUxOCA3NiA4MyA3NS41NTIzIDgzIDc1WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYzIDY4QzYzIDY3LjQ0NzcgNjMuNDQ3NyA2NyA2NCA2N0g2NkM2Ni41NTIzIDY3IDY3IDY3LjQ0NzcgNjcgNjhDNjcgNjguNTUyMyA2Ni41NTIzIDY5IDY2IDY5SDY0QzYzLjQ0NzcgNjkgNjMgNjguNTUyMyA2MyA2OFoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02OSA2OEM2OSA2Ny40NDc3IDY5LjQ0NzcgNjcgNzAgNjdINzNDNzMuNTUyMyA2NyA3NCA2Ny40NDc3IDc0IDY4Qzc0IDY4LjU1MjMgNzMuNTUyMyA2OSA3MyA2OUg3MEM2OS40NDc3IDY5IDY5IDY4LjU1MjMgNjkgNjhaIiBmaWxsPSIjOUNBM0FGIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNjMgNzVDNjMgNzMuODk1NCA2NC4wNjYgNzMgNjUuMzgxIDczSDc3LjYxOUM3OC45MzQgNzMgODAgNzMuODk1NCA4MCA3NUM4MCA3Ni4xMDQ2IDc4LjkzNCA3NyA3Ny42MTkgNzdINjUuMzgxQzY0LjA2NiA3NyA2MyA3Ni4xMDQ2IDYzIDc1WiIgZmlsbD0iIzlDQTNBRiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTQ4IDM3QzQ4IDM2LjQ0NzcgNDguNDQ3NyAzNiA0OSAzNkg3OUM3OS41NTIzIDM2IDgwIDM2LjQ0NzcgODAgMzdDODAgMzcuNTUyMyA3OS41NTIzIDM4IDc5IDM4SDQ5QzQ4LjQ0NzcgMzggNDggMzcuNTUyMyA0OCAzN1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik01NyAzMkM1NyAzMS40NDc3IDU3LjQ0NzcgMzEgNTggMzFINzBDNzAuNTUyMyAzMSA3MSAzMS40NDc3IDcxIDMyQzcxIDMyLjU1MjMgNzAuNTUyMyAzMyA3MCAzM0g1OEM1Ny40NDc3IDMzIDU3IDMyLjU1MjMgNTcgMzJaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGQ9Ik00NC4wMjYxIDU0LjE4MjdDNDQuMjY2MSA1My4xNTE4IDQ1LjczMzkgNTMuMTUxOCA0NS45NzM5IDU0LjE4MjdMNDcuNDQ4NiA2MC41MTZDNDcuNTYxNCA2MS4wMDAxIDQ4LjAxMjYgNjEuMzI4IDQ4LjUwNzkgNjEuMjg1Nkw1NC45ODY5IDYwLjczMUM1Ni4wNDE1IDYwLjY0MDcgNTYuNDk1MSA2Mi4wMzY3IDU1LjU4ODggNjIuNTgzNkw1MC4wMjEyIDY1Ljk0MzJDNDkuNTk1NiA2Ni4yIDQ5LjQyMzMgNjYuNzMwNCA0OS42MTY2IDY3LjE4ODRMNTIuMTQ2MiA3My4xNzg5QzUyLjU1NzkgNzQuMTU0IDUxLjM3MDUgNzUuMDE2OCA1MC41NzAzIDc0LjMyMzhMNDUuNjU0NiA3MC4wNjY5QzQ1LjI3ODkgNjkuNzQxNSA0NC43MjExIDY5Ljc0MTUgNDQuMzQ1NCA3MC4wNjY5TDM5LjQyOTcgNzQuMzIzOEMzOC42Mjk1IDc1LjAxNjggMzcuNDQyMSA3NC4xNTQgMzcuODUzOCA3My4xNzg5TDQwLjM4MzQgNjcuMTg4NEM0MC41NzY3IDY2LjczMDQgNDAuNDA0NCA2Ni4yIDM5Ljk3ODggNjUuOTQzMkwzNC40MTEyIDYyLjU4MzZDMzMuNTA0OSA2Mi4wMzY3IDMzLjk1ODQgNjAuNjQwNyAzNS4wMTMxIDYwLjczMUw0MS40OTIxIDYxLjI4NTZDNDEuOTg3NCA2MS4zMjggNDIuNDM4NiA2MS4wMDAxIDQyLjU1MTQgNjAuNTE2TDQ0LjAyNjEgNTQuMTgyN1oiIGZpbGw9IiNEMUQ1REIiLz4KPGRlZnM+CjxmaWx0ZXIgaWQ9ImZpbHRlcjBfZF8xMDMzXzEwMTI1IiB4PSI2IiB5PSI4IiB3aWR0aD0iMTE2IiBoZWlnaHQ9IjExOCIgZmlsdGVyVW5pdHM9InVzZXJTcGFjZU9uVXNlIiBjb2xvci1pbnRlcnBvbGF0aW9uLWZpbHRlcnM9InNSR0IiPgo8ZmVGbG9vZCBmbG9vZC1vcGFjaXR5PSIwIiByZXN1bHQ9IkJhY2tncm91bmRJbWFnZUZpeCIvPgo8ZmVDb2xvck1hdHJpeCBpbj0iU291cmNlQWxwaGEiIHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAxMjcgMCIgcmVzdWx0PSJoYXJkQWxwaGEiLz4KPGZlTW9ycGhvbG9neSByYWRpdXM9IjQiIG9wZXJhdG9yPSJlcm9kZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd18xMDMzXzEwMTI1Ii8+CjxmZU9mZnNldCBkeT0iNCIvPgo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIi8+CjxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9Im91dCIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4xNiAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzEwMzNfMTAxMjUiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbj0iU291cmNlR3JhcGhpYyIgaW4yPSJlZmZlY3QxX2Ryb3BTaGFkb3dfMTAzM18xMDEyNSIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K",i$="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfMzI1Ml8xMjc0MDIpIj4KPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjExMiIgaGVpZ2h0PSIxMTIiIHJ4PSI2IiBmaWxsPSIjRjlGQUZCIi8+CjwvZz4KPGNpcmNsZSBjeD0iMTciIGN5PSIxNiIgcj0iMyIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTg0IDE2Qzg0IDE1LjQ0NzcgODQuNDQ3NyAxNSA4NSAxNUg5M0M5My41NTIzIDE1IDk0IDE1LjQ0NzcgOTQgMTZDOTQgMTYuNTUyMyA5My41NTIzIDE3IDkzIDE3SDg1Qzg0LjQ0NzcgMTcgODQgMTYuNTUyMyA4NCAxNloiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03MCAxNkM3MCAxNS40NDc3IDcwLjQ0NzcgMTUgNzEgMTVINzlDNzkuNTUyMyAxNSA4MCAxNS40NDc3IDgwIDE2QzgwIDE2LjU1MjMgNzkuNTUyMyAxNyA3OSAxN0g3MUM3MC40NDc3IDE3IDcwIDE2LjU1MjMgNzAgMTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTggMTZDOTggMTUuNDQ3NyA5OC40NDc3IDE1IDk5IDE1SDEwN0MxMDcuNTUyIDE1IDEwOCAxNS40NDc3IDEwOCAxNkMxMDggMTYuNTUyMyAxMDcuNTUyIDE3IDEwNyAxN0g5OUM5OC40NDc3IDE3IDk4IDE2LjU1MjMgOTggMTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik0yNyA1MUMyNyA0OC43OTA5IDI4Ljc5MDkgNDcgMzEgNDdIOTdDOTkuMjA5MSA0NyAxMDEgNDguNzkwOSAxMDEgNTFWNzlDMTAxIDgxLjIwOTEgOTkuMjA5MSA4MyA5NyA4M0gzMUMyOC43OTA5IDgzIDI3IDgxLjIwOTEgMjcgNzlWNTFaIiBmaWxsPSJ3aGl0ZSIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMxIDQ2SDk3Qzk5Ljc2MTQgNDYgMTAyIDQ4LjIzODYgMTAyIDUxVjc5QzEwMiA4MS43NjE0IDk5Ljc2MTQgODQgOTcgODRIMzFDMjguMjM4NiA4NCAyNiA4MS43NjE0IDI2IDc5VjUxQzI2IDQ4LjIzODYgMjguMjM4NiA0NiAzMSA0NlpNMzEgNDdDMjguNzkwOSA0NyAyNyA0OC43OTA5IDI3IDUxVjc5QzI3IDgxLjIwOTEgMjguNzkwOSA4MyAzMSA4M0g5N0M5OS4yMDkxIDgzIDEwMSA4MS4yMDkxIDEwMSA3OVY1MUMxMDEgNDguNzkwOSA5OS4yMDkxIDQ3IDk3IDQ3SDMxWiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBkPSJNMzAgNTMuMkMzMCA1Mi4wNzk5IDMwIDUxLjUxOTggMzAuMjE4IDUxLjA5MkMzMC40MDk3IDUwLjcxNTcgMzAuNzE1NyA1MC40MDk3IDMxLjA5MiA1MC4yMThDMzEuNTE5OCA1MCAzMi4wNzk5IDUwIDMzLjIgNTBINTYuOEM1Ny45MjAxIDUwIDU4LjQ4MDIgNTAgNTguOTA4IDUwLjIxOEM1OS4yODQzIDUwLjQwOTcgNTkuNTkwMyA1MC43MTU3IDU5Ljc4MiA1MS4wOTJDNjAgNTEuNTE5OCA2MCA1Mi4wNzk5IDYwIDUzLjJWNzYuOEM2MCA3Ny45MjAxIDYwIDc4LjQ4MDIgNTkuNzgyIDc4LjkwOEM1OS41OTAzIDc5LjI4NDMgNTkuMjg0MyA3OS41OTAzIDU4LjkwOCA3OS43ODJDNTguNDgwMiA4MCA1Ny45MjAxIDgwIDU2LjggODBIMzMuMkMzMi4wNzk5IDgwIDMxLjUxOTggODAgMzEuMDkyIDc5Ljc4MkMzMC43MTU3IDc5LjU5MDMgMzAuNDA5NyA3OS4yODQzIDMwLjIxOCA3OC45MDhDMzAgNzguNDgwMiAzMCA3Ny45MjAxIDMwIDc2LjhWNTMuMloiIGZpbGw9IiNFNUU3RUIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02MyA2M0M2MyA2Mi40NDc3IDYzLjQ0NzcgNjIgNjQgNjJIODhDODguNTUyMyA2MiA4OSA2Mi40NDc3IDg5IDYzQzg5IDYzLjU1MjMgODguNTUyMyA2NCA4OCA2NEg2NEM2My40NDc3IDY0IDYzIDYzLjU1MjMgNjMgNjNaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNjMgNTlDNjMgNTguNDQ3NyA2My40NDc3IDU4IDY0IDU4SDk0Qzk0LjU1MjMgNTggOTUgNTguNDQ3NyA5NSA1OUM5NSA1OS41NTIzIDk0LjU1MjMgNjAgOTQgNjBINjRDNjMuNDQ3NyA2MCA2MyA1OS41NTIzIDYzIDU5WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYzIDU0QzYzIDUzLjQ0NzcgNjMuNDQ3NyA1MyA2NCA1M0g3NkM3Ni41NTIzIDUzIDc3IDUzLjQ0NzcgNzcgNTRDNzcgNTQuNTUyMyA3Ni41NTIzIDU1IDc2IDU1SDY0QzYzLjQ0NzcgNTUgNjMgNTQuNTUyMyA2MyA1NFoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02MyA2OEM2MyA2Ny40NDc3IDYzLjQ0NzcgNjcgNjQgNjdINjZDNjYuNTUyMyA2NyA2NyA2Ny40NDc3IDY3IDY4QzY3IDY4LjU1MjMgNjYuNTUyMyA2OSA2NiA2OUg2NEM2My40NDc3IDY5IDYzIDY4LjU1MjMgNjMgNjhaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNjkgNjhDNjkgNjcuNDQ3NyA2OS40NDc3IDY3IDcwIDY3SDczQzczLjU1MjMgNjcgNzQgNjcuNDQ3NyA3NCA2OEM3NCA2OC41NTIzIDczLjU1MjMgNjkgNzMgNjlINzBDNjkuNDQ3NyA2OSA2OSA2OC41NTIzIDY5IDY4WiIgZmlsbD0iIzlDQTNBRiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTYzIDc1QzYzIDczLjg5NTQgNjQuMDY2IDczIDY1LjM4MSA3M0g4MS42MTlDODIuOTM0IDczIDg0IDczLjg5NTQgODQgNzVDODQgNzYuMTA0NiA4Mi45MzQgNzcgODEuNjE5IDc3SDY1LjM4MUM2NC4wNjYgNzcgNjMgNzYuMTA0NiA2MyA3NVoiIGZpbGw9IiM5Q0EzQUYiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00OCAzN0M0OCAzNi40NDc3IDQ4LjQ0NzcgMzYgNDkgMzZINzlDNzkuNTUyMyAzNiA4MCAzNi40NDc3IDgwIDM3QzgwIDM3LjU1MjMgNzkuNTUyMyAzOCA3OSAzOEg0OUM0OC40NDc3IDM4IDQ4IDM3LjU1MjMgNDggMzdaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNTcgMzJDNTcgMzEuNDQ3NyA1Ny40NDc3IDMxIDU4IDMxSDcwQzcwLjU1MjMgMzEgNzEgMzEuNDQ3NyA3MSAzMkM3MSAzMi41NTIzIDcwLjU1MjMgMzMgNzAgMzNINThDNTcuNDQ3NyAzMyA1NyAzMi41NTIzIDU3IDMyWiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNNDMuMDY4OCA1Ny4xNzI3QzQzLjYwMDEgNTUuMTk5MyA0Ni4zOTk5IDU1LjE5OTMgNDYuOTMxMiA1Ny4xNzI3TDQ3Ljg4MjYgNjAuNzA2MUM0OC4wNjc5IDYxLjM5NDQgNDguNjA1NiA2MS45MzIxIDQ5LjI5MzkgNjIuMTE3NEw1Mi44MjczIDYzLjA2ODhDNTQuODAwNyA2My42MDAxIDU0LjgwMDcgNjYuMzk5OSA1Mi44MjczIDY2LjkzMTJMNDkuMjkzOSA2Ny44ODI2QzQ4LjYwNTYgNjguMDY3OSA0OC4wNjc5IDY4LjYwNTYgNDcuODgyNiA2OS4yOTM5TDQ2LjkzMTIgNzIuODI3M0M0Ni4zOTk5IDc0LjgwMDcgNDMuNjAwMSA3NC44MDA3IDQzLjA2ODggNzIuODI3M0w0Mi4xMTc0IDY5LjI5MzlDNDEuOTMyMSA2OC42MDU2IDQxLjM5NDQgNjguMDY3OSA0MC43MDYxIDY3Ljg4MjZMMzcuMTcyNyA2Ni45MzEyQzM1LjE5OTMgNjYuMzk5OSAzNS4xOTkzIDYzLjYwMDEgMzcuMTcyNyA2My4wNjg4TDQwLjcwNjEgNjIuMTE3NEM0MS4zOTQ0IDYxLjkzMjEgNDEuOTMyMSA2MS4zOTQ0IDQyLjExNzQgNjAuNzA2MUw0My4wNjg4IDU3LjE3MjdaIiBmaWxsPSIjRDFENURCIi8+CjxkZWZzPgo8ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfMzI1Ml8xMjc0MDIiIHg9IjYiIHk9IjgiIHdpZHRoPSIxMTYiIGhlaWdodD0iMTE4IiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iNCIgb3BlcmF0b3I9ImVyb2RlIiBpbj0iU291cmNlQWxwaGEiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzMyNTJfMTI3NDAyIi8+CjxmZU9mZnNldCBkeT0iNCIvPgo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIi8+CjxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9Im91dCIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4xNiAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzMyNTJfMTI3NDAyIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW49IlNvdXJjZUdyYXBoaWMiIGluMj0iZWZmZWN0MV9kcm9wU2hhZG93XzMyNTJfMTI3NDAyIiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8L2RlZnM+Cjwvc3ZnPgo=",s$="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfMjEzNl8xMjUzNjgpIj4KPHJlY3QgeD0iOCIgeT0iOCIgd2lkdGg9IjExMiIgaGVpZ2h0PSIxMTIiIHJ4PSI2IiBmaWxsPSIjRjlGQUZCIi8+CjwvZz4KPHBhdGggZD0iTTggMTcuNkM4IDE0LjIzOTcgOCAxMi41NTk1IDguNjUzOTYgMTEuMjc2MUM5LjIyOTIgMTAuMTQ3MSAxMC4xNDcxIDkuMjI5MiAxMS4yNzYxIDguNjUzOTZDMTIuNTU5NSA4IDE0LjIzOTcgOCAxNy42IDhINDZWNzAuNEM0NiA3My43NjAzIDQ2IDc1LjQ0MDUgNDUuMzQ2IDc2LjcyMzlDNDQuNzcwOCA3Ny44NTI5IDQzLjg1MjkgNzguNzcwOCA0Mi43MjM5IDc5LjM0NkM0MS40NDA1IDgwIDM5Ljc2MDMgODAgMzYuNCA4MEg4VjE3LjZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik03MCAzNkM3MCAzNC44OTU0IDcwLjg5NTQgMzQgNzIgMzRIMTA4QzEwOS4xMDUgMzQgMTEwIDM0Ljg5NTQgMTEwIDM2VjM4QzExMCAzOS4xMDQ2IDEwOS4xMDUgNDAgMTA4IDQwSDcyQzcwLjg5NTQgNDAgNzAgMzkuMTA0NiA3MCAzOFYzNloiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZD0iTTcwIDQ1QzcwIDQzLjg5NTQgNzAuODk1NCA0MyA3MiA0M0gxMDhDMTA5LjEwNSA0MyAxMTAgNDMuODk1NCAxMTAgNDVWNDdDMTEwIDQ4LjEwNDYgMTA5LjEwNSA0OSAxMDggNDlINzJDNzAuODk1NCA0OSA3MCA0OC4xMDQ2IDcwIDQ3VjQ1WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNNzAgNTRDNzAgNTIuODk1NCA3MC44OTU0IDUyIDcyIDUySDg1Qzg2LjEwNDYgNTIgODcgNTIuODk1NCA4NyA1NFY1NkM4NyA1Ny4xMDQ2IDg2LjEwNDYgNTggODUgNThINzJDNzAuODk1NCA1OCA3MCA1Ny4xMDQ2IDcwIDU2VjU0WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNOTAgNTRDOTAgNTIuODk1NCA5MC44OTU0IDUyIDkyIDUySDEwNUMxMDYuMTA1IDUyIDEwNyA1Mi44OTU0IDEwNyA1NFY1NkMxMDcgNTcuMTA0NiAxMDYuMTA1IDU4IDEwNSA1OEg5MkM5MC44OTU0IDU4IDkwIDU3LjEwNDYgOTAgNTZWNTRaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzAgMjlDNzAgMjguNDQ3NyA3MC40NDc3IDI4IDcxIDI4SDg3Qzg3LjU1MjMgMjggODggMjguNDQ3NyA4OCAyOUM4OCAyOS41NTIzIDg3LjU1MjMgMzAgODcgMzBINzFDNzAuNDQ3NyAzMCA3MCAyOS41NTIzIDcwIDI5WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBkPSJNNzAgNjRDNzAgNjIuODk1NCA3MC44OTU0IDYyIDcyIDYySDk2Qzk3LjEwNDYgNjIgOTggNjIuODk1NCA5OCA2NFY2NkM5OCA2Ny4xMDQ2IDk3LjEwNDYgNjggOTYgNjhINzJDNzAuODk1NCA2OCA3MCA2Ny4xMDQ2IDcwIDY2VjY0WiIgZmlsbD0iIzlDQTNBRiIvPgo8Y2lyY2xlIGN4PSIxNyIgY3k9IjE2IiByPSIzIiBmaWxsPSIjOUNBM0FGIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTcgMTZDOTcgMTQuODk1NCA5OC4wNjYgMTQgOTkuMzgxIDE0SDExMS42MTlDMTEyLjkzNCAxNCAxMTQgMTQuODk1NCAxMTQgMTZDMTE0IDE3LjEwNDYgMTEyLjkzNCAxOCAxMTEuNjE5IDE4SDk5LjM4MUM5OC4wNjYgMTggOTcgMTcuMTA0NiA5NyAxNloiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZD0iTTMwIDMyLjRDMzAgMzAuMTU5OCAzMCAyOS4wMzk3IDMwLjQzNiAyOC4xODRDMzAuODE5NSAyNy40MzE0IDMxLjQzMTQgMjYuODE5NSAzMi4xODQgMjYuNDM2QzMzLjAzOTcgMjYgMzQuMTU5OCAyNiAzNi40IDI2SDU1LjZDNTcuODQwMiAyNiA1OC45NjAzIDI2IDU5LjgxNiAyNi40MzZDNjAuNTY4NiAyNi44MTk1IDYxLjE4MDUgMjcuNDMxNCA2MS41NjQgMjguMTg0QzYyIDI5LjAzOTcgNjIgMzAuMTU5OCA2MiAzMi40VjY3LjZDNjIgNjkuODQwMiA2MiA3MC45NjAzIDYxLjU2NCA3MS44MTZDNjEuMTgwNSA3Mi41Njg2IDYwLjU2ODYgNzMuMTgwNSA1OS44MTYgNzMuNTY0QzU4Ljk2MDMgNzQgNTcuODQwMiA3NCA1NS42IDc0SDM2LjRDMzQuMTU5OCA3NCAzMy4wMzk3IDc0IDMyLjE4NCA3My41NjRDMzEuNDMxNCA3My4xODA1IDMwLjgxOTUgNzIuNTY4NiAzMC40MzYgNzEuODE2QzMwIDcwLjk2MDMgMzAgNjkuODQwMiAzMCA2Ny42VjMyLjRaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGQ9Ik0yOCAzMC40QzI4IDI4LjE1OTggMjggMjcuMDM5NyAyOC40MzYgMjYuMTg0QzI4LjgxOTUgMjUuNDMxNCAyOS40MzE0IDI0LjgxOTUgMzAuMTg0IDI0LjQzNkMzMS4wMzk3IDI0IDMyLjE1OTggMjQgMzQuNCAyNEg1My42QzU1Ljg0MDIgMjQgNTYuOTYwMyAyNCA1Ny44MTYgMjQuNDM2QzU4LjU2ODYgMjQuODE5NSA1OS4xODA1IDI1LjQzMTQgNTkuNTY0IDI2LjE4NEM2MCAyNy4wMzk3IDYwIDI4LjE1OTggNjAgMzAuNFY2NS42QzYwIDY3Ljg0MDIgNjAgNjguOTYwMyA1OS41NjQgNjkuODE2QzU5LjE4MDUgNzAuNTY4NiA1OC41Njg2IDcxLjE4MDUgNTcuODE2IDcxLjU2NEM1Ni45NjAzIDcyIDU1Ljg0MDIgNzIgNTMuNiA3MkgzNC40QzMyLjE1OTggNzIgMzEuMDM5NyA3MiAzMC4xODQgNzEuNTY0QzI5LjQzMTQgNzEuMTgwNSAyOC44MTk1IDcwLjU2ODYgMjguNDM2IDY5LjgxNkMyOCA2OC45NjAzIDI4IDY3Ljg0MDIgMjggNjUuNlYzMC40WiIgZmlsbD0id2hpdGUiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zMyA1N0MzMyA1Ni40NDc3IDMzLjI4OTcgNTYgMzMuNjQ3MSA1Nkg1NC4zNTI5QzU0LjcxMDMgNTYgNTUgNTYuNDQ3NyA1NSA1N0M1NSA1Ny41NTIzIDU0LjcxMDMgNTggNTQuMzUyOSA1OEgzMy42NDcxQzMzLjI4OTcgNTggMzMgNTcuNTUyMyAzMyA1N1oiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zNiA2MkMzNiA2MS40NDc3IDM2LjI5MjcgNjEgMzYuNjUzOCA2MUg1Mi4zNDYyQzUyLjcwNzMgNjEgNTMgNjEuNDQ3NyA1MyA2MkM1MyA2Mi41NTIzIDUyLjcwNzMgNjMgNTIuMzQ2MiA2M0gzNi42NTM4QzM2LjI5MjcgNjMgMzYgNjIuNTUyMyAzNiA2MloiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZD0iTTQzLjA2NTMgMzQuNDU4NUM0My4zOTIxIDMzLjU5OSA0NC42MDc5IDMzLjU5OSA0NC45MzQ3IDM0LjQ1ODVMNDcuNjgzOCA0MS42ODg5QzQ3LjcyMTggNDEuNzg5IDQ3Ljc3NTcgNDEuODgyMyA0Ny44NDM0IDQxLjk2NTNMNTIuNzMwNiA0Ny45NjEzQzUzLjMxMTUgNDguNjc0IDUyLjcwMzYgNDkuNzI3IDUxLjc5NTkgNDkuNTgwM0w0NC4xNTk2IDQ4LjM0NThDNDQuMDUzOSA0OC4zMjg3IDQzLjk0NjEgNDguMzI4NyA0My44NDA0IDQ4LjM0NThMMzYuMjA0MSA0OS41ODAzQzM1LjI5NjQgNDkuNzI3IDM0LjY4ODUgNDguNjc0IDM1LjI2OTQgNDcuOTYxM0w0MC4xNTY2IDQxLjk2NTNDNDAuMjI0MyA0MS44ODIzIDQwLjI3ODIgNDEuNzg5IDQwLjMxNjIgNDEuNjg4OUw0My4wNjUzIDM0LjQ1ODVaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzAgOTZDNzAgOTUuNDQ3NyA3MC40NDc3IDk1IDcxIDk1SDk5Qzk5LjU1MjMgOTUgMTAwIDk1LjQ0NzcgMTAwIDk2QzEwMCA5Ni41NTIzIDk5LjU1MjMgOTcgOTkgOTdINzFDNzAuNDQ3NyA5NyA3MCA5Ni41NTIzIDcwIDk2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTcwIDEwMEM3MCA5OS40NDc3IDcwLjQ0NzcgOTkgNzEgOTlIOTJDOTIuNTUyMyA5OSA5MyA5OS40NDc3IDkzIDEwMEM5MyAxMDAuNTUyIDkyLjU1MjMgMTAxIDkyIDEwMUg3MUM3MC40NDc3IDEwMSA3MCAxMDAuNTUyIDcwIDEwMFoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03NiAxMDVDNzYgMTA0LjQ0OCA3Ni40NDc3IDEwNCA3NyAxMDRIODRDODQuNTUyMyAxMDQgODUgMTA0LjQ0OCA4NSAxMDVDODUgMTA1LjU1MiA4NC41NTIzIDEwNiA4NCAxMDZINzdDNzYuNDQ3NyAxMDYgNzYgMTA1LjU1MiA3NiAxMDVaIiBmaWxsPSIjRDFENURCIi8+CjxjaXJjbGUgY3g9IjcyIiBjeT0iMTA1IiByPSIyIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjggOTZDMjggOTUuNDQ3NyAyOC40NDc3IDk1IDI5IDk1SDU3QzU3LjU1MjMgOTUgNTggOTUuNDQ3NyA1OCA5NkM1OCA5Ni41NTIzIDU3LjU1MjMgOTcgNTcgOTdIMjlDMjguNDQ3NyA5NyAyOCA5Ni41NTIzIDI4IDk2WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTI4IDEwMEMyOCA5OS40NDc3IDI4LjQ0NzcgOTkgMjkgOTlINTBDNTAuNTUyMyA5OSA1MSA5OS40NDc3IDUxIDEwMEM1MSAxMDAuNTUyIDUwLjU1MjMgMTAxIDUwIDEwMUgyOUMyOC40NDc3IDEwMSAyOCAxMDAuNTUyIDI4IDEwMFoiIGZpbGw9IiNEMUQ1REIiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zNCAxMDVDMzQgMTA0LjQ0OCAzNC40NDc3IDEwNCAzNSAxMDRINDJDNDIuNTUyMyAxMDQgNDMgMTA0LjQ0OCA0MyAxMDVDNDMgMTA1LjU1MiA0Mi41NTIzIDEwNiA0MiAxMDZIMzVDMzQuNDQ3NyAxMDYgMzQgMTA1LjU1MiAzNCAxMDVaIiBmaWxsPSIjRDFENURCIi8+CjxjaXJjbGUgY3g9IjMwIiBjeT0iMTA1IiByPSIyIiBmaWxsPSIjRDFENURCIi8+CjxkZWZzPgo8ZmlsdGVyIGlkPSJmaWx0ZXIwX2RfMjEzNl8xMjUzNjgiIHg9IjYiIHk9IjgiIHdpZHRoPSIxMTYiIGhlaWdodD0iMTE4IiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iNCIgb3BlcmF0b3I9ImVyb2RlIiBpbj0iU291cmNlQWxwaGEiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzIxMzZfMTI1MzY4Ii8+CjxmZU9mZnNldCBkeT0iNCIvPgo8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIi8+CjxmZUNvbXBvc2l0ZSBpbjI9ImhhcmRBbHBoYSIgb3BlcmF0b3I9Im91dCIvPgo8ZmVDb2xvck1hdHJpeCB0eXBlPSJtYXRyaXgiIHZhbHVlcz0iMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMC4xNiAwIi8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW4yPSJCYWNrZ3JvdW5kSW1hZ2VGaXgiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzIxMzZfMTI1MzY4Ii8+CjxmZUJsZW5kIG1vZGU9Im5vcm1hbCIgaW49IlNvdXJjZUdyYXBoaWMiIGluMj0iZWZmZWN0MV9kcm9wU2hhZG93XzIxMzZfMTI1MzY4IiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8L2RlZnM+Cjwvc3ZnPgo=",l$="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiBmaWxsPSIjRDFENURCIi8+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfMTAzM18xMDE2MikiPgo8cmVjdCB4PSI4IiB5PSI4IiB3aWR0aD0iMTEyIiBoZWlnaHQ9IjExMiIgcng9IjYiIGZpbGw9IiNGOUZBRkIiLz4KPC9nPgo8Y2lyY2xlIGN4PSIxNyIgY3k9IjE2IiByPSIzIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNOTggMTZDOTggMTUuNDQ3NyA5OC40NDc3IDE1IDk5IDE1SDEwN0MxMDcuNTUyIDE1IDEwOCAxNS40NDc3IDEwOCAxNkMxMDggMTYuNTUyMyAxMDcuNTUyIDE3IDEwNyAxN0g5OUM5OC40NDc3IDE3IDk4IDE2LjU1MjMgOTggMTZaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNzAgMTZDNzAgMTUuNDQ3NyA3MC40NDc3IDE1IDcxIDE1SDc5Qzc5LjU1MjMgMTUgODAgMTUuNDQ3NyA4MCAxNkM4MCAxNi41NTIzIDc5LjU1MjMgMTcgNzkgMTdINzFDNzAuNDQ3NyAxNyA3MCAxNi41NTIzIDcwIDE2WiIgZmlsbD0iI0U1RTdFQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTg0IDE2Qzg0IDE1LjQ0NzcgODQuNDQ3NyAxNSA4NSAxNUg5M0M5My41NTIzIDE1IDk0IDE1LjQ0NzcgOTQgMTZDOTQgMTYuNTUyMyA5My41NTIzIDE3IDkzIDE3SDg1Qzg0LjQ0NzcgMTcgODQgMTYuNTUyMyA4NCAxNloiIGZpbGw9IiNFNUU3RUIiLz4KPHJlY3QgeD0iMzcuNSIgeT0iNDMuNSIgd2lkdGg9IjUyIiBoZWlnaHQ9IjU2IiByeD0iMi41IiBmaWxsPSJ3aGl0ZSIgc3Ryb2tlPSIjRjNGNEY2Ii8+CjxwYXRoIGQ9Ik00MSA1NkM0MSA1NC44OTU0IDQxLjg5NTQgNTQgNDMgNTRINTJDNTMuMTA0NiA1NCA1NCA1NC44OTU0IDU0IDU2QzU0IDU3LjEwNDYgNTMuMTA0NiA1OCA1MiA1OEg0M0M0MS44OTU0IDU4IDQxIDU3LjEwNDYgNDEgNTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik01NyA1NkM1NyA1NC44OTU0IDU3Ljg5NTQgNTQgNTkgNTRINjhDNjkuMTA0NiA1NCA3MCA1NC44OTU0IDcwIDU2QzcwIDU3LjEwNDYgNjkuMTA0NiA1OCA2OCA1OEg1OUM1Ny44OTU0IDU4IDU3IDU3LjEwNDYgNTcgNTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik03MyA1NkM3MyA1NC44OTU0IDczLjg5NTQgNTQgNzUgNTRIODRDODUuMTA0NiA1NCA4NiA1NC44OTU0IDg2IDU2Qzg2IDU3LjEwNDYgODUuMTA0NiA1OCA4NCA1OEg3NUM3My44OTU0IDU4IDczIDU3LjEwNDYgNzMgNTZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik00MSA3MkM0MSA3MC44OTU0IDQxLjg5NTQgNzAgNDMgNzBINTZDNTcuMTA0NiA3MCA1OCA3MC44OTU0IDU4IDcyQzU4IDczLjEwNDYgNTcuMTA0NiA3NCA1NiA3NEg0M0M0MS44OTU0IDc0IDQxIDczLjEwNDYgNDEgNzJaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik02MiA3MkM2MiA3MC44OTU0IDYyLjg5NTQgNzAgNjQgNzBIODNDODQuMTA0NiA3MCA4NSA3MC44OTU0IDg1IDcyQzg1IDczLjEwNDYgODQuMTA0NiA3NCA4MyA3NEg2NEM2Mi44OTU0IDc0IDYyIDczLjEwNDYgNjIgNzJaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik00MSA3OUM0MSA3Ny44OTU0IDQxLjg5NTQgNzcgNDMgNzdINTZDNTcuMTA0NiA3NyA1OCA3Ny44OTU0IDU4IDc5QzU4IDgwLjEwNDYgNTcuMTA0NiA4MSA1NiA4MUg0M0M0MS44OTU0IDgxIDQxIDgwLjEwNDYgNDEgNzlaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik02MiA3OUM2MiA3Ny44OTU0IDYyLjg5NTQgNzcgNjQgNzdINzdDNzguMTA0NiA3NyA3OSA3Ny44OTU0IDc5IDc5Qzc5IDgwLjEwNDYgNzguMTA0NiA4MSA3NyA4MUg2NEM2Mi44OTU0IDgxIDYyIDgwLjEwNDYgNjIgNzlaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik00MSA4NkM0MSA4NC44OTU0IDQxLjg5NTQgODQgNDMgODRINTZDNTcuMTA0NiA4NCA1OCA4NC44OTU0IDU4IDg2QzU4IDg3LjEwNDYgNTcuMTA0NiA4OCA1NiA4OEg0M0M0MS44OTU0IDg4IDQxIDg3LjEwNDYgNDEgODZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik02MiA4NkM2MiA4NC44OTU0IDYyLjg5NTQgODQgNjQgODRINzhDNzkuMTA0NiA4NCA4MCA4NC44OTU0IDgwIDg2QzgwIDg3LjEwNDYgNzkuMTA0NiA4OCA3OCA4OEg2NEM2Mi44OTU0IDg4IDYyIDg3LjEwNDYgNjIgODZaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik00MSA5M0M0MSA5MS44OTU0IDQxLjg5NTQgOTEgNDMgOTFINTZDNTcuMTA0NiA5MSA1OCA5MS44OTU0IDU4IDkzQzU4IDk0LjEwNDYgNTcuMTA0NiA5NSA1NiA5NUg0M0M0MS44OTU0IDk1IDQxIDk0LjEwNDYgNDEgOTNaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGQ9Ik02MiA5M0M2MiA5MS44OTU0IDYyLjg5NTQgOTEgNjQgOTFIODFDODIuMTA0NiA5MSA4MyA5MS44OTU0IDgzIDkzQzgzIDk0LjEwNDYgODIuMTA0NiA5NSA4MSA5NUg2NEM2Mi44OTU0IDk1IDYyIDk0LjEwNDYgNjIgOTNaIiBmaWxsPSIjRTVFN0VCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDEgNDkuNUM0MSA0OC42NzE2IDQxLjY3MTYgNDggNDIuNSA0OEg2Mi41QzYzLjMyODQgNDggNjQgNDguNjcxNiA2NCA0OS41QzY0IDUwLjMyODQgNjMuMzI4NCA1MSA2Mi41IDUxSDQyLjVDNDEuNjcxNiA1MSA0MSA1MC4zMjg0IDQxIDQ5LjVaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDEgNjUuNUM0MSA2NC42NzE2IDQxLjY3MTYgNjQgNDIuNSA2NEg2Mi41QzYzLjMyODQgNjQgNjQgNjQuNjcxNiA2NCA2NS41QzY0IDY2LjMyODQgNjMuMzI4NCA2NyA2Mi41IDY3SDQyLjVDNDEuNjcxNiA2NyA0MSA2Ni4zMjg0IDQxIDY1LjVaIiBmaWxsPSIjRDFENURCIi8+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNNDQgMzVDNDQgMzQuNDQ3NyA0NC40NDc3IDM0IDQ1IDM0SDgzQzgzLjU1MjMgMzQgODQgMzQuNDQ3NyA4NCAzNUM4NCAzNS41NTIzIDgzLjU1MjMgMzYgODMgMzZINDVDNDQuNDQ3NyAzNiA0NCAzNS41NTIzIDQ0IDM1WiIgZmlsbD0iI0QxRDVEQiIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTUzIDMwLjVDNTMgMjkuNjcxNiA1My42NzE2IDI5IDU0LjUgMjlINzIuNUM3My4zMjg0IDI5IDc0IDI5LjY3MTYgNzQgMzAuNUM3NCAzMS4zMjg0IDczLjMyODQgMzIgNzIuNSAzMkg1NC41QzUzLjY3MTYgMzIgNTMgMzEuMzI4NCA1MyAzMC41WiIgZmlsbD0iI0QxRDVEQiIvPgo8Y2lyY2xlIGN4PSI2My41IiBjeT0iMTA3LjUiIHI9IjIuNSIgZmlsbD0iI0U1RTdFQiIvPgo8Y2lyY2xlIGN4PSI1NS41IiBjeT0iMTA3LjUiIHI9IjIuNSIgZmlsbD0iI0U1RTdFQiIvPgo8Y2lyY2xlIGN4PSI3MS41IiBjeT0iMTA3LjUiIHI9IjIuNSIgZmlsbD0iI0U1RTdFQiIvPgo8ZGVmcz4KPGZpbHRlciBpZD0iZmlsdGVyMF9kXzEwMzNfMTAxNjIiIHg9IjYiIHk9IjgiIHdpZHRoPSIxMTYiIGhlaWdodD0iMTE4IiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iNCIgb3BlcmF0b3I9ImVyb2RlIiBpbj0iU291cmNlQWxwaGEiIHJlc3VsdD0iZWZmZWN0MV9kcm9wU2hhZG93XzEwMzNfMTAxNjIiLz4KPGZlT2Zmc2V0IGR5PSI0Ii8+CjxmZUdhdXNzaWFuQmx1ciBzdGREZXZpYXRpb249IjMiLz4KPGZlQ29tcG9zaXRlIGluMj0iaGFyZEFscGhhIiBvcGVyYXRvcj0ib3V0Ii8+CjxmZUNvbG9yTWF0cml4IHR5cGU9Im1hdHJpeCIgdmFsdWVzPSIwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwLjE2IDAiLz4KPGZlQmxlbmQgbW9kZT0ibm9ybWFsIiBpbjI9IkJhY2tncm91bmRJbWFnZUZpeCIgcmVzdWx0PSJlZmZlY3QxX2Ryb3BTaGFkb3dfMTAzM18xMDE2MiIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd18xMDMzXzEwMTYyIiByZXN1bHQ9InNoYXBlIi8+CjwvZmlsdGVyPgo8L2RlZnM+Cjwvc3ZnPgo=";function c$({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 u$=i.forwardRef(c$),d$=Ua("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);var f$=a(9296);const m$=function(e){var t;const{is_cf_pro:n,global_checkout:r,flow_id:a,control_id:s,step_id:l,title:c,type:u,actions:d,menu_actions:f,ab_test_ui:m,offer_no_next_step:p,offer_yes_next_step:h,setShowAbtestUpgradePopup:g=()=>{},step_disabled:w}=e,y=l;let{has_product_assigned:b,is_variation:v}=e;const[{flow_type:x,flow_analytics:_,is_flow_instant_checkout:E}]=ZR(),[N,M]=(0,i.useState)(!1),I=(0,i.useRef)(),S=_?_.all_steps:"",k=v?e.control_id:l,j=S?S.find(e=>e.id===k):[],D=$V(),A=(0,f$.W6)();"landing"!==u&&"thankyou"!==u||(b=!0);const T=(e,t)=>(0,o.createElement)("div",{className:"flex justify-center"},(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:t,placement:"top"},(0,o.createElement)(Yf,{label:e,size:"sm",type:"pill",variant:"neutral",icon:(0,o.createElement)(d$,{"aria-hidden":"true"}),className:"cursor-pointer"}))),O=jh(u,E);return(0,o.createElement)("div",{className:`wcf-step-wrap--container py-4 px-4 flex items-center gap-2 ${m?"border-0 border-b border-solid border-border-subtle":""} ${w?"invalid-step step-disabled touch-none !bg-background-secondary !text-text-disabled !border-0 rounded-lg":""}`},!m&&(0,o.createElement)("div",{className:"wcf-steps--sortable-toggle flex cursor-move text-text-secondary"},(0,o.createElement)(eU,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}),(0,o.createElement)(eU,{className:"w-5 h-5 stroke-1 -ml-3.5","aria-hidden":"true"})),(0,o.createElement)(Gp,{gap:"lg",direction:{sm:"column",md:"row"},align:{md:"center"},className:Gf()("wcf-step w-full justify-between",m?"ml-8":"",N?"step-overlay":"",b||y===r?"":"wcf-step__no-product")},(0,o.createElement)(Gp.Item,{className:"wcf-step--content flex items-center gap-4 w-full sm:w-[50%] min-w-0"},(0,o.createElement)("img",{src:function(){let e="";switch(u){case"landing":e=r$;break;case"checkout":e=a$;break;case"optin":e=s$;break;case"thankyou":e=l$;break;case"upsell":e=o$;break;case"downsell":e=i$}return e}(),alt:u,className:"sm:block lg:block hidden rounded-lg sm:w-[72px] sm:h-[72px] w-[62px] h-[62px]"}),(0,o.createElement)("div",{className:"wcf-steps--title-wrap flex flex-col gap-1"},(0,o.createElement)("div",{className:"wcf-step__col-tags sm:flex items-center gap-2 grid grid-cols-2"},(0,o.createElement)(th,{as:"span",size:14,weight:400,color:"secondary",className:"capitalize"},"thankyou"===u?(0,z.__)("Thank You","cartflows"):u),("upsell"!==u&&"downsell"!==u||wcfCartflowsTypePlusPro())&&w?(0,o.createElement)(Yf,{label:(0,z.__)("Disabled","cartflows"),size:"xs",type:"rounded",variant:"red",icon:(0,o.createElement)(dW,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}):null,function(){let t="";if(m)if(s===l)t=(0,o.createElement)(Yf,{label:(0,z.__)("Control","cartflows"),size:"xs",type:"pill",variant:"blue"});else{const{var_badge_count:n}=e;t=(0,o.createElement)(Yf,{label:(0,z.sprintf)(/* translators: %d is replaced with the count */ /* translators: %d is replaced with the count */ |
| 45 |
(0,z.__)("Variation-%d","cartflows"),n),size:"xs",type:"pill",variant:"inverse"})}return t}(),!b&&"storeCheckout"!==x&&(0,o.createElement)(Yf,{label:(0,z.__)("No Product Assigned","cartflows"),size:"xs",type:"rounded",variant:"red",icon:(0,o.createElement)(dW,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}),!b&&"storeCheckout"===x&&"checkout"!==u&&(0,o.createElement)(Yf,{label:(0,z.__)("No Product Assigned","cartflows"),size:"xs",type:"rounded",variant:"red",icon:(0,o.createElement)(dW,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}),b&&"storeCheckout"===x&&"checkout"===u&&(0,o.createElement)(Yf,{label:(0,z.__)("Store Checkout - Remove selected checkout product","cartflows"),size:"xs",type:"rounded",variant:"red",className:"wcf-global-checkout-error-badge",icon:(0,o.createElement)(dW,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}),function(){let e="";return!wcfCartflowsTypePlusPro()||"upsell"!==u&&"downsell"!==u?wcfCartflowsTypePlusPro()||"upsell"!==u&&"downsell"!==u||(e=(0,o.createElement)(Ym,null)):e=h&&p?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:Ch(h,35,25),placement:"top"},(0,o.createElement)(Yf,{label:(0,z.__)("Offer Accepted","cartflows"),size:"xs",type:"rounded",variant:"green",icon:(0,o.createElement)(mW,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})})),(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:Ch(p,35,25),placement:"top"},(0,o.createElement)(Yf,{label:(0,z.__)("Offer Rejected","cartflows"),size:"xs",type:"rounded",variant:"yellow",icon:(0,o.createElement)(u$,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}))):(0,o.createElement)(Yf,{label:(0,z.__)("Invalid Position","cartflows"),size:"xs",type:"rounded",variant:"red",icon:(0,o.createElement)(dW,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"})}),e}()),(0,o.createElement)("div",{className:"wcf-step__title"},(0,o.createElement)("a",{className:`\n\t\t\t\t\t\t\t\t\tfont-medium text-base sm:text-lg text-text-primary hover:text-brand-brand-600 no-underline\n\t\t\t\t\t\t\t\t\t${O?"disabled pointer-events-none":""}\n\t\t\t\t\t\t\t\t`,href:null!==(t=d[1]?.link)&&void 0!==t?t:"#","aria-disabled":O,tabIndex:O?-1:0},Ch(c,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))))),(0,o.createElement)(Gp.Item,{className:"wcf-step--stats-content w-full sm:w-[30%]"},(0,o.createElement)("div",{className:"wcf-step--stats-content__info flex text-center justify-around items-center gap-4"},(0,o.createElement)("div",{className:"wcf-step--stats-content__stat"},_?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(th,{as:"div",size:14,weight:400,color:"secondary",className:"capitalize"},(0,z.__)("Views","cartflows")),(0,o.createElement)(th,{as:"div",size:16,weight:600,color:"primary"},function(){let e=0;return _&&j&&(e=v?j["visits-ab"][l].total_visits:j.visits.total_visits),e}())):T((0,z.__)("Views","cartflows"),(0,z.__)("Upgrade to CartFlows Pro to track views.","cartflows"))),(0,o.createElement)("div",{className:"wcf-step--stats-content__stat"},_?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(th,{as:"div",size:14,weight:400,color:"secondary",className:"capitalize"},(0,z.__)("Conversions","cartflows")),(0,o.createElement)(th,{as:"div",size:16,weight:600,color:"primary"},"thankyou"!==u?function(){let e=0;return _&&j&&(e=v?j["visits-ab"][l].conversions:j.visits.conversions),e}():"-")):T((0,z.__)("Conversions","cartflows"),(0,z.__)("Upgrade to CartFlows Pro to track conversions.","cartflows"))),(0,o.createElement)("div",{className:"wcf-step--stats-content__stat"},_?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(th,{as:"div",size:14,weight:400,color:"secondary",className:"capitalize"},(0,z.__)("Revenue","cartflows")),(0,o.createElement)(th,{as:"div",size:16,weight:600,color:"primary"},"thankyou"!==u&&"landing"!==u?function(){let e=0;return _&&j&&(e=v?j["visits-ab"][l].revenue:j.visits.revenue),0!==e?fh(e):e}():"-")):T((0,z.__)("Revenue","cartflows"),(0,z.__)("Upgrade to CartFlows Pro to track revenue.","cartflows"))))),(0,o.createElement)(Gp.Item,{className:"wcf-step--actions-col w-full sm:w-[15%]"},(0,o.createElement)("div",{className:"wcf-step--actions",ref:I},(0,o.createElement)("div",{className:"wcf-step--action-btns"},(0,o.createElement)("div",{className:"wcf-step--action__basic-btns flex items-center sm:justify-evenly justify-between"},d.map(e=>{var t;if("view"!==e.slug&&"edit"!==e.slug)return null;const n=O&&"edit"===e.slug,r=n?Dh():(0,z.sprintf)( |
| 46 |
// translators: %s: step slug |
| 47 |
// translators: %s: step slug |
| 48 |
(0,z.__)("%s Step","cartflows"),e?.slug),a="view"===e.slug?(0,o.createElement)(sW,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}):(0,o.createElement)(cW,{className:"w-5 h-5 stroke-1","aria-hidden":"true"});return(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:(0,o.createElement)("span",{className:"capitalize"},r),placement:"top",key:e?.link},(0,o.createElement)(Va,{variant:"ghost",size:"xs",tag:"a",href:!n&&"edit"===e.slug||"view"===e.slug?e?.link:"#!",target:"view"===e?.slug?"_blank":void 0,rel:"noreferrer",className:`wcf-step__action-btn ${null!==(t=e.class)&&void 0!==t?t:""} ${n?"disabled !text-text-disabled":"text-text-secondary"}`},a))}),(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:(0,z.__)("Open Settings","cartflows"),placement:"top"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",tag:C,to:{pathname:"admin.php",search:"storeCheckout"===x?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${a}&step_id=${l}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${a}&step_id=${l}`},className:"wcf-step__action-btn text-text-secondary hover:text-brand-brand-600"},(0,o.createElement)(nU,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}))),(0,o.createElement)(n$,{id:y,control_id:s,onClickEvents:{clone:async function(e){if(e.preventDefault(),!wcfCartflowsPro())return null;if(await D({title:(0,z.__)("Duplicate Step","cartflows"),description:(0,z.__)("Do you want to duplicate this step? Are you sure?","cartflows"),actionBtnText:(0,z.__)("Duplicate","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})){M(!0);const t=e.target.getAttribute("data-action");let n=cartflows_admin.clone_step_nonce;const r=new window.FormData;"cartflows_clone_ab_test_step"===t&&(n=cartflows_admin.wcf_clone_ab_test_step_nonce,r.append("control_id",s)),r.append("action",t),r.append("security",n),r.append("step_id",y),r.append("post_id",a),window.wcfAction="cloneStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{pp.success((0,z.__)("Step cloned successfully!","cartflows")),window.location.reload(),M(!1)}))}},delete:async function(e){if(e.preventDefault(),await D({title:(0,z.__)("Delete Step","cartflows"),description:(0,z.__)("Do you want to delete this step? Are you sure?","cartflows"),actionBtnText:(0,z.__)("Delete","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})){M(!0);const t=e.target.getAttribute("data-action");let n=cartflows_admin.delete_step_nonce;const r=new window.FormData;"cartflows_delete_ab_test_step"===t&&(n=cartflows_admin.wcf_delete_ab_test_step_nonce,r.append("control_id",s)),r.append("action",t),r.append("security",n),r.append("step_id",y),r.append("post_id",a),window.wcfAction="deleteStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{pp.success((0,z.__)("Step deleted successfully!","cartflows")),window.location.reload(),M(!1)}))}},abtest:function(e){if(e.preventDefault(),!wcfCartflowsTypePro())return null;M(!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",y),t.append("flow_id",a),window.wcfAction="abtestStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{pp.success((0,z.__)("A/B test variation created!","cartflows")),window.location.reload(),M(!1)}))},winner:async function(e){if(e.preventDefault(),await D({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.__)("Declare Winner","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})){M(!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",y),e.append("flow_id",a),window.wcfAction="winnerStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{pp.success((0,z.__)("Winner declared successfully!","cartflows")),window.location.reload(),M(!1)}).catch(e=>{console.error("Declare A/B test winner failed:",e),pp.error((0,z.__)("Failed to declare winner. Please try again.","cartflows")),M(!1)}))}},archived:async function(e){if(e.preventDefault(),await D({title:(0,z.__)("Archive Step","cartflows"),description:(0,z.__)("Do you want to archive this step? Are you sure?","cartflows"),actionBtnText:(0,z.__)("Archive","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})){M(!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",y),e.append("post_id",a),window.wcfAction="archiveStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{pp.success((0,z.__)("Step archived successfully!","cartflows")),window.location.reload(),M(!1)}))}},automation:()=>{A.push({pathname:"admin.php",search:"storeCheckout"===x?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${a}&automation=${l}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${a}&automation=${l}`})}},is_cf_pro:n,actions:f,type:u,setShowAbtestUpgradePopup:g})))))))},p$=function(e){const{abVariations:t}=e,n={};t.map(e=>(n[e.id]=parseInt(e.traffic),""));const[r,a]=(0,i.useState)(n),s=function(e,n){e=parseInt(e),n=parseInt(n);let o=r[e]-n;const i={};t.map(t=>{const a=parseInt(t.id);if(e===a)i[a]=n;else{let e=r[a]+o;e<0?(o=e,e=0):e>100?(o=e-100,e=100):o=0,i[a]=e}return""}),a(i)};return(0,o.createElement)(o.Fragment,null,t&&t.map(e=>{const t=e.id,n=e.title;return(0,o.createElement)("div",{className:"wcf-traffic-field pb-5","data-id":e.id,key:e.id},(0,o.createElement)(Qf,{className:"wcf-step-name w-40 mr-4",tag:"span",size:"sm",title:n},Ch(n,20,15)),(0,o.createElement)("div",{className:"wcf-traffic-slider-wrap flex items-center gap-3 flex-1","data-variation-id":e.id},(0,o.createElement)("div",{className:`wcf-traffic-range wcf-traffic-range-${e.id} flex-1`},(0,o.createElement)("input",{type:"range",value:r[t],onChange:e=>{s(t,e.target.value)}})),(0,o.createElement)("div",{className:`wcf-traffic-value wcf-traffic-value-${e.id} shrink-0`},(0,o.createElement)(dp,{type:"number",name:`wcf_ab_settings[traffic][${e.id}][value]`,value:String(r[t]),size:"sm",suffix:"%",className:"w-20",onChange:e=>{s(t,e)}}))))}))},h$=function(e){const{flow_id:t,step_id:n,abvariations:r,closeCallback:a}=e,[s,c]=(0,i.useState)(!1),[u,d]=(0,i.useState)((0,z.__)("Save Settings","cartflows")),f=l().useRef(null);return(0,o.createElement)($m,{open:!0,setOpen:e=>{e||a()},design:"footer-divided",exitOnClickOutside:!0,exitOnEsc:!0},(0,o.createElement)($m.Portal,null,(0,o.createElement)($m.Panel,{className:"max-w-xl gap-0"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)($m.Header,{className:"flex items-center justify-between px-6 pt-5 pb-0"},(0,o.createElement)($m.Title,null,(0,z.__)("Split Test Testing","cartflows")),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)($m.Body,{className:"px-6 py-4"},(0,o.createElement)("form",{ref:f,id:"wcf-ab-settings-form",onSubmit:function(e){e.preventDefault(),c(!0),d((0,z.__)("Saving..","cartflows"));const r=new window.FormData(e.target),a={};r.forEach(function(e,t){a[t]=e});const o=JSON.stringify(a);r.append("formdata",o),r.append("action","cartflows_save_ab_test_setting"),r.append("security",cartflows_admin.save_ab_test_setting_nonce),r.append("step_id",n),r.append("flow_id",t),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{pp.success((0,z.__)("Split test settings saved!","cartflows")),d((0,z.__)("Reloading..","cartflows")),window.location.reload()}).catch(()=>{c(!1),d((0,z.__)("Save Settings","cartflows")),pp.error((0,z.__)("Failed to save split test settings.","cartflows"))})}},(0,o.createElement)("div",{className:"text-sm font-medium text-field-label mb-3"},(0,z.__)("Traffic","cartflows")),(0,o.createElement)("div",{className:"rounded-md border border-border-subtle bg-background-primary text-sm font-medium text-text-primary"},(0,o.createElement)(p$,{abVariations:r})))),(0,o.createElement)($m.Footer,{className:"px-6 py-4"},(0,o.createElement)(Va,{variant:"outline",size:"sm",onClick:a},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(Va,{variant:"primary",size:"sm",type:"submit",form:"wcf-ab-settings-form",loading:s,disabled:s},u)))))},g$=function(e){const{flow_id:t,control_id:n,step_id:r,abvariations:a,ab_test_start:s,compact:l=!1}=e,[c,u]=(0,i.useState)(!1),[d,f]=(0,i.useState)(s?(0,z.__)("Stop Split Test","cartflows"):(0,z.__)("Start Split Test","cartflows")),[m,p]=(0,i.useState)(s?"wcf-stop-split-test text-brand-500 hover:text-brand-700 cursor-pointer":"wcf-start-split-test text-support-success hover:text-support-success"),[h,g]=(0,i.useState)(!1);return(0,o.createElement)("div",{className:"wcf-ab-test-head w-full p-4 bg-background-primary flex justify-between items-center border-0 border-b border-solid border-border-subtle rounded-t-lg box-border"},(0,o.createElement)("div",{className:"wcf-step-left-content flex items-center gap-3"},(0,o.createElement)("div",{className:"wcf-steps--sortable-toggle flex cursor-move text-text-tertiary"},(0,o.createElement)(eU,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}),(0,o.createElement)(eU,{className:"w-5 h-5 stroke-1 -ml-3.5","aria-hidden":"true"})),(0,o.createElement)("span",{className:"wcf-ab-test-title "+(l?"font-semibold text-sm":"font-bold text-base")},(0,z.__)("Split Test","cartflows"))),(0,o.createElement)("div",{className:"wcf-steps-action-buttons flex gap-3 items-center"},(0,o.createElement)("a",{href:"#",className:`wcf-action-button font-semibold ${l?"text-sm ":""}no-underline ${m}`,title:d,"data-id":n,onClick:function(e){if(e.preventDefault(),h)return void console.log("One process of A/B split test is ongoing.");s?(p("wcf-start-split-test"),f((0,z.__)("Stopping…","cartflows"))):(p("wcf-stop-split-test"),f((0,z.__)("Starting…","cartflows"))),g(!0);const n=new window.FormData;n.append("action","cartflows_start_ab_test"),n.append("security",cartflows_admin.wcf_start_ab_test_nonce),n.append("step_id",r),n.append("flow_id",t),L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{g(!1),pp.success(s?(0,z.__)("Split test stopped!","cartflows"):(0,z.__)("Split test started!","cartflows")),f((0,z.__)("Reloading…","cartflows")),window.location.reload()})}},(0,o.createElement)("span",null,d)),(0,o.createElement)("a",{href:"#",className:"wcf-settings-split-test wcf-action-button text-text-tertiary hover:text-brand-500",title:`${(0,z.__)("Split Test Settings","cartflows")}`,onClick:function(e){e.preventDefault(),u(!c)}},(0,o.createElement)(nU,{className:"w-5 h-5 stroke-1 "+(h?"animate-spin text-brand-500":""),"aria-hidden":"true"}))),c&&(0,o.createElement)(h$,{abvariations:a,flow_id:t,step_id:r,control_id:n,closeCallback:function(){u(!1)}}))};function w$({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 y$=i.forwardRef(w$),b$=function(e){const{step_id:t,flow_id:n,control_id:r,title:a,deleted:s,hide:l,date:c,actions:u,type:d}=e,[f,m]=(0,i.useState)(!1),p=$V(),h=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.__)("Restore","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})){m(!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",t),e.append("flow_id",n),e.append("control_id",r),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{window.location.reload(),m(!1)})}},g=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 */ |
| 49 |
(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.__)("Trash","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})){m(!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",t),e.append("flow_id",n),e.append("control_id",r),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{window.location.reload(),m(!1)})}},w=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 */ |
| 50 |
(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.__)("Hide","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})){m(!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",t),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{window.location.reload(),m(!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 */ |
| 51 |
(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.__)("Delete","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})){m(!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",t),e.append("flow_id",n),e.append("control_id",r),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{window.location.reload(),m(!1)})}};return"1"===l?null:(0,o.createElement)("div",{className:"wcf-archived-step flex items-center gap-2 py-4 border-0 border-solid border-border-subtle","data-id":t},(0,o.createElement)("div",{className:"wcf-archive-step--sortable-toggle flex text-text-disabled disabled pointer-events-none"},(0,o.createElement)(eU,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}),(0,o.createElement)(eU,{className:"w-5 h-5 stroke-1 -ml-3.5","aria-hidden":"true"})),(0,o.createElement)("div",{className:"wcf-step flex justify-between items-center w-full "+(f?"step-overlay":"")},(0,o.createElement)("div",{className:"wcf-archive-step--content flex items-center gap-4 w-[55%]"},(0,o.createElement)("img",{src:function(){let e="";switch(d){case"landing":e=r$;break;case"checkout":e=a$;break;case"optin":e=s$;break;case"thankyou":e=l$;break;case"upsell":e=o$;break;case"downsell":e=i$}return e}(),alt:d,className:"rounded-lg w-[72px] h-[72px]"}),(0,o.createElement)("div",{className:"wcf-archive-step--title-wrap flex flex-col gap-1"},(0,o.createElement)("div",{className:"wcf-archive-step--col-tags flex items-center gap-2"},(0,o.createElement)("span",{className:"text-base font-normal text-text-tertiary capitalize mr-2"},"thankyou"===d?(0,z.__)("Thank You","cartflows"):d),function(){let e="",t="";return s?(e=(0,z.__)("Deleted On: ","cartflows"),t="bg-support-error"):(e=(0,z.__)("Archived On: ","cartflows"),t="bg-background-inverse"),(0,o.createElement)("span",{className:`wcf-step-badge text-text-on-color text-xs px-2.5 py-1 rounded-full ${t}`},e+c)}()),(0,o.createElement)("div",{className:"wcf-archive-step--title"},(0,o.createElement)("span",{className:"font-semibold text-lg text-text-primary cursor-default"},Ch(a,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length))))),(0,o.createElement)("div",{className:"wcf-archive-step--col"},(0,o.createElement)("div",{className:"wcf-archive-step--actions"},(0,o.createElement)("div",{className:"wcf-archive-step--action__btns-wrapper"},(0,o.createElement)("div",{className:"wcf-archive-step--basic-action__btns flex items-center gap-3"},u.map(e=>{let t,n;switch(e.slug){case"restore":t=h,n=(0,o.createElement)(oW,{className:"w-18 h-18 stroke-2"});break;case"delete":t=g,n=(0,o.createElement)(aU,{className:"w-18 h-18 stroke-2"});break;case"hide":t=w,n=(0,o.createElement)(y$,{className:"w-18 h-18 stroke-2"});break;case"deleteArch":t=y,n=(0,o.createElement)(aU,{className:"w-18 h-18 stroke-2"})}return(0,o.createElement)(o.Fragment,null,e?.before_text&&(0,o.createElement)("span",{className:"wcf-step__action-before-text"},e?.before_text),(0,o.createElement)("a",{href:e?.link,className:`wcf-step__action-btn text-text-tertiary hover:text-brand-500 no-underline p-1 flex gap-2 ${e?.class}`,title:e?.text,onClick:t},n,e?.text))})))))))},v$=function(e){const{flow_id:t,control_id:n,archived_variations:r,type:a,ab_test_ui:s=!1}=e,[l,c]=(0,i.useState)(!1);return(0,o.createElement)("div",{className:"wcf-archived-wrapper box-border p-4 bg-background-primary w-full rounded-b-lg "+(s?"":"border-0 border-t border-solid border-border-subtle")},(0,o.createElement)("span",{id:"wcf-archived-button",onClick:function(){c(!l)},className:`text-text-primary text-sm flex items-center gap-1 cursor-pointer p-1 ${l?"is-active":""} `},(0,z.__)("Archived Steps","cartflows"),l?(0,o.createElement)(Um,{className:"w-4 h-4 stroke-1 mt-0.5","aria-hidden":"true"}):(0,o.createElement)(_W,{className:"w-4 h-4 stroke-1 mt-0.5","aria-hidden":"true"})),l&&(0,o.createElement)("div",{className:"wcf-archived-steps divide-y divide-border-subtle"},r.map(e=>{const r={step_id:e.id,flow_id:t,control_id:n,title:e.title,note:e.note,deleted:e.deleted,hide:e.hide,date:e.date,type:a,actions:Object.values(e.actions)};return(0,o.createElement)(b$,(0,_.A)({},r,{key:e.id}))})))};function x$({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 _$=i.forwardRef(x$);function E$({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const N$=i.forwardRef(E$),M$=function(){return(0,o.createElement)("div",{className:"wcf-order-bump-product-tab p-6 is-placeholder"},(0,o.createElement)("div",{role:"status",className:"space-y-8 animate-pulse md:space-y-0 md:space-x-8 md:flex md:items-center"},(0,o.createElement)("div",{className:"flex items-center justify-center w-full h-48 bg-background-secondary rounded sm:w-96"},(0,o.createElement)("svg",{className:"w-12 h-12 text-text-disabled",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",fill:"currentColor",viewBox:"0 0 640 512"},(0,o.createElement)("path",{d:"M480 80C480 35.82 515.8 0 560 0C604.2 0 640 35.82 640 80C640 124.2 604.2 160 560 160C515.8 160 480 124.2 480 80zM0 456.1C0 445.6 2.964 435.3 8.551 426.4L225.3 81.01C231.9 70.42 243.5 64 256 64C268.5 64 280.1 70.42 286.8 81.01L412.7 281.7L460.9 202.7C464.1 196.1 472.2 192 480 192C487.8 192 495 196.1 499.1 202.7L631.1 419.1C636.9 428.6 640 439.7 640 450.9C640 484.6 612.6 512 578.9 512H55.91C25.03 512 .0006 486.1 .0006 456.1L0 456.1z"}))),(0,o.createElement)("div",{className:"w-full"},(0,o.createElement)("div",{className:"wcf-accordion-loader mb-3.5"},(0,o.createElement)("span",{className:"block h-4 w-28 bg-background-secondary rounded-md mb-4"}),(0,o.createElement)("span",{className:"block h-4 bg-background-secondary rounded-md mb-4 w-10/12"}),(0,o.createElement)("span",{className:"block h-4 bg-background-secondary rounded-md mb-4 w-8/12"}),(0,o.createElement)("span",{className:"block h-4 bg-background-secondary rounded-md w-1/2 mb-4"})))),(0,o.createElement)("div",{className:"flex gap-4 mt-6"},(0,o.createElement)("span",{className:"w-20 h-4 bg-background-secondary rounded-md"}),(0,o.createElement)("span",{className:"w-20 h-4 bg-background-secondary rounded-md"}),(0,o.createElement)("span",{className:"w-20 h-4 bg-background-secondary rounded-md"}),(0,o.createElement)("span",{className:"w-20 h-4 bg-background-secondary rounded-md"})),(0,o.createElement)("div",{className:"w-full"},(0,o.createElement)("div",{className:"mt-6 mb-3.5"},(0,o.createElement)("span",{className:"block h-4 w-28 bg-background-secondary rounded-md mb-4"}),(0,o.createElement)("span",{className:"block h-4 bg-background-secondary rounded-md mb-4 w-10/12"}),(0,o.createElement)("span",{className:"block h-4 bg-background-secondary rounded-md mb-4 w-8/12"}),(0,o.createElement)("span",{className:"block h-4 bg-background-secondary rounded-md w-1/2 mb-4"}))))},I$=function(){return(0,o.createElement)("div",{className:"wcf-order-bump-design-tab is-placeholder"},(0,o.createElement)("div",{className:"wcf-order-bump-design-tab__settings"},(0,o.createElement)("table",null,(0,o.createElement)("tbody",null,(0,o.createElement)("tr",null,(0,o.createElement)("th",{scope:"row"},(0,o.createElement)("div",{className:"wcf-field wcf-section-heading-field"},(0,o.createElement)("div",{className:"wcf-field__data--label"},(0,o.createElement)("label",null))))),(0,o.createElement)("tr",null,(0,o.createElement)("th",{scope:"row"},(0,o.createElement)("div",null,(0,o.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,o.createElement)("div",{className:"wcf-selection-field"},(0,o.createElement)("label",null)))))),(0,o.createElement)("tr",null,(0,o.createElement)("th",{scope:"row"},(0,o.createElement)("div",null,(0,o.createElement)("div",{className:"wcf-select2-field wcf-product-field"},(0,o.createElement)("div",{className:"wcf-selection-field"},(0,o.createElement)("label",null)))))))),(0,o.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,o.createElement)("span",null))),(0,o.createElement)("div",{className:"wcf-order-bump-design-tab__preview"},(0,o.createElement)("div",{className:"wcf-order-bump-design-tab__preview--title"},(0,o.createElement)("label",null)),(0,o.createElement)("div",{className:"wcf-bump-order-wrap wcf-bump-order-style-1 wcf-after-order"},(0,o.createElement)("div",{className:"wcf-bump-order-content"},(0,o.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,o.createElement)("span",null)),(0,o.createElement)("div",{className:"wcf-content-container"},(0,o.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,o.createElement)("div",{className:"wcf-bump-order-offer"},(0,o.createElement)("span",{className:"wcf-bump-order-bump-highlight"})),(0,o.createElement)("div",{className:"wcf-bump-order-desc"})))))))},S$=function(){return(0,o.createElement)("div",{className:"wcf-order-bump-setting-tab is-placeholder"},(0,o.createElement)("table",null,(0,o.createElement)("tbody",null,(0,o.createElement)("tr",null,(0,o.createElement)("th",{scope:"row"},(0,o.createElement)("div",{className:"wcf-field wcf-section-heading-field"},(0,o.createElement)("div",{className:"wcf-field__data--label"},(0,o.createElement)("label",null))))),(0,o.createElement)("tr",null,(0,o.createElement)("th",{scope:"row"},(0,o.createElement)("div",{className:"wcf-field__data--label"},(0,o.createElement)("label",{className:"wcf-field-one"})))),(0,o.createElement)("tr",null,(0,o.createElement)("th",{scope:"row"},(0,o.createElement)("div",{className:"wcf-field__data--label"},(0,o.createElement)("label",{className:"wcf-field-two"})))),(0,o.createElement)("tr",null,(0,o.createElement)("th",{scope:"row"},(0,o.createElement)("div",{className:"wcf-field wcf-section-heading-field"},(0,o.createElement)("div",{className:"wcf-field__data--label"},(0,o.createElement)("label",null))))),(0,o.createElement)("tr",null,(0,o.createElement)("th",{scope:"row"},(0,o.createElement)("div",{className:"wcf-field__data--label"},(0,o.createElement)("label",{className:"wcf-field-one"})))),(0,o.createElement)("tr",null,(0,o.createElement)("th",{scope:"row"},(0,o.createElement)("div",{className:"wcf-field__data--label"},(0,o.createElement)("label",{className:"wcf-field-two"})))))),(0,o.createElement)("div",{className:"wcf-order-bump-save-settings"},(0,o.createElement)("span",null)))},k$=function(){return(0,o.createElement)("div",{className:"wcf-order-bumps-rules-page"},(0,o.createElement)("div",{className:"wcf-order-bumps-rules-page--enable_option"},(0,o.createElement)(kZ,{width:"65%"})),(0,o.createElement)("div",{className:"wcf-order-bumps-rules--group"},Array(3).fill().map((e,t)=>(0,o.createElement)("div",{className:"wcf-order-bumps-rule",key:e},(0,o.createElement)("div",{className:"wcf-order-bumps-rule--select-box"},(0,o.createElement)(DZ,{height:"35px",width:"30%"}),(0,o.createElement)(DZ,{height:"35px",width:"30%"}),(0,o.createElement)(DZ,{height:"35px",width:"30%"})),2!==t&&(0,o.createElement)("div",{className:"wcf-order-bumps-rule__and"},(0,o.createElement)(DZ,{height:"25px",width:"5%"}))))),(0,o.createElement)("div",{className:"wcf-order-bumps-rules--or"},(0,o.createElement)(DZ,{height:"35px",width:"5%"}),(0,o.createElement)(DZ,{height:"45px",width:"12%"})),(0,o.createElement)("div",{className:"wcf-order-bumps-rules-save-settings"},(0,o.createElement)(DZ,{height:"45px",width:"12%"})))},j$=new function(){const e=this;this.compare=function(e,t,n){switch(n){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<t;case"<=":return e<=t;case">":return e>t;case">=":return e>=t;default:return e===t}},this.check=function(t,n){const r="or"===t.relation;let a=!r;return t.fields.map(function(t){let o;return o=t.fields?e.check(t,n):e.compare(n[t.name],t.value,t.operator),r?(o&&(a=!0),!o):o?"":a=!1}),a},this.isActiveControl=function(t,n){const r=!!t?.conditions&&t?.conditions;return!(r&&!e.check(r,n))}},D$=function(){const[{page_settings:e,current_ob:t}]=ZR();if(null===e||"undefined"===e)return(0,o.createElement)(I$,null);const n=e?.settings["multiple-order-bump-design"];return(0,o.createElement)("div",{className:"wcf-order-bump-design-tab"},(0,o.createElement)("div",{className:"wcf-order-bump-design-tab__settings"},n&&Object.keys(n.fields).map(e=>{const r=n.fields[e];let a="";return"borders"===r.id&&(a="grid grid-cols-4 gap-x-2"),"shadow"===r.id&&(a="grid grid-cols-4 gap-x-2"),r.section_fields?(0,o.createElement)("div",{key:e,className:`wcf-order-bump-design-tab--${r.id}-section ${a} border border-border-subtle rounded-md mb-5`},(0,o.createElement)("div",{className:"wcf-order-bump-deign-tab--heading-section col-span-full"},(0,o.createElement)(PY,{label:r.title,labelClass:"block text-base font-semibold text-text-primary mb-5"})),Object.keys(r.section_fields).map(e=>{const n=r.section_fields[e],a=t[n.name],i=j$.isActiveControl(n,t);return(0,o.createElement)(uQ,{key:e,data:n,value:a,isActive:i,field:e,displayAs:"div",tabName:"ob-design"})})):(0,o.createElement)("div",{key:e,className:"wcf-order-bump-design-tab--section mb-5"},(0,o.createElement)(uQ,{key:r.name,data:r,value:t[r.name],isActive:j$.isActiveControl(r,t),field:r.name,displayAs:"div",tabName:"ob-design"}))})))};function C$({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 A$=i.forwardRef(C$),T$=function(){const[{page_settings:e,current_ob:t},n]=ZR(),[r,a]=(0,i.useState)(t?.product[0]?t?.product[0]:""),[s,l]=(0,i.useState)(!1),[c,u]=(0,i.useState)(),d=(0,z.__)("Add","cartflows"),[f,m]=(0,i.useState)({isInProcessing:!1,buttonText:d}),{isInProcessing:p,buttonText:h}=f,g=e?.settings["multiple-order-bump-product"],w=[{value:"",label:"Original",icon:(0,o.createElement)(HR,{className:"w-5 h-5"})},{value:"discount_percent",label:"Percentage",icon:(0,o.createElement)(XR,{className:"w-5 h-5"})},{value:"discount_price",label:"Price",icon:(0,o.createElement)(JR,{className:"w-5 h-5"})},{value:"coupon",label:"Coupon",icon:(0,o.createElement)(A$,{className:"w-5 h-5"})}];return""!==r&&function(){const e=t.discount_type,n=parseFloat(t.discount_value),a=parseFloat(r.original_price);let o=0;"discount_percent"===e?n>0&&(o=a-a*n/100):"discount_price"===e&&n>0&&(o=a-n),r.sell_price=o.toFixed(2)}(),(0,i.useEffect)(()=>{const e=t?.product?.[0];a(e||""),l(!(e&&!e?.is_deleted))},[t]),null===e||"undefined"===e?(0,o.createElement)(M$,null):(0,o.createElement)("div",{className:"wcf-order-bump-product-tab"},""===r&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"border border-solid border-border-subtle 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,o.createElement)("input",{type:"hidden",name:"product"}),(0,o.createElement)("div",{className:"wcf-ob-product-selection-field__add-new flex justify-between items-end gap-5 mt-5"},(0,o.createElement)(nQ,{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,sectionClass:"w-full"}),(0,o.createElement)(Va,{type:"button",variant:"outline",size:"md",icon:(0,o.createElement)(KO,{className:"w-4 h-4"}),iconPosition:"left",loading:p,disabled:p,onClick:function(e){e.preventDefault();const t=c?.value;"active"===cartflows_admin.woocommerce_status&&t&&(m({isInProcessing:!0,buttonText:(0,z.__)("Adding…","cartflows")}),L()({path:`/cartflows-pro/v1/admin/ob-product-data/${t}`}).then(e=>{n({type:"ADD_OB_PRODUCT",product:e}),m({isInProcessing:!1,buttonText:d})}),u())},className:"wcf-select-product-button shrink-0"},h))),""!==r&&(0,o.createElement)(o.Fragment,null,s&&(0,o.createElement)("div",{className:"border border-brand-500 bg-brand-25 text-center text-brand-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,o.createElement)("div",{className:"wcf-ob-product-selection--selected-product flex items-center gap-3 p-3 border border-border-subtle rounded-md"},(0,o.createElement)("div",{className:"wcf-ob-product-selection--product-title whitespace-nowrap text-sm font-medium text-text-primary w-2/5"},(0,o.createElement)("div",{className:"flex gap-3 items-center"},(0,o.createElement)("div",{className:"wcf-ob-product-selection--product-image w-20 h-20"},(0,o.createElement)("img",{src:r.product_image?r.product_image:cartflows_admin.image_placeholder,className:"wcf-ob-product-image rounded-md w-full h-full aspect-{3/2} object-contain",alt:r.label})),(0,o.createElement)("div",{className:"wcf-ob-product-selection--product-title_text"},(0,o.createElement)("div",{className:"wcf-ob-product-repeater-field__title whitespace-normal text-left","data-product_id":r.value},fh(String(r?.label))),(0,o.createElement)("input",{type:"hidden",name:"product",value:r.value?r.value:""}),(0,o.createElement)("div",{className:"wcf-ob-product-repeater-field__reg-price mt-1 "},(0,o.createElement)("div",{className:"flex gap-2"},(0,o.createElement)("span",{className:`wcf-ob-product--reg-price ${0<t.discount_value?"line-through text-text-tertiary":""} `},cartflows_admin.woo_currency+r.original_price),0<t.discount_value&&(0,o.createElement)("span",{className:"wcf-ob-product--sale-price"},cartflows_admin.woo_currency+r.sell_price))),"coupon"===t.discount_type&&(0,o.createElement)("span",{className:"coupon-message text-xs mt-0.5 text-text-secondary"},(0,z.__)("Coupon will apply on checkout page","cartflows"))))),(0,o.createElement)("div",{className:"wcf-ob-product-selection--product-discount__wrapper flex items-end gap-3 justify-start w-[55%]"},(0,o.createElement)("div",{className:"wcf-ob-product-selection--product-qty whitespace-nowrap text-sm text-text-secondary"},(0,o.createElement)(wU,{id:"",name:"quantity",class:"input-field !w-16 !m-0 "+("no"===t.display_quantity_field?"disabled":""),value:t.quantity,min:"1",readonly:"no"===t.display_quantity_field})),(0,o.createElement)("div",{className:"wcf-ob-product-selection--product-discount flex items-end whitespace-nowrap text-sm text-text-secondary gap-3"},(0,o.createElement)(hQ,{name:"discount_type",value:t.discount_type,class:"!m-0",options:w}),"coupon"!==t.discount_type?(0,o.createElement)(wU,{id:"",class:"input-field !w-16 !m-0",name:"discount_value",value:""===t.discount_type?"":t.discount_value,readonly:""===t.discount_type?"readonly":"",placeholder:""===t.discount_type?"":"0",min:"1",step:"any"}):(0,o.createElement)(rQ,{wrapperClass:"w-56",fieldClass:"!border-l-0 !rounded-r-md !rounded-l-none",name:"discount_coupon",placeholder:(0,z.__)("Search for a coupon","cartflows"),multiple:!1,allow_clear:!0,value:""===t.discount_type?"":t.discount_coupon}))),(0,o.createElement)("div",{className:"wcf-product-selection-actions whitespace-nowrap text-right text-sm font-medium w-[5%]"},(0,o.createElement)("div",{className:"wcf-delete-product-item p-2 text-text-tertiary hover:text-brand-500 cursor-pointer flex justify-center items-center",onClick:function(){n({type:"REMOVE_OB_PRODUCT",product:""}),a("")}},(0,o.createElement)(aU,{className:"h-18 w-18"})))),(0,o.createElement)("div",{className:"flex mt-5"},(0,o.createElement)("table",{className:"w-full"},(0,o.createElement)("tbody",null,g&&g.fields&&Object.keys(g.fields).map(e=>{const n=g.fields[e],r=n.name,a=t[r],i=j$.isActiveControl(n,t);return(0,o.createElement)(uQ,{key:e,data:n,value:a,isActive:i,field:e})}))))))},O$=function(){const[{page_settings:e,current_ob:t}]=ZR();if(null===e||"undefined"===e)return(0,o.createElement)(I$,null);const n=e?.settings["multiple-order-bump-content"];return(0,o.createElement)("div",{className:"wcf-order-bump-content-tab"},(0,o.createElement)("div",{className:"wcf-order-bump-content-tab__settings"},Object.keys(n.fields).map(e=>{const r=n.fields[e],a=t[r.name],i=j$.isActiveControl(r,t);return(0,o.createElement)(uQ,{key:e,data:r,value:a,isActive:i,field:e,options:t,displayAs:"div",tabName:"order-bump-content"})})))},L$=function({rules:e,group_id:t,g_index:n,groups_length:r}){const[{page_settings:a},i]=ZR(),s=a?.settings["multiple-order-bump-rules"],l=s.conditions;return(0,o.createElement)(o.Fragment,null,e.map((a,c)=>{const u=a?.rule_id,d=e[c],f=s.field_data[d.condition],m=f?.operator||[],p=d.operator||m[0]?.value||"";return(0,o.createElement)(o.Fragment,null,0!==c&&(0,o.createElement)("div",{className:"wcf-order-bumps-rules--group_rules__condition-label"},(0,o.createElement)("div",{className:"wcf--condition-label__and_group relative"},(0,o.createElement)("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true"},(0,o.createElement)("div",{className:"w-full border-t border-border-subtle border-dashed"})),(0,o.createElement)("div",{className:"relative flex justify-center"},(0,o.createElement)(Yf,{variant:"neutral",type:"rounded",size:"xs",label:(0,z.__)("AND","cartflows"),className:"wcf--condition-label__and_group__text"})))),(0,o.createElement)("div",{className:"wcf-order-bumps-rules--group_rules flex gap-3 items-center","data-rule-id":u,key:u},(0,o.createElement)("input",{type:"hidden",name:`rules[${n}][rules][${c}][rule_id]`,value:u}),(0,o.createElement)("div",{className:"wcf-order-bumps-rules--rule_fields grid gap-3 items-end w-full \n\t\t\t\t\t\t\t\t\t"+(f?.fields?.some(e=>"product"===e.type)?"grid-cols-2":"grid-cols-3")},(0,o.createElement)(WO,{name:`rules[${n}][rules][${c}][condition]`,wrapperClass:"block",options:l,onSelect:()=>{i({type:"RESET_OB_RULE_VALUE",name:"rules",group_id:t,rule_id:u})},value:d.condition}),(0,o.createElement)(WO,{name:`rules[${n}][rules][${c}][operator]`,wrapperClass:"block",options:f.operator,value:fh(String(p))}),function(e,t,r){const a=r.value;let i="";const s=`rules[${n}][rules][${t}][value]`;return e.map(e=>{switch(e.type){case"select2":i=(0,o.createElement)(YR,{name:`${s}[]`,value:a,placeholder:e.placeholder,tooltip:e.tooltip,options:e.options,isMulti:e.isMulti,isSearchable:e?.enable_search});break;case"number":i=(0,o.createElement)(wU,{name:s,value:a,min:0,placeholder:e.placeholder,tooltip:e.tooltip});break;case"coupon":i="exist"===r.operator||"not_exist"===r.operator?(0,o.createElement)(WO,{name:s,options:[{label:"in parent order",value:"parent_order"}]}):(0,o.createElement)(rQ,{name:s,placeholder:e.placeholder,tooltip:e.tooltip,value:a,isMulti:e.isMulti});break;case"product":i=(0,o.createElement)(nQ,{name:s,placeholder:e.placeholder,tooltip:e.tooltip,value:a,isMulti:e.isMulti,sectionClass:"col-span-full",showLabelOnly:!0})}return i})}(f.fields,c,d)),(0,o.createElement)("div",{className:"wcf-order-bumps-rules--rule_actions"},function(e,n){return 1===e&&1===r?"":(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(aU,{className:"w-4 h-4 stroke-2 text-text-tertiary"}),className:"!p-1 hover:!bg-background-secondary [&_svg]:hover:text-brand-700",onClick:e=>{e.currentTarget.setAttribute("rule_id",n),(e=>{const n=e.target.getAttribute("rule_id");t&&n&&i({type:"REMOVE_OB_RULE",name:"rules",rule_id:n,group_id:t})})({target:e.currentTarget})},rule_id:n})}(e.length,u))))}))},z$=e=>(0,o.createElement)("svg",(0,_.A)({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),(0,o.createElement)("circle",{cx:"7",cy:"5",r:"1.25",fill:"currentColor"}),(0,o.createElement)("circle",{cx:"7",cy:"10",r:"1.25",fill:"currentColor"}),(0,o.createElement)("circle",{cx:"7",cy:"15",r:"1.25",fill:"currentColor"}),(0,o.createElement)("circle",{cx:"13",cy:"5",r:"1.25",fill:"currentColor"}),(0,o.createElement)("circle",{cx:"13",cy:"10",r:"1.25",fill:"currentColor"}),(0,o.createElement)("circle",{cx:"13",cy:"15",r:"1.25",fill:"currentColor"})),P$=function(){const[{options:e,current_ob:t},n]=ZR(),[r,a]=(0,i.useState)({ruleGroupId:"",isOpen:!1}),{ruleGroupId:s,isOpen:l}=r;if(null===e||"undefined"===t)return(0,o.createElement)(k$,null);const c=t.rules;if(void 0===c)return(0,o.createElement)(zY,{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=function(e){const t=e.target.getAttribute("data-group_id");a({ruleGroupId:t,isOpen:s!==t||!l})};return(0,o.createElement)("div",{className:"wcf-order-bumps-rules-page"},(0,o.createElement)("div",{className:"wcf-order-bumps-rules-page--enable_option"},(0,o.createElement)(mQ,{name:"is_rule",value:t.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"===t.is_rule&&c&&(0,o.createElement)("div",{className:"mt-8"},(0,o.createElement)(QR.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((e,t)=>{const r=e.group_id,a=e.rules;return(0,o.createElement)("div",{className:"wcf-order-bumps-rules-page--group_wrapper",key:r},(0,o.createElement)("div",{className:"wcf-order-bumps-rules--group border border-solid border-cartflows-border rounded-md shadow-sm bg-background-primary overflow-hidden","data-group-id":r},(0,o.createElement)("input",{type:"hidden",name:`rules[${t}][group_id]`,value:r}),(0,o.createElement)("div",{className:"wcf-order-bumps-rules--group-header bg-background-primary p-4 flex items-center justify-between gap-4"},(0,o.createElement)("div",{className:"wcf-order-bumps-rules--group_header__left flex gap-4 items-center"},(0,o.createElement)("div",{className:"wcf-order-bumps-rule--sortable-toggle flex cursor-move text-text-tertiary hover:text-text-secondary"},(0,o.createElement)(z$,null)),(0,o.createElement)("span",{className:"wcf-group-header--text font-sm font-normal text-text-tertiary"},(0,z.__)("Show this order bump if following conditions are true","cartflows"))),(0,o.createElement)("div",{className:"wcf-order-bumps-rules--group_header__right flex gap-2 items-center"},s===r&&l?(0,o.createElement)(N$,{className:"w-4 h-4 stroke-1 text-text-tertiary hover:text-text-secondary cursor-pointer","aria-hidden":"true",onClick:d,"data-group_id":r}):(0,o.createElement)(Um,{className:"w-4 h-4 stroke-1 text-text-tertiary hover:text-text-secondary cursor-pointer","aria-hidden":"true",onClick:d,"data-group_id":r}))),(0,o.createElement)("div",{id:`wcf-order-bumps-rules--group-${r}`,className:"p-4 bg-background-secondary border-t border-solid border-border-subtle border-0 "+(s===r&&l?"visible":"hidden")},(0,o.createElement)("div",{className:"wcf-order-bumps-rules--group_rules--wrapper flex flex-col gap-4"},0!==a.length&&(0,o.createElement)(L$,{rules:a,group_id:r,g_index:t,groups_length:c.length})),(0,o.createElement)("div",{className:"wcf-order-bumps-rules--add-rule__repeater flex mt-4"},(0,o.createElement)(Va,{variant:"link",size:"sm",icon:(0,o.createElement)(KO,{className:"w-4 h-4 stroke-2"}),iconPosition:"left",className:"wcf-order-bumps-rules--add-rule__button hover:!no-underline",onClick:()=>(e=>{const t={rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""};n({type:"ADD_NEW_OB_RULE",name:"rules",newRule:t,group_id:e})})(r)},(0,z.__)("Add Condition","cartflows"))))),(0,o.createElement)("div",{className:"wcf-order-bumps-rules-page--group_wrapper__footer"},(0,o.createElement)("div",{className:"wcf-order-bumps-rules--or_group relative my-4"},(0,o.createElement)("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true"},(0,o.createElement)("div",{className:"w-full border-t border-border-subtle border-dashed"})),(0,o.createElement)("div",{className:"relative flex justify-center"},(0,o.createElement)(Yf,{variant:"neutral",type:"rounded",size:"xs",label:(0,z.__)("OR","cartflows"),className:"wcf-order-bumps-rules--or_group__text"}))),parseInt(t)+1===c.length&&(0,o.createElement)("div",{className:"wcf-order-bumps-rules--or_group__button mt-4"},(0,o.createElement)(Va,{variant:"outline",size:"md",icon:(0,o.createElement)(KO,{className:"w-4 h-4 stroke-2"}),iconPosition:"left",className:"wcf-order-bumps-rules--or_group_button !bg-brand-25 !text-brand-600 !outline-brand-300 hover:!bg-brand-50 hover:!outline-brand-300",onClick:u},(0,z.__)("Add Conditions Group","cartflows")))))}))))},R$=function(){const[{current_ob:e}]=ZR(),[t,n]=(0,i.useState)(!1),r=()=>{n(!0)},a=()=>{n(!1)},s=e,l=e=>{let t=s?.product;return e&&t&&(Array.isArray(t)&&(t=s?.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}}",s?.quantity)),e},c=()=>(()=>{let e=s?.product;return Array.isArray(e)&&(e=s?.product[0]),"variable"===e?.type||!0===e?.is_variable})()?(0,o.createElement)("div",{className:"wcf-order-bump-choose-variation-preview"},(0,z.__)("Choose a variation","cartflows")):null,u=s?.position,d=fh(l(s?.checkbox_label)||""),f=fh(l(s?.hl_text)||""),m=fh(l(s?.desc_text)||""),p=s?.show_arrow,h=s?.style,g=fh(l(s?.title_text)||""),w=s?.action_element,y=s?.show_animation,b=s?.enable_show_image,v=s?.display_quantity_field,x="yes"===y?"wcf-blink":"",_=(0,o.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,o.createElement)("g",null,(0,o.createElement)("g",null,(0,o.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"})))),E=s?.bg_color,N=s?.border_style,M=s?.border_color,I=s?.box_border_width,S=s?.box_border_radius,k=s?.box_shadow_color,j=""!==s?.box_shadow_horizontal?s?.box_shadow_horizontal:0,D=""!==s?.box_shadow_vertical?s?.box_shadow_vertical:0,C=""!==s?.box_shadow_blur?s?.box_shadow_blur:0,A=""!==s?.box_shadow_spread?s?.box_shadow_spread:0,T=s?.label_color?s?.label_color:"#7a7a7a",O=s?.label_bg_color,L=s?.desc_text_color,P=s?.hl_text_color,R=s?.button_text_color,U=s?.button_text_hover_color,B=s?.button_color,F=s?.button_border_width,Y=s?.button_border_style,Q=s?.button_border_color,V=s?.button_border_radius,W=s?.button_hover_color,Z=s?.title_text_color,G=s?.label_border_style,H=s?.label_border_width,$=s?.label_border_radius,X=s?.label_border_color,q={background:E,borderStyle:N,borderColor:M,borderRadius:""!==S?S+"px":"4px",borderWidth:""!==I?I+"px":"1px",boxShadow:j+"px "+D+"px "+C+"px "+A+"px "+k};let J={},K={},ee={};"style-1"===h?(J={borderColor:M,borderBottomStyle:"inherit"!==N?N:"solid",background:O,borderWidth:I+"px"},q.borderStyle="inherit"!==N?N:"solid"):"style-2"===h?(J={borderColor:M,borderTopStyle:"inherit"!==N?N:"solid",background:O,borderWidth:I+"px"},q.borderStyle="inherit"!==N?N:"solid"):"style-3"===h?q.borderStyle="inherit"!==N?N:"solid":"style-4"===h?(q.borderStyle="inherit"!==N?N:"solid",ee={color:t?U:R,background:t?W:B,borderWidth:""!==F?F+"px":"1px",borderStyle:"inherit"!==Y?Y:"none",borderColor:Q,borderRadius:""!==V?V+"px":"3px"}):"style-5"===h&&(q.borderStyle="inherit"!==N?N:"",K={borderStyle:"inherit"!==G?G:"",borderWidth:H+"px",borderRadius:$+"px",borderColor:X,background:O,padding:O?"5px 10px":"5px 0"},ee={color:t?U:R,background:t?W:B,borderWidth:""!==F?F+"px":"1px",borderStyle:"inherit"!==Y?Y:"solid",borderColor:Q,borderRadius:""!==V?V+"px":"3px"});let te="",ne="left",re="auto";"yes"===b&&(te=s?.product_image,ne=s?.ob_image_position,re=""!==s?.ob_image_width?s?.ob_image_width+"px":"auto"),(0,i.useEffect)(()=>{const e=document.getElementById("wcf-order-bump-preview-wrapper"),t=e.offsetTop-25,n=window.addEventListener("scroll",()=>{window.pageYOffset>t?e.classList.add("sticky"):e.classList.remove("sticky")});return()=>{window.removeEventListener("scroll",n)}},[]);const ae=function(){let e="";return"yes"===v&&(e=(0,o.createElement)("div",{className:"wcf-ob-qty-selection-wrap"},(0,o.createElement)("span",{className:"wcf-ob-qty-selection-btn wcf-ob-qty-decrement wcf-ob-qty-change-icon"},"-"),(0,o.createElement)("input",{type:"number",className:"wcf-order-bump-quantity-updater",name:"wcf_order_bump_quantity",placeholder:"1",defaultValue:s?.quantity,min:"1"}),(0,o.createElement)("span",{className:"wcf-ob-qty-selection-btn wcf-ob-qty-increment wcf-ob-qty-change-icon"},"+"))),e};return(0,o.createElement)("div",{id:"wcf-order-bump-preview-wrapper",className:"wcf-order-bump-preview-wrapper"},(0,o.createElement)("div",{className:`wcf-bump-order-wrap wcf-bump-order-${h} wcf-${u} box-border`,style:q},function(){let e="";return"style-1"===h?e=(0,o.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${ne} `},(0,o.createElement)("div",{className:"wcf-bump-order-field-wrap",style:J},"right"!==ne&&(0,o.createElement)("label",{style:{color:T}},"yes"===p&&_,(0,o.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,o.createElement)("span",{className:"wcf-bump-order-label"},d)),"right"===ne&&(0,o.createElement)("label",{style:{color:T}},(0,o.createElement)("span",{className:"wcf-bump-order-label"},d),(0,o.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),"yes"===p&&_)),(0,o.createElement)("div",{className:"wcf-content-container"},""!==te&&"right"!==ne&&(0,o.createElement)("div",{className:"wcf-bump-order-offer-content-left",style:{width:"auto"!==re?re:""}},(0,o.createElement)("img",{src:te,className:"wcf-image",alt:(0,z.__)("Order Bump Product Image","cartflows")})),(0,o.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,o.createElement)("div",{className:"wcf-bump-order-offer"},(0,o.createElement)("span",{className:"wcf-bump-order-bump-highlight",style:{color:P}},f)),(0,o.createElement)("div",{className:"wcf-bump-order-desc",style:{color:L}},m),c(),ae()),""!==te&&"right"===ne&&(0,o.createElement)("div",{className:"wcf-bump-order-offer-content-left",style:{width:"auto"!==re?re:""}},(0,o.createElement)("img",{src:te,className:"wcf-image",alt:(0,z.__)("Order Bump Product Image","cartflows")})))):"style-2"===h?e=(0,o.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${ne} `},(0,o.createElement)("div",{className:"wcf-bump-order-offer"},(0,o.createElement)("span",{className:"wcf-bump-order-bump-highlight",style:{color:P}},f)),(0,o.createElement)("div",{className:"wcf-content-container"},""!==te&&"right"!==ne&&(0,o.createElement)("div",{className:"wcf-bump-order-offer-content-left",style:{width:"auto"===re?"":re}},(0,o.createElement)("img",{src:te,className:"wcf-image",alt:(0,z.__)("Order Bump Product Image","cartflows")})),(0,o.createElement)("div",{className:"wcf-bump-order-offer-content-right"},(0,o.createElement)("div",{className:"wcf-bump-order-desc",style:{color:L}},m),c(),ae()),""!==te&&"right"===ne&&(0,o.createElement)("div",{className:"wcf-bump-order-offer-content-left",style:{width:"auto"===re?"":re}},(0,o.createElement)("img",{src:te,className:"wcf-image",alt:(0,z.__)("Order Bump Product Image","cartflows")}))),(0,o.createElement)("div",{className:"wcf-bump-order-field-wrap",style:J},"right"!==ne&&(0,o.createElement)("label",{style:{color:T}},"yes"===p&&_,(0,o.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,o.createElement)("span",{className:"wcf-bump-order-label"},d)),"right"===ne&&(0,o.createElement)("label",{style:{color:T}},(0,o.createElement)("span",{className:"wcf-bump-order-label"},d),(0,o.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),"yes"===p&&_))):"style-3"===h?e=(0,o.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${ne} `},"right"!==ne&&(0,o.createElement)("div",{className:"wcf-bump-order-field-wrap"},""!==te&&"top"!==ne&&(0,o.createElement)("div",{className:"wcf-bump-order-action"},"yes"===p&&_,(0,o.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),""!==te&&(0,o.createElement)("div",{className:"wcf-bump-order-image",style:{maxWidth:"auto"!==re?re:""}},(0,o.createElement)("img",{src:te,className:"wcf-image",alt:(0,z.__)("Order Bump Product Image","cartflows")})),(0,o.createElement)("div",{className:"wcf-bump-order-text"},(0,o.createElement)("div",{className:"wcf-bump-order-label"},""===te&&(0,o.createElement)(o.Fragment,null,"yes"===p&&_,(0,o.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),""!==te&&"top"===ne&&(0,o.createElement)(o.Fragment,null,"yes"===p&&_,(0,o.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""})),(0,o.createElement)("label",{style:{color:Z}},g)),(0,o.createElement)("div",{className:"wcf-bump-order-desc",style:{color:L}},m),c(),ae())),"right"===ne&&(0,o.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,o.createElement)("div",{className:"wcf-bump-order-text"},(0,o.createElement)("div",{className:"wcf-bump-order-label"},(0,o.createElement)("label",{style:{color:Z}},g),""===te&&(0,o.createElement)(o.Fragment,null,"yes"===p&&_,(0,o.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}))),(0,o.createElement)("div",{className:"wcf-bump-order-desc",style:{color:L}},m),c(),ae()),""!==te&&(0,o.createElement)("div",{className:"wcf-bump-order-image",style:{maxWidth:"auto"!==re?re:""}},(0,o.createElement)("img",{src:te,className:"wcf-image",alt:(0,z.__)("Order Bump Product Image","cartflows")})),""!==te&&(0,o.createElement)("div",{className:"wcf-bump-order-action"},(0,o.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),"yes"===p&&_))):"style-4"===h?e=(0,o.createElement)("div",{className:`wcf-bump-order-content wcf-bump-order-image-${ne} `},(0,o.createElement)("div",{className:"wcf-bump-order-field-wrap"},""!==te&&"right"!==ne&&(0,o.createElement)("div",{className:"wcf-bump-order-image"},(0,o.createElement)("img",{src:te,className:"wcf-image",style:{width:"auto"===re?"100px":re},alt:(0,z.__)("Order Bump Product Image","cartflows")})),"right"!==ne&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-bump-order-text"},(0,o.createElement)("div",{className:"wcf-bump-order-info"},(0,o.createElement)("div",{className:"wcf-bump-order-label"},(0,o.createElement)("label",{style:{color:Z}},g)),(0,o.createElement)("div",{className:"wcf-bump-order-desc",style:{color:L}},m),c(),ae())),(0,o.createElement)("div",{className:"wcf-bump-order-action"},(0,o.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,o.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:ee,onMouseEnter:r,onMouseLeave:a},(0,z.__)("Add","cartflows")))),"right"===ne&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-bump-order-action"},(0,o.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,o.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:ee,onMouseEnter:r,onMouseLeave:a},(0,z.__)("Add","cartflows"))),(0,o.createElement)("div",{className:"wcf-bump-order-text"},(0,o.createElement)("div",{className:"wcf-bump-order-info"},(0,o.createElement)("div",{className:"wcf-bump-order-label"},(0,o.createElement)("label",{style:{color:Z}},g)),(0,o.createElement)("div",{className:"wcf-bump-order-desc",style:{color:L}},m),c(),ae()))),""!==te&&"right"===ne&&(0,o.createElement)("div",{className:"wcf-bump-order-image"},(0,o.createElement)("img",{src:te,className:"wcf-image",style:{width:"auto"===re?"100px":re},alt:(0,z.__)("Order Bump Product Image","cartflows")})))):"style-5"===h&&(e=(0,o.createElement)("div",{className:"wcf-bump-order-content"},(0,o.createElement)("div",{className:"wcf-bump-order-field-wrap"},(0,o.createElement)("div",{className:`wcf-bump-order-info wcf-bump-order-image-${ne} `},""!==te&&"right"!==ne&&(0,o.createElement)("div",{className:"wcf-bump-order-image"},(0,o.createElement)("img",{src:te,className:"wcf-image",style:{width:re},alt:(0,z.__)("Order Bump Product Image","cartflows")})),(0,o.createElement)("div",{className:"wcf-bump-order-text"},""!==g&&(0,o.createElement)("div",{className:"wcf-bump-order-label",style:{color:Z}},(0,o.createElement)("span",null,g)),""!==m&&(0,o.createElement)("div",{className:"wcf-bump-order-desc",style:{color:L}},m),c(),ae(),"checkbox"===w&&(0,o.createElement)("div",{className:"wcf-bump-order-action",style:K},"yes"===p&&_,(0,o.createElement)("input",{type:"checkbox",id:"wcf-bump-order-cb",className:"wcf-bump-order-cb",name:"wcf-bump-order-cb",value:""}),(0,o.createElement)("label",{style:{color:T}},d)),"button"===w&&(0,o.createElement)("div",{className:"wcf-bump-order-action wcf-ob-action-button"},(0,o.createElement)("a",{className:"wcf-bump-order-cb-button wcf-bump-add-to-cart",style:ee,onMouseEnter:r,onMouseLeave:a},(0,z.__)("Add","cartflows")))),""!==te&&"right"===ne&&(0,o.createElement)("div",{className:"wcf-bump-order-image"},(0,o.createElement)("img",{src:te,className:"wcf-image",style:{width:re},alt:(0,z.__)("Order Bump Product Image","cartflows")})))))),e}()))};function U$({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 B$=i.forwardRef(U$);function F$({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"}))}const Y$=i.forwardRef(F$);function Q$({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 V$=i.forwardRef(Q$);function W$({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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"}),i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}const Z$=i.forwardRef(W$),G$=()=>{const[{flow_id:e,step_id:t,current_ob:n},r]=ZR(),[,a]=g();return{saveOrderBump:(0,i.useCallback)(()=>{a({status:"PROCESSING"});const o=document.querySelector(".wcf-slide-out-panel--form, .wcf-step-settings-view");if(!o)return a({status:"RESET"}),Promise.resolve(!1);if(null===n)return a({status:"SAVED"}),Promise.resolve(!0);if("undefined"!=typeof tinymce){const e=tinymce.get("wcf-order-bump-desc-editor");e&&e.save()}const i=new window.FormData(o),s=n.id;return i.append("action","cartflows_pro_save_order_bump_settings"),i.append("security",cartflows_admin.save_order_bump_settings_nonce),i.append("post_id",e),i.append("step_id",t),i.append("ob_id",s),L()({url:cartflows_admin.ajax_url,method:"POST",body:i}).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",s),e.append("step_id",t),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>(e.data&&e.data.success&&e.data.current_ob&&r({type:"SET_CURRENT_OB",current_ob:e.data.current_ob,ob_id:s}),a({status:"SAVED"}),window.wcfUnsavedChanges=!1,!0))}return a({status:"RESET"}),!1}).catch(e=>(console.error(e),a({status:"RESET"}),!1))},[e,t,n,r,a])}},H$=function(e){const[{step_id:t,options:n,current_ob:r},a]=ZR(),[s,l]=(0,i.useState)("product"),c=new URLSearchParams((0,b.useLocation)().search),u=e.ob_id,d=c.get("obtab"),f=$V(),{saveOrderBump:m}=G$();!function(){const[{current_ob:e},t]=ZR(),n=function(n){const{name:r,value:a}=n.detail;if(r.includes("[")){const n=r.split("["),o=[];for(let e=1;e<n.length;e++)o.push(n[e].split("]")[0]);const i=r.substr(0,r.indexOf("[")),s=e[i];switch(o.length){case 2:s[o[0]][o[1]]=a;break;case 4:s[o[0]][o[1]][o[2]][o[3]]=a}t({type:"SET_OB_OPTION",name:i,value:s})}void 0!==e&&(window.wcfUnsavedChanges=!0,t({type:"SET_OB_OPTION",name:r,value:a}))},r=[{type:"select"},{type:"select2"},{type:"checkbox"},{type:"text"},{type:"textarea"},{type:"code"},{type:"number"},{type:"radio"},{type:"color"},{type:"font"},{type:"product"},{type:"coupon"},{type:"image-selector"},{type:"wpeditor"},{type:"toggle"},{type:"selectioncard"}];(0,i.useEffect)(()=>(e&&r.map(function(e){return document.addEventListener(`wcf:${e.type}:change`,n),""}),()=>{r.map(function(e){return document.removeEventListener(`wcf:${e.type}:change`,n),""})}),[e])}();const p=[{name:(0,z.__)("Product","cartflows"),slug:"product",icon:(0,o.createElement)(B$,{className:"w-18 h-18 stroke-2"})},{name:(0,z.__)("Content","cartflows"),slug:"content",icon:(0,o.createElement)(Y$,{className:"w-18 h-18 stroke-2"})},{name:(0,z.__)("Styles","cartflows"),slug:"styles",icon:(0,o.createElement)(V$,{className:"w-18 h-18 stroke-2"})},{name:(0,z.__)("Conditions","cartflows"),slug:"conditions",icon:(0,o.createElement)(Z$,{className:"w-18 h-18 stroke-2"})}];if((0,i.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",t),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.data.success&&a({type:"SET_CURRENT_OB",current_ob:e.data.current_ob,ob_id:u})})}(),null!==n&&"undefined"!==n||L()({path:`/cartflows/v1/admin/step-data/${t}`}).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}a({type:"SET_STEP_DATA",data:e})})})(),()=>{}),[]),null===r||"undefined"===r||r&&u!==r.id){let e="";switch(d){case"design":case"content":e=(0,o.createElement)(I$,null);break;case"product":default:e=(0,o.createElement)(M$,null);break;case"settings":e=(0,o.createElement)(S$,null);break;case"conditions":e=(0,o.createElement)(k$,null)}return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Gp,{containerType:"flex",direction:"column",className:"wcf-page-wrapper wcf-order-bump-page-wrapper"},e))}return(0,o.createElement)(Gp,{containerType:"flex",direction:"column",gap:"md",className:"wcf-order-bump-page-wrapper p-6 bg-background-secondary rounded-b-lg"},(0,o.createElement)("div",{className:"wcf-order-bump-content-tab__preview"},(0,o.createElement)(R$,null)),(0,o.createElement)(AQ.Group,{variant:"pill",size:"sm",width:"full",activeItem:s,onChange:({value:e})=>async function(e){e!==s?(await async function(){return!!window.wcfUnsavedChanges&&await f({title:(0,z.__)("Save Changes","cartflows"),description:(0,z.__)("You have made changes. Do you want to save the changes?","cartflows"),actionBtnText:(0,z.__)("Save","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows"),onConfirm:m})}()||l(e),window.wcfUnsavedChanges=!1):l(e)}(e.slug),className:"wcf-order-bump--tabs-wrapper mt-8 mb-4"},p.map(e=>(0,o.createElement)(AQ.Tab,{key:e.slug,slug:e.slug,text:e.name,icon:e.icon}))),function(){let e=(0,o.createElement)("h1",null,"404 Not Found");switch(s){case"styles":e=(0,o.createElement)(D$,null);break;case"product":default:e=(0,o.createElement)(T$,null);break;case"content":e=(0,o.createElement)(O$,null);break;case"conditions":e=(0,o.createElement)(P$,null)}return(0,o.createElement)(o.Fragment,null,e)}())};function $$({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"}))}const X$=i.forwardRef($$),q$=({role:e="plain",onStartAb:t,onDeclareWinner:n,onArchive:r})=>{const a="plain"===e,i="control"===e||"variant"===e,s="variant"===e;return a||i||s?(0,o.createElement)(Nm,{placement:"bottom-end",className:"wcf-ob-ab-action-menu"},(0,o.createElement)(Nm.Trigger,null,(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"text-text-secondary hover:text-text-primary","aria-label":(0,z.__)("More Options","cartflows")},(0,o.createElement)(eU,{className:"h-5 w-5","aria-hidden":"true"}))),(0,o.createElement)(Nm.ContentWrapper,{className:"z-20"},(0,o.createElement)(Nm.Content,{size:"sm",className:"wcf-ob-ab-action-menu__dropdown"},(0,o.createElement)(Nm.List,null,a&&(0,o.createElement)(Nm.Item,{onClick:t,className:"wcf-ob-ab-action-menu__start hover:!bg-brand-25 hover:!text-brand-600"},(0,o.createElement)(X$,{className:"w-4 h-4"}),(0,z.__)("Start A/B Test","cartflows")),i&&(0,o.createElement)(Nm.Item,{onClick:n,className:"wcf-ob-ab-action-menu__winner hover:!bg-brand-25 hover:!text-brand-600"},(0,o.createElement)(qH,{className:"w-4 h-4"}),(0,z.__)("Declare as Winner","cartflows")),s&&(0,o.createElement)(Nm.Item,{onClick:r,className:"wcf-ob-ab-action-menu__archive hover:!bg-brand-25 hover:!text-brand-600"},(0,o.createElement)($H,{className:"w-4 h-4"}),(0,z.__)("Archive Variation","cartflows")))))):null},J$=({impressions:e=0,initiated:t=0,conversions:n=0,isWinner:r=!1})=>{const a=((e,t)=>!e||e<=0?"—":`${(t/e*100).toFixed(1)}%`)(e,n);let i="green";!r&&e>0&&(e>0?n/e*100:0)<5&&(i="yellow");const s=r?"ring-1 ring-support-success":"",l=r?(0,z.sprintf)(/* translators: %s: conversion rate percentage */ /* translators: %s: conversion rate percentage */ |
| 52 |
(0,z.__)("Conversion Rate %s · winner","cartflows"),a):(0,z.sprintf)(/* translators: %s: conversion rate percentage */ /* translators: %s: conversion rate percentage */ |
| 53 |
(0,z.__)("Conversion Rate %s","cartflows"),a);return(0,o.createElement)(Gp,{containerType:"flex",align:"center",className:"wcf-ob-funnel-ribbon flex items-center gap-5 py-2 pl-7 pr-4 border-0 border-t border-solid border-border-subtle bg-background-secondary"},(0,o.createElement)(Gp,{containerType:"flex",align:"center",gap:"xs"},(0,o.createElement)(Ja,{content:(0,z.__)("Visitors who saw this bump.","cartflows"),placement:"top",arrow:!0},(0,o.createElement)($G,{className:"w-3.5 h-3.5 text-text-tertiary cursor-pointer"})),(0,o.createElement)(th,{size:12,weight:600,className:"tracking-wider text-text-tertiary"},(0,z.__)("Impressions","cartflows")),(0,o.createElement)(th,{size:14,weight:600,className:"text-text-primary"},e)),(0,o.createElement)(th,{size:14,className:"text-text-tertiary"},"›"),(0,o.createElement)(Gp,{containerType:"flex",align:"center",gap:"xs"},(0,o.createElement)(Ja,{content:(0,z.__)("Visitors who added this bump to their cart.","cartflows"),placement:"top",arrow:!0},(0,o.createElement)($G,{className:"w-3.5 h-3.5 text-text-tertiary cursor-pointer"})),(0,o.createElement)(th,{size:12,weight:600,className:"tracking-wider text-text-tertiary"},(0,z.__)("Initiated","cartflows")),(0,o.createElement)(th,{size:14,weight:600,className:"text-text-primary"},t)),(0,o.createElement)(th,{size:14,className:"text-text-tertiary"},"›"),(0,o.createElement)(Gp,{containerType:"flex",align:"center",gap:"xs"},(0,o.createElement)(Ja,{content:(0,z.__)("Orders placed that include this bump.","cartflows"),placement:"top",arrow:!0},(0,o.createElement)($G,{className:"w-3.5 h-3.5 text-text-tertiary cursor-pointer"})),(0,o.createElement)(th,{size:12,weight:600,className:"tracking-wider text-text-tertiary"},(0,z.__)("Conversions","cartflows")),(0,o.createElement)(th,{size:14,weight:600,className:"text-text-primary"},n)),(0,o.createElement)(Gp,{containerType:"flex",align:"center",gap:"xs",className:"ml-auto"},(0,o.createElement)(Ja,{content:(0,z.__)("Percentage of impressions that became orders.","cartflows"),placement:"top",arrow:!0},(0,o.createElement)($G,{className:"w-3.5 h-3.5 text-text-tertiary cursor-pointer"})),(0,o.createElement)(Yf,{label:l,variant:i,type:"pill",size:"xs",className:s,disableHover:!0})))},K$={impressions:0,initiated:0,conversions:0},eX=()=>{const[e]=ZR(),t=e?.options?.ob_ab_stats;return t&&"object"==typeof t?t:{}},tX=(e,t={})=>{if(!e||!e.id)return{...K$};const n=e["wcf-control-ob"]?e["wcf-control-ob"]:e.id,r=t[n]?.[e.id];return r&&"object"==typeof r?{impressions:parseInt(r.impressions||0,10),initiated:parseInt(r.initiated||0,10),conversions:parseInt(r.conversions||0,10)}:{...K$}},nX=e=>e&&e.impressions?e.conversions/e.impressions*100:null,rX=(e,t,n={})=>{const r=new window.FormData;return r.append("action",e),r.append("security",cartflows_admin[t]),Object.entries(n).forEach(([e,t])=>{r.append(e,t)}),r},aX=e=>L()({url:cartflows_admin.ajax_url,method:"POST",body:e}),oX=()=>({createVariation:(0,i.useCallback)(({stepId:e,ob_id:t})=>aX(rX("cartflows_pro_create_order_bump_variation","create_order_bump_variation_nonce",{step_id:e,ob_id:t})),[]),cloneVariation:(0,i.useCallback)(({stepId:e,control_ob_id:t,source_ob_id:n})=>aX(rX("cartflows_pro_clone_order_bump_variation","clone_order_bump_variation_nonce",{step_id:e,control_ob_id:t,source_ob_id:n})),[]),startAbTest:(0,i.useCallback)(({stepId:e,control_ob_id:t})=>aX(rX("cartflows_pro_start_order_bump_ab_test","start_order_bump_ab_test_nonce",{step_id:e,control_ob_id:t})),[]),pauseAbTest:(0,i.useCallback)(({stepId:e,control_ob_id:t})=>aX(rX("cartflows_pro_pause_order_bump_ab_test","pause_order_bump_ab_test_nonce",{step_id:e,control_ob_id:t})),[]),saveTraffic:(0,i.useCallback)(({stepId:e,control_ob_id:t,variations:n})=>aX(rX("cartflows_pro_save_order_bump_ab_traffic","save_order_bump_ab_traffic_nonce",{step_id:e,control_ob_id:t,variations:JSON.stringify(n)})),[]),archiveVariation:(0,i.useCallback)(({stepId:e,control_ob_id:t,ob_id:n})=>aX(rX("cartflows_pro_archive_order_bump_variation","archive_order_bump_variation_nonce",{step_id:e,control_ob_id:t,ob_id:n})),[]),deleteVariation:(0,i.useCallback)(({stepId:e,control_ob_id:t,ob_id:n})=>aX(rX("cartflows_pro_delete_order_bump_variation","delete_order_bump_variation_nonce",{step_id:e,control_ob_id:t,ob_id:n})),[]),declareWinner:(0,i.useCallback)(({stepId:e,control_ob_id:t,winner_ob_id:n})=>aX(rX("cartflows_pro_declare_order_bump_ab_winner","declare_order_bump_ab_winner_nonce",{step_id:e,control_ob_id:t,winner_ob_id:n})),[]),restoreArchived:(0,i.useCallback)(({stepId:e,control_ob_id:t,ob_id:n})=>aX(rX("cartflows_pro_restore_archive_order_bump_variation","restore_archive_order_bump_variation_nonce",{step_id:e,control_ob_id:t,ob_id:n})),[]),deleteArchived:(0,i.useCallback)(({stepId:e,control_ob_id:t,ob_id:n})=>aX(rX("cartflows_pro_delete_archive_order_bump_variation","delete_archive_order_bump_variation_nonce",{step_id:e,control_ob_id:t,ob_id:n})),[]),toggleBumpStatus:(0,i.useCallback)(({stepId:e,flowId:t,ob_id:n,currentStatus:r})=>aX(rX("cartflows_pro_update_order_bump_status","update_order_bump_status_nonce",{step_id:e,post_id:t,ob_id:n,ob_status:!r})),[]),cloneBump:(0,i.useCallback)(({stepId:e,ob_id:t})=>aX(rX("cartflows_pro_clone_order_bump","clone_order_bump_nonce",{step_id:e,ob_id:t})),[]),deleteBump:(0,i.useCallback)(({stepId:e,flowId:t,ob_id:n})=>aX(rX("cartflows_pro_delete_order_bump","delete_order_bump_nonce",{step_id:e,post_id:t,ob_id:n})),[])}),iX=e=>{const t=parseInt(e,10);return Number.isNaN(t)?0:Math.max(0,Math.min(100,t))},sX=e=>{const t={};return(e||[]).forEach(e=>{t[e.id]=iX(e.traffic)}),t},lX=function(e){const{flow_id:t,step_id:n,data:r,callback:a,dispatch:s,onEditClick:l,openObSettingsId:c="",toggleObSettings:u}=e,[{},d]=ZR(),f=s||d,m=eX(),p=tX(r,m),[h,g]=(0,i.useState)(r.status),[w,y]=(0,i.useState)(!1),[b,v]=(0,i.useState)(""),[x,_]=(0,i.useState)(!1),[E,N]=(0,i.useState)(!1),M=(0,i.createRef)(),I=c===r.id,S=$V(),k=oX();(0,i.useEffect)(()=>{g(h)},[h,I]);let j=r.title;const D=function(e){e.preventDefault(),_(!0)},C=function(e){e.preventDefault(),_(!1)};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-order-bump border-0 border-t border-border-subtle border-solid first:border-t-0",onDragEnd:a},(0,o.createElement)(Gp,{containerType:"flex",align:"center",className:"wcf-order-bump__content-wrapper relative p-6 text-sm gap-2"},(0,o.createElement)("div",{className:"wcf-order-bump__data wcf-column--product w-[70%]"},(0,o.createElement)("div",{className:"wcf-order-bump__data-title flex items-center gap-2 min-h-8"},(0,o.createElement)("span",{className:"text-sm font-medium text-text-primary flex gap-2 justify-center items-center min-h-8"},function(){""===j&&(j=(0,z.__)("(no title)","cartflows"));let e=Ch(j,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length),t=(0,o.createElement)(Ja,{content:(0,z.__)("Edit Order Bump Name","cartflows"),placement:"bottom"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(cW,{className:"w-4 h-4 stroke-1"}),onClick:D,className:"wcf-ob-header__title--edit"}));return x&&(e=(0,o.createElement)(dp,{size:"sm",ref:M,defaultValue:j,className:"new-step-title focus:!ring-0 focus:!ring-offset-0 !h-8 [&>input]:!h-8 [&>input]:!min-h-8 [&>input]:!py-1"}),t=(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"primary",size:"xs",loading:E,onClick:()=>function(e){N(!0);const t=M.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",t),r.append("ob_id",e),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{f({type:"SET_OB_TITLE",title:t,name:"wcf-order-bumps",ob_id:e}),N(!1),_(!1),pp.success((0,z.__)("Order bump title updated!","cartflows"))})}(r.id)},(0,z.__)("Save","cartflows")),(0,o.createElement)(Va,{variant:"secondary",size:"xs",onClick:C},(0,z.__)("Cancel","cartflows")))),(0,o.createElement)(o.Fragment,null,(0,o.createElement)("span",{className:"wcf-ob-header__title--text"},e),(0,o.createElement)("span",{className:"wcf-ob-header__title--buttons flex gap-2"},t))}()),""===r.product&&(0,o.createElement)(Yf,{label:(0,z.__)("No product","cartflows"),variant:"warning",icon:(0,o.createElement)(dW,{className:"w-4 h-4"}),size:"xs"}))),(0,o.createElement)(Gp,{containerType:"flex",gap:"xs",className:"wcf_order_bump__status w-[12%]"},(0,o.createElement)(bO,{value:h,size:"md",onChange:()=>function(e){y(!0);const r=new window.FormData;r.append("action","cartflows_pro_update_order_bump_status"),r.append("security",cartflows_admin.update_order_bump_status_nonce),r.append("ob_id",e),r.append("post_id",t),r.append("step_id",n),r.append("ob_status",!h),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{f({type:"SET_OB_STATUS",name:"wcf-order-bumps",newStatus:!h,ob_id:e}),g(!h),y(!1),pp.success(h?(0,z.__)("Order bump disabled!","cartflows"):(0,z.__)("Order bump enabled!","cartflows"))})}(r.id),disabled:w}),w&&(0,o.createElement)(LO,{size:"sm",variant:"primary"})),(0,o.createElement)(Gp,{containerType:"flex",justify:"end",align:"center",gap:"sm",className:"wcf-order-bump__action wcf-column--actions shrink-0 ml-auto"},(0,o.createElement)(Ja,{content:(0,z.__)("Duplicate Order Bump","cartflows"),placement:"bottom"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:"clone"===b?(0,o.createElement)(LO,{size:"sm"}):(0,o.createElement)(hW,{className:"w-4 h-4 stroke-1"}),onClick:()=>(e=>{const t=new window.FormData;v("clone"),t.append("action","cartflows_pro_clone_order_bump"),t.append("security",cartflows_admin.clone_order_bump_nonce),t.append("ob_id",e),t.append("step_id",n),L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(e=>{e.success&&(f({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:e.data.order_bumps}),v(""),pp.success((0,z.__)("Order bump cloned!","cartflows")))})})(r.id),className:"wcf-clone-bump-button"})),(0,o.createElement)(Ja,{content:(0,z.__)("Edit Order Bump","cartflows"),placement:"bottom"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(Z$,{className:"w-4 h-4 stroke-1"}),onClick:()=>{return e=r.id,void("function"!=typeof l?u?.(e):l(e));var e},className:"wcf-setting-bump-button "+(I?"!bg-brand-50 !text-brand-500":"")})),(0,o.createElement)(Ja,{content:(0,z.__)("Delete Order Bump","cartflows"),placement:"bottom"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:"delete"===b?(0,o.createElement)(LO,{size:"sm"}):(0,o.createElement)(aU,{className:"w-4 h-4 stroke-1"}),onClick:()=>async function(e){if(!await S({title:(0,z.__)("Delete Order Bump","cartflows"),description:(0,z.__)("Do you really want to delete this order bump permanently?","cartflows"),actionBtnText:(0,z.__)("Delete","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")}))return;v("delete");const r=new window.FormData;r.append("action","cartflows_pro_delete_order_bump"),r.append("security",cartflows_admin.delete_order_bump_nonce),r.append("ob_id",e),r.append("post_id",t),r.append("step_id",n),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(t=>{t.success&&(f({type:"REMOVE_ORDER_BUMP",name:"wcf-order-bumps",ob_id:e}),v(""),pp.success((0,z.__)("Order bump deleted!","cartflows")))})}(r.id),className:"wcf-remove-order-bump-button"})),(0,o.createElement)(q$,{role:"plain",onStartAb:async()=>{const e=await k.createVariation({stepId:n,ob_id:r.id});e?.success&&(f({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:e.data.order_bumps}),pp.success((0,z.__)("A/B test variation created!","cartflows")))}}))),(0,o.createElement)(J$,{impressions:p.impressions,initiated:p.initiated,conversions:p.conversions})),I&&(0,o.createElement)(H$,{ob_id:r.id}))},cX=({abTestStart:e,onToggle:t,onOpenSettings:n})=>{const[r,a]=(0,i.useState)(!1),s=e?(0,z.__)("Stopping…","cartflows"):(0,z.__)("Starting…","cartflows"),l=e?(0,z.__)("Stop Split Test","cartflows"):(0,z.__)("Start Split Test","cartflows"),c=r?s:l;return(0,o.createElement)("div",{className:"wcf-ob-ab-head w-full block bg-background-secondary border-0 border-b border-solid border-border-subtle"},(0,o.createElement)(Gp,{containerType:"flex",align:"center",justify:"between",className:"px-6 py-3"},(0,o.createElement)(Gp,{containerType:"flex",align:"center",gap:"xs"},(0,o.createElement)("span",{className:"text-sm font-medium text-text-primary"},(0,z.__)("Split Test","cartflows")),(0,o.createElement)(Yf,{label:e?(0,z.__)("RUNNING","cartflows"):(0,z.__)("PAUSED","cartflows"),variant:e?"green":"neutral",type:"pill",size:"xs"})),(0,o.createElement)(Gp,{containerType:"flex",align:"center",gap:"sm"},(0,o.createElement)(Va,{variant:"link",size:"sm",loading:r,onClick:async()=>{if(!r){a(!0);try{await(t?.())}finally{a(!1)}}},disabled:r,className:e?"wcf-ob-ab-head__stop !text-brand-500 hover:!text-brand-600":"wcf-ob-ab-head__start !text-support-success hover:!text-support-success-hover"},c),(0,o.createElement)(Ja,{content:(0,z.__)("Split Test Settings","cartflows"),placement:"bottom"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(Z$,{className:"w-4 h-4 stroke-1"}),onClick:n,className:"wcf-ob-ab-head__settings","aria-label":(0,z.__)("Split Test Settings","cartflows")})))))},uX=()=>(0,o.createElement)(Yf,{label:(0,z.__)("Control","cartflows"),variant:"blue",type:"pill",size:"xs"}),dX=({number:e})=>(0,o.createElement)(Yf,{label:(0,z.sprintf)((0,z.__)("Variation-%d","cartflows"),e),variant:"inverse",type:"pill",size:"xs"}),fX=()=>(0,o.createElement)(Yf,{label:(0,z.__)("Winner","cartflows"),variant:"green",type:"pill",size:"xs",icon:(0,o.createElement)(qH,{className:"w-3 h-3"})}),mX=({bump:e,role:t="plain",variantNumber:n=1,traffic:r,stepId:a,dispatch:s,onDuplicateClick:l,onSettingsClick:c,isSettingsOpen:u=!1,onDeleteClick:d,onMenuStartAb:f,onMenuDeclareWinner:m,onMenuArchive:p,onStatusToggle:h,statusProcess:g,actionProcess:w,readOnly:y=!1,isWinner:b=!1})=>{const v=eX(),x=tX(e,v),[_,E]=(0,i.useState)(!1),[N,M]=(0,i.useState)(!1),I=(0,i.createRef)(),S="control"===t?(0,o.createElement)(uX,null):"variant"===t?(0,o.createElement)(dX,{number:n}):"winner"===t?(0,o.createElement)(fX,null):null,k=""===e.title?(0,z.__)("(no title)","cartflows"):e.title,j=Ch(k,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length);return(0,o.createElement)("div",{className:`wcf-order-bump wcf-order-bump--ab wcf-order-bump--${t} border-b border-border-subtle border-solid border-0 last:border-0`},(0,o.createElement)(Gp,{containerType:"flex",align:"center",className:"wcf-order-bump__content-wrapper relative p-6 text-sm gap-2"},(0,o.createElement)("div",{className:"wcf-order-bump__data wcf-column--product w-[70%]"},(0,o.createElement)("div",{className:"wcf-order-bump__data-title flex items-center gap-2 min-h-8"},(0,o.createElement)("span",{className:"text-sm font-medium text-text-primary flex gap-2 justify-center items-center min-h-8"},!_&&(0,o.createElement)("span",{className:"wcf-ob-header__title--text"},j),_&&(0,o.createElement)(dp,{size:"sm",ref:I,defaultValue:k,className:"new-step-title focus:!ring-0 focus:!ring-offset-0 !h-8 [&>input]:!h-8 [&>input]:!min-h-8 [&>input]:!py-1"}),!_&&S,!_&&""===e.product&&(0,o.createElement)(Yf,{label:(0,z.__)("No product","cartflows"),variant:"warning",icon:(0,o.createElement)(dW,{className:"w-4 h-4"}),size:"xs"}),(0,o.createElement)("span",{className:"wcf-ob-header__title--buttons flex gap-2"},!_&&!y&&(0,o.createElement)(Ja,{content:(0,z.__)("Edit Order Bump Name","cartflows"),placement:"bottom"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(cW,{className:"w-4 h-4 stroke-1"}),onClick:e=>{e.preventDefault(),E(!0)},className:"wcf-ob-header__title--edit"})),_&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"primary",size:"xs",loading:N,onClick:()=>{if(N)return;const t=I.current?.value||"",n=new window.FormData;n.append("action","cartflows_pro_update_order_bump_title"),n.append("security",cartflows_admin.update_order_bump_title_nonce),n.append("step_id",a),n.append("new_title",t),n.append("ob_id",e.id),M(!0),L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{s?.({type:"SET_OB_TITLE",name:"wcf-order-bumps",title:t,ob_id:e.id}),M(!1),E(!1),pp.success((0,z.__)("Order bump title updated!","cartflows"))})}},(0,z.__)("Save","cartflows")),(0,o.createElement)(Va,{variant:"secondary",size:"xs",onClick:e=>{e.preventDefault(),E(!1)}},(0,z.__)("Cancel","cartflows")))),!_&&void 0!==r&&(0,o.createElement)("span",{className:"text-xs text-text-tertiary ml-2"},(0,z.__)("Traffic:","cartflows")," ",(0,o.createElement)("b",{className:"text-text-primary"},r,"%"))))),(0,o.createElement)(Gp,{containerType:"flex",gap:"xs",className:"wcf_order_bump__status w-[13%]"},(0,o.createElement)(bO,{value:!!e.status,size:"md",onChange:()=>h?.(e.id),disabled:!!g||y}),g&&(0,o.createElement)(LO,{size:"sm",variant:"primary"})),(0,o.createElement)(Gp,{containerType:"flex",justify:"end",align:"center",gap:"sm",className:"wcf-order-bump__action wcf-column--actions shrink-0 ml-auto"},!y&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Ja,{content:(0,z.__)("Duplicate Order Bump","cartflows"),placement:"bottom"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:"clone"===w?(0,o.createElement)(LO,{size:"sm"}):(0,o.createElement)(hW,{className:"w-4 h-4 stroke-1"}),onClick:()=>l?.(e.id),className:"wcf-clone-bump-button"})),(0,o.createElement)(Ja,{content:(0,z.__)("Edit Order Bump","cartflows"),placement:"bottom"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(Z$,{className:"w-4 h-4 stroke-1"}),onClick:()=>c?.(e.id),className:"wcf-setting-bump-button "+(u?"!bg-brand-50 !text-brand-500":"")})),(0,o.createElement)(Ja,{content:(0,z.__)("Delete Variation","cartflows"),placement:"bottom"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:"delete"===w?(0,o.createElement)(LO,{size:"sm"}):(0,o.createElement)(aU,{className:"w-4 h-4 stroke-1"}),onClick:()=>d?.(e.id),className:"wcf-remove-order-bump-button"})),(0,o.createElement)(q$,{role:t,onStartAb:f,onDeclareWinner:m,onArchive:p})))),(0,o.createElement)(J$,{impressions:x.impressions,initiated:x.initiated,conversions:x.conversions,isWinner:b}))},pX=e=>"number"==typeof e&&e>=0?String(e):"—",hX=({item:e,onRestore:t,onDelete:n})=>{const{id:r,title:a,note:i,deleted:s,date:l,stats:c}=e||{},u=c&&"object"==typeof c?(0,z.sprintf)(/* translators: 1: impressions, 2: initiated, 3: conversions, 4: conversion rate */ /* translators: 1: impressions, 2: initiated, 3: conversions, 4: conversion rate */ |
| 54 |
(0,z.__)("Impressions %1$s · Initiated %2$s · Conversions %3$s · Conversion Rate %4$s","cartflows"),pX(c.impressions),pX(c.initiated),pX(c.conversions),(e=>e&&e.impressions?`${(e.conversions/e.impressions*100).toFixed(1)}%`:"—")(c)):"";return(0,o.createElement)(Gp,{containerType:"flex",align:"center",justify:"between",gap:"sm",className:"wcf-ob-ab-archived-item py-2"},(0,o.createElement)(Gp,{containerType:"flex",direction:"column",gap:"xs",className:"min-w-0 flex-1"},(0,o.createElement)(Gp,{containerType:"flex",align:"center",gap:"xs"},(0,o.createElement)(th,{as:"span",size:"sm",weight:500,className:"text-text-primary truncate"},a||(0,z.__)("(no title)","cartflows")),s&&(0,o.createElement)(Yf,{label:(0,z.__)("Deleted","cartflows"),variant:"red",type:"pill",size:"xxs"})),(i||l)&&(0,o.createElement)(th,{as:"span",size:"xs",className:"text-text-tertiary"},i?`${i} · `:"",l||""),u&&(0,o.createElement)(th,{as:"span",size:"xs",className:"text-text-secondary wcf-ob-ab-archived-item__stats"},u)),(0,o.createElement)(Gp,{containerType:"flex",align:"center",gap:"xs"},!s&&(0,o.createElement)(Va,{variant:"outline",size:"xs",onClick:()=>t?.(r),className:"wcf-ob-ab-archived-item__restore"},(0,z.__)("Restore","cartflows")),(0,o.createElement)(Va,{variant:"outline",size:"xs",onClick:()=>n?.(r),className:"wcf-ob-ab-archived-item__delete"},(0,z.__)("Delete","cartflows"))))},gX=({items:e=[],onRestore:t,onDelete:n,trailing:r=null})=>{const[a,s]=(0,i.useState)(!1),l=Array.isArray(e)?e.length:0,c=l>0;return c||r?(0,o.createElement)("div",{className:"wcf-ob-ab-archived border-0 border-t border-solid border-border-subtle"},(0,o.createElement)("div",{className:"flex items-center justify-between px-6 py-3"},c?(0,o.createElement)("button",{type:"button",onClick:()=>s(e=>!e),"aria-expanded":a,className:"wcf-ob-ab-archived__trigger inline-flex items-center gap-1.5 text-xs font-medium text-text-secondary hover:text-text-primary bg-transparent border-0 p-0 cursor-pointer"},(0,o.createElement)("span",null,(0,z.sprintf)(/* translators: %d is the number of archived variations. */ /* translators: %d is the number of archived variations. */ |
| 55 |
(0,z.__)("Archived Variations (%d)","cartflows"),l)),(0,o.createElement)(hm,{className:"w-4 h-4 transition-transform "+(a?"rotate-180":"")})):(0,o.createElement)("span",{className:"wcf-ob-ab-archived__placeholder"}),r),c&&a&&(0,o.createElement)("div",{className:"wcf-ob-ab-archived__content px-6 pb-3"},(0,o.createElement)(Gp,{containerType:"flex",direction:"column",gap:"xs"},e.map(e=>(0,o.createElement)(hX,{key:e.id,item:e,onRestore:t,onDelete:n}))))):null},wX=({open:e,setOpen:t,variations:n=[],titlesById:r={},onSave:a})=>{const[s,l]=(0,i.useState)(!1),{values:c,handleChange:u,total:d,reset:f}=(e=>{const[t,n]=(0,i.useState)(()=>sX(e)),r=(0,i.useCallback)(e=>{n(sX(e))},[]),a=(0,i.useCallback)((e,t)=>{const r=iX(t);n(t=>{const n=Object.keys(t).filter(t=>t!==e);if(0===n.length)return{...t,[e]:r};const a=100-r,o=n.reduce((e,n)=>{var r;return e+(null!==(r=t[n])&&void 0!==r?r:0)},0),i=n.map(e=>{var r;return o>0?Math.floor((null!==(r=t[e])&&void 0!==r?r:0)*a/o):Math.floor(a/n.length)}),s=a-i.reduce((e,t)=>e+t,0),l={...t,[e]:r};return n.forEach((e,t)=>{l[e]=i[t]+(t<s?1:0)}),l})},[]),o=(0,i.useMemo)(()=>Object.values(t).reduce((e,t)=>e+(t||0),0),[t]);return{values:t,handleChange:a,reset:r,total:o}})(n);(0,i.useEffect)(()=>{e&&f(n)},[e,n,f]);const m=(0,i.useMemo)(()=>n.map((e,t)=>{var n,a;return{id:e.id,traffic:null!==(n=null!==(a=c[e.id])&&void 0!==a?a:e.traffic)&&void 0!==n?n:0,title:r[e.id]||(0,z.__)("(no title)","cartflows"),role:0===t?"control":"variant",variantNumber:t}}),[n,c,r]);return(0,o.createElement)($m,{open:e,setOpen:t,exitOnClickOutside:!0,exitOnEsc:!0},(0,o.createElement)($m.Panel,{className:"!p-3 !gap-4"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)("div",{className:"flex flex-col gap-3 p-2 min-w-0"},(0,o.createElement)("div",{className:"flex items-center justify-between"},(0,o.createElement)($m.Title,{className:"!text-lg"},(0,z.__)("Split Test Settings","cartflows")),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)(th,{as:"span",size:"xs",className:"text-text-tertiary uppercase tracking-wide"},(0,z.__)("Traffic Distribution","cartflows")),(0,o.createElement)(Gp,{containerType:"flex",direction:"column",gap:"xs",className:"wcf-ob-ab-traffic-list"},m.map(e=>(0,o.createElement)(Gp,{key:e.id,containerType:"flex",align:"center",justify:"between",gap:"sm",className:"wcf-ob-ab-traffic-row py-2"},(0,o.createElement)(Gp,{containerType:"flex",align:"center",gap:"xs",className:"min-w-0"},(0,o.createElement)(th,{as:"span",size:"sm",weight:500,className:"text-text-primary truncate"},e.title),"control"===e.role&&(0,o.createElement)(uX,null),"variant"===e.role&&(0,o.createElement)(dX,{number:e.variantNumber})),(0,o.createElement)(dp,{type:"number",size:"sm",min:0,max:100,value:String(e.traffic),suffix:"%",onChange:t=>u(e.id,t),className:"wcf-ob-ab-traffic-input w-[120px]"})))),(0,o.createElement)(th,{as:"span",size:"xs",className:"text-text-tertiary"},(0,z.sprintf)( |
| 56 |
// translators: %d is the current total of all traffic % fields. |
| 57 |
// translators: %d is the current total of all traffic % fields. |
| 58 |
(0,z.__)("Current total: %1$d%% (must equal 100%%)","cartflows"),d))),(0,o.createElement)($m.Footer,{className:"!p-2 flex gap-3 justify-end"},(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:()=>{t(!1)},disabled:s},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(Va,{variant:"primary",size:"md",onClick:async()=>{if(s)return;if(100!==d)return void pp.error((0,z.__)("Traffic must sum to 100%.","cartflows"));l(!0);const e=n.map(e=>{var t,n;return{id:e.id,traffic:null!==(t=null!==(n=c[e.id])&&void 0!==n?n:e.traffic)&&void 0!==t?t:0}});try{!1!==await(a?.(e))&&t(!1)}finally{l(!1)}},loading:s,disabled:s||100!==d},s?(0,z.__)("Saving…","cartflows"):(0,z.__)("Save Settings","cartflows")))))},yX=e=>null===e?"—":`${e.toFixed(1)}%`,bX=({bump:e,role:t,isWinner:n,isPendingWinner:r,statsBlob:a})=>{const i=tX(e,a),s=nX(i),l=r?"wcf-ob-cmp-card p-4 rounded-md border border-solid border-support-success bg-support-success-bg":"wcf-ob-cmp-card p-4 rounded-md border border-solid border-border-subtle bg-background-secondary";let c="",u="neutral";return r?(c=(0,z.__)("★ Winner","cartflows"),u="green"):"control"===t?(c=(0,z.__)("Control","cartflows"),u="blue"):(c=t,u="inverse"),(0,o.createElement)(Gp,{containerType:"flex",direction:"column",gap:"sm",className:l},(0,o.createElement)(Gp,{containerType:"flex",align:"center",justify:"between",gap:"xs"},(0,o.createElement)(th,{as:"span",size:14,weight:600,className:"text-text-primary truncate"},e?.title||(0,z.__)("(no title)","cartflows")),(0,o.createElement)(Yf,{label:c,variant:u,type:"pill",size:"xs",disableHover:!0})),(0,o.createElement)(Gp,{containerType:"flex",direction:"column",gap:"xxs"},(0,o.createElement)(vX,{labelText:(0,z.__)("Impressions","cartflows"),value:i.impressions}),(0,o.createElement)(vX,{labelText:(0,z.__)("Initiated","cartflows"),value:i.initiated}),(0,o.createElement)(vX,{labelText:(0,z.__)("Conversions","cartflows"),value:i.conversions}),(0,o.createElement)(vX,{labelText:(0,z.__)("Conversion Rate","cartflows"),value:yX(s),emphasis:r?"success":"default"})),n&&!r&&(0,o.createElement)(th,{size:12,className:"text-support-success"},(0,z.__)("Currently leading","cartflows")))},vX=({labelText:e,value:t,emphasis:n="default"})=>{const r="success"===n?"text-support-success":"text-text-primary";return(0,o.createElement)(Gp,{containerType:"flex",align:"center",justify:"between",gap:"xs"},(0,o.createElement)(th,{as:"span",size:12,className:"text-text-tertiary"},e),(0,o.createElement)(th,{as:"span",size:12,weight:600,className:r},t))},xX=({open:e,setOpen:t,winningTitle:n="",onConfirm:r,controlId:a,variations:s=[],bumpsById:l={},pendingWinnerId:c=null,statsBlob:u={}})=>{const[d,f]=(0,i.useState)(!1),m=l?.[a],p=m?nX(tX(m,u)):null;let h=null;if(c&&c!==a){const e=l?.[c];e&&(h=((e,t)=>null===e||null===t||t<=0?null:(e-t)/t*100)(nX(tX(e,u)),p))}let g=0;s.forEach(e=>{const t=l?.[e?.id];t&&(g+=tX(t,u).impressions)});let w=null,y=-1;return s.forEach(e=>{const t=l?.[e?.id];if(!t)return;const n=tX(t,u);if(n.impressions<30)return;const r=nX(n)||0;r>y&&(y=r,w=e.id)}),(0,o.createElement)($m,{open:e,setOpen:t,exitOnClickOutside:!1},(0,o.createElement)($m.Panel,{className:"!p-3 !gap-4 !w-[640px] !max-w-[90vw]"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)("div",{className:"flex gap-2.5 p-2"},(0,o.createElement)(qH,{className:"w-6 h-6 text-support-success shrink-0 mt-0.5","aria-hidden":"true"}),(0,o.createElement)("div",{className:"flex flex-col gap-1.5 flex-1 min-w-0"},(0,o.createElement)("div",{className:"flex items-center justify-between"},(0,o.createElement)($m.Title,{className:"!text-lg"},(0,z.__)("Declare Winner","cartflows")),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)(th,{as:"span",size:14,className:"text-text-secondary"},(0,z.sprintf)(/* translators: %s is the winning variation's title. */ /* translators: %s is the winning variation's title. */ |
| 59 |
(0,z.__)("Do you want to declare “%s” as the winner? The other variations will be moved to Archived Variations and the test will end.","cartflows"),n)),(0,o.createElement)(th,{as:"span",size:12,className:"text-text-tertiary"},(0,z.sprintf)(/* translators: 1: total impressions across the test, 2: system-recommended variant name or "—". */ /* translators: 1: total impressions across the test, 2: system-recommended variant name or "—". */ |
| 60 |
(0,z.__)("Total visitors: %1$s · System recommendation: %2$s","cartflows"),g,w?l?.[w]?.title||w:(0,z.__)("not enough data yet","cartflows"))))),(0,o.createElement)(Gp,{containerType:"grid",gap:"sm",className:"grid-cols-1 sm:grid-cols-2 p-2"},s.map((e,t)=>{const n=l?.[e?.id];if(!n)return null;const r=0===t?"control":(0,z.sprintf)(/* translators: %d is the variant index (1-based) */ /* translators: %d is the variant index (1-based) */ |
| 61 |
(0,z.__)("Variation-%d","cartflows"),t);return(0,o.createElement)(bX,{key:e.id,bump:n,role:r,isWinner:w===e.id,isPendingWinner:c===e.id,statsBlob:u})})),null!==h&&(0,o.createElement)(th,{size:12,className:"text-text-tertiary px-2"},(0,z.sprintf)(/* translators: %s is the % lift over control (e.g. "+35.8%"). */ /* translators: %s is the % lift over control (e.g. "+35.8%"). */ |
| 62 |
(0,z.__)("Lift over control: %s","cartflows"),`${h>0?"+":""}${h.toFixed(1)}%`)),(0,o.createElement)($m.Footer,{className:"!p-2 flex gap-3 justify-end"},(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:()=>t(!1),disabled:d},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(Va,{variant:"primary",size:"md",onClick:async()=>{if(!d){f(!0);try{!1!==await(r?.())&&t(!1)}finally{f(!1)}}},loading:d,disabled:d},d?(0,z.__)("Declaring…","cartflows"):(0,z.sprintf)(/* translators: %s is the winning variation's title. */ /* translators: %s is the winning variation's title. */ |
| 63 |
(0,z.__)("Declare %s as Winner","cartflows"),n)))))},_X=({controlBump:e,allBumps:t=[],stepId:n,flowId:r,dispatch:a,onEditClick:s,openObSettingsId:l="",toggleObSettings:c})=>{const[u,d]=(0,i.useState)(!1),[f,m]=(0,i.useState)(!1),[p,h]=(0,i.useState)(null),[g,w]=(0,i.useState)({}),[y,b]=(0,i.useState)({}),[,v]=ZR(),x=eX(),_=a||v,E=oX(),N=(0,i.useMemo)(()=>({splitStarted:()=>(0,z.__)("Split test started!","cartflows"),splitStopped:()=>(0,z.__)("Split test stopped!","cartflows"),variationAdded:()=>(0,z.__)("A/B test variation created!","cartflows"),variationCloned:()=>(0,z.__)("Variation cloned!","cartflows"),variationArchived:()=>(0,z.__)("Variation archived!","cartflows"),variationDeleted:()=>(0,z.__)("Variation deleted!","cartflows"),winnerDeclared:()=>(0,z.__)("Winner declared successfully!","cartflows"),trafficSaved:()=>(0,z.__)("Split test traffic saved!","cartflows"),archiveRestored:()=>(0,z.__)("Archived variation restored!","cartflows"),archiveDeleted:()=>(0,z.__)("Archived variation deleted permanently!","cartflows"),statusUpdated:e=>e?(0,z.__)("Order bump enabled!","cartflows"):(0,z.__)("Order bump disabled!","cartflows"),bumpCloned:()=>(0,z.__)("Order bump cloned!","cartflows"),bumpDeleted:()=>(0,z.__)("Order bump deleted!","cartflows")}),[]),M=$V(),I=(0,i.useMemo)(()=>Array.isArray(e?.["ab-test-variations"])?e["ab-test-variations"]:[],[e]),S=(0,i.useMemo)(()=>Array.isArray(e?.["ab-test-archived-variations"])?e["ab-test-archived-variations"]:[],[e]),k=(0,i.useMemo)(()=>{const e={};return(t||[]).forEach(t=>{e[t.id]=t}),e},[t]),j=(0,i.useMemo)(()=>{const e={};return I.forEach(t=>{e[t.id]=k[t.id]?.title||""}),e},[I,k]),D=!!e?.["ab-test-start"],C=(e,t,n)=>{("status"===e?w:b)(e=>({...e,[t]:n}))},A=e=>{C("status",e,!0),E.toggleBumpStatus({stepId:n,flowId:r,ob_id:e,currentStatus:!!k[e]?.status}).then(t=>{t?.success&&(_({type:"SET_OB_STATUS",name:"wcf-order-bumps",newStatus:!k[e]?.status,ob_id:e}),pp.success(N.statusUpdated(!k[e]?.status)))}).finally(()=>C("status",e,!1))},T=async t=>{if(!await M({title:(0,z.__)("Delete Variation","cartflows"),description:(0,z.__)("Do you really want to delete this variation permanently?","cartflows"),actionBtnText:(0,z.__)("Delete","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")}))return;C("action",t,"delete");const r=await E.deleteVariation({stepId:n,control_ob_id:e.id,ob_id:t});r?.success&&(_({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:r.data.order_bumps}),pp.success(N.variationDeleted())),C("action",t,!1)},O=t=>{C("action",t,"clone"),E.cloneVariation({stepId:n,control_ob_id:e.id,source_ob_id:t}).then(e=>{e?.success&&(_({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:e.data.order_bumps}),pp.success(N.variationCloned()))}).finally(()=>C("action",t,!1))},L=e=>{"function"!=typeof s?c?.(e):s(e)},P=p&&k[p]?.title||"";return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-ob-ab-group block rounded-lg overflow-hidden border border-solid border-border-subtle border-l-4 !border-l-brand-500 bg-background-primary shadow-sm m-4"},(0,o.createElement)(cX,{abTestStart:D,onToggle:async()=>{const t=D?await E.pauseAbTest({stepId:n,control_ob_id:e.id}):await E.startAbTest({stepId:n,control_ob_id:e.id});t?.success&&(_({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:t.data.order_bumps}),pp.success(D?N.splitStopped():N.splitStarted()))},onOpenSettings:()=>{d(!0)}}),(()=>{const t=((e,t,n={},r=30)=>{if(!Array.isArray(t)||!t.length)return null;let a=null,o=-1;for(const i of t){if(!i||!i.id)continue;const t=n[e]?.[i.id];if(!t)continue;const s=parseInt(t.impressions||0,10),l=parseInt(t.conversions||0,10);if(s<r)continue;const c=l/s*100;c>o&&(o=c,a=i.id)}return a})(e?.id,I,x);return I.map((r,a)=>{const i=k[r.id];if(!i)return null;const s=0===a;return(0,o.createElement)(mX,{key:r.id,bump:i,role:s?"control":"variant",variantNumber:a,traffic:r.traffic,stepId:n,dispatch:_,statusProcess:!!g[r.id],actionProcess:y[r.id]||"",onStatusToggle:A,onDuplicateClick:O,onSettingsClick:L,isSettingsOpen:l===r.id,onDeleteClick:T,onMenuDeclareWinner:()=>{return e=r.id,h(e),void m(!0);var e},onMenuArchive:()=>(async t=>{if(!await M({title:(0,z.__)("Archive Variation","cartflows"),description:(0,z.__)("Do you want to archive this variation? You can restore it later.","cartflows"),actionBtnText:(0,z.__)("Archive","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")}))return;const r=await E.archiveVariation({stepId:n,control_ob_id:e.id,ob_id:t});r?.success&&(_({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:r.data.order_bumps}),pp.success(N.variationArchived()))})(r.id),isWinner:t===r.id})})})(),(0,o.createElement)(gX,{items:S,onRestore:async t=>{const r=await E.restoreArchived({stepId:n,control_ob_id:e.id,ob_id:t});r?.success&&(_({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:r.data.order_bumps}),pp.success(N.archiveRestored()))},onDelete:async t=>{if(!await M({title:(0,z.__)("Delete Archived Variation","cartflows"),description:(0,z.__)("Do you want to delete this archived variation permanently?","cartflows"),actionBtnText:(0,z.__)("Delete","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")}))return;const r=await E.deleteArchived({stepId:n,control_ob_id:e.id,ob_id:t});r?.success&&(_({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:r.data.order_bumps}),pp.success(N.archiveDeleted()))},trailing:(0,o.createElement)("button",{type:"button",onClick:()=>O(e.id),disabled:"clone"===y[e.id],className:"wcf-ob-ab-add-variation inline-flex items-center gap-1 text-xs font-medium text-brand-500 hover:text-brand-600 bg-transparent border-0 px-2 py-1 rounded cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed hover:bg-brand-25"},(0,o.createElement)(LW,{className:"w-4 h-4"}),(0,z.__)("Add Variation","cartflows"))}),(0,o.createElement)(wX,{open:u,setOpen:d,variations:I,titlesById:j,onSave:async t=>{const r=await E.saveTraffic({stepId:n,control_ob_id:e.id,variations:t});return!!r?.success&&(_({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:r.data.order_bumps}),pp.success(N.trafficSaved()),!0)}}),(0,o.createElement)(xX,{open:f,setOpen:m,winningTitle:P,onConfirm:async()=>{if(!p)return!1;const t=await E.declareWinner({stepId:n,control_ob_id:e.id,winner_ob_id:p});return!!t?.success&&(_({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:t.data.order_bumps}),pp.success(N.winnerDeclared()),h(null),!0)},controlId:e?.id,variations:I,bumpsById:k,pendingWinnerId:p,statsBlob:x})),l&&I.some(e=>e.id===l)&&(0,o.createElement)(H$,{key:l,ob_id:l}))},EX=function(){return(0,o.createElement)("div",{className:"wcf-multiple-order-bumps is-placeholder"},(0,o.createElement)("div",{className:"wcf-multiple-order-bumps__add-new"},(0,o.createElement)("span",{className:"wcf-add-new-order-bump wcf-button--primary"})),(0,o.createElement)("div",{className:"wcf-multiple-order-bumps__header"},(0,o.createElement)("div",{className:"wcf-column wcf-column--title"},"Title"),(0,o.createElement)("div",{className:"wcf-column wcf-column--status"},"Status"),(0,o.createElement)("div",{className:"wcf-column wcf-column--actions"},"Actions")),(0,o.createElement)("div",{className:"wcf-multiple-order-bumps__content"},(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-order-bump"},(0,o.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,o.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,o.createElement)("div",{className:"wcf-order-bump__data-title"},(0,o.createElement)("span",{title:"ob"}))),(0,o.createElement)("div",{className:"wcf_order_bump__status"},(0,o.createElement)("span",{className:"wcf-ob-status"})),(0,o.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,o.createElement)("span",{title:"Edit Order Bump"}))))),(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-order-bump"},(0,o.createElement)("div",{className:"wcf-order-bump__content-wrapper"},(0,o.createElement)("div",{className:"wcf-order-bump__data wcf-column--product"},(0,o.createElement)("div",{className:"wcf-order-bump__data-title"},(0,o.createElement)("span",{title:"ob"}))),(0,o.createElement)("div",{className:"wcf_order_bump__status"},(0,o.createElement)("span",{className:"wcf-ob-status"})),(0,o.createElement)("div",{className:"wcf-order-bump__action wcf-column--actions"},(0,o.createElement)("span",{title:"Edit Order Bump"})))))))},NX=(e="pro")=>{const[{license_status:t}]=g();return!("plus-pro"===e?wcfCartflowsTypePlusPro():wcfCartflowsPro())||"Activated"!==t},MX=function({orderBumps:e,stepId:t,flowId:n,pageSettings:r,onChange:a,onEditClick:s,hideDocLink:l=!1,hideAddControl:c=!1}={}){const[u,d]=ZR(),f=Array.isArray(e),m=f?null:u?.options,p=f?t:u?.step_id,h=f?n:u?.flow_id,g=f?r:u?.page_settings,w=f?e=>a?.(e):d,y=NX("plus-pro"),[v,x]=(0,i.useState)(),[_,E]=(0,i.useState)(""),N=(0,z.__)("Add","cartflows"),M=(0,b.useHistory)(),I=(0,b.useLocation)(),[S,k]=(0,i.useState)(new URLSearchParams(window.location.search).get("ob_id")||""),j=e=>{k(t=>{const n=t===e?"":e,r=new URLSearchParams(I?.search||"");return n===(r.get("ob_id")||"")||(n?r.set("ob_id",n):r.delete("ob_id"),M?.replace?.({pathname:I?.pathname,search:r.toString()})),n})},[D,C]=(0,i.useState)({button_text:N,is_processing:!1}),{button_text:A,is_processing:T}=D;if(y)return(0,o.createElement)(nZ,{title:(0,z.__)("Add Extra Revenue to Every Checkout Effortlessly","cartflows"),description:(0,z.__)("Show a perfectly timed add-on offer at checkout. Customers buy more in one click — zero extra steps, zero coding needed.","cartflows")});if(!f&&(null===m||"undefined"===g))return(0,o.createElement)(EX,null);const O=g,P=f?e:m["wcf-order-bumps"],R=Array.isArray(P)?P.filter(e=>!e?.["wcf-control-ob"]):P,U=P?Object.keys(P).length:0,B=g?.settings?.["multiple-order-bump-design"],F=()=>{const t=f?e:m["wcf-order-bumps"];if(!t)return;const n=[];Object.keys(t).map(e=>(n.push(t[e].id),""));const r=new window.FormData;r.append("action","cartflows_pro_reorder_order_bumps"),r.append("security",cartflows_admin.reorder_order_bumps_nonce),r.append("step_id",p),r.append("sorted_obs",n),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{})};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Gp,{containerType:"flex",direction:"column",gap:"sm",className:"wcf-multiple-order-bumps--wrapper"},U>0&&(0,o.createElement)("div",{className:"wcf-multiple-order-bumps border border-solid border-border-subtle sm:mx-0 sm:rounded-lg"},(0,o.createElement)(Gp,{containerType:"flex",direction:"row",className:"wcf-multiple-order-bumps__header border-b border-solid border-border-subtle border-0 bg-background-secondary px-6 py-4 gap-2 text-left sm:rounded-t-lg"},(0,o.createElement)(th,{as:"span",size:"sm",weight:500,className:"wcf-column wcf-column--title w-[70%]"},(0,z.__)("Title","cartflows")),(0,o.createElement)(th,{as:"span",size:"sm",weight:500,className:"wcf-column wcf-column--status w-[13%]"},(0,z.__)("Status","cartflows")),(0,o.createElement)(th,{as:"span",size:"sm",weight:500,className:"wcf-column wcf-column--actions w-[12%] sr-only"},(0,z.__)("Actions","cartflows"))),(0,o.createElement)("div",{className:"wcf-multiple-order-bumps__content"},P&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(QR.ReactSortable,{list:R,setList:e=>{const t=[];e.forEach(e=>{t.push(e),e?.["ab-test"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].forEach(n=>{const r=P.find(t=>t.id===n.id&&t["wcf-control-ob"]===e.id);r&&t.push(r)})}),w({type:"SET_OB",obs:t,fieldName:"wcf-order-bumps",step_id:p,flow_id:h})},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},R.map(e=>{const t=e["ab-test-variations"];return e["ab-test"]&&Array.isArray(t)&&t.length>0?(0,o.createElement)(_X,{key:e.id,controlBump:e,allBumps:P,stepId:p,flowId:h,dispatch:f?w:void 0,onEditClick:s,openObSettingsId:S,toggleObSettings:j}):(0,o.createElement)(lX,{key:e.id,flow_id:h,step_id:p,data:e,title:e.title,settings:O?.settings?.["multiple-order-bump"],design_settings:B,callback:F,dispatch:f?w:void 0,onEditClick:s,openObSettingsId:S,toggleObSettings:j})}))))),0===U&&(0,o.createElement)("div",{className:"border border-border-subtle border-solid bg-gray-25 rounded-md px-5 py-5 text-sm text-text-secondary text-center"},(0,z.__)("Create an order bump.","cartflows")),!c&&(0,o.createElement)(Gp,{containerType:"flex",gap:"sm",className:"wcf-multiple-order-bumps__add-new mt-5"},(0,o.createElement)("div",{className:"flex-1 flex flex-col gap-1"},(0,o.createElement)(dp,{size:"md",value:v||"",onChange:x,placeholder:(0,z.__)("Enter order bump name","cartflows"),error:!!_,className:"focus:!ring-0 focus:!ring-offset-0"}),_&&(0,o.createElement)("span",{className:"text-sm font-normal text-brand-500"},_)),(0,o.createElement)(Va,{variant:"outline",icon:(0,o.createElement)(KO,{className:"w-4 h-4 stroke-1"}),iconPosition:"left",loading:T,disabled:T,onClick:function(e){if(e.preventDefault(),void 0!==v){E(""),C({button_text:(0,z.__)("Adding…","cartflows"),is_processing:!0});const t={title:v,id:Math.random().toString(36).substring(2,5)},n=new window.FormData;n.append("action","cartflows_pro_add_order_bump"),n.append("security",cartflows_admin.add_order_bump_nonce),n.append("ob_id",t.id),n.append("post_id",h),n.append("step_id",p),n.append("title",v),L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(t=>{t.success&&(w({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:t.data.order_bumps}),x(""),C({button_text:N,is_processing:!1}),pp.success((0,z.__)("Order bump added!","cartflows"))),e.target.blur()})}else E((0,z.__)("Please enter the order bump title","cartflows")),e.target.blur()},className:"wcf-add-new-order-bump font-normal h-fit"},A))),!l&&(0,o.createElement)(zY,{content:(0,z.sprintf)( |
| 64 |
// translators: %1$s: link html start, %2$s: link html end |
| 65 |
// translators: %1$s: link html start, %2$s: link html end |
| 66 |
(0,z.__)("For more information about order bump settings please %1$sClick here.%2$s","cartflows"),'<a href="https://cartflows.com/docs/how-to-add-order-bumps-to-woocommerce-sales-funnel" class="text-brand-500 hover:text-brand-600 no-underline" target="_blank">',"</a>")}))},IX=function({stepId:e,flowId:t,flowType:n,initialBumps:r,onCountChange:a}){const[s,l]=(0,i.useState)(Array.isArray(r)?r:[]),[c,u]=(0,i.useState)(!1),[d,f]=(0,i.useState)(""),[m,p]=(0,i.useState)(""),[h,g]=(0,i.useState)(!1),w=(0,b.useHistory)(),y=NX("plus-pro");(0,i.useEffect)(()=>{Array.isArray(r)&&l(r)},[r]),(0,i.useEffect)(()=>{a?.(s.length)},[s.length]);const v=(0,i.useCallback)(e=>{if(e&&"object"==typeof e)switch(e.type){case"UPDATE_ORDER_BUMP":Array.isArray(e.order_bumps)&&l(e.order_bumps);break;case"SET_OB":Array.isArray(e.obs)&&l(e.obs);break;case"SET_OB_STATUS":l(t=>t.map(t=>t.id===e.ob_id?{...t,status:e.newStatus}:t));break;case"SET_OB_TITLE":l(t=>t.map(t=>t.id===e.ob_id?{...t,title:e.title}:t));break;case"REMOVE_ORDER_BUMP":l(t=>t.filter(t=>t.id!==e.ob_id));break;case"SET_OB_PRODUCT":l(t=>t.map(t=>t.id===e.ob_id?{...t,product:e.product}:t))}},[]),x=(0,i.useCallback)(r=>{const a=`?page=cartflows&path=${"storeCheckout"===n?"store-checkout":"flows"}&action=wcf-edit-flow&flow_id=${t}&step_id=${e}&tab=order_bumps&ob_id=${r}`;w?.push&&w.push({pathname:"admin.php",search:a})},[n,t,e,w]),_=()=>{h||(u(!1),f(""),p(""))},E=()=>{const n=(d||"").trim();if(""===n)return void p((0,z.__)("Please enter the order bump title","cartflows"));p(""),g(!0);const r=new window.FormData;r.append("action","cartflows_pro_add_order_bump"),r.append("security",cartflows_admin.add_order_bump_nonce);const a=window.crypto&&"function"==typeof window.crypto.randomUUID?window.crypto.randomUUID():Math.random().toString(36).slice(2,12)+Math.random().toString(36).slice(2,12);r.append("ob_id",a),r.append("post_id",t),r.append("step_id",e),r.append("title",n),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(e=>{e?.success?(v({type:"UPDATE_ORDER_BUMP",name:"wcf-order-bumps",order_bumps:e.data.order_bumps}),pp.success((0,z.__)("Order bump added!","cartflows")),u(!1),f("")):p((0,z.__)("Failed to add order bump.","cartflows"))}).catch(()=>{p((0,z.__)("Failed to add order bump.","cartflows"))}).finally(()=>{g(!1)})};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(MX,{orderBumps:s,stepId:e,flowId:t,pageSettings:null,onChange:v,onEditClick:x,hideDocLink:!0,hideAddControl:!0}),!y&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("button",{type:"button",onClick:()=>u(!0),className:"wcf-add-order-bump-trigger w-full mt-2.5 py-2.5 flex items-center justify-center gap-1 border border-solid border-border-subtle rounded-lg bg-transparent text-sm font-medium text-text-secondary hover:text-text-primary hover:border-border-strong cursor-pointer"},(0,o.createElement)(KO,{className:"w-4 h-4 stroke-2"}),(0,z.__)("Add Order Bump","cartflows")),(0,o.createElement)($m,{open:c,setOpen:e=>{e||_()},exitOnClickOutside:!1},(0,o.createElement)($m.Panel,{className:"sm:max-w-lg w-full"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)($m.Header,{className:"flex items-center justify-between !space-y-0"},(0,o.createElement)($m.Title,null,(0,z.__)("Order Bump","cartflows")),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)($m.Body,null,(0,o.createElement)("label",{htmlFor:"wcf-add-order-bump-title",className:"block text-sm font-medium text-text-primary mb-2"},(0,z.__)("Order Bump Name","cartflows")),(0,o.createElement)(dp,{id:"wcf-add-order-bump-title",type:"text",size:"md",value:d,onChange:e=>{f(e),m&&p("")},placeholder:(0,z.__)("Enter Order Bump name","cartflows"),error:!!m,onKeyDown:e=>{"Enter"!==e.key||h||(e.preventDefault(),E())}}),(0,o.createElement)("p",{className:"flex items-center gap-1 text-xs font-normal text-text-tertiary mt-2 m-0"},(0,o.createElement)(iU,{className:"w-3.5 h-3.5 stroke-2"}),(0,z.__)("Configure product and settings after creation.","cartflows")),m&&(0,o.createElement)("p",{className:"text-sm font-normal text-brand-500 mt-2 m-0"},m)),(0,o.createElement)($m.Footer,{className:"flex gap-3 justify-end"},(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:_,disabled:h},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(Va,{variant:"primary",size:"md",onClick:E,loading:h,disabled:h},(0,z.__)("Add Order Bump","cartflows")))))))},SX=function({stepId:e,flowId:t,flowType:n,initialBumps:r=[]}){const[a,s]=(0,i.useState)(!0),[l,c]=(0,i.useState)(r.length),u=(0,i.useCallback)(e=>{c(e)},[]);return(0,o.createElement)("div",{className:"wcf-order-bump-section px-4 py-4 border-t border-solid border-border-subtle border-0"},(0,o.createElement)("div",{className:"flex items-center justify-between"},(0,o.createElement)("div",{className:"flex items-center gap-1.5"},(0,o.createElement)(_$,{className:"w-4 h-4 text-text-primary stroke-1"}),(0,o.createElement)(th,{as:"span",size:14,weight:400,color:"primary"},(0,z.__)("Order Bumps","cartflows")," ",(0,o.createElement)("span",{className:"text-text-primary font-normal"},"(",l,")"))),(0,o.createElement)(Va,{variant:"link",size:"xs",icon:a?(0,o.createElement)(N$,{className:"w-3.5 h-3.5 stroke-2"}):(0,o.createElement)(Um,{className:"w-3.5 h-3.5 stroke-2"}),iconPosition:"right",onClick:()=>s(!a)},a?(0,z.__)("Hide","cartflows"):(0,z.__)("Show","cartflows"))),a&&(0,o.createElement)("div",{className:"mt-2.5"},(0,o.createElement)(IX,{stepId:e,flowId:t,flowType:n,initialBumps:r,onCountChange:u})))},kX=function(e){const[{is_cf_pro:t,global_checkout:n,flow_id:r,flow_type:a}]=ZR(),{id:i,title:s,type:l,actions:c,menu_actions:u,offer_yes_next_step:d,offer_no_next_step:f,invalid:m=!1,step_disabled:p=!1,setShowAbtestUpgradePopup:h=()=>{},order_bumps:g=[]}=e,w=!!m,y=i;"storeCheckout"===a&&(["checkout"].includes(l)&&(delete u.clone,w||delete u.delete),w&&(delete u.clone,delete u.abtest));let b=!1,v=!1,x=[],E=[],N=0;wcfCartflowsTypePro()&&(b=!!e["ab-test-ui"]&&e["ab-test-ui"],v=!!e["ab-test-start"]&&e["ab-test-start"],x=e["ab-test-variations"]?e["ab-test-variations"]:[],E=e["ab-test-archived-variations"]?e["ab-test-archived-variations"]:[],N=x.length,N<2&&(b=!1));let M="";"storeCheckout"===a&&w&&(M+=" invalid-step wcf-store-checkout pointer-events-none touch-none"),b&&(M+=" wcf-ab-test"),wcfCartflowsTypePlusPro()||"upsell"!==l&&"downsell"!==l||(M+=" invalid-step pro-inactive pointer-events-none touch-none !bg-background-secondary !text-text-disabled !border-0"),p&&!b&&(M+=" invalid-step step-disabled touch-none !bg-background-secondary !text-text-disabled !border-0");const I={is_cf_pro:t,global_checkout:n,flow_id:r,ab_test_ui:b,control_id:y,step_id:i,type:l,title:s,actions:Object.values(c),menu_actions:Object.values(u),has_product_assigned:e.is_product_assigned,offer_yes_next_step:d,offer_no_next_step:f,ab_test_archived_variations:E,invalidStep:w,setShowAbtestUpgradePopup:h,step_disabled:p};return(0,o.createElement)("div",{className:"wcf-step-wrap box-border bg-background-primary border border-solid border-border-subtle shadow-sm rounded-lg overflow-hidden"+M,id:i},b&&(0,o.createElement)(g$,{flow_id:r,control_id:y,step_id:i,abvariations:x,ab_test_start:v}),function(){let e="";if(I.step_id=i,b&&N>1){let t=0;e=x.map(e=>(y!==e.id&&++t,I.is_variation=!0,I.control_id=y,I.step_id=e.id,I.title=e.title,I.actions=Object.values(e.actions),I.menu_actions=Object.values(e.menu_actions),I.has_product_assigned=e.is_product_assigned,I.var_badge_count=t,I.offer_yes_next_step=e.offer_yes_next_step,I.offer_no_next_step=e.offer_no_next_step,I.offer_yes_step_id=e.offer_yes_step_id,I.offer_no_step_id=e.offer_no_step_id,I.step_disabled=e.step_disabled,(0,o.createElement)(m$,(0,_.A)({},I,{key:e.id}))))}else e=(0,o.createElement)(m$,I);return e}(),function(){if(E.length>0){const e={flow_id:r,control_id:y,type:l,archived_variations:E,ab_test_ui:b};return(0,o.createElement)(v$,e)}}(),"checkout"===l&&wcfCartflowsPro()&&(0,o.createElement)(SX,{stepId:i,flowId:r,flowType:a,initialBumps:Array.isArray(g)?g:[]}))},jX=function(){return(0,o.createElement)("div",{className:"w-full"},Array(3).fill().map((e,t)=>(0,o.createElement)("div",{key:t,className:"wcf-step-wrap bg-background-primary border border-border-subtle shadow-sm rounded-lg mb-4 p-4 flex items-center gap-4"},(0,o.createElement)("div",{className:"flex"},(0,o.createElement)(cO,{className:"w-3 h-10 rounded"})),(0,o.createElement)(cO,{className:"w-[72px] h-[72px] rounded-lg flex-shrink-0"}),(0,o.createElement)("div",{className:"flex flex-col gap-2 w-[40%]"},(0,o.createElement)(cO,{className:"h-3 w-24 rounded-md"}),(0,o.createElement)(cO,{className:"h-4 w-48 rounded-md"})),(0,o.createElement)("div",{className:"flex items-center justify-around w-[35%] gap-4"},[1,2,3].map(e=>(0,o.createElement)("div",{key:e,className:"flex flex-col gap-2 items-center"},(0,o.createElement)(cO,{className:"h-3 w-16 rounded-md"}),(0,o.createElement)(cO,{className:"h-4 w-8 rounded-md"})))),(0,o.createElement)("div",{className:"flex items-center gap-2 ml-auto"},[1,2,3,4].map(e=>(0,o.createElement)(cO,{key:e,variant:"circular",className:"size-8"}))))))};function DX({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"}))}const CX=i.forwardRef(DX);function AX({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 TX=i.forwardRef(AX),OX=function(){return(0,o.createElement)("div",{className:"wcf-design-page is-placeholder"},(0,o.createElement)("div",{className:"wcf-design-page__content"},(0,o.createElement)("div",{className:"wcf-design-header--title wcf-step__title--editable"},(0,o.createElement)("div",{className:"title wcf-placeholder__width--30"})),(0,o.createElement)("div",{className:"wcf-design-page__customize"},(0,o.createElement)("div",{className:"wcf-design-page__button"}),(0,o.createElement)("div",{className:"wcf-design-page__button"})),(0,o.createElement)("div",{className:"wcf-design-page__text"},(0,o.createElement)("div",{className:"title wcf-placeholder__width--60"})),(0,o.createElement)("div",{className:"wcf-design-page__WPeditor"},(0,o.createElement)("div",{className:"title wcf-placeholder__width--80"}))),(0,o.createElement)("div",{className:"wcf-design-page__settings"},(0,o.createElement)("div",{className:"title"}),(0,o.createElement)("div",{className:"wcf-field wcf-checkbox-field"},(0,o.createElement)("div",{className:"title"})),(0,o.createElement)("div",{className:"wcf-settings"},(0,o.createElement)("form",null,(0,o.createElement)("div",{className:"wcf-vertical-nav"},(0,o.createElement)("div",{className:"wcf-vertical-nav__menu"},Array(5).fill().map(e=>(0,o.createElement)("div",{className:"wcf-settings-nav__tab",key:e},(0,o.createElement)(DZ,{height:"45px"})))),(0,o.createElement)("div",{className:"wcf-vertical-nav__content"},(0,o.createElement)(kZ,{fontSize:"35px",width:"225px"}),(0,o.createElement)(kZ,{width:"80%"}),(0,o.createElement)(kZ,{width:"80%"}),(0,o.createElement)(kZ,{width:"80%"}),(0,o.createElement)(kZ,{width:"65%"}),(0,o.createElement)(jZ,null),(0,o.createElement)(kZ,{fontSize:"35px",width:"300px"}),(0,o.createElement)(kZ,{width:"60%"}),(0,o.createElement)(kZ,{width:"60%"}),(0,o.createElement)(kZ,{width:"45%"}),(0,o.createElement)(jZ,null),(0,o.createElement)(kZ,{fontSize:"35px",width:"300px"}),(0,o.createElement)(kZ,{width:"60%"}),(0,o.createElement)(kZ,{width:"60%"}),(0,o.createElement)(kZ,{width:"45%"})))))))},LX=function({settings:e,displayAs:t="tr"}){const[{options:n}]=ZR();return(0,o.createElement)("div",{className:"wcf-list-options"},(0,o.createElement)("div",{className:"wcf-list-options-wrapper"},"tr"===t?(0,o.createElement)("table",{className:"w-full"},(0,o.createElement)("tbody",null,Object.keys(e.fields).map(t=>{const r=e.fields[t],a=n[r.name]?n[r.name]:"",i=Ah.isActiveControl(r,n);return(0,o.createElement)(uQ,{key:t,data:r,value:a,isActive:i,field:t})}))):(0,o.createElement)("div",{className:"wcf-list-options-container"},Object.keys(e.fields).map(r=>{const a=e.fields[r],i=n[a.name]?n[a.name]:"",s=Ah.isActiveControl(a,n);return(0,o.createElement)(uQ,{key:r,data:a,value:i,isActive:s,field:r,tabName:"list-options",displayAs:t})}))))},zX=function(e){const[t,n]=(0,i.useState)(e.isOpen?"":"collapsed"),r=e.settings.title.replace(/ /g,"_").toLowerCase(),a=e.settings.title.replace(/ /g,"-").toLowerCase();return(0,o.createElement)("div",{className:`wcf-${a} accordion-item bg-background-primary -mx-8 border-b border-border-subtle ${!1===e?.isActive?"hidden":""}`},(0,o.createElement)("h2",{className:"accordion-header mb-0 "+("landing"===e?.settings?.step_type&&"general"===e?.settings?.slug?"hidden":""),id:`wcf_${r}_toggler`.toLowerCase()},(0,o.createElement)("button",{className:`wcf-accordion-button relative flex justify-between items-center w-full py-4 px-8 text-base font-semibold text-text-primary text-left transition focus:outline-none ${t}`,type:"button","data-bs-toggle":"collapse","data-bs-target":`#wcf_collapse_${r}`,"aria-expanded":"false","aria-controls":`wcf_collapse_${r}`,onClick:function(){n("collapsed"===t?"":"collapsed")}},(0,o.createElement)("span",null,e.settings.title),""===t?(0,o.createElement)(N$,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}):(0,o.createElement)(Um,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}))),(0,o.createElement)("div",{id:`wcf_collapse_${r}`,className:`accordion-collapse px-8 pt-4 pb-8 ${t}`,"aria-labelledby":`wcf_${r}_toggler`},(0,o.createElement)("div",{className:"accordion-body"},(0,o.createElement)(LX,{settings:e.settings,displayAs:e.displayAs?e.displayAs:"tr"}))))},PX=function(){const[{step_id:e,design_settings:t,options:n,flow_type:r,flow_id:a,step_data:s,is_flow_instant_checkout:l}]=ZR(),c=t.settings,u=c?Object.values(c).sort(function(e,t){return e.priority-t.priority}):"",[{step_title:d}]=ZR(),f=(0,b.useHistory)(),m=$V();return(0,i.useEffect)(()=>{let e=!0;return()=>{e=!1}},[]),""===e?(0,o.createElement)(OX,null):(0,o.createElement)("div",{className:"wcf-design-page"},"storeCheckout"===r&&d&&"yes"!==l&&(0,o.createElement)("div",{className:"mb-3"},(0,o.createElement)("div",{className:"wcf-change-step wcf-button wcf-secondary-button",onClick:async function(){await m({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.__)("Update","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})&&f.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&step_id=${e}&flow_id=${a}&tab=update-template`)}},(0,o.createElement)("span",{className:""},(0,z.__)("Change Template","cartflows")))),(0,o.createElement)("div",{className:"wcf-step-notices-wrapper rounded-md bg-alert-background-warning border border-yellow-200 p-4 mb-3"},(0,o.createElement)("div",{className:"flex"},(0,o.createElement)("div",{className:"text-sm text-support-warning"},"yes"===l&&["checkout","upsell","downsell","thankyou"].includes(s?.type)?(0,o.createElement)(o.Fragment,null,(0,z.sprintf)( |
| 67 |
// translators: %s: The current step type. |
| 68 |
// translators: %s: The current step type. |
| 69 |
(0,z.__)("Use this setting to customize the style of the Instant %s Layout.","cartflows"),"thankyou"===s?.type?(0,z.__)("Thank You","cartflows"):s?.type.charAt(0).toUpperCase()+s?.type.slice(1))):(0,o.createElement)(o.Fragment,null,(0,z.__)("If you are using shortcodes, enable this design settings to apply styles.","cartflows"))))),u&&(0,o.createElement)("div",{className:"wcf-design-page__settings"},(0,o.createElement)("div",{className:"mb-4"},(0,o.createElement)(mQ,{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((e,t)=>(0,o.createElement)(zX,{settings:u[e],key:e,isOpen:0===t,isActive:Ah.isActiveControl(u[e],n)}))))},RX=function(e){const t=e.heading?e.heading:"",n=e.subHeading?e.subHeading:"",r=e.description?e.description:"",a=e.btnText||(0,z.__)("Upgrade to CartFlows Pro","cartflows"),i=e.class?e.class:"",s=e.usps?e.usps:"";return(0,o.createElement)("div",{className:`wcf-upgrade-to-pro-cta ${i}`},(0,o.createElement)("div",{className:"bg-brand-25 border border-solid border-brand-200 rounded-xl px-5 py-5 lg:px-6 sm:py-5"},(0,o.createElement)("div",{className:"flex flex-col gap-3"},t&&(0,o.createElement)($p,{size:"sm",tag:"h2",title:t}),n&&(0,o.createElement)(th,{size:14,color:"secondary"},n),(0,o.createElement)("div",{className:"flex items-center"},(0,o.createElement)(tZ,{buttonLink:e.buttonLink,ctaText:a}))),r&&(0,o.createElement)(th,{size:14,color:"secondary",className:"wcf-upgrade-to-pro-cta--text mt-3"},r),s&&(0,o.createElement)("ul",{className:"wcf-upgrade-to-pro-cta-list list-none p-0 m-0 mt-3"},s.map((e,t)=>(0,o.createElement)("li",{className:"wcf-upgrade-to-pro-cta-list-item flex gap-2 items-center mb-2",key:t},(0,o.createElement)(mW,{className:"w-18 h-18 stroke-2 text-brand-500 shrink-0"}),(0,o.createElement)(th,{size:14,color:"secondary"},e))))))},UX=function(){return(0,o.createElement)("div",{className:"wcf-settings-nav"},(0,o.createElement)("div",{className:"wcf-settings-nav__tabs"},Array(5).fill().map(e=>(0,o.createElement)("div",{className:"wcf-settings-nav__tab",key:e},(0,o.createElement)(DZ,{height:"45px"})))),(0,o.createElement)("div",{className:"wcf-settings-nav__content"},(0,o.createElement)(kZ,{fontSize:"35px",width:"225px"}),(0,o.createElement)(kZ,{width:"80%"}),(0,o.createElement)(kZ,{width:"80%"}),(0,o.createElement)(kZ,{width:"80%"}),(0,o.createElement)(kZ,{width:"65%"}),(0,o.createElement)(jZ,null),(0,o.createElement)(kZ,{fontSize:"35px",width:"300px"}),(0,o.createElement)(kZ,{width:"60%"}),(0,o.createElement)(kZ,{width:"60%"}),(0,o.createElement)(kZ,{width:"45%"})))},BX=function(){const[{step_id:e,flow_id:t,step_data:n}]=ZR(),[r,a]=(0,i.useState)("collapsed"),s=(0,b.useHistory)(),l=$V();return(0,o.createElement)("div",{className:"wcf-change-step-template accordion-item bg-background-primary -mx-8 border-b border-border-subtle"},(0,o.createElement)("h2",{className:"accordion-header mb-0",id:"wcf_change_step_template_toggler"},(0,o.createElement)("button",{className:`wcf-accordion-button relative flex justify-between items-center w-full py-4 px-8 text-base font-semibold text-text-primary text-left transition focus:outline-none ${r}`,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(){a("collapsed"===r?"":"collapsed")}},(0,o.createElement)("span",null,(0,z.__)("Change Template","cartflows")),""===r?(0,o.createElement)(N$,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}):(0,o.createElement)(Um,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}))),(0,o.createElement)("div",{id:"wcf_collapse_change_step_template",className:`accordion-collapse px-8 pt-4 pb-8 ${r}`,"aria-labelledby":"wcf_change_step_template_toggler"},(0,o.createElement)("div",{className:"accordion-body"},(0,o.createElement)("div",{className:"mb-3 flex items-center gap-4"},(0,o.createElement)("img",{src:function(){let e="";switch(n.type){case"landing":e=r$;break;case"checkout":e=a$;break;case"optin":e=s$;break;case"thankyou":e=l$;break;case"upsell":e=o$;break;case"downsell":e=i$}return e}(),alt:n.type,className:"rounded-lg w-[85px] h-[85px]"}),(0,o.createElement)("div",{className:"wcf-template-content"},(0,o.createElement)("div",{className:"wcf-step-template-type mb-3"},(0,o.createElement)("span",{className:"text-sm font-medium"},(0,z.__)("Step Type: ","cartflows")),(0,o.createElement)("span",{className:"text-sm font-normal text-text-secondary capitalize"},n.type)),(0,o.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.__)("Update","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})&&s.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}step_id=${e}&tab=update-template`)}},(0,o.createElement)("span",{className:""},(0,z.__)("Update Template","cartflows"))))))))},FX=function(){const[{step_data:e,settings_data:t,page_builder:n,flow_type:r,step_title:a,options:i}]=ZR(),[{license_status:s}]=g();let l=!0;if(void 0!==e.id&&(l=!1),l||!t?.settings)return(0,o.createElement)(UX,null);const c=t.settings,u=Object.values(c).sort(function(e,t){return e.priority-t.priority});return["upsell","downsell"].includes(e.type)&&wcfCartflowsPro()&&"Activated"!==s?(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-multiple-order-bumps wcf-multiple-order-bumps-cta"},(0,o.createElement)(RX,{heading:(0,z.__)("License is required!","cartflows"),subHeading:(0,z.__)("Activate the license to modify this offer step's settings","cartflows")}))):(0,o.createElement)("div",{className:"wcf-settings-page"},c&&Object.keys(u).map((t,r)=>"other"!==n&&"shortcode"===u[t].slug?null:(u[t].step_type=e?.type||"",(0,o.createElement)(zX,{settings:u[t],key:t,displayAs:"div",isOpen:0===r,isActive:Ah.isActiveControl(u[t],i)}))),"storeCheckout"===r&&a&&(0,o.createElement)(BX,null))},YX=function({settings:e},t="tr"){const[{options:n}]=ZR(),r=e=>{let t="";const r=e.name;if(r&&r.includes("[")){const a=r.split("["),o=[];for(let e=1;e<a.length;e++)o.push(a[e].split("]")[0]);const i=r.substr(0,r.indexOf("[")),s=n[i],l=n["wcf-offer-product"];if((null==l||""===l||l.length<=0)&&("wcf-offer-product[original_price]"===r||"wcf-offer-product[sell_price]"===r))return(0,z.__)("No product Selected","cartflows");const c=Array.isArray(l)?parseFloat(l[0].original_price):parseFloat(l.original_price);if("wcf-offer-product[sell_price]"===r&&c){const t=n["wcf-offer-discount"],r=parseFloat(n["wcf-offer-discount-value"]);let a=c;return"discount_percent"===t?r>0&&(a=(c-c*r/100).toFixed(2)):"discount_price"===t&&r>0&&(a=(c-r).toFixed(2)),e.class=a<0?"error_field":"",a}t=s[o[0]]}else t=n[e.name]?n[e.name]:"";return t};return(0,o.createElement)("div",{className:"wcf-list-options wcf-offer-list-options"},(0,o.createElement)("div",{className:"wcf-list-options-wrapper"},"tr"===t?(0,o.createElement)("table",{className:"w-full"},(0,o.createElement)("tbody",null,Object.keys(e.fields).map(t=>{const a=e.fields[t],i=r(a),s=Ah.isActiveControl(a,n);return(0,o.createElement)(uQ,{key:t,data:a,value:i,isActive:s,field:t})}))):(0,o.createElement)("div",{className:"wcf-list-options-container"},Object.keys(e.fields).map(a=>{const i=e.fields[a],s=r(i),l=Ah.isActiveControl(i,n);return(0,o.createElement)(uQ,{key:a,data:i,value:s,isActive:l,field:a,tabName:"list-options",displayAs:t})}))),(0,o.createElement)("table",null,(0,o.createElement)("tbody",null)))},QX=function(){return(0,o.createElement)("div",{className:"wcf-checkout-products is-placeholder"},(0,o.createElement)("div",{className:"wcf-checkout-products--selection wcf-checkout__section"},(0,o.createElement)("div",{className:"wcf-product-selection-wrapper"},(0,o.createElement)("div",{className:"wcf-list-options"},(0,o.createElement)("div",{className:"wcf-list-options__title"},(0,o.createElement)("div",{className:"title wcf-placeholder__width--30"})),(0,o.createElement)("table",null,(0,o.createElement)("tbody",null,(0,o.createElement)("tr",null,(0,o.createElement)("th",null,(0,o.createElement)("div",{className:"wcf-checkout-product-selection-field"},(0,o.createElement)("div",{className:"wcf-checkout-product-selection-field__add-new"},(0,o.createElement)("div",{className:"wcf-checkout-products__button"}),(0,o.createElement)("div",{className:"wcf-checkout-products__button"})))))))))),(0,o.createElement)("div",{className:"wcf-checkout-products__pro-options"},(0,o.createElement)("div",{className:"wcf-checkout-products--coupon"},(0,o.createElement)("div",{className:"wcf-coupon-selection-wrapper"},(0,o.createElement)("div",{className:"wcf-list-options"},(0,o.createElement)("div",{className:"wcf-list-options__title"},(0,o.createElement)("div",{className:"title"})),(0,o.createElement)("table",null,(0,o.createElement)("tbody",null,(0,o.createElement)("tr",null,(0,o.createElement)("th",null,(0,o.createElement)("div",null,(0,o.createElement)("div",{className:"wcf-select2-field"},(0,o.createElement)("div",{className:"title"}))))))))))),(0,o.createElement)("div",{className:"wcf-field wcf-submit"},(0,o.createElement)("div",{className:"wcf-checkout-products__button"})))},VX=function(){const[{settings_data:e,page_settings:t,options:n,step_data:r},a]=ZR(),[{license_status:s}]=g(),l=n["wcf-offer-product"]?n["wcf-offer-product"]:"",c=[{value:"",label:"No Discount",icon:(0,o.createElement)(HR,{className:"w-5 h-5"})},{value:"discount_percent",label:"Discount Percentage",icon:(0,o.createElement)(XR,{className:"w-5 h-5"})},{value:"discount_price",label:"Discount Price",icon:(0,o.createElement)(JR,{className:"w-5 h-5"})}],[u,d]=(0,i.useState)(),[f,m]=(0,i.useState)(""),p=(0,z.__)("Add","cartflows"),h=void 0===l.discount_type||""===l.discount_type?"disable":"enable",[w,y]=(0,i.useState)(h);(0,i.useEffect)(()=>{y(l?.discount_type?"enable":"disable")},[l]);const[b,v]=(0,i.useState)({isInProcessing:!1,buttonText:p}),{isInProcessing:x,buttonText:_}=b;return void 0===e.settings?(0,o.createElement)(QX,null):["upsell","downsell"].includes(r.type)&&wcfCartflowsPro()&&"Activated"!==s?(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-multiple-order-bumps wcf-multiple-order-bumps-cta"},(0,o.createElement)(RX,{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"]),r=parseFloat(l.original_price);let a=0;"discount_percent"===e?t>0&&(a=r-r*t/100):"discount_price"===e&&t>0&&(a=r-t),l.sell_price=a.toFixed(2)}(),(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-offer-product--wrapper"},(0,o.createElement)("div",{className:"wcf-offer-products--selection wcf-products__section"},0===l.length?(0,o.createElement)(o.Fragment,null,(0,o.createElement)("input",{name:"wcf-offer-product[]",type:"hidden",value:""}),(0,o.createElement)("div",{className:"wcf-offer-no-product--notice border border-border-subtle 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,o.createElement)("div",{className:"wcf-offer-product-selection-field__add-new flex justify-between items-end gap-5 mt-5"},(0,o.createElement)(nQ,{name:"",desc:"",field:"product",value:f,allowed_products:"",include_products:"braintree-subscription, braintree-variable-subscription",excluded_products:"grouped",placeholder:(0,z.__)("Search for a Product","cartflows"),onChangeCB:d,sectionClass:"flex-1"}),(0,o.createElement)(Va,{type:"button",variant:"outline",size:"md",icon:(0,o.createElement)(KO,{className:"w-4 h-4"}),iconPosition:"left",loading:x,disabled:x,onClick:function(){const e=u?.value;m(u),e&&(v({isInProcessing:!0,buttonText:(0,z.__)("Adding…","cartflows")}),L()({path:`/cartflows/v1/admin/product-data/${e}`}).then(t=>{console.log(t),a({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}}),m(null),v({isInProcessing:!1,buttonText:p})}),d(null))},className:"wcf-select-product-button shrink-0 h-fit"},_))):(0,o.createElement)("div",{className:"overflow-visible shadow border border-border-subtle rounded-md"},(0,o.createElement)("div",{className:"wcf-offer-product-selection--header border-b border-border-subtle flex gap-4 p-3"},(0,o.createElement)("div",{className:"text-left text-sm font-semibold text-text-primary w-2/5"},(0,z.__)("Items","cartflows")),(0,o.createElement)("div",{className:"flex gap-2"},(0,o.createElement)("div",{className:"text-left text-sm font-semibold text-text-primary w-20"},(0,z.__)("Quantity","cartflows")),(0,o.createElement)("div",{className:"text-left text-sm font-semibold text-text-primary w-44"},(0,z.__)("Discount","cartflows")),(0,o.createElement)("div",{className:"text-left text-sm font-semibold text-text-primary w-24"},(0,z.__)("Shipping Rate","cartflows")),(0,o.createElement)("div",{className:"relative w-[5%]"},(0,o.createElement)("span",{className:"sr-only"},(0,z.__)("Delete","cartflows"))))),(0,o.createElement)("div",{className:"wcf-offer-product-selection--selected-product flex items-center p-3 gap-4"},(0,o.createElement)("div",{className:"wcf-offer-product-selection--product-title whitespace-nowrap text-sm font-medium text-text-primary w-2/5"},(0,o.createElement)("div",{className:"flex gap-3 items-center"},(0,o.createElement)("div",{className:"wcf-offer-product-selection--product-image flex w-24 h-24"},(0,o.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:fh(l.label)})),(0,o.createElement)("div",{className:"wcf-offer-product-selection--product-title_text"},(0,o.createElement)("div",{className:"wcf-offer-product-repeater-field__title whitespace-normal text-left","data-product_id":l.value},fh(l.label)),(0,o.createElement)("div",{className:"wcf-offer-product-repeater-field__reg-price mt-1"},(0,o.createElement)("div",{className:"flex gap-2"},(0,o.createElement)("span",{className:"wcf-offer-product--reg-price "+(0<l.sell_price?"line-through text-text-tertiary":"")},cartflows_admin.woo_currency+l.original_price),0<l.sell_price&&(0,o.createElement)("span",{className:"wcf-offer-product--sale-price"},cartflows_admin.woo_currency+l.sell_price)))))),(0,o.createElement)("div",{className:"flex-1 flex gap-2"},(0,o.createElement)("div",{className:"wcf-offer-product-selection--product-qty"},(0,o.createElement)(wU,{id:"",name:"wcf-offer-quantity",class:"input-field !w-20 !text-sm font-normal !m-0",value:n["wcf-offer-quantity"],min:"1"})),(0,o.createElement)("div",{className:"wcf-offer-product-selection--product-discount flex gap-2"},(0,o.createElement)(hQ,{name:"wcf-offer-discount",value:n["wcf-offer-discount"],class:"!w-20 !m-0",options:c,callback:function(e,t,n){y(""===n?"disable":"enable")}}),(0,o.createElement)(wU,{id:"",class:"input-field !w-20 !m-0",name:"wcf-offer-discount-value",value:"disable"===w?"":n["wcf-offer-discount-value"],readonly:"disable"===w?"readonly":"",placeholder:"disable"===w?"":"0",min:"1",step:"any"})),(0,o.createElement)("div",{className:"wcf-offer-product-selection--flat-rate flex"},(0,o.createElement)(wU,{id:"",class:"input-field !w-20 !m-0",name:"wcf-offer-flat-shipping-value",placeholder:"0",value:n["wcf-offer-flat-shipping-value"],min:"0"})),(0,o.createElement)("div",{className:"wcf-offer-product-selection-actions flex gap-2 relative whitespace-nowrap text-right text-sm font-medium w-[5%] justify-center"},(0,o.createElement)("div",{className:"wcf-delete-product-item py-2 text-brand-500 hover:text-brand-700 cursor-pointer text-right flex justify-end",onClick:function(){a({type:"REMOVE_OFFER_PRODUCT",field_name:"wcf-offer-product"})}},(0,o.createElement)(aU,{className:"h-18 w-18"}))),(0,o.createElement)("input",{name:"wcf-offer-product[]",type:"hidden",className:"wcf-checkout-product-id",value:l.value}))))),(0,o.createElement)("div",{className:"wcf-offer-product--common-settings pt-8"},(0,o.createElement)(YX,{settings:t?.settings.product,displayAs:"div"})))))},WX=function(){return(0,o.createElement)("div",{className:"flex flex-col gap-5"},(0,o.createElement)("div",{className:"flex items-center justify-between py-1"},(0,o.createElement)(cO,{className:"w-40 h-4"}),(0,o.createElement)(cO,{className:"w-10 h-5 rounded-full"})),(0,o.createElement)(cO,{className:"w-full h-48 rounded-lg"}),(0,o.createElement)("div",{className:"flex gap-2"},(0,o.createElement)(cO,{className:"w-1/3 h-9 rounded-md"}),(0,o.createElement)(cO,{className:"w-1/3 h-9 rounded-md"}),(0,o.createElement)(cO,{className:"w-1/3 h-9 rounded-md"})),["w-32","w-40","w-28","w-36"].map((e,t)=>(0,o.createElement)("div",{key:t,className:"flex flex-col gap-2"},(0,o.createElement)(cO,{className:`${e} h-3.5`}),(0,o.createElement)(cO,{className:"w-full h-10 rounded-md"}))))},ZX=function(e){const[{page_settings:t,options:n}]=ZR(),r=e=>{let t="";const r=e.name;if(r&&r.includes("[")){const a=r.split("["),o=[];for(let e=1;e<a.length;e++)o.push(a[e].split("]")[0]);const i=r.substr(0,r.indexOf("[")),s=n[i];if("wcf-pre-checkout-offer-product[original_price]"===r||"wcf-pre-checkout-offer-product[sell_price]"===r){const t=n["wcf-pre-checkout-offer-product"];if(""===t||null==t||t.length<=0)return(0,z.__)("No product Selected","cartflows");const a=Array.isArray(t)?parseFloat(t[0].original_price):parseFloat(t.original_price);if("wcf-pre-checkout-offer-product[original_price]"===r)return isNaN(a)?"":String(a);if("wcf-pre-checkout-offer-product[sell_price]"===r&&!isNaN(a)){const t=n["wcf-pre-checkout-offer-discount"],r=parseFloat(n["wcf-pre-checkout-offer-discount-value"]);let o=a;return"discount_percent"===t?r>0&&(o=(a-a*r/100).toFixed(2)):"discount_price"===t&&r>0&&(o=(a-r).toFixed(2)),e.class=o<0?"error_field":"",isNaN(parseFloat(o))?"":String(o)}}t=s[o[0]]}else t=n[e.name]?n[e.name]:"";return t};let a=[];switch(e.tab){case"product":default:a=t?.settings["checkout-offer-product"];break;case"content":a=t?.settings["checkout-offer-content"];break;case"styles":a=t?.settings["checkout-offer-styles"]}const i=function(t){return Object.keys(t.section_fields).map(a=>{const i=t.section_fields[a],s=r(i),l=Ah.isActiveControl(i,n);return(0,o.createElement)(uQ,{key:a,data:i,value:s,isActive:l,field:a,tabName:e.tab?e.tab:"",displayAs:e.displayAs?e.displayAs:""})})};return(0,o.createElement)("div",{className:"wcf-list-options wcf-co-list-options"},(0,o.createElement)("div",{className:"wcf-co-options-wrapper",id:"wcf-co-options-wrapper"},a&&Object.keys(a.fields).map(t=>{const s=a.fields[t];return s.section_fields?(0,o.createElement)("div",{key:t,className:`wcf-${e.tab?e.tab:"setting"}-tab--${s.id}-section p-5 border border-border-subtle rounded-md mb-5`},(0,o.createElement)("div",{className:`wcf-${e.tab?e.tab:"setting"}-tab--heading-section col-span-full`},(0,o.createElement)(PY,{label:s.title,labelClass:"block text-base font-semibold text-text-primary mb-5"})),e.displayAs&&"tr"===e.displayAs?(0,o.createElement)("table",{className:"w-full"},(0,o.createElement)("tbody",null,i(s))):(0,o.createElement)("div",{className:"wcf-co-list-options-container"},i(s))):(0,o.createElement)("div",{key:t,className:`wcf-${e.tab?e.tab:"setting"}-tab--section mb-5`},e.displayAs&&"tr"===e.displayAs?(0,o.createElement)("table",{className:"wcf-full"},(0,o.createElement)("tbody",null,(0,o.createElement)(uQ,{key:t,data:s,value:r(s),isActive:Ah.isActiveControl(s,n),field:s,tabName:e.tab?e.tab:"",displayAs:e.displayAs?e.displayAs:""}))):(0,o.createElement)("div",{className:"wcf-co-list-options-container"},(0,o.createElement)(uQ,{key:t,data:s,value:r(s),isActive:Ah.isActiveControl(s,n),field:s,tabName:e.tab?e.tab:"",displayAs:e.displayAs?e.displayAs:""})))})))};function GX({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 HX=i.forwardRef(GX);function $X({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 XX=i.forwardRef($X),qX=function(){const[{options:e}]=ZR(),[t,n]=(0,i.useState)("");(0,i.useEffect)(()=>{const e=document.getElementById("wcf-checkout-offer-preview-wrapper"),t=e.offsetTop-25,n=window.addEventListener("scroll",()=>{window.pageYOffset>t?e.classList.add("sticky"):e.classList.remove("sticky")});return()=>{window.removeEventListener("scroll",n)}},[]);let r=e["wcf-pre-checkout-offer-product"];null!==r&&Array.isArray(r)&&(r=r[0]);const a=e["wcf-pre-checkout-offer-discount"],s=parseFloat(e["wcf-pre-checkout-offer-discount-value"]);let l="";const c=r?parseFloat(r.original_price).toFixed(2):0;"discount_percent"===a?s>0&&(l=(c-c*s/100).toFixed(2)):"discount_price"===a&&s>0&&(l=(c-s).toFixed(2));const u=r&&r.product_image?r.product_image:cartflows_admin.image_placeholder;return(0,o.createElement)("div",{id:"wcf-checkout-offer-preview-wrapper",className:"fullscreen"===t?"wcf-checkout-offer-preview-wrapper fullscreen":"wcf-checkout-offer-preview-wrapper"},(0,o.createElement)("div",{className:"fullscreen"===t?"p-6":"mt-8 bg-background-secondary p-6 -mx-6"},(0,o.createElement)("div",{className:"wcf-pre-checkout-offer--header flex justify-between items-center mb-5 p-2.5"},(0,o.createElement)(Qf,{tag:"span",size:"md",className:"font-semibold text-text-primary"},(0,z.__)("Preview","cartflows")),""===t&&(0,o.createElement)("div",{className:"wcf-co-preview-mode wcf-full-screen-preview-button p-2.5 text-text-tertiary hover:text-text-secondary cursor-pointer",onClick:()=>n("fullscreen")},(0,o.createElement)(HX,{className:"w-5 h-5 stroke-2",title:(0,z.__)("View in Full Screen","cartflows")})),"fullscreen"===t&&(0,o.createElement)("div",{className:"wcf-co-preview-mode wcf-full-screen-preview-exit-button p-2.5 text-text-tertiary hover:text-text-secondary cursor-pointer",onClick:()=>n("")},(0,o.createElement)(XX,{className:"w-5 h-5 stroke-2",title:(0,z.__)("Exit Full Screen","cartflows")}))),(0,o.createElement)("div",{className:"wcf-pre-checkout-offer-wrapper wcf-pre-checkout-full-width"},(0,o.createElement)("div",{id:"wcf-pre-checkout-offer-modal",style:{backgroundColor:e["wcf-pre-checkout-offer-model-bg-color"]},className:"bg-background-primary border border-border-subtle rounded-md"},(0,o.createElement)("div",{className:"wcf-content-main-wrapper"},(0,o.createElement)("div",{className:"wcf-lightbox-content p-6",style:{backgroundColor:e["wcf-pre-checkout-offer-model-bg-color"]}},(0,o.createElement)("div",{className:"wcf-content-modal-progress-bar mb-8"},(0,o.createElement)("div",{className:"wcf-progress-bar-nav",style:{color:e["wcf-pre-checkout-offer-desc-color"]}},(0,o.createElement)("div",{className:"wcf-pre-checkout-progress grid grid-cols-3 text-center text-sm font-normal text-text-secondary max-w-2xl mx-auto"},(0,o.createElement)("div",{className:"wcf-nav-bar-step active"},(0,o.createElement)("div",{className:"wcf-nav-bar-title mb-3",style:{color:e["wcf-pre-checkout-offer-desc-color"]}},(0,z.__)("Order Submitted","cartflows")),(0,o.createElement)("div",{className:"wcf-nav-bar-step-line relative"},(0,o.createElement)("div",{className:"wcf-progress-nav-step",style:{backgroundColor:e["wcf-pre-checkout-offer-navbar-color"]}},(0,o.createElement)("span",{className:"before"})),(0,o.createElement)("span",{className:"order-after",style:{backgroundColor:e["wcf-pre-checkout-offer-navbar-color"]}}))),(0,o.createElement)("div",{className:"wcf-nav-bar-step active inprogress"},(0,o.createElement)("div",{className:"wcf-nav-bar-title mb-3",style:{color:e["wcf-pre-checkout-offer-desc-color"]}},(0,z.__)("Special Offer","cartflows")),(0,o.createElement)("div",{className:"wcf-nav-bar-step-line relative"},(0,o.createElement)("span",{className:"before",style:{backgroundColor:e["wcf-pre-checkout-offer-navbar-color"]}}),(0,o.createElement)("div",{className:"wcf-progress-nav-step",style:{backgroundColor:e["wcf-pre-checkout-offer-navbar-color"]}},(0,o.createElement)("span",{className:"before"})),(0,o.createElement)("span",{className:"after"}))),(0,o.createElement)("div",{className:"wcf-nav-bar-step"},(0,o.createElement)("div",{className:"wcf-nav-bar-title mb-3"},(0,z.__)("Order Receipt","cartflows")),(0,o.createElement)("div",{className:"wcf-nav-bar-step-line relative"},(0,o.createElement)("span",{className:"before"}),(0,o.createElement)("div",{className:"wcf-progress-nav-step"})))))),(0,o.createElement)("div",{className:"wcf-content-main-head text-center mb-8"},(0,o.createElement)("div",{className:"wcf-content-modal-title"},(0,o.createElement)("h1",{style:{color:e["wcf-pre-checkout-offer-title-color"]},className:"text-xl font-semibold text-text-primary mb-2.5"},e["wcf-pre-checkout-offer-popup-title"])),(0,o.createElement)("div",{className:"wcf-content-modal-sub-title"},(0,o.createElement)("span",{style:{color:e["wcf-pre-checkout-offer-subtitle-color"]},className:"text-sm font-normal text-600"},e["wcf-pre-checkout-offer-popup-sub-title"]))),(0,o.createElement)("div",{id:"wcf-pre-checkout-offer-content",className:"woocommerce border-2 border-border-subtle border-dashed rounded items-center",style:{backgroundColor:e["wcf-pre-checkout-offer-model-bg-color"]}},(0,o.createElement)("div",{className:"flex gap-4 p-5 items-center"},(0,o.createElement)("div",{className:"wcf-pre-checkout-info wcf-pre-checkout-img w-2/5"},(0,o.createElement)("img",{src:u,alt:"Checkout Offer Product",className:"border border-border-subtle"})),(0,o.createElement)("div",{className:"wcf-pre-checkout-info wcf-pre-checkout-offer-product-details w-3/5"},(0,o.createElement)("div",{className:"wcf-pre-checkout-offer-product-title"},(0,o.createElement)("h1",{style:{color:e["wcf-pre-checkout-offer-title-color"]}},e["wcf-pre-checkout-offer-product-title"])),(0,o.createElement)("div",{className:"wcf-pre-checkout-offer-price",style:{color:e["wcf-pre-checkout-offer-desc-color"],fontWeight:500}},cartflows_admin.woo_currency,""!==l&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("del",{className:"wcf-regular-price"},isNaN(c)?0:c),(0,o.createElement)("span",{className:"wcf-discount-price"}," ",l)),""===l&&(0,o.createElement)("span",{className:"wcf-regular-price"},isNaN(c)?0:c)),(0,o.createElement)("div",{className:"wcf-pre-checkout-offer-desc"},(0,o.createElement)("span",{style:{color:e["wcf-pre-checkout-offer-desc-color"],lineHeight:"0"}},fh((e["wcf-pre-checkout-offer-desc"]||"").toString()))),(0,o.createElement)("input",{type:"hidden",value:"add",className:"wcf-pre-checkout-offer-action"}))),(0,o.createElement)("div",{className:"wcf-pre-checkout-offer-actions flex flex-col gap-3 p-5"},(0,o.createElement)("div",{className:"wcf-pre-checkout-offer-btn-action wcf-pre-checkout-add-cart-btn"},(0,o.createElement)("button",{className:"wcf-pre-checkout-offer-btn alt !w-full text-base !bg-brand-500 !rounded !text-text-on-color !font-semibold px-4 py-3 !text-center",style:{backgroundColor:e["wcf-pre-checkout-offer-button-color"],borderColor:e["wcf-pre-checkout-offer-button-color"]}},e["wcf-pre-checkout-offer-popup-btn-text"])),(0,o.createElement)("div",{className:"wcf-pre-checkout-offer-btn-action wcf-pre-checkout-skip-btn text-center"},(0,o.createElement)("a",{className:"wcf-pre-checkout-skip text-text-tertiary",href:"#",style:{color:e["wcf-pre-checkout-offer-desc-color"]}},e["wcf-pre-checkout-offer-popup-skip-btn-text"]))))))))))},JX=function(){const[{settings_data:e,options:t}]=ZR(),[n,r]=(0,i.useState)("product"),a=$V();if(!wcfCartflowsPro())return(0,o.createElement)(RY,{feature:"Checkout Offer",plan_required:"starter"});if(void 0===e.settings)return(0,o.createElement)(WX,null);const s="yes"===t["wcf-pre-checkout-offer"];return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(mQ,{name:"wcf-pre-checkout-offer",value:t["wcf-pre-checkout-offer"],label:(0,z.__)("Enable Checkout Offer","cartflows"),fullWidth:!0}),s&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-co-preview"},(0,o.createElement)(qX,null)),(0,o.createElement)("div",{className:"mt-8 mb-8"},(0,o.createElement)(AQ.Group,{variant:"rounded",size:"sm",width:"full",activeItem:n,onChange:({value:e})=>async function(e){e!==n?(await async function(){return!!window.wcfUnsavedChanges&&await a({title:(0,z.__)("Save Changes","cartflows"),description:(0,z.__)("You have made changes. Do you want to save the changes?","cartflows"),actionBtnText:(0,z.__)("Save","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})}()||r(e),window.wcfUnsavedChanges=!1):r(e)}(e.slug)},(0,o.createElement)(AQ.Tab,{slug:"product",text:(0,z.__)("Product","cartflows"),icon:(0,o.createElement)(B$,{className:"w-4 h-4"})}),(0,o.createElement)(AQ.Tab,{slug:"content",text:(0,z.__)("Content","cartflows"),icon:(0,o.createElement)(Y$,{className:"w-4 h-4"})}),(0,o.createElement)(AQ.Tab,{slug:"styles",text:(0,z.__)("Styles","cartflows"),icon:(0,o.createElement)(V$,{className:"w-4 h-4"})}))),(0,o.createElement)("div",{className:"wcf-checkout-offer-settings wcf-checkout__section"},(0,o.createElement)(ZX,{tab:n,displayAs:"div"}))))},KX=function(){return(0,o.createElement)("div",{className:"wcf-checkout-rules-page"},(0,o.createElement)("div",{className:"wcf-checkout-rules-page--enable_option"},(0,o.createElement)(kZ,{width:"65%"})),(0,o.createElement)("div",{className:"wcf-checkout-rules--group_wrapper"},(0,o.createElement)("div",{className:"wcf-checkout-rules--text"},(0,o.createElement)(kZ,{width:"10%"}),(0,o.createElement)(DZ,{width:"25%",height:"35px"}),(0,o.createElement)(kZ,{width:"20%"})),(0,o.createElement)("div",{className:"wcf-checkout-rules"},Array(3).fill().map((e,t)=>(0,o.createElement)("div",{className:"wcf-checkout-rule",key:t},(0,o.createElement)("div",{className:"wcf-checkout-rule--select-box"},(0,o.createElement)(DZ,{height:"35px",width:"30%"}),(0,o.createElement)(DZ,{height:"35px",width:"30%"}),(0,o.createElement)(DZ,{height:"35px",width:"30%"})),2!==t&&(0,o.createElement)("div",{className:"wcf-checkout-rule__and"},(0,o.createElement)(DZ,{height:"25px",width:"5%"}))))),(0,o.createElement)(DZ,{height:"40px",width:"9%"})),(0,o.createElement)("div",{className:"wcf-checkout-rules--or"},(0,o.createElement)(DZ,{height:"35px",width:"5%"}),(0,o.createElement)(DZ,{height:"45px",width:"12%"})),(0,o.createElement)("div",{className:"wcf-checkout-rules--default-step"},(0,o.createElement)(kZ,{width:"10%"}),(0,o.createElement)(DZ,{width:"25%",height:"35px"}),(0,o.createElement)(kZ,{width:"20%"})))},eq=function(){return(0,o.createElement)(nZ,{title:(0,z.__)("Show Every Customer the Offer They’ll Actually Buy","cartflows"),description:(0,z.__)("Target offers by location, cart value, and more. Upgrade to CartFlows Pro and turn every visit into a personalized sale.","cartflows")})},tq=function({rules:e,group_id:t,g_index:n,groups_length:r}){const[{page_settings:a},i]=ZR(),s=a?.settings.rules,l=s?.conditions;return(0,o.createElement)(o.Fragment,null,e.map((a,c)=>{const u=a?.rule_id,d=e[c],f=s?.field_data[d.condition],m=f?.operator||[],p=d.operator||m[0]?.value||"",h=String(p).replace(/</g,"<").replace(/>/g,">"),g=((e=[])=>"wcf-checkout-rules--rule_fields flex flex-col justify-center items-end sm:grid gap-3 w-full "+(e.some(e=>"product"===e.type)?"sm:grid-cols-2":"sm:grid-cols-3"))(f?.fields);return(0,o.createElement)(o.Fragment,null,0!==c&&(0,o.createElement)("div",{className:"wcf-checkout-rules--group_rules__condition-label"},(0,o.createElement)("div",{className:"wcf--condition-label__and_group relative"},(0,o.createElement)("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true"},(0,o.createElement)("div",{className:"w-full border-t border-border-subtle border-dashed"})),(0,o.createElement)("div",{className:"relative flex justify-center"},(0,o.createElement)(Yf,{variant:"neutral",type:"rounded",size:"xs",label:(0,z.__)("AND","cartflows"),className:"wcf--condition-label__and_group__text"})))),(0,o.createElement)("div",{className:"wcf-checkout-rules--group_rules flex gap-3 items-center","data-rule-id":u,key:u},(0,o.createElement)("input",{type:"hidden",name:`wcf-checkout-rules[${n}][rules][${c}][rule_id]`,value:u}),(0,o.createElement)("div",{className:g},(0,o.createElement)(WO,{name:`wcf-checkout-rules[${n}][rules][${c}][condition]`,wrapperClass:"block",options:l,onSelect:()=>{i({type:"RESET_RULE_VALUE",name:"wcf-checkout-rules",group_id:t,rule_id:u})},value:d.condition,sectionClass:"w-full sm:!w-auto"}),(0,o.createElement)(WO,{name:`wcf-checkout-rules[${n}][rules][${c}][operator]`,wrapperClass:"block",options:f?.operator,value:fh(h),sectionClass:"w-full sm:!w-auto"}),function(e,t,r){const a=r.value;let i="";const s=`wcf-checkout-rules[${n}][rules][${t}][value]`;return e&&e?.map(e=>{switch(e.type){case"multitext":i=(0,o.createElement)(fQ,{name:`${s}`,value:a,fields:e.fields});break;case"text":i=(0,o.createElement)(ZO,{name:`${s}`,value:a,placeholder:e.placeholder,tooltip:e.tooltip,contentClass:"w-full"});break;case"select2":i=(0,o.createElement)(YR,{name:`${s}[]`,value:a,placeholder:e.placeholder,tooltip:e.tooltip,options:e.options,isMulti:e.isMulti,isSearchable:e?.enable_search});break;case"number":i=(0,o.createElement)(wU,{name:s,value:a,min:0,placeholder:e.placeholder,tooltip:e.tooltip});break;case"coupon":i="exist"===r.operator||"not_exist"===r.operator?(0,o.createElement)(WO,{name:s,options:[{label:"in parent order",value:"parent_order"}]}):(0,o.createElement)(rQ,{name:s,placeholder:e.placeholder,tooltip:e.tooltip,value:a,isMulti:e.isMulti});break;case"product":i=(0,o.createElement)(nQ,{name:s,placeholder:e.placeholder,tooltip:e.tooltip,value:a,isMulti:e.isMulti,sectionClass:"col-span-full",showLabelOnly:!0})}return i})}(f?.fields,c,d)),(0,o.createElement)("div",{className:"wcf-checkout-rules--rule_actions"},function(e,n){return 1===e&&1===r?"":(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(aU,{className:"w-4 h-4 stroke-2 text-text-tertiary"}),className:"!p-1 hover:!bg-background-secondary [&_svg]:hover:text-brand-700",onClick:e=>{e.currentTarget.setAttribute("rule_id",n),(e=>{const n=e.target.getAttribute("rule_id");t&&n&&i({type:"REMOVE_RULE",name:"wcf-checkout-rules",rule_id:n,group_id:t})})({target:e.currentTarget})},rule_id:n})}(e.length,u))))}))},nq=e=>(0,o.createElement)("svg",(0,_.A)({width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},e),(0,o.createElement)("circle",{cx:"7",cy:"5",r:"1.25",fill:"currentColor"}),(0,o.createElement)("circle",{cx:"7",cy:"10",r:"1.25",fill:"currentColor"}),(0,o.createElement)("circle",{cx:"7",cy:"15",r:"1.25",fill:"currentColor"}),(0,o.createElement)("circle",{cx:"13",cy:"5",r:"1.25",fill:"currentColor"}),(0,o.createElement)("circle",{cx:"13",cy:"10",r:"1.25",fill:"currentColor"}),(0,o.createElement)("circle",{cx:"13",cy:"15",r:"1.25",fill:"currentColor"})),rq=function(){const[{step_data:e,step_id:t,options:n},r]=ZR(),[a,s]=(0,i.useState)({ruleGroupId:"",isOpen:!1}),[{license_status:l}]=g(),{ruleGroupId:c,isOpen:u}=a;if(!wcfCartflowsPro()||"Activated"!==l)return(0,o.createElement)(eq,null);if(null===n)return(0,o.createElement)(KX,null);const d=n["wcf-checkout-rules"];if(void 0===d)return(0,o.createElement)(zY,{content:(0,z.__)("Please Update the CartFlows Pro to the latest version to use the dynamic offers feature.","cartflows")});const f=()=>{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:""}]};r({type:"ADD_NEW_GROUP",name:"wcf-checkout-rules",newGroup:e})},m=function(e){const t=e.target.getAttribute("data-group_id");s({ruleGroupId:t,isOpen:c!==t||!u})};return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-checkout-rules-page"},(0,o.createElement)("div",{className:"wcf-checkout-rules-page--enable_option"},(0,o.createElement)(mQ,{name:"wcf-checkout-rules-option",value:n["wcf-checkout-rules-option"],label:(0,z.__)("Enable Dynamic Offers","cartflows"),tooltip:(0,z.__)("Turn this on to set up rules that decide when visitors should be redirected to a special offer or the next step.","cartflows"),fullWidth:!0})),"yes"===n["wcf-checkout-rules-option"]&&d&&(0,o.createElement)("div",{className:"mt-8"},(0,o.createElement)(QR.ReactSortable,{id:"wcf-checkout-rules-sortable-wrapper",className:"wcf-checkout-rules--sortable-wrapper flex flex-col gap-4",list:d,setList:e=>r({type:"SET_RULES_GROUPS",groups:e,fieldName:"wcf-checkout-rules",step_id:t}),swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-checkout-rules--group",filter:".wcf-checkout-rules--rule_fields, .wcf-checkout-rules--rule_actions, .wcf-field.wcf-select-option, .wcf-checkout-rules--add-rule__repeater .wcf-button.wcf-button--secondary, .wcf-field__data--content, .wcf-checkout-rules-page--group_wrapper__footer, .wcf-checkout-rules--group_header",preventOnFilter:!1,onStart:function(){document.getElementsByClassName("wcf-checkout-rules--or_group__button")[0].setAttribute("style","display:none")},onEnd:function(){document.getElementsByClassName("wcf-checkout-rules--or_group__button")[0].setAttribute("style","display:inline-block")}},d.map((t,n)=>{const a=t.group_id,i=t.rules;return(0,o.createElement)("div",{className:"wcf-checkout-rules-page--group_wrapper",key:a},(0,o.createElement)("div",{className:"wcf-checkout-rules--group border border-solid border-cartflows-border rounded-md shadow-sm bg-background-primary overflow-hidden","data-group-id":a},(0,o.createElement)("input",{type:"hidden",name:`wcf-checkout-rules[${n}][group_id]`,value:a}),(0,o.createElement)("div",{className:"wcf-checkout-rules--group-header wcf-redirection-step bg-background-primary p-4 flex items-center justify-between flex-wrap gap-4"},(0,o.createElement)("div",{className:"wcf-checkout-rules--group-header__left flex gap-4 items-center"},(0,o.createElement)("div",{className:"wcf-checkout-rule--sortable-toggle flex cursor-move text-text-tertiary hover:text-text-secondary"},(0,o.createElement)(nq,null)),(0,o.createElement)("div",{className:"border border-solid border-cartflows-border rounded-md shadow-sm flex items-center gap-4 px-3 py-1 h-10 bg-background-primary"},(0,o.createElement)("div",{className:"text-sm font-normal text-text-tertiary whitespace-nowrap"},(0,z.__)("Redirect to:","cartflows")),(0,o.createElement)(WO,{name:`wcf-checkout-rules[${n}][step_id]`,class:"w-full !max-w-full h-auto input-field !text-sm !font-medium !rounded-none !text-text-primary !border-none focus:ring-0 focus:!border-none focus:!shadow-none !outline-0 !outline-none !m-0 !p-0 !placeholder-text-tertiary",value:t.step_id,placeholder:(0,z.__)("Search for step…","cartflows"),options:e.step_lists,overrideCss:!0})),(0,o.createElement)("div",{className:"text-sm font-normal text-text-tertiary"},(0,z.__)("If the following conditions are true","cartflows"))),(0,o.createElement)("div",{className:"wcf-checkout-rules--group-header__right flex gap-2 items-center"},c===a&&u?(0,o.createElement)(N$,{className:"w-4 h-4 stroke-1 text-text-tertiary hover:text-text-secondary cursor-pointer","aria-hidden":"true",onClick:m,"data-group_id":a}):(0,o.createElement)(Um,{className:"w-4 h-4 stroke-1 text-text-tertiary hover:text-text-secondary cursor-pointer","aria-hidden":"true",onClick:m,"data-group_id":a}))),(0,o.createElement)("div",{id:`wcf-checkout-rules--group-${a}`,className:"p-4 bg-background-secondary border-t border-solid border-border-subtle border-0 "+(c===a&&u?"visible":"hidden")},(0,o.createElement)("div",{className:"wcf-checkout-rules--group-rules__wrapper flex flex-col gap-4"},0!==i.length&&(0,o.createElement)(tq,{rules:i,group_id:a,g_index:n,groups_length:d.length})),(0,o.createElement)("div",{className:"wcf-checkout-rules--add-rule__repeater flex mt-4"},(0,o.createElement)(Va,{variant:"link",size:"sm",icon:(0,o.createElement)(KO,{className:"w-4 h-4 stroke-2"}),iconPosition:"left",className:"wcf-checkout-rules--add-rule__button hover:!no-underline",onClick:()=>(e=>{const t={rule_id:Math.random().toString(36).substring(2,5),condition:"cart_item",operator:"",value:""};r({type:"ADD_NEW_RULE",name:"wcf-checkout-rules",newRule:t,group_id:e})})(a)},(0,z.__)("Add Condition","cartflows"))))),(0,o.createElement)("div",{className:"wcf-checkout-rules-page--group_wrapper__footer"},(0,o.createElement)("div",{className:"wcf-checkout-rules--or-group relative my-4"},(0,o.createElement)("div",{className:"absolute inset-0 flex items-center","aria-hidden":"true"},(0,o.createElement)("div",{className:"w-full border-t border-border-subtle border-dashed"})),(0,o.createElement)("div",{className:"relative flex justify-center"},(0,o.createElement)(Yf,{variant:"neutral",type:"rounded",size:"xs",label:(0,z.__)("OR","cartflows"),className:"wcf-checkout-rules--or_group__text"}))),parseInt(n)+1===d.length&&(0,o.createElement)("div",{className:"wcf-checkout-rules--or_group__button mt-4"},(0,o.createElement)(Va,{variant:"outline",size:"md",icon:(0,o.createElement)(KO,{className:"w-4 h-4 stroke-2"}),iconPosition:"left",className:"wcf-checkout-rules--or_group_button !bg-brand-25 !text-brand-600 !outline-brand-300 hover:!bg-brand-50 hover:!outline-brand-300",onClick:f},(0,z.__)("Add Dynamic Offer","cartflows")))))}))),"yes"===n["wcf-checkout-rules-option"]&&(0,o.createElement)("div",{className:"wcf-checkout-rules--default-step border border-solid border-cartflows-border rounded-md shadow-sm bg-background-primary p-4 flex items-center justify-between gap-4 mt-8"},(0,o.createElement)("div",{className:"wcf-checkout-rules--default-step__left border border-solid border-cartflows-border rounded-md shadow-sm flex items-center gap-4 px-3 h-10 bg-background-primary"},(0,o.createElement)("div",{className:"text-sm font-normal text-text-tertiary whitespace-nowrap"},(0,z.__)("Redirect to:","cartflows")),(0,o.createElement)(WO,{name:"wcf-checkout-rules-default-step",class:"w-full !max-w-full h-auto input-field !text-sm !font-medium !rounded-none !text-text-primary !border-none focus:ring-0 focus:!border-none focus:!shadow-none !outline-0 !outline-none !m-0 !p-0 !placeholder-text-tertiary",value:n["wcf-checkout-rules-default-step"],placeholder:(0,z.__)("Search for default step…","cartflows"),options:e.step_lists,overrideCss:!0})),(0,o.createElement)("div",{className:"text-sm font-normal text-text-tertiary"},(0,z.__)("If all of the above conditions failed.","cartflows")))))};function aq({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a2.25 2.25 0 0 0-2.25-2.25H15a3 3 0 1 1-6 0H5.25A2.25 2.25 0 0 0 3 12m18 0v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 9m18 0V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v3"}))}const oq=i.forwardRef(aq),iq=function(e){const{innerField:t,innerFieldData:n}=e,[{options:r}]=ZR();return(0,o.createElement)("div",{className:"wcf-field-item--fields-settings__wrapper bg-white hidden p-5 border border-solid border-border-subtle my-5 rounded-md shadow-sm",id:`wcf-field-setting-${t}`},n&&Object.keys(n.field_options).map(e=>{const t=n.field_options[e];let a="";const i=function(e){const t=e.name;let n="";if(t.includes("[")){const e=t.split("["),a=[];for(let t=1;t<e.length;t++)a.push(e[t].split("]")[0]);const o=t.substr(0,t.indexOf("["));switch(a.length){case 2:n=r[o][a[0]][a[1]];break;case 3:n=r[o][a[0]][a[1]][a[2]];break;case 4:n=r[o][a[0]][a[1]][a[2]][a[3]];break;default:n=r[o][a[0]]}}else n=r[e.name]?r[e.name]:e.value;return n}(t);switch(t.type){case"text":a=(0,o.createElement)(ZO,{name:t.name,value:i,label:t.label,placeholder:t.placeholder,readonly:t.readonly,tooltip:t.tooltip,displayAlign:"vertical"});break;case"number":a=(0,o.createElement)(wU,{name:t.name,value:i,label:t.label,readonly:t.readonly,tooltip:t.tooltip,displayAlign:"vertical",min:t.min});break;case"checkbox":a=(0,o.createElement)(mO,{class:t.class,name:t.name,value:i,label:t.label,desc:t.desc,child_className:t.child_class});break;case"select":a=(0,o.createElement)(WO,{class:t.class,name:t.name,value:i,label:t.label,options:t.options,tooltip:t.tooltip,displayAlign:"vertical"});break;case"doc":a=(0,o.createElement)(zY,{content:t.content})}return(0,o.createElement)("div",{key:t.name,className:`wcf-cfe-field-setting__panel wcf-cfe-field-${e} mb-5 ${"enable-field"===e||"required-field"===e?"hidden":""}`},a)}))},sq=function(e){const[{billing_fields:t,shipping_fields:n},r]=ZR(),{step:a,type:s,removeCallback:l}=e,[c,u]=(0,i.useState)(""),[d,f]=(0,i.useState)("");let m=[];m="billing"===s?t:n;const p=function(e){const t=e.currentTarget.getAttribute("data-name"),n=document.getElementById(`wcf-field-setting-${t}`);n&&(n.classList.contains("hidden")?(n.classList.remove("hidden"),u(t)):(n.classList.add("hidden"),u("")))},h=function(e){l(e,f)},g=({name:e,value:a,fieldName:o})=>{const i=("billing"===s?t:n).map(t=>t.field_options[o].name===e?{...t,field_options:{...t.field_options,[o]:{...t.field_options[o],value:a}}}:t);r({type:"SET_FIELDS",field_type:s,fields:i})};return(0,o.createElement)("div",{className:"py-5"},(0,o.createElement)("div",{className:`wcf-${s}-fields--header flex items-center p-3 gap-4 bg-background-secondary rounded-md`},(0,o.createElement)("div",{className:"w-3/12 pl-7"},(0,z.__)("Label","cartflows")),(0,o.createElement)("div",{className:"w-3/12"},(0,z.__)("ID","cartflows")),(0,o.createElement)("div",{className:"w-1/5 text-center"},(0,z.__)("Enable","cartflows")),(0,o.createElement)("div",{className:"w-1/5 text-center"},(0,z.__)("Required","cartflows")),(0,o.createElement)("div",{className:"w-1/12 text-center"},(0,z.__)("Edit","cartflows"))),(0,o.createElement)(QR.ReactSortable,{list:[...m],setList:e=>r({type:"SET_FIELDS",field_type:s,fields:e}),direction:"vertical",animation:150,handle:".wcf-field-item-handle",filter:".wcf-field-settings-icon, .wcf-toggle-field"},m&&m.map(e=>{const t=e.key,n=e.field_options["enable-field"],r=e.field_options["required-field"];return(0,o.createElement)("div",{key:t,className:"wcf-field-item-handle "+("yes"!==n.value?"!text-text-tertiary":""),"data-key":t},(0,o.createElement)("div",{className:"wcf-fields-wrapper flex items-center p-3 border-0 border-b border-solid border-border-subtle gap-4"},(0,o.createElement)("div",{className:"wcf-field--label whitespace-nowrap w-3/12 flex items-center mr-auto"},(0,o.createElement)("div",{className:"wcf-cpf--sortable-toggle flex cursor-move text-text-tertiary"},(0,o.createElement)(eU,{className:"w-5 h-5 stroke-1","aria-hidden":"true"}),(0,o.createElement)(eU,{className:"w-5 h-5 stroke-1 -ml-3.5","aria-hidden":"true"})),(0,o.createElement)("span",{className:"w-44 text-ellipsis overflow-hidden cursor-default text-sm text-text-secondary"},e.label?e.label:e.placeholder," "),("billing_email"===t||"shipping_email"===t)&&"checkout"===a&&(0,o.createElement)(Ja,{content:(0,z.__)("Your email address can't be edited when using the Modern Checkout Style.","cartflows"),placement:"top"},(0,o.createElement)("span",null,(0,o.createElement)(iU,{className:"w-4 h-4 text-icon-secondary cursor-help ml-1"}))),"billing_company"===t&&"checkout"===a&&(0,o.createElement)(Ja,{content:(0,z.__)("The Company field won't be visible if you're using the Instant Layout Style.","cartflows"),placement:"top"},(0,o.createElement)("span",null,(0,o.createElement)(iU,{className:"w-4 h-4 text-icon-secondary cursor-help ml-1"})))),(0,o.createElement)("div",{className:"wcf-field--key whitespace-nowrap w-3/12 text-ellipsis overflow-hidden mr-auto cursor-default"},e.key),(0,o.createElement)("div",{className:"wcf-field--is-enable w-1/5 wcf-toggle-field flex justify-center"},(0,o.createElement)(bO,{value:"yes"===n.value,onChange:e=>g({name:n.name,value:e?"yes":"no",fieldName:"enable-field"})}),(0,o.createElement)("input",{type:"hidden",name:n.name,value:n.value})),(0,o.createElement)("div",{className:"wcf-field--is-required w-1/5 wcf-toggle-field flex justify-center"},(0,o.createElement)(bO,{value:"yes"===n.value&&"yes"===r.value,onChange:e=>g({name:r.name,value:e?"yes":"no",fieldName:"required-field"}),disabled:"yes"!==n.value}),(0,o.createElement)("input",{type:"hidden",name:r.name,value:"yes"!==n.value?"no":r.value})),(0,o.createElement)("div",{className:"wcf-field-settings-icon flex gap-2 w-1/12 justify-center items-center"},(0,o.createElement)("div",{onClick:p,"data-name":t},(0,o.createElement)(nU,{className:"w-4 h-4 cursor-pointer "+(c===t?"text-brand-500":"text-text-tertiary hover:text-brand-500"),"data-name":t})),e.custom&&(0,o.createElement)("div",{"data-key":t,"data-type":s,onClick:h},t===d?(0,o.createElement)(Wf,{className:"wcf-delete-cpf--button-processing p-1 h-4 w-4 text-brand-500 pointer-events-none animate-spin","data-key":t,"data-type":s}):(0,o.createElement)(aU,{className:"wcf-delete-cpf--button-delete p-1 h-4 w-4 text-brand-500 cursor-pointer","data-key":t,"data-type":s})))),(0,o.createElement)(iq,{innerField:t,innerFieldData:e,removecustomField:h,type:s}))})))},lq={left:{open:{x:0},exit:{x:"-100%"}},right:{open:{x:0},exit:{x:"100%"}}},cq=({children:e,className:t})=>{const{open:n,position:r,handleClose:a,transitionDuration:o,getFloatingProps:i,drawerContainerRef:s,scrollLock:l,context:c,className:u,refs:d}=vq();return c&&i?(0,P.jsx)(pm,{children:n&&(0,P.jsx)(ca,{ref:s,lockScroll:l,className:Oe("z-50",u),children:(0,P.jsx)(ia,{context:c,modal:!0,...d?.reference&&{returnFocus:d.reference},children:(0,P.jsx)("div",{className:"fixed inset-0 overflow-hidden",children:(0,P.jsx)("div",{className:"relative inset-0 h-full flex items-center",children:(0,P.jsx)("div",{className:Oe("flex items-center justify-center h-full w-full",{"justify-start":"left"===r,"justify-end":"right"===r}),children:(0,P.jsx)(kf.div,{className:Oe("flex flex-col w-120 h-full bg-background-primary shadow-2xl overflow-hidden z-20",t),initial:"exit",animate:"open",exit:"exit",variants:lq[r],transition:o,ref:e=>{setTimeout(()=>{d?.setFloating(e)},1e3*((o?.duration||.3)+.1))},"aria-label":"drawer",role:"dialog","aria-modal":"true",...i?.(),children:"function"==typeof e?e({close:a}):e})})})})})})}):null};cq.displayName="Drawer.Panel";const uq=({children:e,className:t,...n})=>(0,P.jsx)("div",{className:Oe("space-y-2 px-5 pt-5 pb-4",t),...n,children:e});uq.displayName="Drawer.Header";const dq=({children:e,as:t="h3",className:n,...r})=>(0,P.jsx)(t,{className:Oe("text-base font-semibold text-text-primary m-0 p-0",n),...r,children:e});dq.displayName="Drawer.Title";const fq=({children:e,as:t="p",className:n,...r})=>(0,P.jsx)(t,{className:Oe("text-sm font-normal text-text-secondary my-0 ml-0 mr-1 p-0",n),...r,children:e});fq.displayName="Drawer.Description";const mq=({children:e,className:t,...n})=>(0,P.jsx)("div",{className:Oe("px-5 pb-4 pt-2 flex flex-col flex-1 overflow-y-auto overflow-x-hidden",t),...n,children:e});mq.displayName="Drawer.Body";const pq=({children:e,className:t})=>{const{design:n,handleClose:r}=vq();return(0,P.jsx)("div",{className:Oe("px-5 py-4 flex justify-end gap-3 mt-auto",{"bg-background-secondary":"footer-divided"===n,"border-t border-b-0 border-x-0 border-solid border-border-subtle":"footer-bordered"===n},t),children:e?"function"==typeof e?e({close:r}):e:null})};pq.displayName="Drawer.Footer";const hq=({className:e,...t})=>(0,P.jsx)("button",{className:Oe("bg-transparent inline-flex justify-center items-center border-0 p-1 m-0 cursor-pointer focus:outline-none outline-none shadow-none",e),"aria-label":"Close drawer",...t,children:(0,P.jsx)(Ff,{className:"size-4 text-text-primary shrink-0"})}),gq=({children:e,as:t=i.Fragment,...n})=>{const{handleClose:r}=vq();return e?t===i.Fragment?"function"==typeof e?e({close:r}):(0,i.isValidElement)(e)?(0,i.cloneElement)(e,{onClick:r}):(0,P.jsx)(hq,{onClick:r,...n}):(0,P.jsx)(t,{...n,onClick:r,children:e}):(0,P.jsx)(hq,{onClick:r,...n})};gq.displayName="Drawer.CloseButton";const wq={open:{opacity:1},exit:{opacity:0}},yq=({className:e,...t})=>{const{open:n,drawerContainerRef:r,transitionDuration:a}=vq(),[o,s]=(0,i.useState)(null);(0,i.useEffect)(()=>{r?.current&&s(r.current)},[n,r]);const l=(0,P.jsx)(pm,{mode:"wait",children:n&&(0,i.createElement)(kf.div,{className:Oe("fixed inset-0 -z-10 bg-background-inverse/90",e),...t,initial:"exit",animate:"open",exit:"exit",variants:wq,transition:a,key:"backdrop"})});return o?(0,wn.createPortal)(l,o):l};yq.displayName="Drawer.Backdrop";const bq=(0,i.createContext)({}),vq=()=>(0,i.useContext)(bq),xq=({open:e,setOpen:t,children:n,trigger:r,className:a,exitOnClickOutside:o=!1,exitOnEsc:s=!0,design:l="simple",position:c="right",transitionDuration:u=.2,scrollLock:d=!0})=>{const f=void 0!==e&&void 0!==t,[m,p]=(0,i.useState)(!1),h=(0,i.useRef)(null),g=(0,i.useMemo)(()=>f?e:m,[e,m,f]),w=(0,i.useMemo)(()=>f?t:p,[t,p,f]),y=()=>{g||w(!0)},{refs:b,context:v}=wa({open:g,onOpenChange:w,transform:!1}),x=ga(v,{enabled:s||o,escapeKey:s,outsidePress:e=>!!o&&!e?.target?.closest("ul.fui-toast-container")}),_=ja(v,{role:"dialog"}),E=fa(v),{getFloatingProps:N}=xa([x,_,E]),M=(0,i.useCallback)(()=>(0,i.isValidElement)(r)?(0,i.cloneElement)(r,{onClick:Le(y,r.props.onClick),ref:b.setReference,"aria-haspopup":"dialog","aria-expanded":g}):"function"==typeof r?r({onClick:y}):null,[r,y,b.setReference]);return(0,P.jsxs)(P.Fragment,{children:[M(),(0,P.jsx)(bq.Provider,{value:{open:g,setOpen:w,handleClose:()=>{g&&w(!1)},design:l,position:c,drawerContainerRef:h,transitionDuration:{duration:u},getFloatingProps:N,scrollLock:d,context:v,className:a,refs:b},children:n})]})};xq.displayName="Drawer",xq.Panel=cq,xq.Header=uq,xq.Title=dq,xq.Description=fq,xq.Body=mq,xq.CloseButton=gq,xq.Footer=pq,xq.Backdrop=yq,xq.Portal=({children:e,...t})=>(0,P.jsx)(Jr,{...t,children:e});const _q=function(e){const{addNewField:t,step_type:n}=e,r=(0,z.__)("Add New Field","cartflows"),a=(0,z.__)("Date & Time","cartflows"),[s,l]=(0,i.useState)(!1),[c,u]=(0,i.useState)(!1),[d,f]=(0,i.useState)(r),[m,p]=(0,i.useState)(),h=function(){l(!1),u(!1),b(!1),f(r)},[g,w]=(0,i.useState)(!1),[y,b]=(0,i.useState)(!1),[v,x]=(0,i.useState)(!0),[_,E]=(0,i.useState)(!1),[N,M]=(0,i.useState)(!1),[I,S]=(0,i.useState)(!1),[k,j]=(0,i.useState)("datetime-local"),[D,C]=(0,i.useState)(a),A=function(){b(!y)},[T,O]=(0,i.useState)(!1),L=function(){const e=document.getElementById("wcf-checkout-custom-fields[0][type]").value;E(!1),M(!1),S(!1),x(!1),O(!1),"text"===e||"textarea"===e?x(!0):"select"===e?S(!0):"checkbox"===e?E(!0):"radio"===e?M(!0):"file"===e&&O(!0),w(e)},P=function(e){let t=e.replace(/[^a-zA-Z\d ]/g," ");t=t.replace(/\s/g,"_").toLowerCase(),p(t)},R=function(e){j(e.target.value),"datetime-local"===e.target.value?C(a):C(e.target.value)},U=function(){let e="";if("datetime"!==g)return e;switch(k){case"date":e="yyyy-mm-dd";break;case"time":e="hh:mm";break;case"datetime-local":e="yyyy-mm-dd hh.mm";break;default:e=""}return e};return(0,o.createElement)("div",{className:"wcf-custom-field-box"},(0,o.createElement)("div",{className:"flex justify-end"},(0,o.createElement)(Va,{variant:"outline",size:"md",className:"wcf-add-custom-field text-brand-500 bg-brand-50 outline-brand-500",onClick:function(e){e.preventDefault(),p(""),l(!s)},icon:(0,o.createElement)(KO,{className:"h-18 w-18 text-brand-500"}),iconPosition:"left"},(0,z.__)("Add Custom Field","cartflows"))),(0,o.createElement)(xq,{open:s,setOpen:e=>{e||h()},position:"right",exitOnClickOutside:!1,className:"wcf-add-custom-field-drawer z-999999"},(0,o.createElement)(xq.Panel,{className:"pointer-events-auto w-screen max-w-xl flex flex-col h-full"},(0,o.createElement)(xq.Backdrop,null),(0,o.createElement)(xq.Header,{className:"flex items-center justify-between !space-y-0"},(0,o.createElement)(xq.Title,null,(0,z.__)("Add Custom Field","cartflows")),(0,o.createElement)(xq.CloseButton,{type:"button"})),(0,o.createElement)(xq.Body,{className:"wcf-cfe-content flex-1 overflow-y-auto"},function(){const e=[{value:"billing",label:(0,z.__)("Billing","cartflows")},{value:"shipping",label:(0,z.__)("Shipping","cartflows")}],t=[{value:"text",label:(0,z.__)("Text","cartflows")},{value:"textarea",label:(0,z.__)("TextArea","cartflows")},{value:"number",label:(0,z.__)("Number","cartflows")},{value:"datetime",label:(0,z.__)("Date & Time","cartflows")},{value:"checkbox",label:(0,z.__)("Checkbox","cartflows")},{value:"radio",label:(0,z.__)("Radio","cartflows")},{value:"select",label:(0,z.__)("Select","cartflows")},{value:"hidden",label:(0,z.__)("Hidden","cartflows")},{value:"file",label:(0,z.__)("File","cartflows")}],r=[{value:"33",label:(0,z.__)("33%","cartflows")},{value:"50",label:(0,z.__)("50%","cartflows")},{value:"100",label:(0,z.__)("100%","cartflows")}],a="w-full max-wi-full input-field !text-sm font-normal !rounded-md text-text-tertiary !border-border-subtle focus:ring focus:!ring-brand-100 focus:!border-brand-500 focus:!shadow-none !outline-0 !outline-none !m-0";return(0,o.createElement)("div",{className:"wcf-custom-field-form--wrapper text-left"},"checkout"===n&&(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(WO,{class:"wcf-cpf-add_to",name:"wcf-checkout-custom-fields[0][add_to]",options:e,label:(0,z.__)("Add To","cartflows"),displayAlign:"vertical"})),(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(WO,{class:"wcf-cpf-type",id:"wcf-checkout-custom-fields[0][type]",name:"wcf-checkout-custom-fields[0][type]",options:t,label:(0,z.__)("Type","cartflows"),onSelect:L,displayAlign:"vertical"})),(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(ZO,{class:`wcf-cpf-label ${a}`,name:"wcf-checkout-custom-fields[0][label]",label:fh((0,z.sprintf)(/* translators: %$s is replaced with the HTML tag */ /* translators: %$s is replaced with the HTML tag */ |
| 70 |
(0,z.__)("Label %1$s*%2$s","cartflows"),'<span class="text-brand-300">',"</span>")),onChangeCB:P,displayAlign:"vertical",placeholder:(0,z.__)("e.g. Phone Number","cartflows")})),(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(ZO,{class:`wcf-cpf-name ${a}`,name:"wcf-checkout-custom-fields[0][key]",value:m,label:(0,z.__)("Field ID","cartflows"),displayAlign:"vertical",placeholder:(0,z.__)("e.g. phone_number","cartflows")}),(0,o.createElement)(th,{as:"span",className:"text-sm font-normal text-text-tertiary mt-2 block"},(0,z.__)('Field value will store in this meta key. Add field id without prefix like "billing_" or "shipping_". Use "_" instead of spaces.',"cartflows"))),"number"===g&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(wU,{class:`wcf-cpf-min ${a}`,name:"wcf-checkout-custom-fields[0][min]",label:(0,z.__)("Min Value","cartflows"),displayAlign:"vertical",min:0,placeholder:(0,z.__)("e.g. 0","cartflows")})),(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(wU,{class:`wcf-cpf-max ${a}`,name:"wcf-checkout-custom-fields[0][max]",label:(0,z.__)("Max Value","cartflows"),displayAlign:"vertical",min:0,placeholder:(0,z.__)("e.g. 100","cartflows")}))),(I||N)&&(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(HO,{class:`wcf-cpf-options ${a}`,name:"wcf-checkout-custom-fields[0][options]",label:(0,z.__)("Options","cartflows"),placeholder:(0,z.__)("Enter your options separated by (|).","cartflows"),displayAlign:"vertical"})),_&&(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(WO,{class:"wcf-cpf-default",name:"wcf-checkout-custom-fields[0][default]",label:(0,z.__)("Default","cartflows"),options:[{value:"1",label:(0,z.__)("Checked","cartflows")},{value:"0",label:(0,z.__)("UnChecked","cartflows")}],displayAlign:"vertical"})),"datetime"===g&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(WO,{class:`wcf-cpf-date-input ${a}`,name:"wcf-checkout-custom-fields[0][date_input]",label:(0,z.__)("Field Input Type","cartflows"),options:[{label:(0,z.__)("Date & Time","cartflows"),value:"datetime-local"},{label:(0,z.__)("Date","cartflows"),value:"date"},{label:(0,z.__)("Time","cartflows"),value:"time"}],displayAlign:"vertical",value:k,onSelect:R})),(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(ZO,{class:`wcf-cpf-min-date ${a}`,labelClass:"text-sm font-medium text-left capitalize",textFieldType:k,name:"wcf-checkout-custom-fields[0][default]",label:(0,z.__)("Min ","cartflows")+D,displayAlign:"vertical",placeholder:U()})),(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(ZO,{class:`wcf-cpf-max-date ${a}`,labelClass:"text-sm font-medium text-left capitalize",textFieldType:k,name:"wcf-checkout-custom-fields[0][default]",label:(0,z.__)("Max ","cartflows")+D,displayAlign:"vertical",placeholder:U()}))),!_&&!T&&(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(ZO,{class:`wcf-cpf-default ${a}`,textFieldType:"datetime"===g&&k?k:"text",name:"wcf-checkout-custom-fields[0][default]",label:(0,z.__)("Default","cartflows"),displayAlign:"vertical",placeholder:U()||(0,z.__)("e.g. Default value","cartflows")})),v&&!T&&(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(ZO,{class:`wcf-cpf-placeholder ${a}`,name:"wcf-checkout-custom-fields[0][placeholder]",label:(0,z.__)("Placeholder","cartflows"),displayAlign:"vertical",placeholder:(0,z.__)("e.g. Enter your phone number","cartflows")})),"file"===g&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(wU,{class:`wcf-cpf-file-size ${a}`,name:"wcf-checkout-custom-fields[0][file_size]",label:(0,z.__)("File Size (MB)","cartflows"),tooltip:(0,z.__)("Enter the maximum allowed file size. Default is 5MB.","cartflows"),displayAlign:"vertical",min:0,placeholder:(0,z.__)("e.g. 5","cartflows")})),(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(ZO,{class:`wcf-cpf-accepted-file-types ${a}`,textFieldType:"text",name:"wcf-checkout-custom-fields[0][accepted_file_types]",label:(0,z.__)("Accepted File Types","cartflows"),tooltip:(0,z.__)("Enter comma-separated file extensions (e.g. jpg, png, gif)","cartflows"),displayAlign:"vertical",placeholder:(0,z.__)("e.g. jpg, png, gif","cartflows")}))),(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(WO,{class:"wcf-cpf-width",name:"wcf-checkout-custom-fields[0][width]",options:r,value:"100",label:(0,z.__)("Width","cartflows"),displayAlign:"vertical"})),(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(mO,{class:"wcf-cpf-show-in-email",name:"wcf-checkout-custom-fields[0][show_in_email]",label:(0,z.__)("Show in Email","cartflows")})),(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(mO,{class:"wcf-cpf-required",name:"wcf-checkout-custom-fields[0][required]",label:(0,z.__)("Required","cartflows"),onClick:A})),!y&&"optin"!==n&&(0,o.createElement)("div",{className:"wcf-custom-field-form--field-row pb-5"},(0,o.createElement)(mO,{class:"wcf-cpf-optimized",name:"wcf-checkout-custom-fields[0][optimized]",label:(0,z.__)("Collapsible","cartflows")})))}()),(0,o.createElement)(xq.Footer,{className:"flex gap-3 justify-end"},(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:function(e){e.preventDefault(),l(!1)}},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(Va,{variant:"primary",size:"md",onClick:function(e){e.preventDefault(),f((0,z.__)("Adding…","cartflows")),u(!0),c||t(e,h,f)||u(!1)}},d)))))},Eq=function(){return(0,o.createElement)("div",{className:"wcf-custom-field-editor wcf-checkout__section is-placeholder"},(0,o.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,o.createElement)("div",{className:"wcf-custom-field-editor__title"},(0,o.createElement)("div",{className:"title"})),(0,o.createElement)("form",null,(0,o.createElement)("table",null,(0,o.createElement)("tbody",null,(0,o.createElement)("tr",null,(0,o.createElement)("td",null,(0,o.createElement)("div",{className:"title"}))),(0,o.createElement)("tr",null,(0,o.createElement)("td",null,(0,o.createElement)("div",{className:"title"}))),(0,o.createElement)("tr",null,(0,o.createElement)("td",null,(0,o.createElement)("div",{className:"title"}))),(0,o.createElement)("tr",null,(0,o.createElement)("td",null,(0,o.createElement)("div",{className:"title"}))),(0,o.createElement)("tr",null,(0,o.createElement)("td",null,(0,o.createElement)("div",{className:"title"}))),(0,o.createElement)("tr",null,(0,o.createElement)("td",null,(0,o.createElement)("div",{className:"title"}))))),(0,o.createElement)("div",{className:"wcf-field wcf-submit"},(0,o.createElement)("div",{className:"wcf-checkout-custom-fields__button"})))),(0,o.createElement)(kZ,{fontSize:"35px",width:"400px"}),(0,o.createElement)(kZ,{width:"80%"}),(0,o.createElement)(kZ,{width:"80%"}),(0,o.createElement)(kZ,{width:"80%"}),(0,o.createElement)(kZ,{width:"65%"}))},Nq=function(){const[{custom_fields:e,step_id:t,options:n,billing_fields:r,shipping_fields:a},s]=ZR(),[l,c]=(0,i.useState)("collapsed"),[u,d]=(0,i.useState)("billing"),f=$V();if(void 0===e)return(0,o.createElement)(Eq,null);const m=[{name:(0,z.__)("Billing Fields","cartflows"),slug:"billing",icon:(0,o.createElement)(oq,{className:"w-5 h-5","aria-hidden":"true"})},{name:(0,z.__)("Shipping Fields","cartflows"),slug:"shipping",icon:(0,o.createElement)(_$,{className:"w-5 h-5","aria-hidden":"true"})}],p=async function(e,n){if(e.preventDefault(),!await f({title:(0,z.__)("Delete Field","cartflows"),description:(0,z.__)("Are you really want to delete field?","cartflows"),actionBtnText:(0,z.__)("Delete","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")}))return;const o=new FormData,i=e.target.getAttribute("data-key"),l=e.target.getAttribute("data-type");n(i),o.append("action","cartflows_pro_delete_custom_field"),o.append("security",cartflows_admin.delete_custom_field_nonce),o.append("post_id",t),o.append("key",i),o.append("type",l),o.append("step","checkout"),L()({url:cartflows_admin.ajax_url,method:"POST",body:o}).then(e=>{if(e.status){const e=r.filter(function(e){return e.key!==i});s({type:"SET_FIELDS",field_type:"billing",fields:e});const t=a.filter(function(e){return e.key!==i});s({type:"SET_FIELDS",field_type:"shipping",fields:t}),n(""),pp.success((0,z.__)("Custom field deleted!","cartflows"))}})};return(0,o.createElement)("div",{className:"wcf-custom-field-editor wcf-checkout__section"},(0,o.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,o.createElement)(zX,{settings:e.extra_fields,isOpen:!0}),(0,o.createElement)("div",{className:"wcf-field-editor accordion-item bg-background-primary -mx-8 border-b border-border-subtle"},(0,o.createElement)("h2",{className:"accordion-header mb-0",id:"wcf_field_editor_toggler"},(0,o.createElement)("button",{className:`wcf-accordion-button relative flex justify-between items-center w-full py-4 px-8 text-base font-semibold text-text-primary text-left transition focus:outline-none ${l}`,type:"button","data-bs-toggle":"collapse","data-bs-target":"#wcf_collapse_field_editor_toggler","aria-expanded":"false","aria-controls":"wcf_collapse_field_editor_toggler",onClick:function(){c("collapsed"===l?"":"collapsed")}},(0,o.createElement)("span",null,(0,z.__)("Field Editor","cartflows")),""===l?(0,o.createElement)(N$,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}):(0,o.createElement)(Um,{className:"w-5 h-5 text-text-tertiary","aria-hidden":"true"}))),(0,o.createElement)("div",{id:"wcf_collapse_field_editor_toggler",className:`accordion-collapse px-8 pt-4 pb-8 ${l}`,"aria-labelledby":"wcf_field_editor_toggler"},(0,o.createElement)("div",{className:"accordion-body"},(0,o.createElement)(mQ,{name:"wcf-custom-checkout-fields",value:n["wcf-custom-checkout-fields"],label:(0,z.__)("Enable Custom Field Editor","cartflows"),classes:"wcf-enable-custom-field-editor",fullWidth:!0}),"yes"===n["wcf-custom-checkout-fields"]&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-checkout-fields-tabs isolate inline-flex h-11 rounded-md shadow-sm w-full mt-4 mb-0"},m.map(e=>{const t=e.slug===u,n=t?"z-10 bg-brand-25 border-primary-300 hover:bg-brand-25 outline-none text-primary-600":"bg-background-primary border-border-subtle hover:bg-brand-25 hover:border-primary-600";return(0,o.createElement)("button",{type:"button",className:Gf()("relative text-center w-3/6 items-center border px-4 py-2 text-sm font-medium text-text-primary hover:text-primary-600",n),onClick:()=>d(e.slug),key:e.slug},(0,o.createElement)("span",{className:(t?"text-primary-600":"")+" text-sm font-medium text-center flex justify-center items-center gap-1"},e.icon,e.name))})),"billing"===u&&(0,o.createElement)("div",{id:"wcf-billing-fields",className:"wcf-billing-fields billing-field-sortable wcf-field-row w-full"},r&&(0,o.createElement)(sq,{data:r,step:"checkout",type:"billing",removeCallback:p})),"shipping"===u&&(0,o.createElement)("div",{id:"wcf-shipping-fields",className:"wcf-shipping-fields shipping-field-sortable wcf-field-row w-full"},a&&(0,o.createElement)(sq,{data:a,step:"checkout",type:"shipping",removeCallback:p})),(0,o.createElement)("div",{className:"text-end"},wcfCartflowsPro()&&(0,o.createElement)("div",{className:""},(0,o.createElement)(_q,{addNewField:function(e,o,i){e.preventDefault();const l=document.getElementsByClassName("wcf-cpf-add_to")[0],c=document.getElementsByClassName("wcf-cpf-type")[0],u=document.getElementsByClassName("wcf-cpf-label")[0],d=document.getElementsByClassName("wcf-cpf-name")[0],f=document.getElementsByClassName("wcf-cpf-min")[0],m=document.getElementsByClassName("wcf-cpf-max")[0],p=document.getElementsByClassName("wcf-cpf-default")[0],h=document.getElementsByClassName("wcf-cpf-placeholder")[0],g=document.getElementsByClassName("wcf-cpf-options")[0],w=document.getElementsByClassName("wcf-cpf-min-date")[0],y=document.getElementsByClassName("wcf-cpf-max-date")[0],b=document.getElementsByClassName("wcf-cpf-width")[0],v=document.getElementsByClassName("wcf-cpf-show-in-email")[0],x=document.getElementsByClassName("wcf-cpf-required")[0],_=document.getElementsByClassName("wcf-cpf-optimized")[0],E=document.getElementsByClassName("wcf-cpf-date-input")[0],N=E?E.value:"",M=document.getElementsByClassName("wcf-cpf-file-size")[0],I=document.getElementsByClassName("wcf-cpf-accepted-file-types")[0];if(""===u.value){const e=document.createElement("span");return e.className="text-xs text-brand-500",e.textContent=(0,z.__)("Label is required field","cartflows"),document.querySelector(".wcf-cpf-label").insertAdjacentElement("afterend",e),u.focus(),i((0,z.__)("Add New Field","cartflows")),""}const S=["jpg","jpeg","png","gif","webp","ico","pdf","mp3","m4a","ogg","wav","mp4","m4v","mov","wmv","avi","mpg","ogv","3gp","3g2"];if(I&&I.value.trim()){const e=I.value.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e).filter(e=>!S.includes(e));if(e.length){const t=document.querySelector(".wcf-cpf-accepted-file-types + .wcf-cpf-error");t&&t.remove();const n=document.createElement("span");return n.className="wcf-cpf-error text-xs text-brand-500",n.textContent=(0,z.sprintf)(/* translators: %s: invalid extensions */ /* translators: %s: invalid extensions */ |
| 71 |
(0,z.__)("Invalid file type(s): %s","cartflows"),e.join(", ")),I.insertAdjacentElement("afterend",n),I.focus(),i((0,z.__)("Add New Field","cartflows")),""}}const k=new FormData;k.append("add_to",l?l.value:""),k.append("type",c?c.value:""),k.append("label",u?u.value:""),k.append("name",d?d.value:""),k.append("default",p?p.value:""),k.append("min",f?f.value:""),k.append("max",m?m.value:""),k.append("placeholder",h?h.value:""),k.append("min_date",w?w.value:""),k.append("max_date",y?y.value:""),k.append("options",g?g.value:""),k.append("date_input",N||"datetime-local"),k.append("width",b?b.value:""),k.append("required",x?x.value:""),k.append("show_in_email",v?v.value:""),k.append("optimized",_?_.value:""),k.append("file_size",M?M.value:"5"),k.append("accepted_file_types",I?I.value:""),k.append("action","cartflows_pro_prepare_custom_field"),k.append("security",cartflows_admin.prepare_custom_field_nonce),k.append("post_id",t),k.append("save_field_name","wcf_field_order_"),L()({url:cartflows_admin.ajax_url,method:"POST",body:k}).then(e=>{if(e.success){const t=e.data,o=t.field_data;if("billing"===t.add_to){r.push(o);const e=n.wcf_field_order_billing;e[t.new_field.key]=t.new_field,s({type:"SET_OPTION",name:"wcf_field_order_billing",value:e}),s({type:"SET_FIELDS",field_type:"billing",fields:r})}if("shipping"===t.add_to){a.push(o);const e=n.wcf_field_order_shipping;e[t.new_field.key]=t.new_field,s({type:"SET_OPTION",name:"wcf_field_order_shipping",value:e}),s({type:"SET_FIELDS",field_type:"shipping",fields:a})}pp.success((0,z.__)("Custom field added!","cartflows"))}o()})},step_type:"checkout"}))))))),(0,o.createElement)(zX,{settings:e.checkout_settings}),(0,o.createElement)(zX,{settings:e.button_settings})))},Mq=function(){return(0,o.createElement)("div",{className:"wcf-custom-field-editor is-placeholder"},(0,o.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,o.createElement)("div",{className:"wcf-custom-field-editor__title"},(0,o.createElement)("div",{className:"title"})),(0,o.createElement)("form",null,(0,o.createElement)("table",null,(0,o.createElement)("tbody",null,(0,o.createElement)("tr",null,(0,o.createElement)("div",{className:"checkbox-title"})))),(0,o.createElement)("div",{className:"wcf-optin-fields-section-section"},(0,o.createElement)("div",{className:"wcf-custom-field-editor-title-section"},(0,o.createElement)("div",{className:"title"})),(0,o.createElement)("div",{className:"wcf-optin-fields"},(0,o.createElement)("div",{className:"title"}),(0,o.createElement)("div",{className:"title"}),(0,o.createElement)("div",{className:"title"}))),(0,o.createElement)("div",{className:"wcf-field wcf-submit"},(0,o.createElement)("div",{className:"wcf-optin-form-field__button"})))))},Iq=function(){const[{custom_fields:e,step_id:t,options:n,billing_fields:r},a]=ZR();if(void 0===e)return(0,o.createElement)(Mq,null);const i=e.extra_fields;return(0,o.createElement)("div",{className:"wcf-custom-field-editor"},(0,o.createElement)("div",{className:"wcf-custom-field-editor__content"},(0,o.createElement)("h3",{className:"wcf-custom-field-editor__title hidden relative justify-between items-center w-full py-4 px-8 text-base font-semibold text-text-primary text-left transition focus:outline-none"},(0,z.__)("Field Editor","cartflows")),(0,o.createElement)("div",{className:"wcf-optin-fields--enable_option px-8 py-4 -mx-6 pt-0"},i&&Object.keys(i.fields).map(e=>{const t=i.fields[e],r=n[t.name]?n[t.name]:"";return(0,o.createElement)("div",{key:e,className:"w-full"},(0,o.createElement)(mQ,{name:t.name,value:r,label:t.label,desc:t.desc,fullWidth:!0}))})),"yes"===n["wcf-optin-enable-custom-fields"]&&(0,o.createElement)("div",{className:"wcf-optin-fields-section-section"},(0,o.createElement)("div",{id:"wcf-optin-fields",className:"billing-field-sortable wcf-field-row"},(0,o.createElement)(sq,{data:r,step:"optin",type:"billing",removeCallback:function(e){e.preventDefault();const n=new FormData,o=e.target.getAttribute("data-key"),i=e.target.getAttribute("data-type");n.append("action","cartflows_pro_delete_custom_field"),n.append("security",cartflows_admin.delete_custom_field_nonce),n.append("post_id",t),n.append("key",o),n.append("type",i),n.append("step","optin"),L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(e=>{if(e.status){const e=r.filter(function(e){return e.key!==o});a({type:"SET_FIELDS",field_type:"billing",fields:e}),pp.success((0,z.__)("Custom field deleted!","cartflows"))}})}})),(0,o.createElement)("div",{className:"wcf-custom-field-editor-title-section"},wcfCartflowsPro()&&(0,o.createElement)("div",{className:"wcf-custom-field-editor-buttons"},(0,o.createElement)(_q,{addNewField:function(e,o,i){e.preventDefault();const s=document.getElementsByClassName("wcf-cpf-type")[0],l=document.getElementsByClassName("wcf-cpf-label")[0],c=document.getElementsByClassName("wcf-cpf-name")[0],u=document.getElementsByClassName("wcf-cpf-default")[0],d=document.getElementsByClassName("wcf-cpf-placeholder")[0],f=document.getElementsByClassName("wcf-cpf-min")[0],m=document.getElementsByClassName("wcf-cpf-max")[0],p=document.getElementsByClassName("wcf-cpf-options")[0],h=document.getElementsByClassName("wcf-cpf-min-date")[0],g=document.getElementsByClassName("wcf-cpf-max-date")[0],w=document.getElementsByClassName("wcf-cpf-width")[0],y=document.getElementsByClassName("wcf-cpf-show-in-email")[1],b=document.getElementsByClassName("wcf-cpf-required")[1],v=document.getElementsByClassName("wcf-cpf-date-input")[0],x=v?v.value:"";if(""===l.value){const e=document.createElement("span");return e.className="text-xs text-brand-500",e.textContent=(0,z.__)("Label is required field","cartflows"),document.querySelector(".wcf-cpf-label").insertAdjacentElement("afterend",e),l.focus(),i((0,z.__)("Add New Field","cartflows")),!1}const _=new FormData;_.append("add_to","billing"),_.append("type",s?s.value:""),_.append("label",l?l.value:""),_.append("name",c?c.value:""),_.append("default",u?u.value:""),_.append("placeholder",d?d.value:""),_.append("options",p?p.value:""),_.append("min",f?f.value:""),_.append("max",m?m.value:""),_.append("width",w?w.value:""),_.append("min_date",h?h.value:""),_.append("max_date",g?g.value:""),_.append("show_in_email",y?y.value:""),_.append("date_input",x||"datetime-local"),_.append("required",b?b.value:""),_.append("action","cartflows_pro_prepare_custom_field"),_.append("security",cartflows_admin.prepare_custom_field_nonce),_.append("post_id",t),_.append("save_field_name","wcf-optin-fields-"),L()({url:cartflows_admin.ajax_url,method:"POST",body:_}).then(e=>{if(e.success){const t=e.data,o=t.field_data;if("billing"===t.add_to){r.push(o);const e=n["wcf-optin-fields-billing"];e[t.new_field.key]=t.new_field,a({type:"SET_OPTION",name:"wcf-optin-fields-billing",value:e}),a({type:"SET_FIELDS",field_type:"billing",fields:r})}pp.success((0,z.__)("Custom field added!","cartflows"))}o()})},step_type:"optin"}))))))},Sq=function({title:e,children:t,defaultOpen:n=!0,badge:r,className:a=""}){return(0,o.createElement)("div",{className:`-mx-8 border-b border-border-subtle last:border-b-0 ${a}`.trim()},(0,o.createElement)(BW,{type:"simple",defaultValue:n?"section":[],autoClose:!1},(0,o.createElement)(BW.Item,{value:"section"},(0,o.createElement)(BW.Trigger,{iconType:"arrow",className:"px-8 py-4"},(0,o.createElement)("span",{className:"flex items-center gap-2 text-sm font-semibold text-text-primary"},e,r&&r)),(0,o.createElement)(BW.Content,{className:"px-8 pb-8 pt-0"},t))))},kq=function(e){const[{license_status:t}]=g(),n=e.btnText||(0,z.__)("Upgrade to CartFlows Pro","cartflows"),r=function(r){return(0,o.createElement)(Sq,{title:r.title,badge:(0,o.createElement)(Yf,{label:(0,z.__)("PRO","cartflows"),size:"xs",variant:"primary"}),defaultOpen:!1},(0,o.createElement)("div",{className:"p-5 border border-border-subtle rounded-lg bg-brand-25"},(0,o.createElement)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between"},(0,o.createElement)("div",null,(0,o.createElement)("p",{className:"text-sm font-medium text-text-primary mb-1"},r.noticeTitle),(0,o.createElement)("p",{className:"text-sm font-normal text-text-secondary"},r.noticeDesc)),(0,o.createElement)("div",{className:"flex items-center gap-4 shrink-0"},function(){const r=cartflows_admin.cf_pro_status;return wcfCartflowsTypePro()||"inactive"!==r||"pro"!==wcfInactivepluginType()?wcfCartflowsTypePlusPro()?"Activated"!==t?(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)(_p,{title:(0,z.__)("Activate the License","cartflows")}))):void 0:wcfInactiveProPlus()?(0,o.createElement)(yp,null):(0,o.createElement)(bp,{buttonLink:e.buttonLink,title:n,buttonStyle:"secondary"}):(0,o.createElement)(yp,null)}()))))};return(0,o.createElement)(o.Fragment,null,r({title:(0,z.__)("Auto Apply Coupon","cartflows"),noticeTitle:(0,z.__)("Apply Discounts Automatically and Convert More Customers","cartflows"),noticeDesc:(0,z.__)("Remove friction at checkout — discounts activate the moment customers arrive. Upgrade to Pro and watch conversions climb immediately.","cartflows")}),r({title:(0,z.__)("Product Options","cartflows"),noticeTitle:(0,z.__)("Let Customers Choose Exactly What They Want","cartflows"),noticeDesc:(0,z.__)("Offer flexible product options right at checkout — quantities, variations, and more. Upgrade to CartFlows Pro and start customizing your offers today.","cartflows")}))},jq=function(){const[{step_data:e,settings_data:t,page_settings:n,options:r}]=ZR(),[{license_status:a}]=g(),i=n;if(void 0===t.settings)return(0,o.createElement)(QX,null);const s=r["wcf-checkout-products"];return(0,o.createElement)("div",{className:"wcf-checkout-products"},(0,o.createElement)(Sq,{title:i.settings.product.title,defaultOpen:!0},(0,o.createElement)(LX,{settings:i.settings.product})),"checkout"===e.type&&(!wcfCartflowsPro()||"Activated"!==a)&&(0,o.createElement)(kq,null),"checkout"===e.type&&wcfCartflowsPro()&&"Activated"===a&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Sq,{title:i.settings.coupon.title},(0,o.createElement)(LX,{settings:i.settings.coupon})),s&&(0,o.createElement)(Sq,{title:i.settings["product-options"].title},(0,o.createElement)(LX,{settings:i.settings["product-options"]}))))},Dq=function(){const[{settings_data:e,page_settings:t,options:n},r]=ZR(),a=n["wcf-optin-product"]?n["wcf-optin-product"]:[],[s,l]=(0,i.useState)(),[c,u]=(0,i.useState)(""),[d,f]=(0,i.useState)(!1),m=(0,z.__)("Add","cartflows"),[p,h]=(0,i.useState)({isInProcessing:!1,buttonText:m}),{isInProcessing:g,buttonText:w}=p;return void 0===e.settings?(0,o.createElement)(QX,null):(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-optin-product--wrapper"},(0,o.createElement)("h2",{className:"text-base font-semibold text-text-primary py-4"},(0,z.__)("Optin Product","cartflows")),(0,o.createElement)("div",{className:"wcf-optin-products--selection wcf-products__section"},0===a.length||""===a[0]?(0,o.createElement)(o.Fragment,null,(0,o.createElement)("input",{name:"wcf-optin-product[]",type:"hidden",value:""}),(0,o.createElement)("div",{className:"wcf-optin-no-product--notice border border-border-subtle bg-gray-25 text-center text-sm font-normal rounded-md p-5"},(0,z.__)("Select free & virtual product only. Once you select a product, it will be displayed here.","cartflows")),(0,o.createElement)("div",{className:"wcf-optin-product-selection-field__add-new flex justify-between items-end gap-5 mt-5"},(0,o.createElement)(nQ,{name:"",desc:"",field:"product",value:c,allowed_products:"simple",include_products:"braintree-subscription, braintree-variable-subscription",excluded_products:"grouped",placeholder:(0,z.__)("Search for a Free & Virtual Product","cartflows"),onChangeCB:e=>{l(e),f(!1)},sectionClass:"flex-1 "+(d?"border border-border-error":"")}),(0,o.createElement)(Va,{type:"button",variant:"outline",size:"md",icon:(0,o.createElement)(KO,{className:"w-4 h-4"}),iconPosition:"left",loading:g,disabled:g,onClick:function(){const e=s?.value;u(s),e&&(h({isInProcessing:!0,buttonText:(0,z.__)("Adding…","cartflows")}),L()({path:`/cartflows/v1/admin/product-data/${e}`}).then(t=>{t.regular_price>0||!t.is_virtual?f(!0):(f(!1),r({type:"ADD_OPTIN_PRODUCT",field_name:"wcf-optin-product",product_data:{value:e,label:s?.label,img_url:t?.img_url}})),u(null),h({isInProcessing:!1,buttonText:m})}),l(null))},className:"wcf-select-product-button shrink-0 h-fit"},w)),d&&(0,o.createElement)("span",{className:"text-sm mt-2 text-text-error wcf-field-required-error inline-block"},(0,z.__)("Please select a free & virtual product only.","cartflows")),(0,o.createElement)(lU,null)):(0,o.createElement)("div",{className:"overflow-visible shadow border border-border-subtle rounded-md"},(0,o.createElement)("div",{className:"wcf-optin-product-selection--selected-product flex items-center p-3 gap-4"},(0,o.createElement)("div",{className:"wcf-optin-product-selection--product-title whitespace-nowrap text-sm font-medium text-text-primary w-1/2"},(0,o.createElement)("div",{className:"flex gap-3 items-center"},(0,o.createElement)("div",{className:"wcf-optin-product-selection--product-image flex w-20 h-20"},(0,o.createElement)("img",{src:a.img_url?a.img_url:cartflows_admin.image_placeholder,className:"product-image rounded-md w-full h-full aspect-{3/2} object-contain",alt:fh(a.label)})),(0,o.createElement)("div",{className:"wcf-optin-product-selection--product-title_text"},(0,o.createElement)("div",{className:"wcf-offer-product-repeater-field__title whitespace-normal text-left","data-product_id":a.value},fh(a.label)),(0,o.createElement)("div",{className:"wcf-optin-product-repeater-field__reg-price mt-1"},(0,o.createElement)("div",{className:"flex gap-2"},(0,o.createElement)("span",{className:"wcf-offer-product--reg-price"},(0,z.__)("Free","cartflows"))))))),(0,o.createElement)("div",{className:"wcf-optin-product-selection-actions flex gap-2 relative whitespace-nowrap text-right text-sm font-medium w-[5%] justify-center ml-auto"},(0,o.createElement)("div",{className:"wcf-delete-product-item cursor-pointer text-text-secondary hover:text-brand-500 p-1 hover:bg-background-secondary focus:bg-background-secondary rounded relative justify-end",onClick:function(){r({type:"REMOVE_OPTIN_PRODUCT",field_name:"wcf-optin-product"})}},(0,o.createElement)(aU,{className:"h-18 w-18"}))),(0,o.createElement)("input",{name:"wcf-optin-product[]",type:"hidden",className:"wcf-checkout-product-id",value:a.value})))),(0,o.createElement)("div",{className:"wcf-offer-product--common-settings pt-2"},(0,o.createElement)(YX,{settings:t?.settings.product,displayAs:"div"}))))};function Cq(e,t){var n;if(!t)return"";const r=Object.values(t).find(t=>t.id===e);return null!==(n=r?.title)&&void 0!==n?n:""}function Aq(e,t,n,r){if(!t?.type)return null;switch(e){case"design":default:return(0,o.createElement)(PX,null);case"settings":return(0,o.createElement)(FX,null);case"products":return"checkout"===t.type?"storeCheckout"!==n||cartflows_admin.store_checkout_show_product_tab?(0,o.createElement)(jq,null):(r("order_bumps"),(0,o.createElement)(MX,null)):["upsell","downsell"].includes(t.type)?(0,o.createElement)(VX,null):"optin"===t.type?(0,o.createElement)(Dq,null):"landing"===t.type||"thankyou"===t.type?(r("settings"),(0,o.createElement)(FX,null)):(0,o.createElement)(FX,null);case"checkout_form_fields":return(0,o.createElement)(Nq,null);case"order_bumps":return(0,o.createElement)(MX,null);case"checkout_offer":return(0,o.createElement)(JX,null);case"optin_form_fields":return(0,o.createElement)(Iq,null);case"dynamic-offers":return(0,o.createElement)(rq,null)}}const Tq=function({accordionGroups:e,currentTab:t,currentSection:n,onTabChange:r,onSectionChange:a}){const[s,l]=(0,i.useState)(()=>new Set((null!=e?e:[]).filter(e=>e.sections.length>0).map(e=>e.id)));(0,i.useEffect)(()=>{const t=(null!=e?e:[]).filter(e=>e.sections.length>0).map(e=>e.id);l(e=>{let n=!1;const r=new Set(e);return t.forEach(e=>{r.has(e)||(r.add(e),n=!0)}),n?r:e})},[e]);const c=(null!=e?e:[]).find(e=>e.id===t),u=n&&c?.sections.length>0?`${t}|${n}`:t,d={};return(null!=e?e:[]).forEach(e=>{0===e.sections.length?d[e.id]=e.name:e.sections.forEach(e=>{d[`${e.tabId}|${e.id}`]=e.name})}),(0,o.createElement)("div",{className:"wcf-step-setting--sidebar-wrapper w-full lg:w-auto"},(0,o.createElement)("div",{className:"lg:hidden px-6 py-4",onClickCapture:e=>e.preventDefault()},(0,o.createElement)(VO,{value:u,onChange:e=>{if(e.includes("|")){const[t,n]=e.split("|");a(t,n)}else r(e)},size:"md"},(0,o.createElement)(VO.Button,{placeholder:(0,z.__)("Select a Settings Tab","cartflows"),render:e=>{var t;return null!==(t=d[e])&&void 0!==t?t:e}}),(0,o.createElement)(VO.Portal,null,(0,o.createElement)(VO.Options,null,(null!=e?e:[]).map(e=>e.sections.length>0?(0,o.createElement)(VO.OptionGroup,{key:e.id,label:e.name},e.sections.map(e=>(0,o.createElement)(VO.Option,{key:e.id,value:`${e.tabId}|${e.id}`},e.name))):(0,o.createElement)(VO.Option,{key:e.id,value:e.id},e.name)))))),(0,o.createElement)("div",{className:"wcf-step-setting--sidebar hidden lg:flex h-full min-h-screen flex-col w-auto sticky top-0 sidebar after:content-[''] after:fixed after:left-0 after:top-0 after:w-[420px] after:h-screen after:bg-background-primary after:-z-10"},(0,o.createElement)(TW,{borderOn:!0,className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow"},(0,o.createElement)(TW.Body,{className:"!p-0 pt-2"},(0,o.createElement)(TW.Item,null,(0,o.createElement)(ym,{className:"w-full p-0 bg-transparent",size:"md"},(0,o.createElement)("ul",{className:"m-0 p-0 list-none flex flex-col gap-0.5"},(null!=e?e:[]).map(e=>{const c=s.has(e.id),u=t===e.id,d=e.sections.length>0,f=e.icon,m=d&&u;return(0,o.createElement)(i.Fragment,{key:e.id},(0,o.createElement)(ym.Item,{active:!d&&u,onClick:()=>(e=>{if(0===e.sections.length)r(e.id);else if(s.has(e.id))l(t=>{const n=new Set(t);return n.delete(e.id),n});else{l(t=>new Set([...t,e.id]));const t=e.sections[0];a(t.tabId,t.id)}})(e),className:d?"hover:!bg-transparent":"hover:!bg-brand-25 hover:[&>svg]:!text-brand-600 "+(u?"!bg-brand-25 !text-text-primary [&>svg]:!text-brand-600":"")},(0,o.createElement)(f,{className:m?"!text-icon-interactive":""}),(0,o.createElement)("div",{className:"flex-1"},e.name),d&&(0,o.createElement)(Um,{className:"!size-4 shrink-0 text-icon-secondary transition-transform duration-200 "+(c?"rotate-180":"")})),d&&c&&(0,o.createElement)("div",{className:"border-l border-solid border-r-0 border-t-0 border-b-0 border-border-subtle pl-4 ml-5"},e.sections.map(e=>{const r=t===e.tabId&&n===e.id;return(0,o.createElement)(ym.Item,{key:e.id,active:r,onClick:()=>a(e.tabId,e.id),className:"p-1 hover:!bg-brand-25 "+(r?"!bg-brand-25 !text-text-primary":"")},(0,o.createElement)("div",null,e.name))})))}))))))))},Oq=function({section:e}){const[{options:t,page_builder:n,step_data:r}]=ZR();if(!e)return null;if("shortcode"===e.slug&&"other"!==n)return null;const a={...e,step_type:r?.type||""};return!1===Ah.isActiveControl(a,t)?null:(0,o.createElement)("div",{className:"wcf-section-content"},(0,o.createElement)(LX,{settings:a,displayAs:"div"}))};function Lq({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Z"}))}const zq=i.forwardRef(Lq);function Pq({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 18.75a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m3 0h6m-9 0H3.375a1.125 1.125 0 0 1-1.125-1.125V14.25m17.25 4.5a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m3 0h1.125c.621 0 1.129-.504 1.09-1.124a17.902 17.902 0 0 0-3.213-9.193 2.056 2.056 0 0 0-1.58-.86H14.25M16.5 18.75h-2.25m0-11.177v-.958c0-.568-.422-1.048-.987-1.106a48.554 48.554 0 0 0-10.026 0 1.106 1.106 0 0 0-.987 1.106v7.635m12-6.677v6.677m0 4.5v-4.5m0 0h-12"}))}const Rq=i.forwardRef(Pq),Uq=function(){const[{options:e},t]=ZR(),n="yes"===e["wcf-show-coupon-field"],r="yes"===e["wcf-optimize-coupon-field"],a="yes"===e["wcf-checkout-additional-fields"],i="yes"===e["wcf-optimize-order-note-field"],s="yes"===e["wcf-shipto-diff-addr-fields"],l="yes"===e["wcf-google-autoaddress"],c="yes"===e["wcf-custom-no-shipping-method-message-toggle"],u=e["wcf-no-shipping-method-message"]||"",d=e["wcf-order-review-summary-position"]||"top",f=(e,n)=>{t({type:"SET_OPTION",name:e,value:n})},m=[{value:"top",label:(0,z.__)("Top","cartflows")},{value:"bottom",label:(0,z.__)("Bottom","cartflows")}];return(0,o.createElement)("div",{className:"flex flex-col gap-4"},(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"flex items-center justify-between py-1"},(0,o.createElement)(Qf,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Enable Coupon Field","cartflows")),(0,o.createElement)(bO,{value:n,onChange:e=>f("wcf-show-coupon-field",e?"yes":"no")})),n&&(0,o.createElement)("div",{className:"flex items-center justify-between py-1"},(0,o.createElement)(Qf,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Collapsible Coupon Field","cartflows")),(0,o.createElement)(bO,{value:r,onChange:e=>f("wcf-optimize-coupon-field",e?"yes":"no")}))),(0,o.createElement)("input",{type:"hidden",name:"wcf-show-coupon-field",value:n?"yes":"no"}),(0,o.createElement)("input",{type:"hidden",name:"wcf-optimize-coupon-field",value:r?"yes":"no"}),(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"flex items-center justify-between py-1"},(0,o.createElement)(Qf,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Enable Additional Field","cartflows")),(0,o.createElement)(bO,{value:a,onChange:e=>f("wcf-checkout-additional-fields",e?"yes":"no")})),a&&(0,o.createElement)("div",{className:"flex items-center justify-between py-1"},(0,o.createElement)(Qf,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Collapsible Additional Field","cartflows")),(0,o.createElement)(bO,{value:i,onChange:e=>f("wcf-optimize-order-note-field",e?"yes":"no")}))),(0,o.createElement)("input",{type:"hidden",name:"wcf-checkout-additional-fields",value:a?"yes":"no"}),(0,o.createElement)("input",{type:"hidden",name:"wcf-optimize-order-note-field",value:i?"yes":"no"}),(0,o.createElement)("div",{className:"flex items-center justify-between py-1"},(0,o.createElement)(Qf,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Enable Ship To Different Address","cartflows")),(0,o.createElement)(bO,{value:s,onChange:e=>f("wcf-shipto-diff-addr-fields",e?"yes":"no")})),(0,o.createElement)("input",{type:"hidden",name:"wcf-shipto-diff-addr-fields",value:s?"yes":"no"}),(0,o.createElement)("div",{className:"flex flex-col py-1"},(0,o.createElement)("div",{className:"flex items-center justify-between"},(0,o.createElement)(Qf,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Enable Google Address Autocomplete","cartflows")),(0,o.createElement)(bO,{value:l,onChange:e=>f("wcf-google-autoaddress",e?"yes":"no")})),(0,o.createElement)("div",{className:"flex items-start gap-1 text-sm font-normal text-text-tertiary mt-2"},(0,o.createElement)(iU,{className:"w-4 h-4 shrink-0 mt-px text-icon-secondary"}),(0,o.createElement)("span",null,(0,z.__)("Before enabling this option, make sure that you have added API key in Google Address Autocomplete Settings.","cartflows")))),(0,o.createElement)("input",{type:"hidden",name:"wcf-google-autoaddress",value:l?"yes":"no"}),(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"flex items-center justify-between py-1"},(0,o.createElement)("div",{className:"flex items-center gap-1"},(0,o.createElement)(Qf,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Enable Custom Shipping Message","cartflows")),(0,o.createElement)(Ja,{content:(0,z.__)("Turn this on to show a custom message when no shipping options are available at checkout.","cartflows"),placement:"top"},(0,o.createElement)("span",null,(0,o.createElement)(iU,{className:"w-4 h-4 text-icon-secondary cursor-help"})))),(0,o.createElement)(bO,{value:c,onChange:e=>f("wcf-custom-no-shipping-method-message-toggle",e?"yes":"no")})),(0,o.createElement)("input",{type:"hidden",name:"wcf-custom-no-shipping-method-message-toggle",value:c?"yes":"no"}),c&&(0,o.createElement)("div",{className:"flex flex-col gap-1.5"},(0,o.createElement)(Qf,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Shipping Message","cartflows")),(0,o.createElement)(GO,{value:u,rows:2,size:"md",className:"w-full",placeholder:(0,z.__)("There are no shipping options available. Please ensure that your address has been entered correctly, or contact us if you need any help.","cartflows"),onChange:e=>f("wcf-no-shipping-method-message",e)}))),(0,o.createElement)("input",{type:"hidden",name:"wcf-no-shipping-method-message",value:u}),(0,o.createElement)("div",{className:"flex items-center gap-3"},(0,o.createElement)("div",{className:"flex items-center gap-1"},(0,o.createElement)(Qf,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Order Summary Position","cartflows")),(0,o.createElement)(Ja,{content:(0,z.__)("Choose this option to adjust where the order summary appears on mobile devices.","cartflows"),placement:"top"},(0,o.createElement)("span",null,(0,o.createElement)(iU,{className:"w-4 h-4 text-icon-secondary cursor-help"})))),(0,o.createElement)("div",{className:"w-32"},(0,o.createElement)(VO,{value:d,onChange:e=>f("wcf-order-review-summary-position",e),size:"md"},(0,o.createElement)(VO.Button,{type:"button",render:e=>{const t=m.find(t=>t.value===e);return t?t.label:e}}),(0,o.createElement)(VO.Portal,null,(0,o.createElement)(VO.Options,null,m.map(e=>(0,o.createElement)(VO.Option,{value:e.value,key:e.value},e.label))))))),(0,o.createElement)("input",{type:"hidden",name:"wcf-order-review-summary-position",value:d}))},Bq=function({sectionId:e}){const[{custom_fields:t,step_id:n,options:r,billing_fields:a,shipping_fields:s},l]=ZR(),[c,u]=(0,i.useState)("billing"),d=$V();if(void 0===t)return(0,o.createElement)(Eq,null);if("form-settings"===e)return(0,o.createElement)(Uq,null);if("form-headings"===e&&t.checkout_settings)return(0,o.createElement)(Oq,{section:{...t.checkout_settings,slug:"checkout_settings"}});if("place-order-button"===e&&t.button_settings)return(0,o.createElement)(Oq,{section:{...t.button_settings,slug:"button_settings"}});if("field-editor"===e){const e=async function(e,t){if(e.preventDefault(),!await d({title:(0,z.__)("Delete Field","cartflows"),description:(0,z.__)("Are you really want to delete field?","cartflows"),actionBtnText:(0,z.__)("Delete","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")}))return;const r=new FormData,o=e.target.getAttribute("data-key"),i=e.target.getAttribute("data-type");t(o),r.append("action","cartflows_pro_delete_custom_field"),r.append("security",cartflows_admin.delete_custom_field_nonce),r.append("post_id",n),r.append("key",o),r.append("type",i),r.append("step","checkout"),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(e=>{e.status&&(l({type:"SET_FIELDS",field_type:"billing",fields:a.filter(e=>e.key!==o)}),l({type:"SET_FIELDS",field_type:"shipping",fields:s.filter(e=>e.key!==o)}),t(""))})},t=function(e,t,o){e.preventDefault();const i=document.getElementsByClassName("wcf-cpf-add_to")[0],c=document.getElementsByClassName("wcf-cpf-type")[0],u=document.getElementsByClassName("wcf-cpf-label")[0],d=document.getElementsByClassName("wcf-cpf-name")[0],f=document.getElementsByClassName("wcf-cpf-min")[0],m=document.getElementsByClassName("wcf-cpf-max")[0],p=document.getElementsByClassName("wcf-cpf-default")[0],h=document.getElementsByClassName("wcf-cpf-placeholder")[0],g=document.getElementsByClassName("wcf-cpf-options")[0],w=document.getElementsByClassName("wcf-cpf-min-date")[0],y=document.getElementsByClassName("wcf-cpf-max-date")[0],b=document.getElementsByClassName("wcf-cpf-width")[0],v=document.getElementsByClassName("wcf-cpf-show-in-email")[0],x=document.getElementsByClassName("wcf-cpf-required")[0],_=document.getElementsByClassName("wcf-cpf-optimized")[0],E=document.getElementsByClassName("wcf-cpf-date-input")[0],N=E?E.value:"",M=document.getElementsByClassName("wcf-cpf-file-size")[0],I=document.getElementsByClassName("wcf-cpf-accepted-file-types")[0];if(""===u.value){const e=document.createElement("span");return e.className="text-xs text-brand-500",e.textContent=(0,z.__)("Label is required field","cartflows"),document.querySelector(".wcf-cpf-label").insertAdjacentElement("afterend",e),u.focus(),o((0,z.__)("Add New Field","cartflows")),""}const S=["jpg","jpeg","png","gif","webp","ico","pdf","mp3","m4a","ogg","wav","mp4","m4v","mov","wmv","avi","mpg","ogv","3gp","3g2"];if(I&&I.value.trim()){const e=I.value.split(",").map(e=>e.trim().toLowerCase()).filter(e=>e).filter(e=>!S.includes(e));if(e.length){const t=document.querySelector(".wcf-cpf-accepted-file-types + .wcf-cpf-error");t&&t.remove();const n=document.createElement("span");return n.className="wcf-cpf-error text-xs text-brand-500",n.textContent=(0,z.sprintf)(/* translators: %s: invalid extensions */ /* translators: %s: invalid extensions */ |
| 72 |
(0,z.__)("Invalid file type(s): %s","cartflows"),e.join(", ")),I.insertAdjacentElement("afterend",n),I.focus(),o((0,z.__)("Add New Field","cartflows")),""}}const k=new FormData;k.append("add_to",i?i.value:""),k.append("type",c?c.value:""),k.append("label",u?u.value:""),k.append("name",d?d.value:""),k.append("default",p?p.value:""),k.append("min",f?f.value:""),k.append("max",m?m.value:""),k.append("placeholder",h?h.value:""),k.append("min_date",w?w.value:""),k.append("max_date",y?y.value:""),k.append("options",g?g.value:""),k.append("date_input",N||"datetime-local"),k.append("width",b?b.value:""),k.append("required",x?x.value:""),k.append("show_in_email",v?v.value:""),k.append("optimized",_?_.value:""),k.append("file_size",M?M.value:"5"),k.append("accepted_file_types",I?I.value:""),k.append("action","cartflows_pro_prepare_custom_field"),k.append("security",cartflows_admin.prepare_custom_field_nonce),k.append("post_id",n),k.append("save_field_name","wcf_field_order_"),L()({url:cartflows_admin.ajax_url,method:"POST",body:k}).then(e=>{if(e.success){const t=e.data,n=t.field_data;if("billing"===t.add_to){a.push(n);const e=r.wcf_field_order_billing;e[t.new_field.key]=t.new_field,l({type:"SET_OPTION",name:"wcf_field_order_billing",value:e}),l({type:"SET_FIELDS",field_type:"billing",fields:a})}if("shipping"===t.add_to){s.push(n);const e=r.wcf_field_order_shipping;e[t.new_field.key]=t.new_field,l({type:"SET_OPTION",name:"wcf_field_order_shipping",value:e}),l({type:"SET_FIELDS",field_type:"shipping",fields:s})}}t()})};return(0,o.createElement)("div",{className:"wcf-field-editor-section"},(0,o.createElement)("div",{className:"flex items-center justify-between py-1"},(0,o.createElement)(Qf,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Enable Custom Field Editor","cartflows")),(0,o.createElement)(bO,{value:"yes"===r["wcf-custom-checkout-fields"],onChange:e=>l({type:"SET_OPTION",name:"wcf-custom-checkout-fields",value:e?"yes":"no"})})),(0,o.createElement)("input",{type:"hidden",name:"wcf-custom-checkout-fields",value:r["wcf-custom-checkout-fields"]}),"yes"===r["wcf-custom-checkout-fields"]&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-checkout-fields-tabs mt-4 mb-0"},(0,o.createElement)(AQ.Group,{variant:"rounded",size:"sm",width:"full",activeItem:c,onChange:({value:e})=>u(e.slug)},(0,o.createElement)(AQ.Tab,{slug:"billing",text:(0,z.__)("Billing Fields","cartflows"),icon:(0,o.createElement)(zq,{className:"w-4 h-4"}),type:"button"}),(0,o.createElement)(AQ.Tab,{slug:"shipping",text:(0,z.__)("Shipping Fields","cartflows"),icon:(0,o.createElement)(Rq,{className:"w-4 h-4"}),type:"button"}))),"billing"===c&&a&&(0,o.createElement)("div",{id:"wcf-billing-fields",className:"wcf-billing-fields billing-field-sortable wcf-field-row w-full"},(0,o.createElement)(sq,{data:a,step:"checkout",type:"billing",removeCallback:e})),"shipping"===c&&s&&(0,o.createElement)("div",{id:"wcf-shipping-fields",className:"wcf-shipping-fields shipping-field-sortable wcf-field-row w-full"},(0,o.createElement)(sq,{data:s,step:"checkout",type:"shipping",removeCallback:e})),(0,o.createElement)("div",{className:"text-end"},wcfCartflowsPro()&&(0,o.createElement)(_q,{addNewField:t,step_type:"checkout"}))))}return null},Fq=function(){const[{options:e,page_settings:t},n]=ZR();if(NX())return(0,o.createElement)(nZ,{title:(0,z.__)("Let Customers Choose Exactly What They Want","cartflows"),description:(0,z.__)("Offer flexible product options right at checkout — quantities, variations, and more. Upgrade to CartFlows Pro and start customizing your offers today.","cartflows")});const r="yes"===e["wcf-enable-product-options"],a=e["wcf-product-options"]||"force-all",i="yes"===e["wcf-enable-product-variation"],s=e["wcf-product-variation-options"]||"inline",l="yes"===e["wcf-enable-product-quantity"],c=t?.settings?.["product-options"]?.desc||null,u=(e,t)=>{n({type:"SET_OPTION",name:e,value:t})};return(0,o.createElement)("div",{className:"flex flex-col"},(0,o.createElement)("div",{className:"flex items-center justify-between py-4"},(0,o.createElement)(Qf,{htmlFor:"wcf-enable-product-options-switch",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Enable Product Options","cartflows")),(0,o.createElement)(bO,{id:"wcf-enable-product-options-switch",value:r,onChange:e=>u("wcf-enable-product-options",e?"yes":"no")})),(0,o.createElement)("input",{type:"hidden",name:"wcf-enable-product-options",value:r?"yes":"no"}),r&&(0,o.createElement)("div",{className:"flex flex-col gap-2 pb-4 border-b border-border-subtle border-solid border-0"},(0,o.createElement)(Qf,{tag:"p",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Enable Conditions","cartflows")),(0,o.createElement)(MO.Group,{gapClassName:"gap-1.5",value:a,onChange:e=>u("wcf-product-options",e),style:"simple",size:"sm",vertical:!0,className:"w-full"},(0,o.createElement)(MO.Button,{value:"force-all",reversePosition:!0,minWidth:!1,buttonWrapperClasses:"w-full !pr-2.5 !py-0",label:{heading:(0,z.__)("Restrict user to purchase all products","cartflows")}}),(0,o.createElement)(MO.Button,{value:"single-selection",reversePosition:!0,minWidth:!1,buttonWrapperClasses:"w-full !pr-2.5 !py-0",label:{heading:(0,z.__)("Let user select one product from all options","cartflows")}}),(0,o.createElement)(MO.Button,{value:"multiple-selection",reversePosition:!0,minWidth:!1,buttonWrapperClasses:"w-full !pr-2.5 !py-0",label:{heading:(0,z.__)("Let user select multiple products from all options","cartflows")}}))),(0,o.createElement)("input",{type:"hidden",name:"wcf-product-options",value:a}),(0,o.createElement)("div",{className:"flex items-center justify-between py-4"},(0,o.createElement)(Qf,{htmlFor:"wcf-enable-product-variation-switch",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Enable Variations","cartflows")),(0,o.createElement)(bO,{id:"wcf-enable-product-variation-switch",value:i,onChange:e=>u("wcf-enable-product-variation",e?"yes":"no")})),(0,o.createElement)("input",{type:"hidden",name:"wcf-enable-product-variation",value:i?"yes":"no"}),i&&(0,o.createElement)("div",{className:"flex flex-col gap-2 pb-4 border-b border-border-subtle border-solid border-0"},(0,o.createElement)(MO.Group,{gapClassName:"gap-1.5",value:s,onChange:e=>u("wcf-product-variation-options",e),style:"simple",size:"sm",vertical:!0,className:"w-full"},(0,o.createElement)(MO.Button,{value:"inline",reversePosition:!0,minWidth:!1,buttonWrapperClasses:"w-full !pr-2.5 !py-0",label:{heading:(0,z.__)("Show variations inline","cartflows")}}),(0,o.createElement)(MO.Button,{value:"popup",reversePosition:!0,minWidth:!1,buttonWrapperClasses:"w-full !pr-2.5 !py-0",label:{heading:(0,z.__)("Show variations in popup","cartflows")}}))),(0,o.createElement)("input",{type:"hidden",name:"wcf-product-variation-options",value:s}),(0,o.createElement)("div",{className:"flex items-center justify-between py-4 !pb-0"},(0,o.createElement)(Qf,{htmlFor:"wcf-enable-product-quantity-switch",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Enable Quantity","cartflows")),(0,o.createElement)(bO,{id:"wcf-enable-product-quantity-switch",value:l,onChange:e=>u("wcf-enable-product-quantity",e?"yes":"no")})),(0,o.createElement)("input",{type:"hidden",name:"wcf-enable-product-quantity",value:l?"yes":"no"}),c&&(0,o.createElement)("div",{className:"flex items-start gap-1 text-sm font-normal text-text-tertiary mt-2"},(0,o.createElement)(iU,{className:"w-4 h-4 shrink-0 mt-px text-icon-secondary"}),(0,o.createElement)("span",null,fh(c))))},Yq={landing:r$,checkout:a$,upsell:o$,downsell:i$,optin:s$,thankyou:l$},Qq=function(){var e;const[{step_id:t,flow_id:n,step_data:r}]=ZR(),a=(0,b.useHistory)(),i=$V(),s=r?.type||"",l=null!==(e=Yq[s])&&void 0!==e?e:null;return(0,o.createElement)("div",{className:"flex flex-col gap-4"},(0,o.createElement)(Qf,{tag:"span",size:"sm",className:"font-normal text-text-secondary"},(0,z.__)("Replace this step with a different template. Your current design and content for this step will be permanently removed.","cartflows")),(0,o.createElement)("div",{className:"flex items-center gap-4"},l&&(0,o.createElement)("img",{src:l,alt:s,className:"rounded-lg w-[72px] h-[72px]"}),(0,o.createElement)("div",{className:"flex flex-col gap-1"},(0,o.createElement)(Qf,{tag:"span",size:"sm",className:"font-medium text-text-primary"},(0,z.__)("Step Type","cartflows")),(0,o.createElement)(Qf,{tag:"span",size:"sm",className:"font-normal text-text-secondary capitalize"},s))),(0,o.createElement)("div",null,(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:async()=>{await i({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.__)("Update","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})&&a.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}&step_id=${t}&tab=update-template`)}},(0,z.__)("Update Template","cartflows"))))};function Vq({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 Wq=i.forwardRef(Vq),Zq=function({onEditingChange:e}){const[{step_id:t,flow_id:n},r]=ZR();let[{step_title:a}]=ZR();(0,i.useEffect)(()=>{let e=!0;return e&&L()({path:`/cartflows/v1/admin/flow-data/${n}`}).then(t=>{e&&r({type:"SET_FLOW_DATA",data:t})}),()=>{e=!1}},[a]);const[s,l]=(0,i.useState)(!1),[c,u]=(0,i.useState)(!1),[d,f]=(0,i.useState)("");if(!1===a)return null;if(s)return(0,o.createElement)("div",{className:"flex items-center gap-2 flex-1 min-w-0"},(0,o.createElement)(dp,{id:"new-step-title",value:d,onChange:f,size:"md",className:"!py-2",autoComplete:"off"}),(0,o.createElement)(Va,{variant:"primary",size:"sm",type:"button",loading:c,disabled:c,onClick:n=>{n.preventDefault(),u(!0);const a=new window.FormData;a.append("action","cartflows_update_step_title"),a.append("security",cartflows_admin.update_step_title_nonce),a.append("step_id",t),a.append("new_step_title",d),L()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then(()=>{r({type:"SET_STEP_TITLE",title:d}),u(!1),l(!1),e?.(!1),pp.success((0,z.__)("Step title updated successfully!","cartflows"))})}},(0,z.__)("Save","cartflows")),(0,o.createElement)(Va,{variant:"outline",size:"sm",type:"button",disabled:c,onClick:t=>{t.preventDefault(),l(!1),e?.(!1)}},(0,z.__)("Cancel","cartflows")));""===a&&(a=(0,z.__)("(no title)","cartflows"));const m=Ch(a,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length);return(0,o.createElement)("div",{className:"wcf-edit-step__title-wrap flex items-center gap-1.5"},(0,o.createElement)("span",{className:"wcf-steps-header__title--text text-xl font-semibold text-text-primary truncate max-w-xs",title:a},m),(0,o.createElement)(Va,{variant:"ghost",size:"xs",type:"button",icon:(0,o.createElement)(Wq,null),onClick:t=>{t.preventDefault(),f(a||""),l(!0),e?.(!0)},"aria-label":(0,z.__)("Edit Step Name","cartflows")}))},Gq=function({currentTab:e,currentSection:t,sectionObject:n,stepData:r,flowType:a,buttonRef:s,wooStatus:l,setActiveTab:c,backUrl:u}){const[{options:d,is_flow_instant_checkout:f,step_data:m,flow_title:p,step_title:h}]=ZR(),[{license_status:w}]=g(),[y,b]=(0,i.useState)(!1),[v,x]=(0,i.useState)((0,z.__)("Activate WooCommerce","cartflows")),_=l||!l&&"landing"===r?.type,E=NX(),N=NX("plus-pro"),M="coupon"===t&&E,I="product-options"===t&&E,S="dynamic-offers"===e&&E,k="order_bumps"===e&&N,j=["upsell","downsell"].includes(m?.type)&&wcfCartflowsPro()&&"Activated"!==w,D=M||I||S||k||j,A=D||!l&&["checkout","upsell","downsell","thankyou"].includes(r?.type),T="storeCheckout"===a?"store-checkout":"flows",O="storeCheckout"===a?(0,z.__)("Store Checkout","cartflows"):(0,z.__)("Funnels","cartflows"),P=h&&!1!==h?(0,z.sprintf)(/* translators: %s: step name */ /* translators: %s: step name */ |
| 73 |
(0,z.__)("%s Settings","cartflows"),h):(0,z.__)("Step Settings","cartflows"),R=(e=!0)=>(0,o.createElement)(o.Fragment,null,(0,o.createElement)("nav",{"aria-label":(0,z.__)("Breadcrumb","cartflows"),className:"flex items-center gap-1 py-1 text-xs text-text-tertiary flex-wrap"},(0,o.createElement)("a",{href:`admin.php?page=cartflows&path=${T}`,className:"text-text-secondary hover:text-text-primary no-underline transition-colors"},O),p&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("span",{"aria-hidden":"true",className:"mx-0.5"},">"),(0,o.createElement)("a",{href:`admin.php${u}`,className:"text-text-secondary hover:text-text-primary no-underline transition-colors"},p)),(0,o.createElement)("span",{"aria-hidden":"true",className:"mx-0.5"},">"),(0,o.createElement)("span",{"aria-current":"page",className:"text-text-primary font-medium"},P)),(0,o.createElement)("div",{className:"flex justify-between items-center h-10"},(0,o.createElement)("div",{className:"flex items-center gap-2.5"+(y?" flex-1 min-w-0":"")},(0,o.createElement)(C,{to:{pathname:"admin.php",search:u},className:"text-icon-secondary hover:text-icon-primary no-underline shrink-0 transition-colors","aria-label":(0,z.__)("Back to funnel","cartflows")},(0,o.createElement)(HW,{className:"w-5 h-5 flex stroke-1"})),(0,o.createElement)(Zq,{onEditingChange:b})),e&&!A&&!y&&(0,o.createElement)(rL,{id:"wcf-save-step-meta",ref:s})));if(!_)return(0,o.createElement)("div",{className:"wcf-step-settings--container min-w-0 max-w-4.5xl flex flex-col gap-3 p-4 md:p-8 mx-auto w-full box-border"},R(!1),(0,o.createElement)("div",{className:"bg-brand-25 border border-border-subtle rounded-lg px-5 py-4 lg:px-7 sm:py-6 flex justify-between gap-6"},(0,o.createElement)("div",{className:"max-w-full"},(0,o.createElement)("h2",{className:"text-base font-medium tracking-tight text-text-primary sm:text-base"},(0,z.__)("WooCommerce is Required!","cartflows")),(0,o.createElement)("p",{className:"wcf-upgrade-to-pro-cta--text text-base font-normal text-text-secondary mt-2"},(0,z.sprintf)( |
| 74 |
// translators: %s: step type |
| 75 |
// translators: %s: step type |
| 76 |
(0,z.__)("To modify the %s step options, please install and activate the WooCommerce plugin.","cartflows"),r?.type))),(0,o.createElement)("div",{className:"mt-10 flex items-center gap-x-6 lg:mt-0 lg:flex-shrink-0"},(0,o.createElement)(Va,{variant:"primary",size:"md",onClick:(U=x,()=>{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),U((0,z.__)("Activating…","cartflows")),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{U((0,z.__)("Activated","cartflows")),window.location.reload()})})},v))));var U;let B;return B="change-template"===t&&"storeCheckout"===a&&"yes"!==f?(0,z.__)("Change Template","cartflows"):"checkout_form_fields"===e&&t?{"form-settings":(0,z.__)("Form Settings","cartflows"),"field-editor":(0,z.__)("Field Editor","cartflows"),"form-headings":(0,z.__)("Form Headings","cartflows"),"place-order-button":(0,z.__)("Place Order Button","cartflows")}[t]||Cq(e,r?.tabs):n?.title||Cq(e,r?.tabs),(0,o.createElement)(Gp,{containerType:"flex",direction:"column",gap:"sm",className:"wcf-step-settings--container min-w-0 max-w-3.5xl p-4 md:p-8 mx-auto w-full box-border"},R(),(0,o.createElement)(Gp,{containerType:"flex",direction:"column",className:D?"!gap-5 mb-8":"!gap-5 bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm mb-8 p-6"},B&&(0,o.createElement)($p,{title:B,tag:"h5",size:"xs",className:"text-text-primary"}),j?(0,o.createElement)(RX,{heading:(0,z.__)("License is required!","cartflows"),subHeading:(0,z.__)("Activate the license to modify this offer step's settings","cartflows")}):M?(0,o.createElement)(nZ,{title:(0,z.__)("Apply Discounts Automatically and Convert More Customers","cartflows"),description:(0,z.__)("Remove friction at checkout — discounts activate the moment customers arrive. Upgrade to Pro and watch conversions climb immediately.","cartflows")}):"design"===e?(0,o.createElement)("div",{className:"space-y-4"},(0,o.createElement)("div",{className:"wcf-step-notices-wrapper rounded-md bg-brand-25 border border-solid border-border-interactive p-4"},(0,o.createElement)("div",{className:"text-sm text-brand-600"},"yes"===f&&["checkout","upsell","downsell","thankyou"].includes(m?.type)?(0,z.sprintf)( |
| 77 |
// translators: %s: The current step type. |
| 78 |
// translators: %s: The current step type. |
| 79 |
(0,z.__)("Use this to customize how your Instant %s page looks.","cartflows"),"thankyou"===m?.type?(0,z.__)("Thank You","cartflows"):m?.type.charAt(0).toUpperCase()+m?.type.slice(1)):(0,o.createElement)(o.Fragment,null,(0,z.__)("If you are using shortcodes, enable this design settings to apply styles.","cartflows")))),(0,o.createElement)(mQ,{id:"wcf-enable-design-settings",name:"wcf-enable-design-settings",value:d["wcf-enable-design-settings"],label:(0,z.__)("Enable Design Settings","cartflows"),fullWidth:!0}),"yes"===d["wcf-enable-design-settings"]&&n&&(0,o.createElement)(Oq,{section:n})):"checkout_form_fields"===e&&t?(0,o.createElement)(Bq,{sectionId:t}):"product-options"===t&&n?(0,o.createElement)(Fq,null):"change-template"===t&&"storeCheckout"===a&&"yes"!==f?(0,o.createElement)(Qq,null):"checkout_offer"===e?(0,o.createElement)("div",{className:"wcf-page-wrapper"},Aq(e,r,a,c)):n&&("products"!==e||"storeCheckout"!==a||cartflows_admin.store_checkout_show_product_tab)?(0,o.createElement)(Oq,{section:n}):(0,o.createElement)("div",{className:"wcf-page-wrapper"},Aq(e,r,a,c))))},Hq=function(){return(0,o.createElement)("div",{className:"wcf-step-settings-view flex flex-col lg:flex-row lg:gap-6 items-start w-full"},(0,o.createElement)("div",{className:"wcf-step-setting--sidebar hidden lg:flex h-full min-h-screen flex-col w-auto sticky top-0 after:content-[''] after:fixed after:left-0 after:top-0 after:w-[420px] after:h-screen after:bg-background-primary after:-z-10"},(0,o.createElement)("div",{className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow bg-background-primary border-0 border-r border-solid border-border-subtle"},(0,o.createElement)("div",{className:"flex flex-col gap-0.5 pt-2"},[["w-20",!0,["w-24","w-20"]],["w-24",!1,[]],["w-16",!0,["w-28","w-20","w-24"]],["w-20",!1,[]],["w-16",!1,[]]].map(([e,t,n],r)=>(0,o.createElement)("div",{key:r,className:"flex flex-col"},(0,o.createElement)("div",{className:"flex items-center gap-2.5 px-3 py-2"},(0,o.createElement)(cO,{className:"w-5 h-5 rounded"}),(0,o.createElement)(cO,{className:`h-3 ${e} flex-1`}),t&&(0,o.createElement)(cO,{className:"w-4 h-4 rounded"})),n.length>0&&(0,o.createElement)("div",{className:"flex flex-col gap-0.5 ml-10"},n.map((e,t)=>(0,o.createElement)("div",{key:t,className:"px-2 py-1.5"},(0,o.createElement)(cO,{className:`h-3 ${e}`}))))))))),(0,o.createElement)("div",{className:"wcf-step-settings--container min-w-0 max-w-3.5xl p-4 md:p-8 mx-auto w-full flex flex-col gap-3"},(0,o.createElement)("div",{className:"flex items-center gap-2 py-1"},(0,o.createElement)(cO,{className:"w-14 h-2.5"}),(0,o.createElement)(cO,{className:"w-2 h-2.5"}),(0,o.createElement)(cO,{className:"w-20 h-2.5"}),(0,o.createElement)(cO,{className:"w-2 h-2.5"}),(0,o.createElement)(cO,{className:"w-28 h-2.5"})),(0,o.createElement)("div",{className:"flex justify-between items-center h-10"},(0,o.createElement)("div",{className:"flex items-center gap-2.5"},(0,o.createElement)(cO,{className:"w-5 h-5 rounded"}),(0,o.createElement)(cO,{className:"w-40 h-5"})),(0,o.createElement)(cO,{className:"w-28 h-9 rounded-lg"})),(0,o.createElement)("div",{className:"bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm overflow-hidden mb-8 p-6 flex flex-col gap-5"},(0,o.createElement)(cO,{className:"w-32 h-4"}),["w-28","w-36","w-24","w-32"].map((e,t)=>(0,o.createElement)("div",{key:t,className:"flex flex-col gap-2"},(0,o.createElement)(cO,{className:`${e} h-3.5`}),(0,o.createElement)(cO,{className:"w-full h-10 rounded-md"}))))))};function $q(e,t,n,r,a){if("checkout_form_fields"===e)return"form-settings";if(a?.settings){const t=Object.entries(a.settings).filter(([,t])=>t.tab===e&&t.title).sort(([,e],[,t])=>e.priority-t.priority);if(t.length>0){var o;const[e,n]=t[0];return null!==(o=n.slug)&&void 0!==o?o:e}}if("settings"===e&&t?.settings){var i,s;const e=Object.values(t.settings).sort((e,t)=>e.priority-t.priority);return null!==(i=null!==(s=e[0]?.slug)&&void 0!==s?s:e[0]?.id)&&void 0!==i?i:null}if("design"===e&&n?.settings&&"yes"===r?.["wcf-enable-design-settings"]){var l,c;const e=Object.values(n.settings).sort((e,t)=>e.priority-t.priority);return null!==(l=null!==(c=e[0]?.slug)&&void 0!==c?c:e[0]?.id)&&void 0!==l?l:null}return null}const Xq=function(e){var t,n,r;const[{flow_id:a,step_data:s,flow_type:l,options:c,page_builder:u,is_flow_instant_checkout:d,settings_data:f,design_settings:m,page_settings:p},h]=ZR(),w=(0,i.useRef)(null),y=$V(),[{},v]=g(),x=(0,b.useHistory)(),_=new URLSearchParams((0,b.useLocation)()?.search),E=null!==(t=_.get("step_id"))&&void 0!==t?t:"",N=null!==(n=_.get("tab"))&&void 0!==n?n:"",M=null!==(r=_.get("section"))&&void 0!==r?r:null,{saveOrderBump:I}=G$(),[S,k]=(0,i.useState)(N||"products"),[j,D]=(0,i.useState)(M),C="active"===cartflows_admin.woocommerce_status;let A=!0;0!==Object.keys(s).length&&s.id.toString()===E&&(A=!1);const T=e=>{const t={};return Object.entries(e).forEach(([e,n])=>{const r={...n,step_type:s?.type||""};!1!==Ah.isActiveControl(r,c)&&(t[e]=n)}),t},O=(0,i.useMemo)(()=>{if(!m?.settings)return m;const e={};return Object.entries(m.settings).forEach(([t,n])=>{if(["shortcode","shortcodes"].includes(n.slug)&&"other"!==u)return;const r={...n,step_type:s?.type||""};!1!==Ah.isActiveControl(r,c)&&(e[t]=n)}),{...m,settings:e}},[m,u,s?.type,c]),P=(0,i.useMemo)(()=>{if(!f?.settings)return f;const e=T(f.settings),t={};return Object.entries(e).forEach(([e,n])=>{["shortcode","shortcodes"].includes(n.slug)&&"other"!==u||(t[e]=n)}),{...f,settings:t}},[f,u,s?.type,c]),R=(0,i.useMemo)(()=>p?.settings?{...p,settings:T(p.settings)}:p,[p,s?.type,c]);(0,i.useEffect)(()=>{let e=!0;return""!==E&&(async()=>{L()({path:`/cartflows/v1/admin/step-data/${E}`}).then(t=>{if(e){if(t.billing_fields){const e=Object.entries(t.billing_fields.fields).map(([e,t])=>({...t,key:e}));t.billing_fields=e}if(t.shipping_fields){const e=Object.entries(t.shipping_fields.fields).map(([e,t])=>({...t,key:e}));t.shipping_fields=e}h({type:"SET_STEP_DATA",data:t})}})})(),()=>{e=!1}},[E]),(0,i.useEffect)(()=>{if(!A&&!M){const e=$q(S,P,O,c,R);D(e)}},[A]);const U=null!=j?j:A?null:$q(S,P,O,c,R);let B=[];if(s?.tabs){const e=s.tabs,t=Object.values(e).sort((e,t)=>e.priority-t.priority);let n=t.map(e=>({name:e.title,id:e.id}));F=n,Y=s,n="other"!==u&&"yes"!==d||["upsell","downsell"].includes(Y?.type)&&"yes"!==Y?.options?.["wcf-enable-instant-layout"]?F.filter(e=>"design"!==e.id):F,B=function(e,t,n,r,a,o,i){return e.map(e=>{const s={id:e.id,name:e.name,icon:(l=e.id,null!==(c={products:B$,order_bumps:mZ,checkout_form_fields:CX,"dynamic-offers":TX,checkout_offer:_$,settings:nU,optin_form_fields:_$,design:V$}[l])&&void 0!==c?c:nU),sections:[]};var l,c;return"settings"===e.id&&t?.settings?(s.sections=Object.values(t.settings).sort((e,t)=>e.priority-t.priority).map(e=>{var t;return{id:null!==(t=e.slug)&&void 0!==t?t:e.id,tabId:"settings",name:e.title}}),"storeCheckout"===o&&"yes"!==i&&s.sections.push({id:"change-template",tabId:"settings",name:(0,z.__)("Change Template","cartflows")})):"design"===e.id&&n?.settings&&"yes"===r?.["wcf-enable-design-settings"]?s.sections=Object.values(n.settings).sort((e,t)=>e.priority-t.priority).map(e=>{var t;return{id:null!==(t=e.slug)&&void 0!==t?t:e.id,tabId:"design",name:e.title}}):"checkout_form_fields"===e.id?s.sections=[{id:"form-settings",tabId:"checkout_form_fields",name:(0,z.__)("Form Settings","cartflows")},{id:"field-editor",tabId:"checkout_form_fields",name:(0,z.__)("Field Editor","cartflows")},{id:"form-headings",tabId:"checkout_form_fields",name:(0,z.__)("Form Headings","cartflows")},{id:"place-order-button",tabId:"checkout_form_fields",name:(0,z.__)("Place Order Button","cartflows")}]:a?.settings&&"checkout_offer"!==e.id&&(s.sections=Object.entries(a.settings).filter(([,t])=>t.tab===e.id&&t.title).sort(([,e],[,t])=>e.priority-t.priority).map(([t,n])=>{var r;return{id:null!==(r=n.slug)&&void 0!==r?r:t,tabId:e.id,name:n.title}})),s})}(n,P,O,c,R,l,d)}var F,Y;const Q=function(e,t,n,r,a){if(!t)return null;if(a?.settings){const n=Object.entries(a.settings).find(([n,r])=>{var a;return r.tab===e&&(null!==(a=r.slug)&&void 0!==a?a:n)===t});if(n)return n[1]}var o,i;return"settings"===e&&n?.settings?null!==(o=Object.values(n.settings).find(e=>{var n;return(null!==(n=e.slug)&&void 0!==n?n:e.id)===t}))&&void 0!==o?o:null:"design"===e&&r?.settings&&null!==(i=Object.values(r.settings).find(e=>{var n;return(null!==(n=e.slug)&&void 0!==n?n:e.id)===t}))&&void 0!==i?i:null}(S,U,P,O,R),V=async function(){return!!window.wcfUnsavedChanges&&await y({title:"Save Changes",description:"You have made changes. Do you want to save the changes?",actionBtnText:"Yes",cancelBtnText:"No"})},W=(e,t)=>{const n=new URLSearchParams(window.location.search);n.set("tab",e),t?n.set("section",t):n.delete("section"),x.push({search:n.toString()})},Z="storeCheckout"===l?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${a}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${a}`;return A?(0,o.createElement)(Hq,null):(0,o.createElement)("form",{className:"wcf-step-settings-view flex flex-col lg:flex-row lg:gap-6 items-start w-full",onSubmit:function(t){t.preventDefault();const n=new window.FormData(t.target);if("yes"===c["wcf-enable-product-options"]&&Object.entries(c["wcf-product-options-data"]).forEach(([e,t])=>{Object.entries(t).forEach(([t,r])=>{n.append(`wcf-product-options-data[${e}][${t}]`,r)})}),"order_bumps"===S)I();else{if(n.append("action","cartflows_save_meta_settings"),n.append("security",cartflows_admin.save_meta_settings_nonce),n.append("post_id",a),n.append("step_id",E),"products"===S&&"checkout"===s.type&&"single-selection"===c["wcf-product-options"]){const e=n.get("wcf_default_add_to_cart[]");n.set(`wcf-product-options-data[${e}][add_to_cart]`,"yes")}L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{v({status:"SAVED"}),pp.success((0,z.__)("Settings saved successfully!","cartflows")),["products"].includes(S)&&e.renderCb()}).catch(()=>{v({status:"UNSAVED"}),pp.error((0,z.__)("Failed to save settings. Please try again.","cartflows"))})}}},(0,o.createElement)(Tq,{accordionGroups:B,currentTab:S,currentSection:U,onTabChange:async function(e){if(e===S)return;await V()&&w.current?.click();const t=$q(e,P,O,c,R);k(e),D(t),W(e,t),window.wcfUnsavedChanges=!1},onSectionChange:async function(e,t){e===S&&t===j||(await V()&&w.current?.click(),k(e),D(t),W(e,t),window.wcfUnsavedChanges=!1)}}),(0,o.createElement)(Gq,{currentTab:S,currentSection:U,sectionObject:Q,stepData:s,flowType:l,renderCb:e.renderCb,buttonRef:w,wooStatus:C,setActiveTab:k,backUrl:Z}))},qq=Ua("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]),Jq=Ua("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]),Kq=Ua("LayoutPanelTop",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]]),eJ=Ua("LayoutPanelLeft",[["rect",{width:"7",height:"18",x:"3",y:"3",rx:"1",key:"2obqm"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}]]),tJ=Ua("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]),nJ=Ua("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),rJ=Ua("Spline",[["circle",{cx:"19",cy:"5",r:"2",key:"mhkx31"}],["circle",{cx:"5",cy:"19",r:"2",key:"v8kfzx"}],["path",{d:"M5 17A12 12 0 0 1 17 5",key:"1okkup"}]]),aJ=Ua("Workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]]),oJ=Ua("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]),iJ=Ua("Focus",[["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}],["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]),sJ=Ua("Keyboard",[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]]);var lJ={value:()=>{}};function cJ(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new uJ(r)}function uJ(e){this._=e}function dJ(e,t){for(var n,r=0,a=e.length;r<a;++r)if((n=e[r]).name===t)return n.value}function fJ(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=lJ,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}uJ.prototype=cJ.prototype={constructor:uJ,on:function(e,t){var n,r,a=this._,o=(r=a,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),i=-1,s=o.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<s;)if(n=(e=o[i]).type)a[n]=fJ(a[n],e.name,t);else if(null==t)for(n in a)a[n]=fJ(a[n],e.name,null);return this}for(;++i<s;)if((n=(e=o[i]).type)&&(n=dJ(a[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new uJ(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,a=new Array(n),o=0;o<n;++o)a[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=0,n=(r=this._[e]).length;o<n;++o)r[o].value.apply(t,a)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,o=r.length;a<o;++a)r[a].value.apply(t,n)}};const mJ=cJ;function pJ(){}function hJ(e){return null==e?pJ:function(){return this.querySelector(e)}}function gJ(){return[]}function wJ(e){return null==e?gJ:function(){return this.querySelectorAll(e)}}function yJ(e){return function(){return this.matches(e)}}function bJ(e){return function(t){return t.matches(e)}}var vJ=Array.prototype.find;function xJ(){return this.firstElementChild}var _J=Array.prototype.filter;function EJ(){return Array.from(this.children)}function NJ(e){return new Array(e.length)}function MJ(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function IJ(e,t,n,r,a,o){for(var i,s=0,l=t.length,c=o.length;s<c;++s)(i=t[s])?(i.__data__=o[s],r[s]=i):n[s]=new MJ(e,o[s]);for(;s<l;++s)(i=t[s])&&(a[s]=i)}function SJ(e,t,n,r,a,o,i){var s,l,c,u=new Map,d=t.length,f=o.length,m=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(m[s]=c=i.call(l,l.__data__,s,t)+"",u.has(c)?a[s]=l:u.set(c,l));for(s=0;s<f;++s)c=i.call(e,o[s],s,o)+"",(l=u.get(c))?(r[s]=l,l.__data__=o[s],u.delete(c)):n[s]=new MJ(e,o[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(m[s])===l&&(a[s]=l)}function kJ(e){return e.__data__}function jJ(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function DJ(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}MJ.prototype={constructor:MJ,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};var CJ="http://www.w3.org/1999/xhtml";const AJ={svg:"http://www.w3.org/2000/svg",xhtml:CJ,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function TJ(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),AJ.hasOwnProperty(t)?{space:AJ[t],local:e}:e}function OJ(e){return function(){this.removeAttribute(e)}}function LJ(e){return function(){this.removeAttributeNS(e.space,e.local)}}function zJ(e,t){return function(){this.setAttribute(e,t)}}function PJ(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function RJ(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function UJ(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function BJ(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function FJ(e){return function(){this.style.removeProperty(e)}}function YJ(e,t,n){return function(){this.style.setProperty(e,t,n)}}function QJ(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function VJ(e,t){return e.style.getPropertyValue(t)||BJ(e).getComputedStyle(e,null).getPropertyValue(t)}function WJ(e){return function(){delete this[e]}}function ZJ(e,t){return function(){this[e]=t}}function GJ(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function HJ(e){return e.trim().split(/^|\s+/)}function $J(e){return e.classList||new XJ(e)}function XJ(e){this._node=e,this._names=HJ(e.getAttribute("class")||"")}function qJ(e,t){for(var n=$J(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function JJ(e,t){for(var n=$J(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function KJ(e){return function(){qJ(this,e)}}function eK(e){return function(){JJ(this,e)}}function tK(e,t){return function(){(t.apply(this,arguments)?qJ:JJ)(this,e)}}function nK(){this.textContent=""}function rK(e){return function(){this.textContent=e}}function aK(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function oK(){this.innerHTML=""}function iK(e){return function(){this.innerHTML=e}}function sK(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function lK(){this.nextSibling&&this.parentNode.appendChild(this)}function cK(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function uK(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===CJ&&t.documentElement.namespaceURI===CJ?t.createElement(e):t.createElementNS(n,e)}}function dK(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function fK(e){var t=TJ(e);return(t.local?dK:uK)(t)}function mK(){return null}function pK(){var e=this.parentNode;e&&e.removeChild(this)}function hK(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function gK(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function wK(e){return function(){var t=this.__on;if(t){for(var n,r=0,a=-1,o=t.length;r<o;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++a]=n:this.removeEventListener(n.type,n.listener,n.options);++a?t.length=a:delete this.__on}}}function yK(e,t,n){return function(){var r,a=this.__on,o=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(a)for(var i=0,s=a.length;i<s;++i)if((r=a[i]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=o,r.options=n),void(r.value=t);this.addEventListener(e.type,o,n),r={type:e.type,name:e.name,value:t,listener:o,options:n},a?a.push(r):this.__on=[r]}}function bK(e,t,n){var r=BJ(e),a=r.CustomEvent;"function"==typeof a?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function vK(e,t){return function(){return bK(this,e,t)}}function xK(e,t){return function(){return bK(this,e,t.apply(this,arguments))}}XJ.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};var _K=[null];function EK(e,t){this._groups=e,this._parents=t}function NK(){return new EK([[document.documentElement]],_K)}EK.prototype=NK.prototype={constructor:EK,select:function(e){"function"!=typeof e&&(e=hJ(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var o,i,s=t[a],l=s.length,c=r[a]=new Array(l),u=0;u<l;++u)(o=s[u])&&(i=e.call(o,o.__data__,u,s))&&("__data__"in o&&(i.__data__=o.__data__),c[u]=i);return new EK(r,this._parents)},selectAll:function(e){e="function"==typeof e?function(e){return function(){return function(e){return null==e?[]:Array.isArray(e)?e:Array.from(e)}(e.apply(this,arguments))}}(e):wJ(e);for(var t=this._groups,n=t.length,r=[],a=[],o=0;o<n;++o)for(var i,s=t[o],l=s.length,c=0;c<l;++c)(i=s[c])&&(r.push(e.call(i,i.__data__,c,s)),a.push(i));return new EK(r,a)},selectChild:function(e){return this.select(null==e?xJ:function(e){return function(){return vJ.call(this.children,e)}}("function"==typeof e?e:bJ(e)))},selectChildren:function(e){return this.selectAll(null==e?EJ:function(e){return function(){return _J.call(this.children,e)}}("function"==typeof e?e:bJ(e)))},filter:function(e){"function"!=typeof e&&(e=yJ(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var o,i=t[a],s=i.length,l=r[a]=[],c=0;c<s;++c)(o=i[c])&&e.call(o,o.__data__,c,i)&&l.push(o);return new EK(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,kJ);var n=t?SJ:IJ,r=this._parents,a=this._groups;"function"!=typeof e&&(e=function(e){return function(){return e}}(e));for(var o=a.length,i=new Array(o),s=new Array(o),l=new Array(o),c=0;c<o;++c){var u=r[c],d=a[c],f=d.length,m=jJ(e.call(u,u&&u.__data__,c,r)),p=m.length,h=s[c]=new Array(p),g=i[c]=new Array(p);n(u,d,h,g,l[c]=new Array(f),m,t);for(var w,y,b=0,v=0;b<p;++b)if(w=h[b]){for(b>=v&&(v=b+1);!(y=g[v])&&++v<p;);w._next=y||null}}return(i=new EK(i,r))._enter=s,i._exit=l,i},enter:function(){return new EK(this._enter||this._groups.map(NJ),this._parents)},exit:function(){return new EK(this._exit||this._groups.map(NJ),this._parents)},join:function(e,t,n){var r=this.enter(),a=this,o=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(a=t(a))&&(a=a.selection()),null==n?o.remove():n(o),r&&a?r.merge(a).order():a},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,o=r.length,i=Math.min(a,o),s=new Array(a),l=0;l<i;++l)for(var c,u=n[l],d=r[l],f=u.length,m=s[l]=new Array(f),p=0;p<f;++p)(c=u[p]||d[p])&&(m[p]=c);for(;l<a;++l)s[l]=n[l];return new EK(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,a=e[t],o=a.length-1,i=a[o];--o>=0;)(r=a[o])&&(i&&4^r.compareDocumentPosition(i)&&i.parentNode.insertBefore(r,i),i=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=DJ);for(var n=this._groups,r=n.length,a=new Array(r),o=0;o<r;++o){for(var i,s=n[o],l=s.length,c=a[o]=new Array(l),u=0;u<l;++u)(i=s[u])&&(c[u]=i);c.sort(t)}return new EK(a,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,o=r.length;a<o;++a){var i=r[a];if(i)return i}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a,o=t[n],i=0,s=o.length;i<s;++i)(a=o[i])&&e.call(a,a.__data__,i,o);return this},attr:function(e,t){var n=TJ(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?LJ:OJ:"function"==typeof t?n.local?UJ:RJ:n.local?PJ:zJ)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?FJ:"function"==typeof t?QJ:YJ)(e,t,null==n?"":n)):VJ(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?WJ:"function"==typeof t?GJ:ZJ)(e,t)):this.node()[e]},classed:function(e,t){var n=HJ(e+"");if(arguments.length<2){for(var r=$J(this.node()),a=-1,o=n.length;++a<o;)if(!r.contains(n[a]))return!1;return!0}return this.each(("function"==typeof t?tK:t?KJ:eK)(n,t))},text:function(e){return arguments.length?this.each(null==e?nK:("function"==typeof e?aK:rK)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?oK:("function"==typeof e?sK:iK)(e)):this.node().innerHTML},raise:function(){return this.each(lK)},lower:function(){return this.each(cK)},append:function(e){var t="function"==typeof e?e:fK(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:fK(e),r=null==t?mK:"function"==typeof t?t:hJ(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(pK)},clone:function(e){return this.select(e?gK:hK)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,a,o=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),i=o.length;if(!(arguments.length<2)){for(s=t?yK:wK,r=0;r<i;++r)this.each(s(o[r],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<i;++r)if((a=o[r]).type===l.type&&a.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?xK:vK)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,a=e[t],o=0,i=a.length;o<i;++o)(r=a[o])&&(yield r)}};const MK=NK;function IK(e){return"string"==typeof e?new EK([[document.querySelector(e)]],[document.documentElement]):new EK([[e]],_K)}function SK(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const kK={passive:!1},jK={capture:!0,passive:!1};function DK(e){e.stopImmediatePropagation()}function CK(e){e.preventDefault(),e.stopImmediatePropagation()}function AK(e){var t=e.document.documentElement,n=IK(e).on("dragstart.drag",CK,jK);"onselectstart"in t?n.on("selectstart.drag",CK,jK):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function TK(e,t){var n=e.document.documentElement,r=IK(e).on("dragstart.drag",null);t&&(r.on("click.drag",CK,jK),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const OK=e=>()=>e;function LK(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:o,x:i,y:s,dx:l,dy:c,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function zK(e){return!e.ctrlKey&&!e.button}function PK(){return this.parentNode}function RK(e,t){return null==t?{x:e.x,y:e.y}:t}function UK(){return navigator.maxTouchPoints||"ontouchstart"in this}function BK(){var e,t,n,r,a=zK,o=PK,i=RK,s=UK,l={},c=mJ("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",m).filter(s).on("touchstart.drag",g).on("touchmove.drag",w,kK).on("touchend.drag touchcancel.drag",y).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(i,s){if(!r&&a.call(this,i,s)){var l=b(this,o.call(this,i,s),i,s,"mouse");l&&(IK(i.view).on("mousemove.drag",p,jK).on("mouseup.drag",h,jK),AK(i.view),DK(i),n=!1,e=i.clientX,t=i.clientY,l("start",i))}}function p(r){if(CK(r),!n){var a=r.clientX-e,o=r.clientY-t;n=a*a+o*o>d}l.mouse("drag",r)}function h(e){IK(e.view).on("mousemove.drag mouseup.drag",null),TK(e.view,n),CK(e),l.mouse("end",e)}function g(e,t){if(a.call(this,e,t)){var n,r,i=e.changedTouches,s=o.call(this,e,t),l=i.length;for(n=0;n<l;++n)(r=b(this,s,e,t,i[n].identifier,i[n]))&&(DK(e),r("start",e,i[n]))}}function w(e){var t,n,r=e.changedTouches,a=r.length;for(t=0;t<a;++t)(n=l[r[t].identifier])&&(CK(e),n("drag",e,r[t]))}function y(e){var t,n,a=e.changedTouches,o=a.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<o;++t)(n=l[a[t].identifier])&&(DK(e),n("end",e,a[t]))}function b(e,t,n,r,a,o){var s,d,m,p=c.copy(),h=SK(o||n,t);if(null!=(m=i.call(e,new LK("beforestart",{sourceEvent:n,target:f,identifier:a,active:u,x:h[0],y:h[1],dx:0,dy:0,dispatch:p}),r)))return s=m.x-h[0]||0,d=m.y-h[1]||0,function n(o,i,c){var g,w=h;switch(o){case"start":l[a]=n,g=u++;break;case"end":delete l[a],--u;case"drag":h=SK(c||i,t),g=u}p.call(o,e,new LK(o,{sourceEvent:i,subject:m,target:f,identifier:a,active:g,x:h[0]+s,y:h[1]+d,dx:h[0]-w[0],dy:h[1]-w[1],dispatch:p}),r)}}return f.filter=function(e){return arguments.length?(a="function"==typeof e?e:OK(!!e),f):a},f.container=function(e){return arguments.length?(o="function"==typeof e?e:OK(e),f):o},f.subject=function(e){return arguments.length?(i="function"==typeof e?e:OK(e),f):i},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:OK(!!e),f):s},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function FK(e){return((e=Math.exp(e))+1/e)/2}LK.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};const YK=function e(t,n,r){function a(e,a){var o,i,s=e[0],l=e[1],c=e[2],u=a[0],d=a[1],f=a[2],m=u-s,p=d-l,h=m*m+p*p;if(h<1e-12)i=Math.log(f/c)/t,o=function(e){return[s+e*m,l+e*p,c*Math.exp(t*e*i)]};else{var g=Math.sqrt(h),w=(f*f-c*c+r*h)/(2*c*n*g),y=(f*f-c*c-r*h)/(2*f*n*g),b=Math.log(Math.sqrt(w*w+1)-w),v=Math.log(Math.sqrt(y*y+1)-y);i=(v-b)/t,o=function(e){var r=e*i,a=FK(b),o=c/(n*g)*(a*function(e){return((e=Math.exp(2*e))-1)/(e+1)}(t*r+b)-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+o*m,l+o*p,c*a/FK(t*r+b)]}}return o.duration=1e3*i*t/Math.SQRT2,o}return a.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},a}(Math.SQRT2,2,4);var QK,VK,WK=0,ZK=0,GK=0,HK=0,$K=0,XK=0,qK="object"==typeof performance&&performance.now?performance:Date,JK="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function KK(){return $K||(JK(e0),$K=qK.now()+XK)}function e0(){$K=0}function t0(){this._call=this._time=this._next=null}function n0(e,t,n){var r=new t0;return r.restart(e,t,n),r}function r0(){$K=(HK=qK.now())+XK,WK=ZK=0;try{!function(){KK(),++WK;for(var e,t=QK;t;)(e=$K-t._time)>=0&&t._call.call(void 0,e),t=t._next;--WK}()}finally{WK=0,function(){for(var e,t,n=QK,r=1/0;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:QK=t);VK=e,o0(r)}(),$K=0}}function a0(){var e=qK.now(),t=e-HK;t>1e3&&(XK-=t,HK=e)}function o0(e){WK||(ZK&&(ZK=clearTimeout(ZK)),e-$K>24?(e<1/0&&(ZK=setTimeout(r0,e-qK.now()-XK)),GK&&(GK=clearInterval(GK))):(GK||(HK=qK.now(),GK=setInterval(a0,1e3)),WK=1,JK(r0)))}function i0(e,t,n){var r=new t0;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}t0.prototype=n0.prototype={constructor:t0,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?KK():+n)+(null==t?0:+t),this._next||VK===this||(VK?VK._next=this:QK=this,VK=this),this._call=e,this._time=n,o0()},stop:function(){this._call&&(this._call=null,this._time=1/0,o0())}};var s0=mJ("start","end","cancel","interrupt"),l0=[];function c0(e,t,n,r,a,o){var i=e.__transition;if(i){if(n in i)return}else e.__transition={};!function(e,t,n){var r,a=e.__transition;function o(l){var c,u,d,f;if(1!==n.state)return s();for(c in a)if((f=a[c]).name===n.name){if(3===f.state)return i0(o);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete a[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete a[c])}if(i0(function(){3===n.state&&(n.state=4,n.timer.restart(i,n.delay,n.time),i(l))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function i(t){for(var a=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(s),n.state=5,1),o=-1,i=r.length;++o<i;)r[o].call(e,a);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),s())}function s(){for(var r in n.state=6,n.timer.stop(),delete a[t],a)return;delete e.__transition}a[t]=n,n.timer=n0(function(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)},0,n.time)}(e,n,{name:t,index:r,group:a,on:s0,tween:l0,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:0})}function u0(e,t){var n=f0(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function d0(e,t){var n=f0(e,t);if(n.state>3)throw new Error("too late; already running");return n}function f0(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function m0(e,t){var n,r,a,o=e.__transition,i=!0;if(o){for(a in t=null==t?null:t+"",o)(n=o[a]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete o[a]):i=!1;i&&delete e.__transition}}var p0,h0=180/Math.PI,g0={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function w0(e,t,n,r,a,o){var i,s,l;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,i=-i),{translateX:a,translateY:o,rotate:Math.atan2(t,e)*h0,skewX:Math.atan(l)*h0,scaleX:i,scaleY:s}}function y0(e,t,n,r){function a(e){return e.length?e.pop()+" ":""}return function(o,i){var s=[],l=[];return o=e(o),i=e(i),function(e,r,a,o,i,s){if(e!==a||r!==o){var l=i.push("translate(",null,t,null,n);s.push({i:l-4,x:b_(e,a)},{i:l-2,x:b_(r,o)})}else(a||o)&&i.push("translate("+a+t+o+n)}(o.translateX,o.translateY,i.translateX,i.translateY,s,l),function(e,t,n,o){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),o.push({i:n.push(a(n)+"rotate(",null,r)-2,x:b_(e,t)})):t&&n.push(a(n)+"rotate("+t+r)}(o.rotate,i.rotate,s,l),function(e,t,n,o){e!==t?o.push({i:n.push(a(n)+"skewX(",null,r)-2,x:b_(e,t)}):t&&n.push(a(n)+"skewX("+t+r)}(o.skewX,i.skewX,s,l),function(e,t,n,r,o,i){if(e!==n||t!==r){var s=o.push(a(o)+"scale(",null,",",null,")");i.push({i:s-4,x:b_(e,n)},{i:s-2,x:b_(t,r)})}else 1===n&&1===r||o.push(a(o)+"scale("+n+","+r+")")}(o.scaleX,o.scaleY,i.scaleX,i.scaleY,s,l),o=i=null,function(e){for(var t,n=-1,r=l.length;++n<r;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var b0=y0(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?g0:w0(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),v0=y0(function(e){return null==e?g0:(p0||(p0=document.createElementNS("http://www.w3.org/2000/svg","g")),p0.setAttribute("transform",e),(e=p0.transform.baseVal.consolidate())?w0((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):g0)},", ",")",")");function x0(e,t){var n,r;return function(){var a=d0(this,e),o=a.tween;if(o!==n)for(var i=0,s=(r=n=o).length;i<s;++i)if(r[i].name===t){(r=r.slice()).splice(i,1);break}a.tween=r}}function _0(e,t,n){var r,a;if("function"!=typeof n)throw new Error;return function(){var o=d0(this,e),i=o.tween;if(i!==r){a=(r=i).slice();for(var s={name:t,value:n},l=0,c=a.length;l<c;++l)if(a[l].name===t){a[l]=s;break}l===c&&a.push(s)}o.tween=a}}function E0(e,t,n){var r=e._id;return e.each(function(){var e=d0(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return f0(e,r).value[t]}}function N0(e,t){var n;return("number"==typeof t?b_:t instanceof Xx?h_:(n=Xx(t))?(t=n,h_):N_)(e,t)}function M0(e){return function(){this.removeAttribute(e)}}function I0(e){return function(){this.removeAttributeNS(e.space,e.local)}}function S0(e,t,n){var r,a,o=n+"";return function(){var i=this.getAttribute(e);return i===o?null:i===r?a:a=t(r=i,n)}}function k0(e,t,n){var r,a,o=n+"";return function(){var i=this.getAttributeNS(e.space,e.local);return i===o?null:i===r?a:a=t(r=i,n)}}function j0(e,t,n){var r,a,o;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttribute(e))===(s=l+"")?null:i===r&&s===a?o:(a=s,o=t(r=i,l));this.removeAttribute(e)}}function D0(e,t,n){var r,a,o;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:i===r&&s===a?o:(a=s,o=t(r=i,l));this.removeAttributeNS(e.space,e.local)}}function C0(e,t){var n,r;function a(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,a)),n}return a._value=t,a}function A0(e,t){var n,r;function a(){var a=t.apply(this,arguments);return a!==r&&(n=(r=a)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,a)),n}return a._value=t,a}function T0(e,t){return function(){u0(this,e).delay=+t.apply(this,arguments)}}function O0(e,t){return t=+t,function(){u0(this,e).delay=t}}function L0(e,t){return function(){d0(this,e).duration=+t.apply(this,arguments)}}function z0(e,t){return t=+t,function(){d0(this,e).duration=t}}var P0=MK.prototype.constructor;function R0(e){return function(){this.style.removeProperty(e)}}var U0=0;function B0(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function F0(){return++U0}var Y0=MK.prototype;B0.prototype=function(e){return MK().transition(e)}.prototype={constructor:B0,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=hJ(e));for(var r=this._groups,a=r.length,o=new Array(a),i=0;i<a;++i)for(var s,l,c=r[i],u=c.length,d=o[i]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=e.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),d[f]=l,c0(d[f],t,n,f,d,f0(s,n)));return new B0(o,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=wJ(e));for(var r=this._groups,a=r.length,o=[],i=[],s=0;s<a;++s)for(var l,c=r[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var f,m=e.call(l,l.__data__,d,c),p=f0(l,n),h=0,g=m.length;h<g;++h)(f=m[h])&&c0(f,t,n,h,m,p);o.push(m),i.push(l)}return new B0(o,i,t,n)},selectChild:Y0.selectChild,selectChildren:Y0.selectChildren,filter:function(e){"function"!=typeof e&&(e=yJ(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var o,i=t[a],s=i.length,l=r[a]=[],c=0;c<s;++c)(o=i[c])&&e.call(o,o.__data__,c,i)&&l.push(o);return new B0(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,o=Math.min(r,a),i=new Array(r),s=0;s<o;++s)for(var l,c=t[s],u=n[s],d=c.length,f=i[s]=new Array(d),m=0;m<d;++m)(l=c[m]||u[m])&&(f[m]=l);for(;s<r;++s)i[s]=t[s];return new B0(i,this._parents,this._name,this._id)},selection:function(){return new P0(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=F0(),r=this._groups,a=r.length,o=0;o<a;++o)for(var i,s=r[o],l=s.length,c=0;c<l;++c)if(i=s[c]){var u=f0(i,t);c0(i,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new B0(r,this._parents,e,n)},call:Y0.call,nodes:Y0.nodes,node:Y0.node,size:Y0.size,empty:Y0.empty,each:Y0.each,on:function(e,t){var n=this._id;return arguments.length<2?f0(this.node(),n).on.on(e):this.each(function(e,t,n){var r,a,o=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?u0:d0;return function(){var i=o(this,e),s=i.on;s!==r&&(a=(r=s).copy()).on(t,n),i.on=a}}(n,e,t))},attr:function(e,t){var n=TJ(e),r="transform"===n?v0:N0;return this.attrTween(e,"function"==typeof t?(n.local?D0:j0)(n,r,E0(this,"attr."+e,t)):null==t?(n.local?I0:M0)(n):(n.local?k0:S0)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=TJ(e);return this.tween(n,(r.local?C0:A0)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?b0:N0;return null==t?this.styleTween(e,function(e,t){var n,r,a;return function(){var o=VJ(this,e),i=(this.style.removeProperty(e),VJ(this,e));return o===i?null:o===n&&i===r?a:a=t(n=o,r=i)}}(e,r)).on("end.style."+e,R0(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,a,o;return function(){var i=VJ(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=VJ(this,e)),i===l?null:i===r&&l===a?o:(a=l,o=t(r=i,s))}}(e,r,E0(this,"style."+e,t))).each(function(e,t){var n,r,a,o,i="style."+t,s="end."+i;return function(){var l=d0(this,e),c=l.on,u=null==l.value[i]?o||(o=R0(t)):void 0;c===n&&a===u||(r=(n=c).copy()).on(s,a=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,a,o=n+"";return function(){var i=VJ(this,e);return i===o?null:i===r?a:a=t(r=i,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,a;function o(){var o=t.apply(this,arguments);return o!==a&&(r=(a=o)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,o,n)),r}return o._value=t,o}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(E0(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,a=f0(this.node(),n).tween,o=0,i=a.length;o<i;++o)if((r=a[o]).name===e)return r.value;return null}return this.each((null==t?x0:_0)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?T0:O0)(t,e)):f0(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?L0:z0)(t,e)):f0(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){d0(this,e).ease=t}}(t,e)):f0(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;d0(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(o,i){var s={value:i},l={value:function(){0===--a&&o()}};n.each(function(){var n=d0(this,r),a=n.on;a!==e&&((t=(e=a).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===a&&o()})},[Symbol.iterator]:Y0[Symbol.iterator]};var Q0={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function V0(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}MK.prototype.interrupt=function(e){return this.each(function(){m0(this,e)})},MK.prototype.transition=function(e){var t,n;e instanceof B0?(t=e._id,e=e._name):(t=F0(),(n=Q0).time=KK(),e=null==e?null:e+"");for(var r=this._groups,a=r.length,o=0;o<a;++o)for(var i,s=r[o],l=s.length,c=0;c<l;++c)(i=s[c])&&c0(i,e,t,c,s,n||V0(i,t));return new B0(r,this._parents,e,t)};const W0=e=>()=>e;function Z0(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function G0(e,t,n){this.k=e,this.x=t,this.y=n}G0.prototype={constructor:G0,scale:function(e){return 1===e?this:new G0(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new G0(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var H0=new G0(1,0,0);function $0(e){for(;!e.__zoom;)if(!(e=e.parentNode))return H0;return e.__zoom}function X0(e){e.stopImmediatePropagation()}function q0(e){e.preventDefault(),e.stopImmediatePropagation()}function J0(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function K0(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).x,e.y],[e.x+e.width,e.y+e.height]]:[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]:[[0,0],[e.clientWidth,e.clientHeight]]}function e1(){return this.__zoom||H0}function t1(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function n1(){return navigator.maxTouchPoints||"ontouchstart"in this}function r1(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),i>o?(o+i)/2:Math.min(0,o)||Math.max(0,i))}function a1(){var e,t,n,r=J0,a=K0,o=r1,i=t1,s=n1,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=YK,f=mJ("start","zoom","end"),m=0,p=10;function h(e){e.property("__zoom",e1).on("wheel.zoom",_,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",N).filter(s).on("touchstart.zoom",M).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",S).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new G0(t,e.x,e.y)}function w(e,t,n){var r=t[0]-n[0]*e.k,a=t[1]-n[1]*e.k;return r===e.x&&a===e.y?e:new G0(e.k,r,a)}function y(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,r){e.on("start.zoom",function(){v(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){v(this,arguments).event(r).end()}).tween("zoom",function(){var e=this,o=arguments,i=v(e,o).event(r),s=a.apply(e,o),l=null==n?y(s):"function"==typeof n?n.apply(e,o):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,o):t,m=d(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=m(e),n=c/t[2];e=new G0(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}})}function v(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=a.apply(e,t),this.taps=0}function _(e,...t){if(r.apply(this,arguments)){var n=v(this,t).event(e),a=this.__zoom,s=Math.max(l[0],Math.min(l[1],a.k*Math.pow(2,i.apply(this,arguments)))),u=SK(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=a.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(a.k===s)return;n.mouse=[u,a.invert(u)],m0(this),n.start()}q0(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",o(w(g(a,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function E(e,...t){if(!n&&r.apply(this,arguments)){var a=e.currentTarget,i=v(this,t,!0).event(e),s=IK(e.view).on("mousemove.zoom",function(e){if(q0(e),!i.moved){var t=e.clientX-u,n=e.clientY-d;i.moved=t*t+n*n>m}i.event(e).zoom("mouse",o(w(i.that.__zoom,i.mouse[0]=SK(e,a),i.mouse[1]),i.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),TK(e.view,i.moved),q0(e),i.event(e).end()},!0),l=SK(e,a),u=e.clientX,d=e.clientY;AK(e.view),X0(e),i.mouse=[l,this.__zoom.invert(l)],m0(this),i.start()}}function N(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,i=SK(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(i),l=n.k*(e.shiftKey?.5:2),d=o(w(g(n,l),i,s),a.apply(this,t),c);q0(e),u>0?IK(this).transition().duration(u).call(b,d,i,e):IK(this).call(h.transform,d,i,e)}}function M(n,...a){if(r.apply(this,arguments)){var o,i,s,l,c=n.touches,u=c.length,d=v(this,a,n.changedTouches.length===u).event(n);for(X0(n),i=0;i<u;++i)l=[l=SK(s=c[i],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,o=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),o&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),m0(this),d.start())}}function I(e,...t){if(this.__zooming){var n,r,a,i,s=v(this,t).event(e),l=e.changedTouches,u=l.length;for(q0(e),n=0;n<u;++n)a=SK(r=l[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=a:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=a);if(r=s.that.__zoom,s.touch1){var d=s.touch0[0],f=s.touch0[1],m=s.touch1[0],p=s.touch1[1],h=(h=m[0]-d[0])*h+(h=m[1]-d[1])*h,y=(y=p[0]-f[0])*y+(y=p[1]-f[1])*y;r=g(r,Math.sqrt(h/y)),a=[(d[0]+m[0])/2,(d[1]+m[1])/2],i=[(f[0]+p[0])/2,(f[1]+p[1])/2]}else{if(!s.touch0)return;a=s.touch0[0],i=s.touch0[1]}s.zoom("touch",o(w(r,a,i),s.extent,c))}}function S(e,...r){if(this.__zooming){var a,o,i=v(this,r).event(e),s=e.changedTouches,l=s.length;for(X0(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),a=0;a<l;++a)o=s[a],i.touch0&&i.touch0[2]===o.identifier?delete i.touch0:i.touch1&&i.touch1[2]===o.identifier&&delete i.touch1;if(i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0)i.touch0[1]=this.__zoom.invert(i.touch0[0]);else if(i.end(),2===i.taps&&(o=SK(o,this),Math.hypot(t[0]-o[0],t[1]-o[1])<p)){var c=IK(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return h.transform=function(e,t,n,r){var a=e.selection?e.selection():e;a.property("__zoom",e1),e!==a?b(e,t,n,r):a.interrupt().each(function(){v(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},h.scaleBy=function(e,t,n,r){h.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,r)},h.scaleTo=function(e,t,n,r){h.transform(e,function(){var e=a.apply(this,arguments),r=this.__zoom,i=null==n?y(e):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(i),l="function"==typeof t?t.apply(this,arguments):t;return o(w(g(r,l),i,s),e,c)},n,r)},h.translateBy=function(e,t,n,r){h.transform(e,function(){return o(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),a.apply(this,arguments),c)},null,r)},h.translateTo=function(e,t,n,r,i){h.transform(e,function(){var e=a.apply(this,arguments),i=this.__zoom,s=null==r?y(e):"function"==typeof r?r.apply(this,arguments):r;return o(H0.translate(s[0],s[1]).scale(i.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},r,i)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=IK(this.that).datum();f.call(e,this.that,new Z0(e,{sourceEvent:this.sourceEvent,target:h,type:e,transform:this.that.__zoom,dispatch:f}),t)}},h.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:W0(+e),h):i},h.filter=function(e){return arguments.length?(r="function"==typeof e?e:W0(!!e),h):r},h.touchable=function(e){return arguments.length?(s="function"==typeof e?e:W0(!!e),h):s},h.extent=function(e){return arguments.length?(a="function"==typeof e?e:W0([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),h):a},h.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],h):[l[0],l[1]]},h.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],h):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},h.constrain=function(e){return arguments.length?(o=e,h):o},h.duration=function(e){return arguments.length?(u=+e,h):u},h.interpolate=function(e){return arguments.length?(d=e,h):d},h.on=function(){var e=f.on.apply(f,arguments);return e===f?h:e},h.clickDistance=function(e){return arguments.length?(m=(e=+e)*e,h):Math.sqrt(m)},h.tapDistance=function(e){return arguments.length?(p=+e,h):p},h}$0.prototype=G0.prototype;const o1=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],i1=["Enter"," ","Escape"],s1={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var l1,c1,u1;!function(e){e.Strict="strict",e.Loose="loose"}(l1||(l1={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(c1||(c1={})),function(e){e.Partial="partial",e.Full="full"}(u1||(u1={}));const d1={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var f1,m1,p1;!function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(f1||(f1={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(m1||(m1={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(p1||(p1={}));const h1={[p1.Left]:p1.Right,[p1.Right]:p1.Left,[p1.Top]:p1.Bottom,[p1.Bottom]:p1.Top};function g1(e){return null===e?null:e?"valid":"invalid"}const w1=e=>"id"in e&&"source"in e&&"target"in e,y1=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),b1=(e,t=[0,0])=>{const{width:n,height:r}=W1(e),a=e.origin??t,o=n*a[0],i=r*a[1];return{x:e.position.x-o,y:e.position.y-i}},v1=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(void 0===t.filter||t.filter(e))&&(n=k1(n,A1(e)),r=!0)}),r?D1(n):{x:0,y:0,width:0,height:0}},x1=(e,t,[n,r,a]=[0,0,1],o=!1,i=!1)=>{const s={...U1(t,[n,r,a]),width:t.width/a,height:t.height/a},l=[];for(const t of e.values()){const{measured:e,selectable:n=!0,hidden:r=!1}=t;if(i&&!n||r)continue;const a=e.width??t.width??t.initialWidth??null,c=e.height??t.height??t.initialHeight??null,u=O1(s,C1(t)),d=(a??0)*(c??0),f=o&&u>0;(!t.internals.handleBounds||f||u>=d||t.dragging)&&l.push(t)}return l};function _1({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:o}){const i=n.get(e),s=i.parentId?n.get(i.parentId):void 0,{x:l,y:c}=s?s.internals.positionAbsolute:{x:0,y:0},u=i.origin??r;let d=i.extent||a;if("parent"!==i.extent||i.expandParent)s&&V1(i.extent)&&(d=[[i.extent[0][0]+l,i.extent[0][1]+c],[i.extent[1][0]+l,i.extent[1][1]+c]]);else if(s){const e=s.measured.width,t=s.measured.height;e&&t&&(d=[[l,c],[l+e,c+t]])}else o?.("005","Only child nodes can use a parent extent.");const f=V1(d)?N1(t,d,i.measured):t;return void 0!==i.measured.width&&void 0!==i.measured.height||o?.("015","It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."),{position:{x:f.x-l+(i.measured.width??0)*u[0],y:f.y-c+(i.measured.height??0)*u[1]},positionAbsolute:f}}const E1=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),N1=(e={x:0,y:0},t,n)=>({x:E1(e.x,t[0][0],t[1][0]-(n?.width??0)),y:E1(e.y,t[0][1],t[1][1]-(n?.height??0))});function M1(e,t,n){const{width:r,height:a}=W1(n),{x:o,y:i}=n.internals.positionAbsolute;return N1(e,[[o,i],[o+r,i+a]],t)}const I1=(e,t,n)=>e<t?E1(Math.abs(e-t),1,t)/t:e>n?-E1(Math.abs(e-n),1,t)/t:0,S1=(e,t,n=15,r=40)=>[I1(e.x,r,t.width-r)*n,I1(e.y,r,t.height-r)*n],k1=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),j1=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),D1=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),C1=(e,t=[0,0])=>{const{x:n,y:r}=y1(e)?e.internals.positionAbsolute:b1(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},A1=(e,t=[0,0])=>{const{x:n,y:r}=y1(e)?e.internals.positionAbsolute:b1(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},T1=(e,t)=>D1(k1(j1(e),j1(t))),O1=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},L1=e=>z1(e.width)&&z1(e.height)&&z1(e.x)&&z1(e.y),z1=e=>!isNaN(e)&&isFinite(e),P1=(e,t)=>{},R1=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),U1=({x:e,y:t},[n,r,a],o=!1,i=[1,1])=>{const s={x:(e-n)/a,y:(t-r)/a};return o?R1(s,i):s},B1=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function F1(e,t){if("number"==typeof e)return Math.floor(.5*(t-t/(1+e)));if("string"==typeof e&&e.endsWith("px")){const t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if("string"==typeof e&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}const Y1=(e,t,n,r,a,o)=>{const i=function(e,t,n){if("string"==typeof e||"number"==typeof e){const r=F1(e,n),a=F1(e,t);return{top:r,right:a,bottom:r,left:a,x:2*a,y:2*r}}if("object"==typeof e){const r=F1(e.top??e.y??0,n),a=F1(e.bottom??e.y??0,n),o=F1(e.left??e.x??0,t),i=F1(e.right??e.x??0,t);return{top:r,right:i,bottom:a,left:o,x:o+i,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}(o,t,n),s=(t-i.x)/e.width,l=(n-i.y)/e.height,c=Math.min(s,l),u=E1(c,r,a),d=t/2-(e.x+e.width/2)*u,f=n/2-(e.y+e.height/2)*u,m=function(e,t,n,r,a,o){const{x:i,y:s}=B1(e,[t,n,r]),{x:l,y:c}=B1({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=a-l,d=o-c;return{left:Math.floor(i),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}(e,d,f,u,t,n),p=Math.min(m.left-i.left,0),h=Math.min(m.top-i.top,0);return{x:d-p+Math.min(m.right-i.right,0),y:f-h+Math.min(m.bottom-i.bottom,0),zoom:u}},Q1=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0;function V1(e){return null!=e&&"parent"!==e}function W1(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Z1(e){return void 0!==(e.measured?.width??e.width??e.initialWidth)&&void 0!==(e.measured?.height??e.height??e.initialHeight)}function G1(e,t={width:0,height:0},n,r,a){const o={...e},i=r.get(n);if(i){const e=i.origin||a;o.x+=i.internals.positionAbsolute.x-(t.width??0)*e[0],o.y+=i.internals.positionAbsolute.y-(t.height??0)*e[1]}return o}function H1(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function $1(e){return{...s1,...e||{}}}function X1(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:o,y:i}=n2(e),s=U1({x:o-(a?.left??0),y:i-(a?.top??0)},r),{x:l,y:c}=n?R1(s,t):s;return{xSnapped:l,ySnapped:c,...s}}const q1=e=>({width:e.offsetWidth,height:e.offsetHeight}),J1=e=>e?.getRootNode?.()||window?.document,K1=["INPUT","SELECT","TEXTAREA"];function e2(e){const t=e.composedPath?.()?.[0]||e.target;return 1===t?.nodeType&&(K1.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey"))}const t2=e=>"clientX"in e,n2=(e,t)=>{const n=t2(e),r=n?e.clientX:e.touches?.[0].clientX,a=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:a-(t?.top??0)}},r2=(e,t,n,r,a)=>{const o=t.querySelectorAll(`.${e}`);return o&&o.length?Array.from(o).map(t=>{const o=t.getBoundingClientRect();return{id:t.getAttribute("data-handleid"),type:e,nodeId:a,position:t.getAttribute("data-handlepos"),x:(o.left-n.left)/r,y:(o.top-n.top)/r,...q1(t)}}):null};function a2({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:o,targetControlX:i,targetControlY:s}){const l=.125*e+.375*a+.375*i+.125*n,c=.125*t+.375*o+.375*s+.125*r;return[l,c,Math.abs(l-e),Math.abs(c-t)]}function o2(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function i2({pos:e,x1:t,y1:n,x2:r,y2:a,c:o}){switch(e){case p1.Left:return[t-o2(t-r,o),n];case p1.Right:return[t+o2(r-t,o),n];case p1.Top:return[t,n-o2(n-a,o)];case p1.Bottom:return[t,n+o2(a-n,o)]}}function s2({sourceX:e,sourceY:t,sourcePosition:n=p1.Bottom,targetX:r,targetY:a,targetPosition:o=p1.Top,curvature:i=.25}){const[s,l]=i2({pos:n,x1:e,y1:t,x2:r,y2:a,c:i}),[c,u]=i2({pos:o,x1:r,y1:a,x2:e,y2:t,c:i}),[d,f,m,p]=a2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${r},${a}`,d,f,m,p]}function l2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,o=n<e?n+a:n-a,i=Math.abs(r-t)/2;return[o,r<t?r+i:r-i,a,i]}function c2({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const o=k1(A1(e),A1(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const i={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return O1(i,D1(o))>0}const u2=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,d2=(e,t,n={})=>{if(!e.source||!e.target)return t;const r=n.getEdgeId||u2;let a;return a=w1(e)?{...e}:{...e,id:r(e)},((e,t)=>t.some(t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle))))(a,t)?t:(null===a.sourceHandle&&delete a.sourceHandle,null===a.targetHandle&&delete a.targetHandle,t.concat(a))};function f2({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,o,i,s]=l2({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,o,i,s]}const m2={[p1.Left]:{x:-1,y:0},[p1.Right]:{x:1,y:0},[p1.Top]:{x:0,y:-1},[p1.Bottom]:{x:0,y:1}},p2=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function h2(e,t,n,r){const a=Math.min(p2(e,t)/2,p2(t,n)/2,r),{x:o,y:i}=t;if(e.x===o&&o===n.x||e.y===i&&i===n.y)return`L${o} ${i}`;if(e.y===i)return`L ${o+a*(e.x<n.x?-1:1)},${i}Q ${o},${i} ${o},${i+a*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${o},${i+a*(e.y<n.y?-1:1)}Q ${o},${i} ${o+a*s},${i}`}function g2({sourceX:e,sourceY:t,sourcePosition:n=p1.Bottom,targetX:r,targetY:a,targetPosition:o=p1.Top,borderRadius:i=5,centerX:s,centerY:l,offset:c=20,stepPosition:u=.5}){const[d,f,m,p,h]=function({source:e,sourcePosition:t=p1.Bottom,target:n,targetPosition:r=p1.Top,center:a,offset:o,stepPosition:i}){const s=m2[t],l=m2[r],c={x:e.x+s.x*o,y:e.y+s.y*o},u={x:n.x+l.x*o,y:n.y+l.y*o},d=(({source:e,sourcePosition:t=p1.Bottom,target:n})=>t===p1.Left||t===p1.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1})({source:c,sourcePosition:t,target:u}),f=0!==d.x?"x":"y",m=d[f];let p,h,g=[];const w={x:0,y:0},y={x:0,y:0},[,,b,v]=l2({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*l[f]===-1){"x"===f?(p=a.x??c.x+(u.x-c.x)*i,h=a.y??(c.y+u.y)/2):(p=a.x??(c.x+u.x)/2,h=a.y??c.y+(u.y-c.y)*i);const e=[{x:p,y:c.y},{x:p,y:u.y}],t=[{x:c.x,y:h},{x:u.x,y:h}];g=s[f]===m?"x"===f?e:t:"x"===f?t:e}else{const a=[{x:c.x,y:u.y}],i=[{x:u.x,y:c.y}];if(g="x"===f?s.x===m?i:a:s.y===m?a:i,t===r){const t=Math.abs(e[f]-n[f]);if(t<=o){const r=Math.min(o-1,o-t);s[f]===m?w[f]=(c[f]>e[f]?-1:1)*r:y[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){const e="x"===f?"y":"x",t=s[f]===l[e],n=c[e]>u[e],r=c[e]<u[e];(1===s[f]&&(!t&&n||t&&r)||1!==s[f]&&(!t&&r||t&&n))&&(g="x"===f?a:i)}const d={x:c.x+w.x,y:c.y+w.y},b={x:u.x+y.x,y:u.y+y.y};Math.max(Math.abs(d.x-g[0].x),Math.abs(b.x-g[0].x))>=Math.max(Math.abs(d.y-g[0].y),Math.abs(b.y-g[0].y))?(p=(d.x+b.x)/2,h=g[0].y):(p=g[0].x,h=(d.y+b.y)/2)}const x={x:c.x+w.x,y:c.y+w.y},_={x:u.x+y.x,y:u.y+y.y};return[[e,...x.x!==g[0].x||x.y!==g[0].y?[x]:[],...g,..._.x!==g[g.length-1].x||_.y!==g[g.length-1].y?[_]:[],n],p,h,b,v]}({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:o,center:{x:s,y:l},offset:c,stepPosition:u});let g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=h2(d[e-1],d[e],d[e+1],i);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,m,p,h]}function w2(e){return e&&!(!e.internals.handleBounds&&!e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function y2(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,"source"===r.type?t.push(r):"target"===r.type&&n.push(r);return{source:t,target:n}}function b2(e,t,n=p1.Left,r=!1){const a=(t?.x??0)+e.internals.positionAbsolute.x,o=(t?.y??0)+e.internals.positionAbsolute.y,{width:i,height:s}=t??W1(e);if(r)return{x:a+i/2,y:o+s/2};switch(t?.position??n){case p1.Top:return{x:a+i/2,y:o};case p1.Right:return{x:a+i,y:o+s/2};case p1.Bottom:return{x:a+i/2,y:o+s};case p1.Left:return{x:a,y:o+s/2}}}function v2(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function x2(e,t){return e?"string"==typeof e?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`:""}const _2={nodeOrigin:[0,0],nodeExtent:o1,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},E2={..._2,checkEquality:!0};function N2(e,t){const n={...e};for(const e in t)void 0!==t[e]&&(n[e]=t[e]);return n}function M2(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;const n=[],r=[];for(const t of e.handles){const a={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};"source"===t.type?n.push(a):"target"===t.type&&r.push(a)}return{source:n,target:r}}function I2(e){return"manual"===e}function S2(e,t,n,r={}){const a=N2(E2,r),o={i:0},i=new Map(t),s=a?.elevateNodesOnSelect&&!I2(a.zIndexMode)?1e3:0;let l=e.length>0,c=!1;t.clear(),n.clear();for(const u of e){let e=i.get(u.id);if(a.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{const n=b1(u,a.nodeOrigin),r=V1(u.extent)?u.extent:a.nodeExtent,o=N1(n,r,W1(u));e={...a.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:o,handleBounds:M2(u,e),z:j2(u,s,a.zIndexMode),userNode:u}},t.set(u.id,e)}void 0!==e.measured&&void 0!==e.measured.width&&void 0!==e.measured.height||e.hidden||(l=!1),u.parentId&&k2(e,t,n,r,o),c||=u.selected??!1}return{nodesInitialized:l,hasSelectedNodes:c}}function k2(e,t,n,r,a){const{elevateNodesOnSelect:o,nodeOrigin:i,nodeExtent:s,zIndexMode:l}=N2(_2,r),c=e.parentId,u=t.get(c);if(!u)return void console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);!function(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}(e,n),a&&!u.parentId&&void 0===u.internals.rootParentIndex&&"auto"===l&&(u.internals.rootParentIndex=++a.i,u.internals.z=u.internals.z+10*a.i),a&&void 0!==u.internals.rootParentIndex&&(a.i=u.internals.rootParentIndex);const d=o&&!I2(l)?1e3:0,{x:f,y:m,z:p}=function(e,t,n,r,a,o){const{x:i,y:s}=t.internals.positionAbsolute,l=W1(e),c=b1(e,n),u=V1(e.extent)?N1(c,e.extent,l):c;let d=N1({x:i+u.x,y:s+u.y},r,l);"parent"===e.extent&&(d=M1(d,l,t));const f=j2(e,a,o),m=t.internals.z??0;return{x:d.x,y:d.y,z:m>=f?m+1:f}}(e,u,i,s,d,l),{positionAbsolute:h}=e.internals,g=f!==h.x||m!==h.y;(g||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:g?{x:f,y:m}:h,z:p}})}function j2(e,t,n){const r=z1(e.zIndex)?e.zIndex:0;return I2(n)?r:r+(e.selected?t:0)}function D2(e,t,n,r=[0,0]){const a=[],o=new Map;for(const n of e){const e=t.get(n.parentId);if(!e)continue;const r=o.get(n.parentId)?.expandedRect??C1(e),a=T1(r,n.rect);o.set(n.parentId,{expandedRect:a,parent:e})}return o.size>0&&o.forEach(({expandedRect:t,parent:o},i)=>{const s=o.internals.positionAbsolute,l=W1(o),c=o.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(l.width,Math.round(t.width)),m=Math.max(l.height,Math.round(t.height)),p=(f-l.width)*c[0],h=(m-l.height)*c[1];(u>0||d>0||p||h)&&(a.push({id:i,type:"position",position:{x:o.position.x-u+p,y:o.position.y-d+h}}),n.get(i)?.forEach(t=>{e.some(e=>e.id===t.id)||a.push({id:t.id,type:"position",position:{x:t.position.x+u,y:t.position.y+d}})})),(l.width<t.width||l.height<t.height||u||d)&&a.push({id:i,type:"dimensions",setAttributes:!0,dimensions:{width:f+(u?c[0]*u-p:0),height:m+(d?c[1]*d-h:0)}})}),a}function C2(e,t,n,r,a,o){let i=a;const s=r.get(i)||new Map;r.set(i,s.set(n,t)),i=`${a}-${e}`;const l=r.get(i)||new Map;if(r.set(i,l.set(n,t)),o){i=`${a}-${e}-${o}`;const s=r.get(i)||new Map;r.set(i,s.set(n,t))}}function A2(e,t,n){e.clear(),t.clear();for(const r of n){const{source:n,target:a,sourceHandle:o=null,targetHandle:i=null}=r,s={edgeId:r.id,source:n,target:a,sourceHandle:o,targetHandle:i},l=`${n}-${o}--${a}-${i}`;C2("source",s,`${a}-${i}--${n}-${o}`,e,n,o),C2("target",s,l,e,a,i),t.set(r.id,r)}}function T2(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return!!n&&(!!n.selected||T2(n,t))}function O2(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function L2({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){const a=[];for(const[e,o]of t){const t=n.get(e)?.internals.userNode;t&&a.push({...t,position:o.position,dragging:r})}if(!e)return[a[0],a];const o=n.get(e)?.internals.userNode;return[o?{...o,position:t.get(e)?.position||o.position,dragging:r}:a[0],a]}function z2(e,t,n,r,a,o=!1){const i=r.get(e);if(!i)return null;const s="strict"===a?i.internals.handleBounds?.[t]:[...i.internals.handleBounds?.source??[],...i.internals.handleBounds?.target??[]],l=(n?s?.find(e=>e.id===n):s?.[0])??null;return l&&o?{...l,...b2(i,l,l.position,!0)}:l}function P2(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}const R2=()=>!0;function U2(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:o,doc:i,lib:s,flowId:l,isValidConnection:c=R2,nodeLookup:u}){const d="target"===o,f=t?i.querySelector(`.${s}-flow__handle[data-id="${l}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:m,y:p}=n2(e),h=i.elementFromPoint(m,p),g=h?.classList.contains(`${s}-flow__handle`)?h:f,w={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){const e=P2(void 0,g),t=g.getAttribute("data-nodeid"),o=g.getAttribute("data-handleid"),i=g.classList.contains("connectable"),s=g.classList.contains("connectableend");if(!t||!e)return w;const l={source:d?t:r,sourceHandle:d?o:a,target:d?r:t,targetHandle:d?a:o};w.connection=l;const f=i&&s&&(n===l1.Strict?d&&"source"===e||!d&&"target"===e:t!==r||o!==a);w.isValid=f&&c(l),w.toHandle=z2(t,e,o,u,n,!0)}return w}const B2={onPointerDown:function(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:o,isTarget:i,domNode:s,nodeLookup:l,lib:c,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:m,onConnectStart:p,onConnect:h,onConnectEnd:g,isValidConnection:w=R2,onReconnectEnd:y,updateConnection:b,getTransform:v,getFromHandle:x,autoPanSpeed:_,dragThreshold:E=1,handleDomNode:N}){const M=J1(e.target);let I,S=0;const{x:k,y:j}=n2(e),D=P2(o,N),C=s?.getBoundingClientRect();let A=!1;if(!C||!D)return;const T=z2(a,D,r,l,t);if(!T)return;let O=n2(e,C),L=!1,z=null,P=!1,R=null;function U(){if(!u||!C)return;const[e,t]=S1(O,C,_);f({x:e,y:t}),S=requestAnimationFrame(U)}const B={...T,nodeId:a,type:D,position:T.position},F=l.get(a);let Y={inProgress:!0,isValid:null,from:b2(F,B,p1.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:F,to:O,toHandle:null,toPosition:h1[B.position],toNode:null,pointer:O};function Q(){A=!0,b(Y),p?.(e,{nodeId:a,handleId:r,handleType:D})}function V(e){if(!A){const{x:t,y:n}=n2(e),r=t-k,a=n-j;if(!(r*r+a*a>E*E))return;Q()}if(!x()||!B)return void W(e);const o=v();O=n2(e,C),I=function(e,t,n,r){let a=[],o=1/0;const i=function(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:2*n,height:2*n};for(const e of t.values())O1(a,C1(e))>0&&r.push(e);return r}(e,n,t+250);for(const n of i){const i=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(const s of i){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;const{x:i,y:l}=b2(n,s,s.position,!0),c=Math.sqrt(Math.pow(i-e.x,2)+Math.pow(l-e.y,2));c>t||(c<o?(a=[{...s,x:i,y:l}],o=c):c===o&&a.push({...s,x:i,y:l}))}}if(!a.length)return null;if(a.length>1){const e="source"===r.type?"target":"source";return a.find(t=>t.type===e)??a[0]}return a[0]}(U1(O,o,!1,[1,1]),n,l,B),L||(U(),L=!0);const s=U2(e,{handle:I,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:i?"target":"source",isValidConnection:w,doc:M,lib:c,flowId:d,nodeLookup:l});R=s.handleDomNode,z=s.connection,P=function(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}(!!I,s.isValid);const u=l.get(a),f=u?b2(u,B,p1.Left,!0):Y.from,m={...Y,from:f,isValid:P,to:s.toHandle&&P?B1({x:s.toHandle.x,y:s.toHandle.y},o):O,toHandle:s.toHandle,toPosition:P&&s.toHandle?s.toHandle.position:h1[B.position],toNode:s.toHandle?l.get(s.toHandle.nodeId):null,pointer:O};b(m),Y=m}function W(e){if(!("touches"in e&&e.touches.length>0)){if(A){(I||R)&&z&&P&&h?.(z);const{inProgress:t,...n}=Y,r={...n,toPosition:Y.toHandle?Y.toPosition:null};g?.(e,r),o&&y?.(e,r)}m(),cancelAnimationFrame(S),L=!1,P=!1,z=null,R=null,M.removeEventListener("mousemove",V),M.removeEventListener("mouseup",W),M.removeEventListener("touchmove",V),M.removeEventListener("touchend",W)}}0===E&&Q(),M.addEventListener("mousemove",V),M.addEventListener("mouseup",W),M.addEventListener("touchmove",V),M.addEventListener("touchend",W)},isValid:U2},F2=e=>({x:e.x,y:e.y,zoom:e.k}),Y2=({x:e,y:t,zoom:n})=>H0.translate(e,t).scale(n),Q2=(e,t)=>e.target.closest(`.${t}`),V2=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),W2=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Z2=(e,t=0,n=W2,r=()=>{})=>{const a="number"==typeof t&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},G2=e=>{const t=e.ctrlKey&&Q1()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t};function H2({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:o,onPanZoomStart:i,onPanZoomEnd:s,onDraggingChange:l}){const c={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=a1().scaleExtent([t,n]).translateExtent(r),f=IK(e).call(d);w({x:a.x,y:a.y,zoom:E1(a.zoom,t,n)},[[0,0],[u.width,u.height]],r);const m=f.on("wheel.zoom"),p=f.on("dblclick.zoom");function h(e,t){return f?new Promise(n=>{d?.interpolate("linear"===t?.interpolate?I_:YK).transform(Z2(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)}function g(){d.on("zoom",null)}async function w(e,t,n){const r=Y2(e),a=d?.constrain()(r,t,n);return a&&await h(a),new Promise(e=>e(a))}return d.wheelDelta(G2),{update:function({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:a,panOnDrag:u,panOnScrollMode:h,panOnScrollSpeed:w,preventScrolling:y,zoomOnPinch:b,zoomOnScroll:v,zoomOnDoubleClick:x,zoomActivationKeyPressed:_,lib:E,onTransformChange:N,connectionInProgress:M,paneClickDistance:I,selectionOnDrag:S}){r&&!c.isZoomingOrPanning&&g();const k=a&&!_&&!r;d.clickDistance(S?1/0:!z1(I)||I<0?0:I);const j=k?function({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:o,zoomOnPinch:i,onPanZoomStart:s,onPanZoom:l,onPanZoomEnd:c}){return u=>{if(Q2(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(u.ctrlKey&&i){const e=SK(u),t=G2(u),a=d*Math.pow(2,t);return void r.scaleTo(n,a,e,u)}const f=1===u.deltaMode?20:1;let m=a===c1.Vertical?0:u.deltaX*f,p=a===c1.Horizontal?0:u.deltaY*f;!Q1()&&u.shiftKey&&a!==c1.Vertical&&(m=u.deltaY*f,p=0),r.translateBy(n,-m/d*o,-p/d*o,{internal:!0});const h=F2(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(l?.(u,h),e.panScrollTimeout=setTimeout(()=>{c?.(u,h),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,s?.(u,h))}}({zoomPanValues:c,noWheelClassName:e,d3Selection:f,d3Zoom:d,panOnScrollMode:h,panOnScrollSpeed:w,zoomOnPinch:b,onPanZoomStart:i,onPanZoom:o,onPanZoomEnd:s}):function({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const o="wheel"===r.type,i=!t&&o&&!r.ctrlKey,s=Q2(r,e);if(r.ctrlKey&&o&&s&&r.preventDefault(),i||s)return null;r.preventDefault(),n.call(this,r,a)}}({noWheelClassName:e,preventScrolling:y,d3ZoomHandler:m});if(f.on("wheel.zoom",j,{passive:!1}),!r){const e=function({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;const a=F2(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=a,"mousedown"===r.sourceEvent?.type&&t(!0),n&&n?.(r.sourceEvent,a)}}({zoomPanValues:c,onDraggingChange:l,onPanZoomStart:i});d.on("start",e);const t=function({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return o=>{e.usedRightMouseButton=!(!n||!V2(t,e.mouseButton??0)),o.sourceEvent?.sync||r([o.transform.x,o.transform.y,o.transform.k]),a&&!o.sourceEvent?.internal&&a?.(o.sourceEvent,F2(o.transform))}}({zoomPanValues:c,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:o,onTransformChange:N});d.on("zoom",t);const r=function({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:o}){return i=>{if(!i.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,o&&V2(t,e.mouseButton??0)&&!e.usedRightMouseButton&&i.sourceEvent&&o(i.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const t=F2(i.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a?.(i.sourceEvent,t)},n?150:0)}}}({zoomPanValues:c,panOnDrag:u,panOnScroll:a,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:l});d.on("end",r)}const D=function({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:i,noWheelClassName:s,noPanClassName:l,lib:c,connectionInProgress:u}){return d=>{const f=e||t,m=n&&d.ctrlKey,p="wheel"===d.type;if(1===d.button&&"mousedown"===d.type&&(Q2(d,`${c}-flow__node`)||Q2(d,`${c}-flow__edge`)))return!0;if(!(r||f||a||o||n))return!1;if(i)return!1;if(u&&!p)return!1;if(Q2(d,s)&&p)return!1;if(Q2(d,l)&&(!p||a&&p&&!e))return!1;if(!n&&d.ctrlKey&&p)return!1;if(!n&&"touchstart"===d.type&&d.touches?.length>1)return d.preventDefault(),!1;if(!f&&!a&&!m&&p)return!1;if(!r&&("mousedown"===d.type||"touchstart"===d.type))return!1;if(Array.isArray(r)&&!r.includes(d.button)&&"mousedown"===d.type)return!1;const h=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||p)&&h}}({zoomActivationKeyPressed:_,panOnDrag:u,zoomOnScroll:v,panOnScroll:a,zoomOnDoubleClick:x,zoomOnPinch:b,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:E,connectionInProgress:M});d.filter(D),x?f.on("dblclick.zoom",p):f.on("dblclick.zoom",null)},destroy:g,setViewport:async function(e,t){const n=Y2(e);return await h(n,t),new Promise(e=>e(n))},setViewportConstrained:w,getViewport:function(){const e=f?$0(f.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}},scaleTo:function(e,t){return f?new Promise(n=>{d?.interpolate("linear"===t?.interpolate?I_:YK).scaleTo(Z2(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},scaleBy:function(e,t){return f?new Promise(n=>{d?.interpolate("linear"===t?.interpolate?I_:YK).scaleBy(Z2(f,t?.duration,t?.ease,()=>n(!0)),e)}):Promise.resolve(!1)},setScaleExtent:function(e){d?.scaleExtent(e)},setTranslateExtent:function(e){d?.translateExtent(e)},syncViewport:function(e){if(f){const t=Y2(e),n=f.property("__zoom");n.k===e.zoom&&n.x===e.x&&n.y===e.y||d?.transform(f,t,null,{sync:!0})}},setClickDistance:function(e){const t=!z1(e)||e<0?0:e;d?.clickDistance(t)}}}var $2;function X2(e){return{isHorizontal:e.includes("right")||e.includes("left"),isVertical:e.includes("bottom")||e.includes("top"),affectsX:e.includes("left"),affectsY:e.includes("top")}}function q2(e,t){return Math.max(0,t-e)}function J2(e,t){return Math.max(0,e-t)}function K2(e,t,n){return Math.max(0,t-e,e-n)}function e4(e,t){return e?!t:t}!function(e){e.Line="line",e.Handle="handle"}($2||($2={}));const t4={width:0,height:0,x:0,y:0},n4={...t4,pointerX:0,pointerY:0,aspectRatio:1};function r4(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,o=e.measured.width??0,i=e.measured.height??0,s=n[0]*o,l=n[1]*i;return[[r-s,a-l],[r+o-s,a+i-l]]}function a4(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,r=0;r<e.length;r++)""!==(n=a4(e[r]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var o4=a(9242);const i4=e=>{let t;const n=new Set,r=(e,r)=>{const a="function"==typeof e?e(t):e;if(!Object.is(a,t)){const e=t;t=(null!=r?r:"object"!=typeof a||null===a)?a:Object.assign({},t,a),n.forEach(n=>n(t,e))}},a=()=>t,o={setState:r,getState:a,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},i=t=e(r,a,o);return o},{useDebugValue:s4}=i,{useSyncExternalStoreWithSelector:l4}=o4,c4=e=>e;function u4(e,t=c4,n){const r=l4(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return s4(r),r}const d4=(e,t)=>{const n=(e=>e?i4(e):i4)(e),r=(e,r=t)=>u4(n,e,r);return Object.assign(r,n),r};function f4(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const m4=(0,i.createContext)(null),p4=m4.Provider,h4="[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001";function g4(e,t){const n=(0,i.useContext)(m4);if(null===n)throw new Error(h4);return u4(n,e,t)}function w4(){const e=(0,i.useContext)(m4);if(null===e)throw new Error(h4);return(0,i.useMemo)(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const y4={display:"none"},b4={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},v4="react-flow__node-desc",x4="react-flow__edge-desc",_4=e=>e.ariaLiveMessage,E4=e=>e.ariaLabelConfig;function N4({rfId:e}){const t=g4(_4);return(0,P.jsx)("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:b4,children:t})}function M4({rfId:e,disableKeyboardA11y:t}){const n=g4(E4);return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{id:`${v4}-${e}`,style:y4,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),(0,P.jsx)("div",{id:`${x4}-${e}`,style:y4,children:n["edge.a11yDescription.default"]}),!t&&(0,P.jsx)(N4,{rfId:e})]})}const I4=(0,i.forwardRef)(({position:e="top-left",children:t,className:n,style:r,...a},o)=>{const i=`${e}`.split("-");return(0,P.jsx)("div",{className:a4(["react-flow__panel",n,...i]),style:r,ref:o,...a,children:t})});function S4({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:(0,P.jsx)(I4,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:(0,P.jsx)("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}I4.displayName="Panel";const k4=e=>{const t=[],n=[];for(const[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(const[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},j4=e=>e.id;function D4(e,t){return f4(e.selectedNodes.map(j4),t.selectedNodes.map(j4))&&f4(e.selectedEdges.map(j4),t.selectedEdges.map(j4))}function C4({onSelectionChange:e}){const t=w4(),{selectedNodes:n,selectedEdges:r}=g4(k4,D4);return(0,i.useEffect)(()=>{const a={nodes:n,edges:r};e?.(a),t.getState().onSelectionChangeHandlers.forEach(e=>e(a))},[n,r,e]),null}const A4=e=>!!e.onSelectionChangeHandlers;function T4({onSelectionChange:e}){const t=g4(A4);return e||t?(0,P.jsx)(C4,{onSelectionChange:e}):null}const O4="undefined"!=typeof window?i.useLayoutEffect:i.useEffect,L4=[0,0],z4={x:0,y:0,zoom:1},P4=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode","rfId"],R4=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),U4={translateExtent:o1,nodeOrigin:L4,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function B4(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:o,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:c}=g4(R4,f4),u=w4();O4(()=>(c(e.defaultNodes,e.defaultEdges),()=>{d.current=U4,l()}),[]);const d=(0,i.useRef)(U4);return O4(()=>{for(const i of P4){const l=e[i];l!==d.current[i]&&void 0!==e[i]&&("nodes"===i?t(l):"edges"===i?n(l):"minZoom"===i?r(l):"maxZoom"===i?a(l):"translateExtent"===i?o(l):"nodeExtent"===i?s(l):"ariaLabelConfig"===i?u.setState({ariaLabelConfig:$1(l)}):"fitView"===i?u.setState({fitViewQueued:l}):"fitViewOptions"===i?u.setState({fitViewOptions:l}):u.setState({[i]:l}))}d.current=e},P4.map(t=>e[t])),null}function F4(){return"undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null}const Y4="undefined"!=typeof document?document:null;function Q4(e=null,t={target:Y4,actInsideInputWithModifier:!0}){const[n,r]=(0,i.useState)(!1),a=(0,i.useRef)(!1),o=(0,i.useRef)(new Set([])),[s,l]=(0,i.useMemo)(()=>{if(null!==e){const t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.replace("+","\n").replace("\n\n","\n+").split("\n")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return(0,i.useEffect)(()=>{const n=t?.target??Y4,i=t?.actInsideInputWithModifier??!0;if(null!==e){const e=e=>{if(a.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!a.current||a.current&&!i)&&e2(e))return!1;const n=W4(e.code,l);if(o.current.add(e[n]),V4(s,o.current,!1)){const n=e.composedPath?.()?.[0]||e.target,o="BUTTON"===n?.nodeName||"A"===n?.nodeName;!1===t.preventDefault||!a.current&&o||e.preventDefault(),r(!0)}},c=e=>{const t=W4(e.code,l);V4(s,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(e[t]),"Meta"===e.key&&o.current.clear(),a.current=!1},u=()=>{o.current.clear(),r(!1)};return n?.addEventListener("keydown",e),n?.addEventListener("keyup",c),window.addEventListener("blur",u),window.addEventListener("contextmenu",u),()=>{n?.removeEventListener("keydown",e),n?.removeEventListener("keyup",c),window.removeEventListener("blur",u),window.removeEventListener("contextmenu",u)}}},[e,r]),n}function V4(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function W4(e,t){return t.includes(e)?"code":"key"}function Z4(e,t){const n=[],r=new Map,a=[];for(const t of e)if("add"!==t.type)if("remove"===t.type||"replace"===t.type)r.set(t.id,[t]);else{const e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}else a.push(t);for(const e of t){const t=r.get(e.id);if(!t){n.push(e);continue}if("remove"===t[0].type)continue;if("replace"===t[0].type){n.push({...t[0].item});continue}const a={...e};for(const e of t)G4(e,a);n.push(a)}return a.length&&a.forEach(e=>{void 0!==e.index?n.splice(e.index,0,{...e.item}):n.push({...e.item})}),n}function G4(e,t){switch(e.type){case"select":t.selected=e.selected;break;case"position":void 0!==e.position&&(t.position=e.position),void 0!==e.dragging&&(t.dragging=e.dragging);break;case"dimensions":void 0!==e.dimensions&&(t.measured={...e.dimensions},e.setAttributes&&(!0!==e.setAttributes&&"width"!==e.setAttributes||(t.width=e.dimensions.width),!0!==e.setAttributes&&"height"!==e.setAttributes||(t.height=e.dimensions.height))),"boolean"==typeof e.resizing&&(t.resizing=e.resizing)}}function H4(e,t){return Z4(e,t)}function $4(e,t){return Z4(e,t)}function X4(e,t){return{id:e,type:"select",selected:t}}function q4(e,t=new Set,n=!1){const r=[];for(const[a,o]of e){const e=t.has(a);void 0===o.selected&&!e||o.selected===e||(n&&(o.selected=e),r.push(X4(o.id,e)))}return r}function J4({items:e=[],lookup:t}){const n=[],r=new Map(e.map(e=>[e.id,e]));for(const[r,a]of e.entries()){const e=t.get(a.id),o=e?.internals?.userNode??e;void 0!==o&&o!==a&&n.push({id:a.id,item:a,type:"replace"}),void 0===o&&n.push({item:a,type:"add",index:r})}for(const[e]of t)void 0===r.get(e)&&n.push({id:e,type:"remove"});return n}function K4(e){return{id:e.id,type:"remove"}}const e5=e=>(e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e))(e);function t5(e){return(0,i.forwardRef)(e)}function n5(e){const[t,n]=(0,i.useState)(BigInt(0)),[r]=(0,i.useState)(()=>function(){let e=[];return{get:()=>e,reset:()=>{e=[]},push:t=>{e.push(t),n(e=>e+BigInt(1))}}}());return O4(()=>{const t=r.get();t.length&&(e(t),r.reset())},[t]),r}const r5=(0,i.createContext)(null);function a5({children:e}){const t=w4(),n=(0,i.useCallback)(e=>{const{nodes:n=[],setNodes:r,hasDefaultNodes:a,onNodesChange:o,nodeLookup:i,fitViewQueued:s,onNodesChangeMiddlewareMap:l}=t.getState();let c=n;for(const t of e)c="function"==typeof t?t(c):t;let u=J4({items:c,lookup:i});for(const e of l.values())u=e(u);a&&r(c),u.length>0?o?.(u):s&&window.requestAnimationFrame(()=>{const{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[]),r=n5(n),a=(0,i.useCallback)(e=>{const{edges:n=[],setEdges:r,hasDefaultEdges:a,onEdgesChange:o,edgeLookup:i}=t.getState();let s=n;for(const t of e)s="function"==typeof t?t(s):t;a?r(s):o&&o(J4({items:s,lookup:i}))},[]),o=n5(a),s=(0,i.useMemo)(()=>({nodeQueue:r,edgeQueue:o}),[]);return(0,P.jsx)(r5.Provider,{value:s,children:e})}const o5=e=>!!e.panZoom;function i5(){const e=(()=>{const e=w4();return(0,i.useMemo)(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,o],panZoom:i}=e.getState();return i?(await i.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??o},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:o,maxZoom:i,panZoom:s}=e.getState(),l=Y1(t,r,a,o,i,n?.padding??.1);return s?(await s.setViewport(l,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:o,domNode:i}=e.getState();if(!i)return t;const{x:s,y:l}=i.getBoundingClientRect(),c={x:t.x-s,y:t.y-l},u=n.snapGrid??a,d=n.snapToGrid??o;return U1(c,r,d,u)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:o}=r.getBoundingClientRect(),i=B1(t,n);return{x:i.x+a,y:i.y+o}}}),[])})(),t=w4(),n=function(){const e=(0,i.useContext)(r5);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}(),r=g4(o5),a=(0,i.useMemo)(()=>{const e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},a=e=>{n.edgeQueue.push(e)},o=e=>{const{nodeLookup:n,nodeOrigin:r}=t.getState(),a=e5(e)?e:n.get(e.id),o=a.parentId?G1(a.position,a.measured,a.parentId,n,r):a.position,i={...a,position:o,width:a.measured?.width??a.width,height:a.measured?.height??a.height};return C1(i)},i=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){const e="function"==typeof t?t(r):t;return n.replace&&e5(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{a(r=>r.map(r=>{if(r.id===e){const e="function"==typeof t?t(r):t;return n.replace&&w1(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{const{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:a,addNodes:e=>{const t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{const t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{const{nodes:e=[],edges:n=[],transform:r}=t.getState(),[a,o,i]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:a,y:o,zoom:i}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{const{nodes:r,edges:a,onNodesDelete:o,onEdgesDelete:i,triggerNodeChanges:s,triggerEdgeChanges:l,onDelete:c,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await async function({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const o=new Set(e.map(e=>e.id)),i=[];for(const e of n){if(!1===e.deletable)continue;const t=o.has(e.id),n=!t&&e.parentId&&i.find(t=>t.id===e.parentId);(t||n)&&i.push(e)}const s=new Set(t.map(e=>e.id)),l=r.filter(e=>!1!==e.deletable),c=((e,t)=>{const n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))})(i,l),u=c;for(const e of l)s.has(e.id)&&!u.find(t=>t.id===e.id)&&u.push(e);if(!a)return{edges:u,nodes:i};const d=await a({nodes:i,edges:u});return"boolean"==typeof d?d?{edges:u,nodes:i}:{edges:[],nodes:[]}:d}({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:a,onBeforeDelete:u}),m=f.length>0,p=d.length>0;if(m){const e=f.map(K4);i?.(f),l(e)}if(p){const e=d.map(K4);o?.(d),s(e)}return(p||m)&&c?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{const a=L1(e),i=a?e:o(e),s=void 0!==r;return i?(r||t.getState().nodes).filter(r=>{const o=t.getState().nodeLookup.get(r.id);if(o&&!a&&(r.id===e.id||!o.internals.positionAbsolute))return!1;const l=C1(s?r:o),c=O1(l,i);return n&&c>0||c>=l.width*l.height||c>=i.width*i.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{const r=L1(e)?e:o(e);if(!r)return!1;const a=O1(r,t);return n&&a>0||a>=t.width*t.height||a>=r.width*r.height},updateNode:i,updateNodeData:(e,t,n={replace:!1})=>{i(e,e=>{const r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{const r="function"==typeof t?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{const{nodeLookup:n,nodeOrigin:r}=t.getState();return((e,t={nodeOrigin:[0,0]})=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce((e,n)=>{const r="string"==typeof n;let a=t.nodeLookup||r?void 0:n;t.nodeLookup&&(a=r?t.nodeLookup.get(n):y1(n)?n:t.nodeLookup.get(n.id));const o=a?A1(a,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return k1(e,o)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return D1(n)})(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:""}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:""}`)?.values()??[]),fitView:async e=>{const r=t.getState().fitViewResolver??function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return(0,i.useMemo)(()=>({...a,...e,viewportInitialized:r}),[r])}const s5=e=>e.selected,l5="undefined"!=typeof window?window:void 0,c5={position:"absolute",width:"100%",height:"100%",top:0,left:0},u5=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function d5({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:o=c1.Free,zoomOnDoubleClick:s=!0,panOnDrag:l=!0,defaultViewport:c,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:m,preventScrolling:p=!0,children:h,noWheelClassName:g,noPanClassName:w,onViewportChange:y,isControlledViewport:b,paneClickDistance:v,selectionOnDrag:x}){const _=w4(),E=(0,i.useRef)(null),{userSelectionActive:N,lib:M,connectionInProgress:I}=g4(u5,f4),S=Q4(m),k=(0,i.useRef)();!function(e){const t=w4();(0,i.useEffect)(()=>{const n=()=>{if(!e.current||!(e.current.checkVisibility?.()??1))return!1;const n=q1(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004","The React Flow parent container needs a width and a height to render the graph."),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener("resize",n);const t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener("resize",n),t&&e.current&&t.unobserve(e.current)}}},[])}(E);const j=(0,i.useCallback)(e=>{y?.({x:e[0],y:e[1],zoom:e[2]}),b||_.setState({transform:e})},[y,b]);return(0,i.useEffect)(()=>{if(E.current){k.current=H2({domNode:E.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:c,onDraggingChange:e=>_.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{const{onViewportChangeStart:n,onMoveStart:r}=_.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{const{onViewportChange:n,onMove:r}=_.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{const{onViewportChangeEnd:n,onMoveEnd:r}=_.getState();r?.(e,t),n?.(t)}});const{x:e,y:t,zoom:n}=k.current.getViewport();return _.setState({panZoom:k.current,transform:[e,t,n],domNode:E.current.closest(".react-flow")}),()=>{k.current?.destroy()}}},[]),(0,i.useEffect)(()=>{k.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:l,zoomActivationKeyPressed:S,preventScrolling:p,noPanClassName:w,userSelectionActive:N,noWheelClassName:g,lib:M,onTransformChange:j,connectionInProgress:I,selectionOnDrag:x,paneClickDistance:v})},[e,t,n,r,a,o,s,l,S,p,w,N,g,M,j,I,x,v]),(0,P.jsx)("div",{className:"react-flow__renderer",ref:E,style:c5,children:h})}const f5=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function m5(){const{userSelectionActive:e,userSelectionRect:t}=g4(f5,f4);return e&&t?(0,P.jsx)("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const p5=(e,t)=>n=>{n.target===t.current&&e?.(n)},h5=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function g5({isSelecting:e,selectionKeyPressed:t,selectionMode:n=u1.Full,panOnDrag:r,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:m,onPaneMouseLeave:p,children:h}){const g=w4(),{userSelectionActive:w,elementsSelectable:y,dragging:b,connectionInProgress:v}=g4(h5,f4),x=y&&(e||w),_=(0,i.useRef)(null),E=(0,i.useRef)(),N=(0,i.useRef)(new Set),M=(0,i.useRef)(new Set),I=(0,i.useRef)(!1),S=e=>{I.current||v?I.current=!1:(c?.(e),g.getState().resetSelectedElements(),g.setState({nodesSelectionActive:!1}))},k=d?e=>d(e):void 0,j=!0===r||Array.isArray(r)&&r.includes(0);return(0,P.jsxs)("div",{className:a4(["react-flow__pane",{draggable:j,dragging:b,selection:e}]),onClick:x?void 0:p5(S,_),onContextMenu:p5(e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():u?.(e)},_),onWheel:p5(k,_),onPointerEnter:x?void 0:f,onPointerMove:x?e=>{const{userSelectionRect:r,transform:o,nodeLookup:i,edgeLookup:l,connectionLookup:c,triggerNodeChanges:u,triggerEdgeChanges:d,defaultEdgeOptions:f,resetSelectedElements:m}=g.getState();if(!E.current||!r)return;const{x:p,y:h}=n2(e.nativeEvent,E.current),{startX:w,startY:y}=r;if(!I.current){const n=t?0:a;if(Math.hypot(p-w,h-y)<=n)return;m(),s?.(e)}I.current=!0;const b={startX:w,startY:y,x:p<w?p:w,y:h<y?h:y,width:Math.abs(p-w),height:Math.abs(h-y)},v=N.current,x=M.current;N.current=new Set(x1(i,b,o,n===u1.Partial,!0).map(e=>e.id)),M.current=new Set;const _=f?.selectable??!0;for(const e of N.current){const t=c.get(e);if(t)for(const{edgeId:e}of t.values()){const t=l.get(e);t&&(t.selectable??_)&&M.current.add(e)}}H1(v,N.current)||u(q4(i,N.current,!0)),H1(x,M.current)||d(q4(l,M.current)),g.setState({userSelectionRect:b,userSelectionActive:!0,nodesSelectionActive:!1})}:m,onPointerUp:x?e=>{0===e.button&&(e.target?.releasePointerCapture?.(e.pointerId),!w&&e.target===_.current&&g.getState().userSelectionRect&&S?.(e),g.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(l?.(e),g.setState({nodesSelectionActive:N.current.size>0})))}:void 0,onPointerDownCapture:x?n=>{const{domNode:r}=g.getState();if(E.current=r?.getBoundingClientRect(),!E.current)return;const a=n.target===_.current;if(!a&&n.target.closest(".nokey")||!e||!(o&&a||t)||0!==n.button||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),I.current=!1;const{x:i,y:s}=n2(n.nativeEvent,E.current);g.setState({userSelectionRect:{width:0,height:0,startX:i,startY:s,x:i,y:s}}),a||(n.stopPropagation(),n.preventDefault())}:void 0,onClickCapture:x?e=>{I.current&&(e.stopPropagation(),I.current=!1)}:void 0,onPointerLeave:p,ref:_,style:c5,children:[h,(0,P.jsx)(m5,{})]})}function w5({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:o,multiSelectionActive:i,nodeLookup:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(o({nodes:[c],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):a([e])):l?.("012",(e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`)(e))}function y5({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:o,nodeClickDistance:s}){const l=w4(),[c,u]=(0,i.useState)(!1),d=(0,i.useRef)();return(0,i.useEffect)(()=>{d.current=function({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let o={x:null,y:null},i=0,s=new Map,l=!1,c={x:0,y:0},u=null,d=!1,f=null,m=!1,p=!1,h=null;return{update:function({noDragClassName:g,handleSelector:w,domNode:y,isSelectable:b,nodeId:v,nodeClickDistance:x=0}){function _({x:e,y:n}){const{nodeLookup:a,nodeExtent:i,snapGrid:l,snapToGrid:c,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:m,updateNodePositions:g}=t();o={x:e,y:n};let w=!1;const y=s.size>1,b=y&&i?j1(v1(s)):null,x=y&&c?function({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const o={x:n-a.distance.x,y:r-a.distance.y},i=R1(o,t);return{x:i.x-o.x,y:i.y-o.y}}({dragItems:s,snapGrid:l,x:e,y:n}):null;for(const[t,r]of s){if(!a.has(t))continue;let o={x:e-r.distance.x,y:n-r.distance.y};c&&(o=x?{x:Math.round(o.x+x.x),y:Math.round(o.y+x.y)}:R1(o,l));let s=null;if(y&&i&&!r.extent&&b){const{positionAbsolute:e}=r.internals,t=e.x-b.x+i[0][0],n=e.x+r.measured.width-b.x2+i[1][0];s=[[t,e.y-b.y+i[0][1]],[n,e.y+r.measured.height-b.y2+i[1][1]]]}const{position:d,positionAbsolute:f}=_1({nodeId:t,nextPosition:o,nodeLookup:a,nodeExtent:s||i,nodeOrigin:u,onError:m});w=w||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(p=p||w,w&&(g(s,!0),h&&(r||d||!v&&f))){const[e,t]=L2({nodeId:v,dragItems:s,nodeLookup:a});r?.(h,s,e,t),d?.(h,e,t),v||f?.(h,t)}}async function E(){if(!u)return;const{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:a}=t();if(!a)return l=!1,void cancelAnimationFrame(i);const[s,d]=S1(c,u,r);0===s&&0===d||(o.x=(o.x??0)-s/e[2],o.y=(o.y??0)-d/e[2],await n({x:s,y:d})&&_(o)),i=requestAnimationFrame(E)}function N(r){const{nodeLookup:a,multiSelectionActive:i,nodesDraggable:l,transform:c,snapGrid:f,snapToGrid:m,selectNodesOnDrag:p,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:w}=t();d=!0,p&&b||i||!v||a.get(v)?.selected||w(),b&&p&&v&&e?.(v);const y=X1(r.sourceEvent,{transform:c,snapGrid:f,snapToGrid:m,containerBounds:u});if(o=y,s=function(e,t,n,r){const a=new Map;for(const[o,i]of e)if((i.selected||i.id===r)&&(!i.parentId||!T2(i,e))&&(i.draggable||t&&void 0===i.draggable)){const t=e.get(o);t&&a.set(o,{id:o,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return a}(a,l,y,v),s.size>0&&(n||h||!v&&g)){const[e,t]=L2({nodeId:v,dragItems:s,nodeLookup:a});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),v||g?.(r.sourceEvent,t)}}f=IK(y);const M=BK().clickDistance(x).on("start",e=>{const{domNode:n,nodeDragThreshold:r,transform:a,snapGrid:i,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,m=!1,p=!1,h=e.sourceEvent,0===r&&N(e);const l=X1(e.sourceEvent,{transform:a,snapGrid:i,snapToGrid:s,containerBounds:u});o=l,c=n2(e.sourceEvent,u)}).on("drag",e=>{const{autoPanOnNodeDrag:n,transform:r,snapGrid:a,snapToGrid:i,nodeDragThreshold:f,nodeLookup:p}=t(),g=X1(e.sourceEvent,{transform:r,snapGrid:a,snapToGrid:i,containerBounds:u});if(h=e.sourceEvent,("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1||v&&!p.has(v))&&(m=!0),!m){if(!l&&n&&d&&(l=!0,E()),!d){const t=n2(e.sourceEvent,u),n=t.x-c.x,r=t.y-c.y;Math.sqrt(n*n+r*r)>f&&N(e)}(o.x!==g.xSnapped||o.y!==g.ySnapped)&&s&&d&&(c=n2(e.sourceEvent,u),_(g))}}).on("end",e=>{if(d&&!m&&(l=!1,d=!1,cancelAnimationFrame(i),s.size>0)){const{nodeLookup:n,updateNodePositions:r,onNodeDragStop:o,onSelectionDragStop:i}=t();if(p&&(r(s,!1),p=!1),a||o||!v&&i){const[t,r]=L2({nodeId:v,dragItems:s,nodeLookup:n,dragging:!1});a?.(e.sourceEvent,s,t,r),o?.(e.sourceEvent,t,r),v||i?.(e.sourceEvent,r)}}}).filter(e=>{const t=e.target;return!e.button&&(!g||!O2(t,`.${g}`,y))&&(!w||O2(t,w,y))});f.call(M)},destroy:function(){f?.on(".drag",null)}}}({getStoreItems:()=>l.getState(),onNodeMouseDown:t=>{w5({id:t,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}})},[]),(0,i.useEffect)(()=>{if(!t&&e.current&&d.current)return d.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:a,nodeClickDistance:s}),()=>{d.current?.destroy()}},[n,r,t,o,e,a,s]),c}function b5(){const e=w4(),t=(0,i.useCallback)(t=>{const{nodeExtent:n,snapToGrid:r,snapGrid:a,nodesDraggable:o,onError:i,updateNodePositions:s,nodeLookup:l,nodeOrigin:c}=e.getState(),u=new Map,d=(e=>t=>t.selected&&(t.draggable||e&&void 0===t.draggable))(o),f=r?a[0]:5,m=r?a[1]:5,p=t.direction.x*f*t.factor,h=t.direction.y*m*t.factor;for(const[,e]of l){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+p,y:e.internals.positionAbsolute.y+h};r&&(t=R1(t,a));const{position:o,positionAbsolute:s}=_1({nodeId:e.id,nextPosition:t,nodeLookup:l,nodeExtent:n,nodeOrigin:c,onError:i});e.position=o,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[]);return t}const v5=(0,i.createContext)(null),x5=v5.Provider;v5.Consumer;const _5=()=>(0,i.useContext)(v5),E5=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),N5=(0,i.memo)(t5(function({type:e="source",position:t=p1.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:o=!0,id:i,onConnect:s,children:l,className:c,onMouseDown:u,onTouchStart:d,...f},m){const p=i||null,h="target"===e,g=w4(),w=_5(),{connectOnClick:y,noPanClassName:b,rfId:v}=g4(E5,f4),{connectingFrom:x,connectingTo:_,clickConnecting:E,isPossibleEndHandle:N,connectionInProcess:M,clickConnectionInProcess:I,valid:S}=g4(((e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:o,connection:i}=r,{fromHandle:s,toHandle:l,isValid:c}=i,u=l?.nodeId===e&&l?.id===t&&l?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:a?.nodeId===e&&a?.id===t&&a?.type===n,isPossibleEndHandle:o===l1.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!a,valid:u&&c}})(w,p,e),f4);w||g.getState().onError?.("010","Handle: No node id found. Make sure to only use a Handle inside a custom Node.");const k=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=g.getState(),a={...t,...e};if(r){const{edges:e,setEdges:t}=g.getState();t(d2(a,e))}n?.(a),s?.(a)},j=e=>{if(!w)return;const t=t2(e.nativeEvent);if(a&&(t&&0===e.button||!t)){const t=g.getState();B2.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:h,handleId:p,nodeId:w,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>g.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:k,isValidConnection:n||((...e)=>g.getState().isValidConnection?.(...e)??!0),getTransform:()=>g.getState().transform,getFromHandle:()=>g.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return(0,P.jsx)("div",{"data-handleid":p,"data-nodeid":w,"data-handlepos":t,"data-id":`${v}-${w}-${p}-${e}`,className:a4(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",b,c,{source:!h,target:h,connectable:r,connectablestart:a,connectableend:o,clickconnecting:E,connectingfrom:x,connectingto:_,valid:S,connectionindicator:r&&(!M||N)&&(M||I?o:a)}]),onMouseDown:j,onTouchStart:j,onClick:y?t=>{const{onClickConnectStart:r,onClickConnectEnd:o,connectionClickStartHandle:i,connectionMode:s,isValidConnection:l,lib:c,rfId:u,nodeLookup:d,connection:f}=g.getState();if(!w||!i&&!a)return;if(!i)return r?.(t.nativeEvent,{nodeId:w,handleId:p,handleType:e}),void g.setState({connectionClickStartHandle:{nodeId:w,type:e,id:p}});const m=J1(t.target),h=n||l,{connection:y,isValid:b}=B2.isValid(t.nativeEvent,{handle:{nodeId:w,id:p,type:e},connectionMode:s,fromNodeId:i.nodeId,fromHandleId:i.id||null,fromType:i.type,isValidConnection:h,flowId:u,doc:m,lib:c,nodeLookup:d});b&&y&&k(y);const v=structuredClone(f);delete v.inProgress,v.toPosition=v.toHandle?v.toHandle.position:null,o?.(t,v),g.setState({connectionClickStartHandle:null})}:void 0,ref:m,...f,children:l})})),M5={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},I5={input:function({data:e,isConnectable:t,sourcePosition:n=p1.Bottom}){return(0,P.jsxs)(P.Fragment,{children:[e?.label,(0,P.jsx)(N5,{type:"source",position:n,isConnectable:t})]})},default:function({data:e,isConnectable:t,targetPosition:n=p1.Top,sourcePosition:r=p1.Bottom}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(N5,{type:"target",position:n,isConnectable:t}),e?.label,(0,P.jsx)(N5,{type:"source",position:r,isConnectable:t})]})},output:function({data:e,isConnectable:t,targetPosition:n=p1.Top}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(N5,{type:"target",position:n,isConnectable:t}),e?.label]})},group:function(){return null}},S5=e=>{const{width:t,height:n,x:r,y:a}=v1(e.nodeLookup,{filter:e=>!!e.selected});return{width:z1(t)?t:null,height:z1(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function k5({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=w4(),{width:a,height:o,transformString:s,userSelectionActive:l}=g4(S5,f4),c=b5(),u=(0,i.useRef)(null);(0,i.useEffect)(()=>{n||u.current?.focus({preventScroll:!0})},[n]);const d=!l&&null!==a&&null!==o;if(y5({nodeRef:u,disabled:!d}),!d)return null;const f=e?t=>{const n=r.getState().nodes.filter(e=>e.selected);e(t,n)}:void 0;return(0,P.jsx)("div",{className:a4(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:(0,P.jsx)("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:f,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(M5,e.key)&&(e.preventDefault(),c({direction:M5[e.key],factor:e.shiftKey?4:1}))},style:{width:a,height:o}})})}const j5="undefined"!=typeof window?window:void 0,D5=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function C5({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:o,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:c,selectionKeyCode:u,selectionOnDrag:d,selectionMode:f,onSelectionStart:m,onSelectionEnd:p,multiSelectionKeyCode:h,panActivationKeyCode:g,zoomActivationKeyCode:w,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:v,panOnScroll:x,panOnScrollSpeed:_,panOnScrollMode:E,zoomOnDoubleClick:N,panOnDrag:M,defaultViewport:I,translateExtent:S,minZoom:k,maxZoom:j,preventScrolling:D,onSelectionContextMenu:C,noWheelClassName:A,noPanClassName:T,disableKeyboardA11y:O,onViewportChange:L,isControlledViewport:z}){const{nodesSelectionActive:R,userSelectionActive:U}=g4(D5,f4),B=Q4(u,{target:j5}),F=Q4(g,{target:j5}),Y=F||M,Q=F||x,V=d&&!0!==Y,W=B||U||V;return function({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=w4(),{deleteElements:r}=i5(),a=Q4(e,{actInsideInputWithModifier:!1}),o=Q4(t,{target:l5});(0,i.useEffect)(()=>{if(a){const{edges:e,nodes:t}=n.getState();r({nodes:t.filter(s5),edges:e.filter(s5)}),n.setState({nodesSelectionActive:!1})}},[a]),(0,i.useEffect)(()=>{n.setState({multiSelectionActive:o})},[o])}({deleteKeyCode:c,multiSelectionKeyCode:h}),(0,P.jsx)(d5,{onPaneContextMenu:o,elementsSelectable:y,zoomOnScroll:b,zoomOnPinch:v,panOnScroll:Q,panOnScrollSpeed:_,panOnScrollMode:E,zoomOnDoubleClick:N,panOnDrag:!B&&Y,defaultViewport:I,translateExtent:S,minZoom:k,maxZoom:j,zoomActivationKeyCode:w,preventScrolling:D,noWheelClassName:A,noPanClassName:T,onViewportChange:L,isControlledViewport:z,paneClickDistance:l,selectionOnDrag:V,children:(0,P.jsxs)(g5,{onSelectionStart:m,onSelectionEnd:p,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:o,onPaneScroll:s,panOnDrag:Y,isSelecting:!!W,selectionMode:f,selectionKeyPressed:B,paneClickDistance:l,selectionOnDrag:V,children:[e,R&&(0,P.jsx)(k5,{onSelectionContextMenu:C,noPanClassName:T,disableKeyboardA11y:O})]})})}C5.displayName="FlowRenderer";const A5=(0,i.memo)(C5);const T5=e=>e.updateNodeInternals;var O5=(0,i.memo)(function({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:o,onDoubleClick:s,nodesDraggable:l,elementsSelectable:c,nodesConnectable:u,nodesFocusable:d,resizeObserver:f,noDragClassName:m,noPanClassName:p,disableKeyboardA11y:h,rfId:g,nodeTypes:w,nodeClickDistance:y,onError:b}){const{node:v,internals:x,isParent:_}=g4(t=>{const n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},f4);let E=v.type||"default",N=w?.[E]||I5[E];void 0===N&&(b?.("003",(e=>`Node type "${e}" not found. Using fallback type "default".`)(E)),E="default",N=w?.default||I5.default);const M=!!(v.draggable||l&&void 0===v.draggable),I=!!(v.selectable||c&&void 0===v.selectable),S=!!(v.connectable||u&&void 0===v.connectable),k=!!(v.focusable||d&&void 0===v.focusable),j=w4(),D=Z1(v),C=function({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=w4(),o=(0,i.useRef)(null),s=(0,i.useRef)(null),l=(0,i.useRef)(e.sourcePosition),c=(0,i.useRef)(e.targetPosition),u=(0,i.useRef)(t),d=n&&!!e.internals.handleBounds;return(0,i.useEffect)(()=>{!o.current||e.hidden||d&&s.current===o.current||(s.current&&r?.unobserve(s.current),r?.observe(o.current),s.current=o.current)},[d,e.hidden]),(0,i.useEffect)(()=>()=>{s.current&&(r?.unobserve(s.current),s.current=null)},[]),(0,i.useEffect)(()=>{if(o.current){const n=u.current!==t,r=l.current!==e.sourcePosition,i=c.current!==e.targetPosition;(n||r||i)&&(u.current=t,l.current=e.sourcePosition,c.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}({node:v,nodeType:E,hasDimensions:D,resizeObserver:f}),A=y5({nodeRef:C,disabled:v.hidden||!M,noDragClassName:m,handleSelector:v.dragHandle,nodeId:e,isSelectable:I,nodeClickDistance:y}),T=b5();if(v.hidden)return null;const O=W1(v),L=function(e){return void 0===e.internals.handleBounds?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}(v),z=I||M||t||n||r||a,R=n?e=>n(e,{...x.userNode}):void 0,U=r?e=>r(e,{...x.userNode}):void 0,B=a?e=>a(e,{...x.userNode}):void 0,F=o?e=>o(e,{...x.userNode}):void 0,Y=s?e=>s(e,{...x.userNode}):void 0;return(0,P.jsx)("div",{className:a4(["react-flow__node",`react-flow__node-${E}`,{[p]:M},v.className,{selected:v.selected,selectable:I,parent:_,draggable:M,dragging:A}]),ref:C,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:z?"all":"none",visibility:D?"visible":"hidden",...v.style,...L},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:R,onMouseMove:U,onMouseLeave:B,onContextMenu:F,onClick:n=>{const{selectNodesOnDrag:r,nodeDragThreshold:a}=j.getState();I&&(!r||!M||a>0)&&w5({id:e,store:j,nodeRef:C}),t&&t(n,{...x.userNode})},onDoubleClick:Y,onKeyDown:k?t=>{if(!e2(t.nativeEvent)&&!h)if(i1.includes(t.key)&&I){const n="Escape"===t.key;w5({id:e,store:j,unselect:n,nodeRef:C})}else if(M&&v.selected&&Object.prototype.hasOwnProperty.call(M5,t.key)){t.preventDefault();const{ariaLabelConfig:e}=j.getState();j.setState({ariaLiveMessage:e["node.a11yDescription.ariaLiveMessage"]({direction:t.key.replace("Arrow","").toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),T({direction:M5[t.key],factor:t.shiftKey?4:1})}}:void 0,tabIndex:k?0:void 0,onFocus:k?()=>{if(h||!C.current?.matches(":focus-visible"))return;const{transform:t,width:n,height:r,autoPanOnNodeFocus:a,setCenter:o}=j.getState();a&&(x1(new Map([[e,v]]),{x:0,y:0,width:n,height:r},t,!0).length>0||o(v.position.x+O.width/2,v.position.y+O.height/2,{zoom:t[2]}))}:void 0,role:v.ariaRole??(k?"group":void 0),"aria-roledescription":"node","aria-describedby":h?void 0:`${v4}-${g}`,"aria-label":v.ariaLabel,...v.domAttributes,children:(0,P.jsx)(x5,{value:e,children:(0,P.jsx)(N,{id:e,data:v.data,type:E,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:v.selected??!1,selectable:I,draggable:M,deletable:v.deletable??!0,isConnectable:S,sourcePosition:v.sourcePosition,targetPosition:v.targetPosition,dragging:A,dragHandle:v.dragHandle,zIndex:x.z,parentId:v.parentId,...O})})})});const L5=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function z5(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:o}=g4(L5,f4),s=function(e){const t=g4((0,i.useCallback)((e=>t=>e?x1(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys()))(e),[e]),f4);return t}(e.onlyRenderVisibleElements),l=function(){const e=g4(T5),[t]=(0,i.useState)(()=>"undefined"==typeof ResizeObserver?null:new ResizeObserver(t=>{const n=new Map;t.forEach(e=>{const t=e.target.getAttribute("data-id");n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return(0,i.useEffect)(()=>()=>{t?.disconnect()},[t]),t}();return(0,P.jsx)("div",{className:"react-flow__nodes",style:c5,children:s.map(i=>(0,P.jsx)(O5,{id:i,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:l,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:o},i))})}z5.displayName="NodeRenderer";const P5=(0,i.memo)(z5),R5={[m1.Arrow]:({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return(0,P.jsx)("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},[m1.ArrowClosed]:({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return(0,P.jsx)("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})}},U5=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:o="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const c=function(e){const t=w4();return(0,i.useMemo)(()=>Object.prototype.hasOwnProperty.call(R5,e)?R5[e]:(t.getState().onError?.("009",(e=>`Marker type "${e}" doesn't exist.`)(e)),null),[e])}(t);return c?(0,P.jsx)("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:l,refX:"0",refY:"0",children:(0,P.jsx)(c,{color:n,strokeWidth:s})}):null},B5=({defaultColor:e,rfId:t})=>{const n=g4(e=>e.edges),r=g4(e=>e.defaultEdgeOptions),a=(0,i.useMemo)(()=>{const a=function(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const o=new Set;return e.reduce((e,i)=>([i.markerStart||r,i.markerEnd||a].forEach(r=>{if(r&&"object"==typeof r){const a=x2(r,t);o.has(a)||(e.push({id:a,color:r.color||n,...r}),o.add(a))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd});return a},[n,r,t,e]);return a.length?(0,P.jsx)("svg",{className:"react-flow__marker","aria-hidden":"true",children:(0,P.jsx)("defs",{children:a.map(e=>(0,P.jsx)(U5,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};B5.displayName="MarkerDefinitions";var F5=(0,i.memo)(B5);function Y5({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:o,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:c,className:u,...d}){const[f,m]=(0,i.useState)({x:1,y:0,width:0,height:0}),p=a4(["react-flow__edge-textwrapper",u]),h=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(h.current){const e=h.current.getBBox();m({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?(0,P.jsxs)("g",{transform:`translate(${e-f.width/2} ${t-f.height/2})`,className:p,visibility:f.width?"visible":"hidden",...d,children:[a&&(0,P.jsx)("rect",{width:f.width+2*s[0],x:-s[0],y:-s[1],height:f.height+2*s[1],className:"react-flow__edge-textbg",style:o,rx:l,ry:l}),(0,P.jsx)("text",{className:"react-flow__edge-text",y:f.height/2,dy:"0.3em",ref:h,style:r,children:n}),c]}):null}Y5.displayName="EdgeText";const Q5=(0,i.memo)(Y5);function V5({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:o,labelBgStyle:i,labelBgPadding:s,labelBgBorderRadius:l,interactionWidth:c=20,...u}){return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("path",{...u,d:e,fill:"none",className:a4(["react-flow__edge-path",u.className])}),c?(0,P.jsx)("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:c,className:"react-flow__edge-interaction"}):null,r&&z1(t)&&z1(n)?(0,P.jsx)(Q5,{x:t,y:n,label:r,labelStyle:a,labelShowBg:o,labelBgStyle:i,labelBgPadding:s,labelBgBorderRadius:l}):null]})}function W5({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===p1.Left||e===p1.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function Z5({sourceX:e,sourceY:t,sourcePosition:n=p1.Bottom,targetX:r,targetY:a,targetPosition:o=p1.Top}){const[i,s]=W5({pos:n,x1:e,y1:t,x2:r,y2:a}),[l,c]=W5({pos:o,x1:r,y1:a,x2:e,y2:t}),[u,d,f,m]=a2({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:i,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${i},${s} ${l},${c} ${r},${a}`,u,d,f,m]}function G5(e){return(0,i.memo)(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:o,sourcePosition:i,targetPosition:s,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m,style:p,markerEnd:h,markerStart:g,interactionWidth:w})=>{const[y,b,v]=Z5({sourceX:n,sourceY:r,sourcePosition:i,targetX:a,targetY:o,targetPosition:s}),x=e.isInternal?void 0:t;return(0,P.jsx)(V5,{id:x,path:y,labelX:b,labelY:v,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m,style:p,markerEnd:h,markerStart:g,interactionWidth:w})})}const H5=G5({isInternal:!1}),$5=G5({isInternal:!0});function X5(e){return(0,i.memo)(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:o,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:m=p1.Bottom,targetPosition:p=p1.Top,markerEnd:h,markerStart:g,pathOptions:w,interactionWidth:y})=>{const[b,v,x]=g2({sourceX:n,sourceY:r,sourcePosition:m,targetX:a,targetY:o,targetPosition:p,borderRadius:w?.borderRadius,offset:w?.offset,stepPosition:w?.stepPosition}),_=e.isInternal?void 0:t;return(0,P.jsx)(V5,{id:_,path:b,labelX:v,labelY:x,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:h,markerStart:g,interactionWidth:y})})}H5.displayName="SimpleBezierEdge",$5.displayName="SimpleBezierEdgeInternal";const q5=X5({isInternal:!1}),J5=X5({isInternal:!0});function K5(e){return(0,i.memo)(({id:t,...n})=>{const r=e.isInternal?void 0:t;return(0,P.jsx)(q5,{...n,id:r,pathOptions:(0,i.useMemo)(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}q5.displayName="SmoothStepEdge",J5.displayName="SmoothStepEdgeInternal";const e3=K5({isInternal:!1}),t3=K5({isInternal:!0});function n3(e){return(0,i.memo)(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:o,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:p,interactionWidth:h})=>{const[g,w,y]=f2({sourceX:n,sourceY:r,targetX:a,targetY:o}),b=e.isInternal?void 0:t;return(0,P.jsx)(V5,{id:b,path:g,labelX:w,labelY:y,label:i,labelStyle:s,labelShowBg:l,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:p,interactionWidth:h})})}e3.displayName="StepEdge",t3.displayName="StepEdgeInternal";const r3=n3({isInternal:!1}),a3=n3({isInternal:!0});function o3(e){return(0,i.memo)(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:o,sourcePosition:i=p1.Bottom,targetPosition:s=p1.Top,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m,style:p,markerEnd:h,markerStart:g,pathOptions:w,interactionWidth:y})=>{const[b,v,x]=s2({sourceX:n,sourceY:r,sourcePosition:i,targetX:a,targetY:o,targetPosition:s,curvature:w?.curvature}),_=e.isInternal?void 0:t;return(0,P.jsx)(V5,{id:_,path:b,labelX:v,labelY:x,label:l,labelStyle:c,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m,style:p,markerEnd:h,markerStart:g,interactionWidth:y})})}r3.displayName="StraightEdge",a3.displayName="StraightEdgeInternal";const i3=o3({isInternal:!1}),s3=o3({isInternal:!0});i3.displayName="BezierEdge",s3.displayName="BezierEdgeInternal";const l3={default:s3,straight:a3,step:t3,smoothstep:J5,simplebezier:$5},c3={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},u3=(e,t,n)=>n===p1.Left?e-t:n===p1.Right?e+t:e,d3=(e,t,n)=>n===p1.Top?e-t:n===p1.Bottom?e+t:e,f3="react-flow__edgeupdater";function m3({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:o,onMouseOut:i,type:s}){return(0,P.jsx)("circle",{onMouseDown:a,onMouseEnter:o,onMouseOut:i,className:a4([f3,`${f3}-${s}`]),cx:u3(t,r,e),cy:d3(n,r,e),r,stroke:"transparent",fill:"transparent"})}function p3({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:o,targetY:i,sourcePosition:s,targetPosition:l,onReconnect:c,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:m}){const p=w4(),h=(e,t)=>{if(0!==e.button)return;const{autoPanOnConnect:r,domNode:a,connectionMode:o,connectionRadius:i,lib:s,onConnectStart:l,cancelConnection:m,nodeLookup:h,rfId:g,panBy:w,updateConnection:y}=p.getState(),b="target"===t.type;B2.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:o,connectionRadius:i,domNode:a,handleId:t.id,nodeId:t.nodeId,nodeLookup:h,isTarget:b,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:m,panBy:w,isValidConnection:(...e)=>p.getState().isValidConnection?.(...e)??!0,onConnect:e=>c?.(n,e),onConnectStart:(r,a)=>{f(!0),u?.(e,n,t.type),l?.(r,a)},onConnectEnd:(...e)=>p.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:y,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,dragThreshold:p.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},g=()=>m(!0),w=()=>m(!1);return(0,P.jsxs)(P.Fragment,{children:[(!0===e||"source"===e)&&(0,P.jsx)(m3,{position:s,centerX:r,centerY:a,radius:t,onMouseDown:e=>h(e,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),onMouseEnter:g,onMouseOut:w,type:"source"}),(!0===e||"target"===e)&&(0,P.jsx)(m3,{position:l,centerX:o,centerY:i,radius:t,onMouseDown:e=>h(e,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),onMouseEnter:g,onMouseOut:w,type:"target"})]})}var h3=(0,i.memo)(function({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:o,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,reconnectRadius:d,onReconnect:f,onReconnectStart:m,onReconnectEnd:p,rfId:h,edgeTypes:g,noPanClassName:w,onError:y,disableKeyboardA11y:b}){let v=g4(t=>t.edgeLookup.get(e));const x=g4(e=>e.defaultEdgeOptions);v=x?{...x,...v}:v;let _=v.type||"default",E=g?.[_]||l3[_];void 0===E&&(y?.("011",(e=>`Edge type "${e}" not found. Using fallback type "default".`)(_)),_="default",E=g?.default||l3.default);const N=!!(v.focusable||t&&void 0===v.focusable),M=void 0!==f&&(v.reconnectable||n&&void 0===v.reconnectable),I=!!(v.selectable||r&&void 0===v.selectable),S=(0,i.useRef)(null),[k,j]=(0,i.useState)(!1),[D,C]=(0,i.useState)(!1),A=w4(),{zIndex:T,sourceX:O,sourceY:L,targetX:z,targetY:R,sourcePosition:U,targetPosition:B}=g4((0,i.useCallback)(t=>{const n=t.nodeLookup.get(v.source),r=t.nodeLookup.get(v.target);if(!n||!r)return{zIndex:v.zIndex,...c3};const a=function(e){const{sourceNode:t,targetNode:n}=e;if(!w2(t)||!w2(n))return null;const r=t.internals.handleBounds||y2(t.handles),a=n.internals.handleBounds||y2(n.handles),o=v2(r?.source??[],e.sourceHandle),i=v2(e.connectionMode===l1.Strict?a?.target??[]:(a?.target??[]).concat(a?.source??[]),e.targetHandle);if(!o||!i)return e.onError?.("008",((e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${"source"===e?n:r}", edge id: ${t}.`)(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const s=o?.position||p1.Bottom,l=i?.position||p1.Top,c=b2(t,o,s),u=b2(n,i,l);return{sourceX:c.x,sourceY:c.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:l}}({id:e,sourceNode:n,targetNode:r,sourceHandle:v.sourceHandle||null,targetHandle:v.targetHandle||null,connectionMode:t.connectionMode,onError:y}),o=function({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:a=!1,zIndexMode:o="basic"}){return"manual"===o?r:(a&&n?r+1e3:r)+Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0)}({selected:v.selected,zIndex:v.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{zIndex:o,...a||c3}},[v.source,v.target,v.sourceHandle,v.targetHandle,v.selected,v.zIndex]),f4),F=(0,i.useMemo)(()=>v.markerStart?`url('#${x2(v.markerStart,h)}')`:void 0,[v.markerStart,h]),Y=(0,i.useMemo)(()=>v.markerEnd?`url('#${x2(v.markerEnd,h)}')`:void 0,[v.markerEnd,h]);if(v.hidden||null===O||null===L||null===z||null===R)return null;const Q=o?e=>{o(e,{...v})}:void 0,V=s?e=>{s(e,{...v})}:void 0,W=l?e=>{l(e,{...v})}:void 0,Z=c?e=>{c(e,{...v})}:void 0,G=u?e=>{u(e,{...v})}:void 0;return(0,P.jsx)("svg",{style:{zIndex:T},children:(0,P.jsxs)("g",{className:a4(["react-flow__edge",`react-flow__edge-${_}`,v.className,w,{selected:v.selected,animated:v.animated,inactive:!I&&!a,updating:k,selectable:I}]),onClick:t=>{const{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:o}=A.getState();I&&(A.setState({nodesSelectionActive:!1}),v.selected&&o?(r({nodes:[],edges:[v]}),S.current?.blur()):n([e])),a&&a(t,v)},onDoubleClick:Q,onContextMenu:V,onMouseEnter:W,onMouseMove:Z,onMouseLeave:G,onKeyDown:N?t=>{if(!b&&i1.includes(t.key)&&I){const{unselectNodesAndEdges:n,addSelectedEdges:r}=A.getState();"Escape"===t.key?(S.current?.blur(),n({edges:[v]})):r([e])}}:void 0,tabIndex:N?0:void 0,role:v.ariaRole??(N?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":null===v.ariaLabel?void 0:v.ariaLabel||`Edge from ${v.source} to ${v.target}`,"aria-describedby":N?`${x4}-${h}`:void 0,ref:S,...v.domAttributes,children:[!D&&(0,P.jsx)(E,{id:e,source:v.source,target:v.target,type:v.type,selected:v.selected,animated:v.animated,selectable:I,deletable:v.deletable??!0,label:v.label,labelStyle:v.labelStyle,labelShowBg:v.labelShowBg,labelBgStyle:v.labelBgStyle,labelBgPadding:v.labelBgPadding,labelBgBorderRadius:v.labelBgBorderRadius,sourceX:O,sourceY:L,targetX:z,targetY:R,sourcePosition:U,targetPosition:B,data:v.data,style:v.style,sourceHandleId:v.sourceHandle,targetHandleId:v.targetHandle,markerStart:F,markerEnd:Y,pathOptions:"pathOptions"in v?v.pathOptions:void 0,interactionWidth:v.interactionWidth}),M&&(0,P.jsx)(p3,{edge:v,isReconnectable:M,reconnectRadius:d,onReconnect:f,onReconnectStart:m,onReconnectEnd:p,sourceX:O,sourceY:L,targetX:z,targetY:R,sourcePosition:U,targetPosition:B,setUpdateHover:j,setReconnecting:C})]})})});const g3=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function w3({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:o,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,reconnectRadius:f,onEdgeDoubleClick:m,onReconnectStart:p,onReconnectEnd:h,disableKeyboardA11y:g}){const{edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,onError:v}=g4(g3,f4),x=function(e){const t=g4((0,i.useCallback)(t=>{if(!e)return t.edges.map(e=>e.id);const n=[];if(t.width&&t.height)for(const e of t.edges){const r=t.nodeLookup.get(e.source),a=t.nodeLookup.get(e.target);r&&a&&c2({sourceNode:r,targetNode:a,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),f4);return t}(t);return(0,P.jsxs)("div",{className:"react-flow__edges",children:[(0,P.jsx)(F5,{defaultColor:e,rfId:n}),x.map(e=>(0,P.jsx)(h3,{id:e,edgesFocusable:w,edgesReconnectable:y,elementsSelectable:b,noPanClassName:a,onReconnect:o,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,reconnectRadius:f,onDoubleClick:m,onReconnectStart:p,onReconnectEnd:h,rfId:n,onError:v,edgeTypes:r,disableKeyboardA11y:g},e))]})}w3.displayName="EdgeRenderer";const y3=(0,i.memo)(w3),b3=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function v3({children:e}){const t=g4(b3);return(0,P.jsx)("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}const x3=e=>e.panZoom?.syncViewport;function _3(e){return e.connection.inProgress?{...e.connection,to:U1(e.connection.to,e.transform)}:{...e.connection}}const E3=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function N3({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:o,height:i,isValid:s,inProgress:l}=g4(E3,f4);return o&&a&&l?(0,P.jsx)("svg",{style:e,width:o,height:i,className:"react-flow__connectionline react-flow__container",children:(0,P.jsx)("g",{className:a4(["react-flow__connection",g1(s)]),children:(0,P.jsx)(M3,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}const M3=({style:e,type:t=f1.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:o,fromNode:i,fromHandle:s,fromPosition:l,to:c,toNode:u,toHandle:d,toPosition:f,pointer:m}=function(e){const t=function(e){if(e){const t=t=>{const n=_3(t);return e(n)};return t}return _3}(e);return g4(t,f4)}();if(!a)return;if(n)return(0,P.jsx)(n,{connectionLineType:t,connectionLineStyle:e,fromNode:i,fromHandle:s,fromX:o.x,fromY:o.y,toX:c.x,toY:c.y,fromPosition:l,toPosition:f,connectionStatus:g1(r),toNode:u,toHandle:d,pointer:m});let p="";const h={sourceX:o.x,sourceY:o.y,sourcePosition:l,targetX:c.x,targetY:c.y,targetPosition:f};switch(t){case f1.Bezier:[p]=s2(h);break;case f1.SimpleBezier:[p]=Z5(h);break;case f1.Step:[p]=g2({...h,borderRadius:0});break;case f1.SmoothStep:[p]=g2(h);break;default:[p]=f2(h)}return(0,P.jsx)("path",{d:p,fill:"none",className:"react-flow__connection-path",style:e})};M3.displayName="ConnectionLine";const I3={};function S3(e=I3){(0,i.useRef)(e),w4(),(0,i.useEffect)(()=>{},[e])}function k3({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:o,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,onSelectionContextMenu:f,onSelectionStart:m,onSelectionEnd:p,connectionLineType:h,connectionLineStyle:g,connectionLineComponent:w,connectionLineContainerStyle:y,selectionKeyCode:b,selectionOnDrag:v,selectionMode:x,multiSelectionKeyCode:_,panActivationKeyCode:E,zoomActivationKeyCode:N,deleteKeyCode:M,onlyRenderVisibleElements:I,elementsSelectable:S,defaultViewport:k,translateExtent:j,minZoom:D,maxZoom:C,preventScrolling:A,defaultMarkerColor:T,zoomOnScroll:O,zoomOnPinch:L,panOnScroll:z,panOnScrollSpeed:R,panOnScrollMode:U,zoomOnDoubleClick:B,panOnDrag:F,onPaneClick:Y,onPaneMouseEnter:Q,onPaneMouseMove:V,onPaneMouseLeave:W,onPaneScroll:Z,onPaneContextMenu:G,paneClickDistance:H,nodeClickDistance:$,onEdgeContextMenu:X,onEdgeMouseEnter:q,onEdgeMouseMove:J,onEdgeMouseLeave:K,reconnectRadius:ee,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,noDragClassName:ae,noWheelClassName:oe,noPanClassName:ie,disableKeyboardA11y:se,nodeExtent:le,rfId:ce,viewport:ue,onViewportChange:de}){return S3(e),S3(t),w4(),(0,i.useRef)(!1),(0,i.useEffect)(()=>{},[]),function(e){const t=i5(),n=(0,i.useRef)(!1);(0,i.useEffect)(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}(n),function(e){const t=g4(x3),n=w4();(0,i.useEffect)(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t])}(ue),(0,P.jsx)(A5,{onPaneClick:Y,onPaneMouseEnter:Q,onPaneMouseMove:V,onPaneMouseLeave:W,onPaneContextMenu:G,onPaneScroll:Z,paneClickDistance:H,deleteKeyCode:M,selectionKeyCode:b,selectionOnDrag:v,selectionMode:x,onSelectionStart:m,onSelectionEnd:p,multiSelectionKeyCode:_,panActivationKeyCode:E,zoomActivationKeyCode:N,elementsSelectable:S,zoomOnScroll:O,zoomOnPinch:L,zoomOnDoubleClick:B,panOnScroll:z,panOnScrollSpeed:R,panOnScrollMode:U,panOnDrag:F,defaultViewport:k,translateExtent:j,minZoom:D,maxZoom:C,onSelectionContextMenu:f,preventScrolling:A,noDragClassName:ae,noWheelClassName:oe,noPanClassName:ie,disableKeyboardA11y:se,onViewportChange:de,isControlledViewport:!!ue,children:(0,P.jsxs)(v3,{children:[(0,P.jsx)(y3,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:s,onReconnect:te,onReconnectStart:ne,onReconnectEnd:re,onlyRenderVisibleElements:I,onEdgeContextMenu:X,onEdgeMouseEnter:q,onEdgeMouseMove:J,onEdgeMouseLeave:K,reconnectRadius:ee,defaultMarkerColor:T,noPanClassName:ie,disableKeyboardA11y:se,rfId:ce}),(0,P.jsx)(N3,{style:g,type:h,component:w,containerStyle:y}),(0,P.jsx)("div",{className:"react-flow__edgelabel-renderer"}),(0,P.jsx)(P5,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:l,onNodeMouseMove:c,onNodeMouseLeave:u,onNodeContextMenu:d,nodeClickDistance:$,onlyRenderVisibleElements:I,noPanClassName:ie,noDragClassName:ae,disableKeyboardA11y:se,nodeExtent:le,rfId:ce}),(0,P.jsx)("div",{className:"react-flow__viewport-portal"})]})})}k3.displayName="GraphView";const j3=(0,i.memo)(k3),D3=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:o,fitView:i,fitViewOptions:s,minZoom:l=.5,maxZoom:c=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f="basic"}={})=>{const m=new Map,p=new Map,h=new Map,g=new Map,w=r??t??[],y=n??e??[],b=u??[0,0],v=d??o1;A2(h,g,w);const{nodesInitialized:x}=S2(y,m,p,{nodeOrigin:b,nodeExtent:v,zIndexMode:f});let _=[0,0,1];if(i&&a&&o){const e=v1(m,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),{x:t,y:n,zoom:r}=Y1(e,a,o,l,c,s?.padding??.1);_=[t,n,r]}return{rfId:"1",width:a??0,height:o??0,transform:_,nodes:y,nodesInitialized:x,nodeLookup:m,parentLookup:p,edges:w,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:void 0!==n,hasDefaultEdges:void 0!==r,panZoom:null,minZoom:l,maxZoom:c,translateExtent:o1,nodeExtent:v,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:l1.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:b,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:i??!1,fitViewOptions:s,fitViewResolver:null,connection:{...d1},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:P1,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:s1,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},C3=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:o,fitView:i,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>((e,t)=>e?d4(e,t):d4)((m,p)=>{async function h(){const{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:a,height:o,minZoom:i,maxZoom:s}=p();t&&(await async function({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:o},i){if(0===e.size)return Promise.resolve(!0);const s=function(e,t){const n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{!e.measured.width||!e.measured.height||!t?.includeHiddenNodes&&e.hidden||r&&!r.has(e.id)||n.set(e.id,e)}),n}(e,i),l=v1(s),c=Y1(l,t,n,i?.minZoom??a,i?.maxZoom??o,i?.padding??.1);return await r.setViewport(c,{duration:i?.duration,ease:i?.ease,interpolate:i?.interpolate}),Promise.resolve(!0)}({nodes:e,width:a,height:o,panZoom:t,minZoom:i,maxZoom:s},n),r?.resolve(!0),m({fitViewResolver:null}))}return{...D3({nodes:e,edges:t,width:a,height:o,fitView:i,fitViewOptions:s,minZoom:l,maxZoom:c,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{const{nodeLookup:t,parentLookup:n,nodeOrigin:r,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:i,nodesSelectionActive:s}=p(),{nodesInitialized:l,hasSelectedNodes:c}=S2(e,t,n,{nodeOrigin:r,nodeExtent:d,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:i}),u=s&&c;o&&l?(h(),m({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:u})):m({nodes:e,nodesInitialized:l,nodesSelectionActive:u})},setEdges:e=>{const{connectionLookup:t,edgeLookup:n}=p();A2(t,n,e),m({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){const{setNodes:t}=p();t(e),m({hasDefaultNodes:!0})}if(t){const{setEdges:e}=p();e(t),m({hasDefaultEdges:!0})}},updateNodeInternals:e=>{const{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:a,nodeOrigin:o,nodeExtent:i,debug:s,fitViewQueued:l,zIndexMode:c}=p(),{changes:u,updatedInternals:d}=function(e,t,n,r,a,o,i){const s=r?.querySelector(".xyflow__viewport");let l=!1;if(!s)return{changes:[],updatedInternals:l};const c=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(const r of e.values()){const e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),l=!0;continue}const s=q1(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){const m=r.nodeElement.getBoundingClientRect(),p=V1(e.extent)?e.extent:o;let{positionAbsolute:h}=e.internals;e.parentId&&"parent"===e.extent?h=M1(h,s,t.get(e.parentId)):p&&(h=N1(h,p,s));const g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:r2("source",r.nodeElement,m,d,e.id),target:r2("target",r.nodeElement,m,d,e.id)}}};t.set(e.id,g),e.parentId&&k2(g,t,n,{nodeOrigin:a,zIndexMode:i}),l=!0,u&&(c.push({id:e.id,type:"dimensions",dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:C1(g,a)}))}}if(f.length>0){const e=D2(f,t,n,a);c.push(...e)}return{changes:c,updatedInternals:l}}(e,n,r,a,o,i,c);d&&(function(e,t,n){const r=N2(_2,n);for(const n of e.values())if(n.parentId)k2(n,e,t,r);else{const e=b1(n,r.nodeOrigin),t=V1(n.extent)?n.extent:r.nodeExtent,a=N1(e,t,W1(n));n.internals.positionAbsolute=a}}(n,r,{nodeOrigin:o,nodeExtent:i,zIndexMode:c}),l?(h(),m({fitViewQueued:!1,fitViewOptions:void 0})):m({}),u?.length>0&&(s&&console.log("React Flow: trigger node changes",u),t?.(u)))},updateNodePositions:(e,t=!1)=>{const n=[];let r=[];const{nodeLookup:a,triggerNodeChanges:o,connection:i,updateConnection:s,onNodesChangeMiddlewareMap:l}=p();for(const[o,l]of e){const e=a.get(o),c=!!(e?.expandParent&&e?.parentId&&l?.position),u={id:o,type:"position",position:c?{x:Math.max(0,l.position.x),y:Math.max(0,l.position.y)}:l.position,dragging:t};if(e&&i.inProgress&&i.fromNode.id===e.id){const t=b2(e,i.fromHandle,p1.Left,!0);s({...i,from:t})}c&&e.parentId&&n.push({id:o,parentId:e.parentId,rect:{...l.internals.positionAbsolute,width:l.measured.width??0,height:l.measured.height??0}}),r.push(u)}if(n.length>0){const{parentLookup:e,nodeOrigin:t}=p(),o=D2(n,a,e,t);r.push(...o)}for(const e of l.values())r=e(r);o(r)},triggerNodeChanges:e=>{const{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:a,debug:o}=p();e?.length&&(a&&n(H4(e,r)),o&&console.log("React Flow: trigger node changes",e),t?.(e))},triggerEdgeChanges:e=>{const{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:a,debug:o}=p();e?.length&&(a&&n($4(e,r)),o&&console.log("React Flow: trigger edge changes",e),t?.(e))},addSelectedNodes:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:a,triggerEdgeChanges:o}=p();t?a(e.map(e=>X4(e,!0))):(a(q4(r,new Set([...e]),!0)),o(q4(n)))},addSelectedEdges:e=>{const{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:a,triggerEdgeChanges:o}=p();t?o(e.map(e=>X4(e,!0))):(o(q4(n,new Set([...e]))),a(q4(r,new Set,!0)))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{const{edges:n,nodes:r,nodeLookup:a,triggerNodeChanges:o,triggerEdgeChanges:i}=p(),s=e||r,l=t||n,c=[];for(const e of s){if(!e.selected)continue;const t=a.get(e.id);t&&(t.selected=!1),c.push(X4(e.id,!1))}const u=[];for(const e of l)e.selected&&u.push(X4(e.id,!1));o(c),i(u)},setMinZoom:e=>{const{panZoom:t,maxZoom:n}=p();t?.setScaleExtent([e,n]),m({minZoom:e})},setMaxZoom:e=>{const{panZoom:t,minZoom:n}=p();t?.setScaleExtent([n,e]),m({maxZoom:e})},setTranslateExtent:e=>{p().panZoom?.setTranslateExtent(e),m({translateExtent:e})},resetSelectedElements:()=>{const{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:a}=p();if(!a)return;const o=t.reduce((e,t)=>t.selected?[...e,X4(t.id,!1)]:e,[]),i=e.reduce((e,t)=>t.selected?[...e,X4(t.id,!1)]:e,[]);n(o),r(i)},setNodeExtent:e=>{const{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:a,elevateNodesOnSelect:o,nodeExtent:i,zIndexMode:s}=p();e[0][0]===i[0][0]&&e[0][1]===i[0][1]&&e[1][0]===i[1][0]&&e[1][1]===i[1][1]||(S2(t,n,r,{nodeOrigin:a,nodeExtent:e,elevateNodesOnSelect:o,checkEquality:!1,zIndexMode:s}),m({nodeExtent:e}))},panBy:e=>{const{transform:t,width:n,height:r,panZoom:a,translateExtent:o}=p();return async function({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:o}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const i=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,o]],r),s=!!i&&(i.x!==n[0]||i.y!==n[1]||i.k!==n[2]);return Promise.resolve(s)}({delta:e,panZoom:a,transform:t,translateExtent:o,width:n,height:r})},setCenter:async(e,t,n)=>{const{width:r,height:a,maxZoom:o,panZoom:i}=p();if(!i)return Promise.resolve(!1);const s=void 0!==n?.zoom?n.zoom:o;return await i.setViewport({x:r/2-e*s,y:a/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{m({connection:{...d1}})},updateConnection:e=>{m({connection:e})},reset:()=>m({...D3()})}},Object.is);function A3({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:o,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:c,fitView:u,nodeOrigin:d,nodeExtent:f,zIndexMode:m,children:p}){const[h]=(0,i.useState)(()=>C3({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:o,fitView:u,minZoom:s,maxZoom:l,fitViewOptions:c,nodeOrigin:d,nodeExtent:f,zIndexMode:m}));return(0,P.jsx)(p4,{value:h,children:(0,P.jsx)(a5,{children:p})})}function T3({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:o,height:s,fitView:l,fitViewOptions:c,minZoom:u,maxZoom:d,nodeOrigin:f,nodeExtent:m,zIndexMode:p}){return(0,i.useContext)(m4)?(0,P.jsx)(P.Fragment,{children:e}):(0,P.jsx)(A3,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:o,initialHeight:s,fitView:l,initialFitViewOptions:c,initialMinZoom:u,initialMaxZoom:d,nodeOrigin:f,nodeExtent:m,zIndexMode:p,children:e})}const O3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};var L3=t5(function({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:o,edgeTypes:s,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:m,onConnect:p,onConnectStart:h,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,onNodeMouseEnter:b,onNodeMouseMove:v,onNodeMouseLeave:x,onNodeContextMenu:_,onNodeDoubleClick:E,onNodeDragStart:N,onNodeDrag:M,onNodeDragStop:I,onNodesDelete:S,onEdgesDelete:k,onDelete:j,onSelectionChange:D,onSelectionDragStart:C,onSelectionDrag:A,onSelectionDragStop:T,onSelectionContextMenu:O,onSelectionStart:L,onSelectionEnd:z,onBeforeDelete:R,connectionMode:U,connectionLineType:B=f1.Bezier,connectionLineStyle:F,connectionLineComponent:Y,connectionLineContainerStyle:Q,deleteKeyCode:V="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:Z=!1,selectionMode:G=u1.Full,panActivationKeyCode:H="Space",multiSelectionKeyCode:$=(Q1()?"Meta":"Control"),zoomActivationKeyCode:X=(Q1()?"Meta":"Control"),snapToGrid:q,snapGrid:J,onlyRenderVisibleElements:K=!1,selectNodesOnDrag:ee,nodesDraggable:te,autoPanOnNodeFocus:ne,nodesConnectable:re,nodesFocusable:ae,nodeOrigin:oe=L4,edgesFocusable:ie,edgesReconnectable:se,elementsSelectable:le=!0,defaultViewport:ce=z4,minZoom:ue=.5,maxZoom:de=2,translateExtent:fe=o1,preventScrolling:me=!0,nodeExtent:pe,defaultMarkerColor:he="#b1b1b7",zoomOnScroll:ge=!0,zoomOnPinch:we=!0,panOnScroll:ye=!1,panOnScrollSpeed:be=.5,panOnScrollMode:ve=c1.Free,zoomOnDoubleClick:xe=!0,panOnDrag:_e=!0,onPaneClick:Ee,onPaneMouseEnter:Ne,onPaneMouseMove:Me,onPaneMouseLeave:Ie,onPaneScroll:Se,onPaneContextMenu:ke,paneClickDistance:je=1,nodeClickDistance:De=0,children:Ce,onReconnect:Ae,onReconnectStart:Te,onReconnectEnd:Oe,onEdgeContextMenu:Le,onEdgeDoubleClick:ze,onEdgeMouseEnter:Pe,onEdgeMouseMove:Re,onEdgeMouseLeave:Ue,reconnectRadius:Be=10,onNodesChange:Fe,onEdgesChange:Ye,noDragClassName:Qe="nodrag",noWheelClassName:Ve="nowheel",noPanClassName:We="nopan",fitView:Ze,fitViewOptions:Ge,connectOnClick:He,attributionPosition:$e,proOptions:Xe,defaultEdgeOptions:qe,elevateNodesOnSelect:Je=!0,elevateEdgesOnSelect:Ke=!1,disableKeyboardA11y:et=!1,autoPanOnConnect:tt,autoPanOnNodeDrag:nt,autoPanSpeed:rt,connectionRadius:at,isValidConnection:ot,onError:it,style:st,id:lt,nodeDragThreshold:ct,connectionDragThreshold:ut,viewport:dt,onViewportChange:ft,width:mt,height:pt,colorMode:ht="light",debug:gt,onScroll:wt,ariaLabelConfig:yt,zIndexMode:bt="basic",...vt},xt){const _t=lt||"1",Et=function(e){const[t,n]=(0,i.useState)("system"===e?null:e);return(0,i.useEffect)(()=>{if("system"!==e)return void n(e);const t=F4(),r=()=>n(t?.matches?"dark":"light");return r(),t?.addEventListener("change",r),()=>{t?.removeEventListener("change",r)}},[e]),null!==t?t:F4()?.matches?"dark":"light"}(ht),Nt=(0,i.useCallback)(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),wt?.(e)},[wt]);return(0,P.jsx)("div",{"data-testid":"rf__wrapper",...vt,onScroll:Nt,style:{...st,...O3},ref:xt,className:a4(["react-flow",a,Et]),id:lt,role:"application",children:(0,P.jsxs)(T3,{nodes:e,edges:t,width:mt,height:pt,fitView:Ze,fitViewOptions:Ge,minZoom:ue,maxZoom:de,nodeOrigin:oe,nodeExtent:pe,zIndexMode:bt,children:[(0,P.jsx)(B4,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:p,onConnectStart:h,onConnectEnd:g,onClickConnectStart:w,onClickConnectEnd:y,nodesDraggable:te,autoPanOnNodeFocus:ne,nodesConnectable:re,nodesFocusable:ae,edgesFocusable:ie,edgesReconnectable:se,elementsSelectable:le,elevateNodesOnSelect:Je,elevateEdgesOnSelect:Ke,minZoom:ue,maxZoom:de,nodeExtent:pe,onNodesChange:Fe,onEdgesChange:Ye,snapToGrid:q,snapGrid:J,connectionMode:U,translateExtent:fe,connectOnClick:He,defaultEdgeOptions:qe,fitView:Ze,fitViewOptions:Ge,onNodesDelete:S,onEdgesDelete:k,onDelete:j,onNodeDragStart:N,onNodeDrag:M,onNodeDragStop:I,onSelectionDrag:A,onSelectionDragStart:C,onSelectionDragStop:T,onMove:d,onMoveStart:f,onMoveEnd:m,noPanClassName:We,nodeOrigin:oe,rfId:_t,autoPanOnConnect:tt,autoPanOnNodeDrag:nt,autoPanSpeed:rt,onError:it,connectionRadius:at,isValidConnection:ot,selectNodesOnDrag:ee,nodeDragThreshold:ct,connectionDragThreshold:ut,onBeforeDelete:R,debug:gt,ariaLabelConfig:yt,zIndexMode:bt}),(0,P.jsx)(j3,{onInit:u,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:b,onNodeMouseMove:v,onNodeMouseLeave:x,onNodeContextMenu:_,onNodeDoubleClick:E,nodeTypes:o,edgeTypes:s,connectionLineType:B,connectionLineStyle:F,connectionLineComponent:Y,connectionLineContainerStyle:Q,selectionKeyCode:W,selectionOnDrag:Z,selectionMode:G,deleteKeyCode:V,multiSelectionKeyCode:$,panActivationKeyCode:H,zoomActivationKeyCode:X,onlyRenderVisibleElements:K,defaultViewport:ce,translateExtent:fe,minZoom:ue,maxZoom:de,preventScrolling:me,zoomOnScroll:ge,zoomOnPinch:we,zoomOnDoubleClick:xe,panOnScroll:ye,panOnScrollSpeed:be,panOnScrollMode:ve,panOnDrag:_e,onPaneClick:Ee,onPaneMouseEnter:Ne,onPaneMouseMove:Me,onPaneMouseLeave:Ie,onPaneScroll:Se,onPaneContextMenu:ke,paneClickDistance:je,nodeClickDistance:De,onSelectionContextMenu:O,onSelectionStart:L,onSelectionEnd:z,onReconnect:Ae,onReconnectStart:Te,onReconnectEnd:Oe,onEdgeContextMenu:Le,onEdgeDoubleClick:ze,onEdgeMouseEnter:Pe,onEdgeMouseMove:Re,onEdgeMouseLeave:Ue,reconnectRadius:Be,defaultMarkerColor:he,noDragClassName:Qe,noWheelClassName:Ve,noPanClassName:We,rfId:_t,disableKeyboardA11y:et,nodeExtent:pe,viewport:dt,onViewportChange:ft}),(0,P.jsx)(T4,{onSelectionChange:D}),Ce,(0,P.jsx)(S4,{proOptions:Xe,position:$e}),(0,P.jsx)(M4,{rfId:_t,disableKeyboardA11y:et})]})})});const z3=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function P3({children:e}){const t=g4(z3);return t?(0,wn.createPortal)(e,t):null}const R3=e=>({x:e.transform[0],y:e.transform[1],zoom:e.transform[2]});function U3({dimensions:e,lineWidth:t,variant:n,className:r}){return(0,P.jsx)("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:a4(["react-flow__background-pattern",n,r])})}function B3({radius:e,className:t}){return(0,P.jsx)("circle",{cx:e,cy:e,r:e,className:a4(["react-flow__background-pattern","dots",t])})}var F3;!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(F3||(F3={}));const Y3={[F3.Dots]:1,[F3.Lines]:1,[F3.Cross]:6},Q3=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function V3({id:e,variant:t=F3.Dots,gap:n=20,size:r,lineWidth:a=1,offset:o=0,color:s,bgColor:l,style:c,className:u,patternClassName:d}){const f=(0,i.useRef)(null),{transform:m,patternId:p}=g4(Q3,f4),h=r||Y3[t],g=t===F3.Dots,w=t===F3.Cross,y=Array.isArray(n)?n:[n,n],b=[y[0]*m[2]||1,y[1]*m[2]||1],v=h*m[2],x=Array.isArray(o)?o:[o,o],_=w?[v,v]:b,E=[x[0]*m[2]||1+_[0]/2,x[1]*m[2]||1+_[1]/2],N=`${p}${e||""}`;return(0,P.jsxs)("svg",{className:a4(["react-flow__background",u]),style:{...c,...c5,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:f,"data-testid":"rf__background",children:[(0,P.jsx)("pattern",{id:N,x:m[0]%b[0],y:m[1]%b[1],width:b[0],height:b[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`,children:g?(0,P.jsx)(B3,{radius:v/2,className:d}):(0,P.jsx)(U3,{dimensions:_,lineWidth:a,variant:t,className:d})}),(0,P.jsx)("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}V3.displayName="Background";const W3=(0,i.memo)(V3);function Z3(){return(0,P.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:(0,P.jsx)("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function G3(){return(0,P.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:(0,P.jsx)("path",{d:"M0 0h32v4.2H0z"})})}function H3(){return(0,P.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:(0,P.jsx)("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function $3(){return(0,P.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,P.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function X3(){return(0,P.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:(0,P.jsx)("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function q3({children:e,className:t,...n}){return(0,P.jsx)("button",{type:"button",className:a4(["react-flow__controls-button",t]),...n,children:e})}const J3=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function K3({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:o,onZoomOut:i,onFitView:s,onInteractiveChange:l,className:c,children:u,position:d="bottom-left",orientation:f="vertical","aria-label":m}){const p=w4(),{isInteractive:h,minZoomReached:g,maxZoomReached:w,ariaLabelConfig:y}=g4(J3,f4),{zoomIn:b,zoomOut:v,fitView:x}=i5(),_="horizontal"===f?"horizontal":"vertical";return(0,P.jsxs)(I4,{className:a4(["react-flow__controls",_,c]),position:d,style:e,"data-testid":"rf__controls","aria-label":m??y["controls.ariaLabel"],children:[t&&(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(q3,{onClick:()=>{b(),o?.()},className:"react-flow__controls-zoomin",title:y["controls.zoomIn.ariaLabel"],"aria-label":y["controls.zoomIn.ariaLabel"],disabled:w,children:(0,P.jsx)(Z3,{})}),(0,P.jsx)(q3,{onClick:()=>{v(),i?.()},className:"react-flow__controls-zoomout",title:y["controls.zoomOut.ariaLabel"],"aria-label":y["controls.zoomOut.ariaLabel"],disabled:g,children:(0,P.jsx)(G3,{})})]}),n&&(0,P.jsx)(q3,{className:"react-flow__controls-fitview",onClick:()=>{x(a),s?.()},title:y["controls.fitView.ariaLabel"],"aria-label":y["controls.fitView.ariaLabel"],children:(0,P.jsx)(H3,{})}),r&&(0,P.jsx)(q3,{className:"react-flow__controls-interactive",onClick:()=>{p.setState({nodesDraggable:!h,nodesConnectable:!h,elementsSelectable:!h}),l?.(!h)},title:y["controls.interactive.ariaLabel"],"aria-label":y["controls.interactive.ariaLabel"],children:h?(0,P.jsx)(X3,{}):(0,P.jsx)($3,{})}),u]})}K3.displayName="Controls",(0,i.memo)(K3);const e8=(0,i.memo)(function({id:e,x:t,y:n,width:r,height:a,style:o,color:i,strokeColor:s,strokeWidth:l,className:c,borderRadius:u,shapeRendering:d,selected:f,onClick:m}){const{background:p,backgroundColor:h}=o||{},g=i||p||h;return(0,P.jsx)("rect",{className:a4(["react-flow__minimap-node",{selected:f},c]),x:t,y:n,rx:u,ry:u,width:r,height:a,style:{fill:g,stroke:s,strokeWidth:l},shapeRendering:d,onClick:m?t=>m(t,e):void 0})}),t8=e=>e.nodes.map(e=>e.id),n8=e=>e instanceof Function?e:()=>e,r8=(0,i.memo)(function({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:o,shapeRendering:i,NodeComponent:s,onClick:l}){const{node:c,x:u,y:d,width:f,height:m}=g4(t=>{const n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};const r=n.internals.userNode,{x:a,y:o}=n.internals.positionAbsolute,{width:i,height:s}=W1(r);return{node:r,x:a,y:o,width:i,height:s}},f4);return c&&!c.hidden&&Z1(c)?(0,P.jsx)(s,{x:u,y:d,width:f,height:m,style:c.style,selected:!!c.selected,className:r(c),color:t(c),borderRadius:a,strokeColor:n(c),strokeWidth:o,shapeRendering:i,onClick:l,id:c.id}):null});var a8=(0,i.memo)(function({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:o=e8,onClick:i}){const s=g4(t8,f4),l=n8(t),c=n8(e),u=n8(n),d="undefined"==typeof window||window.chrome?"crispEdges":"geometricPrecision";return(0,P.jsx)(P.Fragment,{children:s.map(e=>(0,P.jsx)(r8,{id:e,nodeColorFunc:l,nodeStrokeColorFunc:c,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:o,onClick:i,shapeRendering:d},e))})});const o8=e=>!e.hidden,i8=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?T1(v1(e.nodeLookup,{filter:o8}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}};function s8({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:c,maskColor:u,maskStrokeColor:d,maskStrokeWidth:f,position:m="bottom-right",onClick:p,onNodeClick:h,pannable:g=!1,zoomable:w=!1,ariaLabel:y,inversePan:b,zoomStep:v=1,offsetScale:x=5}){const _=w4(),E=(0,i.useRef)(null),{boundingRect:N,viewBB:M,rfId:I,panZoom:S,translateExtent:k,flowWidth:j,flowHeight:D,ariaLabelConfig:C}=g4(i8,f4),A=e?.width??200,T=e?.height??150,O=N.width/A,L=N.height/T,z=Math.max(O,L),R=z*A,U=z*T,B=x*z,F=N.x-(R-N.width)/2-B,Y=N.y-(U-N.height)/2-B,Q=R+2*B,V=U+2*B,W=`react-flow__minimap-desc-${I}`,Z=(0,i.useRef)(0),G=(0,i.useRef)();Z.current=z,(0,i.useEffect)(()=>{if(E.current&&S)return G.current=function({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=IK(e);return{update:function({translateExtent:e,width:o,height:i,zoomStep:s=1,pannable:l=!0,zoomable:c=!0,inversePan:u=!1}){let d=[0,0];const f=a1().on("start",e=>{"mousedown"!==e.sourceEvent.type&&"touchstart"!==e.sourceEvent.type||(d=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on("zoom",l?a=>{const s=n();if("mousemove"!==a.sourceEvent.type&&"touchmove"!==a.sourceEvent.type||!t)return;const l=[a.sourceEvent.clientX??a.sourceEvent.touches[0].clientX,a.sourceEvent.clientY??a.sourceEvent.touches[0].clientY],c=[l[0]-d[0],l[1]-d[1]];d=l;const f=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),m={x:s[0]-c[0]*f,y:s[1]-c[1]*f},p=[[0,0],[o,i]];t.setViewportConstrained({x:m.x,y:m.y,zoom:s[2]},p,e)}:null).on("zoom.wheel",c?e=>{if("wheel"!==e.sourceEvent.type||!t)return;const r=n(),a=e.sourceEvent.ctrlKey&&Q1()?10:1,o=-e.sourceEvent.deltaY*(1===e.sourceEvent.deltaMode?.05:e.sourceEvent.deltaMode?1:.002)*s,i=r[2]*Math.pow(2,o*a);t.scaleTo(i)}:null);a.call(f,{})},destroy:function(){a.on("zoom",null)},pointer:SK}}({domNode:E.current,panZoom:S,getTransform:()=>_.getState().transform,getViewScale:()=>Z.current}),()=>{G.current?.destroy()}},[S]),(0,i.useEffect)(()=>{G.current?.update({translateExtent:k,width:j,height:D,inversePan:b,pannable:g,zoomStep:v,zoomable:w})},[g,w,b,v,k,j,D]);const H=p?e=>{const[t,n]=G.current?.pointer(e)||[0,0];p(e,{x:t,y:n})}:void 0,$=h?(0,i.useCallback)((e,t)=>{const n=_.getState().nodeLookup.get(t).internals.userNode;h(e,n)},[]):void 0,X=y??C["minimap.ariaLabel"];return(0,P.jsx)(I4,{position:m,style:{...e,"--xy-minimap-background-color-props":"string"==typeof c?c:void 0,"--xy-minimap-mask-background-color-props":"string"==typeof u?u:void 0,"--xy-minimap-mask-stroke-color-props":"string"==typeof d?d:void 0,"--xy-minimap-mask-stroke-width-props":"number"==typeof f?f*z:void 0,"--xy-minimap-node-background-color-props":"string"==typeof r?r:void 0,"--xy-minimap-node-stroke-color-props":"string"==typeof n?n:void 0,"--xy-minimap-node-stroke-width-props":"number"==typeof s?s:void 0},className:a4(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:(0,P.jsxs)("svg",{width:A,height:T,viewBox:`${F} ${Y} ${Q} ${V}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":W,ref:E,onClick:H,children:[X&&(0,P.jsx)("title",{id:W,children:X}),(0,P.jsx)(a8,{onClick:$,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:a,nodeStrokeWidth:s,nodeComponent:l}),(0,P.jsx)("path",{className:"react-flow__minimap-mask",d:`M${F-B},${Y-B}h${Q+2*B}v${V+2*B}h${-Q-2*B}z\n M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}s8.displayName="MiniMap";const l8=(0,i.memo)(s8),c8={[$2.Line]:"right",[$2.Handle]:"bottom-right"};(0,i.memo)(function({nodeId:e,position:t,variant:n=$2.Handle,className:r,style:a,children:o,color:s,minWidth:l=10,minHeight:c=10,maxWidth:u=Number.MAX_VALUE,maxHeight:d=Number.MAX_VALUE,keepAspectRatio:f=!1,resizeDirection:m,autoScale:p=!0,shouldResize:h,onResizeStart:g,onResize:w,onResizeEnd:y}){const b=_5(),v="string"==typeof e?e:b,x=w4(),_=(0,i.useRef)(null),E=n===$2.Handle,N=g4((0,i.useCallback)((M=E&&p,e=>M?`${Math.max(1/e.transform[2],1)}`:void 0),[E,p]),f4);var M;const I=(0,i.useRef)(null),S=t??c8[n];(0,i.useEffect)(()=>{if(_.current&&v)return I.current||(I.current=function({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const o=IK(e);let i={controlDirection:X2("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};return{update:function({controlPosition:e,boundaries:s,keepAspectRatio:l,resizeDirection:c,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:m}){let p,h={...t4},g={...n4};i={boundaries:s,resizeDirection:c,keepAspectRatio:l,controlDirection:X2(e)};let w,y,b,v=null,x=[],_=!1;const E=BK().on("start",e=>{const{nodeLookup:r,transform:a,snapGrid:o,snapToGrid:i,nodeOrigin:s,paneDomNode:l}=n();if(p=r.get(t),!p)return;v=l?.getBoundingClientRect()??null;const{xSnapped:c,ySnapped:d}=X1(e.sourceEvent,{transform:a,snapGrid:o,snapToGrid:i,containerBounds:v});h={width:p.measured.width??0,height:p.measured.height??0,x:p.position.x??0,y:p.position.y??0},g={...h,pointerX:c,pointerY:d,aspectRatio:h.width/h.height},w=void 0,p.parentId&&("parent"===p.extent||p.expandParent)&&(w=r.get(p.parentId),y=w&&"parent"===p.extent?function(e){return[[0,0],[e.measured.width,e.measured.height]]}(w):void 0),x=[],b=void 0;for(const[e,n]of r)if(n.parentId===t&&(x.push({id:e,position:{...n.position},extent:n.extent}),"parent"===n.extent||n.expandParent)){const e=r4(n,p,n.origin??s);b=b?[[Math.min(e[0][0],b[0][0]),Math.min(e[0][1],b[0][1])],[Math.max(e[1][0],b[1][0]),Math.max(e[1][1],b[1][1])]]:e}u?.(e,{...h})}).on("drag",e=>{const{transform:t,snapGrid:a,snapToGrid:o,nodeOrigin:s}=n(),l=X1(e.sourceEvent,{transform:t,snapGrid:a,snapToGrid:o,containerBounds:v}),c=[];if(!p)return;const{x:u,y:f,width:E,height:N}=h,M={},I=p.origin??s,{width:S,height:k,x:j,y:D}=function(e,t,n,r,a,o,i,s){let{affectsX:l,affectsY:c}=t;const{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:m,ySnapped:p}=n,{minWidth:h,maxWidth:g,minHeight:w,maxHeight:y}=r,{x:b,y:v,width:x,height:_,aspectRatio:E}=e;let N=Math.floor(u?m-e.pointerX:0),M=Math.floor(d?p-e.pointerY:0);const I=x+(l?-N:N),S=_+(c?-M:M),k=-o[0]*x,j=-o[1]*_;let D=K2(I,h,g),C=K2(S,w,y);if(i){let e=0,t=0;l&&N<0?e=q2(b+N+k,i[0][0]):!l&&N>0&&(e=J2(b+I+k,i[1][0])),c&&M<0?t=q2(v+M+j,i[0][1]):!c&&M>0&&(t=J2(v+S+j,i[1][1])),D=Math.max(D,e),C=Math.max(C,t)}if(s){let e=0,t=0;l&&N>0?e=J2(b+N,s[0][0]):!l&&N<0&&(e=q2(b+I,s[1][0])),c&&M>0?t=J2(v+M,s[0][1]):!c&&M<0&&(t=q2(v+S,s[1][1])),D=Math.max(D,e),C=Math.max(C,t)}if(a){if(u){const e=K2(I/E,w,y)*E;if(D=Math.max(D,e),i){let e=0;e=!l&&!c||l&&!c&&f?J2(v+j+I/E,i[1][1])*E:q2(v+j+(l?N:-N)/E,i[0][1])*E,D=Math.max(D,e)}if(s){let e=0;e=!l&&!c||l&&!c&&f?q2(v+I/E,s[1][1])*E:J2(v+(l?N:-N)/E,s[0][1])*E,D=Math.max(D,e)}}if(d){const e=K2(S*E,h,g)/E;if(C=Math.max(C,e),i){let e=0;e=!l&&!c||c&&!l&&f?J2(b+S*E+k,i[1][0])/E:q2(b+(c?M:-M)*E+k,i[0][0])/E,C=Math.max(C,e)}if(s){let e=0;e=!l&&!c||c&&!l&&f?q2(b+S*E,s[1][0])/E:J2(b+(c?M:-M)*E,s[0][0])/E,C=Math.max(C,e)}}}M+=M<0?C:-C,N+=N<0?D:-D,a&&(f?I>S*E?M=(e4(l,c)?-N:N)/E:N=(e4(l,c)?-M:M)*E:u?(M=N/E,c=l):(N=M*E,l=c));const A=l?b+N:b,T=c?v+M:v;return{width:x+(l?-N:N),height:_+(c?-M:M),x:o[0]*N*(l?-1:1)+A,y:o[1]*M*(c?-1:1)+T}}(g,i.controlDirection,l,i.boundaries,i.keepAspectRatio,I,y,b),C=S!==E,A=k!==N,T=j!==u&&C,O=D!==f&&A;if(!(T||O||C||A))return;if((T||O||1===I[0]||1===I[1])&&(M.x=T?j:h.x,M.y=O?D:h.y,h.x=M.x,h.y=M.y,x.length>0)){const e=j-u,t=D-f;for(const n of x)n.position={x:n.position.x-e+I[0]*(S-E),y:n.position.y-t+I[1]*(k-N)},c.push(n)}if((C||A)&&(M.width=!C||i.resizeDirection&&"horizontal"!==i.resizeDirection?h.width:S,M.height=!A||i.resizeDirection&&"vertical"!==i.resizeDirection?h.height:k,h.width=M.width,h.height=M.height),w&&p.expandParent){const e=I[0]*(M.width??0);M.x&&M.x<e&&(h.x=e,g.x=g.x-(M.x-e));const t=I[1]*(M.height??0);M.y&&M.y<t&&(h.y=t,g.y=g.y-(M.y-t))}const L=function({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:o}){const i=e-t,s=n-r,l=[i>0?1:i<0?-1:0,s>0?1:s<0?-1:0];return i&&a&&(l[0]=-1*l[0]),s&&o&&(l[1]=-1*l[1]),l}({width:h.width,prevWidth:E,height:h.height,prevHeight:N,affectsX:i.controlDirection.affectsX,affectsY:i.controlDirection.affectsY}),z={...h,direction:L},P=m?.(e,z);!1!==P&&(_=!0,d?.(e,z),r(M,c))}).on("end",e=>{_&&(f?.(e,{...h}),a?.({...h}),_=!1)});o.call(E)},destroy:function(){o.on(".drag",null)}}}({domNode:_.current,nodeId:v,getStoreItems:()=>{const{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:a,domNode:o}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:a,paneDomNode:o}},onChange:(e,t)=>{const{triggerNodeChanges:n,nodeLookup:r,parentLookup:a,nodeOrigin:o}=x.getState(),i=[],s={x:e.x,y:e.y},l=r.get(v);if(l&&l.expandParent&&l.parentId){const t=l.origin??o,n=e.width??l.measured.width??0,c=e.height??l.measured.height??0,u=D2([{id:l.id,parentId:l.parentId,rect:{width:n,height:c,...G1({x:e.x??l.position.x,y:e.y??l.position.y},{width:n,height:c},l.parentId,r,t)}}],r,a,o);i.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*c,e.y):void 0}if(void 0!==s.x&&void 0!==s.y){const e={id:v,type:"position",position:{...s}};i.push(e)}if(void 0!==e.width&&void 0!==e.height){const t={id:v,type:"dimensions",resizing:!0,setAttributes:!m||("horizontal"===m?"width":"height"),dimensions:{width:e.width,height:e.height}};i.push(t)}for(const e of t){const t={...e,type:"position"};i.push(t)}n(i)},onEnd:({width:e,height:t})=>{const n={id:v,type:"dimensions",resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}})),I.current.update({controlPosition:S,boundaries:{minWidth:l,minHeight:c,maxWidth:u,maxHeight:d},keepAspectRatio:f,resizeDirection:m,onResizeStart:g,onResize:w,onResizeEnd:y,shouldResize:h}),()=>{I.current?.destroy()}},[S,l,c,u,d,f,g,w,y,h]);const k=S.split("-");return(0,P.jsx)("div",{className:a4(["react-flow__resize-control","nodrag",...k,n,r]),ref:_,style:{...a,scale:N,...s&&{[E?"backgroundColor":"borderColor"]:s}},children:o})});const u8=(0,i.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,a="start"===e?.position,i="end"===e?.position,{position:s,id:l}="start"==(a?"start":"end")?n?{position:p1.Bottom,id:"bottom"}:r?{position:p1.Right,id:"right"}:{position:p1.Left,id:"left"}:n?{position:p1.Top,id:"top"}:r?{position:p1.Left,id:"left"}:{position:p1.Right,id:"right"};return(0,o.createElement)(o.Fragment,null,i&&(0,o.createElement)(N5,{type:"target",position:s,id:l,style:{background:"#555",border:"2px dotted #555",transition:"all 0.3s ease"},className:`react-flow__handle wcf-handle-${l}`,isConnectable:t}),(0,o.createElement)("div",{className:"wcf-custom-label-node--wrapper bg-primary-50 py-1 px-3 border border-primary-300 rounded-md text-primary-500 text-sm font-medium","aria-label":e.label},e.label),a&&(0,o.createElement)(N5,{type:"source",position:s,id:l,style:{border:"2px dotted #555",transition:"all 0.3s ease"},className:`react-flow__handle wcf-handle-${l}`,isConnectable:t}))});function d8({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"}))}const f8=i.forwardRef(d8),m8=(0,i.memo)(({data:e,isConnectable:t})=>{const n="LR"===e.direction?"target":"source",r="LR"===e.direction?"source":"target",a=(Array.isArray(e?.conditions)?e.conditions.length:0)+(e?.defaultStep?1:0),i=a?(0,z.sprintf)(/* translators: %d: number of dynamic-offer conditions on this checkout */ /* translators: %d: number of dynamic-offer conditions on this checkout */ |
| 80 |
(0,z._n)("%d condition","%d conditions",a,"cartflows"),a):"";return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(N5,{type:n,position:p1.Left,style:{background:"#555"},isConnectable:t,className:"react-flow__handle wcf-handle-left"}),(0,o.createElement)("div",{className:"wcf-custom-node-wrapper wcf-conditional-node",style:{width:"80px",margin:"auto",height:"80px",display:"flex",alignItems:"center",justifyContent:"center",transform:"rotate(45deg)"}},(0,o.createElement)("div",{className:"wcf-custom-node-design"},(0,o.createElement)(C,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.checkoutId}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.checkoutId}`},title:"Dynamic Offers",rel:"noreferrer",className:"wcf-custom-node-content bg-white border border-gray-200 shadow-md",style:{width:"80px",margin:"auto",height:"80px",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer"}},(0,o.createElement)(f8,{className:"w-8 h-8 !fill-[none] stroke-2 text-gray-500",style:{transform:"rotate(-45deg)"}})))),(0,o.createElement)("div",{className:"wcf-custom-node-label",style:{fontSize:"11px",fontWeight:"600",marginTop:"8px",textAlign:"center"}},e.label||(0,z.__)("Dynamic Offers","cartflows")),i&&(0,o.createElement)("div",{className:"wcf-conditional-node__summary",style:{fontSize:"10px",color:"#6B7280",marginTop:"2px",textAlign:"center"}},i),(0,o.createElement)(N5,{type:r,position:p1.Right,style:{background:"#555"},isConnectable:t,className:"react-flow__handle wcf-handle-right"}))}),p8="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFQUVBRUEiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOEgwVjEwWiIgZmlsbD0iI0U2RUFFRCIvPjxjaXJjbGUgY3g9IjE0IiBjeT0iMTQiIHI9IjQiIGZpbGw9IiNGRjNCMzAiLz48Y2lyY2xlIGN4PSIyNyIgY3k9IjE0IiByPSI0IiBmaWxsPSIjRkMwIi8+PGNpcmNsZSBjeD0iNDAiIGN5PSIxNCIgcj0iNCIgZmlsbD0iIzRDRDk2NCIvPjxyZWN0IHg9IjY0IiB5PSIxMCIgd2lkdGg9IjEwNyIgaGVpZ2h0PSI3IiByeD0iMSIgZmlsbD0iI2ZmZiIvPjxyZWN0IHg9IjIzIiB5PSIyMjAiIHdpZHRoPSIxNTQiIGhlaWdodD0iMjAiIHJ4PSIyIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTY3LjIwNiAyMzMuNWgyLjc5NmMxLjQ3IDAgMi4yNTMtLjc2NyAyLjI1My0xLjgwOSAwLS45NjgtLjY5My0xLjU1My0xLjQzOC0xLjU4OHYtLjA2NGMuNjgtLjE1NCAxLjE4My0uNjM2IDEuMTgzLTEuNDA3IDAtLjk4MS0uNzI5LTEuNjc3LTIuMTc0LTEuNjc3aC0yLjYydjYuNTQ1Wm0xLjM4My0xLjEzMXYtMS43MzloMS4xNmMuNjY1IDAgMS4wNzguMzgzIDEuMDc4LjkyNCAwIC40OTItLjMzNi44MTUtMS4xMS44MTVINjguNTlabTAtMi42NzV2LTEuNjIxaDEuMDUyYy42MTQgMCAuOTYyLjMxNy45NjIuNzkgMCAuNTE3LS40MjIuODMxLS45ODguODMxSDY4LjU5Wm03LjY5IDEuNzE2Yy4wMDIuNjU4LS40NDggMS4wMDMtLjkzNyAxLjAwMy0uNTE1IDAtLjg0Ny0uMzYxLS44NS0uOTM5di0yLjg4M0g3My4xM3YzLjEyNmMuMDAzIDEuMTQ3LjY3NSAxLjg0NyAxLjY2MiAxLjg0Ny43MzkgMCAxLjI2OS0uMzggMS40OS0uOTU2aC4wNXYuODkyaDEuMzA4di00LjkwOWgtMS4zNjJ2Mi44MTlabTMuMjkgMy45MzFjMS4wMTQgMCAxLjU1LS41MTggMS44MjgtMS4zMWwxLjkwOS01LjQzNC0xLjQ0Mi0uMDA2LTEuMDI2IDMuNjA1aC0uMDVsLTEuMDE3LTMuNjA1aC0xLjQzMmwxLjc2MSA1LjA1LS4wOC4yMDdjLS4xNzkuNDYxLS41Mi40ODMtMSAuMzM2bC0uMzA3IDEuMDE2Yy4xOTUuMDgzLjUxMS4xNDEuODU2LjE0MVptMTIuMDE3LTguMzg2aC0xLjM3OHY0LjExNmgtLjA1N2wtMi44MjYtNC4xMTZoLTEuMjE0djYuNTQ1aDEuMzg0di00LjEyaC4wNDhsMi44NDcgNC4xMmgxLjE5NnYtNi41NDVabTMuMzM1IDYuNjQxYzEuNDkgMCAyLjQxNy0xLjAyIDIuNDE3LTIuNTMxIDAtMS41MjItLjkyNy0yLjUzOC0yLjQxNi0yLjUzOC0xLjQ5IDAtMi40MTcgMS4wMTYtMi40MTcgMi41MzggMCAxLjUxMS45MjcgMi41MzEgMi40MTYgMi41MzFabS4wMDctMS4wNTVjLS42ODcgMC0xLjAzOS0uNjI5LTEuMDM5LTEuNDg2IDAtLjg1Ni4zNTItMS40ODkgMS4wMzktMS40ODkuNjc0IDAgMS4wMjYuNjMzIDEuMDI2IDEuNDg5IDAgLjg1Ny0uMzUyIDEuNDg2LTEuMDI2IDEuNDg2Wm00LjE0Ljk1OWgxLjQzOWwuODQzLTMuMDg3aC4wNjFsLjg0NCAzLjA4N2gxLjQ0MWwxLjMzMy00LjkwOWgtMS4zNzRsLS43NDggMy4yNzloLS4wNDJsLS44MDUtMy4yNzloLTEuMzUybC0uNzkzIDMuMjk4aC0uMDQ0bC0uNzYxLTMuMjk4aC0xLjM3OGwxLjMzNiA0LjkwOVptOS4wNzEtMi42MjRjMCAxLjU4OC40MTggMi45MDggMS4yOTEgNC4wNDZoMS4zMDFjLS42NjgtLjg0NC0xLjE3Ni0yLjUzMS0xLjE3Ni00LjA0NiAwLTEuNTEyLjUwOC0zLjE5OSAxLjE3Ni00LjA0M2gtMS4zMDFjLS44NzMgMS4xMzgtMS4yOTEgMi40NTUtMS4yOTEgNC4wNDNabTkuMTgzLTEuNjNjLS4xODMtMS41MTItMS4zMjctMi4zODEtMi44NDItMi4zODEtMS43MjkgMC0zLjA0OSAxLjIyMS0zLjA0OSAzLjM2MiAwIDIuMTM1IDEuMjk4IDMuMzYyIDMuMDQ5IDMuMzYyIDEuNjc4IDAgMi42OTEtMS4xMTUgMi44NDItMi4zMmwtMS40LS4wMDZjLS4xMzEuNy0uNjgxIDEuMTAyLTEuNDE5IDEuMTAyLS45OTQgMC0xLjY2OS0uNzM4LTEuNjY5LTIuMTM4IDAtMS4zNjEuNjY1LTIuMTM4IDEuNjc4LTIuMTM4Ljc1OCAwIDEuMzA0LjQzOCAxLjQxIDEuMTU3aDEuNFptLjc0My0xLjE1aDIuMDA0djUuNDA0aDEuMzY4di01LjQwNGgyLjAwM3YtMS4xNDFoLTUuMzc1djEuMTQxWm02LjU4IDUuNDA0LjQ4Ni0xLjQ5M2gyLjM2MmwuNDg2IDEuNDkzaDEuNDgzbC0yLjI1Ny02LjU0NWgtMS43ODNsLTIuMjYgNi41NDVoMS40ODNabS44MzgtMi41NzMuODA1LTIuNDc3aC4wNTFsLjgwNiAyLjQ3N2gtMS42NjJabTcuMDM2LS43YzAtMS41ODgtLjQxOS0yLjkwOC0xLjI5MS00LjA0NmgtMS4zMDFjLjY2OC44NDQgMS4xNzYgMi41MzEgMS4xNzYgNC4wNDYgMCAxLjUxMi0uNTA4IDMuMTk5LTEuMTc2IDQuMDQzaDEuMzAxYy44NzItMS4xMzggMS4yOTEtMi40NTQgMS4yOTEtNC4wNDNaIiBmaWxsPSIjZmZmIi8+PHJlY3QgeD0iNjUiIHk9IjE2NCIgd2lkdGg9IjcwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iNzUiIHk9IjU3IiB3aWR0aD0iNTAiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSI1MCIgeT0iNDMiIHdpZHRoPSIxMDAiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiMyMjcxQjEiLz48cmVjdCB4PSIyMy43NSIgeT0iNzYuNzUiIHdpZHRoPSIxNTIuNSIgaGVpZ2h0PSI2MS41IiByeD0iMS4yNSIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMjI3MUIxIiBzdHJva2Utd2lkdGg9IjEuNSIvPjxwYXRoIGQ9Im05NS44NzcgMTEzLjQ4MyAxOS4xMTMtMTkuMzg0IDI4LjM0OSAzMi4xNTFINTguODc2bDI0LjUzLTIzLjM1MSAxMS40MjcgMTAuNjA3LjUzMy40OTUuNTEtLjUxOFoiIGZpbGw9IiNmZmYiIHN0cm9rZT0iIzIyNzFCMSIgc3Ryb2tlLXdpZHRoPSIxLjUiLz48cGF0aCBkPSJNMTAxLjI1IDk1YzAgMi45NjItMi4xODcgNS4yNS00Ljc1IDUuMjVzLTQuNzUtMi4yODgtNC43NS01LjI1IDIuMTg3LTUuMjUgNC43NS01LjI1IDQuNzUgMi4yODggNC43NSA1LjI1WiIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMjI3MUIxIiBzdHJva2Utd2lkdGg9IjEuNSIvPjxwYXRoIGQ9Im0xNjYuNzI3IDExMS4wNiAzLjA1My0zLjA2LTMuMDUzLTMuMDYuOTQtLjk0IDQgNC00IDQtLjk0LS45NFpNMzQuMjcyIDExMS4wNiAzMS4yMTkgMTA4bDMuMDUzLTMuMDYtLjk0LS45NC00IDQgNCA0IC45NC0uOTRaIiBmaWxsPSIjMjI3MUIxIi8+PGNpcmNsZSBjeD0iOTEuNSIgY3k9IjE0Ny41IiByPSIxLjUiIGZpbGw9IiMyMjcxQjEiLz48Y2lyY2xlIGN4PSI5OS41IiBjeT0iMTQ3LjUiIHI9IjEuNSIgZmlsbD0iIzIyNzFCMSIvPjxjaXJjbGUgY3g9IjEwNy41IiBjeT0iMTQ3LjUiIHI9IjEuNSIgZmlsbD0iIzIyNzFCMSIvPjxyZWN0IHg9IjIzIiB5PSIxNzgiIHdpZHRoPSIxNTQiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSIyMyIgeT0iMTkyIiB3aWR0aD0iMTU0IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iMjMiIHk9IjIwNiIgd2lkdGg9IjE1NCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0U2RUFFRCIvPjwvc3ZnPg==";function h8({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.125 2.25h-4.5c-.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.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12"}))}const g8=i.forwardRef(h8);function w8({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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 y8=i.forwardRef(w8);function b8({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.633 10.25c.806 0 1.533-.446 2.031-1.08a9.041 9.041 0 0 1 2.861-2.4c.723-.384 1.35-.956 1.653-1.715a4.498 4.498 0 0 0 .322-1.672V2.75a.75.75 0 0 1 .75-.75 2.25 2.25 0 0 1 2.25 2.25c0 1.152-.26 2.243-.723 3.218-.266.558.107 1.282.725 1.282m0 0h3.126c1.026 0 1.945.694 2.054 1.715.045.422.068.85.068 1.285a11.95 11.95 0 0 1-2.649 7.521c-.388.482-.987.729-1.605.729H13.48c-.483 0-.964-.078-1.423-.23l-3.114-1.04a4.501 4.501 0 0 0-1.423-.23H5.904m10.598-9.75H14.25M5.904 18.5c.083.205.173.405.27.602.197.4-.078.898-.523.898h-.908c-.889 0-1.713-.518-1.972-1.368a12 12 0 0 1-.521-3.507c0-1.553.295-3.036.831-4.398C3.387 9.953 4.167 9.5 5 9.5h1.053c.472 0 .745.556.5.96a8.958 8.958 0 0 0-1.302 4.665c0 1.194.232 2.333.654 3.375Z"}))}const v8=i.forwardRef(b8),x8=Ua("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]),_8=Ua("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]),E8=Ua("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]),N8=Ua("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),M8=Ua("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]),I8=Ua("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),S8=Ua("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),k8=Ua("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),j8=Ua("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]),D8=e=>{const t=Number(e)||0;return 0===t?"—":Number.isInteger(t)?`$${t}`:`$${t.toFixed(2)}`},C8=({bump:e,settingsUrl:t})=>{const n=!e.revenue&&!e.conversions;return(0,o.createElement)(C,{to:{pathname:"admin.php",search:t},className:"wcf-bump-row bg-background-secondary border border-solid border-border-subtle rounded-md px-3 py-2 no-underline hover:bg-background-tertiary",title:e.title},(0,o.createElement)(Gp,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,o.createElement)("span",{className:"wcf-bump-row__icon bg-primary-25 p-1 rounded border border-solid border-primary-300 inline-flex items-center justify-center shrink-0","aria-label":(0,z.__)("Order bump","cartflows")},(0,o.createElement)(j8,{className:"w-3 h-3 stroke-2 text-primary-500"})),(0,o.createElement)(th,{as:"span",size:14,color:n?"tertiary":"primary",className:"wcf-bump-row__title truncate flex-1 text-left"},e.title),(0,o.createElement)(th,{as:"span",size:12,color:n?"tertiary":"secondary",className:"tabular-nums w-10 text-right"},(e=>{const t=parseInt(e,10)||0;return 0===t?"—":String(t)})(e.conversions)),(0,o.createElement)(th,{as:"span",size:14,weight:n?400:600,color:n?"tertiary":"primary",className:"tabular-nums w-14 text-right"},D8(e.revenue)),(0,o.createElement)(bU,{className:"w-3 h-3 stroke-2 text-text-tertiary shrink-0"})))},A8=({stepId:e,flowId:t,flowType:n,bumps:r=[],compact:a=!1})=>{const[s,l]=(0,i.useState)(!1);if(!Array.isArray(r)||0===r.length)return null;const c=r.reduce((e,t)=>e+(Number(t.revenue)||0),0),u="storeCheckout"===n?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}&step_id=${e}&tab=order_bumps`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&step_id=${e}&tab=order_bumps`;return a?(0,o.createElement)(C,{to:{pathname:"admin.php",search:u},className:"wcf-bumps-section wcf-bumps-section--compact px-3 py-2 border-0 border-t border-b border-solid border-border-subtle no-underline hover:bg-background-secondary"},(0,o.createElement)(Gp,{containerType:"flex",direction:"row",align:"center",justify:"between"},(0,o.createElement)(Gp,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,o.createElement)(j8,{className:"w-3.5 h-3.5 stroke-2 text-text-primary"}),(0,o.createElement)(th,{as:"span",size:12,weight:500,color:"primary"},(0,z.__)("Order Bumps","cartflows")),(0,o.createElement)(th,{as:"span",size:12,color:"secondary",className:"tabular-nums"},"(",r.length,")")),(0,o.createElement)(th,{as:"span",size:12,color:"secondary",className:"tabular-nums"},D8(c)))):(0,o.createElement)(Gp,{containerType:"flex",direction:"column",className:"wcf-bumps-section px-4 py-3 border-0 border-t border-b border-solid border-border-subtle "+(s?"":"!gap-0")},(0,o.createElement)(Gp,{containerType:"flex",direction:"row",align:"center",justify:"between",className:s?"mb-2":""},(0,o.createElement)(Gp,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,o.createElement)(j8,{className:"w-4 h-4 stroke-2 text-text-primary"}),(0,o.createElement)(th,{as:"span",size:14,weight:500,color:"primary"},(0,z.__)("Order Bumps","cartflows")),(0,o.createElement)(th,{as:"span",size:12,color:"secondary",className:"tabular-nums"},"(",r.length,")")),(0,o.createElement)(Gp,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,o.createElement)(th,{as:"span",size:12,color:"tertiary"},(0,z.__)("Total","cartflows")),(0,o.createElement)(th,{as:"span",size:12,weight:500,color:"primary",className:"tabular-nums"},D8(c)),(0,o.createElement)(Va,{variant:"ghost",size:"xs",type:"button",onClick:()=>l(e=>!e),"aria-expanded":s,"aria-label":s?(0,z.__)("Collapse order bumps","cartflows"):(0,z.__)("Expand order bumps","cartflows"),icon:(0,o.createElement)(hm,{className:"stroke-2 transition-transform duration-300 ease-in-out "+(s?"rotate-180":"")}),className:"wcf-bumps-section__toggle !p-0.5 text-text-tertiary hover:text-text-primary"}))),(0,o.createElement)("div",{className:"wcf-bumps-section__body grid transition-[grid-template-rows] duration-300 ease-in-out "+(s?"grid-rows-[1fr]":"grid-rows-[0fr]"),"aria-hidden":!s},(0,o.createElement)("div",{className:"overflow-hidden min-h-0"},(0,o.createElement)(Gp,{containerType:"flex",direction:"column",gap:"xs"},r.map(e=>(0,o.createElement)(C8,{key:e.id,bump:e,settingsUrl:u}))),(0,o.createElement)(Gp,{containerType:"flex",direction:"row",align:"center",justify:"end",gap:"sm",className:"pt-1.5 mt-0.5"},(0,o.createElement)(th,{as:"span",size:12,color:"tertiary",className:"uppercase tracking-wide w-10 text-right"},(0,z.__)("Sales","cartflows")),(0,o.createElement)(th,{as:"span",size:12,color:"tertiary",className:"uppercase tracking-wide w-14 text-right"},(0,z.__)("Revenue","cartflows")),(0,o.createElement)("span",{className:"w-3","aria-hidden":"true"})))))},T8={cloneStepRequest({stepId:e,flowId:t,action:n="cartflows_clone_step",controlId:r}){if(!wcfCartflowsPro())return Promise.resolve(null);let a=cartflows_admin.clone_step_nonce;const o=new window.FormData;return"cartflows_clone_ab_test_step"===n&&(a=cartflows_admin.wcf_clone_ab_test_step_nonce,o.append("control_id",r)),o.append("action",n),o.append("security",a),o.append("step_id",e),o.append("post_id",t),window.wcfAction="cloneStep",L()({url:cartflows_admin.ajax_url,method:"POST",body:o})},createEventHandlers:(e,t,n,r,a={})=>({clone:async function(n){if(n.preventDefault(),!wcfCartflowsPro())return null;const a=n.currentTarget.getAttribute("data-action");if(await t({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")})){r(!0);let t=cartflows_admin.clone_step_nonce;const n=new window.FormData;"cartflows_clone_ab_test_step"===a&&(t=cartflows_admin.wcf_clone_ab_test_step_nonce,n.append("control_id",e?.control_id)),n.append("action",a),n.append("security",t),n.append("step_id",e?.step_id),n.append("post_id",e?.flow_id),window.wcfAction="cloneStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{window.location.reload()}).catch(e=>{console.error("Cloning step failed:",e),r(!1)}))}},delete:a.delete||async function(n){n.preventDefault();const a=n.currentTarget.getAttribute("data-action");if(await t({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")})){r(!0);let t=cartflows_admin.delete_step_nonce;const n=new window.FormData;"cartflows_delete_ab_test_step"===a&&(t=cartflows_admin.wcf_delete_ab_test_step_nonce,n.append("control_id",e?.control_id)),n.append("action",a),n.append("security",t),n.append("step_id",e?.step_id),n.append("post_id",e?.flow_id),window.wcfAction="deleteStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{window.location.reload()}).catch(e=>{console.error("Delete step failed:",e),r(!1)}))}},abtest:function(t){if(t.preventDefault(),!wcfCartflowsTypePro())return null;r(!0);const n=new window.FormData;n.append("action","cartflows_create_ab_test_variation"),n.append("security",cartflows_admin.wcf_create_ab_test_variation_nonce),n.append("step_id",e?.step_id),n.append("flow_id",e?.flow_id),window.wcfAction="abtestStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{window.location.reload()}).catch(e=>{console.error("Create A/B variation failed:",e),r(!1)}))},winner:async function(n){if(n.preventDefault(),await t({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.__)("Declare Winner","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})){r(!0);const t=new window.FormData;t.append("action","cartflows_declare_ab_test_winner"),t.append("security",cartflows_admin.wcf_declare_ab_test_winner_nonce),t.append("step_id",e?.step_id),t.append("flow_id",e?.flow_id),window.wcfAction="winnerStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{pp.success((0,z.__)("Winner declared successfully!","cartflows")),window.location.reload()}).catch(e=>{console.error("Declare A/B test winner failed:",e),pp.error((0,z.__)("Failed to declare winner. Please try again.","cartflows")),r(!1)}))}},archived:async function(n){if(n.preventDefault(),await t({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")})){r(!0);const t=new window.FormData;t.append("action","cartflows_archive_ab_test_step"),t.append("security",cartflows_admin.wcf_archive_ab_test_step_nonce),t.append("step_id",e?.step_id),t.append("post_id",e?.flow_id),window.wcfAction="archiveStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{window.location.reload()}).catch(e=>{console.error("Archiving step failed:",e),r(!1)}))}},automation:()=>{n.push({pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&automation=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&automation=${e?.step_id}`})}}),async performDelete(e,t,n,r={}){n(!0);let o=cartflows_admin.delete_step_nonce;const i=new window.FormData;"cartflows_delete_ab_test_step"===t&&(o=cartflows_admin.wcf_delete_ab_test_step_nonce,i.append("control_id",e?.control_id)),i.append("action",t),i.append("security",o),i.append("step_id",e?.step_id),i.append("post_id",e?.flow_id),Object.keys(r).length>0&&i.append("redirect_updates",JSON.stringify(r)),window.wcfAction="deleteStep";try{const e=(await Promise.resolve().then(a.t.bind(a,1455,23))).default;await e({url:cartflows_admin.ajax_url,method:"POST",body:i}),window.location.reload()}catch(e){console.error("Delete step failed:",e),n(!1)}},nodeHtml(e,t,n,r,a,i,s,l,c,u,d,f,m=[],p=!1,h=[],g="",w=!1,y=!1){const b=jh(e?.step_type,g),v=()=>{let e=0;return c&&c.visits&&(e=c.visits.total_visits||0),e},x=()=>{let e=0;return c&&c.visits&&(e=c.visits.conversions||0),e},_=()=>c&&c?.visits?.revenue?fh(c.visits.revenue):0,E=e?.step_type||"",N=kh(e?.step_title||"");return(0,o.createElement)("div",{className:`wcf-custom-node-wrapper${p?" wcf-custom-node-wrapper--compact":""}${w?" wcf-custom-node-wrapper--locked pointer-events-none touch-none opacity-60":""}`},(0,o.createElement)("div",{className:"wcf-custom-node-design"},(0,o.createElement)("div",{className:"wcf-node-actions absolute flex bg-white left-11 -top-16 rounded-md py-0.5 px-1.5 sm:hidden lg:hidden"},(0,o.createElement)(Ja,{content:(0,z.__)("View Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)("a",{href:n,target:"_blank",rel:"noreferrer","aria-label":(0,z.__)("View Page","cartflows"),className:"wcf-canvas--view-step text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,o.createElement)(I8,{className:"w-5 h-5"}))),(0,o.createElement)(Ja,{content:b?Dh():(0,z.__)("Edit Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)("a",{href:b?"#!":r,target:b?void 0:"_blank",rel:"noreferrer","aria-label":(0,z.__)("Edit Page","cartflows"),"aria-disabled":b,tabIndex:b?-1:0,className:"wcf-canvas--edit-step p-2 block "+(b?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer")},(0,o.createElement)(S8,{className:"w-5 h-5"}))),(0,o.createElement)(Ja,{content:(0,z.__)("Edit Settings","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)(C,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`},rel:"noreferrer","aria-label":(0,z.__)("Edit Settings","cartflows"),className:"wcf-canvas--edit-settings relative text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,o.createElement)(k8,{className:"w-5 h-5"})))),(0,o.createElement)("div",{className:"wcf-custom-node-content bg-white border border-gray-200 rounded-lg shadow-md"+(f?" opacity-50":"")},(0,o.createElement)("div",{className:"wcf-custom-node-content--header flex flex-col gap-3 border-b border-gray-200 py-4 px-5"},(0,o.createElement)("div",{className:"wcf-node-step--info-wrapper flex flex-row items-center gap-4 w-full"},(0,o.createElement)("div",{className:"wcf-node-step--icon bg-primary-25 p-2.5 rounded border border-primary-300"},(e=>{let t="";const n="w-5 h-5 stroke-2 text-primary-500";switch(e){case"landing":t=(0,o.createElement)(WV,{className:n});break;case"optin":t=(0,o.createElement)(g8,{className:n});break;case"checkout":t=(0,o.createElement)(mZ,{className:n});break;case"upsell":t=(0,o.createElement)(Lm,{className:n});break;case"downsell":t=(0,o.createElement)(y8,{className:n});break;case"thankyou":t=(0,o.createElement)(v8,{className:n});break;default:t=(0,o.createElement)(vV,{className:n})}return t})(E)),(0,o.createElement)("div",{className:"w-full flex flex-col gap-1"},(0,o.createElement)("div",{className:"wcf-node-step--type flex items-center gap-2"},(0,o.createElement)("span",{className:"text-xs font-normal text-gray-400"},(M=E,{landing:(0,z.__)("Landing","cartflows"),optin:(0,z.__)("Optin","cartflows"),checkout:(0,z.__)("Checkout","cartflows"),upsell:(0,z.__)("Upsell","cartflows"),downsell:(0,z.__)("Downsell","cartflows"),thankyou:(0,z.__)("Thank You","cartflows")}[M]||M)),u&&(0,o.createElement)("span",{className:"wcf-flow-badge wcf-badge wcf-badge--error !text-[10px] !px-2 !py-px wcf-invalid-sequence-badge"},(0,o.createElement)(dW,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"}),(0,z.__)("Invalid Position","cartflows"))),(0,o.createElement)("div",{className:"wcf-node-step--title text-left"},(0,o.createElement)("span",{className:"font-semibold text-sm text-gray-800 hover:text-gray-800"},N)))),function(){let e=null;return d||(e=(0,o.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-no-product-badge"},(0,z.__)("No Product Assigned","cartflows"))),e}(),y&&(0,o.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-global-checkout-error-badge"},(0,z.__)("Store Checkout - Remove selected checkout product","cartflows")),f&&(0,o.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-disabled-step-badge"},(0,z.__)("Disabled","cartflows")),m&&m.length>0&&(0,o.createElement)("div",{className:"wcf-node-warnings flex flex-wrap gap-1"},m.slice(0,2).map((e,t)=>(0,o.createElement)("span",{key:t,className:`wcf-badge wcf-badge--${"error"===e.severity?"error":"warning"} wcf-warning-pill !text-[10px] !px-2 !py-px`,title:e.message},e.message)),m.length>2&&(0,o.createElement)("span",{className:"wcf-badge wcf-warning-pill-more !text-[10px] !px-2 !py-px",title:m.slice(2).map(e=>e.message).join(", ")},"+",m.length-2))),(0,o.createElement)("div",{className:"wcf-custom-node-content--stats flex text-center justify-around items-center py-4 px-5"},(0,o.createElement)("div",{className:"wcf-step--stats-content--stat-view"},(0,o.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,z.__)("Views","cartflows")),(0,o.createElement)("div",{className:"font-semibold text-base text-gray-800"},v())),(0,o.createElement)("div",{className:"wcf-step--stats-content--stat-conversation"},(0,o.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,z.__)("Conversions","cartflows")),(0,o.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==E?x():"-")),(0,o.createElement)("div",{className:"wcf-step--stats-content--stat-revenue"},(0,o.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,z.__)("Revenue","cartflows")),(0,o.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==E&&"landing"!==E?_():"-"))),p&&(0,o.createElement)("div",{className:"wcf-custom-node-content--stats-compact flex items-center justify-center gap-2 py-2 px-4 border-t border-gray-200 text-xs text-gray-600"},(0,o.createElement)("span",{className:"tabular-nums"},(0,o.createElement)("span",{className:"font-semibold text-gray-800"},v())," ",(0,o.createElement)("span",{className:"text-gray-400"},(0,z.__)("views","cartflows"))),"thankyou"!==E&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("span",{className:"text-gray-300"},"·"),(0,o.createElement)("span",{className:"tabular-nums"},(0,o.createElement)("span",{className:"font-semibold text-gray-800"},x())," ",(0,o.createElement)("span",{className:"text-gray-400"},(0,z.__)("conv.","cartflows")))),"thankyou"!==E&&"landing"!==E&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("span",{className:"text-gray-300"},"·"),(0,o.createElement)("span",{className:"font-semibold text-gray-800 tabular-nums"},_()))),"checkout"===E&&Array.isArray(h)&&h.length>0&&(0,o.createElement)(A8,{stepId:e?.step_id,flowId:e?.flow_id,flowType:e?.flow_type,bumps:h,compact:p}),(0,o.createElement)("div",{className:"wcf-custom-node-content--footer flex text-center justify-around items-center border-t border-gray-200 py-4 px-5"},(0,o.createElement)(Ja,{content:(0,z.__)("View Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)("a",{href:n,target:"_blank",rel:"noreferrer","aria-label":(0,z.__)("View Page","cartflows"),className:"wcf-canvas--view-step text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 inline-flex items-center justify-center rounded-md"},(0,o.createElement)(I8,{className:"w-5 h-5"}))),(0,o.createElement)(Ja,{content:b?Dh():(0,z.__)("Edit Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)("a",{href:b?"#!":r,target:b?void 0:"_blank",rel:"noreferrer","aria-label":(0,z.__)("Edit Page","cartflows"),"aria-disabled":b,tabIndex:b?-1:0,className:"wcf-canvas--edit-step p-2 inline-flex items-center justify-center rounded-md "+(b?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer")},(0,o.createElement)(S8,{className:"w-5 h-5"}))),(0,o.createElement)(Ja,{content:(0,z.__)("Edit Settings","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)(C,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`},rel:"noreferrer","aria-label":(0,z.__)("Edit Settings","cartflows"),className:"wcf-canvas--edit-settings relative text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 inline-flex items-center justify-center rounded-md"},(0,o.createElement)(k8,{className:"w-5 h-5"}))),(a?Object.keys(a):[]).map(t=>{const n=a[t],r=n?.class;let i=!1,c=!1;if((!wcfCartflowsPro()&&n?.pro||"abtest"===n?.slug&&!wcfCartflowsTypePro())&&(i=!0),wcfCartflowsPro()&&n?.pro&&"Activated"!==l&&(c=!0),"automation"===n?.slug&&"downsell"!==E&&"upsell"!==E&&"checkout"!==E)return null;const u=i||c,d=u?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary cursor-pointer "+("delete"===n?.slug?"hover:bg-field-background-error hover:text-button-danger":"hover:bg-badge-hover-gray hover:text-text-primary");let f=n?.text;return i?f=(0,z.sprintf)( |
| 81 |
// translators: %s: action name (e.g. Clone, A/B Test). |
| 82 |
// translators: %s: action name (e.g. Clone, A/B Test). |
| 83 |
(0,z.__)("Upgrade to CartFlows Pro to use %s.","cartflows"),n?.text):c&&(f=(0,z.sprintf)( |
| 84 |
// translators: %s: action name (e.g. Clone, A/B Test). |
| 85 |
// translators: %s: action name (e.g. Clone, A/B Test). |
| 86 |
(0,z.__)("Activate your CartFlows license to use %s.","cartflows"),n?.text)),(0,o.createElement)(Ja,{key:n?.slug,content:f,placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)("a",{href:n?.link,className:`wcf-step__action-btn relative p-2 inline-flex items-center justify-center rounded-md ${r} ${d}`,"aria-label":n?.text,"data-id":e?.step_id,"data-control-id":e?.step_id,onClick:e=>{i||c?e.preventDefault():"#"===n?.link&&s&&s[n?.slug]&&(e.preventDefault(),s[n?.slug](e))},"data-action":n?.ajaxcall},function(e){let t="";switch(e){case"clone":t=(0,o.createElement)(zZ,{className:"h-5 w-5"});break;case"delete":t=(0,o.createElement)(Qa,{className:"h-5 w-5"});break;case"abtest":t=(0,o.createElement)(x8,{className:"h-5 w-5"});break;case"archived":t=(0,o.createElement)(_8,{className:"h-5 w-5"});break;case"winner":t=(0,o.createElement)(E8,{className:"h-5 w-5"});break;case"automation":t=(0,o.createElement)(N8,{className:"h-5 w-5"});break;default:t=(0,o.createElement)(M8,{className:"h-5 w-5"})}return t}(n?.slug),u&&(0,o.createElement)(d$,{className:"absolute -top-1 -right-1 w-4 h-4 text-brand-600 fill-brand-600","aria-label":(0,z.__)("Pro feature","cartflows")})))})))));var M}},O8=T8,L8=(0,i.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,a=r?"target":"source",s=r?"source":"target",[,l]=(0,i.useState)(!1),c=$V(),u=(0,f$.W6)(),[{license_status:d}]=g(),f=O8.createEventHandlers(e,c,u,l);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(N5,{type:a,position:p1.Left,id:"left",style:{background:"#555",border:"2px dotted #555",transition:"all 0.3s ease",visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-left",isConnectable:t&&!n}),(0,o.createElement)(N5,{type:"target",position:p1.Top,id:"top",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t&&n}),O8.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},p8,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,f,d,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,void 0,void 0,e.is_locked),(0,o.createElement)("div",{className:"wcf-custom-node-label",title:e.label},e?.label),(0,o.createElement)(N5,{type:s,position:p1.Right,id:"right",style:{border:"2px dotted #555",transition:"all 0.3s ease",visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-right",isConnectable:t&&!n}),(0,o.createElement)(N5,{type:"source",position:p1.Bottom,id:"bottom",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-bottom",isConnectable:t&&n}))}),z8="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFQUVBRUEiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOEgwVjEwWiIgZmlsbD0iI0U2RUFFRCIvPjxyZWN0IHg9IjY0IiB5PSIxMCIgd2lkdGg9IjEwNyIgaGVpZ2h0PSI3IiByeD0iMSIgZmlsbD0iI2ZmZiIvPjxjaXJjbGUgY3g9IjE0IiBjeT0iMTQiIHI9IjQiIGZpbGw9IiNGRjNCMzAiLz48Y2lyY2xlIGN4PSIyNyIgY3k9IjE0IiByPSI0IiBmaWxsPSIjRkMwIi8+PGNpcmNsZSBjeD0iNDAiIGN5PSIxNCIgcj0iNCIgZmlsbD0iIzRDRDk2NCIvPjxyZWN0IHg9IjIzIiB5PSIyMTkiIHdpZHRoPSIxNTQiIGhlaWdodD0iMjAiIHJ4PSIyIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTgxLjY4NiAyMzIuNWgxLjM4M3YtMi4xMjJoMS4xNjRjMS41MDUgMCAyLjM4LS44OTggMi4zOC0yLjIwNSAwLTEuMzAxLS44NTktMi4yMTgtMi4zNDUtMi4yMThoLTIuNTgydjYuNTQ1Wm0xLjM4My0zLjIzMXYtMi4xODNoLjkzNGMuNzk5IDAgMS4xODUuNDM1IDEuMTg1IDEuMDg3IDAgLjY0OC0uMzg2IDEuMDk2LTEuMTc5IDEuMDk2aC0uOTRabTUuNjg2IDMuMzI0Yy43MjYgMCAxLjE5Ni0uMzE3IDEuNDM1LS43NzRoLjAzOXYuNjgxaDEuMjl2LTMuMzExYzAtMS4xNy0uOTktMS42NjItMi4wODMtMS42NjItMS4xNzYgMC0xLjk1LjU2Mi0yLjEzOCAxLjQ1N2wxLjI1OS4xMDNjLjA5My0uMzI2LjM4NC0uNTY2Ljg3My0uNTY2LjQ2MyAwIC43MjguMjMzLjcyOC42MzZ2LjAxOWMwIC4zMTctLjMzNS4zNTgtMS4xODkuNDQxLS45NzEuMDktMS44NDQuNDE2LTEuODQ0IDEuNTEyIDAgLjk3MS42OTQgMS40NjQgMS42MyAxLjQ2NFptLjM5LS45NGMtLjQxOSAwLS43MTktLjE5NS0uNzE5LS41NjkgMC0uMzgzLjMxNi0uNTcyLjc5Ni0uNjM5LjI5Ny0uMDQyLjc4My0uMTEyLjk0Ni0uMjIxdi41MjFjMCAuNTE1LS40MjUuOTA4LTEuMDIzLjkwOFptNC4wOTYgMi42ODhjMS4wMTMgMCAxLjU1LS41MTggMS44MjgtMS4zMWwxLjkwOC01LjQzNC0xLjQ0MS0uMDA2LTEuMDI2IDMuNjA1aC0uMDUybC0xLjAxNi0zLjYwNUg5Mi4wMWwxLjc2MSA1LjA1LS4wOC4yMDdjLS4xNzguNDYxLS41Mi40ODMtMSAuMzM2bC0uMzA3IDEuMDE2Yy4xOTUuMDgzLjUxMi4xNDEuODU3LjE0MVptMTIuMDE2LTguMzg2aC0xLjM3N3Y0LjExNmgtLjA1OGwtMi44MjUtNC4xMTZoLTEuMjE1djYuNTQ1aDEuMzg0di00LjEyaC4wNDhsMi44NDggNC4xMmgxLjE5NXYtNi41NDVabTMuMzM2IDYuNjQxYzEuNDg5IDAgMi40MTYtMS4wMiAyLjQxNi0yLjUzMSAwLTEuNTIyLS45MjctMi41MzgtMi40MTYtMi41MzgtMS40ODkgMC0yLjQxNiAxLjAxNi0yLjQxNiAyLjUzOCAwIDEuNTExLjkyNyAyLjUzMSAyLjQxNiAyLjUzMVptLjAwNi0xLjA1NWMtLjY4NyAwLTEuMDM4LS42MjktMS4wMzgtMS40ODYgMC0uODU2LjM1MS0xLjQ4OSAxLjAzOC0xLjQ4OS42NzUgMCAxLjAyNi42MzMgMS4wMjYgMS40ODkgMCAuODU3LS4zNTEgMS40ODYtMS4wMjYgMS40ODZabTQuMTQxLjk1OWgxLjQzOGwuODQ0LTMuMDg3aC4wNmwuODQ0IDMuMDg3aDEuNDQybDEuMzMyLTQuOTA5aC0xLjM3NGwtLjc0OCAzLjI3OWgtLjA0MWwtLjgwNi0zLjI3OWgtMS4zNTJsLS43OTIgMy4yOThoLS4wNDVsLS43NjEtMy4yOThoLTEuMzc3bDEuMzM2IDQuOTA5WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0yNC40OTUgMTUxLjMzM2EuNS41IDAgMCAxIC41LS41SDE3NmEuNS41IDAgMCAxIC41LjV2NmEuNS41IDAgMCAxLS41LjVIMjQuOTk1YS41LjUgMCAwIDEtLjUtLjV2LTZaTTI0LjQ5NSAxNjguNjY3YS41LjUgMCAwIDEgLjUtLjVIMTc2YS41LjUgMCAwIDEgLjUuNXY2YS41LjUgMCAwIDEtLjUuNUgyNC45OTVhLjUuNSAwIDAgMS0uNS0uNXYtNlpNMjQuNDk1IDE4NmEuNS41IDAgMCAxIC41LS41SDY4LjI1YS41LjUgMCAwIDEgLjUuNXY2YS41LjUgMCAwIDEtLjUuNUgyNC45OTVhLjUuNSAwIDAgMS0uNS0uNXYtNlpNNzguMzcgMTg2YS41LjUgMCAwIDEgLjUtLjVoNDMuMjU1YS41LjUgMCAwIDEgLjUuNXY2YS41LjUgMCAwIDEtLjUuNUg3OC44N2EuNS41IDAgMCAxLS41LS41di02Wk0xMzIuMjQ1IDE4NmEuNS41IDAgMCAxIC41LS41SDE3NmEuNS41IDAgMCAxIC41LjV2NmEuNS41IDAgMCAxLS41LjVoLTQzLjI1NWEuNS41IDAgMCAxLS41LS41di02WiIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjQjdDRkUyIi8+PHJlY3QgeD0iMjMuNSIgeT0iMjAyLjUiIHdpZHRoPSI2IiBoZWlnaHQ9IjYiIHJ4PSIuNSIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjQ0NERUVEIi8+PHJlY3QgeD0iNDMuMzkiIHk9IjIwNCIgd2lkdGg9IjEzMy42MSIgaGVpZ2h0PSIyLjY2NyIgcng9IjEiIGZpbGw9IiNCN0NGRTIiLz48ZyBjbGlwLXBhdGg9InVybCgjYSkiIGZpbGw9IiMyMjcxQjEiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxLjQiPjxwYXRoIGQ9Im05OS4wMDUgODIuMzY4LjQ5NS40OTYuNDk1LS40OTYgMTIuNDAzLTEyLjQwN2ExLjY0OCAxLjY0OCAwIDAgMSAyLjgxMSAxLjE2NGMwIC40MzctLjE3My44NTYtLjQ4MiAxLjE2NGwtMTQuMDYzIDE0LjA2M2ExLjY0MyAxLjY0MyAwIDAgMS0yLjMyOCAwbC03LjAzMi03LjAzMWExLjY0OSAxLjY0OSAwIDAgMSAwLTIuMzMgMS42NDQgMS42NDQgMCAwIDEgMi4zMyAwbDUuMzcgNS4zNzdaIi8+PHBhdGggZD0ibTcwLjIyNiA1Mi4yMDYtLjEzMi0uNTMxaC01Ljc1YTEuNjQ0IDEuNjQ0IDAgMCAxIDAtMy4yODdINzEuMzc1YTEuNjQzIDEuNjQzIDAgMCAxIDEuNTk0IDEuMjQ1bDEuODk5IDcuNi4xMzIuNTNIMTI5Ljk2OGExLjY0MyAxLjY0MyAwIDAgMSAxLjYxNCAxLjk0NmwtNy4wMzEgMzcuNWExLjY0NSAxLjY0NSAwIDAgMS0xLjYxNCAxLjM0MUg4MC43NTFhMS42NDQgMS42NDQgMCAwIDEtMS42MTUtMS4zNDFsLTcuMDIxLTM3LjQzLS4wMDQtLjAyLS4wMDUtLjAyLTEuODgtNy41MzNabTExLjc4MSA0Mi40ODYuMTA3LjU3aDM5LjQ1OWwuMTA3LS41NyA2LjE1NS0zMi44MTMuMTU1LS44MjlINzUuNjk3bC4xNTYuODI5IDYuMTU0IDMyLjgxM1ptLTIuNzA0IDcuNzk5YTguNjc1IDguNjc1IDAgMSAxIDEyLjI2OSAxMi4yNjcgOC42NzUgOC42NzUgMCAwIDEtMTIuMjY5LTEyLjI2N1ptMzIuODEzIDBhOC42NzQgOC42NzQgMCAxIDEgMTIuMjY4IDEyLjI2NiA4LjY3NCA4LjY3NCAwIDAgMS0xMi4yNjgtMTIuMjY2Wm0tMjIuODY5IDkuOTQ0YTUuMzkgNS4zOSAwIDAgMC0zLjgxLTkuMTk4IDUuMzg5IDUuMzg5IDAgMCAwLTMuODA5IDkuMTk4IDUuMzg4IDUuMzg4IDAgMCAwIDcuNjE5IDBabTMyLjgxMyAwYTUuMzkgNS4zOSAwIDAgMC0zLjgxLTkuMTk4IDUuMzkxIDUuMzkxIDAgMCAwLTUuMzg4IDUuMzg4IDUuMzkgNS4zOSAwIDAgMCA5LjE5OCAzLjgxWiIvPjwvZz48cmVjdCB4PSI1MCIgeT0iMTMzIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjMjI3MUIxIi8+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg2MiA0MykiIGQ9Ik0wIDBoNzV2NzVIMHoiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=",P8=(0,i.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,a=r?"target":"source",s=r?"source":"target",[,l]=(0,i.useState)(!1),c=$V(),u=(0,f$.W6)(),[{license_status:d}]=g(),[{is_flow_instant_checkout:f}]=ZR(),m=O8.createEventHandlers(e,c,u,l);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(N5,{type:a,position:p1.Left,id:"left",style:{background:"#555",visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-left",isConnectable:t&&!n}),(0,o.createElement)(N5,{type:"target",position:p1.Top,id:"top",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t&&n}),O8.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},z8,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,m,d,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,e.bumps,f,e.is_locked,e.has_store_checkout_product_warning),(0,o.createElement)("div",{className:"wcf-custom-node-label"},e?.label),(0,o.createElement)(N5,{type:s,position:p1.Right,id:"right",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-right",isConnectable:t&&!n}),(0,o.createElement)(N5,{type:"source",position:p1.Bottom,id:"bottom",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-bottom",isConnectable:t&&n}))}),R8="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFRkVGRUYiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOC4xNDdIMFYxMFoiIGZpbGw9IiNFNkVBRUQiLz48ZWxsaXBzZSBjeD0iMTQiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGRjNCMzAiLz48ZWxsaXBzZSBjeD0iMjciIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGQzAiLz48ZWxsaXBzZSBjeD0iNDAiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiM0Q0Q5NjQiLz48cmVjdCB4PSI2NCIgeT0iMTEiIHdpZHRoPSIxMDciIGhlaWdodD0iNyIgcng9IjEiIGZpbGw9IiNmZmYiLz48Y2lyY2xlIGN4PSI5OS44NTIiIGN5PSI5Mi4xMDEiIHI9IjM4LjM1MiIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMjI3MUIxIiBzdHJva2UtbWl0ZXJsaW1pdD0iMS44NjIiIHN0cm9rZS1kYXNoYXJyYXk9IjIgMyIvPjxjaXJjbGUgY3g9Ijk5Ljg1MiIgY3k9IjkyLjEwMSIgcj0iMzEuNTQzIiBmaWxsPSIjRjZGQUZGIi8+PGcgY2xpcC1wYXRoPSJ1cmwoI2EpIj48cGF0aCBkPSJNMTE0LjUgNjMuMzQ3djEyLjEzYTEuNjUgMS42NSAwIDEgMCAzLjMwMiAwdi0xMi4xM2w0LjA4OCA0LjA4OWExLjY1MiAxLjY1MiAwIDEgMCAyLjMzNy0yLjMzN2wtNi45MDctNi45MDdhMS42NDEgMS42NDEgMCAwIDAtMS4xNjktLjQ4NSAxLjY0NCAxLjY0NCAwIDAgMC0xLjE2OC40ODVoLS4wMDFsLTYuOTA2IDYuOTA3YTEuNjUyIDEuNjUyIDAgMSAwIDIuMzM3IDIuMzM3bDQuMDg3LTQuMDlabTE0LjMyMi04LjU5OWExNy45MiAxNy45MiAwIDEgMS0yNS4zNDMgMjUuMzQxIDE3LjkyIDE3LjkyIDAgMCAxIDI1LjM0My0yNS4zNFoiIGZpbGw9IiNmZmYiIHN0cm9rZT0iIzIyNzFCMSIvPjwvZz48ZyBjbGlwLXBhdGg9InVybCgjYikiPjxwYXRoIGQ9Ik02OC42NzUgMTE2LjAyOWEyLjUxIDIuNTEgMCAwIDEgMi41MDgtMi41MDlINzYuMmEyLjUxIDIuNTEgMCAwIDEgMi41MDkgMi41MDl2Ny41MjZhMi41MSAyLjUxIDAgMCAxLTIuNTA5IDIuNTA4aC01LjAxN2EyLjUxIDIuNTEgMCAwIDEtMi41MDgtMi41MDh2LTcuNTI2Wm0xMi41NDMtMTAuMDM0YTIuNTA3IDIuNTA3IDAgMCAxIDIuNTA4LTIuNTA5aDUuMDE3YTIuNTA3IDIuNTA3IDAgMCAxIDIuNTA5IDIuNTA5djE3LjU2YTIuNTEgMi41MSAwIDAgMS0yLjUwOSAyLjUwOGgtNS4wMTdhMi41MSAyLjUxIDAgMCAxLTIuNTA4LTIuNTA4di0xNy41NlpNOTMuNzYgOTMuNDUyYTIuNTA5IDIuNTA5IDAgMCAxIDIuNTA5LTIuNTA5aDUuMDE3YTIuNTEgMi41MSAwIDAgMSAyLjUwOSAyLjUwOXYzMC4xMDNhMi41MTIgMi41MTIgMCAwIDEtMi41MDkgMi41MDhoLTUuMDE3YTIuNTEgMi41MSAwIDAgMS0yLjUwOS0yLjUwOFY5My40NTJaIiBmaWxsPSIjMjI3MUIxIi8+PC9nPjxyZWN0IHg9Ijg4LjQ5NyIgeT0iMTA5Ljc2NSIgd2lkdGg9IjI1LjIzNSIgaGVpZ2h0PSIyNS4yMzUiIHJ4PSIxMi42MTciIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNMTAxLjExNCAxMTEuODY4YTEwLjUxNyAxMC41MTcgMCAwIDAtOS43MTQgNi40OTEgMTAuNTEzIDEwLjUxMyAwIDEgMCA5LjcxNC02LjQ5MVptMCAxOC45MjZhOC40MTMgOC40MTMgMCAwIDEtNy43NzEtNS4xOTIgOC40MTEgOC40MTEgMCAxIDEgNy43NzEgNS4xOTJaIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTEwMS4xMTQgMTIxLjMzMWMtMi4xMDMgMC0yLjEwMy0uNjYyLTIuMTAzLTEuMDUxIDAtLjM4OS43MzYtMS4wNTIgMi4xMDMtMS4wNTIgMS4zNjcgMCAxLjQ2MS42NzMgMS40NzIgMS4wNTJoMi4xMDNhMy4xNSAzLjE1IDAgMCAwLTIuNTI0LTMuMDI4di0xLjE3OGgtMi4xMDJ2MS4xNDZjLTIuMTAzLjM0Ny0zLjE1NSAxLjcwMy0zLjE1NSAzLjA2IDAgMS4xNzcuNTQ3IDMuMTU0IDQuMjA2IDMuMTU0IDIuMTAzIDAgMi4xMDMuNzE1IDIuMTAzIDEuMDUyIDAgLjMzNi0uNjUyIDEuMDUxLTIuMTAzIDEuMDUxLTEuOTM1IDAtMi4xMDMtLjkwNC0yLjEwMy0xLjA1MWgtMi4xMDNjMCAuOTY3LjY5NCAyLjY4MSAzLjE1NSAzLjA3djEuMTM1aDIuMTAydi0xLjEzNWMyLjEwMy0uMzU4IDMuMTU1LTEuNzE0IDMuMTU1LTMuMDcgMC0xLjE3OC0uNTQ3LTMuMTU1LTQuMjA2LTMuMTU1WiIgZmlsbD0iIzIyNzFCMSIvPjxyZWN0IHg9IjUwIiB5PSIxNTAiIHdpZHRoPSIxMDAiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiMyMjcxQjEiLz48cmVjdCB4PSIyMyIgeT0iMTY0IiB3aWR0aD0iMTU0IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRUFFQUVBIi8+PHJlY3QgeD0iNzAiIHk9IjE3OCIgd2lkdGg9IjYwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRUFFQUVBIi8+PHJlY3QgeD0iMjMiIHk9IjE5NyIgd2lkdGg9IjE1NCIgaGVpZ2h0PSIyMCIgcng9IjIiIGZpbGw9IiMyMjcxQjEiLz48cGF0aCBkPSJtNzMuNCAyMTAuNS40ODYtMS40OTNoMi4zNjJsLjQ4NiAxLjQ5M2gxLjQ4M2wtMi4yNTYtNi41NDVoLTEuNzg0bC0yLjI2IDYuNTQ1aDEuNDg0Wm0uODM4LTIuNTczLjgwNS0yLjQ3N2guMDUybC44MDUgMi40NzdoLTEuNjYyWm02LjczIDIuNjY5YzEuMzA4IDAgMi4xMy0uNzY3IDIuMTkzLTEuODk1aC0xLjI4NGMtLjA4LjUyNC0uNDI1LjgxOC0uODkyLjgxOC0uNjM2IDAtMS4wNDgtLjUzNC0xLjA0OC0xLjQ3NCAwLS45MjYuNDE1LTEuNDU3IDEuMDQ4LTEuNDU3LjQ5OCAwIC44MTguMzI5Ljg5Mi44MThoMS4yODRjLS4wNTctMS4xMzQtLjkxNy0xLjg3OS0yLjE5OC0xLjg3OS0xLjQ5IDAtMi40MSAxLjAzMi0yLjQxIDIuNTM4IDAgMS40OTIuOTA0IDIuNTMxIDIuNDE2IDIuNTMxWm01LjI4MyAwYzEuMzA3IDAgMi4xMjktLjc2NyAyLjE5My0xLjg5NWgtMS4yODVjLS4wOC41MjQtLjQyNS44MTgtLjg5Mi44MTgtLjYzNiAwLTEuMDQ4LS41MzQtMS4wNDgtMS40NzQgMC0uOTI2LjQxNS0xLjQ1NyAxLjA0OC0xLjQ1Ny40OTkgMCAuODE4LjMyOS44OTIuODE4aDEuMjg1Yy0uMDU4LTEuMTM0LS45MTgtMS44NzktMi4yLTEuODc5LTEuNDg5IDAtMi40MSAxLjAzMi0yLjQxIDIuNTM4IDAgMS40OTIuOTA1IDIuNTMxIDIuNDE3IDIuNTMxWm01LjMwMSAwYzEuMjE1IDAgMi4wMzMtLjU5MSAyLjIyNS0xLjUwMmwtMS4yNi0uMDgzYy0uMTM3LjM3NC0uNDg4LjU2OS0uOTQyLjU2OS0uNjggMC0xLjExMi0uNDUxLTEuMTEyLTEuMTgzdi0uMDAzaDMuMzQzdi0uMzc0YzAtMS42NjgtMS4wMS0yLjQ5My0yLjMwOC0yLjQ5My0xLjQ0NCAwLTIuMzggMS4wMjYtMi4zOCAyLjU0MSAwIDEuNTU2LjkyMyAyLjUyOCAyLjQzNCAyLjUyOFptLTEuMDktMy4wNDZhMS4wMzcgMS4wMzcgMCAwIDEgMS4wNTktMS4wMDdjLjU5IDAgMSAuNDIyIDEuMDAzIDEuMDA3aC0yLjA2MVptNC4yMzIgNC43OTFoMS4zNjJ2LTIuNjI3aC4wNDFjLjE4OS40MDkuNjAxLjg2NiAxLjM5NC44NjYgMS4xMTggMCAxLjk5LS44ODUgMS45OS0yLjUyOCAwLTEuNjg4LS45MS0yLjUyNS0xLjk4Ny0yLjUyNS0uODIyIDAtMS4yMTUuNDg5LTEuMzk3Ljg4OGgtLjA2di0uODI0aC0xLjM0M3Y2Ljc1Wm0xLjMzMy00LjI5NmMwLS44NzUuMzctMS40MzUgMS4wMzItMS40MzUuNjc1IDAgMS4wMzMuNTg1IDEuMDMzIDEuNDM1IDAgLjg1Ny0uMzY1IDEuNDUxLTEuMDMzIDEuNDUxLS42NTUgMC0xLjAzMi0uNTc1LTEuMDMyLTEuNDUxWm02Ljk3NC0yLjQ1NGgtLjkyNHYtMS4xNzZoLTEuMzYxdjEuMTc2aC0uNjcydjEuMDIzaC42NzJ2Mi41NTZjLS4wMDcuOTYyLjY0OCAxLjQzOSAxLjYzNiAxLjM5Ny4zNTEtLjAxMy42MDEtLjA4My43MzgtLjEyOGwtLjIxNC0xLjAxM2MtLjA2Ny4wMTMtLjIxMS4wNDUtLjMzOS4wNDUtLjI3MSAwLS40Ni0uMTAyLS40Ni0uNDh2LTIuMzc3aC45MjR2LTEuMDIzWm05LjAxIDEuNjM2YzAtMi4xNDEtMS4zMjktMy4zNjItMy4wNjUtMy4zNjItMS43NDUgMC0zLjA2NSAxLjIyMS0zLjA2NSAzLjM2MiAwIDIuMTMyIDEuMzIgMy4zNjIgMy4wNjUgMy4zNjIgMS43MzYgMCAzLjA2NS0xLjIyIDMuMDY1LTMuMzYyWm0tMS40MDMgMGMwIDEuMzg3LS42NTggMi4xMzgtMS42NjIgMi4xMzgtMS4wMDcgMC0xLjY2Mi0uNzUxLTEuNjYyLTIuMTM4cy42NTUtMi4xMzggMS42NjItMi4xMzhjMS4wMDQgMCAxLjY2Mi43NTEgMS42NjIgMi4xMzhabTUuMDQzLTEuNjM2aC0uOTc1di0uMzI5YzAtLjMzMy4xMzQtLjUyOC41MzMtLjUyOC4xNjMgMCAuMzMuMDM2LjQzOC4wNzFsLjI0LTEuMDIzYTMuNTg5IDMuNTg5IDAgMCAwLS45NjItLjEzNGMtLjkyNCAwLTEuNjExLjUyMS0xLjYxMSAxLjU4OHYuMzU1aC0uNjkzdjEuMDIzaC42OTN2My44ODZoMS4zNjJ2LTMuODg2aC45NzV2LTEuMDIzWm0zLjQ3MSAwaC0uOTc1di0uMzI5YzAtLjMzMy4xMzUtLjUyOC41MzQtLjUyOC4xNjMgMCAuMzI5LjAzNi40MzguMDcxbC4yNC0xLjAyM2EzLjYwMyAzLjYwMyAwIDAgMC0uOTYyLS4xMzRjLS45MjQgMC0xLjYxMS41MjEtMS42MTEgMS41ODh2LjM1NWgtLjY5NHYxLjAyM2guNjk0djMuODg2aDEuMzYxdi0zLjg4NmguOTc1di0xLjAyM1ptMi44OTMgNS4wMDVjMS4yMTUgMCAyLjAzMy0uNTkxIDIuMjI1LTEuNTAybC0xLjI1OS0uMDgzYy0uMTM4LjM3NC0uNDg5LjU2OS0uOTQzLjU2OS0uNjgxIDAtMS4xMTItLjQ1MS0xLjExMi0xLjE4M3YtLjAwM2gzLjM0M3YtLjM3NGMwLTEuNjY4LTEuMDEtMi40OTMtMi4zMDgtMi40OTMtMS40NDUgMC0yLjM4MSAxLjAyNi0yLjM4MSAyLjU0MSAwIDEuNTU2LjkyNCAyLjUyOCAyLjQzNSAyLjUyOFptLTEuMDg5LTMuMDQ2YTEuMDM2IDEuMDM2IDAgMCAxIDEuMDU3LTEuMDA3Yy41OTIgMCAxLjAwMS40MjIgMS4wMDQgMS4wMDdoLTIuMDYxWm00LjIzMSAyLjk1aDEuMzYydi0yLjc3N2MwLS42MDQuNDQxLTEuMDIgMS4wNDItMS4wMi4xODggMCAuNDQ3LjAzMi41NzUuMDc0di0xLjIwOGEyLjAzMyAyLjAzMyAwIDAgMC0uNDI4LS4wNDhjLS41NSAwLTEuMDAxLjMxOS0xLjE4LjkyNmgtLjA1MXYtLjg1NmgtMS4zMnY0LjkwOVoiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNNzkuOTIxIDIzMy41aDEuMDc2di0xLjgwNWguNzg2bC45NjQgMS44MDVoMS4xODlsLTEuMDgyLTEuOTc5Yy41OC0uMjQ4LjktLjc1My45LTEuNDQ5IDAtMS4wMTItLjY2OS0xLjY2My0xLjgyNS0xLjY2M2gtMi4wMDh2NS4wOTFabTEuMDc2LTIuNjd2LTEuNTQxaC43MjZjLjYyMiAwIC45MjIuMjc2LjkyMi43ODMgMCAuNTA1LS4zLjc1OC0uOTE3Ljc1OGgtLjczWm01LjE3NiAyLjc0NWMuOTQ1IDAgMS41ODEtLjQ2IDEuNzMtMS4xNjlsLS45NzktLjA2NGMtLjEwNy4yOS0uMzguNDQyLS43MzMuNDQyLS41MyAwLS44NjUtLjM1LS44NjUtLjkydi0uMDAyaDIuNnYtLjI5MWMwLTEuMjk4LS43ODYtMS45MzktMS43OTUtMS45MzktMS4xMjQgMC0xLjg1Mi43OTgtMS44NTIgMS45NzYgMCAxLjIxMS43MTkgMS45NjcgMS44OTQgMS45NjdabS0uODQ3LTIuMzY5YS44MDYuODA2IDAgMCAxIC44MjMtLjc4M2MuNDYgMCAuNzc4LjMyOC43OC43ODNoLTEuNjAzWm0zLjI5LTEuNTI0djMuOTljMCAuMjg4LS4xMi40MzItLjQ2MS40MzItLjA0NSAwLS4wODUgMC0uMTQtLjAwNXYuODI4Yy4wNzcuMDAyLjE0LjAwNS4yMTQuMDA1LjkgMCAxLjQ0Ny0uMzU4IDEuNDQ3LTEuMjQzdi00LjAwN2gtMS4wNlptLjUyOC0uNDkyYy4zMTYgMCAuNTc0LS4yNDEuNTc0LS41MzcgMC0uMjk0LS4yNTgtLjUzNS0uNTc0LS41MzUtLjMxMyAwLS41NzIuMjQxLS41NzIuNTM1IDAgLjI5Ni4yNTkuNTM3LjU3Mi41MzdabTMuMTIgNC4zODVjLjk0NSAwIDEuNTgxLS40NiAxLjczLTEuMTY5bC0uOTgtLjA2NGMtLjEwNi4yOS0uMzguNDQyLS43MzIuNDQyLS41MyAwLS44NjUtLjM1LS44NjUtLjkydi0uMDAyaDIuNnYtLjI5MWMwLTEuMjk4LS43ODYtMS45MzktMS43OTUtMS45MzktMS4xMjQgMC0xLjg1Mi43OTgtMS44NTIgMS45NzYgMCAxLjIxMS43MTggMS45NjcgMS44OTQgMS45NjdabS0uODQ3LTIuMzY5YS44MDYuODA2IDAgMCAxIC44MjItLjc4M2MuNDYgMCAuNzc4LjMyOC43OC43ODNoLTEuNjAzWm01LjAxNiAyLjM2OWMxLjAxNyAwIDEuNjU1LS41OTcgMS43MDUtMS40NzVoLTFjLS4wNjEuNDA4LS4zMy42MzctLjY5My42MzctLjQ5NCAwLS44MTUtLjQxNS0uODE1LTEuMTQ2IDAtLjcyMS4zMjMtMS4xMzQuODE1LTEuMTM0LjM4OCAwIC42MzcuMjU2LjY5NC42MzdoMWMtLjA0Ni0uODgzLS43MTQtMS40NjItMS43MTEtMS40NjItMS4xNTkgMC0xLjg3NC44MDMtMS44NzQgMS45NzQgMCAxLjE2MS43MDMgMS45NjkgMS44NzkgMS45NjlabTQuNDE0LTMuODkzaC0uNzE4di0uOTE1aC0xLjA2di45MTVoLS41MjF2Ljc5NWguNTIydjEuOTg5Yy0uMDA1Ljc0OC41MDQgMS4xMTkgMS4yNzIgMS4wODYuMjc0LS4wMS40NjgtLjA2NC41NzUtLjA5OWwtLjE2Ny0uNzg4Yy0uMDUyLjAxLS4xNjQuMDM1LS4yNjMuMDM1LS4yMTIgMC0uMzU4LS4wOC0uMzU4LS4zNzN2LTEuODVoLjcxOHYtLjc5NVptNy4wMDggMS4yNzNjMC0xLjY2Ni0xLjAzNC0yLjYxNi0yLjM4NC0yLjYxNi0xLjM1NyAwLTIuMzg0Ljk1LTIuMzg0IDIuNjE2IDAgMS42NTggMS4wMjcgMi42MTUgMi4zODQgMi42MTUgMS4zNSAwIDIuMzg0LS45NSAyLjM4NC0yLjYxNVptLTEuMDkxIDBjMCAxLjA3OC0uNTEyIDEuNjYzLTEuMjkzIDEuNjYzLS43ODMgMC0xLjI5Mi0uNTg1LTEuMjkyLTEuNjYzIDAtMS4wNzkuNTA5LTEuNjYzIDEuMjkyLTEuNjYzLjc4MSAwIDEuMjkzLjU4NCAxLjI5MyAxLjY2M1ptMy45MjItMS4yNzNoLS43NTh2LS4yNTZjMC0uMjU5LjEwNC0uNDEuNDE1LS40MS4xMjcgMCAuMjU2LjAyNy4zNC4wNTRsLjE4Ny0uNzk1YTIuNzc4IDIuNzc4IDAgMCAwLS43NDgtLjEwNWMtLjcxOSAwLTEuMjUzLjQwNi0xLjI1MyAxLjIzNnYuMjc2aC0uNTR2Ljc5NWguNTR2My4wMjNoMS4wNTl2LTMuMDIzaC43NTh2LS43OTVabTIuNyAwaC0uNzU4di0uMjU2YzAtLjI1OS4xMDQtLjQxLjQxNS0uNDEuMTI3IDAgLjI1Ni4wMjcuMzQxLjA1NGwuMTg2LS43OTVhMi43NzggMi43NzggMCAwIDAtLjc0OC0uMTA1Yy0uNzE5IDAtMS4yNTMuNDA2LTEuMjUzIDEuMjM2di4yNzZoLS41NHYuNzk1aC41NHYzLjAyM2gxLjA1OXYtMy4wMjNoLjc1OHYtLjc5NVptMi4yNSAzLjg5M2MuOTQ1IDAgMS41ODEtLjQ2IDEuNzMtMS4xNjlsLS45NzktLjA2NGMtLjEwNy4yOS0uMzguNDQyLS43MzMuNDQyLS41MyAwLS44NjUtLjM1LS44NjUtLjkydi0uMDAyaDIuNnYtLjI5MWMwLTEuMjk4LS43ODYtMS45MzktMS43OTUtMS45MzktMS4xMjQgMC0xLjg1Mi43OTgtMS44NTIgMS45NzYgMCAxLjIxMS43MTggMS45NjcgMS44OTQgMS45NjdabS0uODQ3LTIuMzY5YS44MDYuODA2IDAgMCAxIC44MjItLjc4M2MuNDYgMCAuNzc4LjMyOC43ODEuNzgzaC0xLjYwM1ptMy4yOTEgMi4yOTRoMS4wNTl2LTIuMTZjMC0uNDcuMzQzLS43OTMuODEtLjc5My4xNDcgMCAuMzQ4LjAyNS40NDguMDU3di0uOTRhMS42MjcgMS42MjcgMCAwIDAtLjMzNC0uMDM3Yy0uNDI3IDAtLjc3OC4yNDktLjkxNy43MjFoLS4wNHYtLjY2NmgtMS4wMjZ2My44MThaIiBmaWxsPSIjQTFBMUExIi8+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5Ny43MzMgNDkpIiBkPSJNMCAwaDM2LjgzN3YzNi44MzdIMHoiLz48L2NsaXBQYXRoPjxjbGlwUGF0aCBpZD0iYiI+PHBhdGggZmlsbD0iI2ZmZiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNjguMzA5IDg5LjU3OCkiIGQ9Ik0wIDBoMzcuODUydjM3Ljg1MkgweiIvPjwvY2xpcFBhdGg+PC9kZWZzPjwvc3ZnPg==",U8="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFRkVGRUYiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOC4xNDdIMFYxMFoiIGZpbGw9IiNFNkVBRUQiLz48ZWxsaXBzZSBjeD0iMTQiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGRjNCMzAiLz48ZWxsaXBzZSBjeD0iMjciIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGQzAiLz48ZWxsaXBzZSBjeD0iNDAiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiM0Q0Q5NjQiLz48cmVjdCB4PSI2NCIgeT0iMTEiIHdpZHRoPSIxMDciIGhlaWdodD0iNyIgcng9IjEiIGZpbGw9IiNmZmYiLz48cmVjdCB4PSI1MCIgeT0iMTUxIiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjMjI3MUIxIi8+PHJlY3QgeD0iMjMiIHk9IjE2NSIgd2lkdGg9IjE1NCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0VBRUFFQSIvPjxyZWN0IHg9IjcwIiB5PSIxNzgiIHdpZHRoPSI2MCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0VBRUFFQSIvPjxyZWN0IHg9IjIzIiB5PSIxOTciIHdpZHRoPSIxNTQiIGhlaWdodD0iMjAiIHJ4PSIyIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0ibTczLjQgMjEwIC40ODYtMS40OTNoMi4zNjJsLjQ4NiAxLjQ5M2gxLjQ4M2wtMi4yNTYtNi41NDVoLTEuNzg0TDcxLjkxNyAyMTBoMS40ODRabS44MzgtMi41NzMuODA1LTIuNDc3aC4wNTJsLjgwNSAyLjQ3N2gtMS42NjJabTYuNzMgMi42NjljMS4zMDggMCAyLjEzLS43NjcgMi4xOTMtMS44OTVoLTEuMjg0Yy0uMDguNTI0LS40MjUuODE4LS44OTIuODE4LS42MzYgMC0xLjA0OC0uNTM0LTEuMDQ4LTEuNDc0IDAtLjkyNi40MTUtMS40NTcgMS4wNDgtMS40NTcuNDk4IDAgLjgxOC4zMjkuODkyLjgxOGgxLjI4NGMtLjA1Ny0xLjEzNC0uOTE3LTEuODc5LTIuMTk4LTEuODc5LTEuNDkgMC0yLjQxIDEuMDMyLTIuNDEgMi41MzggMCAxLjQ5Mi45MDQgMi41MzEgMi40MTYgMi41MzFabTUuMjgzIDBjMS4zMDcgMCAyLjEyOS0uNzY3IDIuMTkzLTEuODk1aC0xLjI4NWMtLjA4LjUyNC0uNDI1LjgxOC0uODkyLjgxOC0uNjM2IDAtMS4wNDgtLjUzNC0xLjA0OC0xLjQ3NCAwLS45MjYuNDE1LTEuNDU3IDEuMDQ4LTEuNDU3LjQ5OSAwIC44MTguMzI5Ljg5Mi44MThoMS4yODVjLS4wNTgtMS4xMzQtLjkxOC0xLjg3OS0yLjItMS44NzktMS40ODkgMC0yLjQxIDEuMDMyLTIuNDEgMi41MzggMCAxLjQ5Mi45MDUgMi41MzEgMi40MTcgMi41MzFabTUuMzAxIDBjMS4yMTUgMCAyLjAzMy0uNTkxIDIuMjI1LTEuNTAybC0xLjI2LS4wODNjLS4xMzcuMzc0LS40ODguNTY5LS45NDIuNTY5LS42OCAwLTEuMTEyLS40NTEtMS4xMTItMS4xODN2LS4wMDNoMy4zNDN2LS4zNzRjMC0xLjY2OC0xLjAxLTIuNDkzLTIuMzA4LTIuNDkzLTEuNDQ0IDAtMi4zOCAxLjAyNi0yLjM4IDIuNTQxIDAgMS41NTYuOTIzIDIuNTI4IDIuNDM0IDIuNTI4Wm0tMS4wOS0zLjA0NmExLjAzNyAxLjAzNyAwIDAgMSAxLjA1OS0xLjAwN2MuNTkgMCAxIC40MjIgMS4wMDMgMS4wMDdoLTIuMDYxWm00LjIzMiA0Ljc5MWgxLjM2MnYtMi42MjdoLjA0MWMuMTg5LjQwOS42MDEuODY2IDEuMzk0Ljg2NiAxLjExOCAwIDEuOTktLjg4NSAxLjk5LTIuNTI4IDAtMS42ODgtLjkxLTIuNTI1LTEuOTg3LTIuNTI1LS44MjIgMC0xLjIxNS40ODktMS4zOTcuODg4aC0uMDZ2LS44MjRoLTEuMzQzdjYuNzVabTEuMzMzLTQuMjk2YzAtLjg3NS4zNy0xLjQzNSAxLjAzMi0xLjQzNS42NzUgMCAxLjAzMy41ODUgMS4wMzMgMS40MzUgMCAuODU3LS4zNjUgMS40NTEtMS4wMzMgMS40NTEtLjY1NSAwLTEuMDMyLS41NzUtMS4wMzItMS40NTFabTYuOTc0LTIuNDU0aC0uOTI0di0xLjE3NmgtMS4zNjF2MS4xNzZoLS42NzJ2MS4wMjNoLjY3MnYyLjU1NmMtLjAwNy45NjIuNjQ4IDEuNDM5IDEuNjM2IDEuMzk3LjM1MS0uMDEzLjYwMS0uMDgzLjczOC0uMTI4bC0uMjE0LTEuMDEzYy0uMDY3LjAxMy0uMjExLjA0NS0uMzM5LjA0NS0uMjcxIDAtLjQ2LS4xMDItLjQ2LS40OHYtMi4zNzdoLjkyNHYtMS4wMjNabTkuMDEgMS42MzZjMC0yLjE0MS0xLjMyOS0zLjM2Mi0zLjA2NS0zLjM2Mi0xLjc0NSAwLTMuMDY1IDEuMjIxLTMuMDY1IDMuMzYyIDAgMi4xMzIgMS4zMiAzLjM2MiAzLjA2NSAzLjM2MiAxLjczNiAwIDMuMDY1LTEuMjIgMy4wNjUtMy4zNjJabS0xLjQwMyAwYzAgMS4zODctLjY1OCAyLjEzOC0xLjY2MiAyLjEzOC0xLjAwNyAwLTEuNjYyLS43NTEtMS42NjItMi4xMzhzLjY1NS0yLjEzOCAxLjY2Mi0yLjEzOGMxLjAwNCAwIDEuNjYyLjc1MSAxLjY2MiAyLjEzOFptNS4wNDMtMS42MzZoLS45NzV2LS4zMjljMC0uMzMzLjEzNC0uNTI4LjUzMy0uNTI4LjE2MyAwIC4zMy4wMzYuNDM4LjA3MWwuMjQtMS4wMjNhMy41ODkgMy41ODkgMCAwIDAtLjk2Mi0uMTM0Yy0uOTI0IDAtMS42MTEuNTIxLTEuNjExIDEuNTg4di4zNTVoLS42OTN2MS4wMjNoLjY5M1YyMTBoMS4zNjJ2LTMuODg2aC45NzV2LTEuMDIzWm0zLjQ3MSAwaC0uOTc1di0uMzI5YzAtLjMzMy4xMzUtLjUyOC41MzQtLjUyOC4xNjMgMCAuMzI5LjAzNi40MzguMDcxbC4yNC0xLjAyM2EzLjYwMyAzLjYwMyAwIDAgMC0uOTYyLS4xMzRjLS45MjQgMC0xLjYxMS41MjEtMS42MTEgMS41ODh2LjM1NWgtLjY5NHYxLjAyM2guNjk0VjIxMGgxLjM2MXYtMy44ODZoLjk3NXYtMS4wMjNabTIuODkzIDUuMDA1YzEuMjE1IDAgMi4wMzMtLjU5MSAyLjIyNS0xLjUwMmwtMS4yNTktLjA4M2MtLjEzOC4zNzQtLjQ4OS41NjktLjk0My41NjktLjY4MSAwLTEuMTEyLS40NTEtMS4xMTItMS4xODN2LS4wMDNoMy4zNDN2LS4zNzRjMC0xLjY2OC0xLjAxLTIuNDkzLTIuMzA4LTIuNDkzLTEuNDQ1IDAtMi4zODEgMS4wMjYtMi4zODEgMi41NDEgMCAxLjU1Ni45MjQgMi41MjggMi40MzUgMi41MjhabS0xLjA4OS0zLjA0NmExLjAzNiAxLjAzNiAwIDAgMSAxLjA1Ny0xLjAwN2MuNTkyIDAgMS4wMDEuNDIyIDEuMDA0IDEuMDA3aC0yLjA2MVptNC4yMzEgMi45NWgxLjM2MnYtMi43NzdjMC0uNjA0LjQ0MS0xLjAyIDEuMDQyLTEuMDIuMTg4IDAgLjQ0Ny4wMzIuNTc1LjA3NHYtMS4yMDhhMi4wMzMgMi4wMzMgMCAwIDAtLjQyOC0uMDQ4Yy0uNTUgMC0xLjAwMS4zMTktMS4xOC45MjZoLS4wNTF2LS44NTZoLTEuMzJWMjEwWiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik03OS45MjEgMjMzLjVoMS4wNzZ2LTEuODA1aC43ODZsLjk2NCAxLjgwNWgxLjE4OWwtMS4wODItMS45NzljLjU4LS4yNDguOS0uNzUzLjktMS40NDkgMC0xLjAxMi0uNjY5LTEuNjYzLTEuODI1LTEuNjYzaC0yLjAwOHY1LjA5MVptMS4wNzYtMi42N3YtMS41NDFoLjcyNmMuNjIyIDAgLjkyMi4yNzYuOTIyLjc4MyAwIC41MDUtLjMuNzU4LS45MTcuNzU4aC0uNzNabTUuMTc2IDIuNzQ1Yy45NDUgMCAxLjU4MS0uNDYgMS43My0xLjE2OWwtLjk3OS0uMDY0Yy0uMTA3LjI5LS4zOC40NDItLjczMy40NDItLjUzIDAtLjg2NS0uMzUtLjg2NS0uOTJ2LS4wMDJoMi42di0uMjkxYzAtMS4yOTgtLjc4Ni0xLjkzOS0xLjc5NS0xLjkzOS0xLjEyNCAwLTEuODUyLjc5OC0xLjg1MiAxLjk3NiAwIDEuMjExLjcxOSAxLjk2NyAxLjg5NCAxLjk2N1ptLS44NDctMi4zNjlhLjgwNi44MDYgMCAwIDEgLjgyMy0uNzgzYy40NiAwIC43NzguMzI4Ljc4Ljc4M2gtMS42MDNabTMuMjktMS41MjR2My45OWMwIC4yODgtLjEyLjQzMi0uNDYxLjQzMi0uMDQ1IDAtLjA4NSAwLS4xNC0uMDA1di44MjhjLjA3Ny4wMDIuMTQuMDA1LjIxNC4wMDUuOSAwIDEuNDQ3LS4zNTggMS40NDctMS4yNDN2LTQuMDA3aC0xLjA2Wm0uNTI4LS40OTJjLjMxNiAwIC41NzQtLjI0MS41NzQtLjUzNyAwLS4yOTQtLjI1OC0uNTM1LS41NzQtLjUzNS0uMzEzIDAtLjU3Mi4yNDEtLjU3Mi41MzUgMCAuMjk2LjI1OS41MzcuNTcyLjUzN1ptMy4xMiA0LjM4NWMuOTQ1IDAgMS41ODEtLjQ2IDEuNzMtMS4xNjlsLS45OC0uMDY0Yy0uMTA2LjI5LS4zOC40NDItLjczMi40NDItLjUzIDAtLjg2NS0uMzUtLjg2NS0uOTJ2LS4wMDJoMi42di0uMjkxYzAtMS4yOTgtLjc4Ni0xLjkzOS0xLjc5NS0xLjkzOS0xLjEyNCAwLTEuODUyLjc5OC0xLjg1MiAxLjk3NiAwIDEuMjExLjcxOCAxLjk2NyAxLjg5NCAxLjk2N1ptLS44NDctMi4zNjlhLjgwNi44MDYgMCAwIDEgLjgyMi0uNzgzYy40NiAwIC43NzguMzI4Ljc4Ljc4M2gtMS42MDNabTUuMDE2IDIuMzY5YzEuMDE3IDAgMS42NTUtLjU5NyAxLjcwNS0xLjQ3NWgtMWMtLjA2MS40MDgtLjMzLjYzNy0uNjkzLjYzNy0uNDk0IDAtLjgxNS0uNDE1LS44MTUtMS4xNDYgMC0uNzIxLjMyMy0xLjEzNC44MTUtMS4xMzQuMzg4IDAgLjYzNy4yNTYuNjk0LjYzN2gxYy0uMDQ2LS44ODMtLjcxNC0xLjQ2Mi0xLjcxMS0xLjQ2Mi0xLjE1OSAwLTEuODc0LjgwMy0xLjg3NCAxLjk3NCAwIDEuMTYxLjcwMyAxLjk2OSAxLjg3OSAxLjk2OVptNC40MTQtMy44OTNoLS43MTh2LS45MTVoLTEuMDZ2LjkxNWgtLjUyMXYuNzk1aC41MjJ2MS45ODljLS4wMDUuNzQ4LjUwNCAxLjExOSAxLjI3MiAxLjA4Ni4yNzQtLjAxLjQ2OC0uMDY0LjU3NS0uMDk5bC0uMTY3LS43ODhjLS4wNTIuMDEtLjE2NC4wMzUtLjI2My4wMzUtLjIxMiAwLS4zNTgtLjA4LS4zNTgtLjM3M3YtMS44NWguNzE4di0uNzk1Wm03LjAwOCAxLjI3M2MwLTEuNjY2LTEuMDM0LTIuNjE2LTIuMzg0LTIuNjE2LTEuMzU3IDAtMi4zODQuOTUtMi4zODQgMi42MTYgMCAxLjY1OCAxLjAyNyAyLjYxNSAyLjM4NCAyLjYxNSAxLjM1IDAgMi4zODQtLjk1IDIuMzg0LTIuNjE1Wm0tMS4wOTEgMGMwIDEuMDc4LS41MTIgMS42NjMtMS4yOTMgMS42NjMtLjc4MyAwLTEuMjkyLS41ODUtMS4yOTItMS42NjMgMC0xLjA3OS41MDktMS42NjMgMS4yOTItMS42NjMuNzgxIDAgMS4yOTMuNTg0IDEuMjkzIDEuNjYzWm0zLjkyMi0xLjI3M2gtLjc1OHYtLjI1NmMwLS4yNTkuMTA0LS40MS40MTUtLjQxLjEyNyAwIC4yNTYuMDI3LjM0LjA1NGwuMTg3LS43OTVhMi43NzggMi43NzggMCAwIDAtLjc0OC0uMTA1Yy0uNzE5IDAtMS4yNTMuNDA2LTEuMjUzIDEuMjM2di4yNzZoLS41NHYuNzk1aC41NHYzLjAyM2gxLjA1OXYtMy4wMjNoLjc1OHYtLjc5NVptMi43IDBoLS43NTh2LS4yNTZjMC0uMjU5LjEwNC0uNDEuNDE1LS40MS4xMjcgMCAuMjU2LjAyNy4zNDEuMDU0bC4xODYtLjc5NWEyLjc3OCAyLjc3OCAwIDAgMC0uNzQ4LS4xMDVjLS43MTkgMC0xLjI1My40MDYtMS4yNTMgMS4yMzZ2LjI3NmgtLjU0di43OTVoLjU0djMuMDIzaDEuMDU5di0zLjAyM2guNzU4di0uNzk1Wm0yLjI1IDMuODkzYy45NDUgMCAxLjU4MS0uNDYgMS43My0xLjE2OWwtLjk3OS0uMDY0Yy0uMTA3LjI5LS4zOC40NDItLjczMy40NDItLjUzIDAtLjg2NS0uMzUtLjg2NS0uOTJ2LS4wMDJoMi42di0uMjkxYzAtMS4yOTgtLjc4Ni0xLjkzOS0xLjc5NS0xLjkzOS0xLjEyNCAwLTEuODUyLjc5OC0xLjg1MiAxLjk3NiAwIDEuMjExLjcxOCAxLjk2NyAxLjg5NCAxLjk2N1ptLS44NDctMi4zNjlhLjgwNi44MDYgMCAwIDEgLjgyMi0uNzgzYy40NiAwIC43NzguMzI4Ljc4MS43ODNoLTEuNjAzWm0zLjI5MSAyLjI5NGgxLjA1OXYtMi4xNmMwLS40Ny4zNDMtLjc5My44MS0uNzkzLjE0NyAwIC4zNDguMDI1LjQ0OC4wNTd2LS45NGExLjYyNyAxLjYyNyAwIDAgMC0uMzM0LS4wMzdjLS40MjcgMC0uNzc4LjI0OS0uOTE3LjcyMWgtLjA0di0uNjY2aC0xLjAyNnYzLjgxOFoiIGZpbGw9IiNBMUExQTEiLz48Y2lyY2xlIGN4PSIxMDQuNTQyIiBjeT0iOTAuNTk1IiByPSIzOC43ODYiIGZpbGw9IiNmZmYiIHN0cm9rZT0iIzIyNzFCMSIgc3Ryb2tlLW1pdGVybGltaXQ9IjEuODYyIiBzdHJva2UtZGFzaGFycmF5PSIyIDMiLz48Y2lyY2xlIGN4PSIxMDQuNTQxIiBjeT0iOTAuNTk1IiByPSIzMS45MDUiIGZpbGw9IiNGNkZBRkYiLz48ZyBjbGlwLXBhdGg9InVybCgjYSkiPjxwYXRoIGQ9Im0xMjcuMjU1IDY1LjQ3NC0zLjgwMiAzLjgwNFY1Ny40OGExLjg2MyAxLjg2MyAwIDAgMC0zLjE4Mi0xLjMxOGMtLjM1LjM1LS41NDcuODIzLS41NDcgMS4zMTh2MTEuOGwtMy44MDItMy44MDVhMS44NjUgMS44NjUgMCAxIDAtMi42MzkgMi42MzlsNi45ODYgNi45ODVhMS44NjUgMS44NjUgMCAwIDAgMi42NCAwbDYuOTg1LTYuOTg1YTEuODY2IDEuODY2IDAgMSAwLTIuNjM5LTIuNjM5Wm0xMi4yNjMuMTU1YTE3LjkzIDE3LjkzIDAgMCAxLTM1Ljg1OSAwIDE3LjkyNyAxNy45MjcgMCAwIDEgMTcuOTMtMTcuOTI5IDE3LjkzIDE3LjkzIDAgMCAxIDE3LjkyOSAxNy45M1oiIGZpbGw9IiNmZmYiIHN0cm9rZT0iIzIyNzFCMSIgc3Ryb2tlLXdpZHRoPSIxLjQiLz48L2c+PHBhdGggZD0iTTEwNy4xNDUgMTEyLjA2NnYuMDAxYzAgLjk2Ni4zODQgMS44OTMgMS4wNjggMi41NzdsMjAuMjY1IDIwLjI2NWEzLjY0NiAzLjY0NiAwIDAgMCA1LjE1NCAwbDEzLjI3Ny0xMy4yNzdhMy42NDYgMy42NDYgMCAwIDAgMC01LjE1NGwtMjAuMjY1LTIwLjI2NWEzLjY0NyAzLjY0NyAwIDAgMC0yLjU3Ny0xLjA2OEgxMTAuNzlhMy42NDIgMy42NDIgMCAwIDAtMy42NDUgMy42NDV2MTMuMjc2Wm0xNC40NzUtNi4wMzhhMy41OTIgMy41OTIgMCAxIDEtNy4xODUgMCAzLjU5MiAzLjU5MiAwIDAgMSA3LjE4NSAwWiIgZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjMjI3MUIxIiBzdHJva2Utd2lkdGg9IjEuNSIvPjxyZWN0IHg9IjU1IiB5PSI4OC41MjciIHdpZHRoPSIzNi4zODkiIGhlaWdodD0iMzYuMzg5IiByeD0iMTguMTk0IiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTczLjE5NCA5MS41NmExNS4xNjIgMTUuMTYyIDAgMSAwIDAgMzAuMzI0IDE1LjE2MiAxNS4xNjIgMCAwIDAgMC0zMC4zMjRabTAgMjcuMjkxYTEyLjEyOCAxMi4xMjggMCAwIDEtOC41NzctMjAuNzA2IDEyLjEzIDEyLjEzIDAgMSAxIDguNTc3IDIwLjcwNloiIGZpbGw9IiMyMjcxQjEiLz48cGF0aCBkPSJNNzMuMTk0IDEwNS4yMDZjLTMuMDMyIDAtMy4wMzItLjk1Ni0zLjAzMi0xLjUxNyAwLS41NjEgMS4wNjEtMS41MTYgMy4wMzItMS41MTZzMi4xMDguOTcxIDIuMTIzIDEuNTE2aDMuMDMzYTQuNTQ1IDQuNTQ1IDAgMCAwLTMuNjQtNC4zNjZ2LTEuNjk4aC0zLjAzMnYxLjY1MmMtMy4wMzIuNS00LjU0OCAyLjQ1Ni00LjU0OCA0LjQxMiAwIDEuNjk4Ljc4OCA0LjU0OSA2LjA2NCA0LjU0OSAzLjAzMyAwIDMuMDMzIDEuMDMxIDMuMDMzIDEuNTE2IDAgLjQ4NS0uOTQgMS41MTYtMy4wMzMgMS41MTYtMi43OSAwLTMuMDMyLTEuMzA0LTMuMDMyLTEuNTE2SDY3LjEzYzAgMS4zOTUgMSAzLjg2NiA0LjU0OCA0LjQyN3YxLjYzOGgzLjAzM3YtMS42MzhjMy4wMzItLjUxNSA0LjU0OC0yLjQ3MSA0LjU0OC00LjQyNyAwLTEuNjk4LS43ODgtNC41NDgtNi4wNjUtNC41NDhaIiBmaWxsPSIjMjI3MUIxIi8+PGRlZnM+PGNsaXBQYXRoIGlkPSJhIj48cGF0aCBmaWxsPSIjZmZmIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMDIuOTU5IDQ3KSIgZD0iTTAgMGgzNy4yNTl2MzcuMjU5SDB6Ii8+PC9jbGlwUGF0aD48L2RlZnM+PC9zdmc+";function B8(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}function F8(){let e=[],t={addEventListener:(e,n,r,a)=>(e.addEventListener(n,r,a),t.add(()=>e.removeEventListener(n,r,a))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add(()=>cancelAnimationFrame(n))},nextFrame:(...e)=>t.requestAnimationFrame(()=>t.requestAnimationFrame(...e)),setTimeout(...e){let n=setTimeout(...e);return t.add(()=>clearTimeout(n))},microTask(...e){let n={current:!0};return B8(()=>{n.current&&e[0]()}),t.add(()=>{n.current=!1})},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add(()=>{Object.assign(e.style,{[t]:r})})},group(e){let t=F8();return e(t),this.add(()=>t.dispose())},add:t=>(e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}function Y8(){let[e]=(0,i.useState)(F8);return(0,i.useEffect)(()=>()=>e.dispose(),[e]),e}var Q8=Object.defineProperty,V8=(e,t,n)=>(((e,t,n)=>{t in e?Q8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let W8=new class{constructor(){V8(this,"current",this.detect()),V8(this,"handoffState","pending"),V8(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}},Z8=(e,t)=>{W8.isServer?(0,i.useEffect)(e,t):(0,i.useLayoutEffect)(e,t)};function G8(e){let t=(0,i.useRef)(e);return Z8(()=>{t.current=e},[e]),t}let H8=function(e){let t=G8(e);return i.useCallback((...e)=>t.current(...e),[t])};function $8(){let e=(0,i.useRef)(!1);return Z8(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function X8(){let e=function(){let e="undefined"==typeof document;return"useSyncExternalStore"in s&&(e=>e.useSyncExternalStore)(s)(()=>()=>{},()=>!1,()=>!e)}(),[t,n]=i.useState(W8.isHandoffComplete);return t&&!1===W8.isHandoffComplete&&n(!1),i.useEffect(()=>{!0!==t&&n(!0)},[t]),i.useEffect(()=>W8.handoff(),[]),!e&&t}let q8=Symbol();function J8(...e){let t=(0,i.useRef)(e);(0,i.useEffect)(()=>{t.current=e},[e]);let n=H8(e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)});return e.every(e=>null==e||(null==e?void 0:e[q8]))?void 0:n}var K8,e6;"undefined"!=typeof process&&"undefined"!=typeof globalThis&&"undefined"!=typeof Element&&"test"===(null==(K8=null==process?void 0:process.env)?void 0:K8.NODE_ENV)&&void 0===(null==(e6=null==Element?void 0:Element.prototype)?void 0:e6.getAnimations)&&(Element.prototype.getAnimations=function(){return console.warn(["Headless UI has polyfilled `Element.prototype.getAnimations` for your tests.","Please install a proper polyfill e.g. `jsdom-testing-mocks`, to silence these warnings.","","Example usage:","```js","import { mockAnimationsApi } from 'jsdom-testing-mocks'","mockAnimationsApi()","```"].join("\n")),[]});var t6=(e=>(e[e.None=0]="None",e[e.Closed=1]="Closed",e[e.Enter=2]="Enter",e[e.Leave=4]="Leave",e))(t6||{});function n6(e){let t={};for(let n in e)!0===e[n]&&(t[`data-${n}`]="");return t}let r6=(0,i.createContext)(null);r6.displayName="OpenClosedContext";var a6=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(a6||{});function o6(){return(0,i.useContext)(r6)}function i6({value:e,children:t}){return i.createElement(r6.Provider,{value:e},t)}function s6({children:e}){return i.createElement(r6.Provider,{value:null},e)}function l6(...e){return Array.from(new Set(e.flatMap(e=>"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}function c6(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(e=>`"${e}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,c6),r}var u6=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(u6||{}),d6=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(d6||{});function f6(){let e=function(){let e=(0,i.useRef)([]),t=(0,i.useCallback)(t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)},[]);return(...n)=>{if(!n.every(e=>null==e))return e.current=n,t}}();return(0,i.useCallback)(t=>function({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:a,visible:o=!0,name:i,mergeRefs:s}){s=null!=s?s:p6;let l=h6(t,e);if(o)return m6(l,n,r,i,s);let c=null!=a?a:0;if(2&c){let{static:e=!1,...t}=l;if(e)return m6(t,n,r,i,s)}if(1&c){let{unmount:e=!0,...t}=l;return c6(e?0:1,{0:()=>null,1:()=>m6({...t,hidden:!0,style:{display:"none"}},n,r,i,s)})}return m6(l,n,r,i,s)}({mergeRefs:e,...t}),[e])}function m6(e,t={},n,r,a){let{as:o=n,children:s,refName:l="ref",...c}=y6(e,["unmount","static"]),u=void 0!==e.ref?{[l]:e.ref}:{},d="function"==typeof s?s(t):s;"className"in c&&c.className&&"function"==typeof c.className&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let f={};if(t){let e=!1,n=[];for(let[r,a]of Object.entries(t))"boolean"==typeof a&&(e=!0),!0===a&&n.push(r.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`));if(e){f["data-headlessui-state"]=n.join(" ");for(let e of n)f[`data-${e}`]=""}}if(v6(o)&&(Object.keys(w6(c)).length>0||Object.keys(w6(f)).length>0)){if(!(!(0,i.isValidElement)(d)||Array.isArray(d)&&d.length>1||function(e){return v6(e.type)}(d))){let e=d.props,t=null==e?void 0:e.className,n="function"==typeof t?(...e)=>l6(t(...e),c.className):l6(t,c.className),r=n?{className:n}:{},o=h6(d.props,w6(y6(c,["ref"])));for(let e in f)e in o&&delete f[e];return(0,i.cloneElement)(d,Object.assign({},o,f,u,{ref:a(b6(d),u.ref)},r))}if(Object.keys(w6(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(w6(c)).concat(Object.keys(w6(f))).map(e=>` - ${e}`).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>` - ${e}`).join("\n")].join("\n"))}return(0,i.createElement)(o,Object.assign({},y6(c,["ref"]),!v6(o)&&u,!v6(o)&&f),d)}function p6(...e){return e.every(e=>null==e)?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}function h6(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>{var t;return null==(t=null==e?void 0:e.preventDefault)?void 0:t.call(e)}]);for(let e in n)Object.assign(t,{[e](t,...r){let a=n[e];for(let e of a){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function g6(e){var t;return Object.assign((0,i.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function w6(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function y6(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}function b6(e){return i.version.split(".")[0]>="19"?e.props.ref:e.ref}function v6(e){return e===i.Fragment||e===Symbol.for("react.fragment")}function x6(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||!v6(null!=(t=e.as)?t:S6)||1===i.Children.count(e.children)}let _6=(0,i.createContext)(null);_6.displayName="TransitionContext";var E6=(e=>(e.Visible="visible",e.Hidden="hidden",e))(E6||{});let N6=(0,i.createContext)(null);function M6(e){return"children"in e?M6(e.children):e.current.filter(({el:e})=>null!==e.current).filter(({state:e})=>"visible"===e).length>0}function I6(e,t){let n=G8(e),r=(0,i.useRef)([]),a=$8(),o=Y8(),s=H8((e,t=d6.Hidden)=>{let i=r.current.findIndex(({el:t})=>t===e);-1!==i&&(c6(t,{[d6.Unmount](){r.current.splice(i,1)},[d6.Hidden](){r.current[i].state="hidden"}}),o.microTask(()=>{var e;!M6(r)&&a.current&&(null==(e=n.current)||e.call(n))}))}),l=H8(e=>{let t=r.current.find(({el:t})=>t===e);return t?"visible"!==t.state&&(t.state="visible"):r.current.push({el:e,state:"visible"}),()=>s(e,d6.Unmount)}),c=(0,i.useRef)([]),u=(0,i.useRef)(Promise.resolve()),d=(0,i.useRef)({enter:[],leave:[]}),f=H8((e,n,r)=>{c.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter(([t])=>t!==e)),null==t||t.chains.current[n].push([e,new Promise(e=>{c.current.push(e)})]),null==t||t.chains.current[n].push([e,new Promise(e=>{Promise.all(d.current[n].map(([e,t])=>t)).then(()=>e())})]),"enter"===n?u.current=u.current.then(()=>null==t?void 0:t.wait.current).then(()=>r(n)):r(n)}),m=H8((e,t,n)=>{Promise.all(d.current[t].splice(0).map(([e,t])=>t)).then(()=>{var e;null==(e=c.current.shift())||e()}).then(()=>n(t))});return(0,i.useMemo)(()=>({children:r,register:l,unregister:s,onStart:f,onStop:m,wait:u,chains:d}),[l,s,r,f,m,d,u])}N6.displayName="NestingContext";let S6=i.Fragment,k6=u6.RenderStrategy,j6=g6(function(e,t){let{show:n,appear:r=!1,unmount:a=!0,...o}=e,s=(0,i.useRef)(null),l=J8(...x6(e)?[s,t]:null===t?[]:[t]);X8();let c=o6();if(void 0===n&&null!==c&&(n=(c&a6.Open)===a6.Open),void 0===n)throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[u,d]=(0,i.useState)(n?"visible":"hidden"),f=I6(()=>{n||d("hidden")}),[m,p]=(0,i.useState)(!0),h=(0,i.useRef)([n]);Z8(()=>{!1!==m&&h.current[h.current.length-1]!==n&&(h.current.push(n),p(!1))},[h,n]);let g=(0,i.useMemo)(()=>({show:n,appear:r,initial:m}),[n,r,m]);Z8(()=>{n?d("visible"):!M6(f)&&null!==s.current&&d("hidden")},[n,f]);let w={unmount:a},y=H8(()=>{var t;m&&p(!1),null==(t=e.beforeEnter)||t.call(e)}),b=H8(()=>{var t;m&&p(!1),null==(t=e.beforeLeave)||t.call(e)}),v=f6();return i.createElement(N6.Provider,{value:f},i.createElement(_6.Provider,{value:g},v({ourProps:{...w,as:i.Fragment,children:i.createElement(D6,{ref:l,...w,...o,beforeEnter:y,beforeLeave:b})},theirProps:{},defaultTag:i.Fragment,features:k6,visible:"visible"===u,name:"Transition"})))}),D6=g6(function(e,t){var n,r;let{transition:a=!0,beforeEnter:o,afterEnter:s,beforeLeave:l,afterLeave:c,enter:u,enterFrom:d,enterTo:f,entered:m,leave:p,leaveFrom:h,leaveTo:g,...w}=e,[y,b]=(0,i.useState)(null),v=(0,i.useRef)(null),x=x6(e),_=J8(...x?[v,t,b]:null===t?[]:[t]),E=null==(n=w.unmount)||n?d6.Unmount:d6.Hidden,{show:N,appear:M,initial:I}=function(){let e=(0,i.useContext)(_6);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),[S,k]=(0,i.useState)(N?"visible":"hidden"),j=function(){let e=(0,i.useContext)(N6);if(null===e)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}(),{register:D,unregister:C}=j;Z8(()=>D(v),[D,v]),Z8(()=>{if(E===d6.Hidden&&v.current)return N&&"visible"!==S?void k("visible"):c6(S,{hidden:()=>C(v),visible:()=>D(v)})},[S,v,D,C,N,E]);let A=X8();Z8(()=>{if(x&&A&&"visible"===S&&null===v.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[v,S,A,x]);let T=I&&!M,O=M&&N&&I,L=(0,i.useRef)(!1),z=I6(()=>{L.current||(k("hidden"),C(v))},j),P=H8(e=>{L.current=!0;let t=e?"enter":"leave";z.onStart(v,t,e=>{"enter"===e?null==o||o():"leave"===e&&(null==l||l())})}),R=H8(e=>{let t=e?"enter":"leave";L.current=!1,z.onStop(v,t,e=>{"enter"===e?null==s||s():"leave"===e&&(null==c||c())}),"leave"===t&&!M6(z)&&(k("hidden"),C(v))});(0,i.useEffect)(()=>{x&&a||(P(N),R(N))},[N,x,a]);let U=!(!a||!x||!A||T),[,B]=function(e,t,n,r){let[a,o]=(0,i.useState)(n),{hasFlag:s,addFlag:l,removeFlag:c}=function(e=0){let[t,n]=(0,i.useState)(e),r=(0,i.useCallback)(e=>n(e),[]),a=(0,i.useCallback)(e=>n(t=>t|e),[]),o=(0,i.useCallback)(e=>(t&e)===e,[t]),s=(0,i.useCallback)(e=>n(t=>t&~e),[]),l=(0,i.useCallback)(e=>n(t=>t^e),[]);return{flags:t,setFlag:r,addFlag:a,hasFlag:o,removeFlag:s,toggleFlag:l}}(e&&a?3:0),u=(0,i.useRef)(!1),d=(0,i.useRef)(!1),f=Y8();return Z8(()=>{var a;if(e)return n&&o(!0),t?(null==(a=null==r?void 0:r.start)||a.call(r,n),function(e,{prepare:t,run:n,done:r,inFlight:a}){let o=F8();return function(e,{inFlight:t,prepare:n}){if(null!=t&&t.current)return void n();let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}(e,{prepare:t,inFlight:a}),o.nextFrame(()=>{n(),o.requestAnimationFrame(()=>{o.add(function(e,t){var n,r;let a=F8();if(!e)return a.dispose;let o=!1;a.add(()=>{o=!0});let i=null!=(r=null==(n=e.getAnimations)?void 0:n.call(e).filter(e=>e instanceof CSSTransition))?r:[];return 0===i.length?(t(),a.dispose):(Promise.allSettled(i.map(e=>e.finished)).then(()=>{o||t()}),a.dispose)}(e,r))})}),o.dispose}(t,{inFlight:u,prepare(){d.current?d.current=!1:d.current=u.current,u.current=!0,!d.current&&(n?(l(3),c(4)):(l(4),c(2)))},run(){d.current?n?(c(3),l(4)):(c(4),l(3)):n?c(1):l(1)},done(){var e;d.current&&function(e){var t,n;return(null!=(n=null==(t=e.getAnimations)?void 0:t.call(e))?n:[]).some(e=>e instanceof CSSTransition&&"finished"!==e.playState)}(t)||(u.current=!1,c(7),n||o(!1),null==(e=null==r?void 0:r.end)||e.call(r,n))}})):void(n&&l(3))},[e,n,t,f]),e?[a,{closed:s(1),enter:s(2),leave:s(4),transition:s(2)||s(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}(U,y,N,{start:P,end:R}),F=w6({ref:_,className:(null==(r=l6(w.className,O&&u,O&&d,B.enter&&u,B.enter&&B.closed&&d,B.enter&&!B.closed&&f,B.leave&&p,B.leave&&!B.closed&&h,B.leave&&B.closed&&g,!B.transition&&N&&m))?void 0:r.trim())||void 0,...n6(B)}),Y=0;"visible"===S&&(Y|=a6.Open),"hidden"===S&&(Y|=a6.Closed),N&&"hidden"===S&&(Y|=a6.Opening),!N&&"visible"===S&&(Y|=a6.Closing);let Q=f6();return i.createElement(N6.Provider,{value:z},i.createElement(i6,{value:Y},Q({ourProps:F,theirProps:w,defaultTag:S6,features:k6,visible:"visible"===S,name:"Transition.Child"})))}),C6=g6(function(e,t){let n=null!==(0,i.useContext)(_6),r=null!==o6();return i.createElement(i.Fragment,null,!n&&r?i.createElement(j6,{ref:t,...e}):i.createElement(D6,{ref:t,...e}))}),A6=Object.assign(j6,{Child:C6,Root:j6});var T6=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(T6||{});function O6(e,t,n,r){let a=G8(n);(0,i.useEffect)(()=>{function n(e){a.current(e)}return(e=null!=e?e:window).addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)},[e,t,r])}class L6 extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}}var z6,P6,R6,U6=Object.defineProperty,B6=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},F6=(e,t,n)=>(B6(e,t,"read from private field"),n?n.call(e):t.get(e)),Y6=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},Q6=(e,t,n,r)=>(B6(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);class V6{constructor(e){Y6(this,z6,{}),Y6(this,P6,new L6(()=>new Set)),Y6(this,R6,new Set),((e,t,n)=>{((e,t,n)=>{t in e?U6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n)})(this,"disposables",F8()),Q6(this,z6,e),W8.isServer&&this.disposables.microTask(()=>{this.dispose()})}dispose(){this.disposables.dispose()}get state(){return F6(this,z6)}subscribe(e,t){if(W8.isServer)return()=>{};let n={selector:e,callback:t,current:e(F6(this,z6))};return F6(this,R6).add(n),this.disposables.add(()=>{F6(this,R6).delete(n)})}on(e,t){return W8.isServer?()=>{}:(F6(this,P6).get(e).add(t),this.disposables.add(()=>{F6(this,P6).get(e).delete(t)}))}send(e){let t=this.reduce(F6(this,z6),e);if(t!==F6(this,z6)){Q6(this,z6,t);for(let e of F6(this,R6)){let t=e.selector(F6(this,z6));W6(e.current,t)||(e.current=t,e.callback(t))}for(let t of F6(this,P6).get(e.type))t(F6(this,z6),e)}}}function W6(e,t){return!!Object.is(e,t)||"object"==typeof e&&null!==e&&"object"==typeof t&&null!==t&&(Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&Z6(e[Symbol.iterator](),t[Symbol.iterator]()):e instanceof Map&&t instanceof Map||e instanceof Set&&t instanceof Set?e.size===t.size&&Z6(e.entries(),t.entries()):!(!G6(e)||!G6(t))&&Z6(Object.entries(e)[Symbol.iterator](),Object.entries(t)[Symbol.iterator]()))}function Z6(e,t){for(;;){let n=e.next(),r=t.next();if(n.done&&r.done)return!0;if(n.done||r.done||!Object.is(n.value,r.value))return!1}}function G6(e){if("[object Object]"!==Object.prototype.toString.call(e))return!1;let t=Object.getPrototypeOf(e);return null===t||null===Object.getPrototypeOf(t)}z6=new WeakMap,P6=new WeakMap,R6=new WeakMap;var H6=Object.defineProperty,$6=(e,t,n)=>(((e,t,n)=>{t in e?H6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n),X6=(e=>(e[e.Push=0]="Push",e[e.Pop=1]="Pop",e))(X6||{});let q6={0(e,t){let n=t.id,r=e.stack,a=e.stack.indexOf(n);if(-1!==a){let t=e.stack.slice();return t.splice(a,1),t.push(n),r=t,{...e,stack:r}}return{...e,stack:[...e.stack,n]}},1(e,t){let n=t.id,r=e.stack.indexOf(n);if(-1===r)return e;let a=e.stack.slice();return a.splice(r,1),{...e,stack:a}}};class J6 extends V6{constructor(){super(...arguments),$6(this,"actions",{push:e=>this.send({type:0,id:e}),pop:e=>this.send({type:1,id:e})}),$6(this,"selectors",{isTop:(e,t)=>e.stack[e.stack.length-1]===t,inStack:(e,t)=>e.stack.includes(t)})}static new(){return new J6({stack:[]})}reduce(e,t){return c6(t.type,q6,e,t)}}const K6=new L6(()=>J6.new());var e9=a(8418);function t9(e,t,n=W6){return(0,e9.useSyncExternalStoreWithSelector)(H8(t=>e.subscribe(n9,t)),H8(()=>e.state),H8(()=>e.state),H8(t),n)}function n9(e){return e}function r9(e,t){let n=(0,i.useId)(),r=K6.get(t),[a,o]=t9(r,(0,i.useCallback)(e=>[r.selectors.isTop(e,n),r.selectors.inStack(e,n)],[r,n]));return Z8(()=>{if(e)return r.actions.push(n),()=>r.actions.pop(n)},[r,e,n]),!!e&&(!o||a)}function a9(e){var t;return W8.isServer?null:null==e?document:null!=(t=null==e?void 0:e.ownerDocument)?t:document}function o9(e){var t,n;return W8.isServer?null:null==e?document:null!=(n=null==(t=null==e?void 0:e.getRootNode)?void 0:t.call(e))?n:document}function i9(e){var t,n;return null!=(n=null==(t=o9(e))?void 0:t.activeElement)?n:null}let s9=new Map,l9=new Map;function c9(e){var t;let n=null!=(t=l9.get(e))?t:0;return l9.set(e,n+1),0!==n||(s9.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0),()=>function(e){var t;let n=null!=(t=l9.get(e))?t:1;if(1===n?l9.delete(e):l9.set(e,n-1),1!==n)return;let r=s9.get(e);r&&(null===r["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,s9.delete(e))}(e)}function u9(e){return function(e){return"object"==typeof e&&null!==e&&"nodeType"in e}(e)&&"tagName"in e}function d9(e){return u9(e)&&"accessKey"in e}function f9(e){return u9(e)&&"tabIndex"in e}let m9=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","details>summary","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(","),p9=["[data-autofocus]"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var h9=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e[e.AutoFocus=64]="AutoFocus",e))(h9||{}),g9=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(g9||{}),w9=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(w9||{});var y9=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(y9||{});var b9=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(b9||{});function v9(e){null==e||e.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));let x9=["textarea","input"].join(",");function _9(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:a=[]}={}){let o=Array.isArray(e)?e.length>0?o9(e[0]):document:o9(e),i=Array.isArray(e)?n?function(e,t=e=>e){return e.slice().sort((e,n)=>{let r=t(e),a=t(n);if(null===r||null===a)return 0;let o=r.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}(e):e:64&t?function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(p9)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e):function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(m9)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e);a.length>0&&i.length>1&&(i=i.filter(e=>!a.some(t=>null!=t&&"current"in t?(null==t?void 0:t.current)===e:t===e))),r=null!=r?r:null==o?void 0:o.activeElement;let s,l=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,i.indexOf(r))-1;if(4&t)return Math.max(0,i.indexOf(r))+1;if(8&t)return i.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=32&t?{preventScroll:!0}:{},d=0,f=i.length;do{if(d>=f||d+f<=0)return 0;let e=c+d;if(16&t)e=(e+f)%f;else{if(e<0)return 3;if(e>=f)return 1}s=i[e],null==s||s.focus(u),d+=l}while(s!==i9(s));return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,x9))&&n}(s)&&s.select(),2}function E9(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function N9(){return E9()||/Android/gi.test(window.navigator.userAgent)}function M9(e,t,n,r){let a=G8(n);(0,i.useEffect)(()=>{if(e)return document.addEventListener(t,n,r),()=>document.removeEventListener(t,n,r);function n(e){a.current(e)}},[e,t,r])}function I9(e,t,n,r){let a=G8(n);(0,i.useEffect)(()=>{if(e)return window.addEventListener(t,n,r),()=>window.removeEventListener(t,n,r);function n(e){a.current(e)}},[e,t,r])}function S9(e,t,n){let r=G8(n),a=(0,i.useCallback)(function(e,n){if(e.defaultPrevented)return;let a=n(e);if(null===a||!a.getRootNode().contains(a)||!a.isConnected)return;let o=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of o)if(null!==t&&(t.contains(a)||e.composed&&e.composedPath().includes(t)))return;return!function(e,t=0){var n;return e!==(null==(n=a9(e))?void 0:n.body)&&c6(t,{0:()=>e.matches(m9),1(){let t=e;for(;null!==t;){if(t.matches(m9))return!0;t=t.parentElement}return!1}})}(a,y9.Loose)&&-1!==a.tabIndex&&e.preventDefault(),r.current(e,a)},[r,t]),o=(0,i.useRef)(null);M9(e,"pointerdown",e=>{var t,n;N9()||(o.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target)},!0),M9(e,"pointerup",e=>{if(N9()||!o.current)return;let t=o.current;return o.current=null,a(e,()=>t)},!0);let s=(0,i.useRef)({x:0,y:0});M9(e,"touchstart",e=>{s.current.x=e.touches[0].clientX,s.current.y=e.touches[0].clientY},!0),M9(e,"touchend",e=>{let t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY;if(!(Math.abs(t-s.current.x)>=30||Math.abs(n-s.current.y)>=30))return a(e,()=>f9(e.target)?e.target:null)},!0),I9(e,"blur",e=>a(e,()=>function(e){return d9(e)&&"IFRAME"===e.nodeName}(window.document.activeElement)?window.document.activeElement:null),!0)}function k9(...e){return(0,i.useMemo)(()=>a9(...e),[...e])}var j9=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(j9||{});let D9=g6(function(e,t){var n;let{features:r=1,...a}=e,o={ref:t,"aria-hidden":!(2&~r)||(null!=(n=a["aria-hidden"])?n:void 0),hidden:!(4&~r)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...!(4&~r)&&!!(2&~r)&&{display:"none"}}};return f6()({ourProps:o,theirProps:a,slot:{},defaultTag:"span",name:"Hidden"})}),C9=(0,i.createContext)(null);function A9({children:e,node:t}){let[n,r]=(0,i.useState)(null),a=T9(null!=t?t:n);return i.createElement(C9.Provider,{value:a},e,null===a&&i.createElement(D9,{features:j9.Hidden,ref:e=>{var t,n;if(e)for(let a of null!=(n=null==(t=a9(e))?void 0:t.querySelectorAll("html > *, body > *"))?n:[])if(a!==document.body&&a!==document.head&&u9(a)&&null!=a&&a.contains(e)){r(a);break}}}))}function T9(e=null){var t;return null!=(t=(0,i.useContext)(C9))?t:e}function O9(){let e;return{before({doc:t}){var n;let r=t.documentElement,a=null!=(n=t.defaultView)?n:window;e=Math.max(0,a.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,a=Math.max(0,r.clientWidth-r.offsetWidth),o=Math.max(0,e-a);n.style(r,"paddingRight",`${o}px`)}}}function L9(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let z9=function(e,t){let n=new Map,r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e,...a){let o=t[e].call(n,...a);o&&(n=o,r.forEach(e=>e()))}}}(0,{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:F8(),meta:new Set,computedMeta:{}};return r.count++,r.meta.add(t),r.computedMeta=L9(r.meta),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t),n.computedMeta=L9(n.meta)),this},SCROLL_PREVENT(e){let t={doc:e.doc,d:e.d,meta:()=>e.computedMeta},n=[E9()?{before({doc:e,d:t,meta:n}){function r(e){for(let t of n().containers)for(let n of t())if(n.contains(e))return!0;return!1}t.microTask(()=>{var n;if("auto"!==window.getComputedStyle(e.documentElement).scrollBehavior){let n=F8();n.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>n.dispose()))}let a=null!=(n=window.scrollY)?n:window.pageYOffset,o=null;t.addEventListener(e,"click",t=>{if(f9(t.target))try{let n=t.target.closest("a");if(!n)return;let{hash:a}=new URL(n.href),i=e.querySelector(a);f9(i)&&!r(i)&&(o=i)}catch{}},!0),t.group(n=>{t.addEventListener(e,"touchstart",e=>{if(n.dispose(),f9(e.target)&&function(e){return u9(e)&&"style"in e}(e.target))if(r(e.target)){let t=e.target;for(;t.parentElement&&r(t.parentElement);)t=t.parentElement;n.style(t,"overscrollBehavior","contain")}else n.style(e.target,"touchAction","none")})}),t.addEventListener(e,"touchmove",e=>{if(f9(e.target)){if(function(e){return d9(e)&&"INPUT"===e.nodeName}(e.target))return;if(r(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),t.add(()=>{var e;let t=null!=(e=window.scrollY)?e:window.pageYOffset;a!==t&&window.scrollTo(0,a),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{},O9(),{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];n.forEach(({before:e})=>null==e?void 0:e(t)),n.forEach(({after:e})=>null==e?void 0:e(t))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});function P9(e){return(0,i.useMemo)(()=>e,Object.values(e))}z9.subscribe(()=>{let e=z9.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&z9.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&z9.dispatch("TEARDOWN",n)}});let R9=(0,i.createContext)(()=>{});function U9({value:e,children:t}){return i.createElement(R9.Provider,{value:e},t)}let B9=(0,i.createContext)(!1);function F9(e){return i.createElement(B9.Provider,{value:e.force},e.children)}let Y9=(0,i.createContext)(void 0),Q9=(0,i.createContext)(null);function V9(){let e=(0,i.useContext)(Q9);if(null===e){let e=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,V9),e}return e}Q9.displayName="DescriptionContext";let W9=g6(function(e,t){let n=(0,i.useId)(),r=(0,i.useContext)(Y9),{id:a=`headlessui-description-${n}`,...o}=e,s=V9(),l=J8(t);Z8(()=>s.register(a),[a,s.register]);let c=P9({...s.slot,disabled:r||!1}),u={ref:l,...s.props,id:a};return f6()({ourProps:u,theirProps:o,slot:c,defaultTag:"p",name:s.name||"Description"})}),Z9=Object.assign(W9,{});function G9(e){let t=H8(e),n=(0,i.useRef)(!1);(0,i.useEffect)(()=>(n.current=!1,()=>{n.current=!0,B8(()=>{n.current&&t()})}),[t])}var H9=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(H9||{});function $9(e,t){let n=(0,i.useRef)([]),r=H8(e);(0,i.useEffect)(()=>{let e=[...n.current];for(let[a,o]of t.entries())if(n.current[a]!==o){let a=r(t,e);return n.current=t,a}},[r,...t])}let X9=[];function q9(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let n of e.current)u9(n.current)&&t.add(n.current);return t}!function(){function e(){"loading"!==document.readyState&&((()=>{function e(e){if(!f9(e.target)||e.target===document.body||X9[0]===e.target)return;let t=e.target;t=t.closest(m9),X9.unshift(null!=t?t:e.target),X9=X9.filter(e=>null!=e&&e.isConnected),X9.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})})(),document.removeEventListener("DOMContentLoaded",e))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",e),e())}();var J9=(e=>(e[e.None=0]="None",e[e.InitialFocus=1]="InitialFocus",e[e.TabLock=2]="TabLock",e[e.FocusLock=4]="FocusLock",e[e.RestoreFocus=8]="RestoreFocus",e[e.AutoFocus=16]="AutoFocus",e))(J9||{});let K9=g6(function(e,t){let n=(0,i.useRef)(null),r=J8(n,t),{initialFocus:a,initialFocusFallback:o,containers:s,features:l=15,...c}=e;X8()||(l=0);let u=k9(n.current);!function(e,{ownerDocument:t}){let n=!!(8&e),r=function(e=!0){let t=(0,i.useRef)(X9.slice());return $9(([e],[n])=>{!0===n&&!1===e&&B8(()=>{t.current.splice(0)}),!1===n&&!0===e&&(t.current=X9.slice())},[e,X9,t]),H8(()=>{var e;return null!=(e=t.current.find(e=>null!=e&&e.isConnected))?e:null})}(n);$9(()=>{n||function(e){return i9(e)===e}(null==t?void 0:t.body)&&v9(r())},[n]),G9(()=>{n&&v9(r())})}(l,{ownerDocument:u});let d=function(e,{ownerDocument:t,container:n,initialFocus:r,initialFocusFallback:a}){let o=(0,i.useRef)(null),s=r9(!!(1&e),"focus-trap#initial-focus"),l=$8();return $9(()=>{if(0===e)return;if(!s)return void(null!=a&&a.current&&v9(a.current));let i=n.current;i&&B8(()=>{if(!l.current)return;let n=null==t?void 0:t.activeElement;if(null!=r&&r.current){if((null==r?void 0:r.current)===n)return void(o.current=n)}else if(i.contains(n))return void(o.current=n);if(null!=r&&r.current)v9(r.current);else{if(16&e){if(_9(i,h9.First|h9.AutoFocus)!==g9.Error)return}else if(_9(i,h9.First)!==g9.Error)return;if(null!=a&&a.current&&(v9(a.current),(null==t?void 0:t.activeElement)===a.current))return;console.warn("There are no focusable elements inside the <FocusTrap />")}o.current=null==t?void 0:t.activeElement})},[a,s,e]),o}(l,{ownerDocument:u,container:n,initialFocus:a,initialFocusFallback:o});!function(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:a}){let o=$8(),i=!!(4&e);O6(null==t?void 0:t.defaultView,"focus",e=>{if(!i||!o.current)return;let t=q9(r);d9(n.current)&&t.add(n.current);let s=a.current;if(!s)return;let l=e.target;d9(l)?t7(t,l)?(a.current=l,v9(l)):(e.preventDefault(),e.stopPropagation(),v9(s)):v9(a.current)},!0)}(l,{ownerDocument:u,container:n,containers:s,previousActiveElement:d});let f=function(){let e=(0,i.useRef)(0);return I9(!0,"keydown",t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)},!0),e}(),m=H8(e=>{if(!d9(n.current))return;let t=n.current;c6(f.current,{[H9.Forwards]:()=>{_9(t,h9.First,{skipElements:[e.relatedTarget,o]})},[H9.Backwards]:()=>{_9(t,h9.Last,{skipElements:[e.relatedTarget,o]})}})}),p=r9(!!(2&l),"focus-trap#tab-lock"),h=Y8(),g=(0,i.useRef)(!1),w={ref:r,onKeyDown(e){"Tab"==e.key&&(g.current=!0,h.requestAnimationFrame(()=>{g.current=!1}))},onBlur(e){if(!(4&l))return;let t=q9(s);d9(n.current)&&t.add(n.current);let r=e.relatedTarget;f9(r)&&"true"!==r.dataset.headlessuiFocusGuard&&(t7(t,r)||(g.current?_9(n.current,c6(f.current,{[H9.Forwards]:()=>h9.Next,[H9.Backwards]:()=>h9.Previous})|h9.WrapAround,{relativeTo:e.target}):f9(e.target)&&v9(e.target)))}},y=f6();return i.createElement(i.Fragment,null,p&&i.createElement(D9,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:m,features:j9.Focusable}),y({ourProps:w,theirProps:c,defaultTag:"div",name:"FocusTrap"}),p&&i.createElement(D9,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:m,features:j9.Focusable}))}),e7=Object.assign(K9,{features:J9});function t7(e,t){for(let n of e)if(n.contains(t))return!0;return!1}let n7=i.Fragment,r7=g6(function(e,t){let{ownerDocument:n=null,...r}=e,a=(0,i.useRef)(null),o=J8(function(e,t=!0){return Object.assign(e,{[q8]:t})}(e=>{a.current=e}),t),s=k9(a.current),l=function(e){let t=(0,i.useContext)(B9),n=(0,i.useContext)(o7),[r,a]=(0,i.useState)(()=>{var r;if(!t&&null!==n)return null!=(r=n.current)?r:null;if(W8.isServer)return null;let a=null==e?void 0:e.getElementById("headlessui-portal-root");if(a)return a;if(null===e)return null;let o=e.createElement("div");return o.setAttribute("id","headlessui-portal-root"),e.body.appendChild(o)});return(0,i.useEffect)(()=>{null!==r&&(null!=e&&e.body.contains(r)||null==e||e.body.appendChild(r))},[r,e]),(0,i.useEffect)(()=>{t||null!==n&&a(n.current)},[n,a,t]),r}(null!=n?n:s),c=(0,i.useContext)(i7),u=Y8(),d=f6();return G9(()=>{var e;l&&l.childNodes.length<=0&&(null==(e=l.parentElement)||e.removeChild(l))}),l?(0,wn.createPortal)(i.createElement("div",{"data-headlessui-portal":"",ref:e=>{u.dispose(),c&&e&&u.add(c.register(e))}},d({ourProps:{ref:o},theirProps:r,slot:{},defaultTag:n7,name:"Portal"})),l):null}),a7=i.Fragment,o7=(0,i.createContext)(null),i7=(0,i.createContext)(null),s7=g6(function(e,t){let n=J8(t),{enabled:r=!0,ownerDocument:a,...o}=e,s=f6();return r?i.createElement(r7,{...o,ownerDocument:a,ref:n}):s({ourProps:{ref:n},theirProps:o,slot:{},defaultTag:n7,name:"Portal"})}),l7=g6(function(e,t){let{target:n,...r}=e,a={ref:J8(t)},o=f6();return i.createElement(o7.Provider,{value:n},o({ourProps:a,theirProps:r,defaultTag:a7,name:"Popover.Group"}))}),c7=Object.assign(s7,{Group:l7});var u7=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(u7||{}),d7=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(d7||{});let f7={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},m7=(0,i.createContext)(null);function p7(e){let t=(0,i.useContext)(m7);if(null===t){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,p7),t}return t}function h7(e,t){return c6(t.type,f7,e,t)}m7.displayName="DialogContext";let g7=g6(function(e,t){let n=(0,i.useId)(),{id:r=`headlessui-dialog-${n}`,open:a,onClose:o,initialFocus:s,role:l="dialog",autoFocus:c=!0,__demoMode:u=!1,unmount:d=!1,...f}=e,m=(0,i.useRef)(!1);l="dialog"===l||"alertdialog"===l?l:(m.current||(m.current=!0,console.warn(`Invalid role [${l}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog");let p=o6();void 0===a&&null!==p&&(a=(p&a6.Open)===a6.Open);let h=(0,i.useRef)(null),g=J8(h,t),w=k9(h.current),y=a?0:1,[b,v]=(0,i.useReducer)(h7,{titleId:null,descriptionId:null,panelRef:(0,i.createRef)()}),x=H8(()=>o(!1)),_=H8(e=>v({type:0,id:e})),E=!!X8()&&0===y,[N,M]=function(){let e=(0,i.useContext)(i7),t=(0,i.useRef)([]),n=H8(n=>(t.current.push(n),e&&e.register(n),()=>r(n))),r=H8(n=>{let r=t.current.indexOf(n);-1!==r&&t.current.splice(r,1),e&&e.unregister(n)}),a=(0,i.useMemo)(()=>({register:n,unregister:r,portals:t}),[n,r,t]);return[t,(0,i.useMemo)(()=>function({children:e}){return i.createElement(i7.Provider,{value:a},e)},[a])]}(),I={get current(){var e;return null!=(e=b.panelRef.current)?e:h.current}},S=T9(),{resolveContainers:k}=function({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=H8(()=>{var r,a;let o=a9(n),i=[];for(let t of e)null!==t&&(u9(t)?i.push(t):"current"in t&&u9(t.current)&&i.push(t.current));if(null!=t&&t.current)for(let e of t.current)i.push(e);for(let e of null!=(r=null==o?void 0:o.querySelectorAll("html > *, body > *"))?r:[])e!==document.body&&e!==document.head&&u9(e)&&"headlessui-portal-root"!==e.id&&(n&&(e.contains(n)||e.contains(null==(a=null==n?void 0:n.getRootNode())?void 0:a.host))||i.some(t=>e.contains(t))||i.push(e));return i});return{resolveContainers:r,contains:H8(e=>r().some(t=>t.contains(e)))}}({mainTreeNode:S,portals:N,defaultContainers:[I]}),j=null!==p&&(p&a6.Closing)===a6.Closing;!function(e,{allowed:t,disallowed:n}={}){let r=r9(e,"inert-others");Z8(()=>{var e,a;if(!r)return;let o=F8();for(let t of null!=(e=null==n?void 0:n())?e:[])t&&o.add(c9(t));let i=null!=(a=null==t?void 0:t())?a:[];for(let e of i){if(!e)continue;let t=a9(e);if(!t)continue;let n=e.parentElement;for(;n&&n!==t.body;){for(let e of n.children)i.some(t=>e.contains(t))||o.add(c9(e));n=n.parentElement}}return o.dispose},[r,t,n])}(!u&&!j&&E,{allowed:H8(()=>{var e,t;return[null!=(t=null==(e=h.current)?void 0:e.closest("[data-headlessui-portal]"))?t:null]}),disallowed:H8(()=>{var e;return[null!=(e=null==S?void 0:S.closest("body > *:not(#headlessui-portal-root)"))?e:null]})});let D=K6.get(null);Z8(()=>{if(E)return D.actions.push(r),()=>D.actions.pop(r)},[D,r,E]);let C=t9(D,(0,i.useCallback)(e=>D.selectors.isTop(e,r),[D,r]));S9(C,k,e=>{e.preventDefault(),x()}),function(e,t=("undefined"!=typeof document?document.defaultView:null),n){let r=r9(e,"escape");O6(t,"keydown",e=>{r&&(e.defaultPrevented||e.key===T6.Escape&&n(e))})}(C,null==w?void 0:w.defaultView,e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur(),x()}),function(e,t,n=()=>[document.body]){!function(e,t,n=()=>({containers:[]})){let r=function(e){return(0,i.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}(z9),a=t?r.get(t):void 0,o=!!a&&a.count>0;Z8(()=>{if(t&&e)return z9.dispatch("PUSH",t,n),()=>z9.dispatch("POP",t,n)},[e,t])}(r9(e,"scroll-lock"),t,e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}})}(!u&&!j&&E,w,k),function(e,t,n){let r=G8(e=>{let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&n()});(0,i.useEffect)(()=>{if(!e)return;let n=null===t?null:d9(t)?t:t.current;if(!n)return;let a=F8();if("undefined"!=typeof ResizeObserver){let e=new ResizeObserver(()=>r.current(n));e.observe(n),a.add(()=>e.disconnect())}if("undefined"!=typeof IntersectionObserver){let e=new IntersectionObserver(()=>r.current(n));e.observe(n),a.add(()=>e.disconnect())}return()=>a.dispose()},[t,r,e])}(E,h,x);let[A,T]=function(){let[e,t]=(0,i.useState)([]);return[e.length>0?e.join(" "):void 0,(0,i.useMemo)(()=>function(e){let n=H8(e=>(t(t=>[...t,e]),()=>t(t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))),r=(0,i.useMemo)(()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value}),[n,e.slot,e.name,e.props,e.value]);return i.createElement(Q9.Provider,{value:r},e.children)},[t])]}(),O=(0,i.useMemo)(()=>[{dialogState:y,close:x,setTitleId:_,unmount:d},b],[y,x,_,d,b]),L=P9({open:0===y}),z={ref:g,id:r,role:l,tabIndex:-1,"aria-modal":u?void 0:0===y||void 0,"aria-labelledby":b.titleId,"aria-describedby":A,unmount:d},P=!function(){var e;let[t]=(0,i.useState)(()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null),[n,r]=(0,i.useState)(null!=(e=null==t?void 0:t.matches)&&e);return Z8(()=>{if(t)return t.addEventListener("change",e),()=>t.removeEventListener("change",e);function e(e){r(e.matches)}},[t]),n}(),R=J9.None;E&&!u&&(R|=J9.RestoreFocus,R|=J9.TabLock,c&&(R|=J9.AutoFocus),P&&(R|=J9.InitialFocus));let U=f6();return i.createElement(s6,null,i.createElement(F9,{force:!0},i.createElement(c7,null,i.createElement(m7.Provider,{value:O},i.createElement(l7,{target:h},i.createElement(F9,{force:!1},i.createElement(T,{slot:L},i.createElement(M,null,i.createElement(e7,{initialFocus:s,initialFocusFallback:h,containers:k,features:R},i.createElement(U9,{value:x},U({ourProps:z,theirProps:f,slot:L,defaultTag:w7,features:y7,visible:0===y,name:"Dialog"})))))))))))}),w7="div",y7=u6.RenderStrategy|u6.Static,b7=g6(function(e,t){let{transition:n=!1,open:r,...a}=e,o=o6(),s=e.hasOwnProperty("open")||null!==o,l=e.hasOwnProperty("onClose");if(!s&&!l)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!s)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!l)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!o&&"boolean"!=typeof e.open)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if("function"!=typeof e.onClose)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return void 0===r&&!n||a.static?i.createElement(A9,null,i.createElement(g7,{ref:t,open:r,...a})):i.createElement(A9,null,i.createElement(A6,{show:r,transition:n,unmount:a.unmount},i.createElement(g7,{ref:t,...a})))}),v7=g6(function(e,t){let n=(0,i.useId)(),{id:r=`headlessui-dialog-panel-${n}`,transition:a=!1,...o}=e,[{dialogState:s,unmount:l},c]=p7("Dialog.Panel"),u=J8(t,c.panelRef),d=P9({open:0===s}),f=H8(e=>{e.stopPropagation()}),m={ref:u,id:r,onClick:f},p=a?C6:i.Fragment,h=a?{unmount:l}:{},g=f6();return i.createElement(p,{...h},g({ourProps:m,theirProps:o,slot:d,defaultTag:"div",name:"Dialog.Panel"}))}),x7=(g6(function(e,t){let{transition:n=!1,...r}=e,[{dialogState:a,unmount:o}]=p7("Dialog.Backdrop"),s=P9({open:0===a}),l={ref:t,"aria-hidden":!0},c=n?C6:i.Fragment,u=n?{unmount:o}:{},d=f6();return i.createElement(c,{...u},d({ourProps:l,theirProps:r,slot:s,defaultTag:"div",name:"Dialog.Backdrop"}))}),g6(function(e,t){let n=(0,i.useId)(),{id:r=`headlessui-dialog-title-${n}`,...a}=e,[{dialogState:o,setTitleId:s}]=p7("Dialog.Title"),l=J8(t);(0,i.useEffect)(()=>(s(r),()=>s(null)),[r,s]);let c=P9({open:0===o}),u={ref:l,id:r};return f6()({ourProps:u,theirProps:a,slot:c,defaultTag:"h2",name:"Dialog.Title"})})),_7=Object.assign(b7,{Panel:v7,Title:x7,Description:Z9});const E7=({sourceStep:e,availableSteps:t,acceptRedirect:n,setAcceptRedirect:r,rejectRedirect:a,setRejectRedirect:i})=>(0,o.createElement)("div",{className:"border border-gray-200 rounded-lg p-4 mb-4"},(0,o.createElement)("div",{className:"font-medium text-gray-800 mb-3"},e.title," (",e.type,")",e.isVariation&&(0,o.createElement)("span",{className:"ml-2 text-xs bg-blue-100 text-blue-700 px-2 py-0.5 rounded"},(0,z.__)("A/B Variation","cartflows"))),(0,o.createElement)("div",{className:"mb-3"},(0,o.createElement)("label",{className:"block text-sm font-normal text-gray-600 mb-1"},(0,z.__)("Accept (Yes) - redirect to:","cartflows")),(0,o.createElement)("select",{className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:ring focus:ring-primary-100 focus:border-primary-500 focus:outline-none",value:n,onChange:e=>r(e.target.value)},t.map(e=>(0,o.createElement)("option",{key:`accept-${e.id}`,value:e.id},e.title)))),(0,o.createElement)("div",null,(0,o.createElement)("label",{className:"block text-sm font-normal text-gray-600 mb-1"},(0,z.__)("Reject (No) - redirect to:","cartflows")),(0,o.createElement)("select",{className:"w-full px-3 py-2 text-sm border border-gray-200 rounded-md focus:ring focus:ring-primary-100 focus:border-primary-500 focus:outline-none",value:a,onChange:e=>i(e.target.value)},t.map(e=>(0,o.createElement)("option",{key:`reject-${e.id}`,value:e.id},e.title))))),N7=({isOpen:e,onClose:t,onConfirm:n,stepToDelete:r,flowSteps:a})=>{const s=(0,i.useRef)(null),[l,c]=(0,i.useState)({}),u=(0,i.useMemo)(()=>{if(!a||!r)return[];const e=[],t=parseInt(r.step_id,10);return a.forEach(n=>{if("upsell"===n.type||"downsell"===n.type){const r=parseInt(n.offer_yes_step_id,10)===t,a=parseInt(n.offer_no_step_id,10)===t;(r||a)&&e.push({id:n.id,title:n.title,type:n.type,currentAccept:n.offer_yes_step_id,currentReject:n.offer_no_step_id,acceptPointsToDeleted:r,rejectPointsToDeleted:a,isVariation:!1,controlStepId:n.id});const o=n["ab-test-variations"];Array.isArray(o)&&o.length>0&&o.forEach(r=>{const a=parseInt(r.offer_yes_step_id,10)===t,o=parseInt(r.offer_no_step_id,10)===t;if(a||o){const t=r.title||`${n.title} - Variation`;e.push({id:r.id,title:t,type:n.type,currentAccept:r.offer_yes_step_id,currentReject:r.offer_no_step_id,acceptPointsToDeleted:a,rejectPointsToDeleted:o,isVariation:!0,controlStepId:n.id})}})}}),e},[a,r]),d=(e,t)=>{if(!a||!r)return[];const n=t||e,o=a.findIndex(e=>parseInt(e.id,10)===parseInt(n,10));if(-1===o)return[];const i=parseInt(r.step_id,10);return a.slice(o+1).filter(e=>parseInt(e.id,10)!==i&&"checkout"!==e.type)};(0,i.useEffect)(()=>{if(u.length>0){const e={};u.forEach(t=>{const n=d(t.id,t.controlStepId),r=n.length>0?n[0].id:"";e[t.id]={accept:t.acceptPointsToDeleted?r:t.currentAccept,reject:t.rejectPointsToDeleted?r:t.currentReject}}),c(e)}},[e,a,r]);const f=(e,t,n)=>{c(r=>({...r,[e]:{...r[e],[t]:n}}))};return e?(0,wn.createPortal)((0,o.createElement)(A6.Root,{show:e,as:i.Fragment},(0,o.createElement)(_7,{as:"div",className:"relative z-[99999] wcf-confirm-popup",initialFocus:s,onClose:()=>{}},(0,o.createElement)(A6.Child,{as:i.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0"},(0,o.createElement)("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"})),(0,o.createElement)("div",{className:"fixed inset-0 z-10 overflow-y-auto"},(0,o.createElement)("div",{className:"flex min-h-full items-center justify-center p-4 text-center sm:p-0"},(0,o.createElement)(A6.Child,{as:i.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,o.createElement)(_7.Panel,{className:"wcf-confirm-popup-wrapper 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,o.createElement)("div",{className:"absolute top-0 right-0 hidden pt-4 pr-4 sm:block"},(0,o.createElement)("button",{type:"button",className:"rounded-md bg-white text-gray-400 hover:text-gray-500 focus:outline-none",onClick:t},(0,o.createElement)("span",{className:"sr-only"},"Close"),(0,o.createElement)(tL,{className:"h-6 w-6","aria-hidden":"true"}))),(0,o.createElement)("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4"},(0,o.createElement)("div",{className:"sm:flex sm:items-start"},(0,o.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,o.createElement)(uh,{className:"h-6 w-6 text-red-600","aria-hidden":"true"})),(0,o.createElement)("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left"},(0,o.createElement)(_7.Title,{as:"h3",className:"text-lg font-medium leading-6 text-gray-900 capitalize"},(0,z.__)("Delete Step","cartflows")),(0,o.createElement)("div",{className:"mt-2"},(0,o.createElement)("p",{className:"text-sm text-gray-500"},(0,z.__)("Are you sure you want to delete this step?","cartflows"))))),u.length>0&&(0,o.createElement)("div",{className:"mt-4"},(0,o.createElement)("p",{className:"text-sm font-medium text-gray-700 mb-3"},(0,z.__)("The following steps have edges pointing to this step. Please select where they should redirect after deletion:","cartflows")),u.map(e=>{const t=d(e.id,e.controlStepId),n=l[e.id]||{};return(0,o.createElement)(E7,{key:e.id,sourceStep:e,availableSteps:t,acceptRedirect:n.accept||"",setAcceptRedirect:t=>f(e.id,"accept",t),rejectRedirect:n.reject||"",setRejectRedirect:t=>f(e.id,"reject",t)})}))),(0,o.createElement)("div",{className:"flex bg-gray-50 px-4 py-3 flex-col-reverse sm:flex-row gap-3 sm:justify-end sm:px-6"},(0,o.createElement)("button",{type:"button",className:"wcf-button wcf-secondary-button",onClick:t,ref:s},(0,z.__)("Cancel","cartflows")),(0,o.createElement)("button",{type:"button",className:"wcf-button wcf-primary-button",onClick:()=>{n(l)}},(0,z.__)("Delete","cartflows"))))))))),document.body):null},M7=(0,i.memo)(({data:e,isConnectable:t})=>{const n="upsell"===e.step_type?R8:U8,r="vertical"===e?.axis,a="LR"===e.direction?"target":"source",s="LR"===e.direction?"source":"target",[,l]=(0,i.useState)(!1),[c,u]=(0,i.useState)(!1),[d,f]=(0,i.useState)("cartflows_delete_step"),m=$V(),p=(0,f$.W6)(),[{license_status:h}]=g(),[{steps:w,is_flow_instant_checkout:y}]=ZR(),b=O8.createEventHandlers(e,m,p,l,{delete:e=>{e.preventDefault();const t=e.currentTarget.getAttribute("data-action")||"cartflows_delete_step";f(t),u(!0)}});return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(N5,{type:"target",position:p1.Top,id:"top",style:{background:"#555",visibility:r?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t}),"LR"===e.direction&&!r&&(0,o.createElement)(N5,{type:a,position:p1.Left,id:"left",style:{background:"#555"},className:"react-flow__handle wcf-handle-left",isConnectable:t}),"RL"===e.direction&&!r&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(N5,{type:a,position:p1.Left,className:"react-flow__handle-right-a wcf-handle-right",id:"a",style:{top:50},isConnectable:t}),(0,o.createElement)(N5,{type:a,position:p1.Left,className:"react-flow__handle-right-b wcf-handle-right",id:"b",style:{bottom:50,top:"auto"},isConnectable:t})),O8.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},n,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,b,h,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,[],y,e.is_locked),(0,o.createElement)("div",{className:"wcf-custom-node-label"},e?.label),"LR"===e.direction&&!r&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(N5,{type:s,position:p1.Right,className:"react-flow__handle-right-a wcf-handle-right",id:"a",style:{top:50},isConnectable:t}),(0,o.createElement)(N5,{type:s,position:p1.Right,className:"react-flow__handle-right-b wcf-handle-right",id:"b",style:{bottom:50,top:"auto"},isConnectable:t})),"RL"===e.direction&&!r&&(0,o.createElement)(N5,{type:s,position:p1.Right,style:{background:"#555"},className:"react-flow__handle wcf-handle-left",isConnectable:t}),r&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(N5,{type:"source",position:p1.Bottom,id:"a",style:{left:80,background:"#16A34A"},className:"react-flow__handle wcf-handle-bottom-accept",isConnectable:t}),(0,o.createElement)(N5,{type:"source",position:p1.Bottom,id:"b",style:{left:"auto",right:80,background:"#DC2626"},className:"react-flow__handle wcf-handle-bottom-reject",isConnectable:t})),(0,o.createElement)(N7,{isOpen:c,onClose:()=>u(!1),onConfirm:async t=>{u(!1),await O8.performDelete(e,d,l,t)},stepToDelete:e,flowSteps:w}))}),I7="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI1OSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iLjUiIHdpZHRoPSIxOTkiIGhlaWdodD0iMjU4IiByeD0iOS41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNFQUVBRUEiLz48cGF0aCBkPSJNMCAxMEMwIDQuNDc3IDQuNDc3IDAgMTAgMGgxODBjNS41MjMgMCAxMCA0LjQ3NyAxMCAxMHYxOC4xNDdIMFYxMFoiIGZpbGw9IiNFNkVBRUQiLz48ZWxsaXBzZSBjeD0iMTQiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGRjNCMzAiLz48ZWxsaXBzZSBjeD0iMjciIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiNGQzAiLz48ZWxsaXBzZSBjeD0iNDAiIGN5PSIxNC4wMjEiIHJ4PSI0IiByeT0iNC4wMjEiIGZpbGw9IiM0Q0Q5NjQiLz48cmVjdCB4PSI2NCIgeT0iMTEiIHdpZHRoPSIxMDciIGhlaWdodD0iNyIgcng9IjEiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNMTI2LjU4MyA3OS4wMDhWODEuNWEyNy4wOCAyNy4wOCAwIDAgMS0xOS40MDQgMjUuOTU2IDI3LjA4MyAyNy4wODMgMCAxIDEgMy4zNDQtNTAuNzEiIHN0cm9rZT0iIzIyNzFCMSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz48cGF0aCBkPSJNMTI2LjU4MyA1OS44MzMgOTkuNSA4Ni45NDNsLTguMTI1LTguMTI0IiBzdHJva2U9IiMyMjcxQjEiIHN0cm9rZS13aWR0aD0iMiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+PHJlY3QgeD0iODMiIHk9IjE0MyIgd2lkdGg9IjM1IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iNzgiIHk9IjEyOSIgd2lkdGg9IjQ1IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjMjI3MUIxIi8+PHJlY3QgeD0iMjMiIHk9IjE1NyIgd2lkdGg9IjE1NCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0U2RUFFRCIvPjxyZWN0IHg9IjIzIiB5PSIxNzEiIHdpZHRoPSIxNTQiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSIyMyIgeT0iMTg1IiB3aWR0aD0iMTU0IiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iMjMiIHk9IjE5OSIgd2lkdGg9IjkyLjQiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSI3MiIgeT0iMjIzIiB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIxIiBmaWxsPSIjRUFFQUVBIi8+PHJlY3QgeD0iOTQiIHk9IjIyMyIgd2lkdGg9IjEyIiBoZWlnaHQ9IjEyIiByeD0iMSIgZmlsbD0iI0VBRUFFQSIvPjxyZWN0IHg9IjExNiIgeT0iMjIzIiB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIHJ4PSIxIiBmaWxsPSIjRUFFQUVBIi8+PC9zdmc+",S7=(0,i.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,a=r?"target":"source",s=r?"source":"target",[,l]=(0,i.useState)(!1),c=$V(),u=(0,f$.W6)(),[{license_status:d}]=g(),[{is_flow_instant_checkout:f}]=ZR(),m=O8.createEventHandlers(e,c,u,l);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(N5,{type:"target",position:p1.Top,id:"top",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t}),(0,o.createElement)(N5,{type:a,position:p1.Left,id:"left",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-left",isConnectable:t&&!n}),O8.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},I7,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,m,d,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,[],f,e.is_locked),(0,o.createElement)(N5,{type:s,position:p1.Right,id:"right",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-right",isConnectable:t&&!n}),(0,o.createElement)(N5,{type:"source",position:p1.Bottom,id:"bottom",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-bottom",isConnectable:t&&n}),(0,o.createElement)("div",{className:"wcf-custom-node-label"},e?.label))}),k7="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjI2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cmVjdCB4PSIuNSIgeT0iMSIgd2lkdGg9IjE5OSIgaGVpZ2h0PSIyNTgiIHJ4PSI5LjUiIGZpbGw9IiNmZmYiIHN0cm9rZT0iI0VBRUFFQSIvPjxwYXRoIGQ9Ik0wIDEwLjVDMCA0Ljk3NyA0LjQ3Ny41IDEwIC41aDE4MGM1LjUyMyAwIDEwIDQuNDc3IDEwIDEwdjE4SDB2LTE4WiIgZmlsbD0iI0U2RUFFRCIvPjxjaXJjbGUgY3g9IjE0IiBjeT0iMTQuNSIgcj0iNCIgZmlsbD0iI0ZGM0IzMCIvPjxjaXJjbGUgY3g9IjI3IiBjeT0iMTQuNSIgcj0iNCIgZmlsbD0iI0ZDMCIvPjxjaXJjbGUgY3g9IjQwIiBjeT0iMTQuNSIgcj0iNCIgZmlsbD0iIzRDRDk2NCIvPjxyZWN0IHg9IjY0IiB5PSIxMC41IiB3aWR0aD0iMTA3IiBoZWlnaHQ9IjciIHJ4PSIxIiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbD0iI0Y2RkFGRiIgZD0iTTExMyA0OWg2NHY5MmgtNjR6Ii8+PHJlY3QgeD0iMTI1IiB5PSI2NCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTEyMC41IDc5YS41LjUgMCAwIDEgLjUtLjVoNDhhLjUuNSAwIDAgMSAuNS41djRhLjUuNSAwIDAgMS0uNS41aC00OGEuNS41IDAgMCAxLS41LS41di00Wk0xMjAuNSA5MGEuNS41IDAgMCAxIC41LS41aDQ4YS41LjUgMCAwIDEgLjUuNXY0YS41LjUgMCAwIDEtLjUuNWgtNDhhLjUuNSAwIDAgMS0uNS0uNXYtNFoiIGZpbGw9IiNmZmYiIHN0cm9rZT0iI0I3Q0ZFMiIvPjxyZWN0IHg9IjEyMC41IiB5PSIxMDMuNSIgd2lkdGg9IjQiIGhlaWdodD0iNCIgcng9Ii41IiBmaWxsPSIjZmZmIiBzdHJva2U9IiNDQ0RFRUQiLz48cmVjdCB4PSIxMzAiIHk9IjEwNCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjMiIHJ4PSIxIiBmaWxsPSIjQ0NERUVEIi8+PHJlY3QgeD0iMTIwIiB5PSIxMTgiIHdpZHRoPSI1MCIgaGVpZ2h0PSI3IiByeD0iMiIgZmlsbD0iIzIyNzFCMSIvPjxyZWN0IHg9IjIzIiB5PSI2MCIgd2lkdGg9IjgwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHBhdGggZmlsbD0iI2ZmZiIgc3Ryb2tlPSIjRTZFQUVEIiBzdHJva2Utd2lkdGg9IjEuNSIgZD0iTTIzLjc1IDc0Ljc1aDc4LjV2NDMuNWgtNzguNXoiLz48cGF0aCBkPSJNNjMgODguMjVhOC43NSA4Ljc1IDAgMSAwIC4wMDEgMTcuNTAxQTguNzUgOC43NSAwIDAgMCA2MyA4OC4yNVptMCAxNi4wMTZhNy4yNjcgNy4yNjcgMCAwIDEgMC0xNC41MzIgNy4yNjcgNy4yNjcgMCAwIDEgMCAxNC41MzJaIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0ibTY3LjA1IDk2Ljc0OC01Ljc4Mi00LjJhLjMxLjMxIDAgMCAwLS40OTUuMjUzdjguMzk4YzAgLjI1Ni4yOS40MDEuNDk1LjI1Mmw1Ljc4My00LjE5OWEuMzEyLjMxMiAwIDAgMCAuMDk1LS4zOTMuMzEyLjMxMiAwIDAgMC0uMDk1LS4xMTFabS01LjAzIDIuNjE3di00LjczTDY1LjI3NSA5N2wtMy4yNTYgMi4zNjVaIiBmaWxsPSIjMjI3MUIxIi8+PHJlY3QgeD0iNTAiIHk9IjE1NiIgd2lkdGg9IjEwMCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0U2RUFFRCIvPjxjaXJjbGUgY3g9IjI1IiBjeT0iMTc1IiByPSIyIiBmaWxsPSIjMjI3MUIxIi8+PGNpcmNsZSBjeD0iMjUiIGN5PSIxODkiIHI9IjIiIGZpbGw9IiMyMjcxQjEiLz48Y2lyY2xlIGN4PSIyNSIgY3k9IjIwMyIgcj0iMiIgZmlsbD0iIzIyNzFCMSIvPjxyZWN0IHg9IjM1IiB5PSIxNzMiIHdpZHRoPSIxNDIiIGhlaWdodD0iNCIgcng9IjEiIGZpbGw9IiNFNkVBRUQiLz48cmVjdCB4PSIzNSIgeT0iMTg3IiB3aWR0aD0iMTAwIiBoZWlnaHQ9IjQiIHJ4PSIxIiBmaWxsPSIjRTZFQUVEIi8+PHJlY3QgeD0iMzUiIHk9IjIwMSIgd2lkdGg9IjEyMCIgaGVpZ2h0PSI0IiByeD0iMSIgZmlsbD0iI0U2RUFFRCIvPjxyZWN0IHg9IjIzIiB5PSIyMTkiIHdpZHRoPSIxNTQiIGhlaWdodD0iMjAiIHJ4PSIyIiBmaWxsPSIjMjI3MUIxIi8+PHBhdGggZD0iTTk0LjQ0MiAyMjkuMjI3YzAtMi4xNDEtMS4zMy0zLjM2Mi0zLjA2NS0zLjM2Mi0xLjc0NSAwLTMuMDY1IDEuMjIxLTMuMDY1IDMuMzYyIDAgMi4xMzIgMS4zMiAzLjM2MiAzLjA2NSAzLjM2MiAxLjczNSAwIDMuMDY1LTEuMjIgMy4wNjUtMy4zNjJabS0xLjQwMyAwYzAgMS4zODctLjY1OSAyLjEzOC0xLjY2MiAyLjEzOC0xLjAwNyAwLTEuNjYyLS43NTEtMS42NjItMi4xMzhzLjY1NS0yLjEzOCAxLjY2Mi0yLjEzOGMxLjAwMyAwIDEuNjYyLjc1MSAxLjY2MiAyLjEzOFptMi40MDIgNS4xMTRoMS4zNjJ2LTIuNjI3aC4wNDFjLjE4OS40MDkuNjAxLjg2NiAxLjM5NC44NjYgMS4xMTggMCAxLjk5MS0uODg1IDEuOTkxLTIuNTI4IDAtMS42ODgtLjkxMS0yLjUyNS0xLjk4OC0yLjUyNS0uODIxIDAtMS4yMTUuNDg5LTEuMzk3Ljg4OGgtLjA2di0uODI0SDk1LjQ0djYuNzVabTEuMzMzLTQuMjk2YzAtLjg3NS4zNy0xLjQzNSAxLjAzMi0xLjQzNS42NzUgMCAxLjAzMy41ODUgMS4wMzMgMS40MzUgMCAuODU3LS4zNjUgMS40NTEtMS4wMzMgMS40NTEtLjY1NSAwLTEuMDMyLS41NzUtMS4wMzItMS40NTFabTYuOTc0LTIuNDU0aC0uOTI0di0xLjE3NmgtMS4zNjF2MS4xNzZoLS42NzJ2MS4wMjNoLjY3MnYyLjU1NmMtLjAwNy45NjIuNjQ4IDEuNDM5IDEuNjM2IDEuMzk3LjM1Mi0uMDEzLjYwMS0uMDgzLjczOC0uMTI4bC0uMjE0LTEuMDEzYy0uMDY3LjAxMy0uMjExLjA0NS0uMzM5LjA0NS0uMjcxIDAtLjQ2LS4xMDItLjQ2LS40OHYtMi4zNzdoLjkyNHYtMS4wMjNabS44ODcgNC45MDloMS4zNjF2LTQuOTA5aC0xLjM2MXY0LjkwOVptLjY4NC01LjU0MmMuNDA1IDAgLjczOC0uMzEuNzM4LS42OSAwLS4zNzctLjMzMy0uNjg3LS43MzgtLjY4Ny0uNDAzIDAtLjczNi4zMS0uNzM2LjY4NyAwIC4zOC4zMzMuNjkuNzM2LjY5Wm0zLjEyOSAyLjcwNGMuMDAzLS42MzMuMzgxLTEuMDA0LjkzLTEuMDA0LjU0NyAwIC44NzYuMzU4Ljg3My45NTl2Mi44ODNoMS4zNjF2LTMuMTI2YzAtMS4xNDQtLjY3MS0xLjg0Ny0xLjY5NC0xLjg0Ny0uNzI4IDAtMS4yNTYuMzU4LTEuNDc2LjkzaC0uMDU4di0uODY2aC0xLjI5N3Y0LjkwOWgxLjM2MXYtMi44MzhaIiBmaWxsPSIjZmZmIi8+PC9zdmc+",j7=(0,i.memo)(({data:e,isConnectable:t})=>{const n="vertical"===e?.axis,r="LR"===e?.direction,a=r?"target":"source",s=r?"source":"target",[,l]=(0,i.useState)(!1),c=$V(),u=(0,f$.W6)(),[{license_status:d}]=g(),f=O8.createEventHandlers(e,c,u,l);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(N5,{type:"target",position:p1.Top,id:"top",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t}),(0,o.createElement)(N5,{type:a,position:p1.Left,id:"left",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-left",isConnectable:t&&!n}),O8.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type},k7,e.viewPageLink,e.editPage,e.menu_actions,e.ab_test_variations,f,d,e.analytics,e.isInvalidPosition,e.is_product_assigned,e.step_disabled,e.warnings,e.compact,void 0,void 0,e.is_locked),(0,o.createElement)("div",{className:"wcf-custom-node-label"},e?.label),(0,o.createElement)(N5,{type:s,position:p1.Right,id:"right",style:{visibility:n?"hidden":"visible"},className:"react-flow__handle wcf-handle-right",isConnectable:t&&!n}),(0,o.createElement)(N5,{type:"source",position:p1.Bottom,id:"bottom",style:{visibility:n?"visible":"hidden"},className:"react-flow__handle wcf-handle-bottom",isConnectable:t&&n}))}),D7={createEventHandlers:(e,t,n,r)=>({clone:async function(n){if(n.preventDefault(),!wcfCartflowsPro())return null;const a=n.currentTarget.getAttribute("data-action");if(await t({title:(0,z.__)("Duplicate Variation","cartflows"),description:(0,z.__)("Do you want to duplicate this variation? Are you sure?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})){r(!0);const t=cartflows_admin.wcf_clone_ab_test_step_nonce,n=new window.FormData;n.append("action",a),n.append("security",t),n.append("step_id",e?.step_id),n.append("post_id",e?.flow_id),n.append("control_id",e?.control_id),window.wcfAction="cloneABTestStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{window.location.reload()}).catch(e=>{console.error("Clone Step failed:",e),r(!1)}))}},delete:async function(n){n.preventDefault();const a=n.currentTarget.getAttribute("data-action");if(await t({title:(0,z.__)("Delete Variation","cartflows"),description:(0,z.__)("Do you want to delete this variation? Are you sure?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})){r(!0);const t=cartflows_admin.wcf_delete_ab_test_step_nonce,n=new window.FormData;n.append("action",a),n.append("security",t),n.append("step_id",e?.step_id),n.append("post_id",e?.flow_id),n.append("control_id",e?.control_id),window.wcfAction="deleteABTestStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{window.location.reload()}).catch(e=>{console.error("Delete step failed:",e),r(!1)}))}},winner:async function(n){if(n.preventDefault(),await t({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.__)("Declare Winner","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")})){r(!0);const t=new window.FormData;t.append("action","cartflows_declare_ab_test_winner"),t.append("security",cartflows_admin.wcf_declare_ab_test_winner_nonce),t.append("step_id",e?.step_id),t.append("flow_id",e?.flow_id),window.wcfAction="winnerStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{pp.success((0,z.__)("Winner declared successfully!","cartflows")),window.location.reload()}).catch(e=>{console.error("Declare AB Test Winner failed:",e),pp.error((0,z.__)("Failed to declare winner. Please try again.","cartflows")),r(!1)}))}},archived:async function(n){if(n.preventDefault(),await t({title:(0,z.__)("Archive Variation","cartflows"),description:(0,z.__)("Do you want to archive this variation? Are you sure?","cartflows"),actionBtnText:(0,z.__)("Yes","cartflows"),cancelBtnText:(0,z.__)("No","cartflows")})){r(!0);const t=new window.FormData;t.append("action","cartflows_archive_ab_test_step"),t.append("security",cartflows_admin.wcf_archive_ab_test_step_nonce),t.append("step_id",e?.step_id),t.append("post_id",e?.flow_id),window.wcfAction="archiveStep",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:t}).then(()=>{window.location.reload()}).catch(e=>{console.error("Archiving step failed:",e),r(!1)}))}}}),nodeHtml(e,t,n,r,a,i,s,l,c,u,d,f,m,p,h,g,w,y=!1,b=""){const v=jh(e?.step_type,b),x=e?.step_type||"",_=kh(e?.step_title||"");return(0,o.createElement)("div",{className:"wcf-custom-node-wrapper wcf-ab-test-variation"+(y?" wcf-custom-node-wrapper--compact":"")},(0,o.createElement)("div",{className:"wcf-custom-node-design"},(0,o.createElement)("div",{className:"wcf-node-actions absolute flex bg-white left-11 -top-16 rounded-md py-0.5 px-1.5 sm:hidden lg:hidden"},(0,o.createElement)(Ja,{content:(0,z.__)("View Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)("a",{href:n,target:"_blank",rel:"noreferrer","aria-label":(0,z.__)("View Page","cartflows"),className:"wcf-canvas--view-step text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,o.createElement)(I8,{className:"w-5 h-5"}))),(0,o.createElement)(Ja,{content:v?Dh():(0,z.__)("Edit Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)("a",{href:v?"#!":r,target:v?void 0:"_blank",rel:"noreferrer","aria-label":(0,z.__)("Edit Page","cartflows"),"aria-disabled":v,tabIndex:v?-1:0,className:"wcf-canvas--edit-step p-2 block "+(v?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer")},(0,o.createElement)(S8,{className:"w-5 h-5"}))),(0,o.createElement)(Ja,{content:(0,z.__)("Edit Settings","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)(C,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`},rel:"noreferrer","aria-label":(0,z.__)("Edit Settings","cartflows"),className:"wcf-canvas--edit-settings relative text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,o.createElement)(k8,{className:"w-5 h-5"})))),(0,o.createElement)("div",{className:"wcf-custom-node-content bg-white border border-gray-200 rounded-lg shadow-md"+(m?" opacity-50":"")},(0,o.createElement)("div",{className:"wcf-custom-node-content--header flex flex-col gap-3 border-b border-gray-200 py-4 px-5"},(0,o.createElement)("div",{className:"wcf-node-step--info-wrapper flex flex-row items-center gap-4 w-full"},(0,o.createElement)("div",{className:"wcf-node-step--icon bg-primary-25 p-2.5 rounded border border-primary-300"},(e=>{let t="";const n="w-5 h-5 stroke-2 text-primary-500";switch(e){case"landing":t=(0,o.createElement)(WV,{className:n});break;case"optin":t=(0,o.createElement)(g8,{className:n});break;case"checkout":t=(0,o.createElement)(mZ,{className:n});break;case"upsell":t=(0,o.createElement)(Lm,{className:n});break;case"downsell":t=(0,o.createElement)(y8,{className:n});break;case"thankyou":t=(0,o.createElement)(v8,{className:n});break;default:t=(0,o.createElement)(vV,{className:n})}return t})(x)),(0,o.createElement)("div",{className:"w-full flex flex-col gap-1"},(0,o.createElement)("div",{className:"wcf-node-step--type flex items-center gap-2"},(0,o.createElement)("span",{className:"text-xs font-normal text-gray-400 capitalize"},x),function(){let t="";return t=e.control_id===e.step_id?(0,o.createElement)("span",{className:"wcf-step-badge bg-primary-500 text-white text-xs px-2.5 py-1 rounded-full"},(0,z.__)("Control","cartflows")):(0,o.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 */ |
| 87 |
(0,z.__)("Variation-%d","cartflows"),u)),t}(),f&&(0,o.createElement)("span",{className:"wcf-flow-badge wcf-badge wcf-badge--error !text-[10px] !px-2 !py-px wcf-invalid-sequence-badge"},(0,o.createElement)(dW,{className:"w-3.5 h-3.5 stroke-2","aria-hidden":"true"}),(0,z.__)("Invalid Position","cartflows"))),(0,o.createElement)("div",{className:"wcf-node-step--title text-left"},(0,o.createElement)("span",{className:"font-semibold text-sm text-gray-800 hover:text-gray-800"},_)))),function(){let e=null;return d||(e=(0,o.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-no-product-badge"},(0,z.__)("No Product Assigned","cartflows"))),e}(),m&&(0,o.createElement)("span",{className:"wcf-badge wcf-badge--error !flex !justify-center !rounded-sm !text-xs !text-center !py-2 wcf-disabled-step-badge"},(0,z.__)("Disabled","cartflows"))),(0,o.createElement)("div",{className:"wcf-custom-node-content--stats flex text-center justify-around items-center py-4 px-5"},(0,o.createElement)("div",{className:"wcf-step--stats-content--stat-view"},(0,o.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,z.__)("Views","cartflows")),(0,o.createElement)("div",{className:"font-semibold text-base text-gray-800"},(()=>{let e=0;return l&&l.total_visits&&(e=l.total_visits||0),e})())),(0,o.createElement)("div",{className:"wcf-step--stats-content--stat-conversation"},(0,o.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,z.__)("Conversions","cartflows")),(0,o.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==x?(()=>{let e=0;return l&&l?.conversions&&(e=l.conversions||0),e})():"-")),(0,o.createElement)("div",{className:"wcf-step--stats-content--stat-revenue"},(0,o.createElement)("div",{className:"text-sm text-gray-400 capitalize"},(0,z.__)("Revenue","cartflows")),(0,o.createElement)("div",{className:"font-semibold text-base text-gray-800"},"thankyou"!==x&&"landing"!==x?l&&l?.visits?.revenue?fh(l.visits.revenue):0:"-"))),(0,o.createElement)("div",{className:"wcf-custom-node-content--footer flex text-center justify-around items-center border-t border-gray-200 py-4 px-5"},(0,o.createElement)(Ja,{content:(0,z.__)("View Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)("a",{href:n,target:"_blank",rel:"noreferrer","aria-label":(0,z.__)("View Page","cartflows"),className:"wcf-canvas--view-step text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,o.createElement)(I8,{className:"w-5 h-5"}))),(0,o.createElement)(Ja,{content:v?Dh():(0,z.__)("Edit Page","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)("a",{href:v?"#!":r,target:v?void 0:"_blank",rel:"noreferrer","aria-label":(0,z.__)("Edit Page","cartflows"),"aria-disabled":v,tabIndex:v?-1:0,className:"wcf-canvas--edit-step p-2 block "+(v?"disabled text-text-disabled cursor-not-allowed":"text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer")},(0,o.createElement)(S8,{className:"w-5 h-5"}))),(0,o.createElement)(Ja,{content:(0,z.__)("Edit Settings","cartflows"),placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)(C,{to:{pathname:"admin.php",search:"storeCheckout"===e?.flow_type?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e?.flow_id}&step_id=${e?.step_id}`},rel:"noreferrer","aria-label":(0,z.__)("Edit Settings","cartflows"),className:"wcf-canvas--edit-settings relative text-text-tertiary hover:bg-badge-hover-gray hover:text-text-primary cursor-pointer p-2 block"},(0,o.createElement)(k8,{className:"w-5 h-5"}))),(a?Object.keys(a):[]).map(t=>{const n=a[t],r=n?.class;let l=!1,c=!1;!wcfCartflowsPro()&&n?.pro&&(l=!0),wcfCartflowsPro()&&n?.pro&&"Activated"!==s&&(c=!0);let u="";u=l||c?"wcf-pro text-text-disabled cursor-not-allowed":"text-text-tertiary";let d=n?.text;return l?d=(0,z.sprintf)( |
| 88 |
// translators: %s: action name (e.g. Clone, A/B Test). |
| 89 |
// translators: %s: action name (e.g. Clone, A/B Test). |
| 90 |
(0,z.__)("Upgrade to CartFlows Pro to use %s.","cartflows"),n?.text):c&&(d=(0,z.sprintf)( |
| 91 |
// translators: %s: action name (e.g. Clone, A/B Test). |
| 92 |
// translators: %s: action name (e.g. Clone, A/B Test). |
| 93 |
(0,z.__)("Activate your CartFlows license to use %s.","cartflows"),n?.text)),(0,o.createElement)(Ja,{key:n?.slug,content:d,placement:"top",boundary:"viewport",arrow:!0},(0,o.createElement)("a",{href:n?.link,className:`wcf-step__action-btn relative ${r} ${u} p-2 text-sm flex gap-1.5 ${"delete"===n?.slug?"hover:bg-field-background-error hover:text-button-danger":"hover:bg-badge-hover-gray hover:text-text-primary"}`,"aria-label":n?.text,"data-id":e?.step_id,"data-control-id":e?.control_id,onClick:e=>{l||c?e.preventDefault():"#"===n?.link&&i&&i[n?.slug]&&(e.preventDefault(),i[n?.slug](e))},"data-action":n?.ajaxcall},(0,o.createElement)("div",{className:"flex items-center gap-1.5"},function(e){let t="";switch(e){case"clone":t=(0,o.createElement)(zZ,{className:"h-5 w-5"});break;case"delete":t=(0,o.createElement)(Qa,{className:"h-5 w-5"});break;case"archived":t=(0,o.createElement)(_8,{className:"h-5 w-5"});break;case"winner":t=(0,o.createElement)(E8,{className:"h-5 w-5"});break;default:t=(0,o.createElement)(M8,{className:"h-5 w-5"})}return t}(n?.slug),(l||c)&&(0,o.createElement)(d$,{className:"absolute -top-1 -right-1 w-4 h-4 text-brand-600 fill-brand-600","aria-label":(0,z.__)("Pro feature","cartflows")}))))})))))}},C7=D7,A7=(0,i.memo)(({data:e,isConnectable:t})=>{let n=p8;switch(e.step_type){case"landing":default:n=p8;break;case"checkout":n=z8;break;case"upsell":n=R8;break;case"downsell":n=U8;break;case"optin":n=k7;break;case"thankyou":n=I7}const r="upsell"===e.step_type||"downsell"===e.step_type,a="vertical"===e?.axis,s="LR"===e.direction?"target":"source",l="LR"===e.direction?"source":"target",[,c]=(0,i.useState)(!1),u=$V(),d=(0,f$.W6)(),[{license_status:f}]=g(),[{is_flow_instant_checkout:m}]=ZR(),p=C7.createEventHandlers(e,u,d,c);return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(N5,{type:"target",position:p1.Top,id:"top",style:{visibility:a?"visible":"hidden"},className:"react-flow__handle wcf-handle-top",isConnectable:t}),r&&"RL"===e.direction?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(N5,{type:s,position:p1.Left,className:"react-flow__handle-left-a wcf-handle-left",id:"a",style:{top:50},isConnectable:t}),(0,o.createElement)(N5,{type:s,position:p1.Left,className:"react-flow__handle-left-b wcf-handle-left",id:"b",style:{bottom:50,top:"auto"},isConnectable:t})):(0,o.createElement)(N5,{type:s,position:p1.Left,id:"left",style:{background:"#555"},className:"react-flow__handle wcf-handle-left",isConnectable:t}),C7.nodeHtml({step_title:e?.label,step_id:e?.step_id,step_type:e?.step_type,flow_id:e?.flow_id,flow_type:e?.flow_type,control_id:e?.control_id},n,e.viewPageLink,e.editPage,e.menu_actions,p,f,e.analytics,e.traffic,e.var_badge_count,e.is_product_assigned,e.isInvalidPosition,e?.step_disabled,e?.offer_no_next_step,e?.offer_no_step_id,e?.offer_yes_next_step,e?.offer_yes_step_id,e?.compact,m),(0,o.createElement)("div",{className:"wcf-custom-node-label"},e.label),r&&"LR"===e.direction?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(N5,{type:l,position:p1.Right,className:"react-flow__handle-right-a wcf-handle-right",id:"a",style:{top:50},isConnectable:t}),(0,o.createElement)(N5,{type:l,position:p1.Right,className:"react-flow__handle-right-b wcf-handle-right",id:"b",style:{bottom:50,top:"auto"},isConnectable:t})):(0,o.createElement)(N5,{type:l,position:p1.Right,className:"react-flow__handle wcf-handle-right",id:"right",isConnectable:t}))}),T7=Ua("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),O7=(0,i.forwardRef)(({variant:e="primary",size:t="md",border:n="subtle",src:r,alt:a,children:o,className:s,...l},c)=>{const[u,d]=(0,i.useState)(!1),f={white:"text-text-primary bg-background-primary",gray:"text-text-primary bg-background-secondary",primary:"text-text-on-color bg-background-brand","primary-light":"text-text-primary bg-brand-background-50",dark:"text-text-on-color bg-button-secondary"}[e],m={xxs:"size-5 [&>svg]:size-3 text-xs",xs:"size-6 [&>svg]:size-4 text-sm",sm:"size-8 [&>svg]:size-5 text-base",md:"size-10 [&>svg]:size-6 text-lg",lg:"size-12 [&>svg]:size-12 text-lg"}[t],p={none:"",subtle:"ring-1 ring-border-transparent-subtle",ring:"ring ring-border-subtle"}[r&&"none"===n?"subtle":n],h=r?"object-cover object-center":"",g=!r||u,w=g?"div":"img";return(0,i.useEffect)(()=>{d(!1)},[r]),(0,P.jsx)(w,{ref:c,className:Oe("rounded-full overflow-hidden flex items-center justify-center",g&&f,m,p,h,s),...g?{children:(()=>{if(r&&u){if(a&&"string"==typeof a)return a?.[0]?.toUpperCase();if(o&&"string"==typeof o)return o?.[0]?.toUpperCase();if(!o&&!a)return(0,P.jsx)(T7,{})}return o?"string"==typeof o?o?.[0]?.toUpperCase():o:null})()}:{src:r,alt:a,onError:()=>{d(!0)}},...l})}),L7=Ua("ShoppingCart",[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]]),z7=Ua("CircleArrowDown",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 8v8",key:"napkw2"}],["path",{d:"m8 12 4 4 4-4",key:"k98ssh"}]]),P7=Ua("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]),R7=Ua("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]),U7=Ua("Undo2",[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]),B7=Ua("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),F7=({action:e,nonce:t,stepId:n,flowId:r,controlId:a})=>{const o=new window.FormData;return o.append("action",e),o.append("security",t),o.append("step_id",n),o.append("flow_id",r),o.append("control_id",a),o},Y7=async({confirm:e,title:t,description:n,actionText:r,payload:a,successText:o,errorText:i})=>!!await e({title:t,description:n,actionBtnText:r,cancelBtnText:(0,z.__)("Cancel","cartflows")})&&(e=>L()({url:cartflows_admin.ajax_url,method:"POST",body:e}))(a).then(()=>{pp.success(o),window.location.reload()}).catch(()=>{pp.error(i)}),Q7={restore:({confirm:e,stepId:t,flowId:n,controlId:r})=>Y7({confirm:e,title:(0,z.__)("Restore Archived Variation","cartflows"),description:(0,z.__)("Do you want to restore this archived variation? Are you sure?","cartflows"),actionText:(0,z.__)("Restore","cartflows"),payload:F7({action:"cartflows_restore_archive_ab_test_variation",nonce:cartflows_admin.wcf_restore_archive_ab_test_variation_nonce,stepId:t,flowId:n,controlId:r}),successText:(0,z.__)("Variation restored.","cartflows"),errorText:(0,z.__)("Failed to restore variation. Please try again.","cartflows")}),delete:({confirm:e,stepId:t,flowId:n,controlId:r})=>Y7({confirm:e,title:(0,z.__)("Trash Archived Variation","cartflows"),description:(0,z.__)("This action will trash this archived variation and its analytics data permanently. Do you want to delete this archived variation?","cartflows"),actionText:(0,z.__)("Trash","cartflows"),payload:F7({action:"cartflows_delete_archive_ab_test_variation",nonce:cartflows_admin.wcf_delete_archive_ab_test_variation_nonce,stepId:t,flowId:n,controlId:r}),successText:(0,z.__)("Variation moved to trash.","cartflows"),errorText:(0,z.__)("Failed to delete variation. Please try again.","cartflows")}),hide:({confirm:e,stepId:t})=>Y7({confirm:e,title:(0,z.__)("Hide Archived Variation","cartflows"),description:(0,z.__)("This action will hide this archived variation from the list of steps, but its analytics will be visible. Do you want to hide this archived variation?","cartflows"),actionText:(0,z.__)("Hide","cartflows"),payload:(()=>{const e=new window.FormData;return e.append("action","cartflows_hide_archive_ab_test_variation"),e.append("security",cartflows_admin.hide_archive_ab_test_variation_nonce),e.append("step_id",t),e})(),successText:(0,z.__)("Variation hidden.","cartflows"),errorText:(0,z.__)("Failed to hide variation. Please try again.","cartflows")}),deleteArch:({confirm:e,stepId:t,flowId:n,controlId:r})=>Y7({confirm:e,title:(0,z.__)("Trash Archived Variation","cartflows"),description:(0,z.__)("This action will delete this archived variation and its analytics data permanently. Do you want to delete this archived variation?","cartflows"),actionText:(0,z.__)("Delete","cartflows"),payload:F7({action:"cartflows_permanent_delete_archive_ab_test_variation",nonce:cartflows_admin.permanent_delete_archive_ab_test_variation_nonce,stepId:t,flowId:n,controlId:r}),successText:(0,z.__)("Variation permanently deleted.","cartflows"),errorText:(0,z.__)("Failed to delete variation. Please try again.","cartflows")})},V7=({open:e,setOpen:t,variations:n,type:r,flowId:a,controlId:i})=>{const s=$V(),l=n.filter(e=>"1"!==e.hide),c=l.filter(e=>e.deleted).length;return(0,o.createElement)($m,{open:e,setOpen:t,design:"footer-divided",exitOnClickOutside:!1,exitOnEsc:!1,className:"!z-[999998]"},(0,o.createElement)($m.Portal,null,(0,o.createElement)($m.Backdrop,null),(0,o.createElement)($m.Panel,{className:"w-[640px] max-w-[92vw]"},(0,o.createElement)($m.Header,{className:"flex items-start justify-between"},(0,o.createElement)("div",{className:"space-y-1"},(0,o.createElement)($m.Title,null,(0,z.__)("Archived Variations","cartflows")),(0,o.createElement)($m.Description,null,(0,z.__)("Restore a variation back into the test, or delete it permanently.","cartflows"))),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)($m.Body,null,(0,o.createElement)(Gp,{containerType:"flex",direction:"column",gap:"xs"},l.map(e=>(0,o.createElement)(Gp,{key:e.id,containerType:"flex",direction:"row",align:"center",justify:"between",gap:"md",className:"py-3 border-0 border-t border-solid border-border-subtle first:border-t-0"},(0,o.createElement)(Gp,{containerType:"flex",direction:"row",align:"center",gap:"sm"},(0,o.createElement)(O7,{variant:"primary-light",size:"sm",className:"!rounded-md !text-brand-500 ring-1 ring-brand-200 !p-1"},(e=>({landing:(0,o.createElement)(LZ,{className:"w-5 h-5"}),checkout:(0,o.createElement)(L7,{className:"w-5 h-5"}),upsell:(0,o.createElement)(M8,{className:"w-5 h-5"}),downsell:(0,o.createElement)(z7,{className:"w-5 h-5"}),thankyou:(0,o.createElement)(P7,{className:"w-5 h-5"}),optin:(0,o.createElement)(R7,{className:"w-5 h-5"})}[e]||(0,o.createElement)(LZ,{className:"w-5 h-5"})))(r)),(0,o.createElement)(Gp,{containerType:"flex",direction:"column",className:"!gap-1"},(0,o.createElement)(Gp,{containerType:"flex",direction:"row",align:"center",gap:"xs"},(0,o.createElement)(th,{size:12,weight:400,color:"tertiary",className:"capitalize"},"thankyou"===r?(0,z.__)("Thank You","cartflows"):r),(0,o.createElement)(Yf,{size:"xs",type:"pill",variant:e.deleted?"red":"inverse",className:"!font-normal text-[0.5rem]",label:(e.deleted?(0,z.__)("Deleted On: ","cartflows"):(0,z.__)("Archived On: ","cartflows"))+e.date})),(0,o.createElement)(th,{size:14,weight:400,color:"primary"},e.title))),(0,o.createElement)(Gp,{containerType:"flex",direction:"row",gap:"xs"},Object.values(e.actions||{}).map(t=>{const n="delete"===t.slug||"deleteArch"===t.slug?"text-text-secondary hover:bg-field-background-error hover:text-button-danger":"text-text-secondary hover:bg-badge-hover-gray hover:text-text-primary";return(0,o.createElement)(Va,{key:t.slug,variant:"ghost",size:"xs",icon:(r=t.slug,{restore:(0,o.createElement)(U7,{className:"w-4 h-4"}),delete:(0,o.createElement)(Qa,{className:"w-4 h-4"}),hide:(0,o.createElement)(B7,{className:"w-4 h-4"}),deleteArch:(0,o.createElement)(Qa,{className:"w-4 h-4"})}[r]),iconPosition:"left",onClick:()=>((e,t)=>{const n=Q7[e];n&&n({confirm:s,stepId:t.id,flowId:a,controlId:i})})(t.slug,e),className:`${n} !rounded-md`},t.text);var r})))))),(0,o.createElement)($m.Footer,{className:"justify-between items-center border-0 border-t border-solid border-border-subtle"},(0,o.createElement)(th,{size:12,color:"tertiary"},l.length," ",(0,z.__)("archived","cartflows"),c>0&&` · ${c} ${(0,z.__)("deleted","cartflows")}`),(0,o.createElement)(Va,{variant:"outline",size:"sm",onClick:()=>t(!1)},(0,z.__)("Close","cartflows"))))))},W7=({variations:e=[],type:t,flowId:n,controlId:r})=>{const a=e.filter(e=>"1"!==e.hide).length,[s,l]=(0,i.useState)(!1);return 0===a?null:(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(_8,{className:"w-3.5 h-3.5"}),iconPosition:"left",onClick:()=>l(!0),className:"bg-background-primary border border-solid border-border-subtle shadow-sm rounded-full"},(0,o.createElement)("span",{className:"inline-flex items-center gap-1"},(0,z.__)("Archived","cartflows"),(0,o.createElement)(Yf,{size:"xxs",type:"rounded",variant:"inverse",label:String(a),className:"inline-flex"}))),(0,o.createElement)(V7,{open:s,setOpen:l,variations:e,type:t,flowId:n,controlId:r}))},Z7=(0,i.memo)(({data:e,isConnectable:t})=>{const{step:n,flow_id:r,isDynamicOfferGroup:a,isOfferABTestGroup:i}=e;if(a)return(0,o.createElement)("div",{className:"dynamic-offer-group-container",style:{width:"100%",height:"100%",position:"relative"}});if(i){if(!n)return null;const e=n["ab-test-variations"]||[],t=n["ab-test-start"]||!1;return(0,o.createElement)("div",{className:"offer-ab-test-group-container"},(0,o.createElement)("div",{className:"ab-test-group-header absolute w-3/4 mx-auto top-[-30px] left-0 right-0 z-10"},(0,o.createElement)(g$,{flow_id:r,control_id:n.id,step_id:n.id,abvariations:e,ab_test_start:t,compact:!0})))}if(!n)return null;const s=n["ab-test-variations"]||[],l=n["ab-test-start"]||!1;return(0,o.createElement)("div",{className:"ab-test-group-container"},(0,o.createElement)(N5,{type:"target",position:p1.Top,id:"top",style:{background:"#555",width:"10px",height:"10px",top:"-5px",left:"50%"},isConnectable:t}),(0,o.createElement)(N5,{type:"target",position:p1.Left,id:"left",style:{background:"#555",width:"10px",height:"10px",left:"-5px",top:"50%"},isConnectable:t}),(0,o.createElement)("div",{className:"ab-test-group-header absolute w-3/4 mx-auto top-[-30px] left-0 right-0 z-10"},(0,o.createElement)(g$,{flow_id:r,control_id:n.id,step_id:n.id,abvariations:s,ab_test_start:l,compact:!0})),(0,o.createElement)("div",{className:"absolute -bottom-[14px] right-3 z-10"},(0,o.createElement)(W7,{variations:n["ab-test-archived-variations"]||[],type:n.type,flowId:r,controlId:n.id})),(0,o.createElement)(N5,{type:"source",position:p1.Right,id:"right",style:{background:"#555",width:"10px",height:"10px",right:"-5px",top:"50%"},isConnectable:t}),(0,o.createElement)(N5,{type:"source",position:p1.Bottom,id:"bottom",style:{background:"#555",width:"10px",height:"10px",bottom:"-5px",left:"50%"},isConnectable:t}))});Z7.displayName="ABTestGroupNode";const G7=Z7;var H7=a(6246),$7=a.n(H7);const X7=class{static validateConnection(e,t,n,r){const a=[];if(this.isOfferStep(e.type)&&("landing"!==t.type&&"checkout"!==t.type||a.push({code:"INVALID_OFFER_TARGET",message:`${this.getStepTypeLabel(e.type)} cannot connect to ${this.getStepTypeLabel(t.type)}`,severity:"error"})),e.id===t.id&&a.push({code:"SELF_REFERENCE",message:"Step cannot connect to itself",severity:"error"}),this.isOfferStep(e.type)&&r.steps){const t=r.steps.some(e=>"checkout"===e.type);if(t&&r.stepOrder){const n=this.extractStepId(e.id),o=r.stepOrder.indexOf(n),i=r.stepOrder.findIndex(e=>"checkout"===r.steps.find(t=>t.id===e)?.type);t&&-1!==o&&-1!==i&&o<i&&a.push({code:"OFFER_BEFORE_CHECKOUT",message:"Offer step should come after Checkout",severity:"warning"})}}if("landing"===e.type&&r.stepOrder){const t=this.extractStepId(e.id);0!==r.stepOrder.indexOf(t)&&a.push({code:"LANDING_NOT_FIRST",message:"Landing page should be the first step",severity:"warning"})}const o={isValid:0===a.filter(e=>"error"===e.severity).length,errors:a,warnings:a.filter(e=>"warning"===e.severity)};return console.log("[ValidationHelper] Validation complete:",{isValid:o.isValid,errorCount:a.length,hardErrors:a.filter(e=>"error"===e.severity).length,warnings:a.filter(e=>"warning"===e.severity).length}),o}static validateStepOrder(e,t,n){const r=[];if("storeCheckout"===n){const n=t.find(e=>"checkout"===e.type);n&&0!==e.indexOf(n.id)&&r.push({code:"STORE_CHECKOUT_POSITION",stepId:n.id,message:"Store checkout must be the first step",severity:"error"})}const a=e.findIndex(e=>"checkout"===t.find(t=>t.id===e)?.type);-1!==a&&e.forEach((e,n)=>{const o=t.find(t=>t.id===e);this.isOfferStep(o?.type)&&n<a&&r.push({code:"OFFER_BEFORE_CHECKOUT",stepId:e,message:"Offer step should come after Checkout",severity:"warning"})});const o=e.findIndex(e=>"landing"===t.find(t=>t.id===e)?.type);if(-1!==o&&0!==o){const e=t.find(e=>"landing"===e.type);r.push({code:"LANDING_NOT_FIRST",stepId:e?.id,message:"Landing page should be the first step",severity:"warning"})}const i=e.findIndex(e=>"thankyou"===t.find(t=>t.id===e)?.type);if(-1!==i&&i!==e.length-1){const n=e.slice(i+1).some(e=>{const n=t.find(t=>t.id===e);return n&&!this.isOfferStep(n.type)});if(n){const e=t.find(e=>"thankyou"===e.type);r.push({code:"THANKYOU_NOT_LAST",stepId:e?.id,message:"Thank You page should typically be the last step (or followed only by offers)",severity:"warning"})}}return{isValid:0===r.filter(e=>"error"===e.severity).length,errors:r,warnings:r.filter(e=>"warning"===e.severity)}}static isOfferStep(e){return"upsell"===e||"downsell"===e}static getStepTypeLabel(e){return{landing:"Landing Page",checkout:"Checkout",upsell:"Upsell",downsell:"Downsell",thankyou:"Thank You",optin:"Opt-in"}[e]||e}static extractStepId(e){if(!e)return null;if("wcf_start_node"===e||"wcf_end_node"===e)return null;const t=e.match(/wcf_node_edge_(\d+)/);return t?parseInt(t[1],10):e}static validateStepPosition(e,t,n,r,a){const o=this.validateStepOrder(n,r,a).errors.filter(t=>t.stepId===e.id);return o.length>0?{isValid:0===o.filter(e=>"error"===e.severity).length,errors:o,warnings:o.filter(e=>"warning"===e.severity)}:{isValid:!0,errors:[],warnings:[]}}},q7=class{static hasValidRuleValue(e){return!(!e||!e.value||Array.isArray(e.value)&&(0===e.value.length||e.value.every(e=>""===e||"string"==typeof e&&""===e.trim()))||"string"==typeof e.value&&""===e.value.trim())}static hasValidRules(e){return!!(e&&e.rules&&Array.isArray(e.rules))&&e.rules.some(e=>this.hasValidRuleValue(e))}static hasDynamicOffers(e){return!(!e||"checkout"!==e.type&&"store-checkout"!==e.type)&&(!(!e.conditions||!Array.isArray(e.conditions)||0===e.conditions.length)&&this.getValidTargetSteps(e.conditions,e.default_step).length>0)}static getValidTargetSteps(e,t){const n=[];if(e&&Array.isArray(e)&&e.forEach(e=>{if(e.step_id&&this.hasValidRules(e)){const t=parseInt(e.step_id,10);isNaN(t)||n.push(t)}}),t){const e=parseInt(t,10);isNaN(e)||n.push(e)}return n}static getUniqueTargetSteps(e,t){const n=new Set;if(e&&Array.isArray(e)&&e.forEach(e=>{if(e.step_id){const t=parseInt(e.step_id,10);isNaN(t)||n.add(t)}}),t){const e=parseInt(t,10);isNaN(e)||n.add(e)}return Array.from(n)}static removeConditionsForStep(e,t){return e&&Array.isArray(e)?e.filter(e=>parseInt(e.step_id,10)!==t):[]}static updateDefaultStep(e,t,n){return parseInt(e,10)!==parseInt(t,10)?e:n.length>0&&void 0!==n[0].step_id&&null!==n[0].step_id?n[0].step_id:""}static buildRulesFormData(e,t,n,r){const a=new window.FormData;return a.append("action","cartflows_save_meta_settings"),a.append("security",cartflows_admin.save_meta_settings_nonce),a.append("post_id",t),a.append("step_id",e),a.append("wcf-checkout-rules-option","yes"),n.forEach((e,t)=>{a.append(`wcf-checkout-rules[${t}][group_id]`,e.group_id),a.append(`wcf-checkout-rules[${t}][step_id]`,e.step_id),e?.rules&&Array.isArray(e?.rules)&&e.rules.forEach((e,n)=>{var r,o,i;a.append(`wcf-checkout-rules[${t}][rules][${n}][rule_id]`,null!==(r=e?.rule_id)&&void 0!==r?r:""),a.append(`wcf-checkout-rules[${t}][rules][${n}][condition]`,null!==(o=e?.condition)&&void 0!==o?o:""),a.append(`wcf-checkout-rules[${t}][rules][${n}][operator]`,null!==(i=e?.operator)&&void 0!==i?i:""),Array.isArray(e.value)?e.value.forEach(e=>{a.append(`wcf-checkout-rules[${t}][rules][${n}][value][]`,e)}):a.append(`wcf-checkout-rules[${t}][rules][${n}][value]`,e.value)})}),a.append("wcf-checkout-rules-default-step",r||""),a}static isConditionalEdge(e){return e&&e.source&&e.source.startsWith("conditional-")}static extractCheckoutId(e){if(!e||!e.startsWith("conditional-"))return null;const t=parseInt(e.replace("conditional-",""),10);return isNaN(t)?null:t}static extractStepId(e,t=null){if(!e)return null;if(e.includes("ab-group-")){const t=e.match(/(?:offer-)?ab-group-(\d+)/);if(t){const e=parseInt(t[1],10);return isNaN(e)?null:e}return null}if(e.includes("wcf_node_edge_")){const n=parseInt(e.replace("wcf_node_edge_",""),10);if(isNaN(n))return null;if(t&&Array.isArray(t))for(const e of t)if(e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].some(e=>e.id===n))return e.id;return n}return null}},J7=["upsell","downsell"],K7=(e,t=[])=>{const n=[];if(!e||!e.type)return n;if(J7.includes(e.type)){const r=new Set(t.map(e=>parseInt(e.id,10))),a=parseInt(e.offer_yes_step_id,10)||0,o=parseInt(e.offer_no_step_id,10)||0;a&&!r.has(a)&&n.push({kind:"broken-redirect",severity:"error",message:(0,z.__)("Accept target step is missing","cartflows")}),o&&!r.has(o)&&n.push({kind:"broken-redirect",severity:"error",message:(0,z.__)("Reject target step is missing","cartflows")})}return n},eee=550,tee=350,nee=-200,ree=300,aee=-50,oee=class{constructor(e,t,n="horizontal"){this.steps=e,this.flowType=t,this.axis=n,this.offerSteps=["upsell","downsell"],this.positions=new Map,this.incomingAcceptEdges=new Map,this.incomingRejectEdges=new Map,this.conditionalTargets=new Map,this.dynamicOfferTargetSteps=new Set,this.stepIndexMap=new Map,this.steps.forEach((e,t)=>{this.stepIndexMap.set(e.id,t)})}calculate(){return this.identifyDynamicOfferTargets(),this.buildIncomingEdgesMap(),this.calculatePositions(),this.positions}identifyDynamicOfferTargets(){this.steps.forEach(e=>{if(q7.hasDynamicOffers(e)){const t=q7.getUniqueTargetSteps(e.conditions,e.default_step),n=this.calculateConditionalFan(t);t.forEach((t,r)=>{this.dynamicOfferTargetSteps.add(t),this.conditionalTargets.set(t,{yOffset:n[r],sourceCheckoutId:e.id})})}})}buildIncomingEdgesMap(){this.steps.forEach(e=>{this.incomingAcceptEdges.set(e.id,[]),this.incomingRejectEdges.set(e.id,[])}),this.steps.forEach((e,t)=>{if(!this.offerSteps.includes(e.type))return;const n=this.hasABTestVariations(e),r=n?e["ab-test-variations"].length:1;if(n){const n=new Set;e["ab-test-variations"].forEach((a,o)=>{const i=a.offer_yes_step_id,s=a.offer_no_step_id;if(i){const n=this.incomingAcceptEdges.get(i);n&&n.push({offerId:e.id,offerIndex:t,hasABTest:!0,variationCount:r,variationIndex:o})}if(s&&!n.has(s)){n.add(s);const a=this.incomingRejectEdges.get(s);a&&a.push({offerId:e.id,offerIndex:t,hasABTest:!0,variationCount:r})}})}else{const n=e.offer_yes_step_id,r=e.offer_no_step_id;if(n){const r=this.incomingAcceptEdges.get(n);r&&r.push({offerId:e.id,offerIndex:t,hasABTest:!1,variationCount:1})}if(r){const n=this.incomingRejectEdges.get(r);n&&n.push({offerId:e.id,offerIndex:t,hasABTest:!1,variationCount:1})}}})}calculatePositions(){this.steps.forEach((e,t)=>{const n=this.calculateYPosition(e,t),r=this.calculateXPositionForStep(e,t),a=q7.hasDynamicOffers(e),o="upsell"===e.type||"downsell"===e.type,i="checkout"===e.type&&Array.isArray(e.bumps)?e.bumps.length:0;this.positions.set(e.id,{x:r,y:n,hasDynamicOffers:a,hasABTest:this.hasABTestVariations(e),isOfferStep:o,bumpCount:i})}),this.adjustXPositionsForIncomingEdges()}bumpStride(e,t){return e&&t?150+50*(t-1):0}calculateXPositionForStep(e,t){if(0===t)return 250;const n="vertical"===this.axis,r=n?380:eee,a=[...this.incomingAcceptEdges.get(e.id)||[],...this.incomingRejectEdges.get(e.id)||[]];if(a.length>0){let e=0,t=!1;if(a.forEach(n=>{const r=this.positions.get(n.offerId);r&&r.x>e&&(e=r.x,t=r.hasDynamicOffers)}),e>0)return e+(t?r+tee:r)}const o=this.steps[t-1],i=this.positions.get(o.id);if(i){let e=r;return i.hasDynamicOffers&&(e+=tee),i.hasABTest&&!i.isOfferStep&&(n?e=700:e+=150),e+=this.bumpStride(n,i.bumpCount),i.x+e}return 250+t*r}adjustXPositionsForIncomingEdges(){let e=!0,t=0;for(;e&&t<10;)e=!1,t++,this.steps.forEach(t=>{const n=this.positions.get(t.id);if(!n)return;const r=[...this.incomingAcceptEdges.get(t.id)||[],...this.incomingRejectEdges.get(t.id)||[]];if(0===r.length)return;let a=0,o=!1;r.forEach(e=>{const t=this.positions.get(e.offerId);t&&t.x>a&&(a=t.x,o=t.hasDynamicOffers)});const i="vertical"===this.axis?380:eee,s=a+(o?i+tee:i);s>n.x&&(n.x=s,this.positions.set(t.id,n),e=!0)})}calculateYPosition(e,t){if(0===t)return 0;if(this.dynamicOfferTargetSteps.has(e.id)){const e=this.steps[t-1],n=this.positions.get(e.id);return(n?n.y:0)+200}const n=this.incomingAcceptEdges.get(e.id)||[],r=this.incomingRejectEdges.get(e.id)||[];if(n.length>0&&r.length>0){const t=new Set(r.map(e=>e.offerId)),a=new Set(n.map(e=>e.offerId));if([...t].some(e=>!a.has(e))){const e=r.filter(e=>!a.has(e.offerId)),t=this.findEarliestSource(e);return this.calculateRejectYPosition(t)}const o=this.findEarliestSource(n),i=this.positions.get(o.offerId);let s=i?i.y:0;return s=this.applyABTestAcceptOffset(e,s),s}if(n.length>0){const t=this.findEarliestSource(n);let r=this.calculateAcceptYPosition(t);return r=this.applyABTestAcceptOffset(e,r),r}if(r.length>0){const e=this.findEarliestSource(r);return this.calculateRejectYPosition(e)}const a=this.steps[t-1],o=this.positions.get(a.id);return o?o.y:0}calculateRejectYPosition(e){const t=this.positions.get(e.offerId);if(!t)return 200;if(e.hasABTest&&e.variationCount>1){const n=this.calculateABGroupHeight(e.variationCount);return t.y+aee+n}return t.y+200}calculateAcceptYPosition(e){const t=this.positions.get(e.offerId);return t?e.hasABTest&&e.variationCount>1&&void 0!==e.variationIndex?t.y+aee+50-e.variationIndex*ree+150:t.y+nee:nee}applyABTestAcceptOffset(e,t){if(this.hasABTestVariations(e)){const n=this.calculateABGroupHeight(e["ab-test-variations"].length);return t+nee-n/3}return t}calculateABGroupHeight(e){return e*ree+50}findEarliestSource(e){return 0===e.length?null:e.reduce((e,t)=>t.offerIndex<e.offerIndex||t.offerIndex===e.offerIndex&&void 0!==t.variationIndex&&void 0!==e.variationIndex&&t.variationIndex<e.variationIndex?t:e,e[0])}calculateConditionalFan(e){const t=e.length;if(0===t)return[];if(1===t)return[0];const n=0-250*(t-1)/2;return e.map((e,t)=>n+250*t)}hasABTestVariations(e){return e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].length>1}getMaxX(){let e=0;return this.positions.forEach(t=>{t.x>e&&(e=t.x)}),e}getPosition(e){return this.positions.get(e)||null}isConditionalTarget(e){return this.conditionalTargets.has(e)}isDynamicOfferTarget(e){return this.dynamicOfferTargetSteps.has(e)}static calculateABGroupDimensions(e){return{width:450,height:e*ree+50}}static calculateABVariationPosition(e){return{x:25,y:50+e*ree}}static getABGroupYOffset(){return aee}},iee={getInvalidStepIds(e){const t=new Set;if(!Array.isArray(e))return t;const n="undefined"!=typeof cartflows_admin&&cartflows_admin.old_global_checkout?parseInt(cartflows_admin.old_global_checkout,10):null;let r=!1;return e.forEach(e=>{e&&"object"==typeof e&&("landing"!==e.type?"checkout"===e.type&&(n?parseInt(e.id,10)!==n&&t.add(e.id):r?t.add(e.id):r=!0):t.add(e.id))}),t},filterMenuActions(e,t,n){if(!e||"object"!=typeof e)return e;const r={...e};return"checkout"===t?.type&&(delete r.clone,n||delete r.delete),n&&(delete r.clone,delete r.abtest),r}},see=class{constructor(e,t,n,r,a="LR",o="horizontal",i=!1){this.steps=e,this.flowType=t,this.flowId=n,this.flowAnalytics=r,this.direction=a,this.axis=o,this.compact=i,this.offerSteps=["upsell","downsell"],this.nonOfferSteps=["landing","checkout","thankyou","optin"],this.storeCheckoutInvalidIds="storeCheckout"===t?iee.getInvalidStepIds(e):new Set,this.positionCalculator=new oee(e,t,o),this.calculatedPositions=null}initializePositions(){this.calculatedPositions=this.positionCalculator.calculate()}getStepPosition(e,t=0,n=0){if(this.calculatedPositions&&this.calculatedPositions.has(e)){const t=this.calculatedPositions.get(e);return{x:t.x,y:t.y}}return{x:t,y:n}}generateNodeId(e){return`wcf_node_edge_${e}`}getStepAnalytics(e){return this.flowAnalytics&&this.flowAnalytics.all_steps&&this.flowAnalytics.all_steps.find(t=>t.id===e)||null}isInvalidPosition(e){if(this.storeCheckoutInvalidIds.has(e.id))return!0;if(!this.offerSteps.includes(e.type))return!1;if(!e.offer_yes_step_id||!e.offer_no_step_id)return!0;const t=this.steps.map(e=>e.id),n=t.indexOf(e.id);return!X7.validateStepPosition(e,n,t,this.steps,this.flowType).isValid}createStartNode(){return{id:"wcf_start_node",type:"label",data:{position:"start",label:(0,z.__)("Start","cartflows"),direction:this.direction,axis:this.axis,compact:this.compact},position:{x:50,y:103}}}createEndNode(e){return{id:"wcf_end_node",type:"label",data:{position:"end",label:(0,z.__)("End","cartflows"),direction:this.direction,axis:this.axis,compact:this.compact},position:{x:e,y:103}}}hasABTestVariations(e){return e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].length>1}createRegularStepNode(e,t,n,r){const a=this.offerSteps.includes(e.type)?"offer":e.type,o=this.getStepAnalytics(e.id),i=this.isInvalidPosition(e),s="storeCheckout"===this.flowType&&this.storeCheckoutInvalidIds.has(e.id),l="storeCheckout"===this.flowType&&"checkout"===e.type&&!0===e.is_product_assigned;let c=e.is_product_assigned;(["landing","thankyou"].includes(e.type)||"storeCheckout"===this.flowType&&"checkout"===e.type)&&(c=!0);const u=e.actions?.view?.link||"",d=e.page_builder_edit?e.page_builder_edit.replace(/&/g,"&"):"",f=e.actions?.edit?.link||"",m="storeCheckout"===this.flowType?iee.filterMenuActions(e.menu_actions,e,this.storeCheckoutInvalidIds.has(e.id)):e.menu_actions;return{id:this.generateNodeId(e.id),type:a,data:{flow_id:this.flowId,flow_type:this.flowType,label:e.title,step_id:e.id,step_type:e.type,control_id:e.id,editPage:d,editSettings:f,viewPageLink:u,index:t,direction:this.direction,axis:this.axis,compact:this.compact,menu_actions:m,ab_test_variations:e["ab-test-variations"],analytics:o,is_product_assigned:c,isInvalidPosition:i,is_locked:s,has_store_checkout_product_warning:l,warnings:K7(e,this.steps),step_disabled:e.step_disabled||!1,bumps:"checkout"===e.type&&e.bumps||[]},position:{x:n,y:r}}}createOfferABTestVariationNode(e,t,n,r){const a=this.getStepAnalytics(t.id),o=t.actions?.edit?.link||"";let i=e.is_product_assigned;(["landing","thankyou"].includes(t.type)||"storeCheckout"===this.flowType&&"checkout"===t.type)&&(i=!0);const s={id:t.id,type:t.type,offer_yes_step_id:e.offer_yes_step_id,offer_no_step_id:e.offer_no_step_id},l=this.isInvalidPosition(s),c=oee.calculateABVariationPosition(r);return{id:this.generateNodeId(e.id),type:"abtest",data:{flow_id:this.flowId,flow_type:this.flowType,label:e.title,step_id:e.id,step_type:t.type,control_id:t.id,editPage:e.actions?.edit?.link?e.actions.edit.link.replace(/&/g,"&"):"",editSettings:o,viewPageLink:e.actions?.view?.link||"",index:n,direction:this.direction,axis:this.axis,compact:this.compact,menu_actions:e.menu_actions,analytics:a?a["visits-ab"][e.id]:null,traffic:e.traffic,var_badge_count:r,offer_yes_next_step:e.offer_yes_next_step,offer_no_next_step:e.offer_no_next_step,offer_yes_step_id:e.offer_yes_step_id,offer_no_step_id:e.offer_no_step_id,is_product_assigned:i,isInvalidPosition:l,isABTestVariation:!0,isGrouped:!0,step_disabled:e.step_disabled||!1},parentId:`offer-ab-group-${t.id}`,extent:"parent",connectable:!0,draggable:!1,position:c}}createABTestGroupNode(e,t,n){const r=e["ab-test-variations"],{width:a,height:o}=oee.calculateABGroupDimensions(r.length),i="vertical"===this.axis?-25:aee,s=this.flowId;return{id:`ab-group-${e.id}`,type:"group",data:{step:e,flow_id:s,label:e.title},position:{x:t,y:n+i},style:{width:a,height:o,backgroundColor:"transparent",border:"2px dashed #000000",borderRadius:"8px"}}}createOfferABTestGroupNode(e,t,n){const r=e["ab-test-variations"],{width:a,height:o}=oee.calculateABGroupDimensions(r.length),i=this.flowId;return{id:`offer-ab-group-${e.id}`,type:"group",data:{step:e,flow_id:i,label:e.title,isOfferABTestGroup:!0},position:{x:t,y:n+aee},style:{width:a,height:o,backgroundColor:"transparent",border:"2px dashed #000000",borderRadius:"8px"}}}createGroupedABTestVariationNode(e,t,n,r,a,o){const i=this.getStepAnalytics(t.id),s=t.actions?.edit?.link||"";let l=e.is_product_assigned;(["landing","thankyou"].includes(t.type)||"storeCheckout"===this.flowType&&"checkout"===t.type)&&(l=!0),t.type;const c=oee.calculateABVariationPosition(r);return{id:this.generateNodeId(e.id),type:"abtest",data:{flow_id:this.flowId,flow_type:this.flowType,label:e.title,step_id:e.id,step_type:t.type,control_id:t.id,editPage:e.actions?.edit?.link?e.actions.edit.link.replace(/&/g,"&"):"",editSettings:s,viewPageLink:e.actions?.view?.link||"",index:n,direction:this.direction,axis:this.axis,compact:this.compact,menu_actions:e.menu_actions,analytics:i?i["visits-ab"][e.id]:null,traffic:e.traffic,var_badge_count:r,is_product_assigned:l,isInvalidPosition:!1,isABTestVariation:!0,isGrouped:!0,step_disabled:e.step_disabled||!1},parentId:`ab-group-${t.id}`,extent:"parent",connectable:!1,draggable:!1,position:c}}createConditionalNode(e,t,n){return{id:`conditional-${e.id}`,type:"conditional",position:{x:t,y:n},data:{checkoutId:e.id,conditions:e.conditions,defaultStep:e.default_step,editSettings:e.actions?.edit?.link||"",direction:this.direction,axis:this.axis,compact:this.compact,flow_type:this.flowType,flow_id:this.flowId,label:"Dynamic Offers"},style:{visibility:"visible"}}}buildNodes(){const e=[];this.initializePositions();let t=250;e.push(this.createStartNode()),this.steps.forEach((n,r)=>{if(!wcfCartflowsTypePlusPro()&&this.offerSteps.includes(n.type))return;const a=this.getStepPosition(n.id,t,0),o=a.x,i=a.y;if(q7.hasDynamicOffers(n)){if(this.hasABTestVariations(n)){const t=n["ab-test-variations"],a=this.createABTestGroupNode(n,o,i);e.push(a),t.forEach((t,a)=>{const s=this.createGroupedABTestVariationNode(t,n,r,a,o,i);e.push(s)})}else{const t=this.createRegularStepNode(n,r,o,i);e.push(t)}const a=o+eee,s=this.createConditionalNode(n,a,i);return e.push(s),void(t=a+tee)}if(this.hasABTestVariations(n)){const t=n["ab-test-variations"];if(this.offerSteps.includes(n.type)){const a=this.createOfferABTestGroupNode(n,o,i);e.push(a),t.forEach((t,a)=>{oee.calculateABVariationPosition(a);const o=this.createOfferABTestVariationNode(t,n,r,a);e.push(o)})}else{const a=this.createABTestGroupNode(n,o,i);e.push(a),t.forEach((t,a)=>{const s=this.createGroupedABTestVariationNode(t,n,r,a,o,i);e.push(s)})}}else{const t=this.createRegularStepNode(n,r,o,i);e.push(t)}t=o+eee});const n=this.positionCalculator.getMaxX(),r=Math.max(n+eee,t);return e.push(this.createEndNode(r)),e}},lee=class{constructor(e,t,n=!1,r="custom",a="horizontal"){this.steps=e,this.flowType=t,this.isAnimated=n,this.edgeType=r,this.axis=a,this.offerSteps=["upsell","downsell"]}targetHandleId(e="incoming"){return"vertical"===this.axis?"conditional"===e?"left":"top":"conditional"===e?"top":"left"}sourceHandleId(){return"vertical"===this.axis?"bottom":"right"}generateNodeId(e){return`wcf_node_edge_${e}`}hasABTestVariations(e){return e&&e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].length>1}getAllVariationIds(e){return this.hasABTestVariations(e)?e["ab-test-variations"].map(e=>e.id):[e.id]}isOfferStep(e){return e&&this.offerSteps.includes(e.type)}getTargetNodeIds(e){if(!this.hasABTestVariations(e))return[`wcf_node_edge_${e.id}`];if(this.isOfferStep(e)){return e["ab-test-variations"].map(e=>`wcf_node_edge_${e.id}`)}return[`ab-group-${e.id}`]}findStep(e){return this.steps.find(t=>t.id===e)}createStartEdges(){const e=[];if(0===this.steps.length)return e;const t=this.steps[0];return this.getTargetNodeIds(t).forEach(t=>{e.push({id:`wcf_start_node-${t}-edge`,type:this.edgeType,animated:this.isAnimated,source:"wcf_start_node",sourceHandle:this.sourceHandleId(),target:t,targetHandle:this.targetHandleId(),deletable:!0,focusable:!0,selectable:!0})}),e}createEndEdges(){const e=[];if(0===this.steps.length)return e;const t=this.steps[this.steps.length-1];return this.getTargetNodeIds(t).forEach(t=>{e.push({id:`${t}-wcf_end_node-edge`,animated:this.isAnimated,source:t,sourceHandle:this.sourceHandleId(),target:"wcf_end_node",targetHandle:this.targetHandleId(),type:this.edgeType,deletable:!0,focusable:!0,selectable:!0})}),e}createOfferEdges(e,t,n,r=null){const a=[],o=(r?"a"===n?r.offer_yes_step_id:r.offer_no_step_id:null)||t;if(!o)return a;const i=this.findStep(o);if(!i)return a;const s=this.getTargetNodeIds(i),l="a"===n,c=l?"accept":"reject",u={label:l?(0,z.__)("Accept","cartflows"):(0,z.__)("Reject","cartflows"),labelBgStyle:{fill:l?"#F0FDF4":"#FEF2F2",border:l?"#BBF7D0":"#FECACA"},labelStyle:{fill:l?"#16A34A":"#DC2626",fontWeight:400,fontSize:"12px"},labelBgPadding:[8,4]};return s.forEach(t=>{a.push({id:`${e}-${t}-edge-${n}`,type:this.edgeType,animated:this.isAnimated,source:this.generateNodeId(e),sourceHandle:n,target:t,targetHandle:this.targetHandleId(),...u,data:{kind:c},deletable:!0,focusable:!0,selectable:!0})}),a}createCheckoutToConditionalEdge(e,t){const n=this.hasABTestVariations(e)?`ab-group-${e.id}`:`wcf_node_edge_${e.id}`;return{id:`${n}-${t}-edge`,type:this.edgeType,animated:this.isAnimated,source:n,sourceHandle:this.sourceHandleId(),target:t,deletable:!1,focusable:!0,selectable:!0}}getConditionalEdgeLabel(e,t){if(t.default_step&&parseInt(t.default_step,10)===parseInt(e,10))return{label:(0,z.__)("Default","cartflows"),kind:"default"};if(t.conditions&&Array.isArray(t.conditions))for(let n=0;n<t.conditions.length;n++){const r=t.conditions[n];if(r.step_id&&parseInt(r.step_id,10)===parseInt(e,10))return{label:(0,z.sprintf)(/* translators: %d is replaced with the condition number */ /* translators: %d is replaced with the condition number */ |
| 94 |
(0,z.__)("Condition %d","cartflows"),n+1),kind:"condition"}}return{label:(0,z.__)("Condition","cartflows"),kind:"condition"}}createConditionalEdges(e,t){const n=[];return q7.getUniqueTargetSteps(e.conditions,e.default_step).forEach((r,a)=>{const o=this.findStep(r);if(!o)return void console.warn(`[EdgeBuilder] Target step ${r} not found`);const{label:i,kind:s}=this.getConditionalEdgeLabel(r,e),l={label:i,labelBgStyle:{fill:"#FDE68A",border:"1px solid #d1d5db"},labelStyle:{fill:"#D97706",fontWeight:400,fontSize:"12px"},labelBgPadding:[8,4]},c=this.hasABTestVariations(o);this.offerSteps.includes(o.type)&&c?o["ab-test-variations"].forEach(e=>{const r=`wcf_node_edge_${e.id}`,a={id:`${t}-${r}-edge`,type:this.edgeType,animated:this.isAnimated,source:t,target:r,targetHandle:this.targetHandleId("conditional"),...l,deletable:!0,focusable:!0,selectable:!0,data:{kind:s,offerControlId:o.id}};n.push(a)}):this.getTargetNodeIds(o).forEach(e=>{const r={id:`${t}-${e}-edge`,type:this.edgeType,animated:this.isAnimated,source:t,target:e,targetHandle:this.targetHandleId("conditional"),...l,deletable:!0,focusable:!0,selectable:!0,data:{kind:s,controlId:o.id}};n.push(r)})}),n}createRegularEdges(e,t){const n=[],r=this.findStep(t);return r?(this.getTargetNodeIds(r).forEach(t=>{n.push({id:`${e}-${t}-edge`,type:this.edgeType,animated:this.isAnimated,source:this.generateNodeId(e),sourceHandle:this.sourceHandleId(),target:t,targetHandle:this.targetHandleId(),deletable:!0,focusable:!0,selectable:!0})}),n):n}createRegularEdgesFromGroup(e,t){const n=[],r=this.findStep(t);if(!r)return n;const a=this.getTargetNodeIds(r),o=`ab-group-${e}`;return a.forEach(t=>{n.push({id:`${e}-${t}-edge-group`,type:this.edgeType,animated:this.isAnimated,source:o,sourceHandle:this.sourceHandleId(),target:t,targetHandle:this.targetHandleId(),deletable:!0,focusable:!0,selectable:!0})}),n}createSequentialEdges(e,t,n){const r=[];if(!t)return r;if(q7.hasDynamicOffers(e))return r;const a=this.hasABTestVariations(e),o=this.offerSteps.includes(e.type);return a&&!o?(r.push(...this.createRegularEdgesFromGroup(e.id,t.id)),r):(this.getAllVariationIds(e).forEach(n=>{const i=a?e["ab-test-variations"].find(e=>e.id===n):null;if(o){const t=i?i.offer_yes_step_id:e.offer_yes_step_id,a=i?i.offer_no_step_id:e.offer_no_step_id;t&&r.push(...this.createOfferEdges(n,t,"a",i)),a&&r.push(...this.createOfferEdges(n,a,"b",i))}else r.push(...this.createRegularEdges(n,t.id))}),r)}buildEdges(){const e=[],t=new Set;this.steps.forEach(e=>{q7.hasDynamicOffers(e)&&q7.getUniqueTargetSteps(e.conditions,e.default_step).forEach(e=>t.add(e))});const n=this.createStartEdges();e.push(...n),this.steps.forEach((n,r)=>{if(!wcfCartflowsTypePlusPro()&&this.offerSteps.includes(n.type))return;if(t.has(n.id)){if(this.offerSteps.includes(n.type))if(this.hasABTestVariations(n))this.getAllVariationIds(n).forEach(t=>{const r=n["ab-test-variations"].find(e=>e.id===t);if(r){const n=r.offer_yes_step_id,a=r.offer_no_step_id;if(n){const a=this.createOfferEdges(t,n,"a",r);e.push(...a)}if(a){const n=this.createOfferEdges(t,a,"b",r);e.push(...n)}}});else{const t=n.offer_yes_step_id,r=n.offer_no_step_id;if(t){const r=this.createOfferEdges(n.id,t,"a",null);e.push(...r)}if(r){const t=this.createOfferEdges(n.id,r,"b",null);e.push(...t)}}return}const a=this.steps[r+1]||null,o=this.createSequentialEdges(n,a,r);e.push(...o)}),this.steps.forEach(t=>{if(!q7.hasDynamicOffers(t))return;const n=`conditional-${t.id}`,r=this.createCheckoutToConditionalEdge(t,n);e.push(r);const a=this.createConditionalEdges(t,n);e.push(...a)});const r=this.createEndEdges();return e.push(...r),e}},cee=class{constructor(e,t,n,r,a="LR",o="horizontal",i=!1){this.steps=e,this.direction=a,this.axis=o,this.compact=i,this.nodeBuilder=new see(e,t,n,r,a,o,i),this.edgeBuilder=new lee(e,t,!1,"custom",o)}build(){const e=this.nodeBuilder.buildNodes(),t=this.edgeBuilder.buildEdges();return"vertical"===this.axis?{nodes:this.transpose(e),edges:t}:{nodes:e,edges:t}}transpose(e){return e.map(e=>e.parentId?e:{...e,position:{x:e.position.y,y:e.position.x}})}tidy(e,t){const n="vertical"===this.axis,r=new($7().graphlib.Graph);let a="LR";n?a="TB":"RL"===this.direction&&(a="RL"),r.setGraph({rankdir:a,ranksep:150,nodesep:120,marginx:50,marginy:50}),r.setDefaultEdgeLabel(()=>({}));const o=new Set(e.filter(e=>e.parentId).map(e=>e.id)),i=this.compact?250:400,s=e=>"group"===e.type?e.style?.width||e.measured?.width||i:e.width||e.measured?.width||("label"===e.type?50:i),l=n?230:300,c=e=>{if("group"===e.type)return e.style?.height||e.measured?.height||300;const t=Array.isArray(e.data?.bumps)?e.data.bumps.length:0,r=n&&t?150+50*(t-1):0;return e.height||e.measured?.height||("label"===e.type?30:l+r)};return e.forEach(e=>{o.has(e.id)||r.setNode(e.id,{width:s(e),height:c(e)})}),t.forEach(e=>{o.has(e.source)||o.has(e.target)||r.setEdge(e.source,e.target)}),$7().layout(r),e.map(e=>{if(o.has(e.id))return e;const t=r.node(e.id);return t?{...e,position:n?{x:e.position.x,y:t.y-t.height/2}:{x:t.x-t.width/2,y:e.position.y}}:e})}static structuralKey(e,t,n="horizontal",r=!1){return e.map(e=>`${e.id}:${e.type}:${e.title}`).join("|")+`:${t}:${n}:${r?"c":"d"}`}},uee=class{constructor(e,t,n,r,a,o,i,s,l,c){this.steps=e,this.flowType=t,this.flowId=n,this.nodes=r,this.edges=a,this.setEdges=o,this.setReorderError=i,this.dispatch=s,this.renderCb=c,this.setSettingsStatus=l,this.offerSteps=["upsell","downsell"],this.edgeType="custom"}extractStepId(e){if(!e)return null;if("wcf_start_node"===e)return"START";if("wcf_end_node"===e)return"END";const t=e.match(/ab-group-(\d+)/);if(t)return parseInt(t[1],10);const n=e.match(/wcf_node_edge_(\d+)/);return n?parseInt(n[1],10):null}generateNodeId(e){return`wcf_node_edge_${e}`}findStep(e){return this.steps.find(t=>t.id===e)}getControlId(e){if("wcf_start_node"===e||"wcf_end_node"===e)return this.extractStepId(e);const t=this.nodes.find(t=>t.id===e);return t?"group"===t.type?this.extractStepId(e):t.data&&t.data.control_id?t.data.control_id:this.extractStepId(e):this.extractStepId(e)}hasABTestVariations(e){return e&&e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])&&e["ab-test-variations"].length>1}isOfferStep(e){return e&&this.offerSteps.includes(e.type)}getTargetNodeId(e){return this.hasABTestVariations(e)?this.isOfferStep(e)?null:`ab-group-${e.id}`:`wcf_node_edge_${e.id}`}getAllTargetNodeIds(e){return this.hasABTestVariations(e)?this.isOfferStep(e)?e["ab-test-variations"].map(e=>`wcf_node_edge_${e.id}`):[`ab-group-${e.id}`]:[`wcf_node_edge_${e.id}`]}updateOfferRedirection(e,t,n){const r=new window.FormData;return r.append("action","cartflows_save_meta_settings"),r.append("security",cartflows_admin.save_meta_settings_nonce),r.append("post_id",this.flowId),r.append("step_id",e),"a"===t?r.append("wcf-yes-next-step",n):"b"===t&&r.append("wcf-no-next-step",n),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(e=>(e&&e.status&&(this.setSettingsStatus({status:"SAVED"}),this.renderCb()),e)).catch(e=>{throw console.error("[ConnectionHandler] AJAX error:",e),e})}updateStepConnection(e,t){const n=new window.FormData;return n.append("action","cartflows_save_meta_settings"),n.append("security",cartflows_admin.save_meta_settings_nonce),n.append("post_id",this.flowId),n.append("step_id",e),n.append("wcf-next-step-id","END"===t?"":t),L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(e=>(e&&e.status&&(this.setSettingsStatus({status:"SAVED"}),this.renderCb()),e)).catch(e=>{throw console.error("[ConnectionHandler] Non-offer connection AJAX error:",e),e})}validateConnection(e,t,n){const r=[],a=this.getControlId(e.id),o=this.getControlId(t.id);if("START"===a||"END"===o)return{isValid:!0,errors:[],warnings:[]};const i=this.findStep(a),s=this.findStep(o);if(!i||!s)return r.push((0,z.__)("Invalid step connection.","cartflows")),{isValid:!1,errors:r};if(a===o)return r.push((0,z.__)("Step cannot connect to itself.","cartflows")),{isValid:!1,errors:r};if(this.offerSteps.includes(i.type)){if(["landing","checkout"].includes(s.type))return r.push((0,z.__)("Offer steps can only connect to other Offer steps, Optin, or Thank You page.","cartflows")),{isValid:!1,errors:r};if(!["upsell","downsell","optin","thankyou"].includes(s.type))return r.push((0,z.__)("Offer steps can only connect to other Offer steps, Optin, or Thank You page.","cartflows")),{isValid:!1,errors:r}}const l=this.steps.map(e=>e.id);return X7.validateConnection({...e,type:i.type,id:`wcf_node_edge_${a}`},{...t,type:s.type,id:`wcf_node_edge_${o}`},n,{steps:this.steps,stepOrder:l})}createEdgeData(e,t,n){let r={...e,animated:!1,type:this.edgeType,deletable:!0,focusable:!0,selectable:!0};return n&&e.sourceHandle&&("a"===e.sourceHandle?r={...r,label:(0,z.__)("Accept","cartflows"),labelBgStyle:{fill:"#BBF7D0",border:"1px solid #d1d5db"},labelStyle:{fill:"#16A34A",fontWeight:400,fontSize:"12px"},labelBgPadding:[8,4]}:"b"===e.sourceHandle&&(r={...r,label:(0,z.__)("Reject","cartflows"),labelBgStyle:{fill:"#FEF2F2",border:"1px solid #d1d5db"},labelStyle:{fill:"#DC2626",fontWeight:400,fontSize:"12px"},labelBgPadding:[8,4]})),r}handleConnect(e){const t=this.nodes.find(t=>t.id===e.source),n=this.nodes.find(t=>t.id===e.target);if(!t||!n)return void console.error("[ConnectionHandler] Source or target node not found");const r=this.getControlId(e.source),a=this.getControlId(e.target),o="START"===r,i="END"===a,s=o?null:this.findStep(r),l=i?null:this.findStep(a);if(!(o||i||s&&l))return console.error("[ConnectionHandler] Source or target step not found"),void console.error("[ConnectionHandler] Available steps:",this.steps.map(e=>e.id));const c=this.validateConnection(t,n,e.sourceHandle);if(!c.isValid)return console.error("[ConnectionHandler] Connection validation failed:",c.errors),this.setReorderError(c.errors[0]),void setTimeout(()=>{this.setReorderError(null)},4e3);const u=s&&this.offerSteps.includes(s.type),d=e.sourceHandle,f=this.createEdgeData(e,s,u),m=i?[e.target]:this.getAllTargetNodeIds(l),p=this.extractStepId(e.source);if(m.length>1){const e=[];m.forEach((t,n)=>{const r={...f,id:`${p}-${t}-edge${d?"-"+d:""}-${n}`,target:t};e.push(r)}),this.setEdges(t=>[...t,...e])}else{f.target=m[0];const e=d2(f,this.edges);this.setEdges(e)}u&&d?(0,tW.$h)(this.updateOfferRedirection(p,d,a)):!o&&s&&(0,tW.$h)(this.updateStepConnection(p,a))}},dee=class{constructor(e,t,n,r,a){this.steps=e,this.dispatch=t,this.flowId=n,this.setSettingsStatus=r,this.renderCb=a}async handleDeletion(e){if(!q7.isConditionalEdge(e))return!1;const t=q7.extractCheckoutId(e.source),n=q7.extractStepId(e.target,this.steps);if(!t||!n)return!1;const r=this.steps.find(e=>e.id===t);if(!r||!r.conditions)return console.warn("[ConditionalEdgeHandler] Checkout step or conditions not found"),!1;const a=q7.removeConditionsForStep(r.conditions,n),o=q7.updateDefaultStep(r.default_step,n,a);return await this.saveRules(t,a,o),!0}async saveRules(e,t,n){const r=q7.buildRulesFormData(e,this.flowId,t,n);try{const e=await(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:r}));e&&e.status&&(this.setSettingsStatus({status:"SAVED"}),this.renderCb())}catch(e){console.error("[ConditionalEdgeHandler] Failed to save rules:",e)}}hasConditionalRules(e){const t=this.steps.find(t=>t.id===e);return q7.hasDynamicOffers(t)}},fee=class{constructor(e,t,n,r,a,o,i,s){this.edges=e,this.setEdges=t,this.onEdgesChangeInternal=n,this.steps=r,this.dispatch=a,this.flowId=o,this.setSettingsStatus=i,this.renderCb=s,this.conditionalHandler=new dee(r,a,o,i,s)}findRelatedEdges(e){const t=this.edges.find(t=>t.id===e);if(!t)return[];if(t.source&&t.source.startsWith("conditional-")&&t.target){const n=q7.extractStepId(t.target,this.steps);if(n){const r=this.steps.find(e=>e.id===n);if(r&&r["ab-test-variations"]&&Array.isArray(r["ab-test-variations"])&&r["ab-test-variations"].length>1){const r=this.edges.filter(r=>!(r.id===e||r.source!==t.source||!r.target)&&q7.extractStepId(r.target,this.steps)===n);return r}}}return t.data&&t.data.offerControlId?this.edges.filter(n=>n.id!==e&&n.data&&n.data.offerControlId===t.data.offerControlId):t.sourceHandle?this.edges.filter(n=>n.id!==e&&n.source===t.source&&n.sourceHandle===t.sourceHandle):[]}async handleEdgeChanges(e){const t=e.filter(e=>"remove"===e.type);if(t.length>0){const n=[];for(const e of t){const t=this.edges.find(t=>t.id===e.id);if(!t)continue;if(await this.conditionalHandler.handleDeletion(t))return;const r=this.findRelatedEdges(e.id);for(const e of r)n.push({type:"remove",id:e.id})}n.length>0&&(e=[...e,...n])}this.onEdgesChangeInternal(e)}},mee=()=>{const e=(0,b.useHistory)(),[{flow_type:t,flow_id:n}]=ZR(),r="storeCheckout"===t,[a,s]=(0,i.useState)(null),l=async({key:e,flowName:t,instantLayout:n})=>{if(!a){s(e);try{const e=await(({flowName:e,instantLayout:t})=>{const n=new window.FormData;return n.append("action","cartflows_create_flow"),n.append("security",cartflows_admin.create_flow_nonce),n.append("flow_name",e),n.append("creation_method","scratch"),n.append("instant_layout",t?"true":"false"),L()({url:cartflows_admin.ajax_url,method:"POST",body:n})})({flowName:t,instantLayout:n});if(!e?.success)return pp.error((0,z.__)("Failed to create funnel.","cartflows")),void s(null);pp.success((0,z.__)("Funnel created.","cartflows")),window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e.data.flow_id}`}catch(e){pp.error((0,z.__)("Failed to create funnel.","cartflows")),s(null)}}},c=[{key:"template",icon:hW,title:(0,z.__)("Use a template","cartflows"),description:(0,z.__)("Start with a proven layout from our template library.","cartflows"),cta:(0,z.__)("Browse templates","cartflows"),onClick:()=>{e.push({pathname:"admin.php",search:"?page=cartflows&path=library"})}},{key:"quick-checkout",icon:mZ,title:(0,z.__)("Quick checkout","cartflows"),description:(0,z.__)("Spin up a checkout funnel with Instant Layout enabled.","cartflows"),cta:(0,z.__)("Create checkout funnel","cartflows"),onClick:()=>l({key:"quick-checkout",flowName:(0,z.__)("Quick Checkout Funnel","cartflows"),instantLayout:!0})},{key:"scratch",icon:KO,title:(0,z.__)("Build from scratch","cartflows"),description:(0,z.__)("Start with an empty funnel and add steps yourself.","cartflows"),cta:(0,z.__)("Create blank funnel","cartflows"),onClick:()=>l({key:"scratch",flowName:(0,z.__)("New Funnel","cartflows"),instantLayout:!1})}],u=[{key:"store-template",icon:hW,title:(0,z.__)("Use a Store Checkout template","cartflows"),description:(0,z.__)("Start from a ready-made Store Checkout layout.","cartflows"),cta:(0,z.__)("Browse templates","cartflows"),onClick:()=>{e.push({pathname:"admin.php",search:"?page=cartflows&path=store-checkout-library"})}},{key:"store-add-step",icon:KO,title:(0,z.__)("Add a step","cartflows"),description:(0,z.__)("Pick a step type to add to this Store Checkout.","cartflows"),cta:(0,z.__)("Add step","cartflows"),onClick:()=>{e.push({pathname:"admin.php",search:`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}&tab=library`})}}],d=r?u:c,f=r?(0,z.__)("Start building your Store Checkout","cartflows"):(0,z.__)("Create your first funnel","cartflows"),m=r?(0,z.__)("Pick a starting point for this Store Checkout — you can always change things later.","cartflows"):(0,z.__)("Pick how you’d like to begin — you can always change things later.","cartflows"),p=`grid grid-cols-1 ${2===d.length?"md:grid-cols-2":"md:grid-cols-3"} gap-4`;return(0,o.createElement)(Gp,{align:"center",justify:"center",className:"wcf-canvas-empty-state w-full h-full bg-background-secondary"},(0,o.createElement)(Gp,{direction:"column",gap:"lg",className:"wcf-canvas-empty-state__panel max-w-4xl w-full mx-auto px-6 py-10"},(0,o.createElement)(Gp,{direction:"column",align:"center",gap:"xs",className:"text-center"},(0,o.createElement)($p,{tag:"h2",size:"md",title:f}),(0,o.createElement)(th,{size:16,color:"secondary"},m)),(0,o.createElement)("div",{className:p},d.map(e=>{const t=e.icon,n=a===e.key;return(0,o.createElement)(Gp,{key:e.key,direction:"column",align:"start",gap:"sm",className:"wcf-canvas-empty-state__card p-5 bg-background-primary rounded-lg border-0.5 border-solid border-border-subtle shadow-sm"},(0,o.createElement)(Gp,{align:"center",justify:"center",className:"wcf-canvas-empty-state__icon w-10 h-10 rounded-md bg-primary-50 text-primary-500"},(0,o.createElement)(t,{className:"w-5 h-5 stroke-2"})),(0,o.createElement)($p,{tag:"h3",size:"sm",title:e.title}),(0,o.createElement)(th,{size:14,color:"secondary",className:"flex-1"},e.description),(0,o.createElement)(Va,{variant:"secondary",size:"sm",loading:n,disabled:!!a&&!n,onClick:e.onClick},e.cta))}))))},pee=[{label:(0,z.__)("Open shortcuts panel","cartflows"),keys:["mod","/"]},{label:(0,z.__)("Open shortcuts panel (alt)","cartflows"),keys:["?"]},{label:(0,z.__)("Exit fullscreen","cartflows"),keys:["Esc"]},{label:(0,z.__)("Fit canvas to view","cartflows"),keys:["F"]},{label:(0,z.__)("Tidy layout","cartflows"),keys:["T"]},{label:(0,z.__)("Toggle vertical / horizontal layout","cartflows"),keys:["V"]},{label:(0,z.__)("Toggle minimap","cartflows"),keys:["M"]},{label:(0,z.__)("Toggle compact / detailed cards","cartflows"),keys:["C"]},{label:(0,z.__)("Zoom in","cartflows"),keys:["+"]},{label:(0,z.__)("Zoom out","cartflows"),keys:["−"]},{label:(0,z.__)("Duplicate selected step","cartflows"),keys:["mod","D"]},{label:(0,z.__)("Delete selected node","cartflows"),keys:["Backspace"]}],hee=({children:e})=>(0,o.createElement)("kbd",{className:"inline-flex items-center justify-center min-w-[1.75rem] h-7 px-2 text-xs font-medium text-text-primary bg-background-secondary border border-solid border-border-subtle rounded shadow-sm"},e),gee=({open:e,onClose:t})=>{const n="undefined"!=typeof navigator&&/mac|iphone|ipad|ipod/i.test(navigator.platform||"")?"⌘":"Ctrl";return(0,o.createElement)($m,{open:!!e,setOpen:e=>{e||t?.()},exitOnEsc:!0,exitOnClickOutside:!0,scrollLock:!0},(0,o.createElement)($m.Portal,null,(0,o.createElement)($m.Panel,{className:"max-w-xl gap-0"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)($m.Header,{className:"flex items-center justify-between px-6 pt-5 pb-0"},(0,o.createElement)($m.Title,null,(0,z.__)("Keyboard shortcuts","cartflows")),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)($m.Body,{className:"px-6 py-4"},(0,o.createElement)(Gp,{direction:"column",gap:"sm",className:"m-0 p-0"},pee.map((e,t)=>(0,o.createElement)(Gp,{key:t,align:"center",justify:"between",gap:"md"},(0,o.createElement)(th,{size:14,color:"primary"},e.label),(0,o.createElement)(Gp,{align:"center",gap:"xs"},e.keys.map((e,t)=>(0,o.createElement)(i.Fragment,{key:t},t>0&&(0,o.createElement)(th,{size:12,color:"tertiary"},"+"),(0,o.createElement)(hee,null,"mod"===e?n:e)))))))))))},wee="wcf_canvas_axis",yee="wcf_canvas_minimap",bee="wcf_canvas_compact",vee=()=>"vertical"===window.localStorage.getItem(wee)?"vertical":"horizontal",xee=()=>{const e=window.localStorage.getItem(yee);return null===e||"true"===e},_ee=()=>{const e=window.localStorage.getItem(bee);return null===e?null:"true"===e},Eee={custom:function(e){const{id:t,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:s,targetPosition:l,style:c={},label:u,labelStyle:d,labelBgStyle:f,data:m,markerEnd:p}=e,h=m?.edgeStyle||"smoothstep",[g,w,y]="bezier"===h?s2({sourceX:n,sourceY:r,sourcePosition:s,targetX:a,targetY:i,targetPosition:l}):g2({sourceX:n,sourceY:r,sourcePosition:s,targetX:a,targetY:i,targetPosition:l}),v=!!u,x=m?.kind;let _=24;"accept"===x||"reject"===x?_=80:("condition"===x||"default"===x)&&(_=110);const[{flow_id:E,flow_type:N}]=ZR(),M=(0,b.useHistory)(),I=e=>{if(!e)return null;if("wcf_start_node"===e||"start"===e||"wcf_end_node"===e||"end"===e)return e;if(e.includes("wcf_node_edge_")){const t=parseInt(e.replace("wcf_node_edge_",""),10);return isNaN(t)?null:t}if(e.startsWith("conditional-")){const t=parseInt(e.replace("conditional-",""),10);return isNaN(t)?null:t}if(e.startsWith("ab-group-")){const t=parseInt(e.replace("ab-group-",""),10);return isNaN(t)?null:t}return null},S=!("wcf_end_node"===e.target||"end"===e.target||e.target&&e.target.startsWith("conditional-"));return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(V5,{id:t,path:g,style:c,markerEnd:p,interactionWidth:20}),(0,o.createElement)(P3,null,(0,o.createElement)("div",{className:"nodrag nopan wcf-edge-add-button flex items-center justify-center gap-1",style:{position:"absolute",transform:`translate(-50%, -50%) translate(${w}px, ${y}px)`,pointerEvents:"all",width:_,height:v?32:24,backgroundColor:f?.fill,borderRadius:"14px",border:f?.border,padding:v?"4px 6px":"0",boxShadow:"0 1px 3px 0 rgba(0, 0, 0, 0.1)"}},v&&(0,o.createElement)("span",{style:{color:d?.fill,fontWeight:d?.fontWeight,fontSize:d?.fontSize,lineHeight:1,paddingLeft:"4px"}},u),S&&(0,o.createElement)("button",{onClick:t=>{t.stopPropagation();const n=I(e.source),r=I(e.target),a=e.sourceHandle?e.sourceHandle:"accept"===x?"a":"reject"===x?"b":null;if(null!==n&&null!==r){const e={sourceStepId:n,targetStepId:r,sourceHandle:a};window.sessionStorage.setItem("wcf_edge_insertion_context",JSON.stringify(e))}const o="storeCheckout"===N?"admin.php?page=cartflows&path=store-checkout":"admin.php?page=cartflows&path=flows",i=`&action=wcf-edit-flow&flow_id=${E}&tab=library`;M.push({pathname:o,search:i})},className:"flex items-center justify-center hover:opacity-80 transition-opacity cursor-pointer",style:{width:v?"20px":"24px",height:v?"20px":"24px",backgroundColor:v?"white":"#f3f4f6",borderRadius:"50%",border:v?"none":"1px solid #4b5563",padding:0},title:"Add new step"},(0,o.createElement)(KO,{className:"text-primary-600",style:{width:v?"14px":"16px",height:v?"14px":"16px"}})))))}},Nee={label:u8,conditional:m8,landing:L8,checkout:P8,offer:M7,thankyou:S7,optin:j7,abtest:A7,group:G7},Mee={x:0,y:150,zoom:.75},Iee=[10,10],See={padding:.2,duration:400,minZoom:.3},kee=({x:e,y:t,width:n,height:r,color:a,strokeColor:i,strokeWidth:s,borderRadius:l})=>{const c=e+n/2,u=t+r/2;return(0,o.createElement)("rect",{x:c-160,y:u-120,width:320,height:240,fill:a,stroke:i,strokeWidth:s,rx:l,ry:l})};function jee({renderCb:e}){const[{steps:t,flow_type:n,flow_id:r,flow_analytics:a,emptySteps:s},l]=ZR(),[{},c]=g(),u=(0,i.useMemo)(()=>wcfCartflowsPro()?t:t.filter(e=>"upsell"!==e.type&&"downsell"!==e.type),[t]),[d,f]=(0,i.useState)(""),[m,p]=(0,i.useState)(!1),[h,w]=(0,i.useState)(null),[y,b]=(0,i.useState)("smoothstep"),[v,x]=(0,i.useState)(!0),_=(0,i.useMemo)(()=>({deletable:!0,focusable:!0,selectable:!0,style:{stroke:"#4B5563",strokeWidth:1},markerEnd:{type:m1.ArrowClosed,width:40,height:40,color:"#f06434"},data:{edgeStyle:y}}),[y]),E=""!==d?"wcf-fullscreen":"",N=cartflows_admin.is_rtl?"RL":"LR",M={direction:"initial"},[I,S,k]=function(){const[e,t]=(0,i.useState)([]),n=(0,i.useCallback)(e=>t(t=>H4(e,t)),[]);return[e,t,n]}(),[j,D,C]=function(){const[e,t]=(0,i.useState)([]),n=(0,i.useCallback)(e=>t(t=>$4(e,t)),[]);return[e,t,n]}(),{axis:A,setAxis:T,toggleAxis:O,showMinimap:L,setShowMinimap:P,compact:R,toggleCompact:U}=(({autoCompact:e=!1}={})=>{const[t,n]=(0,i.useState)(vee),[r,a]=(0,i.useState)(xee),[o,s]=(0,i.useState)(_ee),l=(0,i.useCallback)(e=>{const t="vertical"===e?"vertical":"horizontal";window.localStorage.setItem(wee,t),n(t)},[]),c=(0,i.useCallback)(()=>{l("horizontal"===vee()?"vertical":"horizontal")},[l]),u=(0,i.useCallback)(e=>{const t=!!e;window.localStorage.setItem(yee,String(t)),a(t)},[]),d=(0,i.useCallback)(e=>{const t=!!e;window.localStorage.setItem(bee,String(t)),s(t)},[]),f=(0,i.useCallback)(()=>{d(!(null===o?e:o))},[o,e,d]);return{axis:t,setAxis:l,toggleAxis:c,showMinimap:r,setShowMinimap:u,compact:null===o?e:o,setCompact:d,toggleCompact:f}})({autoCompact:u.length>12}),[B,F]=(0,i.useState)(0),Y=(0,i.useRef)(A),Q=(0,i.useRef)(R),{fitView:V,zoomIn:W,zoomOut:Z,setCenter:G,getViewport:H}=i5(),{zoom:$}=g4(R3,f4),X=Q4("Escape"),[q,J]=(0,i.useState)(!1),[K,ee]=(0,i.useState)(0),te=()=>{c({status:"SAVED"}),F(e=>e+1),e(),setTimeout(()=>V(See),50)};(0,i.useEffect)(()=>{const e=new cee(u,n,r,a,N,A,R),t=e.build(),o=B>0?e.tidy(t.nodes,t.edges):t.nodes,i=t.edges.map(e=>({...e,data:{...e.data,edgeStyle:y}})),s=Y.current!==A;Y.current=A;const l=Q.current!==R;Q.current=R;const c=B>0||s||l;S(e=>{if(c)return o;const t=new Map(e.map(e=>[e.id,e.position]));return o.map(e=>e.id.startsWith("wcf_node_edge_")&&t.has(e.id)?{...e,position:t.get(e.id)}:e)}),D(i)},[u,n,r,a,N,A,R,B,S,D]);const ne=(0,i.useCallback)(t=>{new uee(u,n,r,I,j,D,w,l,c,e).handleConnect(t)},[u,n,r,I,j,D,l,c,e]),re=(0,i.useCallback)(t=>{new fee(j,D,C,u,l,r,c,e).handleEdgeChanges(t)},[j,D,C,u,l,r,c,e]);(0,i.useEffect)(()=>{D(e=>e.map(e=>({...e,data:{...e.data,edgeStyle:y}})))},[y,D]),(0,i.useEffect)(()=>(document.body.classList.add("wcf-flow-overview-screen"),()=>document.body.classList.remove("wcf-flow-overview-screen")),[]),(0,i.useEffect)(()=>{X&&"fullscreen"===d&&(f(""),V(See))},[X,d,V]),(0,i.useEffect)(()=>{const e=e=>{const t=e.key,n=e.target?.tagName;if("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n&&!e.target?.isContentEditable){if(e.metaKey||e.ctrlKey)return"d"===t.toLowerCase()?(e.preventDefault(),void ee(e=>e+1)):"/"===t?(e.preventDefault(),void J(e=>!e)):void 0;if(e.altKey||e.shiftKey)"?"===t&&(e.preventDefault(),J(e=>!e));else switch(t.toLowerCase()){case"f":e.preventDefault(),V(See);break;case"t":e.preventDefault(),te();break;case"v":e.preventDefault(),O(),setTimeout(()=>V(See),50);break;case"m":e.preventDefault(),P(!L);break;case"c":e.preventDefault(),U(),setTimeout(()=>V(See),50);break;case"+":case"=":e.preventDefault(),W({duration:200});break;case"-":e.preventDefault(),Z({duration:200})}}};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[V,W,Z,O,U,L,P]),(0,i.useEffect)(()=>{if(!K)return;const e=I.find(e=>e.selected&&e.id?.startsWith("wcf_node_edge_"));if(!e)return;const t=e.data?.step_id;if(!t)return;const n=!!e.data?.isABTestVariation;O8.cloneStepRequest({stepId:t,flowId:e.data?.flow_id||r,action:n?"cartflows_clone_ab_test_step":"cartflows_clone_step",controlId:e.data?.control_id}).then(e=>{!1!==e?.success&&window.location.reload()})},[K,I,r]);const ae=()=>{f("fullscreen"),p(!0),setTimeout(()=>{p(!1)},3e3),V(See)},oe=()=>{f(""),V(See)};return u.length<=0?(0,o.createElement)("div",{className:`wcf-steps-chart wcf-steps-chart--empty flex w-full h-screen items-center justify-center ${E}`,style:M},s?(0,o.createElement)(mee,null):(0,o.createElement)(LO,{variant:"primary",size:"lg"})):(0,o.createElement)("div",{className:`wcf-steps-chart flex justify-center mx-auto h-screen w-full ${E}`,style:M},I.length>0&&(0,o.createElement)(L3,{minZoom:.3,maxZoom:1,nodes:I,edges:j,edgeTypes:Eee,colorMode:"light",onNodesChange:k,onEdgesChange:re,onConnect:ne,nodeTypes:Nee,snapToGrid:!0,snapGrid:Iee,defaultViewport:Mee,onInit:e=>{e.fitView(See)},zoomOnScroll:!1,panOnScroll:!0,panOnScrollMode:"free",elementsSelectable:v,preventScrolling:!1,nodesDraggable:v,nodesConnectable:v,edgesFocusable:!0,reconnectRadius:20,elevateEdgesOnSelect:!0,edgesUpdatable:!1,deleteKeyCode:"Backspace",defaultEdgeOptions:_},(0,o.createElement)(W3,{variant:"dots",gap:16,size:1,color:"#d1d5db"}),L&&(0,o.createElement)(l8,{pannable:!0,zoomable:!0,position:cartflows_admin.is_rtl?"bottom-left":"bottom-right",bgColor:"#ffffff",nodeColor:"#ffedd5",nodeStrokeColor:"#fdba74",nodeStrokeWidth:1,nodeBorderRadius:3,nodeComponent:kee,maskColor:"rgba(240, 100, 52, 0.04)",maskStrokeColor:"#fdba74",maskStrokeWidth:.5,onClick:(e,t)=>{G(t.x,t.y,{zoom:H().zoom,duration:400})},style:{width:160,height:100,border:"1px solid #ffedd5",borderRadius:"6px",boxShadow:"0 2px 8px rgba(240, 100, 52, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04)"}}),(0,o.createElement)(I4,{position:"top-right",className:"flex flex-col items-end gap-2"},(0,o.createElement)("div",{className:"inline-flex items-center gap-0.5 bg-background-primary border border-solid border-border-subtle rounded-md p-1 shadow-sm"},(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:(0,z.__)("Vertical Layout","cartflows"),placement:"left"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,o.createElement)(Kq,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,z.__)("Vertical Layout","cartflows"),onClick:()=>{"vertical"!==A&&(T("vertical"),setTimeout(()=>V(See),50))}})),(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:(0,z.__)("Horizontal Layout","cartflows"),placement:"left"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,o.createElement)(eJ,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,z.__)("Horizontal Layout","cartflows"),onClick:()=>{"horizontal"!==A&&(T("horizontal"),setTimeout(()=>V(See),50))}}))),(0,o.createElement)("div",{className:"inline-flex flex-col items-center gap-0.5 bg-background-primary border border-solid border-border-subtle rounded-md p-1 shadow-sm"},(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:v?(0,z.__)("Lock Interaction","cartflows"):(0,z.__)("Unlock Interaction","cartflows"),placement:"left"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"hidden hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:v?(0,o.createElement)(tJ,{className:"!fill-[none] stroke-[1.5]"}):(0,o.createElement)(nJ,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":v?(0,z.__)("Lock Interaction","cartflows"):(0,z.__)("Unlock Interaction","cartflows"),onClick:()=>x(!v)})),(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:"smoothstep"===y?(0,z.__)("Switch to Wavy Edges","cartflows"):(0,z.__)("Switch to Smooth Edges","cartflows"),placement:"left"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:"smoothstep"===y?(0,o.createElement)(rJ,{className:"!fill-[none] stroke-[1.5]"}):(0,o.createElement)(aJ,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,z.__)("Edge Style","cartflows"),onClick:()=>{b(e=>"smoothstep"===e?"bezier":"smoothstep")}})),(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:(0,z.__)("Tidy Layout","cartflows"),placement:"left"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,o.createElement)(oJ,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,z.__)("Tidy Layout","cartflows"),onClick:te})),(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:(0,z.__)("Fit View","cartflows"),placement:"left"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"hidden hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,o.createElement)(iJ,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,z.__)("Fit View","cartflows"),onClick:()=>V(See)})),(()=>{const e="fullscreen"===d;return(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:e?(0,z.__)("Exit Full Screen","cartflows"):(0,z.__)("Full Screen","cartflows"),placement:"left"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:e?(0,o.createElement)(qq,{className:"!fill-[none] stroke-[1.5]"}):(0,o.createElement)(Jq,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":e?(0,z.__)("Exit Full Screen","cartflows"):(0,z.__)("Full Screen","cartflows"),onClick:e?oe:ae}))})(),(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:(0,z.__)("Keyboard Shortcuts (?)","cartflows"),placement:"left"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,o.createElement)(sJ,{className:"!fill-[none] stroke-[1.5]"}),"aria-label":(0,z.__)("Keyboard Shortcuts","cartflows"),onClick:()=>J(!0)})))),(0,o.createElement)(I4,{position:"bottom-left"},(0,o.createElement)("div",{className:"inline-flex items-center gap-0.5 bg-background-primary border border-solid border-border-subtle rounded-md p-1 shadow-sm"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",onClick:()=>V(See)},(0,z.__)("Fit","cartflows")),(0,o.createElement)("div",{className:"w-px h-4 bg-border-subtle","aria-hidden":"true"}),(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,o.createElement)(dO,{className:"stroke-[1.5]"}),"aria-label":(0,z.__)("Zoom Out","cartflows"),onClick:()=>Z({duration:200})}),(0,o.createElement)(th,{size:12,weight:600,className:"tabular-nums min-w-[44px] text-center"},Math.round(100*$),"%"),(0,o.createElement)(Va,{variant:"ghost",size:"xs",className:"hover:bg-badge-hover-gray hover:text-text-primary focus:ring-1 focus:ring-offset-0",icon:(0,o.createElement)(LW,{className:"stroke-[1.5]"}),"aria-label":(0,z.__)("Zoom In","cartflows"),onClick:()=>W({duration:200})}))),m&&(0,o.createElement)(I4,{position:"top-center",className:"wcf-steps-chart__exit-screen-msg"},(0,z.__)("Press ESC to exit full screen.","cartflows")),h&&(0,o.createElement)(I4,{position:"top-center",className:"wcf-steps-chart__error-msg"},h)),(0,o.createElement)(gee,{open:q,onClose:()=>J(!1)}))}const Dee=function(e){return(0,o.createElement)(A3,null,(0,o.createElement)(jee,e))},Cee=function({renderCb:e}){return(0,o.createElement)("div",{className:"wcf-steps-page-wrapper border-t border-border-subtle -mt-px"},(0,o.createElement)(Dee,{renderCb:e}))};function Aee({title:e,titleId:t,...n},r){return i.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M16.28 11.47a.75.75 0 0 1 0 1.06l-7.5 7.5a.75.75 0 0 1-1.06-1.06L14.69 12 7.72 5.03a.75.75 0 0 1 1.06-1.06l7.5 7.5Z",clipRule:"evenodd"}))}const Tee=i.forwardRef(Aee),Oee=e=>{var t;const{steps:n}=e,[r,a]=(0,i.useState)(""),[s,l]=(0,i.useState)(""),[{flow_id:c,flow_title:u,flow_type:d},f]=ZR(),m=(0,b.useHistory)(),p=null!==(t=new URLSearchParams((0,b.useLocation)()?.search).get("automation"))&&void 0!==t?t:"";(0,i.useEffect)(()=>{const e=n.find(e=>e.id===parseInt(p));e&&(a(e.title),l(e.type))},[p,n]);return(0,i.useEffect)(()=>{r&&(()=>{const e=new window.FormData;e.append("action","cartflows_get_suretriggers_data"),e.append("security",cartflows_admin.get_suretriggers_data_nonce),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e&&e?.success&&e?.data?.connected&&(e=>{if(e&&u){let t=[];switch(s){case"upsell":t=["cartflows_upsell_offer_accepted","cartflows_upsell_offer_rejected","cartflows_upsell_offer_skipped"];break;case"checkout":t=["wcf_order_bump_item_added","wcf_order_bump_item_removed","wcf_pre_checkout_offer_item_added","wcf_order_bump_item_replaced"];break;case"downsell":t=["cartflows_downsell_offer_accepted","cartflows_downsell_offer_rejected","cartflows_downsell_offer_skipped"]}e.embedded_identifier=p,t&&t.length>0&&(e.allowed_events={CartFlows:{triggers:t}}),e.selected_options={funnel_id:{value:c,label:u},funnel_step_id:{value:p,label:r}},f({type:"SET_SURETRIGGERS_CONFIG",config:e})}})(e?.data?.data)})})()},[r]),(0,o.createElement)(xq,{open:""!==p,setOpen:e=>{e||m.push("storeCheckout"===d?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${c}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${c}`)},position:"right",exitOnClickOutside:!0,exitOnEsc:!1,className:"wcf-funnel-step-setting--slide-out"},(0,o.createElement)(xq.Panel,{className:"pointer-events-auto w-screen max-w-4.5xl relative top-1"},(0,o.createElement)(xq.Backdrop,null),(0,o.createElement)("div",{className:"wcf-slide-out-panel--close bg-background-primary absolute -left-10"},(0,o.createElement)(C,{key:"close",to:{pathname:"admin.php",search:"storeCheckout"===d?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${c}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${c}`},className:"flex justify-center items-center p-2.5 text-text-tertiary hover:text-text-secondary outline-none focus:outline-none shadow-none focus:shadow-none"},(0,o.createElement)("button",{type:"button",onClick:()=>{a("")}},(0,o.createElement)(tL,{className:"w-5 h-5","aria-hidden":"true"})))),(0,o.createElement)(xq.Body,{className:"wcf-slide-out-panel--content-body flex h-full flex-col overflow-y-scroll bg-background-primary shadow-xl !p-0"},!1,(0,o.createElement)("form",null,(0,o.createElement)(xq.Header,{className:"wcf-slide-out-panel--header flex justify-between px-6 py-5 !space-y-0"},(0,o.createElement)("div",{className:"wcf-slide-out-panel--step-title"},(0,o.createElement)(xq.Title,{className:"text-lg font-medium text-text-primary"},(0,z.__)("Automation for","cartflows"),":"," ",r))),(0,o.createElement)("div",{className:"wcf-slide-out-panel--settings flex-1 p-8 border-t border-border-subtle px-6"},(0,o.createElement)("div",{id:"suretriggers-iframe-wrapper",style:{width:"100%",height:"80vh"}}))))))},Lee=a.p+"images/abtest_bg.b54fd7f7.png",zee=({visibility:e,setVisibility:t})=>(0,o.createElement)($m,{open:"show"===e,setOpen:e=>{e||t("hide")},exitOnClickOutside:!0},(0,o.createElement)($m.Panel,{className:"sm:max-w-lg w-full"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)($m.Header,{className:"flex items-center justify-between !space-y-0"},(0,o.createElement)($m.Title,null,(0,z.__)("A/B Testing","cartflows"),(0,o.createElement)("span",{className:"ml-2 inline-flex align-middle"},(0,o.createElement)(Ym,null))),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)($m.Body,null,(0,o.createElement)("img",{src:Lee,alt:"Abtest",className:"w-full p-5 bg-background-secondary rounded-lg box-border"}),(0,o.createElement)("div",{className:"mt-5 text-sm"},(0,z.__)("Optimize your sales with A/B testing in CartFlows! Experiment with product pricing, page layouts, messaging, and design. Create variants, analyze results, and discover new ways to boost revenue.","cartflows"))),(0,o.createElement)($m.Footer,{className:"bg-brand-25"},(0,o.createElement)(Va,{tag:"a",href:getUpgradeToProUrl(),target:"blank",variant:"primary",className:"w-full no-underline text-center text-sm"},(0,z.__)("Upgrade to Pro","cartflows"))))),Pee=function({flowId:e,flowType:t,showConnectorLines:n=!0,tooltipPlacement:r="right"}){const a="storeCheckout"===t?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e}&tab=library`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e}&tab=library`;return(0,o.createElement)("div",{className:"wcf-add-step-connector flex flex-col items-center"},n&&(0,o.createElement)("div",{className:"w-px h-4 bg-background-secondary"}),(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:(0,z.__)("Add New Step","cartflows"),placement:r},(0,o.createElement)(C,{to:{pathname:"admin.php",search:a},className:"wcf-add--new-step-connector inline-flex items-center justify-center w-7 h-7 rounded-full border border-solid border-border-subtle bg-background-primary hover:shadow-md hover:bg-background-secondary no-underline"},(0,o.createElement)(KO,{className:"w-3.5 h-3.5 stroke-2 text-text-secondary","aria-hidden":"true"}))),n&&(0,o.createElement)("div",{className:"w-px h-4 bg-background-secondary"}))},Ree=Ua("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),Uee=function({fromDate:e,toDate:t,onBack:n,onDateChange:r}){return(0,o.createElement)(Gp,{containerType:"flex",justify:"between",align:"center",gap:"none",className:"mt-0 mb-6 cursor-pointer"},(0,o.createElement)(Gp,{containerType:"flex",align:"center",gap:"sm"},(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:(0,z.__)("Back to Steps","cartflows"),placement:"top"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",onClick:n,className:"text-text-secondary hover:text-text-primary"},(0,o.createElement)(Ree,{className:"w-5 h-5 !cursor-pointer",strokeWidth:2}))),(0,o.createElement)($p,{tag:"h3",size:"sm",title:(0,z.__)("Analytics","cartflows")})),(0,o.createElement)(TY,{value:{startDate:e,endDate:t},onChangeCB:r,fieldParentWrapperClass:""}))},Bee=Ua("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),Fee=Ua("CircleDollarSign",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]),Yee=Ua("Banknote",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M6 12h.01M18 12h.01",key:"113zkx"}]]),Qee=Ua("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]),Vee=Ua("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]),Wee=Ua("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]),Zee=function({label:e,tooltip:t,value:n,icon:r}){return(0,o.createElement)("div",{className:"bg-[rgba(254, 248, 245, 0.35)] border border-solid border-brand-100 rounded-lg p-5 flex flex-col justify-between gap-3"},(0,o.createElement)("div",{className:"flex items-center justify-between"},(0,o.createElement)("div",{className:"flex items-center gap-1"},(0,o.createElement)(th,{as:"span",size:14,weight:400,color:"primary"},e),t&&(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:t,placement:"top"},(0,o.createElement)(Ba,{className:"w-3.5 h-3.5 text-text-tertiary cursor-help flex-shrink-0",strokeWidth:2}))),(0,o.createElement)("div",{className:"flex items-center p-2 rounded-lg bg-brand-25 border border-solid border-brand-100"},r)),(0,o.createElement)(th,{as:"div",size:24,weight:600,color:"primary"},null!=n?n:0))},Gee={className:"w-5 h-5 text-brand-500",strokeWidth:1.5},Hee=e=>e?fh(e.toString()):0,$ee=function({revenue:e,totalVisitors:t,loading:n}){var r;const a=[[(0,z.__)("Total Visitors","cartflows"),(0,z.__)("Sum of all step views in this funnel.","cartflows"),t,Bee],[(0,z.__)("Total Orders","cartflows"),(0,z.__)("Total number of orders.","cartflows"),null!==(r=e?.order_count)&&void 0!==r?r:0,L7],[(0,z.__)("Total Revenue","cartflows"),(0,z.__)("Grand total of all orders.","cartflows"),Hee(e?.gross_sale),Fee],[(0,z.__)("Average Order Value","cartflows"),(0,z.__)("Average total of every order.","cartflows"),Hee(e?.avg_order_value),Yee],[(0,z.__)("Bump Offer Revenue","cartflows"),(0,z.__)("Grand total of all order bumps.","cartflows"),Hee(e?.bump_offer),Qee],[(0,z.__)("Offers Revenue","cartflows"),(0,z.__)("Total upsell/downsell revenue.","cartflows"),Hee(e?.upsell_revenue),L7],[(0,z.__)("Revenue Per Visit","cartflows"),(0,z.__)("Revenue per visit.","cartflows"),Hee(e?.revenue_per_visit),Vee],[(0,z.__)("RPUV","cartflows"),(0,z.__)("Revenue per unique visitor.","cartflows"),Hee(e?.revenue_per_unique_visits),Wee]];return(0,o.createElement)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6"+(n?" opacity-50 pointer-events-none":"")},a.map(([e,t,n,r])=>(0,o.createElement)(Zee,{key:e,label:e,tooltip:t,value:n,icon:(0,o.createElement)(r,Gee)})))},Xee=[(0,z.__)("Step","cartflows"),(0,z.__)("Total Visits","cartflows"),(0,z.__)("Unique Visits","cartflows"),(0,z.__)("Conversions","cartflows"),(0,z.__)("Conversion rate","cartflows"),(0,z.__)("Revenue","cartflows")],qee=({children:e})=>(0,o.createElement)(th,{as:"span",size:14,weight:500,color:"primary"},e),Jee=({cells:e,rowKey:t})=>e.map((e,n)=>(0,o.createElement)(FQ.Cell,{key:`${t}-c-${n}`},e)),Kee=({rowKey:e,label:t,cells:n,rowClass:r=""})=>(0,o.createElement)(FQ.Row,{className:r},(0,o.createElement)(FQ.Cell,null,t),(0,o.createElement)(Jee,{cells:n,rowKey:e})),ete=({rowKey:e,data:t})=>{var n;return(0,o.createElement)(Kee,{rowKey:e,label:(0,o.createElement)(qee,null,null!==(n=t.visits?.title)&&void 0!==n?n:""),cells:HG(t.visits,t.type)})},tte=({rowKey:e,data:t,isExpanded:n,onToggle:r})=>{var a;const i=n?hm:bU;return(0,o.createElement)(Kee,{rowKey:e,label:(0,o.createElement)("button",{type:"button",className:"flex items-center gap-2 bg-transparent border-0 p-0 cursor-pointer",onClick:r,"aria-expanded":n,"aria-label":n?(0,z.__)("Collapse variations","cartflows"):(0,z.__)("Expand variations","cartflows")},(0,o.createElement)(i,{className:"w-4 h-4 text-text-tertiary",strokeWidth:2}),(0,o.createElement)(qee,null,null!==(a=t.visits?.title)&&void 0!==a?a:"")),cells:HG(t.visits,t.type)})},nte=({rowKey:e,data:t,stepId:n,variation:r,vIdx:a})=>{const i=ZG(n,t.id,a);return(0,o.createElement)(Kee,{rowKey:e,rowClass:"bg-background-secondary",label:(0,o.createElement)("div",{className:"flex items-center gap-2 pl-6"},(0,o.createElement)(qee,null,r?.title||"-"),(0,o.createElement)(Yf,{label:i.label,size:"xs",variant:i.variant,type:"rounded",disableHover:!0})),cells:HG(r,t.type,!0)})},rte=({rowKey:e,data:t,variation:n})=>(0,o.createElement)(Kee,{rowKey:e,rowClass:"bg-background-secondary",label:(0,o.createElement)("div",{className:"flex items-center gap-2 pl-6"},(0,o.createElement)(qee,null,n?.title||"-"),n?.archived_date&&(0,o.createElement)(Yf,{label:n.archived_date,size:"xs",variant:"inverse",type:"rounded",disableHover:!0})),cells:HG(n,t.type,!0)}),ate=()=>(0,o.createElement)(FQ.Row,null,(0,o.createElement)(FQ.Cell,null,(0,o.createElement)(th,{as:"span",size:14,color:"secondary"},(0,z.__)("No analytics data available yet.","cartflows"))),Array(Xee.length-1).fill("-").map((e,t)=>(0,o.createElement)(FQ.Cell,{key:t},e))),ote=function({allSteps:e}){const[t,n]=BG(),r=e?.length?e.flatMap((e,r)=>((e,t,n,r)=>{const a=e.id||`step-${t}`,{variations:i,archived:s,isAbStep:l}=WG(e);if(!l)return[(0,o.createElement)(ete,{key:a,rowKey:a,data:e})];const c=n.has(a),u=[(0,o.createElement)(tte,{key:a,rowKey:a,data:e,isExpanded:c,onToggle:()=>r(a)})];return c?(i.forEach(([t,n],r)=>{const i=`${a}-ab-${t}`;u.push((0,o.createElement)(nte,{key:i,rowKey:i,data:e,stepId:t,variation:n,vIdx:r}))}),s.forEach(([t,n])=>{const r=`${a}-arc-${t}`;u.push((0,o.createElement)(rte,{key:r,rowKey:r,data:e,variation:n}))}),u):u})(e,r,t,n)):(0,o.createElement)(ate,null);return(0,o.createElement)("div",{className:"bg-background-primary border border-border-subtle rounded-lg overflow-hidden mb-6"},(0,o.createElement)(FQ,null,(0,o.createElement)(FQ.Head,null,Xee.map(e=>(0,o.createElement)(FQ.HeadCell,{key:e},e))),(0,o.createElement)(FQ.Body,null,r)))},ite=Ua("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),ste=function({onReset:e,isResetting:t}){return(0,o.createElement)(Gp,{containerType:"flex",justify:"between",align:"center",gap:"none"},(0,o.createElement)(th,{as:"p",size:13,color:"secondary",className:"m-0"},(0,o.createElement)(th,{as:"span",size:13,weight:500,className:"text-brand-500"},(0,z.__)("Note:","cartflows"))," ",(0,z.__)("The orders which are placed by the admins are not considered while calculating the analytics.","cartflows")),(0,o.createElement)(Va,{variant:"outline",size:"sm",onClick:e,loading:t,disabled:t,icon:(0,o.createElement)(ite,{className:"w-4 h-4"+(t?" animate-spin":""),strokeWidth:2}),iconPosition:"left"},t?(0,z.__)("Resetting","cartflows"):(0,z.__)("Reset Analytics","cartflows")))},lte=function({onBack:e}){const[{flow_analytics:t,flow_id:n},r]=ZR(),a=new Date,s=new Date;s.setDate(a.getDate()-7);const[l,c]=(0,i.useState)(s),[u,d]=(0,i.useState)(a),[f,m]=(0,i.useState)(!1),[p,h]=(0,i.useState)(!1),g=t?.revenue,w=t?.all_steps,y=w?.reduce((e,t)=>e+(Number(t.visits?.total_visits)||0),0)||0;return(0,o.createElement)("div",{className:"wcf-steps-analytics bg-background-primary p-6 shadow-sm border border-border-subtle border-solid rounded-lg"},(0,o.createElement)(Uee,{fromDate:l,toDate:u,onBack:e,onDateChange:({startDate:e,endDate:t})=>{if(c(e),d(t),!e||!t)return;m(!0);const a=new window.FormData;a.append("action","cartflows_pro_set_visit_data"),a.append("security",cartflows_admin.set_visit_data_nonce),a.append("flow_id",n),a.append("date_from",Th(e)),a.append("date_to",Th(t)),L()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then(e=>{m(!1),r({type:"SET_FLOW_ANALYTICS",flow_analytics:e})})}}),(0,o.createElement)($ee,{revenue:g,totalVisitors:y,loading:f}),(0,o.createElement)(ote,{allSteps:w}),(0,o.createElement)(ste,{onReset:()=>{h(!0);const e=new window.FormData;e.append("action","cartflows_pro_reset_flow_analytics"),e.append("security",cartflows_admin.reset_flow_analytics_nonce),e.append("flow_id",n),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(()=>{h(!1),window.location.reload()})},isResetting:p}))},cte=Ua("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),ute=function(){const[{flow_analytics:e}]=ZR(),[{license_status:t}]=g();if(e)return null;let n,r,a,i;return"function"==typeof wcfCartflowsPro&&wcfCartflowsPro()&&"Activated"!==t?(n=(0,z.__)("Activate your license to unlock analytics","cartflows"),r=(0,z.__)("Your CartFlows Pro license isn't active yet. Activate it to see views, conversions, and revenue per step.","cartflows"),a=(0,z.__)("Activate License","cartflows"),i=cartflows_admin?.license_popup_url):(n=(0,z.__)("See Every Step's Performance:","cartflows"),r=(0,z.__)("Know exactly which steps win and which lose. Upgrade to Pro and track views, conversions, and revenue per step.","cartflows"),a=(0,z.__)("Upgrade to Pro","cartflows"),i=getUpgradeToProUrl()),(0,o.createElement)("div",{className:"wcf-pro-nudge--notice flex justify-center mb-5"},(0,o.createElement)("div",{className:"wcf-pro-nudge--notice-columns flex items-center justify-between w-full border border-brand-200 border-solid p-3 rounded-lg bg-brand-25 gap-3"},(0,o.createElement)("div",{className:"wcf-pro-nudge--notice-column-left flex items-center gap-3 min-w-0"},(0,o.createElement)("div",{className:"flex p-1 border border-solid border-brand-200 rounded-md"},(0,o.createElement)(cte,{className:"text-brand-500 h-4 w-4"})),(0,o.createElement)("div",{className:"flex min-w-0"},(0,o.createElement)("span",{className:"text-text-primary text-sm font-semibold mr-0.5"},n),(0,o.createElement)(th,{as:"span",size:14,color:"secondary",className:"truncate"},r),(0,o.createElement)(Va,{tag:"a",href:i,target:"_blank",rel:"noreferrer",variant:"link",size:"sm",icon:(0,o.createElement)(im,null),iconPosition:"right",className:"no-underline !text-sm focus:outline-none focus:ring-0"},a)))))},dte=function(e){const{type:t}=e,[{flow_id:n,title:r,steps:a,global_checkout:s,status:l},c]=ZR(),[u,d]=(0,i.useState)(!1),f=(0,z.__)("Save","cartflows"),[m,p]=(0,i.useState)({saveBtnString:f,saveBtnProcess:!1}),{saveBtnString:h,saveBtnProcess:g}=m,w=!!Number.isInteger(s),y=Number.isInteger(s)?"disable":"enable",[b,v]=((0,z.__)("Disable Store Checkout","cartflows"),(0,z.__)("Enable Store Checkout","cartflows"),(0,i.useState)(l||"draft")),[x,_]=(0,i.useState)(w),[E,N]=(0,i.useState)(!1),[M,I]=(0,i.useState)(y),S=(0,i.createRef)(),k=$V();let j="";if("storeCheckout"===t)for(let e=0;e<a.length;e++)if("checkout"===a[e].type){j=a[e].id;break}(0,i.useEffect)(()=>{v(l||"draft")},[l]);const D=function(e){e.preventDefault(),d(!0)},C=function(e){e.preventDefault(),p({saveBtnString:(0,z.__)("Saving…","cartflows"),saveBtnProcess:"processing"});const t=S.current.value,r=new window.FormData;r.append("action","cartflows_update_flow_title"),r.append("security",cartflows_admin.update_flow_title_nonce),r.append("flow_id",n),r.append("new_flow_title",t),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{c({type:"SET_FLOW_TITLE",title:t}),p({saveBtnString:(0,z.__)("Saved","cartflows"),saveBtnProcess:"saved"}),pp.success((0,z.__)("Funnel title updated successfully!","cartflows")),setTimeout(()=>{p({saveBtnString:f,saveBtnProcess:!1}),d(!1)},3e3)})},A=function(e){e.preventDefault(),d(!1)};if(!1===r)return(0,o.createElement)("div",{className:"wcf-edit-flow__title-wrap animate-pulse"},(0,o.createElement)("div",{className:"wcf-flows-header--title wcf-step__title--editable flex gap-2.5 items-center"},(0,o.createElement)("span",{className:"h-3 w-full bg-background-secondary rounded-md px-10 block"})));const T=[{value:"draft",label:(0,z.__)("Draft","cartflows")},{value:"publish",label:(0,z.__)("Publish","cartflows")}];return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-edit-flow__title-wrap w-full"},(0,o.createElement)("div",{className:"wcf-flows-header--title wcf-step__title--editable flex gap-2.5 items-center"},function(){let e=r;""===r&&(e=(0,z.__)("(no title)","cartflows"));let t=Ch(e,cartflows_admin.title_length.max,cartflows_admin.title_length.display_length),n=(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:(0,z.__)("Edit Title","cartflows"),placement:"top"},(0,o.createElement)(Va,{variant:"ghost",size:"md",className:"wcf-flows-header__title--edit",onClick:D,icon:(0,o.createElement)(Wq,{className:"w-5.5 h-5.5 stroke-1","aria-hidden":"true"})}));if(u){t=(0,o.createElement)(dp,{ref:S,id:"new-flow-title",defaultValue:r,autoComplete:"off",size:"sm",className:"wcf-flow-title-input [&>input]:!py-1.5"});let e=null;"processing"===g?e=(0,o.createElement)(LO,{variant:"primary",size:"sm"}):"saved"===g&&(e=(0,o.createElement)(qO,{className:"w-4 h-4 stroke-2"})),n=(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"primary",size:"sm",className:"!py-1.5",onClick:C,disabled:"processing"===g,icon:e,iconPosition:"left"},h),(0,o.createElement)(Va,{variant:"outline",size:"sm",className:"!py-1.5",onClick:A},(0,z.__)("Cancel","cartflows")))}return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("span",{className:"wcf-flows-header__title--text text-text-primary text-lg sm:text-2xl font-semibold",title:e},t),(0,o.createElement)("span",{className:"wcf-flows-header__title--buttons flex gap-3"},n))}(),"flows"===t&&!u&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("span",{className:"divider h-5 w-px bg-background-secondary"}),(0,o.createElement)("div",{className:"wcf-status-toggle inline-flex items-center border border-solid border-border-subtle p-1 rounded-3xl"},T.map(e=>(0,o.createElement)("button",{key:`status-${e.value}`,type:"button",className:"wcf-status-toggle__btn inline-flex items-center gap-1 px-3 py-1 text-sm cursor-pointer border-0 "+(e.value===b?"font-medium text-text-primary bg-background-primary rounded-3xl shadow-sm":"font-normal text-text-secondary bg-transparent hover:text-text-primary"),onClick:t=>{e.value!==b&&async function(e){e.preventDefault();let t=!1,r="";switch(b){case"draft":case"private":t=await k({title:"Publish Funnel",description:(0,z.__)("Do you really want to publish this funnel?","cartflows"),actionBtnText:(0,z.__)("Publish","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")}),r="publish",window.wcfAction="restoreFlow";break;case"publish":t=await k({title:(0,z.__)("Draft Funnel","cartflows"),description:(0,z.__)("Do you really want to draft this funnel?","cartflows"),actionBtnText:(0,z.__)("Switch to Draft","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")}),r="draft",window.wcfAction="draftFlow"}if(!t)return;const a=new window.FormData;a.append("action","cartflows_update_status"),a.append("security",cartflows_admin.update_status_nonce),a.append("flow_id",n),a.append("new_status",r),(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:a}).then(e=>{e.success&&(v(r),pp.success("publish"===r?(0,z.__)("Funnel published!","cartflows"):(0,z.__)("Funnel moved to draft!","cartflows")))}))}(t)}},e.value===b&&(0,o.createElement)(qO,{className:"w-4 h-4 stroke-2"}),e.label)))),"storeCheckout"===t&&!u&&(0,o.createElement)("div",{className:"wcf-store-checkout_status--container flex items-center gap-4"},(0,o.createElement)("span",{className:"divider w-px h-5 bg-background-secondary"}),(0,o.createElement)(bO,{value:x,onChange:()=>(()=>{const e=new window.FormData;N(!0),e.append("action","cartflows_update_store_checkout_status"),e.append("security",cartflows_admin.update_store_checkout_status_nonce),e.append("checkout_id",j),e.append("enable_store_checkout",!x),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e.success&&(_(!x),N(!1),c({type:"SET_GLOBAL_CHECKOUT",global_checkout:e.data.checkout_id}),"enable"===M?(I("disable"),pp.success((0,z.__)("Store Checkout enabled!","cartflows"))):(I("enable"),pp.success((0,z.__)("Store Checkout disabled!","cartflows"))))})})(),size:"sm",label:{heading:(0,z.__)("Enable Store Checkout","cartflows")}}),E&&(0,o.createElement)(LO,{variant:"primary",size:"sm"})))))};function fte({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.098 19.902a3.75 3.75 0 0 0 5.304 0l6.401-6.402M6.75 21A3.75 3.75 0 0 1 3 17.25V4.125C3 3.504 3.504 3 4.125 3h5.25c.621 0 1.125.504 1.125 1.125v4.072M6.75 21a3.75 3.75 0 0 0 3.75-3.75V8.197M6.75 21h13.125c.621 0 1.125-.504 1.125-1.125v-5.25c0-.621-.504-1.125-1.125-1.125h-4.072M10.5 8.197l2.88-2.88c.438-.439 1.15-.439 1.59 0l3.712 3.713c.44.44.44 1.152 0 1.59l-2.879 2.88M6.75 17.25h.008v.008H6.75v-.008Z"}))}const mte=i.forwardRef(fte);function pte({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"}))}const hte=i.forwardRef(pte),gte=function(){return(0,o.createElement)("div",{className:"wcf-flow-settings-view flex gap-6 items-start w-full"},(0,o.createElement)("div",{className:"wcf-flow-settings--sidebar h-full min-h-screen flex flex-col w-auto sticky top-0 lg:top-4 sidebar after:content-[''] after:fixed after:left-0 after:top-0 after:w-16 lg:after:w-[254px] after:h-screen after:bg-background-primary after:-z-10"},(0,o.createElement)("div",{className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow bg-background-primary border-0 border-r border-solid border-border-subtle"},(0,o.createElement)("div",{className:"flex flex-col gap-0.5 pt-2"},["w-28","w-24","w-20"].map((e,t)=>(0,o.createElement)("div",{key:t,className:"flex items-center gap-2.5 px-3 py-2 lg:justify-start justify-center"},(0,o.createElement)(cO,{className:"w-5 h-5 rounded"}),(0,o.createElement)(cO,{className:`h-3 ${e} lg:block hidden`})))))),(0,o.createElement)("div",{className:"min-w-0 max-w-3xl p-8 mx-auto w-full flex flex-col gap-3"},(0,o.createElement)("div",{className:"flex items-center gap-2 py-1"},(0,o.createElement)(cO,{className:"w-14 h-2.5"}),(0,o.createElement)(cO,{className:"w-2 h-2.5"}),(0,o.createElement)(cO,{className:"w-20 h-2.5"}),(0,o.createElement)(cO,{className:"w-2 h-2.5"}),(0,o.createElement)(cO,{className:"w-28 h-2.5"})),(0,o.createElement)("div",{className:"flex justify-between items-center h-10"},(0,o.createElement)("div",{className:"flex items-center gap-2.5"},(0,o.createElement)(cO,{className:"w-5 h-5 rounded"}),(0,o.createElement)(cO,{className:"w-40 h-5"})),(0,o.createElement)(cO,{className:"w-28 h-9 rounded-lg"})),(0,o.createElement)("div",{className:"bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm overflow-hidden mb-8 p-6 flex flex-col gap-5"},(0,o.createElement)(cO,{className:"w-32 h-4"}),["w-28","w-36","w-24","w-32"].map((e,t)=>(0,o.createElement)("div",{key:t,className:"flex flex-col gap-2"},(0,o.createElement)(cO,{className:`${e} h-3.5`}),(0,o.createElement)(cO,{className:"w-full h-10 rounded-md"}))))))},wte=function({menuItems:e,currentTab:t,onTabChange:n}){return(0,o.createElement)("div",{className:"wcf-flow-settings--sidebar h-full min-h-screen flex flex-col w-auto sticky top-0 lg:top-4 sidebar after:content-[''] after:fixed after:left-0 after:top-0 after:w-16 lg:after:w-[254px] after:h-screen after:bg-background-primary after:-z-10"},(0,o.createElement)(TW,{borderOn:!0,className:"!h-full md:pl-3 lg:p-4 lg:w-64 border-none box-border flex-grow"},(0,o.createElement)(TW.Body,{className:"!p-0"},(0,o.createElement)(TW.Item,null,(0,o.createElement)(ym,{className:"w-full p-0 bg-transparent",size:"md"},(0,o.createElement)("ul",{className:"m-0 p-0 list-none flex flex-col"},e.map(e=>{const r=e.icon;return(0,o.createElement)(ym.Item,{key:e.slug,active:t===e.slug,onClick:()=>n(e.slug),className:"lg:justify-start justify-center hover:!bg-brand-25 hover:[&>svg]:!text-brand-600 "+(t===e.slug?"!bg-brand-25 !text-text-primary [&>svg]:!text-brand-600":"")},(0,o.createElement)(r,{className:"w-5 h-5"}),(0,o.createElement)("span",{className:"flex-1 lg:block hidden"},e.name))})))))))},yte=Ua("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),bte={sm:{text:"text-sm",separator:"text-sm",separatorIconSize:16},md:{text:"text-base",separator:"text-base",separatorIconSize:18}},vte=(0,i.createContext)({sizes:bte.sm}),xte=({children:e,size:t="sm"})=>{const n=bte[t]||bte.sm;return(0,P.jsx)(vte.Provider,{value:{sizes:n},children:(0,P.jsx)("nav",{className:"flex m-0","aria-label":"Breadcrumb",children:(0,P.jsx)("ul",{className:"m-0 inline-flex items-center space-x-1 md:space-x-1",children:e})})})};xte.displayName="Breadcrumb";const _te=({children:e})=>(0,P.jsx)(P.Fragment,{children:e});_te.displayName="Breadcrumb.List";const Ete=({children:e})=>(0,P.jsx)("li",{className:"m-0 inline-flex items-center gap-2",children:e});Ete.displayName="Breadcrumb.Item";const Nte=({href:e,children:t,className:n,as:r="a",...a})=>{const{sizes:o}=(0,i.useContext)(vte);return(0,P.jsx)(r,{href:e,className:Oe(o.text,"px-1 font-medium no-underline text-text-tertiary hover:text-text-primary hover:underline","focus:outline-none focus:ring-1 focus:ring-border-interactive focus:border-border-interactive focus:rounded-sm","transition-all duration-200",n),...a,children:t})};Nte.displayName="Breadcrumb.Link";const Mte=({type:e})=>{const{sizes:t}=(0,i.useContext)(vte),n={slash:(0,P.jsx)("span",{className:Oe("mx-1",t.separator),children:"/"}),arrow:(0,P.jsx)(bU,{size:t.separatorIconSize})};return(0,P.jsx)("li",{role:"separator",className:"flex items-center text-text-tertiary mx-2 p-0 list-none","aria-hidden":"true",children:n[e]||n.arrow})};Mte.displayName="Breadcrumb.Separator";const Ite=()=>{const{sizes:e}=(0,i.useContext)(vte);return(0,P.jsx)(yte,{className:"mt-[2px] cursor-pointer text-text-tertiary hover:text-text-primary",size:e.separatorIconSize+4})};Ite.displayName="Breadcrumb.Ellipsis";const Ste=({children:e})=>{const{sizes:t}=(0,i.useContext)(vte);return(0,P.jsx)("span",{className:Oe(t.text,"font-medium text-text-primary"),children:e})};Ste.displayName="Breadcrumb.Page",xte.List=_te,xte.Item=Ete,xte.Link=Nte,xte.Separator=Mte,xte.Ellipsis=Ite,xte.Page=Ste;const kte=function({sectionObject:e,flowType:t,buttonRef:n,backUrl:r}){const[{title:a}]=ZR(),i="?page=cartflows&path="+("storeCheckout"===t?"store-checkout":"flows");return(0,o.createElement)(Gp,{containerType:"flex",direction:"column",gap:"sm",className:"wcf-flow-settings--content min-w-0 max-w-3xl p-8 mx-auto w-full"},(0,o.createElement)(xte,{size:"sm"},(0,o.createElement)(xte.Item,null,(0,o.createElement)(xte.Link,{href:`${cartflows_admin.admin_base_url}admin.php${i}`,className:"font-normal"},(0,z.__)("Funnels","cartflows"))),(0,o.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,o.createElement)(Tee,{className:"w-3 h-3 stroke-2"})),(0,o.createElement)(xte.Item,null,(0,o.createElement)(xte.Link,{as:C,to:{pathname:"admin.php",search:r},className:"font-normal"},a||(0,z.__)("(no title)","cartflows"))),(0,o.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,o.createElement)(Tee,{className:"w-3 h-3 stroke-2"})),(0,o.createElement)(xte.Item,null,(0,o.createElement)(xte.Page,null,(0,z.__)("Funnel Settings","cartflows")))),(0,o.createElement)("div",{className:"flex justify-between items-center h-10"},(0,o.createElement)("div",{className:"flex items-center gap-2.5"},(0,o.createElement)(C,{to:{pathname:"admin.php",search:r},className:"text-icon-secondary hover:text-icon-primary no-underline shrink-0 transition-colors","aria-label":(0,z.__)("Back to funnel","cartflows")},(0,o.createElement)(HW,{className:"w-5 h-5 flex stroke-1"})),(0,o.createElement)(dte,null)),(0,o.createElement)(rL,{id:"wcf-save-flow-settings",ref:n})),(0,o.createElement)(Gp,{containerType:"flex",direction:"column",className:"!gap-5 bg-background-primary border border-solid border-border-subtle rounded-xl shadow-sm mb-8 p-6"},e?.title&&(0,o.createElement)($p,{title:e.title,tag:"h5",size:"xs",className:"text-text-primary"}),(0,o.createElement)(Oq,{section:e})))},jte={instant_layout:SZ,funnel_advanced_options:mte,general:hte},Dte=function(e){var t;const[{flow_id:n,flow_settings:r,flow_type:a}]=ZR(),[,s]=g(),l=(0,i.useRef)(null),c=$V(),[u,d]=(0,i.useState)(null),f=!r||void 0===r.settings,m=(0,i.useMemo)(()=>r?.settings?Object.entries(r.settings).sort(([,e],[,t])=>e.priority-t.priority).map(([e,t])=>({id:e,name:t.title,slug:t.slug,icon:jte[t.slug]||hte})):[],[r]),p=null!==(t=null!=u?u:m[0]?.slug)&&void 0!==t?t:"",h=r?.settings?Object.entries(r.settings).find(([,e])=>e.slug===p):null,w=h?h[1]:null,y="storeCheckout"===a?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${n}`;return f?(0,o.createElement)(gte,null):(0,o.createElement)("form",{className:"wcf-flow-settings-view flex gap-6 items-start w-full",onSubmit:t=>{t.preventDefault();const r=new window.FormData(t.target);r.append("action","cartflows_save_flow_meta_settings"),r.append("security",cartflows_admin.save_flow_meta_settings_nonce),r.append("flow_id",n),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(()=>{s({status:"SAVED"}),e.renderCb()})}},(0,o.createElement)(wte,{menuItems:m,currentTab:p,onTabChange:async e=>{e!==p&&(await(async()=>!!window.wcfUnsavedChanges&&await c({title:"Save Changes",description:"You have made changes. Do you want to save the changes?",actionBtnText:"Yes",cancelBtnText:"No"}))()&&l.current?.click(),d(e),window.wcfUnsavedChanges=!1)}}),(0,o.createElement)(kte,{currentTab:p,sectionObject:w,flowType:a,buttonRef:l,backUrl:y}))},Cte=function(){var e;const[{flow_id:t,steps:n,emptySteps:r,flow_type:a,is_flow_instant_checkout:s,flow_link:l,options:c,title:u},d]=ZR(),f=new URLSearchParams((0,b.useLocation)()?.search),m=null!==(e=f.get("step_id"))&&void 0!==e?e:"",p="true"===f.get("flow_settings"),h=$V(),[{canvasMode:w},y]=g(),[v,x]=(0,i.useState)(!1),[E,N]=(0,i.useState)(!1),[M,I]=(0,i.useState)("no"),[S,k]=(0,i.useState)(!1),[j,D]=(0,i.useState)("hide"),A=(0,i.useRef)(n);(0,i.useEffect)(()=>{A.current=n},[n]);const[T,O]=(0,i.useState)("yes"!==cartflows_admin?.instant_checkout_notice_status);let P=!0;n.length>0&&(P=!1);const R=function(){x(!v)};(0,i.useEffect)(()=>{let e=!0;return(async()=>{L()({path:`/cartflows/v1/admin/flow-data/${t}`}).then(t=>{e&&d({type:"SET_FLOW_DATA",data:t})})})(),()=>{e=!1}},[v]);const U=()=>{const e=t,n=[];A.current.map(e=>(n.push(e.id),""));const r=new window.FormData;r.append("action","cartflows_reorder_flow_steps"),r.append("security",cartflows_admin.reorder_flow_steps_nonce),r.append("step_ids",n),r.append("post_id",e),L()({url:cartflows_admin.ajax_url,method:"POST",body:r}).then(e=>{d({type:"SET_STEPS",steps:e.steps}),pp.success((0,z.__)("Steps reordered successfully!","cartflows"))})};(0,i.useEffect)(()=>{I(c&&c["wcf-testing"]?c["wcf-testing"]:"no")},[c]),(0,i.useEffect)(()=>{"yes"===s&&O(!1)},[s]);let B=!1,F=!1;const Y=[],Q=[];if(m)return(0,o.createElement)(Gp,{align:"start",className:"wcf-step-settings-view--wrapper -m-8",containerType:"flex"},(0,o.createElement)(Xq,{renderCb:R}));if(p)return(0,o.createElement)(Gp,{align:"start",className:"wcf-flow-settings-view--wrapper -m-8",containerType:"flex"},(0,o.createElement)(Dte,{renderCb:R}));const V="storeCheckout"===a,W=V?"?page=cartflows&path=store-checkout":"?page=cartflows&path=flows",Z=V?(0,z.__)("Store Checkout","cartflows"):(0,z.__)("Funnels","cartflows");return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-steps-page-wrapper border-t border-border-subtle -mt-px"},(0,o.createElement)("div",{className:"wcf-page-header mb-4"},(0,o.createElement)(xte,{size:"sm"},(0,o.createElement)(xte.Item,null,(0,o.createElement)(xte.Link,{href:`${cartflows_admin.admin_base_url}admin.php${W}`,className:"font-normal"},Z)),(0,o.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,o.createElement)(Tee,{className:"w-3 h-3 stroke-2"})),E?(0,o.createElement)(o.Fragment,null,(0,o.createElement)(xte.Item,null,(0,o.createElement)(xte.Link,{as:"button",type:"button",onClick:()=>N(!1),className:"font-normal cursor-pointer bg-transparent border-0 p-0"},u||(0,z.__)("(no title)","cartflows"))),(0,o.createElement)("span",{role:"separator",className:"flex items-center text-text-tertiary mx-0 p-0 list-none","aria-hidden":"true"},(0,o.createElement)(Tee,{className:"w-3 h-3 stroke-2"})),(0,o.createElement)(xte.Item,null,(0,o.createElement)(xte.Page,null,(0,z.__)("Analytics","cartflows")))):(0,o.createElement)(xte.Item,null,(0,o.createElement)(xte.Page,null,u||(0,z.__)("(no title)","cartflows")))),(0,o.createElement)("div",{className:"wcf-flow-header flex gap-3 xl:gap-0 justify-between flex-col xl:flex-row w-full mt-4"},(0,o.createElement)(dte,{type:a}),(0,o.createElement)("div",{className:"wcf-flow-header--actions w-full flex gap-3 items-center xl:justify-end"},(0,o.createElement)("div",{className:"wcf-flow-header--action-canvas-mode flex items-center gap-2"},(0,o.createElement)("span",{className:"text-sm font-medium text-text-secondary"},(0,z.__)("Canvas Mode","cartflows")),(0,o.createElement)(bO,{name:"wcf-enable-canvas-mode",size:"sm",value:w,onChange:e=>{e&&E&&N(!1),y({status:"UPDATE_CANVAS_MODE",canvasMode:e}),e?localStorage.setItem("wcf_canvas_mode_enabled","true"):localStorage.removeItem("wcf_canvas_mode_enabled")}})),(0,o.createElement)("div",{className:"wcf-flow-header--action-mode-select flex items-center gap-2 w-44"},S&&(0,o.createElement)(Wf,{className:"w-4 h-4 stroke-2 animate-spin text-brand-500"}),(0,o.createElement)(VO,{size:"md",value:M,onChange:e=>(e=>{k(!0);const n=new window.FormData;n.append("action","cartflows_save_flow_meta_settings"),n.append("security",cartflows_admin.save_flow_meta_settings_nonce),n.append("flow_id",t),n.append("wcf-testing",e),L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{d({type:"UPDATE_OPTIONS",options:{...c,"wcf-testing":e}}),k(!1),window.onbeforeunload=null,pp.success("yes"===e?(0,z.__)("Sandbox mode enabled!","cartflows"):(0,z.__)("Sandbox mode disabled!","cartflows"))}).catch(()=>{k(!1),pp.error((0,z.__)("Failed to update sandbox mode.","cartflows"))})})(e)},(0,o.createElement)(VO.Button,{placeholder:(0,z.__)("Select Mode","cartflows"),className:"gap-1",render:()=>"yes"===M?(0,o.createElement)("span",{className:"flex items-center gap-2"},(0,o.createElement)(iU,{className:"h-4 w-4 text-amber-500"}),(0,z.__)("Sandbox Mode","cartflows")):(0,o.createElement)("span",{className:"flex items-center gap-2"},(0,o.createElement)(mW,{className:"h-4 w-4 text-support-success"}),(0,z.__)("Live Mode","cartflows"))}),(0,o.createElement)(VO.Options,null,(0,o.createElement)(VO.Option,{value:"no"},(0,o.createElement)("span",{className:"flex items-center gap-2"},(0,o.createElement)(mW,{className:"h-4 w-4 text-support-success"}),(0,z.__)("Live Mode","cartflows"))),(0,o.createElement)(VO.Option,{value:"yes"},(0,o.createElement)("span",{className:"flex items-center gap-2"},(0,o.createElement)(iU,{className:"h-4 w-4 text-amber-500"}),(0,z.__)("Sandbox Mode","cartflows")))))),(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:(0,z.__)("Funnel Settings","cartflows"),placement:"top"},(0,o.createElement)(Va,{variant:"outline",size:"sm",className:"p-2.5",tag:C,to:{pathname:"admin.php",search:`?page=cartflows&path=${"storeCheckout"===a?"store-checkout":"flows"}&action=wcf-edit-flow&flow_id=${t}&flow_settings=true`},icon:(0,o.createElement)(nU,null)})),(0,o.createElement)(Ja,{arrow:!0,variant:"dark",content:(0,z.__)("Export Funnel","cartflows"),placement:"top"},(0,o.createElement)(Va,{variant:"outline",size:"sm",className:"p-2.5",onClick:e=>{e.preventDefault();const n=new window.FormData;n.append("action","cartflows_export_flow"),n.append("security",cartflows_admin.export_flow_nonce),n.append("flow_id",t),window.wcfAction="exportFlow",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(e=>{if(e.success){const n=e.data.flow_name||`flow-${t}.json`,r=JSON.stringify(e.data.flows),a=new Blob([r],{type:"application/json"});if(document.documentMode)window.navigator.msSaveOrOpenBlob(a,n);else{const e=document.createElement("a");e.href=URL.createObjectURL(a),e.download=n,e.click()}pp.success((0,z.__)("Funnel exported successfully!","cartflows"))}else pp.error((0,z.__)("Failed to export funnel.","cartflows"))}).catch(()=>{pp.error((0,z.__)("Failed to export funnel.","cartflows"))}))},icon:(0,o.createElement)(vW,null)})),"storeCheckout"===a&&(0,o.createElement)(Ja,{arrow:!0,content:(0,z.__)("Delete Store Checkout","cartflows"),placement:"top"},(0,o.createElement)(Va,{variant:"outline",size:"sm",className:"p-2.5",onClick:async e=>{if(e.preventDefault(),!await h({title:(0,z.__)("Delete Store Checkout","cartflows"),description:(0,z.sprintf)(/* translators: %s new line break */ /* translators: %s new line break */ |
| 95 |
(0,z.__)("Do you really want to delete store checkout?%1$1sNOTE: This action cannot be reversed.","cartflows"),"\r\n"),actionBtnText:(0,z.__)("Delete","cartflows"),cancelBtnText:(0,z.__)("Cancel","cartflows")}))return;const n=new window.FormData;n.append("action","cartflows_delete_flow"),n.append("security",cartflows_admin.delete_flow_nonce),n.append("flow_id",t),window.wcfAction="deleteFlow",(0,tW.$h)(L()({url:cartflows_admin.ajax_url,method:"POST",body:n}).then(()=>{pp.success((0,z.__)("Store checkout deleted successfully!","cartflows")),d({type:"SET_FLOWS",flows:null}),window.location.replace(cartflows_admin.admin_base_url+"admin.php?page=cartflows&path=store-checkout")}))},icon:(0,o.createElement)(aU,null)}))))),E?(0,o.createElement)(lte,{onBack:()=>N(!1)}):(0,o.createElement)(o.Fragment,null,T&&(0,o.createElement)("div",{className:"wcf-instant-checkout--notice flex justify-center mb-5"},(0,o.createElement)("div",{className:"wcf-instant-checkout--notice-columns flex items-center justify-between w-full border border-brand-200 p-3 rounded-lg bg-background-primary"},(0,o.createElement)("div",{className:"wcf-instant-checkout--notice-column-left flex items-center gap-3"},(0,o.createElement)(mZ,{className:"h-5 w-5 text-brand-500 hover:text-brand-600","aria-hidden":"true"}),(0,o.createElement)("span",{className:"text-text-primary text-sm font-medium"},(0,z.__)("Create a distraction free, high-converting checkout experience without needing a page builder.","cartflows"))),(0,o.createElement)("div",{className:"wcf-instant-checkout--notice-column-right flex items-center gap-4"},(0,o.createElement)(C,{to:{pathname:"admin.php",search:"storeCheckout"===a?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}&flow_settings=true`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&flow_settings=true`},className:"text-brand-600 text-xs font-medium cursor-pointer no-underline"},(0,z.__)("Enable Instant Layout","cartflows")),(0,o.createElement)(tL,{className:"h-5 w-5 hover:text-brand-600 cursor-pointer","aria-hidden":"true",onClick:e=>{e.preventDefault(),(()=>{const e=new window.FormData;e.append("action","cartflows_hide_instant_checkout_notice"),e.append("security",cartflows_admin.hide_instant_checkout_notice_nonce),e.append("flow_id",t),O(!1),L()({url:cartflows_admin.ajax_url,method:"POST",body:e}).then(e=>{e?.status&&O(!1)})})()}})))),(0,o.createElement)("div",{className:"wcf-steps-header flex justify-center mb-5 "+(w?"hidden":"")},(0,o.createElement)("div",{className:"flex justify-between items-center w-full gap-2"},(0,o.createElement)($p,{tag:"h3",size:"sm",title:(0,z.__)("Funnel Steps","cartflows")}),(0,o.createElement)("div",{className:"wcf-steps-header--actions flex items-center gap-3"},(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:()=>N(!0),icon:(0,o.createElement)(dV,{className:"!w-4 !h-4 stroke-1"}),className:"text-sm font-normal",iconPosition:"left"},(0,z.__)("View Analytics","cartflows")),(0,o.createElement)(Va,{variant:"outline",size:"md",tag:"a",href:l,target:"_blank",rel:"noreferrer",icon:(0,o.createElement)(sW,{className:"!w-4 !h-4 stroke-1"}),className:"text-sm font-normal no-underline",iconPosition:"left"},(0,z.__)("View Funnel","cartflows")),(0,o.createElement)(Va,{variant:"primary",size:"md",tag:C,to:{pathname:"admin.php",search:"storeCheckout"===a?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}&tab=library`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&tab=library`},className:"text-sm font-normal no-underline",icon:(0,o.createElement)(KO,{className:"!w-4 !h-4 stroke-2"}),iconPosition:"left"},(0,z.__)("Add New Step","cartflows"))))),w?(0,o.createElement)(Cee,{renderCb:R}):(0,o.createElement)(o.Fragment,null,(0,o.createElement)(ute,null),(0,o.createElement)("div",{className:"wcf-list-steps flex justify-center mb-4"},r&&function(){if(0===n.length)return(0,o.createElement)("div",{className:"wcf-analytics-no-step-notice text-center mb-8 bg-background-primary p-20 rounded-xl w-full"},(0,o.createElement)("svg",{className:"mx-auto h-12 w-12 text-text-secondary",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","aria-hidden":"true"},(0,o.createElement)("path",{vectorEffect:"non-scaling-stroke",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 13h6m-3-3v6m-9 1V7a2 2 0 012-2h6l2 2h6a2 2 0 012 2v8a2 2 0 01-2 2H5a2 2 0 01-2-2z"})),(0,o.createElement)("h3",{className:"mt-2 text-sm font-semibold text-text-primary"},(0,z.__)("No Steps Added.","cartflows")),(0,o.createElement)("p",{className:"mt-1 text-sm text-text-secondary"},(0,z.__)("Seems like there are no steps created or added in this flow","cartflows")),(0,o.createElement)("div",{className:"mt-6"},(0,o.createElement)(Va,{variant:"primary",size:"sm",tag:C,to:{pathname:"admin.php",search:"storeCheckout"===a?`?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}&tab=library`:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&tab=library`},icon:(0,o.createElement)(KO,{className:"w-4 h-4 stroke-2"}),iconPosition:"left"},(0,z.__)("Add New Step","cartflows"))))}(),!r&&P&&(0,o.createElement)(jX,null),!P&&(0,o.createElement)("div",{className:"w-full"},"storeCheckout"===a?(n.length>0&&n.map((e,t)=>{if("checkout"===e.type){if(!cartflows_admin.old_global_checkout)return B=t,"";if(e.id===parseInt(cartflows_admin.old_global_checkout))return B=t,"";Y.push(e)}else"landing"===e.type?Y.push(e):Q.push(e);return""}),Q.length>0&&(F=!0),(0,o.createElement)(o.Fragment,null,!r&&!P&&(0,o.createElement)(o.Fragment,null,Y.map(e=>(0,o.createElement)(kX,(0,_.A)({},e,{key:e.id,invalid:!0,setShowAbtestUpgradePopup:D}))),(0,o.createElement)(kX,(0,_.A)({},n[B],{key:n[B].id,setShowAbtestUpgradePopup:D})),F&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Pee,{flowId:t,flowType:a}),(0,o.createElement)(QR.ReactSortable,{list:Q,setList:e=>{const t=A.current.filter(e=>"checkout"===e.type||"landing"===e.type);A.current=[...t,...e],d({type:"SET_STORE_STEPS",steps:e})},onEnd:U,swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-step-wrap",filter:".wcf-step__col-actions, .wcf-step__title-text, .wcf-ab-test-popup-content, .wcf-steps-action-buttons, .wcf-archived-wrapper, .wcf-add-step-connector",preventOnFilter:!1},Q.map((e,n)=>"checkout"!==e.type?(0,o.createElement)("div",{key:e.id},(0,o.createElement)(kX,(0,_.A)({},e,{setShowAbtestUpgradePopup:D})),n<Q.length-1&&(0,o.createElement)(Pee,{flowId:t,flowType:a})):(0,o.createElement)(o.Fragment,null))))))):(0,o.createElement)(o.Fragment,null,!r&&!P&&(0,o.createElement)(QR.ReactSortable,{list:n,setList:e=>{A.current=e,d({type:"SET_STEPS",steps:e})},onEnd:U,swapThreshold:.8,direction:"vertical",animation:150,handle:".wcf-step-wrap",filter:".wcf-step__col-actions, .wcf-step__title-text, .wcf-ab-test-popup-content, .wcf-add-step-connector",preventOnFilter:!1},n.map((e,r)=>(0,o.createElement)("div",{key:e.id},(0,o.createElement)(kX,(0,_.A)({},e,{setShowAbtestUpgradePopup:D})),r<n.length-1&&(0,o.createElement)(Pee,{flowId:t,flowType:a}))))))),(0,o.createElement)("div",{className:"wcf-step-footer flex justify-center pt-2 pb-4"},(0,o.createElement)(Pee,{flowId:t,flowType:a,showConnectorLines:!1,tooltipPlacement:"top"}))))),(0,o.createElement)(Oee,{renderCb:R,steps:n}),(0,o.createElement)(zee,{visibility:j,setVisibility:D}))},Ate=(0,sp.compose)((0,lp.withSelect)(e=>{const{getstepTypes:t}=e("wcf/importer");return{stepTypes:t()}}),(0,lp.withDispatch)(e=>{const{setSelectedStep:t}=e("wcf/importer");return{setSelectedStep(e){t(e)}}}))(({stepTypes:e,setSelectedStep:t})=>(0,o.createElement)("div",{className:"wcf-create-step__dropdown-list wcf-select-option w-full text-left"},(0,o.createElement)(VO,{onChange:e=>{t(e)},size:"md"},(0,o.createElement)(VO.Button,{placeholder:(0,z.__)("Select Step Type","cartflows"),render:t=>t?e[t]||t:""}),(0,o.createElement)(VO.Options,null,Object.keys(e).map(t=>(0,o.createElement)(VO.Option,{value:t,key:t},e[t])))))),Tte=(0,sp.compose)((0,lp.withSelect)(e=>{const{getFlowsCount:t,getcurrentFlowId:n,getselectedStep:r,getstepTypes:a,getcurrentFlowSteps:o,getCFProStatus:i,getWooCommerceStatus:s,getselectedStepTitle:l,getLicenseStatus:c}=e("wcf/importer");return{flowsCount:t(),currentFlowId:n(),selectedStep:r(),stepTypes:a(),currentFlowSteps:o(),cf_pro_status:i(),woocommerce_status:s(),selectedStepTitle:l(),license_status:c()}}))(({currentStep:e,stepName:t,currentFlowId:n,currentFlowSteps:r,cf_pro_status:a,woocommerce_status:s,stepTypes:l,license_status:c,setInputFieldVisibility:u,setErrorDesc:d,offerYesStepId:f="",offerNoStepId:m=""})=>{const p=e.type||"",h=e.title||l[p]||"",[g,w]=(0,i.useState)((0,z.__)("Import Step","cartflows")),[y,b]=(0,i.useState)(!1);if(""===e.type)return(0,o.createElement)(Va,{variant:"primary",size:"md",disabled:!0},g);if(1<=(r?r.filter(e=>p===e.type):[]).length&&!wcfCartflowsPro())return u("hidden"),d((0,z.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")),"not-installed"===a?(0,o.createElement)(bp,{title:(0,z.__)("Get CartFlows Higher Plan","cartflows"),desc:(0,z.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")}):(d((0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 96 |
(0,z.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,o.createElement)(yp,{description:(0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 97 |
(0,z.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)}));if("upsell"===p||"downsell"===p){if(u("hidden"),!wcfCartflowsTypePlusPro())return wcfInactiveProPlus()?(d((0,z.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */ |
| 98 |
(0,z.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),p,cartflows_admin.cf_pro_type_inactive)),(0,o.createElement)(yp,{description:(0,z.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */ |
| 99 |
(0,z.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),p,cartflows_admin.cf_pro_type_inactive)})):(d((0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 100 |
(0,z.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),p)),(0,o.createElement)(bp,{desc:(0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 101 |
(0,z.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),p),title:"Get CartFlows Higher Plan"}));if("Activated"!==c)return d((0,z.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */ |
| 102 |
(0,z.__)("Add %1$s step to your flow by activating CartFlows license.","cartflows"),p)),u("hidden"),(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)(_p,{title:"Activate License"})))}if("pro"===e.template_type){if(!wcfCartflowsTypePro())return"inactive"===a&&"pro"===wcfInactivepluginType()?(u("hidden"),d((0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 103 |
(0,z.__)("Access all of our pro templates by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,o.createElement)(yp,{description:(0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 104 |
(0,z.__)("Access all of our pro templates by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)})):(u("hidden"),d((0,z.__)("Access all of our pro templates when you upgrade your plan to CartFlows Pro today.","cartflows")),(0,o.createElement)(bp,{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"!==c)return u("hidden"),d((0,z.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */ |
| 105 |
(0,z.__)("Add %1$s step to your flows by activating license.","cartflows"),p)),(0,o.createElement)(_p,{title:"Activate License"})}return"landing"!==p&&"active"!==s?(u("hidden"),d((0,z.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")),"inactive"===s?(0,o.createElement)(hp,{title:`Activate WooCommerce to Import ${h}`,description:(0,z.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")}):(0,o.createElement)(gp,null)):(u(""),(0,o.createElement)(Va,{variant:"primary",size:"md",loading:y,disabled:y,icon:(0,o.createElement)(QV,{className:"h-4 w-4 stroke-2"}),iconPosition:"left",onClick:()=>{((e,t,n,r,a,o,i,s="",l="")=>{if(console.log(e,t,n),o)return;n("Importing Step.."),a(!0);const c=new window.FormData;c.append("action","cartflows_import_step"),c.append("security",cartflows_admin.import_step_nonce),c.append("remote_flow_id",e.template_ID),c.append("flow_id",t),c.append("step",JSON.stringify(e)),c.append("step_name",r),s&&c.append("offer_yes_step_id",s),l&&c.append("offer_no_step_id",l);const u=window.sessionStorage.getItem("wcf_edge_insertion_context");if(u)try{const e=JSON.parse(u);e.sourceStepId&&e.targetStepId&&("wcf_start_node"===e.sourceStepId||"start"===e.sourceStepId?c.append("is_start_edge","true"):c.append("edge_source_step_id",e.sourceStepId),c.append("edge_target_step_id",e.targetStepId),e.sourceHandle&&c.append("edge_source_handle",e.sourceHandle))}catch(e){console.error("[CartFlows] Error parsing edge context:",e),window.sessionStorage.removeItem("wcf_edge_insertion_context")}L()({url:cartflows_admin.ajax_url,method:"POST",body:c}).then(e=>{if(e.success)n((0,z.__)("Imported! Redirecting…","cartflows")),a(!1),pp.success((0,z.__)("Step imported successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}`},3e3);else{let t=e.data.message;e.data.error_code&&404===e.data.error_code&&(t+=(0,z.__)(" Please sync the library and try importing the template again.","cartflows")),i(fh(t)),n((0,z.__)("Import Failed! Try again.","cartflows")),pp.error((0,z.__)("Failed to import step.","cartflows")),setTimeout(()=>{n((0,z.__)("Import Step","cartflows"))},3e3),a(!1)}}).finally(()=>{window.sessionStorage.removeItem("wcf_edge_insertion_context")})})(e,n,w,t,b,y,d,f,m)}},g))}),Ote=(0,sp.compose)((0,lp.withSelect)(e=>{const{getcurrentFlowId:t,getselectedStep:n,getselectedStepTitle:r}=e("wcf/importer");return{currentFlowId:t(),selectedStep:n(),selectedStepTitle:r()}}))(({currentFlowId:e,selectedStep:t,selectedStepTitle:n,stepName:r,offerYesStepId:a="",offerNoStepId:s=""})=>{const[l,c]=(0,i.useState)({isProcessing:!1,buttonText:(0,z.__)("Create Step","cartflows")}),{isProcessing:u,buttonText:d}=l;return(0,o.createElement)(Va,{variant:"primary",size:"md",loading:u,disabled:u,onClick:o=>{o.preventDefault(),u||(c({isProcessing:!0,buttonText:(0,z.__)("Creating Step..","cartflows")}),((e,t,n,r,a,o="",i="")=>{console.log(e,t,n);const s=new window.FormData;s.append("action","cartflows_create_step"),s.append("flow_id",e),s.append("step_type",t),s.append("step_title",n),s.append("security",cartflows_admin.create_step_nonce),s.append("step_name",a),o&&s.append("offer_yes_step_id",o),i&&s.append("offer_no_step_id",i);const l=window.sessionStorage.getItem("wcf_edge_insertion_context");if(l)try{const e=JSON.parse(l);e.sourceStepId&&e.targetStepId&&("wcf_start_node"===e.sourceStepId||"start"===e.sourceStepId?s.append("is_start_edge","true"):s.append("edge_source_step_id",e.sourceStepId),s.append("edge_target_step_id",e.targetStepId),e.sourceHandle&&s.append("edge_source_handle",e.sourceHandle))}catch(e){console.error("[CartFlows] Error parsing edge context:",e),window.sessionStorage.removeItem("wcf_edge_insertion_context")}L()({url:cartflows_admin.ajax_url,method:"POST",body:s}).then(t=>{console.log(t),window.sessionStorage.removeItem("wcf_edge_insertion_context"),t.success?(r({isProcessing:!1,buttonText:(0,z.__)("Step Created! Redirecting…","cartflows")}),pp.success((0,z.__)("Step created successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${e}`},3e3)):(r({isProcessing:!1,buttonText:(0,z.__)("Failed to Create Step!","cartflows")}),pp.error((0,z.__)("Failed to create step.","cartflows")))})})(e,t,n,c,r,a,s))}},d)}),Lte=(0,sp.compose)((0,lp.withSelect)(e=>{const{getFlowsCount:t,getselectedStep:n,getstepTypes:r,getcurrentFlowSteps:a,getCFProStatus:o,getWooCommerceStatus:i,getLicenseStatus:s}=e("wcf/importer");return{flowsCount:t(),selectedStep:n(),stepTypes:r(),currentFlowSteps:a(),cf_pro_status:o(),woocommerce_status:i(),license_status:s()}}))(({selectedStep:e,currentFlowSteps:t,cf_pro_status:n,woocommerce_status:r,license_status:a,stepName:i,setInputFieldVisibility:s,setErrorDesc:l,offerYesStepId:c="",offerNoStepId:u=""})=>{if(""===e)return(0,o.createElement)("button",{className:"wcf-button wcf-primary-button",disabled:!0},(0,z.__)("Create Step","cartflows"));if(1<=(t?t.filter(t=>e===t.type):[]).length&&!wcfCartflowsPro())return s("hidden"),l((0,z.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")),"not-installed"===n?(0,o.createElement)(bp,{title:(0,z.__)("Get CartFlows Higher Plan","cartflows")}):(l((0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 106 |
(0,z.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,o.createElement)(yp,{description:(0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 107 |
(0,z.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)}));if("upsell"===e||"downsell"===e){if(!wcfCartflowsTypePlusPro())return wcfInactiveProPlus()?(s("hidden"),l((0,z.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */ |
| 108 |
(0,z.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),e,cartflows_admin.cf_pro_type_inactive)),(0,o.createElement)(yp,null)):(s("hidden"),l((0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 109 |
(0,z.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),e)),(0,o.createElement)(bp,{title:(0,z.__)("Get CartFlows Higher Plan","cartflows")}));if(wcfCartflowsTypePlusPro()&&"Activated"!==a)return s("hidden"),l((0,z.__)("Activate license for adding more steps and other features.","cartflows")),(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)(_p,{title:(0,z.__)("Activate License","cartflows")})))}return"landing"!==e&&"active"!==r?(s("hidden"),l((0,z.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")),"inactive"===r?(0,o.createElement)(hp,null):(0,o.createElement)(gp,null)):(s(""),l(""),(0,o.createElement)(Ote,{stepName:i,offerYesStepId:c,offerNoStepId:u}))}),zte=({stepName:e,setInputFieldVisibility:t,setErrorDesc:n,offerYesStepId:r="",offerNoStepId:a=""})=>(0,o.createElement)("div",{className:"wcf-create-step__button-wrap"},(0,o.createElement)(Lte,{stepName:e,setInputFieldVisibility:t,setErrorDesc:n,offerYesStepId:r,offerNoStepId:a})),Pte=e=>{if(!e||!Array.isArray(e))return[];const t=window.sessionStorage.getItem("wcf_edge_insertion_context");let n=-1;if(t)try{const r=JSON.parse(t).sourceStepId;if("wcf_start_node"===r||"start"===r)return e.filter(e=>"checkout"!==e.type);r&&(n=e.findIndex(e=>e.id===r||e.id===parseInt(r,10)))}catch(e){window.sessionStorage.removeItem("wcf_edge_insertion_context")}return-1===n?e.filter(e=>"checkout"!==e.type):e.slice(n+1).filter(e=>"checkout"!==e.type)},Rte=({offerYesStepId:e,setOfferYesStepId:t,offerNoStepId:n,setOfferNoStepId:r,availableSteps:a=null})=>{const{currentFlowSteps:i}=(0,lp.useSelect)(e=>({currentFlowSteps:e("wcf/importer").getcurrentFlowSteps()})),s=null!==a?a:Pte(i);return 0===s.length?null:(0,o.createElement)("div",{className:"mt-5 space-y-4"},(0,o.createElement)("div",{className:"text-sm font-medium text-gray-700 mb-2"},(0,z.__)("Conditional Redirect Settings","cartflows")),(0,o.createElement)("div",null,(0,o.createElement)("label",{className:"block text-sm font-normal text-gray-600 mb-1"},(0,z.__)("On Accept (Yes), go to:","cartflows")),(0,o.createElement)("select",{className:"w-full input-field !px-3 !py-2 text-sm font-normal !rounded-md text-gray-600 !border-gray-200 focus:ring focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none",value:e,onChange:e=>t(e.target.value)},(0,o.createElement)("option",{value:""},(0,z.__)("Default (Auto)","cartflows")),s.map(e=>(0,o.createElement)("option",{key:e.id,value:e.id},e.title)))),(0,o.createElement)("div",null,(0,o.createElement)("label",{className:"block text-sm font-normal text-gray-600 mb-1"},(0,z.__)("On Reject (No), go to:","cartflows")),(0,o.createElement)("select",{className:"w-full input-field !px-3 !py-2 text-sm font-normal !rounded-md text-gray-600 !border-gray-200 focus:ring focus:!ring-primary-100 focus:!border-primary-500 focus:!shadow-none !outline-0 !outline-none",value:n,onChange:e=>r(e.target.value)},(0,o.createElement)("option",{value:""},(0,z.__)("Default (Auto)","cartflows")),s.map(e=>(0,o.createElement)("option",{key:e.id,value:e.id},e.title)))))},Ute=({visibility:e,setVisibility:t,item:n,type:r,stepName:a,setStepName:s})=>{const l="show"===e,[c,u]=(0,i.useState)(""),[d,f]=(0,i.useState)(""),[m,p]=(0,i.useState)(0),[h,g]=(0,i.useState)(""),[w,y]=(0,i.useState)(""),{currentFlowSteps:b,selectedStep:v}=(0,lp.useSelect)(e=>({currentFlowSteps:e("wcf/importer").getcurrentFlowSteps(),selectedStep:e("wcf/importer").getselectedStep()})),x="ready-templates"===r?n&&("upsell"===n.type||"downsell"===n.type):"upsell"===v||"downsell"===v,_=Pte(b);return(0,o.createElement)($m,{open:l,setOpen:e=>{e||t("hide")},exitOnClickOutside:!1},(0,o.createElement)($m.Panel,{className:"sm:max-w-lg w-full"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)($m.Header,{className:"flex items-center justify-between !space-y-0"},(0,o.createElement)($m.Title,null,"hidden"===c?(0,z.__)("Upgrade Required","cartflows"):(0,z.__)("Name Your Step","cartflows")),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)($m.Body,null,(0,o.createElement)("div",{className:`${c}`},(0,o.createElement)("div",{className:"flex justify-between py-2"},(0,o.createElement)("label",{className:"flex gap-1 text-sm font-normal text-text-primary"},(0,z.__)("Step Name","cartflows")),(0,o.createElement)("span",{className:"text-xs font-normal "+(40===m?"text-brand-500":"text-field-placeholder")},m,"/40")),(0,o.createElement)(dp,{type:"text",value:a,onChange:e=>{e.length<=40&&(p(e.length),s(e))},placeholder:(0,z.__)("Enter Step Name","cartflows"),size:"md"})),"hidden"!==c&&x&&_.length>0&&(0,o.createElement)(Rte,{offerYesStepId:h,setOfferYesStepId:g,offerNoStepId:w,setOfferNoStepId:y,availableSteps:_}),""!==d&&(0,o.createElement)("p",{className:"text-sm font-regular text-text-secondary mt-3 m-0"},d)),(0,o.createElement)($m.Footer,{className:"flex gap-3 justify-end"},"ready-templates"===r&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:()=>t("hide")},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(Tte,{currentStep:n,stepName:a,setInputFieldVisibility:u,setErrorDesc:f,offerYesStepId:h,offerNoStepId:w})),"create-your-own"===r&&(0,o.createElement)(zte,{stepName:a,setInputFieldVisibility:u,setErrorDesc:f,offerYesStepId:h,offerNoStepId:w}))))},Bte=(0,sp.compose)((0,lp.withSelect)(e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}}))(({selectedStep:e})=>{const[t,n]=(0,i.useState)("hide"),[r,a]=(0,i.useState)("");return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Ute,{visibility:t,setVisibility:n,type:"create-your-own",stepName:r,setStepName:a}),(0,o.createElement)("div",{className:"wcf-step-library--item wcf-step-library--item__start-scratch h-full bg-background-primary rounded-lg shadow-md relative p-5 box-border"},(0,o.createElement)("div",{className:"wcf-step-library--item--scratch-select text-center w-full h-full min-h-[400px] max-h-[400px] flex flex-col gap-4 items-center justify-center"},(0,o.createElement)("h3",{className:"text-base text-text-primary p-4 text-center font-medium"},(0,z.__)("Select Step Type","cartflows")),(0,o.createElement)(Ate,null),(0,o.createElement)(Va,{variant:"primary",size:"md",disabled:""===e,icon:(0,o.createElement)(KO,{className:"h-18 w-18 stroke-2"}),iconPosition:"left",onClick:()=>{n("hide"===t?"show":"hide")}},(0,z.__)("Create Step","cartflows")),(0,o.createElement)("div",{className:"wcf-learn-how"},(0,o.createElement)("a",{href:getKbDocUrl(`${cartflows_admin.cf_domain_url}docs/cartflows-step-types/`),target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-sm text-text-tertiary hover:text-brand-500"},(0,o.createElement)(xp,{className:"w-18 h-18 stroke-1"}),(0,z.__)("Learn How","cartflows")))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap border-0 border-t border-solid border-border-subtle absolute bottom-0 left-0 w-full"},(0,o.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},(0,z.__)("Create from Scratch","cartflows")))))}),Fte=function({item:e}){const[t,n]=(0,i.useState)("hide"),[r,a]=(0,i.useState)("");return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Ute,{visibility:t,setVisibility:n,type:"ready-templates",stepName:r,setStepName:a,item:e}),(0,o.createElement)("div",{key:e.id,className:"wcf-template-item group relative cursor-pointer transition ease-in-out delay-150 rounded-lg shadow-md"},"pro"===e.template_type?(0,o.createElement)("div",{className:"z-10 absolute top-5 right-5"},(0,o.createElement)(Ym,null)):"",(0,o.createElement)("div",{className:"wcf-item__inner bg-background-primary border border-border-subtle"},(0,o.createElement)("div",{className:"wcf-item__thumbnail-wrap relative"},(0,o.createElement)("div",{className:"wcf-item__thumbnail overflow-hidden "+("upsell"===e.type||"downsell"===e.type?"max-h-[345px] min-h-[345px]":"min-h-[400px] max-h-[400px]")},(0,o.createElement)("img",{className:"wcf-item__thumbnail-image w-full",src:e.featured_image_url,alt:(0,z.__)("Step thumbnail image","cartflows")})),(0,o.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,o.createElement)("div",{className:"mx-auto my-0 text-center flex flex-col gap-4 relative top-[35%]"},(0,o.createElement)("span",{className:"wcf-step-preview-wrap"},(0,o.createElement)(Va,{tag:"a",variant:"outline",size:"sm",href:e.link,target:"_blank",rel:"noreferrer",className:"mx-auto !w-fit no-underline !bg-background-primary/10 !border-white/30 !text-text-on-color hover:!bg-background-primary/20",icon:(0,o.createElement)(xp,{className:"w-4 h-4 stroke-2"})},(0,z.__)("Preview","cartflows"))),(0,o.createElement)("span",{className:"wcf-item__btn",onClick:()=>{n("hide"===t?"show":"hide")}},(0,o.createElement)(Va,{variant:"primary",size:"sm",className:"mx-auto !w-fit",icon:(0,o.createElement)(_H,{className:"w-4 h-4 stroke-2"})},(0,z.__)("Import","cartflows")))))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap border-0 border-t border-solid border-border-subtle"},(0,o.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},e.title)))))},Yte=function(e){const{templates:t,currentStep:n,setcurrentStepCB:r,allowedStepTypes:a}=e,s=t,{step_types:l}=(0,lp.useSelect)(e=>({step_types:e("wcf/importer").getstepTypes()})),c=Object.entries(l),u=e=>!a||a.hasOwnProperty(e);return(0,o.createElement)(i.Fragment,null,(0,o.createElement)("div",{className:"wcf-remote-steps-filters flex gap-4 items-center p-8 mb-8 -m-8 bg-background-primary"},(0,o.createElement)("div",{className:"wcf-categories w-full"},(0,o.createElement)("div",{className:"wcf-step-type-filter--links sm:block lg:block hidden"},(0,o.createElement)(AQ.Group,{activeItem:n,variant:"rounded",size:"sm",width:"auto",className:"!bg-transparent !p-0 !ring-0 !gap-4",onChange:({value:e})=>{u(e.slug)&&r(e.slug)}},c.map(([e,t])=>{const r=e===n;return(0,o.createElement)(AQ.Tab,{key:e,slug:e,text:t,disabled:!u(e),className:"step-type-filter-item !px-1 !py-1 !font-medium "+(r?"!bg-transparent !shadow-none !text-brand-500":"")})}))),(0,o.createElement)("div",{className:"sm:hidden lg:hidden block"},(0,o.createElement)(VO,{value:n,onChange:e=>{u(e)&&r(e)},size:"sm"},(0,o.createElement)(VO.Button,null),(0,o.createElement)(VO.Options,null,c.map(e=>{const t=e[0],n=e[1],r=u(t);return(0,o.createElement)(VO.Option,{key:t,value:t,disabled:!r},n,r?"":" (Not allowed)")})))))),(0,o.createElement)("div",{className:"wcf-step-importer__list wcf-items-list wcf-row wcf-step-row grid grid-cols-1 sm:grid-cols-4 gap-6 p-6 bg-background-primary shadow-sm rounded-md"},(0,o.createElement)("div",{className:"wcf-start-from-scratch"},(0,o.createElement)(Bte,null)),s.map(e=>(0,o.createElement)(Fte,{item:e,key:e.id}))))},Qte=(0,sp.compose)((0,lp.withSelect)(e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}}))(({selectedStep:e})=>{const[t,n]=(0,i.useState)("hide"),[r,a]=(0,i.useState)(""),[{page_builder:s}]=ZR();return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Ute,{visibility:t,setVisibility:n,type:"create-your-own",stepName:r,setStepName:a}),(0,o.createElement)("div",{className:"wcf-step-library--item__start-scratch flex gap-6 mx-auto max-w-4xl px-10 py-14"},(0,o.createElement)("div",{className:"wcf-step-library--item__card relative bg-gray-25 p-5 flex flex-col gap-4 border border-border-subtle rounded-md items-center justify-center h-72 w-2/3"},(0,o.createElement)($p,{title:(0,z.__)("Create from Scratch","cartflows"),description:(0,z.__)("Select a step type to get started.","cartflows"),tag:"h3",size:"xs",className:"text-center text-base [&>p]:text-text-secondary"}),(0,o.createElement)("div",{className:"w-full"},(0,o.createElement)(Ate,null)),(0,o.createElement)(Va,{variant:"primary",size:"md",disabled:""===e,icon:(0,o.createElement)(KO,{className:"h-5 w-5 stroke-2"}),iconPosition:"left",onClick:()=>{n("hide"===t?"show":"hide")}},(0,z.__)("Create Step","cartflows"))),(0,o.createElement)("div",{className:"wcf-step-library--item__info flex flex-col gap-6 justify-center w-3/4"},(0,o.createElement)("h3",{className:"text-xl text-text-primary font-semibold m-0"},"bricks-builder"===s&&(0,z.__)("It seems that you are using the Bricks Builder.","cartflows"),"other"===s&&(0,z.__)("It seems that you are using the page builder other than Elementor, Beaver Builder, Block Builder.","cartflows")),(0,o.createElement)("span",{className:"text-base text-text-secondary font-normal mt-2"},"bricks-builder"===s&&(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"===s&&(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,o.createElement)("span",{className:"mt-2"},(0,o.createElement)("a",{className:"text-text-secondary hover:text-brand-500 flex items-center gap-2 text-sm",href:getKbDocUrl("https://cartflows.com/docs/how-to-use-cartflows-with-your-own-template/"),target:"_blank",rel:"noreferrer"},(0,z.__)("Learn How","cartflows"),(0,o.createElement)(xp,{className:"w-4 h-4 stroke-1"}))))))}),Vte=class{constructor(){this.offerSteps=["upsell","downsell"],this.allStepTypes=["landing","optin","checkout","upsell","downsell","thankyou"]}isOfferStep(e){return this.offerSteps.includes(e)}isStartNode(e){return"wcf_start_node"===e||"start"===e}isEndNode(e){return"wcf_end_node"===e||"end"===e}extractStepIdFromNodeId(e){if(!e||this.isStartNode(e)||this.isEndNode(e))return e;if("string"==typeof e&&e.includes("wcf_node_edge_")){const t=parseInt(e.replace("wcf_node_edge_",""),10);return isNaN(t)?null:t}if("string"==typeof e&&e.startsWith("conditional-")){const t=parseInt(e.replace("conditional-",""),10);return isNaN(t)?null:t}if("string"==typeof e&&e.startsWith("ab-group-")){const t=parseInt(e.replace("ab-group-",""),10);return isNaN(t)?null:t}return"number"==typeof e?e:null}findStepById(e,t){if(!t||!Array.isArray(t))return null;const n=this.extractStepIdFromNodeId(e);if(!n||this.isStartNode(n)||this.isEndNode(n))return null;const r=t.find(e=>e.id===n);if(r)return r;for(const e of t)if(e["ab-test-variations"]&&Array.isArray(e["ab-test-variations"])){if(e["ab-test-variations"].find(e=>e.id===n))return{...e,_variationId:n,_isVariation:!0}}return null}getStepType(e,t){if(this.isStartNode(e))return"start";if(this.isEndNode(e))return"end";const n=this.findStepById(e,t);return n?n.type:null}hasOptinBeforeCheckout(e){if(!e||!Array.isArray(e))return!1;let t=!1;for(let n=e.length-1;n>=0;n--){const r=e[n];if("checkout"===r.type&&(t=!0),t&&"optin"===r.type)return!0}return!1}hasCheckoutBefore(e,t){if(!t||!Array.isArray(t))return!1;for(let n=0;n<e;n++)if("checkout"===t[n].type)return!0;return!1}getStepIndex(e,t){if(!t||!Array.isArray(t))return-1;const n=this.extractStepIdFromNodeId(e);return!n||this.isStartNode(n)||this.isEndNode(n)?-1:t.findIndex(e=>e.id===n)}getAllowedStepTypes(e,t,n){const r=this.getStepType(e,n),a=this.getStepType(t,n);return"start"===r?"optin"===a?["landing","checkout"]:"checkout"===a||"landing"===a?this.hasOptinBeforeCheckout(n)?["landing"]:["landing","optin"]:["landing","optin","checkout"]:"end"===a?["thankyou"]:"checkout"===a?"checkout"===r?[]:this.hasOptinBeforeCheckout(n)?["landing"]:["landing","optin"]:"checkout"===r?"checkout"===a?[]:["upsell","downsell"]:this.isOfferStep(r)?this.isOfferStep(a)?["upsell","downsell"]:["upsell","downsell","optin"]:"landing"===r?"checkout"===a?this.hasOptinBeforeCheckout(n)?["landing","checkout"]:["landing","optin","checkout"]:"optin"===a?["landing"]:this.hasOptinBeforeCheckout(n)?["landing","checkout"]:["landing","optin","checkout"]:"optin"===r?"checkout"===a?["landing","checkout"]:"landing"===a?["landing"]:["landing","checkout"]:"thankyou"===r?[]:this.hasOptinBeforeCheckout(n)?["landing","checkout"]:["landing","optin","checkout"]}getAllowedStepTypesObject(e,t,n,r){const a=this.getAllowedStepTypes(e,t,n),o={};return a.forEach(e=>{r&&r[e]&&(o[e]=r[e])}),o}},Wte=function(){const e=(0,b.useHistory)(),[{page_builder:t,flow_id:n,flow_type:r}]=ZR(),[a,s]=(0,i.useState)("landing"),[l,c]=(0,i.useState)(""),[u,d]=(0,i.useState)(null),{all_step_templates:f,stepTypes:m,currentFlowSteps:p}=(0,lp.useSelect)(e=>({all_step_templates:e("wcf/importer").getAllStepTemplates(),stepTypes:e("wcf/importer").getstepTypes(),currentFlowSteps:e("wcf/importer").getcurrentFlowSteps()})),h=[];f.forEach(e=>{a===e.type&&h.push(e)});const[g,w]=(0,i.useState)(h);return(0,i.useEffect)(()=>{if("flows"!==r)return void d(null);const e=window.sessionStorage.getItem("wcf_edge_insertion_context");if(e)try{const t=JSON.parse(e);if(t.sourceStepId&&t.targetStepId){const e=(new Vte).getAllowedStepTypesObject(t.sourceStepId,t.targetStepId,p,m);d(e);const n=Object.keys(e);n.length>0&&!e.hasOwnProperty(a)&&s(n[0])}}catch(e){console.error("[Library] Error parsing edge context:",e),window.sessionStorage.removeItem("wcf_edge_insertion_context")}else d(null)},[r,p,m]),(0,i.useEffect)(()=>()=>{window.sessionStorage.getItem("wcf_edge_insertion_context")&&window.sessionStorage.removeItem("wcf_edge_insertion_context")},[]),(0,i.useEffect)(()=>{w(h)},[a]),(0,o.createElement)("div",{className:`wcf-step-library wcf-step-library-${t}`},(0,o.createElement)("div",{className:"wcf-step-library__header bg-background-primary px-8 py-6 flex justify-between items-center sm:items-center -m-8 sm:flex-row flex-col gap-3"},(0,o.createElement)("h3",{className:"text-xl font-semibold text-text-primary m-0 flex items-center gap-2"},(0,o.createElement)(Va,{variant:"ghost",size:"xs","aria-label":(0,z.__)("Back to Flow","cartflows"),icon:(0,o.createElement)(HW,{className:"w-6 h-6 stroke-1 text-text-primary"}),onClick:()=>{n?e.push(`admin.php?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${n}`):e.push("admin.php?page=cartflows&path=flows")}}),(0,z.__)("Steps Library","cartflows")),"other"!==t&&"bricks-builder"!==t&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"gap-4 flex justify-between items-center"},(0,o.createElement)("div",{className:"wcf-search-steps--form w-56"},(0,o.createElement)(dp,{type:"text",value:l,onChange:function(e){if(c(e),e&&e.length>=3){const t=e.toLowerCase(),n=h.filter(function(e){return(e.title&&e.title.toLowerCase()||"").includes(t)});w(n)}else w(h)},placeholder:(0,z.__)("Search Steps","cartflows"),size:"md",prefix:(0,o.createElement)(FV,{className:"size-4 text-field-placeholder"}),suffix:l.length>=3?(0,o.createElement)(tL,{className:"size-4 cursor-pointer text-field-placeholder pointer-events-auto",onClick:()=>{c(""),w(h)}}):null})),(0,o.createElement)("span",{className:"divider w-px bg-background-secondary h-7"}),(0,o.createElement)(jH,null)))),(0,o.createElement)("div",{className:"wcf-step-library__body"},(0,o.createElement)("div",{className:"wcf-remote-content"},"other"!==t&&"bricks-builder"!==t&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-ready-templates"},(0,o.createElement)(Yte,{templates:g,currentStep:a,setcurrentStepCB:s,allowedStepTypes:u}))),("other"===t||"bricks-builder"===t)&&(0,o.createElement)("div",{className:"wcf-start-from-scratch current flex items-center justify-center min-h-[500px]"},(0,o.createElement)(Qte,null)))))},Zte=(0,sp.compose)((0,lp.withSelect)(e=>{const{getDefaultPageBuilder:t}=e("wcf/importer");return{default_page_builder:t()}}))(({default_page_builder:e})=>{const[{flow_id:t}]=ZR();return"library"===new URLSearchParams((0,b.useLocation)().search).get("tab")?(0,o.createElement)(Wte,null):(0,o.createElement)("div",{className:"wcf-flow-library wcf-flex"},"bricks-builder"!==e&&"other"!==e?(0,o.createElement)(C,{key:"importer",to:{pathname:"admin.php",search:`?page=cartflows&path=flows&action=wcf-edit-flow&flow_id=${t}&tab=library&sub=library`},className:"wcf-flow-library__item wcf-flow-library__item--readymade"},"Import from Library"):"",(0,o.createElement)(Bte,{page_builder:e}))}),Gte=(0,sp.compose)((0,lp.withSelect)(e=>{const{getStoreStepTypes:t}=e("wcf/importer");return{stepTypes:t()}}),(0,lp.withDispatch)(e=>{const{setSelectedStep:t}=e("wcf/importer");return{setSelectedStep(e){t(e)}}}))(({stepTypes:e,setSelectedStep:t})=>(0,o.createElement)("div",{className:"wcf-create-step__dropdown-list wcf-select-option w-full text-left"},(0,o.createElement)(VO,{onChange:e=>{t(e)},size:"md"},(0,o.createElement)(VO.Button,{placeholder:(0,z.__)("Select Step Type","cartflows"),render:t=>t?e[t]||t:""}),(0,o.createElement)(VO.Options,null,Object.keys(e).map(t=>(0,o.createElement)(VO.Option,{value:t,key:t},e[t])))))),Hte=(0,sp.compose)((0,lp.withSelect)(e=>{const{getFlowsCount:t,getcurrentFlowId:n,getselectedStep:r,getstepTypes:a,getcurrentFlowSteps:o,getCFProStatus:i,getWooCommerceStatus:s,getselectedStepTitle:l,getLicenseStatus:c}=e("wcf/importer");return{flowsCount:t(),currentFlowId:n(),selectedStep:r(),stepTypes:a(),currentFlowSteps:o(),cf_pro_status:i(),woocommerce_status:s(),selectedStepTitle:l(),license_status:c()}}))(({currentStep:e,stepName:t,currentFlowId:n,currentFlowSteps:r,cf_pro_status:a,woocommerce_status:s,stepTypes:l,license_status:c,setInputFieldVisibility:u,setErrorDesc:d})=>{const f=e.type||"",m=e.title||l[f]||"",[p,h]=(0,i.useState)("Import Step"),[g,w]=(0,i.useState)(!1),[y,b]=(0,i.useState)({cta:"",error_msg:""}),{cta:v}=y;if(v)return(0,o.createElement)(o.Fragment,null,(0,o.createElement)("span",{className:"wcf-message wcf-message--error",dangerouslySetInnerHTML:{__html:v}}));if(""===e.type)return(0,o.createElement)(Va,{variant:"primary",size:"md",disabled:!0},p);const x=r?r.filter(e=>f===e.type):[];if(console.log("selectedExistSteps.length",x.length),1<=x.length&&!wcfCartflowsPro())return u("hidden"),d((0,z.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")),"not-installed"===a?(0,o.createElement)(bp,{title:(0,z.__)("Get CartFlows Higher plan","cartflows")}):(d((0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 110 |
(0,z.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,o.createElement)(yp,null));if("upsell"===f||"downsell"===f){if(u("hidden"),!wcfCartflowsTypePlusPro())return wcfInactiveProPlus()?(d((0,z.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */ |
| 111 |
(0,z.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),f,cartflows_admin.cf_pro_type_inactive)),(0,o.createElement)(yp,null)):(d((0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 112 |
(0,z.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),f)),(0,o.createElement)(bp,{title:(0,z.__)("Get CartFlows Higher Plan","cartflows")}));if("Activated"!==c)return u("hidden"),d((0,z.__)("Activate license for adding more flows and other features.","cartflows")),(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)(_p,{title:`Activate License and ${p}`})))}return"pro"!==e.template_type||wcfCartflowsTypePro()?"landing"!==f&&"active"!==s?(u("hidden"),"inactive"===s?(d((0,z.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")),(0,o.createElement)(hp,{title:`Activate WooCommerce to Import ${m}`})):(0,o.createElement)(gp,null)):(u(""),(0,o.createElement)(Va,{variant:"primary",size:"md",loading:g,disabled:g,icon:(0,o.createElement)(QV,{className:"h-4 w-4 stroke-2"}),iconPosition:"left",onClick:()=>{((e,t,n,r,a,o,i,s)=>{if(console.log(e,t,n),o)return;n((0,z.__)("Importing Step..","cartflows")),a(!0);const l=new window.FormData;l.append("action","cartflows_import_step"),l.append("security",cartflows_admin.import_step_nonce),l.append("remote_flow_id",e.template_ID),l.append("flow_id",t),l.append("step",JSON.stringify(e)),l.append("step_name",r);const c=window.sessionStorage.getItem("wcf_edge_insertion_context");if(c)try{const e=JSON.parse(c);e.sourceStepId&&e.targetStepId&&(l.append("edge_source_step_id",e.sourceStepId),l.append("edge_target_step_id",e.targetStepId))}catch(e){window.sessionStorage.removeItem("wcf_edge_insertion_context")}L()({url:cartflows_admin.ajax_url,method:"POST",body:l}).then(e=>{if(e.success)a(!1),n((0,z.__)("Imported! Redirecting…","cartflows")),pp.success((0,z.__)("Step imported successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}`},3e3);else if("call_to_action"in e.data)i({cta:e.data.call_to_action}),s(e.data.message);else{let t=e.data.message;e.data.error_code&&404===e.data.error_code&&(t+=(0,z.__)(" Please sync the library and try importing the template again.","cartflows")),s(fh(t)),n((0,z.__)("Import Failed! Try again.","cartflows")),pp.error((0,z.__)("Failed to import step.","cartflows")),setTimeout(()=>{n((0,z.__)("Import Step","cartflows"))},3e3),a(!1)}}).finally(()=>{window.sessionStorage.removeItem("wcf_edge_insertion_context")})})(e,n,h,t,w,g,b,d)}},p)):(u("hidden"),"inactive"===a&&"pro"===wcfInactivepluginType()?(u("hidden"),d((0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 113 |
(0,z.__)("Access all of our pro templates by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,o.createElement)(yp,null)):(u("hidden"),d((0,z.__)("Access all of our pro templates when you upgrade your plan to CartFlows Pro today.","cartflows")),(0,o.createElement)(bp,{title:(0,z.__)("Get CartFlows Pro","cartflows")})))}),$te=(0,sp.compose)((0,lp.withSelect)(e=>{const{getcurrentFlowId:t,getselectedStep:n,getselectedStepTitle:r}=e("wcf/importer");return{currentFlowId:t(),selectedStep:n(),selectedStepTitle:r()}}))(({currentFlowId:e,selectedStep:t,selectedStepTitle:n,stepName:r,offerYesStepId:a="",offerNoStepId:s=""})=>{const[l,c]=(0,i.useState)({isProcessing:!1,buttonText:"Create Step"}),{isProcessing:u,buttonText:d}=l;return(0,o.createElement)(Va,{variant:"primary",size:"md",loading:u,disabled:u,onClick:o=>{o.preventDefault(),u||(c({isProcessing:!0,buttonText:(0,z.__)("Creating Step..","cartflows")}),((e,t,n,r,a,o="",i="")=>{console.log(e,t,n);const s=new window.FormData;s.append("action","cartflows_create_step"),s.append("flow_id",e),s.append("step_type",t),s.append("step_title",n),s.append("security",cartflows_admin.create_step_nonce),s.append("step_name",a),o&&s.append("offer_yes_step_id",o),i&&s.append("offer_no_step_id",i);const l=window.sessionStorage.getItem("wcf_edge_insertion_context");if(l)try{const e=JSON.parse(l);e.sourceStepId&&e.targetStepId&&("wcf_start_node"===e.sourceStepId||"start"===e.sourceStepId?s.append("is_start_edge","true"):s.append("edge_source_step_id",e.sourceStepId),s.append("edge_target_step_id",e.targetStepId),e.sourceHandle&&s.append("edge_source_handle",e.sourceHandle))}catch(e){console.error("[CartFlows] Error parsing edge context:",e),window.sessionStorage.removeItem("wcf_edge_insertion_context")}L()({url:cartflows_admin.ajax_url,method:"POST",body:s}).then(t=>{console.log(t),window.sessionStorage.removeItem("wcf_edge_insertion_context"),t.success?(r({isProcessing:!1,buttonText:(0,z.__)("Step Created! Redirecting…","cartflows")}),pp.success((0,z.__)("Step created successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${e}`},3e3)):(r({isProcessing:!1,buttonText:(0,z.__)("Failed to Create Step!","cartflows")}),pp.error((0,z.__)("Failed to create step.","cartflows")))})})(e,t,n,c,r,a,s))}},d)}),Xte=(0,sp.compose)((0,lp.withSelect)(e=>{const{getFlowsCount:t,getselectedStep:n,getstepTypes:r,getcurrentFlowSteps:a,getCFProStatus:o,getWooCommerceStatus:i,getLicenseStatus:s}=e("wcf/importer");return{flowsCount:t(),selectedStep:n(),stepTypes:r(),currentFlowSteps:a(),cf_pro_status:o(),woocommerce_status:i(),license_status:s()}}))(({selectedStep:e,currentFlowSteps:t,cf_pro_status:n,woocommerce_status:r,license_status:a,stepName:i,setInputFieldVisibility:s,setErrorDesc:l,offerYesStepId:c="",offerNoStepId:u=""})=>{if(""===e)return(0,o.createElement)("button",{className:"wcf-button wcf-primary-button",disabled:!0},(0,z.__)("Create Step","cartflows"));if(1<=(t?t.filter(t=>e===t.type):[]).length&&!wcfCartflowsPro())return s("hidden"),l((0,z.__)("Add multiple steps to your flows today with an upgraded CartFlows plan.","cartflows")),"not-installed"===n?(0,o.createElement)(bp,{title:(0,z.__)("Get CartFlows Higher Plan","cartflows")}):(l((0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 114 |
(0,z.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)),(0,o.createElement)(yp,{description:(0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 115 |
(0,z.__)("Add multiple steps to your flows by activating %s.","cartflows"),cartflows_admin.cf_pro_type_inactive)}));if("upsell"===e||"downsell"===e){if(!wcfCartflowsTypePlusPro())return wcfInactiveProPlus()?(s("hidden"),l((0,z.sprintf)(/* translators: %1$s, %2$s are variables */ /* translators: %1$s, %2$s are variables */ |
| 116 |
(0,z.__)("Add %1$s step to your flows by activating %2$s.","cartflows"),e,cartflows_admin.cf_pro_type_inactive)),(0,o.createElement)(yp,null)):(s("hidden"),l((0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 117 |
(0,z.__)("Add unlimited income boosting one-click %s to your flows when you upgrade to our CartFlows Higher plan today.","cartflows"),e)),(0,o.createElement)(bp,{title:(0,z.__)("Get CartFlows Higher Plan","cartflows")}));if(wcfCartflowsTypePlusPro()&&"Activated"!==a)return s("hidden"),l((0,z.__)("Activate license for adding more steps and other features.","cartflows")),(0,o.createElement)("div",{className:"wcf-name-your-flow__actions wcf-pro--required"},(0,o.createElement)("div",{className:"wcf-flow-import__button"},(0,o.createElement)(_p,{title:(0,z.__)("Activate License","cartflows")})))}return"landing"!==e&&"active"!==r?(s("hidden"),"inactive"===r?(l((0,z.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")),(0,o.createElement)(hp,null)):(0,o.createElement)(gp,null)):(s(""),l(""),(0,o.createElement)($te,{stepName:i,offerYesStepId:c,offerNoStepId:u}))}),qte=({stepName:e,setInputFieldVisibility:t,setErrorDesc:n,offerYesStepId:r="",offerNoStepId:a=""})=>(0,o.createElement)("div",{className:"wcf-create-step__button-wrap"},(0,o.createElement)(Xte,{stepName:e,setInputFieldVisibility:t,setErrorDesc:n,offerYesStepId:r,offerNoStepId:a})),Jte=({visibility:e,setVisibility:t,item:n,type:r,stepName:a,setStepName:s})=>{const l="show"===e,[c,u]=(0,i.useState)(""),[d,f]=(0,i.useState)(""),[m,p]=(0,i.useState)(0),[h,g]=(0,i.useState)(""),[w,y]=(0,i.useState)(""),{currentFlowSteps:b,selectedStep:v}=(0,lp.useSelect)(e=>({currentFlowSteps:e("wcf/importer").getcurrentFlowSteps(),selectedStep:e("wcf/importer").getselectedStep()})),x="ready-templates"===r?n&&("upsell"===n.type||"downsell"===n.type):"upsell"===v||"downsell"===v,_=Pte(b);return(0,o.createElement)($m,{open:l,setOpen:e=>{e||t("hide")},exitOnClickOutside:!1},(0,o.createElement)($m.Panel,{className:"sm:max-w-lg w-full"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)($m.Header,{className:"flex items-center justify-between !space-y-0"},(0,o.createElement)($m.Title,null,"hidden"===c?(0,z.__)("Upgrade Required","cartflows"):(0,z.__)("Name Your Step","cartflows")),(0,o.createElement)($m.CloseButton,null)),(0,o.createElement)($m.Body,null,(0,o.createElement)("div",{className:`${c}`},(0,o.createElement)("div",{className:"flex justify-between py-2"},(0,o.createElement)("label",{className:"flex gap-1 text-sm font-normal text-text-primary"},(0,z.__)("Step Name","cartflows")),(0,o.createElement)("span",{className:"text-xs font-normal "+(40===m?"text-brand-500":"text-field-placeholder")},m,"/40")),(0,o.createElement)(dp,{type:"text",value:a,onChange:e=>{e.length<=40&&(p(e.length),s(e))},placeholder:(0,z.__)("Enter Step Name","cartflows"),size:"md"})),"hidden"!==c&&x&&_.length>0&&(0,o.createElement)(Rte,{offerYesStepId:h,setOfferYesStepId:g,offerNoStepId:w,setOfferNoStepId:y,availableSteps:_}),""!==d&&(0,o.createElement)("p",{className:"text-sm font-regular text-text-secondary mt-3 m-0"},d)),(0,o.createElement)($m.Footer,{className:"flex gap-3 justify-end"},"ready-templates"===r&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"outline",size:"md",onClick:()=>t("hide")},(0,z.__)("Cancel","cartflows")),(0,o.createElement)(Hte,{currentStep:n,stepName:a,setInputFieldVisibility:u,setErrorDesc:f,offerYesStepId:h,offerNoStepId:w})),"create-your-own"===r&&(0,o.createElement)(qte,{stepName:a,setInputFieldVisibility:u,setErrorDesc:f,offerYesStepId:h,offerNoStepId:w}))))},Kte=(0,sp.compose)((0,lp.withSelect)(e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}}))(({selectedStep:e})=>{const[t,n]=(0,i.useState)("hide"),[r,a]=(0,i.useState)("");return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Jte,{visibility:t,setVisibility:n,type:"create-your-own",stepName:r,setStepName:a}),(0,o.createElement)("div",{className:"wcf-step-library--item wcf-step-library--item__start-scratch h-full bg-background-primary rounded-lg shadow-md relative p-5 box-border"},(0,o.createElement)("div",{className:"wcf-step-library--item--scratch-select text-center w-full h-full min-h-[400px] max-h-[400px] flex flex-col gap-4 items-center justify-center"},(0,o.createElement)("h3",{className:"text-base text-text-primary p-4 text-center font-medium m-0"},(0,z.__)("Select Step Type","cartflows")),(0,o.createElement)(Gte,null),(0,o.createElement)(Va,{variant:"primary",size:"md",disabled:""===e,icon:(0,o.createElement)(KO,{className:"h-18 w-18 stroke-2"}),iconPosition:"left",onClick:()=>{n("hide"===t?"show":"hide")}},(0,z.__)("Create Step","cartflows")),(0,o.createElement)("div",{className:"wcf-learn-how"},(0,o.createElement)("a",{href:getKbDocUrl(`${cartflows_admin.cf_domain_url}docs/cartflows-step-types/`),target:"_blank",rel:"noreferrer",className:"flex items-center gap-2 text-sm text-text-tertiary hover:text-brand-500"},(0,o.createElement)(xp,{className:"w-18 h-18 stroke-1"}),(0,z.__)("Learn More","cartflows")))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap border-0 border-t border-solid border-border-subtle absolute bottom-0 left-0 w-full"},(0,o.createElement)("div",{className:"wcf-item__heading text-base text-text-primary font-medium p-4 text-center"},(0,z.__)("Create from Scratch","cartflows")))))}),ene=(0,sp.compose)((0,lp.withSelect)(e=>{const{getFlowsCount:t,getcurrentFlowId:n,getselectedStep:r,getstepTypes:a,getcurrentFlowSteps:o,getCFProStatus:i,getWooCommerceStatus:s,getselectedStepTitle:l,getLicenseStatus:c}=e("wcf/importer");return{flowsCount:t(),currentFlowId:n(),selectedStep:r(),stepTypes:a(),currentFlowSteps:o(),cf_pro_status:i(),woocommerce_status:s(),selectedStepTitle:l(),license_status:c()}}))(({currentStep:e,stepName:t,currentFlowId:n,currentFlowSteps:r,cf_pro_status:a,woocommerce_status:s,stepTypes:l,license_status:c,setInputFieldVisibility:u,step_id:d})=>{const f=e.type||"",m=e.title||l[f]||"",[p,h]=(0,i.useState)("Choose"),[g,w]=(0,i.useState)(!1),[y,b]=(0,i.useState)("hide"),[v,x]=(0,i.useState)("");if(""===e.type)return(0,o.createElement)(Va,{variant:"primary",size:"md",disabled:!0},p);const _=r?r.filter(e=>f===e.type):[];if(console.log("selectedExistSteps.length",_.length),("upsell"===f||"downsell"===f)&&!wcfCartflowsPro()){if(u("hidden"),!wcfCartflowsTypePlusPro())return"not-installed"!==a||"pro"===cartflows_admin.cf_pro_type&&"plus"===cartflows_admin.cf_pro_type?(0,o.createElement)(yp,{description:(0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 118 |
(0,z.__)("Add unlimited income boosting one-click upsells to your flows by activating %s","cartflows"),cartflows_admin.cf_pro_type_inactive)}):(0,o.createElement)(bp,{desc:(0,z.__)("Add unlimited income boosting one-click upsells to your flows when you upgrade to our CartFlows Plus or Pro plan today.","cartflows"),title:"Get CartFlows Higher plan"});if("Activated"!==c)return u("hidden"),(0,o.createElement)(_p,{title:`Activate License and ${p}`})}return"pro"!==e.template_type||wcfCartflowsTypePro()?"landing"!==f&&"active"!==s?(u("hidden"),"inactive"===s?(0,o.createElement)(hp,{title:`Activate WooCommerce to Import ${m}`,description:(0,z.__)("You need WooCommerce plugin installed and activated to import this step.","cartflows")}):(0,o.createElement)(gp,null)):(u(""),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Va,{variant:"primary",size:"md",loading:g,disabled:g,onClick:()=>{((e,t,n,r,a,o,i,s,l)=>{if(o)return;n("Changing Template.."),a(!0);const c=new window.FormData;c.append("action","cartflows_update_step"),c.append("security",cartflows_admin.update_step_nonce),c.append("remote_flow_id",e.template_ID),c.append("flow_id",t),c.append("step_id",i),c.append("step",JSON.stringify(e)),c.append("step_name",r),L()({url:cartflows_admin.ajax_url,method:"POST",body:c}).then(e=>{console.log(e),e.success?(a(!1),n("Changed! Redirecting..."),pp.success((0,z.__)("Template changed successfully!","cartflows")),setTimeout(()=>{window.location=`${cartflows_admin.admin_base_url}admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${t}`},3e3)):"call_to_action"in e.data&&(n("Choose"),l(e.data.call_to_action),s("show"))})})(e,n,h,t,w,g,d,b,x)}},p),(0,o.createElement)(ZZ,{visibility:y,setVisibility:b,errorMessage:v}))):(u("hidden"),"not-installed"===a||"pro"!==cartflows_admin.cf_pro_type?(u("hidden"),(0,o.createElement)(bp,{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")})):(u("hidden"),(0,o.createElement)(yp,{description:(0,z.sprintf)(/* translators: %s is replaced with plugin name */ /* translators: %s is replaced with plugin name */ |
| 119 |
(0,z.__)("Access all of our pro templates by activating %s","cartflows"),cartflows_admin.cf_pro_type_inactive)})))}),tne=function({item:e,mode:t,step_id:n}){void 0===t&&(t="");const[r,a]=(0,i.useState)("hide"),[s,l]=(0,i.useState)("");return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Jte,{visibility:r,setVisibility:a,type:"ready-templates",stepName:s,setStepName:l,item:e}),(0,o.createElement)("div",{key:e.id,className:"wcf-template-item group cursor-pointer relative transition ease-in-out delay-150 rounded-lg shadow-md"},"pro"===e.template_type?(0,o.createElement)("div",{className:"z-10 absolute top-5 right-5"},(0,o.createElement)(Ym,null)):"",(0,o.createElement)("div",{className:"wcf-item__inner bg-background-primary border border-border-subtle"},(0,o.createElement)("div",{className:"wcf-item__thumbnail-wrap relative"},(0,o.createElement)("div",{className:"wcf-item__thumbnail overflow-hidden "+("upsell"===e.type||"downsell"===e.type?"max-h-[345px] min-h-[345px]":"min-h-[400px] max-h-[400px]")},(0,o.createElement)("img",{className:"wcf-item__thumbnail-image w-full",src:e.featured_image_url,alt:(0,z.__)("Step thumbnail image","cartflows")})),(0,o.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"},"default"===t&&(0,o.createElement)("div",{className:"mx-auto my-0 text-center flex flex-col gap-4 relative top-[35%]"},(0,o.createElement)("span",{className:"wcf-step-preview-wrap"},(0,o.createElement)(Va,{tag:"a",variant:"outline",size:"sm",href:e.link,target:"_blank",rel:"noreferrer",className:"mx-auto !w-fit no-underline !bg-background-primary/10 !border-white/30 !text-text-on-color hover:!bg-background-primary/20",icon:(0,o.createElement)(xp,{className:"w-4 h-4 stroke-2"})},(0,z.__)("Preview","cartflows"))),(0,o.createElement)("span",{className:"wcf-item__btn",onClick:()=>{a("hide"===r?"show":"hide")}},(0,o.createElement)(Va,{variant:"primary",size:"sm",className:"mx-auto !w-fit",icon:(0,o.createElement)(_H,{className:"w-4 h-4 stroke-2"})},(0,z.__)("Import","cartflows")))),"dynamic"===t&&(0,o.createElement)("div",{className:"mx-auto my-0 text-center relative top-1/2"},(0,o.createElement)(ene,{currentStep:e,stepName:"StepName",setInputFieldVisibility:a,step_id:n})))),(0,o.createElement)("div",{className:"wcf-item__heading-wrap border-0 border-t border-solid border-border-subtle"},(0,o.createElement)("span",{className:"wcf-item__heading block text-base text-text-primary font-medium p-4 text-center"},e.title)))))},nne=function(e){const{templates:t,currentStep:n,required_step_type:r,currentStepId:a,setcurrentStepCB:s}=e,l=t,{step_types:c}=(0,lp.useSelect)(e=>({step_types:e("wcf/importer").getStoreStepTypes()})),u=void 0===r?"default":"dynamic",d=void 0===r?c:r;let f=0;void 0!==a&&(f=a);const m=Object.entries(d);return(0,o.createElement)(i.Fragment,null,"default"===u&&(0,o.createElement)("div",{className:"wcf-remote-steps-filters flex gap-4 items-center p-8 mb-8 -m-8 bg-background-primary"},(0,o.createElement)("div",{className:"wcf-categories w-full"},(0,o.createElement)("div",{className:"wcf-step-type-filter--links sm:block lg:block hidden"},(0,o.createElement)(AQ.Group,{activeItem:n,variant:"rounded",size:"sm",width:"auto",className:"!bg-transparent !p-0 !ring-0 !gap-4",onChange:({value:e})=>{s(e.slug)}},m.map(([e,t])=>{const r=e===n;return(0,o.createElement)(AQ.Tab,{key:e,slug:e,text:t,className:"step-type-filter-item !px-1 !py-1 !font-medium "+(r?"!bg-transparent !shadow-none !text-brand-500":"")})}))),(0,o.createElement)("div",{className:"sm:hidden lg:hidden block"},(0,o.createElement)(VO,{value:n,onChange:e=>{s(e)},size:"sm"},(0,o.createElement)(VO.Button,null),(0,o.createElement)(VO.Options,null,m.map(e=>(0,o.createElement)(VO.Option,{key:e[0],value:e[0]},e[1]))))))),(0,o.createElement)("div",{className:"wcf-step-importer__list wcf-items-list wcf-row wcf-step-row grid grid-cols-1 sm:grid-cols-4 gap-6 p-6 bg-background-primary shadow-sm rounded-md"},(0,o.createElement)("div",{className:"wcf-start-from-scratch"},(0,o.createElement)(Kte,null)),l.map(e=>(0,o.createElement)(tne,{item:e,key:e.id,mode:u,step_id:f}))))},rne=(0,sp.compose)((0,lp.withSelect)(e=>{const{getselectedStep:t}=e("wcf/importer");return{selectedStep:t()}}))(({selectedStep:e})=>{const[t,n]=(0,i.useState)("hide"),[r,a]=(0,i.useState)(""),[{page_builder:s}]=ZR();return(0,o.createElement)(o.Fragment,null,(0,o.createElement)(Jte,{visibility:t,setVisibility:n,type:"create-your-own",stepName:r,setStepName:a}),(0,o.createElement)("div",{className:"wcf-step-library--item__start-scratch flex gap-6 mx-auto max-w-4xl px-10 py-14"},(0,o.createElement)("div",{className:"wcf-step-library--item__card relative bg-gray-25 p-5 flex flex-col gap-4 border border-border-subtle rounded-md items-center justify-center h-72 w-2/3"},(0,o.createElement)($p,{title:(0,z.__)("Create from Scratch","cartflows"),description:(0,z.__)("Select a step type to get started.","cartflows"),tag:"h3",size:"xs",className:"text-center text-base [&>p]:text-text-secondary"}),(0,o.createElement)("div",{className:"w-full"},(0,o.createElement)(Gte,null)),(0,o.createElement)(Va,{variant:"primary",size:"md",disabled:""===e,icon:(0,o.createElement)(KO,{className:"h-5 w-5 stroke-2"}),iconPosition:"left",onClick:()=>{n("hide"===t?"show":"hide")}},(0,z.__)("Create Step","cartflows"))),(0,o.createElement)("div",{className:"wcf-step-library--item__info flex flex-col gap-6 justify-center w-3/4"},(0,o.createElement)("h3",{className:"text-xl text-text-primary font-semibold m-0"},"bricks-builder"===s&&(0,z.__)("It seems that you are using the Bricks Builder.","cartflows"),"other"===s&&(0,z.__)("It seems that you are using the page builder other than Elementor, Beaver Builder, Block Builder.","cartflows")),(0,o.createElement)("span",{className:"text-base text-text-secondary font-normal mt-2"},"bricks-builder"===s&&(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"===s&&(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,o.createElement)("span",{className:"mt-2"},(0,o.createElement)("a",{className:"text-text-secondary hover:text-brand-500 flex items-center gap-2 text-sm",href:getKbDocUrl("https://cartflows.com/docs/how-to-use-cartflows-with-your-own-template/"),target:"_blank",rel:"noreferrer"},(0,z.__)("Learn How","cartflows"),(0,o.createElement)(xp,{className:"w-4 h-4 stroke-1"}))))))}),ane=function(){const e=(0,b.useHistory)(),[{page_builder:t,flow_id:n}]=ZR(),[r,a]=(0,i.useState)("upsell"),[s,l]=(0,i.useState)(""),{all_step_templates:c}=(0,lp.useSelect)(e=>({all_step_templates:e("wcf/importer").getAllStepTemplates()})),u=[];c.forEach(e=>{r===e.type&&u.push(e)});const[d,f]=(0,i.useState)(u);return(0,i.useEffect)(()=>{f(u)},[r]),(0,o.createElement)("div",{className:`wcf-step-library wcf-step-library-${t}`},(0,o.createElement)("div",{className:"wcf-step-library__header bg-background-primary px-8 py-6 flex justify-between items-center sm:items-center -m-8 sm:flex-row flex-col gap-3"},(0,o.createElement)("h3",{className:"text-xl font-semibold text-text-primary m-0 flex items-center gap-2"},(0,o.createElement)(Va,{variant:"ghost",size:"xs","aria-label":(0,z.__)("Back to Store Checkout","cartflows"),icon:(0,o.createElement)(HW,{className:"w-6 h-6 stroke-1 text-text-primary"}),onClick:()=>{n?e.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}`):e.push("admin.php?page=cartflows&path=store-checkout")}}),(0,z.__)("Steps Library","cartflows")),"other"!==t&&"bricks-builder"!==t&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"gap-4 flex justify-between items-center"},(0,o.createElement)("div",{className:"wcf-search-steps--form w-56"},(0,o.createElement)(dp,{type:"text",value:s,onChange:function(e){if(l(e),e&&e.length>=3){const t=e.toLowerCase(),n=u.filter(function(e){return(e.title&&e.title.toLowerCase()||"").includes(t)});f(n)}else f(u)},placeholder:(0,z.__)("Search Steps","cartflows"),size:"md",prefix:(0,o.createElement)(FV,{className:"size-4 text-field-placeholder"}),suffix:s.length>=3?(0,o.createElement)(tL,{className:"size-4 cursor-pointer text-field-placeholder pointer-events-auto",onClick:()=>{l(""),f(u)}}):null})),(0,o.createElement)("span",{className:"divider w-px bg-background-secondary h-7"}),(0,o.createElement)(jH,{template:"store-checkout"})))),(0,o.createElement)("div",{className:"wcf-step-library__body"},(0,o.createElement)("div",{className:"wcf-remote-content"},"other"!==t&&"bricks-builder"!==t&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-ready-templates"},(0,o.createElement)(nne,{templates:d,currentStep:r,setcurrentStepCB:a}))),("other"===t||"bricks-builder"===t)&&(0,o.createElement)("div",{className:"wcf-start-from-scratch current flex items-center justify-center min-h-[500px]"},(0,o.createElement)(rne,null)))))},one=(0,sp.compose)((0,lp.withSelect)(e=>{const{getDefaultPageBuilder:t}=e("wcf/importer");return{default_page_builder:t()}}))(({default_page_builder:e})=>{const[{flow_id:t}]=ZR();return"library"===new URLSearchParams((0,b.useLocation)().search).get("tab")?(0,o.createElement)(ane,null):(0,o.createElement)("div",{className:"wcf-flow-library wcf-flex"},"other"!==e?(0,o.createElement)(C,{key:"importer",to:{pathname:"admin.php",search:`?page=cartflows&action=wcf-edit-flow&flow_id=${t}&tab=library&sub=library`},className:"wcf-flow-library__item wcf-flow-library__item--readymade"},"Import from Library"):"",(0,o.createElement)(Kte,null))}),ine=function(){const[{step_data:e,page_builder:t,flow_id:n,step_id:r}]=ZR(),a=(0,b.useHistory)(),s={[e.type]:""},[l,c]=(0,i.useState)(e.type),{all_step_templates:u}=(0,lp.useSelect)(e=>({all_step_templates:e("wcf/importer").getAllStepTemplates()})),d=[];u.forEach(t=>{e.type===t.type&&d.push(t)});const f=async function(){r?a.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}&step_id=${r}`):a.push(`admin.php?page=cartflows&path=store-checkout&action=wcf-edit-flow&flow_id=${n}`)};return 0===Object.keys(e).length&&f(),(0,o.createElement)("div",{className:`wcf-step-library wcf-step-library-${t}`},(0,o.createElement)("div",{className:"wcf-step-library__header bg-background-primary px-8 py-6 flex justify-between items-center sm:items-center -m-8 sm:flex-row flex-col gap-3"},"other"!==t&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("h3",{className:"flex items-center gap-2 text-2xl font-semibold text-text-primary m-0"},(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(HW,{className:"w-6 h-6 stroke-1"}),onClick:f}),(0,z.sprintf)(/* translators: %s is replaced with the step title */ /* translators: %s is replaced with the step title */ |
| 120 |
(0,z.__)("Templates for %s","cartflows"),e.title)),(0,o.createElement)("div",{className:"wcf-step-library__step-actions"},(0,o.createElement)("div",{className:"wcf-tab-wrapper"},(0,o.createElement)("div",{className:"wcf-get-started-steps"}))))),(0,o.createElement)("div",{className:"wcf-step-library__body"},(0,o.createElement)("div",{className:"wcf-remote-content"},"other"!==t&&e&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-ready-templates current"},(0,o.createElement)(nne,{templates:d,currentStep:l,required_step_type:s,currentStepId:e.id,setcurrentStepCB:c}))),"other"===t&&(0,o.createElement)(o.Fragment,null,(0,o.createElement)("div",{className:"wcf-start-from-scratch current"},(0,o.createElement)(Kte,null))))))};function sne({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const lne=i.forwardRef(sne);function cne({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M11.78 5.22a.75.75 0 0 1 0 1.06L8.06 10l3.72 3.72a.75.75 0 1 1-1.06 1.06l-4.25-4.25a.75.75 0 0 1 0-1.06l4.25-4.25a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))}const une=i.forwardRef(cne);function dne({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M8.22 5.22a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L11.94 10 8.22 6.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const fne=i.forwardRef(dne),mne=({slides:e})=>{const[t,n]=(0,i.useState)(0),[r,a]=(0,i.useState)(!1);return(0,o.createElement)("div",{className:"slider-container mb-2"},(0,o.createElement)("div",{className:"slide-wrapper gap-2 border border-solid border-yellow-400 rounded-lg bg-alert-background-warning p-3"},(0,o.createElement)("div",{className:"slide flex items-center gap-2 "+(r?"fade-out":"fade-in")},(0,o.createElement)("div",{className:"wcf-payment-gateway-notice--icon flex"},(0,o.createElement)(lne,{className:"h-5 w-5 text-support-warning","aria-hidden":"true"})),(0,o.createElement)("div",{dangerouslySetInnerHTML:{__html:e[t]}})),e.length>1&&(0,o.createElement)("div",{className:"slider-dots"},(0,o.createElement)("button",{onClick:()=>{r||(a(!0),setTimeout(()=>{n(0===t?e.length-1:t-1),a(!1)},400))},className:"slider-button "+(0===t?"disabled":""),disabled:0===t},(0,o.createElement)(une,{className:"h-8 w-8","aria-hidden":"true"})),(0,o.createElement)("button",{onClick:()=>{r||(a(!0),setTimeout(()=>{n(t===e.length-1?0:t+1),a(!1)},400))},className:"slider-button "+(t===e.length-1?"disabled":""),disabled:t===e.length-1},(0,o.createElement)(fne,{className:"h-8 w-8","aria-hidden":"true"})))))},pne=function(){const e=new URLSearchParams((0,b.useLocation)().search),[{flow_type:t}]=ZR(),n=e.get("tab"),r=!!e.get("step_id"),a="true"===e.get("flow_settings"),i=cartflows_admin.cartflows_admin_notices,s=i.length>0&&!r&&!a;return(0,o.createElement)(o.Fragment,null,s&&(0,o.createElement)("div",{className:"wcf-notices-wrapper"},(0,o.createElement)(mne,{slides:i})),function(){let e="";switch(n){case"library":e="flows"===t?(0,o.createElement)(Zte,null):(0,o.createElement)(one,null);break;case"update-template":e=(0,o.createElement)(ine,null);break;default:e=(0,o.createElement)(Cte,null)}return e}())},hne=function(){const[e]=ZR();return function(){const[{options:e},t]=ZR(),n=function(n){const{name:r,value:a}=n.detail;if(r&&r.includes("[")){const n=r.split("["),o=[];for(let e=1;e<n.length;e++)o.push(n[e].split("]")[0]);const i=r.substr(0,r.indexOf("["));if("wcf-checkout-custom-fields"===i)return"";const s=e[i];if(!s||"object"!=typeof s)return;switch(o.length){case 2:s[o[0]][o[1]]=a;break;case 4:s[o[0]][o[1]][o[2]][o[3]]=a}t({type:"SET_OPTION",name:i,value:s})}void 0!==e[r]&&(window.wcfUnsavedChanges=!0,t({type:"SET_OPTION",name:r,value:a})),"wcf-pre-checkout-offer-product"===r&&(t({type:"SET_OPTION",name:"wcf-pre-checkout-offer-desc",value:null!==e["wcf-pre-checkout-offer-product"]?e["wcf-pre-checkout-offer-product"].product_desc:""}),t({type:"SET_OPTION",name:"wcf-pre-checkout-offer-product-title",value:null!==e["wcf-pre-checkout-offer-product"]?e["wcf-pre-checkout-offer-product"].product_name:""}))},r=[{type:"select"},{type:"select2"},{type:"checkbox"},{type:"text"},{type:"textarea"},{type:"code"},{type:"number"},{type:"radio"},{type:"color"},{type:"font"},{type:"product"},{type:"coupon"},{type:"image-selector"},{type:"toggle"},{type:"selectioncard"},{type:"select-with-logo"}];(0,i.useEffect)(()=>(e&&r.map(function(e){return document.addEventListener(`wcf:${e.type}:change`,n),""}),()=>{r.map(function(e){return document.removeEventListener(`wcf:${e.type}:change`,n),""})}),[e])}(),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(pne,null))},gne=function(e){const t=new URLSearchParams((0,b.useLocation)()?.search).get("flow_id");return"flows"===e.flowType?(YH.flow_id=t,YH.flow_type="flows"):(YH.flow_id=cartflows_admin.global_checkout_id,YH.flow_type="storeCheckout"),(0,o.createElement)(o.Fragment,null,(0,o.createElement)(WR,{reducer:WH,initialState:YH},(0,o.createElement)(hne,{type:e.flowType})))},wne=function(){const e=(0,b.useHistory)(),[t,n]=(0,i.useState)(1);(0,i.useEffect)(()=>{if(wcfCartflowsTypePro()){const t=new URLSearchParams(window.location.search);if(t.has("path")&&"free-vs-pro"===t.get("path")){t.delete("path");const n=`${window.location.pathname}${t.toString()?"?"+t.toString():""}`;e.push(n)}}},[]);const r=[{title:(0,z.__)("Checkout Features","cartflows"),features:[{feature:(0,z.__)("Modern Checkout Styles","cartflows"),description:(0,z.__)("Optimized replacement for the standard WooCommerce checkout page designed for higher conversion","cartflows"),free:!0,pro:!0},{feature:(0,z.__)("Custom Checkout Fields","cartflows"),description:(0,z.__)("Have complete control over the field editor to manage the fields as required","cartflows"),free:!0,pro:!0}]},{title:(0,z.__)("One-Click Upsells / Downsells","cartflows"),features:[{feature:(0,z.__)("Dynamic One-Click Upsells","cartflows"),description:(0,z.__)("Use cart contents or customer data to display relevant upsells for maximum conversion","cartflows"),free:!1,pro:!0},{feature:(0,z.__)("Dynamic Upsell Templates","cartflows"),description:(0,z.__)("Professional templates to help you sell more even if you’re not a designer","cartflows"),free:!1,pro:!0}]},{title:(0,z.__)("Order Bump Features","cartflows"),features:[{feature:(0,z.__)("Dynamic Order Bumps","cartflows"),description:(0,z.__)("Smart order bumps using customer data to display most relevant products or offers","cartflows"),free:!1,pro:!0}]},{title:(0,z.__)("Advanced Funnel Features","cartflows"),features:[{feature:(0,z.__)("A / B Split Testing","cartflows"),description:(0,z.__)("Increase conversions and sales with CartFlows A/B Testing by running simple tests","cartflows"),free:!1,pro:!0},{feature:(0,z.__)("Analytics","cartflows"),description:(0,z.__)("Analyze transactions and user behavior to refine conversions and make more profit","cartflows"),free:!1,pro:!0}]},{title:(0,z.__)("Bonus ($200 Value)","cartflows"),features:[{feature:(0,z.__)("Access to OttoKit Pro Plan","cartflows"),description:(0,z.__)("Cloud-based automation tools that intelligently links your websites, stores, plugins and apps","cartflows"),free:!1,pro:!0},{feature:(0,z.__)("SkillJet Academy Access","cartflows"),description:(0,z.__)("CartFlows offers full training to help you make more profit with SkillJet academy","cartflows"),free:!1,pro:!0}]},{title:(0,z.__)("Others Benefits","cartflows"),features:[{feature:(0,z.__)("Premium Support","cartflows"),description:(0,z.__)("Professional Support, Professional Support Team or Dedicated Support Team","cartflows"),free:!1,pro:!0},{feature:(0,z.__)("Amazing User Community","cartflows"),description:(0,z.__)("Amazing User Community is already a great message unless you’re looking for a different meaning","cartflows"),free:!0,pro:!0},{feature:(0,z.__)("Great Documentation & Video Tutorials","cartflows"),description:(0,z.__)("Comprehensive Documentation and Video Tutorials or Comprehensive Documentation and Video Guides","cartflows"),free:!0,pro:!0}]},{title:(0,z.__)("Free Plugins","cartflows"),features:[{feature:(0,z.__)("Variation Swatches","cartflows"),description:(0,z.__)("Give customers choice by including relevant product variations including size, color and more","cartflows"),free:!0,pro:!0},{feature:(0,z.__)("Stripe Payment Gateway","cartflows"),description:(0,z.__)("Accepting multiple payment methods gives customers choice and can significantly increase conversion","cartflows"),free:!0,pro:!0}]}],a=[{value:"starter-annual",label:(0,z.__)("Starter - Annual","cartflows"),price:99,term:(0,z.__)("/ year","cartflows")},{value:"plus-annual",label:(0,z.__)("Plus - Annual","cartflows"),price:199,term:(0,z.__)("/ year","cartflows")},{value:"pro-annual",label:(0,z.__)("Pro - Annual","cartflows"),price:299,term:(0,z.__)("/ year","cartflows")},{value:"plus-lifetime",label:(0,z.__)("Plus - Lifetime (One Time Pay)","cartflows"),price:699,term:(0,z.__)("for Lifetime","cartflows")},{value:"plus-lifetime-11-splitpay",label:(0,z.__)("Plus - Lifetime (11 x Split Pay)","cartflows"),price:69,term:(0,z.__)("x 11 Months","cartflows")},{value:"pro-lifetime",label:(0,z.__)("Pro - Lifetime (One Time Pay)","cartflows"),price:999,term:(0,z.__)("for Lifetime","cartflows")},{value:"pro-lifetime-11-splitpay",label:(0,z.__)("Pro - Lifetime (11 x Split Pay)","cartflows"),price:99,term:(0,z.__)("x 11 Months","cartflows")}],s=e=>"boolean"==typeof e?e?(0,o.createElement)(iV,{className:"w-6 h-6 stroke-2 text-support-success"}):(0,o.createElement)(tL,{className:"w-6 h-6 stroke-2 text-brand-500"}):e;return(0,o.createElement)(Gp,{containerType:"grid",cols:12,gap:"lg",className:"wcf-freevspro-page-wrapper w-full"},(0,o.createElement)(Gp.Item,{colSpan:8,className:"wcf-free-vs-pro-table flex flex-col gap-8 lg:col-span-8 md:col-span-12 col-span-12"},(0,o.createElement)("div",{className:"w-full"},(0,o.createElement)("div",{className:"bg-background-primary shadow-sm rounded-md border border-border-muted"},(0,o.createElement)(Gp,{direction:"row",justify:"between",align:"center",className:"w-full py-6 px-5 pr-6 box-border"},(0,o.createElement)("div",null,(0,o.createElement)($p,{tag:"h2",title:(0,z.__)("Free vs Pro","cartflows"),size:"md"}),(0,o.createElement)(th,{size:"sm",className:"m-0 pt-1",color:"text-text-secondary"},(0,z.__)("Explore the key differences between Plus and Pro to find the perfect fit for your needs.","cartflows"))),(()=>{const e=cartflows_admin?.cf_pro_status;return wcfCartflowsTypePro()?(0,o.createElement)(Va,{tag:"a",href:getUpgradeToProUrl(),target:"blank",variant:"primary",size:"sm"},(0,z.__)("Upgrade to Pro","cartflows")):"inactive"===e?(0,o.createElement)(yp,null):void 0})()),(0,o.createElement)(FQ,{className:"border-none"},(0,o.createElement)(FQ.Body,null,r.map((e,t)=>(0,o.createElement)(l().Fragment,{key:`cat-${t}`},(0,o.createElement)(FQ.Row,null,(0,o.createElement)(FQ.Cell,{className:"text-sm text-text-primary font-medium bg-background-secondary py-4 px-5"},e.title),(0,o.createElement)(FQ.Cell,{className:"text-sm text-text-primary font-medium bg-background-secondary py-4 px-5 text-center"},(0,z.__)("Free","cartflows")),(0,o.createElement)(FQ.Cell,{className:"text-sm text-text-primary font-medium bg-background-secondary py-4 px-5 text-center"},(0,z.__)("PRO","cartflows"))),e.features.map((e,n)=>(0,o.createElement)(FQ.Row,{key:`${t}-${n}`},(0,o.createElement)(FQ.Cell,{className:"text-sm font-normal text-text-secondary text-left py-4 px-5"},(0,o.createElement)(Gp,{direction:"row",align:"center",gap:"xs"},(0,o.createElement)(th,{as:"span",size:"sm",color:"text-text-secondary"},e.feature),(0,o.createElement)(Ja,{content:e.description,arrow:!0,placement:"bottom"},(0,o.createElement)(iU,{className:"w-[18px] h-[18px] stroke-1.5 text-brand-500 cursor-help"})))),(0,o.createElement)(FQ.Cell,{className:"text-sm font-normal text-text-secondary text-center py-4 px-5"},(0,o.createElement)("div",{className:"flex justify-center"},s(e.free))),(0,o.createElement)(FQ.Cell,{className:"text-sm font-normal text-text-secondary text-center py-4 px-5"},(0,o.createElement)("div",{className:"flex justify-center"},s(e.pro))))))))),(0,o.createElement)("div",{className:"border-t border-border-subtle text-base text-brand-500"},(0,o.createElement)("a",{href:getUtmUrl("https://cartflows.com/features/",{utm_campaign:"features"}),className:"flex items-center justify-center py-4 px-5 text-brand-500 hover:text-brand-500 no-underline",target:"blank"},(0,z.__)("See all CartFlows Pro features","cartflows"),(0,o.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"w-5 h-5 ml-2"},(0,o.createElement)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))))))),(0,o.createElement)(Gp.Item,{colSpan:4,className:"wcf-pricing-plans--wrapper lg:col-span-4 md:col-span-12 col-span-12 flex flex-col gap-6"},(0,o.createElement)("div",{className:"unlock-pro-features bg-background-primary p-6 shadow-sm rounded-lg border border-solid border-border-subtle flex items-center gap-6 md:flex-col flex-col-reverse"},(0,o.createElement)("div",{className:"flex flex-1"},(0,o.createElement)("img",{className:"md:w-72 w-full",src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzEzIiBoZWlnaHQ9IjI2NCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBjbGlwLXBhdGg9InVybCgjYSkiPjxtYXNrIGlkPSJiIiBzdHlsZT0ibWFzay10eXBlOmx1bWluYW5jZSIgbWFza1VuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeD0iMCIgeT0iMCIgd2lkdGg9IjMxMyIgaGVpZ2h0PSIyNjQiPjxwYXRoIGQ9Ik0zMTIuNDgzIDBILjUydjI2NGgzMTEuOTYzVjBaIiBmaWxsPSIjZmZmIi8+PC9tYXNrPjxnIG1hc2s9InVybCgjYikiPjxwYXRoIGQ9Ik0yNTAuNjg1IDEyMy40OTdjMzQuMTM0IDAgNjEuODAyLTI3LjY0NiA2MS44MDItNjEuNzQ5QzMxMi40ODcgMjcuNjQ2IDI4NC44MTkgMCAyNTAuNjg1IDBzLTYxLjgwNiAyNy42NDYtNjEuODA2IDYxLjc0OGMwIDM0LjEwMyAyNy42NzIgNjEuNzQ5IDYxLjgwNiA2MS43NDlaIiBmaWxsPSIjRjlDMUFFIi8+PHBhdGggZD0iTTI1Ni4xOCA0Ni4wMjNIMzEuMDc4djE2MS41NTVIMjU2LjE4VjQ2LjAyM1oiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNMjU2LjE3OSAyMDguNTkySDMxLjA3N2ExLjAxNyAxLjAxNyAwIDAgMS0xLjAxNS0xLjAxNFY0Ni4wMjJjMC0uNTU3LjQ1Ni0xLjAxNCAxLjAxNS0xLjAxNEgyNTYuMThjLjU1OSAwIDEuMDE1LjQ1NiAxLjAxNSAxLjAxNHYxNjEuNTU2YzAgLjU1OC0uNDU2IDEuMDE0LTEuMDE1IDEuMDE0Wm0tMjI0LjA4Ny0yLjAyOWgyMjMuMDcyVjQ3LjAzN0gzMi4wOTJ2MTU5LjUyNloiIGZpbGw9IiMxQTMxNDIiLz48cGF0aCBkPSJNNDkuMzA0IDYzLjQxYTUuODYyIDUuODYyIDAgMCAxLTUuODYzLTUuODYgNS44NjIgNS44NjIgMCAwIDEgNS44NjMtNS44NTkgNS44NjIgNS44NjIgMCAwIDEgNS44NjMgNS44NiA1Ljg2MiA1Ljg2MiAwIDAgMS01Ljg2MyA1Ljg1OVptMC05LjY3N2EzLjgyNSAzLjgyNSAwIDAgMC0zLjgyMSAzLjgzIDMuODI1IDMuODI1IDAgMCAwIDMuODIxIDMuODMgMy44MjUgMy44MjUgMCAwIDAgMy44MjEtMy44MyAzLjgyNSAzLjgyNSAwIDAgMC0zLjgyLTMuODNaTTY2LjUwNCA2Mi40MDhhNC44NDUgNC44NDUgMCAxIDAgMC05LjY5IDQuODQ3IDQuODQ3IDAgMCAwLTQuODQ4IDQuODQ1IDQuODQ3IDQuODQ3IDAgMCAwIDQuODQ4IDQuODQ1WiIgZmlsbD0iIzFBMzE0MiIvPjxwYXRoIGQ9Ik03OC44NjcgNTcuNTYzYTQuODQ1IDQuODQ1IDAgMCAwIDQuODQ4IDQuODQ1IDQuODQ1IDQuODQ1IDAgMSAwIDAtOS42OSA0Ljg0NSA0Ljg0NSAwIDAgMC00Ljg0OCA0Ljg0NVoiIGZpbGw9IiNGOUMxQUUiLz48cGF0aCBkPSJNMjIyLjg3NCA3MS45NDdINDAuMTUyYTEuMDE3IDEuMDE3IDAgMCAxLTEuMDE1LTEuMDE1YzAtLjU1Ny40NTYtMS4wMTQgMS4wMTQtMS4wMTRoMTgyLjcyM2ExLjAyIDEuMDIgMCAwIDEgMS4wMTUgMS4wMTQgMS4wMiAxLjAyIDAgMCAxLTEuMDE1IDEuMDE1WiIgZmlsbD0iIzFBMzE0MiIvPjxwYXRoIGQ9Im02Ni40NzIgNzYuNjUyLTE3LjY2MyAzNC43NDkgMTY5LjM1MiA4NS45MTMgMTcuNjYtMzQuNzQ5TDY2LjQ3MiA3Ni42NTJaIiBmaWxsPSIjRkY3QzQ4Ii8+PHBhdGggZD0iTTg2LjU1NSAxMDguNjk5Yy0yLjgzIDUuNTY4LTkuNjMzIDcuNzg3LTE1LjIwNiA0Ljk1OS01LjU3My0yLjgyOS03Ljc5My05LjYyNi00Ljk2My0xNS4xOTMgMi44My01LjU2OCA5LjYzNi03Ljc4NyAxNS4yMDYtNC45NTkgNS41NzMgMi44MjggNy43OTMgOS42MjYgNC45NjMgMTUuMTkzWiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0yMTEuMjY5IDE3Mi45ODNhLjk5Ljk5IDAgMCAxLS40Ni0uMTE0TDc2LjAwNyAxMDQuNDg4YTEuMDIzIDEuMDIzIDAgMCAxLS40NDQtMS4zNyAxLjAxNSAxLjAxNSAwIDAgMSAxLjM3MS0uNDQ0bDEzNC44MDMgNjguMzgxYy40OTUuMjU0LjY5Ny44NjMuNDQ0IDEuMzdhMS4wMDUgMS4wMDUgMCAwIDEtLjkuNTU4aC0uMDEyWk0xMDQuMzMgMTQzLjIxNmMtMS4xNTctMTEuODcxLTEuNjg5LTE4LjAyMS02LjAwNS0xNy44NDQtMy4zMTQuMTQtMy41NCA2LjM1NC0zLjQwMSA5Ljg1NC4wNC45NjQtMS4wMjcgMS41ODUtMS44NCAxLjA1My04LjI3Ni0xNS45OTItOS4yMjgtMTguNjkzLTEzLjA3Ny0xNy4yMS0yLjQ5Ny45NjQtMy4yODYgMy4yMjEtMS41NjIgOC4yNDMgMCAwLS44NDgtMS4zODItMS4yNTYtMi4wNTQtMi42ODgtNC4zNzUtOC4zMTMtLjgyNC01Ljg2MyAzLjI3MiAyLjkwNiA0Ljg0NSAxMC4wNCAxNC4xOTEgMTAuMDQgMTQuMTkxbC01LjM0MyAxMi40MDMgMjEuOTczIDYuNDU1czYuNTQ4LTE2LjE4MiA2LjMzNC0xOC4zNjNaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTk3Ljk5OSAxNjIuNTk2Yy0uMDkyIDAtLjE5LS4wMTMtLjI5NC0uMDM4bC0yMS45NzItNi40NTVhMS4wMDggMS4wMDggMCAwIDEtLjYzNC0uNTQ1IDEuMDE0IDEuMDE0IDAgMCAxLS4wMTItLjgzOGw1LjEwMS0xMS44NTdjLTEuNDk4LTEuOTc4LTcuMTgyLTkuNTM3LTkuNzQ3LTEzLjgxMS0xLjU2Mi0yLjU5OS0uNTItNS4wNzIgMS4zMDgtNi4xODlhNC4yOTggNC4yOTggMCAwIDEgNC43MzMuMTc4Yy0uMDUxLTIuMDY3LjY3NC0zLjk2OSAzLjEzNi00LjkyMSA0LjM4LTEuNjg2IDUuNzUxIDEuMDAyIDEyLjM3NSAxMy44ODdsMS43MjggMy4zNDhjLjA3Ni0uMDM4LjE2My0uMDg5LjE2My0uMDg5LS4yNjYtNy4wMTMgMS4yNDUtMTAuNzc5IDQuMzgtMTAuOTA2IDUuMjU2LS4yMTYgNS44NTEgNi4zNDEgNy4wMDggMTguMjQ5bC4wNDguNTA3Yy4yMTggMi4yNTgtNC44NDggMTQuOTktNi40MSAxOC44NDZhMSAxIDAgMCAxLS45NC42MzRIOThabS0yMC41OS04LjExNyAxOS45OTEgNS44NzJjMy4wMzYtNy41NzEgNi4wMTctMTUuODE0IDUuOTMtMTcuMDQ0bC0uMDUxLS41MDdjLTEuMTA2LTExLjMzOC0xLjcyOS0xNi40MjMtNC43ODUtMTYuNDIzaC0uMTE1Yy0yLjA0NS4wODgtMi42MDQgNC42MDMtMi40MzggOC44MDFhMi4xNzQgMi4xNzQgMCAwIDEtMS4xMTggMi4wMDMgMi4yIDIuMiAwIDAgMS0yLjI5NS0uMDYzIDEuMDk0IDEuMDk0IDAgMCAxLS4zNTctLjM4bC0xLjk2Ni0zLjgwNWMtNi40NzctMTIuNTY4LTcuMjczLTEzLjkxMi05LjgzOC0xMi45MjMtMS4wNDMuNDA2LTIuOTcgMS4xNDEtLjk4IDYuOTYyYTEuMDE0IDEuMDE0IDAgMCAxLTEuODI3Ljg1bC0xLjI1Ni0yLjA1NGMtMS4wMjctMS42NjItMi41MDItMS43ODktMy41MDQtMS4xOC0uOTc1LjU5Ni0xLjU0NiAxLjg3Ny0uNjIzIDMuNDEyIDIuODU4IDQuNzQzIDkuOTE0IDE0IDkuOTc4IDE0LjA4OS4yMy4yOTIuMjcuNjg1LjEyNiAxLjAxNWwtNC44ODMgMTEuMzUuMDEyLjAyNVoiIGZpbGw9IiMxQTMxNDIiLz48cGF0aCBkPSJNODMuMjExIDE0MS4xMjhjLS40MDQgMC0uOC0uMjU0LS45NTEtLjY2bC00Ljc2MS0xMi43OTZhMS4wMjggMS4wMjggMCAwIDEgLjU5OS0xLjMwNiAxLjAyOCAxLjAyOCAwIDAgMSAxLjMwOC41OTZsNC43NTYgMTIuNzk2Yy4xOS41Mi0uMDc1IDEuMTA0LS41OTQgMS4zMDZhMS4xNDcgMS4xNDcgMCAwIDEtLjM1Ny4wNjRaIiBmaWxsPSIjMUEzMTQyIi8+PHBhdGggZD0iTTcwLjc0MyAxNTEuNDg0Yy04LjU0NyAxNy44MDYtMTUuMDQ0IDMxLjAyLTE1LjA0NCAzMS4wMmwxNC4yNzggNDguMzgyYzkuODE1LTMuNzU0IDEzLjg2Mi04LjkxNSAzNC4wODMtNjkuMzk1bC0zMy4zMTctMTAuMDA3WiIgZmlsbD0iI0Y5QzFBRSIvPjxwYXRoIGQ9Ik02OS45NzggMjMxLjkwM2MtLjE1IDAtLjMwMS0uMDM4LS40NDQtLjEwMWExLjAwOSAxLjAwOSAwIDAgMS0uNTItLjYyMWwtMTQuMjc3LTQ4LjM4MmEuOTY4Ljk2OCAwIDAgMSAuMDYzLS43MzVjLjA2My0uMTI3IDYuNTg4LTEzLjQzMSAxNS4wNC0zMS4wMmExLjAxNiAxLjAxNiAwIDAgMSAxLjIwNC0uNTMzbDMzLjMyMSAxMC4wMDZjLjI2Ni4wNzYuNDg0LjI2Ni42MTEuNTA3cy4xNS41MzMuMDYzLjc4NmMtMTkuODkxIDU5LjQ1My0yNC4wNTMgNjUuOTM0LTM0LjY5MiA3MC4wMTdhLjkwMy45MDMgMCAwIDEtLjM3LjA2NHYuMDEyWk01Ni43OSAxODIuNjA5bDEzLjg1IDQ2LjkzNmM4LjM3Ni0zLjQ2MiAxMi43MDQtOS4zOTggMzIuMTI4LTY3LjM2N2wtMzEuNDk0LTkuNDZjLTcuNSAxNS42MjMtMTMuNDE4IDI3LjcxLTE0LjQ5NiAyOS44OTFoLjAxMloiIGZpbGw9IiMxQTMxNDIiLz48cGF0aCBkPSJNMTM1LjczMiAxODIuMjExYTEuODYzIDEuODYzIDAgMCAwIDEuNjczIDIuMDQxIDEuODY3IDEuODY3IDAgMSAwIC4zNjktMy43MTUgMS44NjQgMS44NjQgMCAwIDAtMi4wNDIgMS42NzRaIiBmaWxsPSIjRkNGRkZGIi8+PHBhdGggZD0iTTQzLjYyNSAxNjEuNzk2Yy0yLjAzIDAtMy45OTYtLjMxNy00LjExLS4zM2ExLjAwNyAxLjAwNyAwIDAgMS0uODM3LTEuMTY2IDEuMDA4IDEuMDA4IDAgMCAxIDEuMTY1LS44MzhjLjA0IDAgMy4yMTEuNTA4IDUuMzgzLjIxNmExLjAyIDEuMDIgMCAwIDEgMS4xNDIuODYzIDEuMDE1IDEuMDE1IDAgMCAxLS44NjQgMS4xNDFjLS41OTUuMDc2LTEuMjI5LjExNC0xLjg2My4xMTRoLS4wMTZaTTEyMS4wMDQgMzEuNzA1Yy0zLjg1NyAwLTYuOTkyLTMuMTMyLTYuOTkyLTYuOTc1IDAtMy44NDMgMy4xMzUtNi45ODggNi45OTItNi45ODggMy44NjEgMCA2Ljk5NyAzLjEzMyA2Ljk5NyA2Ljk4OCAwIDMuODU1LTMuMTM2IDYuOTc1LTYuOTk3IDYuOTc1Wm0wLTExLjkzNGMtMi43MjcgMC00Ljk2MyAyLjIyLTQuOTYzIDQuOTU5IDAgMi43NCAyLjIyNCA0Ljk0NiA0Ljk2MyA0Ljk0NmE0Ljk0NiA0Ljk0NiAwIDAgMCA0Ljk1MS00Ljk0NmMwLTIuNzI3LTIuMjItNC45NTktNC45NTEtNC45NTlaIiBmaWxsPSIjMUEzMTQyIi8+PHBhdGggZD0iTTE3Ny4zMTQgMjQyLjgxMmMtNi4yNDcgMC05LjMzMS00LjEwOS0xMi4zLTguMDc5LTIuNzk1LTMuNzI4LTUuNDQ3LTcuMjY2LTEwLjY3NS03LjI2NmExLjAxOCAxLjAxOCAwIDAgMS0xLjAxNS0xLjAxNWMwLS41NTguNDU2LTEuMDE0IDEuMDE1LTEuMDE0IDYuMjU5IDAgOS4zMjcgNC4xMDkgMTIuMyA4LjA3OCAyLjc5MSAzLjcyOSA1LjQ0MyA3LjI2NyAxMC42NzUgNy4yNjcgNS4yMjkgMCA3Ljg4LTMuNTI2IDEwLjY3NS03LjI2NyAyLjk2OS0zLjk2OSA2LjA1My04LjA3OCAxMi4zLTguMDc4IDYuMjQzIDAgOS4zMjcgNC4xMDkgMTIuMyA4LjA3OCAyLjcyOCAzLjY0IDUuMzA0IDcuMDg5IDEwLjI3OSA3LjI1NC41NTkuMDEzIDEuMDAzLjQ5NC45NzkgMS4wNTMtLjAxMi41NTgtLjQ3Mi45ODktMS4wNTQuOTc2LTUuOTU0LS4yMDMtOC45MzUtNC4xOTgtMTEuODQxLTguMDY2LTIuNzk0LTMuNzI4LTUuNDQ2LTcuMjY2LTEwLjY3NS03LjI2Ni01LjIzMiAwLTcuODg0IDMuNTI1LTEwLjY3OSA3LjI2Ni0yLjk2OSAzLjk3LTYuMDUzIDguMDc5LTEyLjI5NiA4LjA3OWguMDEyWiIgZmlsbD0iI0ZGN0M0OCIvPjxwYXRoIGQ9Ik0xNTguODU5IDE1My4xOTVjLTEuNDIzLTIuOTQyLTUuNDk4LTEuNjIzLTYuMzg2LTEuNDU4IDAgMCA1LjUzNC0yLjkxNyAzLjIxMS02LjE4OS0xLjUxLTIuMTMxLTUuNDgyLS44NS05LjIyOCAxLjA1MiAzLjI1LTIuMzgzIDQuODEyLTUuODk3IDIuNTc3LTcuNzIzLTIuMjQ0LTEuODM5LTYuMDkzLTIuMTgxLTIxLjgwNiA5LjM0Ny0yLjYwMSAxLjkxNS04LjExLTEuMjgxLTguMTEtMS4yODFsLTguODg4LTQuNjU0cy0uNzg1IDcuOTY0IDMuMjUxIDE1LjgxNGwtMy45NzIgMTYuMjA4IDIzLjU1OCA4LjgwMSAzLjY5NC0xMy42MzNjMi41NDktMS4yMTggMTguNDA1LTUuOTM1IDE5LjUzNC04LjA5MS41MzItMS4wMTUuMzY5LTIuMjU4LS4yMTQtMy4yNzIgMy4yNDctMi4yODMgMy40MDItMy42NzggMi43OTEtNC45NDZsLS4wMTIuMDI1WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMzMuMDUyIDE4NC4xNThhMS4xOCAxLjE4IDAgMCAxLS4zNTctLjA2NGwtMjMuNTU4LTguODAxYTEuMDI1IDEuMDI1IDAgMCAxLS42MzQtMS4xOTJsMy44ODUtMTUuODUzYy0zLjkzNi03LjkxMy0zLjIxMS0xNS43MTMtMy4xNzUtMTYuMDQyLjAzOS0uMzMuMjMtLjYzNC41MzUtLjc4N2EuOTc1Ljk3NSAwIDAgMSAuOTUxIDBsOC44ODcgNC42NTRjMS4zMi43NjEgNS4zNjggMi42IDcuMDQ0IDEuMzcgMTUuMTY3LTExLjEzNCAxOS45MzktMTEuODQ1IDIzLjA1MS05LjMwOC45NjMuNzg2IDEuNDQ3IDEuODUxIDEuNDIzIDMuMTA3LS4wMjguODc1LS4zMjEgMS44MDEtLjg0IDIuNzI3IDMuMDItLjkwMSA1LjEyOS0uNTU5IDYuMjQ3IDEuMDI3LjY4Ni45NjQuOTExIDIuMDQxLjY0NiAzLjExOS0uMjAyLjgzNy0uNjc0IDEuNTk4LTEuMjMzIDIuMjMyIDEuNDc1LjExNSAyLjk5Ny42OTggMy44MzMgMi40NDguOTI4IDEuOTQuMjA2IDMuNjc4LTIuNDQ5IDUuNzA3LjQyIDEuMTY3LjM4IDIuMzk3LS4xNTEgMy40MTEtLjgyNSAxLjU4Ni01LjQ1OCAzLjQxMi0xNC45MDEgNi42ODQtMS45OTQuNjg1LTMuNzQ2IDEuMjkzLTQuNjczIDEuNjc0bC0zLjU2OCAxMy4xNjRhLjk5Ny45OTcgMCAwIDEtLjUxOS42MzQuOTg3Ljk4NyAwIDAgMS0uNDY4LjExNGwuMDI0LS4wMjVabS0yMi4zNTMtMTAuNDUxIDIxLjY2NyA4LjEwNCAzLjQwMS0xMi41NTVjLjA4LS4yOTEuMjgyLS41Mi41NDctLjY0Ny44MjUtLjM5MyAyLjgwNy0xLjA3NyA1LjMwNC0xLjk0IDQuMjAyLTEuNDU4IDEyLjk1LTQuNDc3IDEzLjc3NS01LjcwNy4zMTctLjYyMS4yNDItMS40OTYtLjIwMi0yLjI4MmEuOTk3Ljk5NyAwIDAgMSAuMjg5LTEuMzMyYzMuMTYzLTIuMjMyIDIuNzE5LTMuMTcxIDIuNDYyLTMuNjc4LS44MDktMS42OTktMy4wNDUtMS40Mi00Ljg4NC0uOTc2bC0uMzguMDg4Yy0uNTA4LjEwMi0uOTc5LS4xOS0xLjE1OC0uNjU5LS4xNjItLjQ3LjA0LTEuMDAyLjQ4NC0xLjIzLjc3My0uNDA2IDIuODQyLTEuNzg4IDMuMTk5LTMuMjQ3LjExNS0uNTA3LjAxMi0uOTc2LS4zMjktMS40NzEtLjg5Mi0xLjI0My0zLjc3LS43NDgtNy45MzYgMS4zN2ExLjAyOCAxLjAyOCAwIDAgMS0xLjMzMi0uMzY4IDEgMSAwIDAgMSAuMjY1LTEuMzQ0YzEuOTE5LTEuNDA4IDMuMTc2LTMuMjIyIDMuMjExLTQuNjQyLjAxNi0uNjA5LS4yMDItMS4wOS0uNjctMS40ODQtMS44MjctMS40ODMtNS43LTEuNTM0LTIwLjU2NSA5LjM3Mi0zLjA2IDIuMjQ1LTguNjA1LS44NjItOS4yMjgtMS4yM2wtNy40MjQtMy44OGMwIDIuNjM3LjM2OCA4LjIzIDMuMTg3IDEzLjcwOS4xMTEuMjE1LjEzOC40NjkuMDg3LjcxbC0zLjc1OCAxNS4zMzItLjAxMi0uMDEzWiIgZmlsbD0iIzFBMzE0MiIvPjxwYXRoIGQ9Ik0xNDEuNjQ2IDE1OS4wMmEuOTk2Ljk5NiAwIDAgMS0uODc2LS41MDcgMS4wMTEgMS4wMTEgMCAwIDEgLjM2OC0xLjM4M2wxMC44MjYtNi4yNTJhMS4wMTQgMS4wMTQgMCAwIDEgMS4zODMuMzY4IDEuMDEgMS4wMSAwIDAgMS0uMzY4IDEuMzgybC0xMC44MjYgNi4yNTJjLS4xNjYuMDg5LS4zMjkuMTQtLjUwNy4xNFpNMTM2Ljg5NyAxNTMuMjg4Yy0uMzQxIDAtLjY4Ni0uMTc3LS44NzYtLjQ5NGExLjAyOCAxLjAyOCAwIDAgMSAuMzU3LTEuMzk1bDkuOTAyLTUuODM0YTEuMDI4IDEuMDI4IDAgMCAxIDEuMzk1LjM1NSAxLjAyNyAxLjAyNyAwIDAgMS0uMzU3IDEuMzk1bC05LjkwMiA1LjgyMWEuOTY0Ljk2NCAwIDAgMS0uNTE5LjE0di4wMTJaTTE0NC4zNzUgMTYzLjYzNWMtLjQwNSAwLS43ODUtLjI1NC0uOTUyLS42NDdhMS4wMDkgMS4wMDkgMCAwIDEgLjU4My0xLjMwNmwxMS42OTQtNC40NzdhMS4wMSAxLjAxIDAgMCAxIDEuMzA0LjU4MyAxLjAwNyAxLjAwNyAwIDAgMS0uNTgzIDEuMzA3bC0xMS42OSA0LjQ3NmEuODk2Ljg5NiAwIDAgMS0uMzY4LjA2NGguMDEyWk01My4yNzMgMTM0LjEzNWMuMjU0IDEzLjU5NS04LjU1NCAyOC42NjItMjEuNTQgMjguOTAzLTEyLjk5OC4yNC0yMy43MzYtMTAuNTc4LTIzLjk5LTI0LjE3Mi0uMjU0LTEzLjU5NiAxMC4wNzYtMjQuODA2IDIzLjA3NC0yNS4wNDcgMTIuOTk4LS4yNDEgMjIuMjAyIDYuNzIxIDIyLjQ1NiAyMC4zMTZaIiBmaWxsPSIjMUEzMTQyIi8+PHBhdGggZD0ibTIyLjY2IDE3Mi41NDktLjAzOS0xMS4wODRzMTEuOTMyLS41OTYgMTQuNjExLTE2LjI0NmMwIDAgMy4xNDgtMi4xMy45ODctMTMuOTVhMS4zOTYgMS4zOTYgMCAwIDEgMS4yNzMtMS42MzZjMy4zMzctLjIyOCAxMC44MjUtMS4xMDMgMTAuNzYyLTQuMzc1bDMuMzY1IDExLjQxNCA0Ljk5OS44MTFjLjQ3Mi4wNzYuOC40OTUuNzY1Ljk3N2wtLjU1OSA3LjAxM2MxLjA3OCA1LjU4IDIuNjI0IDEzLjQzLTEzLjQ4MSAxNS4yMDZsLjgyNCAxMi4zNTItMjMuNTIyLS40ODJoLjAxNloiIGZpbGw9IiNmZmYiLz48cGF0aCBkPSJNNDYuMTc4IDE3NC4wNDZjLS41MzEgMC0uOTc1LS40MDYtMS4wMTUtLjk1MWwtLjgyNC0xMi4zNTJhMS4wMDggMS4wMDggMCAwIDEgLjktMS4wNzhjNi4wMTctLjY2IDEwLTIuMjcgMTEuODQ0LTQuNzY4IDIuMDA2LTIuNzE1IDEuMzMyLTYuMTY0Ljc0OS05LjIwOGEyLjEyMiAyLjEyMiAwIDAgMS0uMDI4LS4zMTdsLjU2LTcuMDEzLTQuOTEyLS42OTdhMS4wMzkgMS4wMzkgMCAwIDEtLjgxMy0uNzExbC0zLjM2NS0xMS40MTNhMS4wMSAxLjAxIDAgMCAxIC42ODYtMS4yNTYgMS4wMDYgMS4wMDYgMCAwIDEgMS4yNTYuNjg1bDMuMTg3IDEwLjgwNSA0LjM2OC43MWExLjk0NyAxLjk0NyAwIDAgMSAxLjYxIDIuMDU0bC0uNTQzIDYuODc0Yy42MzQgMy4yOTggMS4zNjcgNy4zMTgtMS4xMyAxMC43MDQtMi4xMiAyLjg2Ni02LjE0NCA0LjY1NC0xMi4zIDUuNDY2bC43NjEgMTEuMzg4Yy4wMzYuNTU4LS4zOCAxLjA0LS45NCAxLjA3OGgtLjA3NS4wMjRaTTIyLjY1NiAxNzMuNTYzYTEuMDIgMS4wMiAwIDAgMS0xLjAxOS0xLjAxNWwtLjAzNS0xMi40NzljMC0uNTU4LjQ1NS0xLjAxNCAxLjAxNC0xLjAxNC42MzUuMDEyIDEuMDE1LjQ0NCAxLjAxNSAxLjAxNGwuMDQgMTIuNDc5YTEuMDIgMS4wMiAwIDAgMS0xLjAxNSAxLjAxNVoiIGZpbGw9IiMxQTMxNDIiLz48cGF0aCBkPSJNNDUuNzIxIDEzNC43NzNjLS4xMzggMC0uMjkzLS4wMzgtLjQzMi0uMTAxYTEuMDA1IDEuMDA1IDAgMCAxLS40ODMtMS4zNDVjLjA0LS4wNzYuOTA0LTEuODc3IDIuOTMzLTIuNTExIDEuNTUtLjQ4MiAzLjI4Ni0uMTY0IDUuMTc3LjkyNi40ODQuMjc5LjY1LjkwMS4zNjkgMS4zODMtLjI5LjQ4MS0uOTEyLjY0Ni0xLjM4NC4zNjctMS4zNzEtLjc5OS0yLjU2NS0xLjA1Mi0zLjU0LS43NDgtMS4xOC4zNTUtMS43MjggMS40NDYtMS43MjggMS40NDZhMS4wMjEgMS4wMjEgMCAwIDEtLjkxMi41NzF2LjAxMlpNNDguNDM2IDEzNy40MzJhNS40NSA1LjQ1IDAgMCAxLS4xNC0uOTg5YzAtLjE1MiAwLS4zMDQuMDY0LS40NDMuMjE0LS40MzIuOTY0LS40OTUgMS4xNjYtLjA3Ny4xMjcuMjY3LjIwNi41NTguMjQxLjgzNy4wNzYuNDQ0LjI2Ni44NjMuMDEyIDEuMzA3YS42NTYuNjU2IDAgMCAxLS40NDQuMzI5Yy0uNDU1LjA4OS0uNzEtLjMwNC0uODEyLS42MjFhMy45NTMgMy45NTMgMCAwIDEtLjEtLjM1NWwuMDEzLjAxMloiIGZpbGw9IiMxQTMxNDIiLz48cGF0aCBkPSJNNDIuOTY4IDE0NC44NzRjLTEuNDg2IDIuNjg5LTUuMTMgMy41MzktOC4xMjYgMS44NzctMi45OTMtMS42NjEtNC4yMjYtNS4xODYtMi43MjctNy44NzUgMS40ODYtMi42ODkgNS4xMy0zLjUzOCA4LjEyMi0xLjg3NyAyLjk5NyAxLjY2MSA0LjIzIDUuMTg3IDIuNzMxIDcuODc1WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0zOC4wMTkgMTQ1LjM1N2MtLjM0MSAwLS42ODYtLjE3Ny0uODc3LS40OTRhMS4wMTcgMS4wMTcgMCAwIDEgLjM1Ny0xLjM5NWwxLjExOC0uNjYtMi43OTQtMi42MzhhMS4wMDUgMS4wMDUgMCAwIDEtLjAzNi0xLjQzMyAxLjAwNCAxLjAwNCAwIDAgMSAxLjQzLS4wMzhsMy43ODYgMy41NjRjLjIyNi4yMTUuMzUzLjUzMi4zMTguODUtLjA0LjMxNy0uMjE4LjU5Ni0uNDk2Ljc2bC0yLjI3MSAxLjM0NWEuOTg5Ljk4OSAwIDAgMS0uNTI0LjEzOWgtLjAxMVpNNTkuMjU1IDE0OC43ODNINTQuNTNhMS4wMTggMS4wMTggMCAwIDEtMS4wMTQtMS4wMTVjMC0uNTU4LjQ1Ni0xLjAxNCAxLjAxNC0xLjAxNGg0LjcyNWExLjAyIDEuMDIgMCAwIDEgMS4wMTUgMS4wMTQgMS4wMiAxLjAyIDAgMCAxLTEuMDE1IDEuMDE1WiIgZmlsbD0iIzFBMzE0MiIvPjxwYXRoIGQ9Ik0yNDQuODU5IDMxLjM4NnMtNDMuOTIxLTIuODE1LTU4LjU0NC0yLjAyOWMtOS42NDQuNTA3LTI1LjI4MiAzLjU5LTM1LjU5MiAxNS4wMjgtMTAuMjkxIDExLjQ0LTIwLjQyMyAyMy4wOTQtOS43MiAzMC45MTkgMi4xNjggMS41ODUgNC4zMTMgMi4xMyA2LjQyMiAxLjk3OC4zOTIgMi4zNzIgMS43NjQgNC41NzkgNC40NDMgNi41MzIgMTAuNjk5IDcuODI0IDIwLjk5My05LjY1MSAyNi4zODgtMTEuMjUgMS4yOTctLjM4IDMuMDcyLS43OTggNS4wMzktMS4yMTcuNTU5IDMuNzQyIDMuMjEgNy42NiAxMC40NDkgMTAuNDI1IDAgMC0xMy42MjEgOC43NzUtMTcuOTg5IDE0LjI5Mi00LjM2NCA1LjUzLTcuMTcxIDE3Ljg4MiAxLjE2OSAyMS43NSA4LjM0MSAzLjg2OCAyNi44MzMtMTEuMyAzMC44ODQtMTIuOTM2IDQuMDM1LTEuNjM2IDM3LjM0NC0xLjg3NyA0OC4zODQtMTQuNzYybC0xMS4zMjEtNTguNzNoLS4wMTJaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTE4MC4wOTUgMTE5LjQ2NGMtMS4zMDkgMC0yLjUyNi0uMjI5LTMuNjA0LS43MjMtMi44ODItMS4zMzItNC44MTItMy43NTQtNS41ODUtNi45NzUtMS4zMzYtNS42MDUgMS4wOS0xMi41OTMgNC4wMzUtMTYuMzM1IDMuNTY4LTQuNTE0IDEyLjg3MS0xMC45NDQgMTYuNjQxLTEzLjQ2OC01LjA2Ni0yLjMwOC04LjExLTUuNDY1LTkuMDg5LTkuNDIyLTEuNjQ5LjM2OC0yLjk4MS42OTctMy45NDguOTg5LTEuNDE5LjQxOC0zLjU0IDIuMzk3LTUuNzc2IDQuNTAyLTUuNjQ4IDUuMjg4LTEzLjM5IDEyLjUxNy0yMS41IDYuNTk0LTIuNDYyLTEuOC00LjAzNi0zLjkxOC00LjY1OC02LjMxNS0yLjE3Mi0uMDM4LTQuMjUzLS43NzQtNi4yMDgtMi4xOTQtMi45NTctMi4xNjktNC42MjItNC43ODEtNC45MjctNy43NzQtLjc5Ny03LjY0NyA3LjMyNi0xNi42NzcgMTQuNDk2LTI0LjY0IDExLjQ2NC0xMi43MzQgMjkuMTk1LTE0Ljk5MSAzNi4yOTEtMTUuMzcyIDE0LjUyMy0uNzczIDU4LjIyNiAyLjAwNCA1OC42NyAyLjAzLjQ1Ni4wMjUuODQ4LjM2Ny45NC44MjRsMTEuMzIxIDU4LjczYS45ODcuOTg3IDAgMCAxLS4yMjYuODVjLTguNjQ2IDEwLjA4Mi0zMC4xODYgMTIuNjA1LTQxLjc2NSAxMy45NzUtMy4zMDkuMzkzLTYuMTY4LjcyMy03LjAxNiAxLjA2NS0uOTE2LjM2OC0yLjg1OCAxLjYzNi01LjEwNSAzLjEyLTYuNjI0IDQuMzM3LTE2LjA5NCAxMC41MjYtMjIuOTc2IDEwLjUyNmwtLjAxMS4wMTNabTMuMTk5LTQ5LjE0M2MuMjAyIDAgLjQwOC4wNjQuNTgyLjE3OC4yMy4xNjUuMzgxLjQwNi40Mi42ODUuNjExIDQuMTM0IDMuOTA5IDcuMzggOS43OTkgOS42MjUuMzU3LjE0LjYxMS40NTcuNjQ2LjgzNy4wNC4zOC0uMTM4Ljc0OS0uNDU1Ljk2NC0uMTM5LjA4OS0xMy41MjkgOC43MzgtMTcuNzQ3IDE0LjA3Ny0yLjY1MiAzLjM2MS00Ljg0OCA5LjYyNi0zLjY1NSAxNC41OTcuNjIyIDIuNjM4IDIuMTMzIDQuNTE1IDQuNDU2IDUuNjA2IDUuNzc1IDIuNjc1IDE3LjU2OC01LjA0OCAyNC42MjQtOS42NjQgMi41MjktMS42NjIgNC4zNjgtMi44NTMgNS40NTgtMy4yOTcgMS4xMDYtLjQ0NCAzLjY3MS0uNzQ5IDcuNTQtMS4yMDUgMTEuMTQ2LTEuMzA3IDMxLjc4Ny0zLjcyOSA0MC4xMzktMTIuOTFsLTExLjA4NC01Ny40NzVjLTUuOTc3LS4zNjgtNDQuMzI1LTIuNjg5LTU3LjY0LTEuOTkxLTYuODQxLjM2OC0yMy45MjYgMi41MjQtMzQuODk0IDE0LjY5OC02Ljg3OCA3LjY0OC0xNC42ODcgMTYuMzIyLTEzLjk4NSAyMy4wNjkuMjU0IDIuNDM1IDEuNTk3IDQuNTE0IDQuMTEgNi4zNCAxLjg0IDEuMzQ1IDMuNzM1IDEuOTI4IDUuNzUyIDEuNzg5LjUxOS0uMDM4Ljk4Ny4zMyAxLjA3OC44NS4zNjkgMi4yMzEgMS42ODkgNC4xNiA0LjA0OCA1Ljg3MSA2Ljc1NCA0LjkzNCAxMy40OTMtMS4zNyAxOC45MTYtNi40MyAyLjUyNS0yLjM3MSA0LjcwOS00LjQxMyA2LjU4OC00Ljk3MSAxLjIxNy0uMzU1IDIuOTI5LS43NzMgNS4xMTMtMS4yNDMuMDc2LS4wMTIuMTM5LS4wMjUuMjE0LS4wMjVsLS4wMjMuMDI1WiIgZmlsbD0iIzFBMzE0MiIvPjxwYXRoIGQ9Ik0xNDcuNDI1IDc4LjI5NmMtLjM4MSAwLS43NDktLjIxNi0uOTE2LS41N2ExLjAyNCAxLjAyNCAwIDAgMSAuNDcyLTEuMzU4Yy4wNDctLjAyNSA1LjY2LTIuNzY0IDExLjU2My05LjQxIDYuMzk4LTcuMTkgMjMuMjY0LTYuMjAxIDIzLjk3OC02LjE1LjU0My4wMzguOTUxLjQ4MS45NTEgMS4wMjYgMCAuMDY0LS4wNzUgNi40My43ODUgOS4yMDhhMS4wMTggMS4wMTggMCAwIDEtLjY3IDEuMjY4IDEuMDIzIDEuMDIzIDAgMCAxLTEuMjcyLS42NzJjLS43NDYtMi40MS0uODYxLTYuODYxLS44NzItOC44NTItMy42MzEtLjEwMi0xNi40NTUtLjAyNi0yMS4zNzggNS41MTYtNi4yMDggNi45NzUtMTEuOTcxIDkuNzc4LTEyLjIwOSA5Ljg5MmExLjA4OCAxLjA4OCAwIDAgMS0uNDMyLjEwMloiIGZpbGw9IiMxQTMxNDIiLz48cGF0aCBkPSJNMTkzLjczOSA4Mi43ODdhMS4wMiAxLjAyIDAgMCAxLS43MzQtMS43MjVjLjA3Ni0uMDc2IDcuNDQ5LTcuNzYxIDQuMzQxLTEzLjEtMy4xOTktNS40NzktMTQuNzM4LTUuMTM2LTE0Ljg1My01LjEzNmExLjAxNCAxLjAxNCAwIDAgMS0xLjA1NS0uOTc3IDEuMDIyIDEuMDIyIDAgMCAxIC45OC0xLjA1MmMuNTA3LS4wMTMgMTIuODcxLS4zODEgMTYuNjggNi4xMzggMy44ODUgNi42NTgtNC4yOTMgMTUuMTY3LTQuNjQ2IDE1LjUzNWExLjA0MSAxLjA0MSAwIDAgMS0uNzI1LjMwNGwuMDEyLjAxM1oiIGZpbGw9IiMxQTMxNDIiLz48cGF0aCBkPSJNMTkwLjAzMyA3My4zMTRjLS4zOTYgMC0uNzc3LS4yNC0uOTM5LS42MzRhMSAxIDAgMCAxIC41NTktMS4zMTlsOC43NDQtMy41ODlhMS4wMDUgMS4wMDUgMCAwIDEgMS4zMi41NTggMS4wMDUgMS4wMDUgMCAwIDEtLjU1OSAxLjMybC04Ljc0NCAzLjU4OGMtLjEyNy4wNS0uMjU0LjA3Ni0uMzgxLjA3NlpNMTYyLjc5NSA2NC44MzZsLTI3Ljc2OCAyMy4yMjMgMjMuMjQxIDI3Ljc0NSAyNy43NzItMjMuMjIzLTIzLjI0NS0yNy43NDVaIiBmaWxsPSIjMUEzMTQyIi8+PHBhdGggZD0iTTE2Ni41IDk3LjQ2Yy0zLjk0OCAzLjI5OC05LjgyNiAyLjc3OC0xMy4xMjQtMS4xNjYtMy4zMDItMy45NDQtMi43ODMtOS44MTYgMS4xNjUtMTMuMTEzIDMuOTQ4LTMuMjk4IDkuODI3LTIuNzc4IDEzLjEyNSAxLjE2NiAzLjMwMiAzLjk0NSAyLjc3OSA5LjgxNi0xLjE2NiAxMy4xMTRaIiBmaWxsPSIjRkY3QzQ4Ii8+PHBhdGggZD0ibTI2Mi42NTIgMjEuNzM4LTIyLjIyNiA0LjU5OSAxNC45MTIgNzEuOTQgMjIuMjIyLTQuNTk5LTE0LjkwOC03MS45NFoiIGZpbGw9IiMxQTMxNDIiLz48cGF0aCBkPSJtMTguOTMgMTcxLjc3Ny4wNC03Ljk1MiAyOC41NzItLjc4NiAxMS4xNyAxMC4wNjktMzkuNzgyLTEuMzMxWiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Im01OC43MTEgMTc0LjEyMS0zOS44MTgtMS4zMTlhMS4wMDMgMS4wMDMgMCAwIDEtLjk3OS0xLjAxNGwuMDUyLTcuOTUyYzAtLjU0NS40NDQtLjk4OS45OS0xLjAxNGwyOC41NzMtLjc4N2MuMjMgMCAuNTA3LjA4OS43MS4yNjdsMTEuMTcgMTAuMDY5Yy4zMTcuMjc5LjQyLjczNi4yNjYgMS4xMjktLjE1MS4zOC0uNTMxLjYzNC0uOTQuNjM0bC0uMDI0LS4wMTNabS0zOC43NjMtMy4zMjIgMzYuMDA4IDEuMTkyLTguNzk2LTcuOTM5LTI3LjE3Ni43NDgtLjAzNiA1Ljk4NnYuMDEzWiIgZmlsbD0iIzFBMzE0MiIvPjxwYXRoIGQ9Ik0xMDguMzE5IDE2Ny4wMDhhNDkzMy42NTQgNDkzMy42NTQgMCAwIDEtMTIuNTkgMzIuMDk4Yy0yMS42MDctMjQuNzkzLTI2LjQ3OS0yOC4zNy00OC42MDYtMzAuNzI4LS42MDYtLjA2NC0xNS4zOTYtLjE1Mi0yNC43NzUuNTU4LTE3LjUwNCAxLjMxOS0yNy4yMTYgMjEuNTg0LTE1Ljk3IDczLjc5NnYyMC4yNjZIODEuN3MtLjc3My0yMS4zNDQtLjgzNi0yMi4zNzFjMTAuNTgzIDkuNiAyNS42MjcgOS4wNDIgMzIuODQ5IDUuNjE4IDkuNDgyLTQuNTAyIDEzLjEyNS05Ljk1NSAyOC42MTItNzEuODE4bC0zNC4wMDctNy40MDZ2LS4wMTNaIiBmaWxsPSIjRjlDMUFFIi8+PHBhdGggZD0iTTgxLjY5OCAyNjMuOTk5Yy0uNTQ2IDAtLjk5LS40MzEtMS4wMTQtLjk3NiAwLS4yMTYtLjc5LTIxLjM0NC0uODQtMjIuMzU4YTEuMDAxIDEuMDAxIDAgMCAxIC41ODYtLjk2NCAxLjAxIDEuMDEgMCAwIDEgMS4xMTguMTY1YzEwLjI0MyA5LjI4MyAyNC43MjMgOC43NzUgMzEuNzMxIDUuNDUzIDguNzk2LTQuMTczIDEyLjM0LTguNDU5IDI3LjgxMi03MC4xMzFsLTMyLjEyOC03LjAwMWE1MTYwLjAzOCA1MTYwLjAzOCAwIDAgMS0xMi4yNzMgMzEuMjg3Ljk4Mi45ODIgMCAwIDEtLjc3Ny42MjEgMS4wMjIgMS4wMjIgMCAwIDEtLjk0LS4zM2MtMjEuMjM0LTI0LjM2Mi0yNS43NTMtMjguMDI3LTQ3Ljk0LTMwLjM4Ni0uNjg1LS4wNTEtMTUuMTMtLjE2NC0yNC41ODguNTU4LTUuNTczLjQxOS0xMC4wNTIgMi44NDEtMTMuMzE1IDcuMjA0LTguMDQ3IDEwLjc0MS04LjY1NyAzMy4zNC0xLjc1MiA2NS4zNjMuMDEyLjA3Ni4wMjguMTM5LjAyOC4yMTV2MjAuMjY2YTEuMDIgMS4wMiAwIDAgMS0xLjAxOSAxLjAxNCAxLjAyIDEuMDIgMCAwIDEtMS4wMTUtMS4wMTRWMjQyLjgyYy03LjA5NS0zMy4wMjMtNi4zODItNTUuNTIxIDIuMTIxLTY2LjkwOSAzLjYzMS00Ljg0NSA4LjYwNi03LjU0NiAxNC43OS04LjAwMyA5LjI2NC0uNjk3IDI0LjE4LS42MzQgMjQuOTUzLS41NDUgMjIuMzkyIDIuMzg0IDI3LjcwOCA2LjQwNCA0OC4xNyAyOS44MTVhNDMyNi4yMzMgNDMyNi4yMzMgMCAwIDAgMTEuOTcxLTMwLjUzOCAxLjAwNCAxLjAwNCAwIDAgMSAxLjE2OS0uNjIxbDM0LjAwMyA3LjQwNmMuMjcuMDYzLjQ5Ni4yMjguNjUuNDU2LjEzOS4yMjkuMTkxLjUyMS4xMjcuNzg3LTE1LjIzMyA2MC44MDktMTguODc2IDY3LjU5NS0yOS4xNzEgNzIuNDktNy4xMDcgMy4zNzMtMjEuMzkgNC4wNzEtMzIuMTc5LTQuMjg3LjIxOCA1LjYwNS43MjUgMTkuMzc4Ljc1IDIwLjA4OGExLjAxNSAxLjAxNSAwIDAgMS0uOTc2IDEuMDUzaC0uMDRsLS4wMTEtLjAxM1oiIGZpbGw9IiMxQTMxNDIiLz48cGF0aCBkPSJNOTAuMjc5IDIxMy43NjhjLS4xMjcgMC0uMjU0LS4wMjYtLjM4LS4wNzdhMS4wMiAxLjAyIDAgMCAxLS41NzYtMS4zMTlsNS40NTktMTMuNjQ1Yy4yMDYtLjUyLjgtLjc3NCAxLjMyLS41NzEuNTIzLjIwMy43NzcuNzk5LjU3IDEuMzE5bC01LjQ1NCAxMy42NDZhMS4wMiAxLjAyIDAgMCAxLS45NC42MzR2LjAxM1pNODAuODU2IDI0MS42MjhhLjk3My45NzMgMCAwIDEtLjYxOC0uMjE2bC0yNS4xNi0xOS40MjhhMS4wMTIgMS4wMTIgMCAxIDEgMS4yNDUtMS41OThsMjUuMTU2IDE5LjQyOGMuNDQ0LjM0My41MjMuOTc3LjE3OCAxLjQyYTEuMDIyIDEuMDIyIDAgMCAxLS44LjM5NFpNNDMuNCAxNjEuODIzYTE2LjUzIDE2LjUzIDAgMCAxLTIuNjUyLS4yMDJjLS41NDctLjEwMi0uOTI4LS42MjItLjgyNS0xLjE2N2EuOTk4Ljk5OCAwIDAgMSAxLjE2Ni0uODI0Yy4wMTEgMCAyLjAxNy4zNDIgNC4xMzguMDVhMS4wMiAxLjAyIDAgMCAxIDEuMTQyLjg2MyAxLjAxMiAxLjAxMiAwIDAgMS0uODYgMS4xNDFjLS43MzguMTAxLTEuNDYzLjEzOS0yLjExLjEzOVpNMTQwLjkgNjYuNjk2Yy0uNDA5IDAtLjc4OS0uMjU0LS45NTItLjY2YTEuMDEgMS4wMSAwIDAgMSAuNTgzLTEuMzA2Yy4wNTItLjAxMyA0LjgzNi0xLjkxNSA4LjIwMi04LjQyIDEuNTczLTMuMDU3LTIuMDU4LTcuNTQ2LTIuMDk3LTcuNTg1YTEuMDI3IDEuMDI3IDAgMCAxIC4xMzgtMS40MzJjLjQzMi0uMzU2IDEuMDgzLS4yOTIgMS40MjMuMTQuMTkxLjIyNyA0LjUzMSA1LjU2NiAyLjMzNSA5LjgxNS0zLjc0MiA3LjIyOS05LjA2MSA5LjI5NS05LjI3NSA5LjM4NGExLjE3NSAxLjE3NSAwIDAgMS0uMzU3LjA2NFpNMTk0LjQxMyAxMTQuMTc3Yy0uNTQzIDAtLjk4Ny0uNDE5LTEuMDE1LS45NjQtLjExNS0yLjYtMy4xMDgtNi45NjMtNi40MjEtNy4yMjktMi44NDMtLjIyOC03Ljg3MyAzLjU3Ny05LjU1OCA1LjA2LS40Mi4zNjgtMS4wNjYuMzMtMS40MzUtLjA4OGExLjAxOCAxLjAxOCAwIDAgMSAuMDg4LTEuNDMzYy42ODUtLjYwOSA2Ljg4MS01Ljg4NSAxMS4wNjctNS41NTUgNC41ODIuMzY3IDguMTM4IDUuNzE5IDguMjg5IDkuMTU2YTEuMDE3IDEuMDE3IDAgMCAxLS45NjQgMS4wNjVoLS4wNTF2LS4wMTJaIiBmaWxsPSIjMUEzMTQyIi8+PC9nPjwvZz48ZGVmcz48Y2xpcFBhdGggaWQ9ImEiPjxwYXRoIGZpbGw9IiNmZmYiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC41MikiIGQ9Ik0wIDBoMzExLjk2NHYyNjRIMHoiLz48L2NsaXBQYXRoPjwvZGVmcz48L3N2Zz4=",alt:(0,z.__)("CartFlows Free vs Pro Image","cartflows"),title:(0,z.__)("CartFlows Free vs Pro Image","cartflows")})),(0,o.createElement)("div",{className:"flex flex-1 flex-col gap-2"},(0,o.createElement)(Gp,{direction:"row",align:"center",gap:"xs",className:"text-brand-600"},(0,o.createElement)(bZ,{className:"w-4 h-4 stroke-2 text-brand-600"}),(0,o.createElement)(th,{as:"span",weight:"semibold",size:"xs",color:"text-brand-600"},(0,z.__)("Unlock Pro Features","cartflows"))),(0,o.createElement)("div",null,(0,o.createElement)($p,{tag:"h3",title:(0,z.__)("Generate More Sales With CartFlows Pro!","cartflows"),size:"sm",className:"p-0 m-0"}),(0,o.createElement)(th,{size:"sm",color:"text-text-secondary",className:"mt-1"},(0,z.__)("Build a sales funnel with everything you need to generate leads and grow sales.","cartflows"))),(0,o.createElement)("div",{className:"grid grid-cols-2 gap-3"},(0,o.createElement)("ul",{className:"list-none pl-0"},(0,o.createElement)("li",{className:"flex items-center space-x-2 text-field-label text-sm"},(0,o.createElement)(iV,{className:"w-4 h-4 stroke-2 text-brand-500 mt-0.5"}),(0,o.createElement)(th,{as:"span",size:"sm"},(0,z.__)("One Click Upsells","cartflows"))),(0,o.createElement)("li",{className:"flex items-center space-x-2 text-field-label text-sm"},(0,o.createElement)(iV,{className:"w-4 h-4 stroke-2 text-brand-500 mt-0.5"}),(0,o.createElement)(th,{as:"span",size:"sm"},(0,z.__)("Order Bumps","cartflows"))),(0,o.createElement)("li",{className:"flex items-center space-x-2 text-field-label text-sm"},(0,o.createElement)(iV,{className:"w-4 h-4 stroke-2 text-brand-500 mt-0.5"}),(0,o.createElement)(th,{as:"span",size:"sm"},(0,z.__)("A/B Split Testing","cartflows"))),(0,o.createElement)("li",{className:"flex items-center space-x-2 text-field-label text-sm"},(0,o.createElement)(iV,{className:"w-4 h-4 stroke-2 text-brand-500 mt-0.5"}),(0,o.createElement)(th,{as:"span",size:"sm"},(0,z.__)("Conversion Templates","cartflows")))),(0,o.createElement)("ul",{className:"list-none pl-0"},(0,o.createElement)("li",{className:"flex items-center space-x-2 text-field-label text-sm"},(0,o.createElement)(iV,{className:"w-4 h-4 stroke-2 text-brand-500 mt-0.5"}),(0,o.createElement)(th,{as:"span",size:"sm"},(0,z.__)("Checkout Editor","cartflows"))),(0,o.createElement)("li",{className:"flex items-center space-x-2 text-field-label text-sm"},(0,o.createElement)(iV,{className:"w-4 h-4 stroke-2 text-brand-500 mt-0.5"}),(0,o.createElement)(th,{as:"span",size:"sm"},(0,z.__)("Dynamic Offers","cartflows"))),(0,o.createElement)("li",{className:"flex items-center space-x-2 text-field-label text-sm"},(0,o.createElement)(iV,{className:"w-4 h-4 stroke-2 text-brand-500 mt-0.5"}),(0,o.createElement)(th,{as:"span",size:"sm"},(0,z.__)("Cart Abandonment","cartflows"))),(0,o.createElement)("li",{className:"flex items-center space-x-2 text-field-label text-sm"},(0,o.createElement)(iV,{className:"w-4 h-4 stroke-2 text-brand-500 mt-0.5"}),(0,o.createElement)(th,{as:"span",size:"sm"},(0,z.__)("And More…","cartflows"))))),(0,o.createElement)("div",{className:"grid grid-cols-6 gap-3 items-center unlock-pro-features-dropdown-container mt-3"},(0,o.createElement)("div",{className:"dropdown-container col-span-3"},(0,o.createElement)(VO,{value:a[t],onChange:e=>{var t;t=e.value,n(a.findIndex(e=>e.value===t))},by:"value",size:"sm"},(0,o.createElement)(VO.Button,{placeholder:(0,z.__)("Pro - Annual","cartflows"),render:e=>e?.label}),(0,o.createElement)(VO.Options,null,a.map(e=>(0,o.createElement)(VO.Option,{key:e.value,value:e},e.label))))),(0,o.createElement)("div",{className:"flex items-center justify-center gap-3 col-span-3"},(0,o.createElement)("div",{className:"wcf-plan--pricing text-sm"},(0,o.createElement)(th,{as:"span",weight:"semibold",size:"base",color:"text-text-primary"},"$"+a[t]?.price)," ",(0,o.createElement)(th,{as:"span",size:"sm",color:"text-text-tertiary"},a[t]?.term)))),(0,o.createElement)("div",{className:"flex gap-2 flex-col mt-2"},(0,o.createElement)(Va,{tag:"a",href:getUtmUrl("https://my.cartflows.com/checkout-cartflows-"+a[t]?.value,{utm_campaign:"go-pro"}),target:"blank",variant:"primary",className:"font-semibold no-underline text-center"},(0,z.__)("Buy Now","cartflows")),(0,o.createElement)(Va,{tag:"a",href:getUpgradeToProUrl(),target:"_blank",rel:"noreferrer",variant:"ghost",className:"text-brand-500 hover:text-brand-600 flex justify-center no-underline text-center"},(0,z.__)("View plans","cartflows"))))),(0,o.createElement)(aV,null),(0,o.createElement)(NV,null)))};function yne({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{d:"M3.25 4A2.25 2.25 0 0 0 1 6.25v7.5A2.25 2.25 0 0 0 3.25 16h7.5A2.25 2.25 0 0 0 13 13.75v-7.5A2.25 2.25 0 0 0 10.75 4h-7.5ZM19 4.75a.75.75 0 0 0-1.28-.53l-3 3a.75.75 0 0 0-.22.53v4.5c0 .199.079.39.22.53l3 3a.75.75 0 0 0 1.28-.53V4.75Z"}))}const bne=i.forwardRef(yne);function vne({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{fillRule:"evenodd",d:"M4.25 5.5a.75.75 0 0 0-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 0 0 .75-.75v-4a.75.75 0 0 1 1.5 0v4A2.25 2.25 0 0 1 12.75 17h-8.5A2.25 2.25 0 0 1 2 14.75v-8.5A2.25 2.25 0 0 1 4.25 4h5a.75.75 0 0 1 0 1.5h-5Z",clipRule:"evenodd"}),i.createElement("path",{fillRule:"evenodd",d:"M6.194 12.753a.75.75 0 0 0 1.06.053L16.5 4.44v2.81a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.553l-9.056 8.194a.75.75 0 0 0-.053 1.06Z",clipRule:"evenodd"}))}const xne=i.forwardRef(vne),_ne=function({module:e,isLast:t=!1,isComplete:n,onToggle:r}){const[a,s]=(0,i.useState)(!1),l="active"===cartflows_admin?.cf_pro_status,c=e?.is_pro&&!l,u="not-installed"===cartflows_admin?.cf_pro_status?(0,o.createElement)(bp,null):(0,o.createElement)(yp,null),d=e?.plugin_status||"",f="active"===d,m=()=>a?(0,z.__)("Processing…","cartflows"):"install"===d?(0,z.sprintf)((0,z.__)("Install %s","cartflows"),e?.cta):"activate"===d?(0,z.sprintf)((0,z.__)("Activate %s","cartflows"),e?.cta):e?.cta,p=e=>{const t=new window.FormData;t.append("action","cartflows_activate_plugin"),t.append("init",e),t.append("security",cartflows_admin?.activate_plugin_nonce),L()({url:cartflows_admin?.ajax_url,method:"POST",body:t}).then(()=>{window.location.reload()}).catch(()=>{s(!1)})};return(0,o.createElement)("div",{className:"py-4 sm:py-5 flex items-center gap-2 sm:gap-3 border-0 border-solid border-border-subtle "+(t?"":"border-b-[0.5px]")},(0,o.createElement)("button",{type:"button",onClick:r,disabled:e?.is_pro,"aria-label":n?(0,z.sprintf)( |
| 121 |
// translators: %s is the module title |
| 122 |
// translators: %s is the module title |
| 123 |
(0,z.__)("Mark %s as not completed","cartflows"),e?.title):(0,z.sprintf)( |
| 124 |
// translators: %s is the module title |
| 125 |
// translators: %s is the module title |
| 126 |
(0,z.__)("Mark %s as completed","cartflows"),e?.title),className:["self-start mt-[1px] flex items-center justify-center h-5 w-5 shrink-0 rounded-full border-[1.25px] border-solid transition-colors",n?"border-support-success bg-support-success p-0.5":"border-border-subtle bg-background-primary",e?.is_pro?"cursor-default pointer-events-none opacity-50":"cursor-pointer hover:border-support-success"].join(" ")},(0,o.createElement)("svg",{className:"w-full h-full text-text-on-color",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"},(0,o.createElement)("path",{d:"M5 13l4 4L19 7"}))),(0,o.createElement)("div",{className:"flex-1 flex items-center gap-2"},(0,o.createElement)("div",{className:"flex flex-col gap-1.5"},(0,o.createElement)("p",{className:["flex gap-3 items-center m-0 p-0 flex-1",n?"text-text-tertiary":"text-text-primary"].join(" ")},(0,o.createElement)("span",{className:"text-sm font-medium text-text-primary"},e?.title),e?.is_pro&&(0,o.createElement)(Yf,{label:(0,z.__)("PRO","cartflows"),variant:"blue",size:"xxs",type:"rounded",className:"uppercase"})),e?.description&&(0,o.createElement)("p",{className:"hidden sm:block mt-0.5 text-sm font-normal text-text-secondary"},e?.description))),(0,o.createElement)("div",{className:"flex shrink-0 items-center gap-2"},c?u:(0,o.createElement)(o.Fragment,null,e?.learn_how&&(0,o.createElement)(Va,{variant:"link",size:"xs",tag:"a",href:e?.learn_how,target:"_blank",rel:"noreferrer",className:"learn-more-btn text-brand-500",icon:(0,o.createElement)(xne,{className:"size-4"}),iconPosition:"right","aria-label":(0,z.sprintf)( |
| 127 |
// translators: %s is the module or section title |
| 128 |
// translators: %s is the module or section title |
| 129 |
(0,z.__)("Learn how: %s","cartflows"),e?.title)},(0,z.__)("Learn How","cartflows")),e?.cta&&"redirect"===e?.action_type&&(0,o.createElement)(Va,{variant:"primary",size:"sm",tag:"a",href:n?void 0:e?.action_data?.url,onClick:e=>n&&e.preventDefault(),className:"no-underline "+(n?"pointer-events-none opacity-50":""),"aria-label":(0,z.sprintf)( |
| 130 |
// translators: %1$s is the CTA or action text, %2$s is the module title |
| 131 |
// translators: %1$s is the CTA or action text, %2$s is the module title |
| 132 |
(0,z.__)("%1$s - %2$s","cartflows"),e?.cta,e?.title)},e?.cta),e?.cta&&"install_plugin"===e?.action_type&&!f&&(0,o.createElement)(Va,{variant:"primary",size:"sm",onClick:()=>{const t=e?.action_data?.plugin_init||"",n=e?.action_data?.plugin_slug||"";t&&n&&(f||(s(!0),"install"===d?(wp.updates.queue.push({action:"install-plugin",data:{slug:n,success(){p(t)},error(){s(!1)}}}),wp.updates.queueChecker()):"activate"===d?p(t):s(!1)))},disabled:f||a,className:f?"pointer-events-none opacity-50":"","aria-label":(0,z.sprintf)( |
| 133 |
// translators: %1$s is the CTA or action text, %2$s is the module title |
| 134 |
// translators: %1$s is the CTA or action text, %2$s is the module title |
| 135 |
(0,z.__)("%1$s - %2$s","cartflows"),m(),e?.title)},m()))))},Ene=function({sections:e,onToggle:t}){return e.length?(0,o.createElement)(BW,{type:"boxed"},e.map(e=>{const n=(e.modules||[]).length,r=(e.modules||[]).filter(e=>!!e.completed).length,a=n===r;return(0,o.createElement)(BW.Item,{key:e.id,value:e.id,className:"bg-background-primary"},(0,o.createElement)(BW.Trigger,{iconType:"arrow","aria-label":(0,z.sprintf)( |
| 136 |
// translators: %1$s is the section title, %2$d is completed count, %3$d is total count |
| 137 |
// translators: %1$s is the section title, %2$d is completed count, %3$d is total count |
| 138 |
(0,z.__)("%1$s - %2$d of %3$d steps completed","cartflows"),e.title,r,n)},(0,o.createElement)("span",{className:"flex-1 text-sm font-medium text-text-primary"},e.title),e?.learn_how&&(0,o.createElement)(Va,{variant:"link",size:"xs",tag:"a",href:e?.learn_how,target:"_blank",rel:"noreferrer",className:"learn-more-btn",icon:(0,o.createElement)(xne,{className:"size-4"}),iconPosition:"right","aria-label":(0,z.sprintf)( |
| 139 |
// translators: %s is the module or section title |
| 140 |
// translators: %s is the module or section title |
| 141 |
(0,z.__)("Learn how: %s","cartflows"),e.title),onClick:e=>e.stopPropagation()},(0,z.__)("Learn How","cartflows")),(0,o.createElement)(Yf,{label:(0,o.createElement)("span",{className:"flex items-center"},a&&(0,o.createElement)(iV,{className:"size-3"}),(0,o.createElement)("span",{className:"px-1"},r,"/",n)),variant:a?"green":r>0?"blue":"neutral",size:"sm",type:"pill",className:"relative overflow-hidden"})),(0,o.createElement)(BW.Content,null,e.description&&(0,o.createElement)("p",{className:"m-0 p-0 font-normal text-sm pt-2 px-3 sm:px-4 -mt-2 pb-4 max-w-full sm:max-w-[72%]"},e.description),(0,o.createElement)("span",{className:"block border-0 border-b-0.5 border-solid border-border-subtle"}),(0,o.createElement)("div",{className:"px-3 sm:px-4 flex flex-col"},(e.modules||[]).map((n,r)=>(0,o.createElement)(_ne,{key:n.id,module:n,isLast:r===e.modules.length-1,isComplete:!!n.completed,onToggle:()=>t(n.id)})))))})):(0,o.createElement)("p",{className:"py-2 text-center text-sm text-text-secondary"},(0,z.__)("No sections available.","cartflows"))},Nne=function(){return(0,o.createElement)("div",{className:"space-y-4"},(0,o.createElement)(cO,{variant:"rectangular",className:"h-7 w-28 rounded"}),(0,o.createElement)("div",{className:"bg-background-secondary p-2 rounded-lg space-y-3"},(0,o.createElement)("div",{className:"rounded-lg border border-border-subtle"},(0,o.createElement)("div",{className:"flex items-center gap-2 bg-background-primary rounded-lg shadow-sm p-3 sm:p-4"},(0,o.createElement)(cO,{variant:"circular",className:"size-4 shrink-0"}),(0,o.createElement)(cO,{variant:"rectangular",className:"flex-1 h-4 w-36 rounded"}),(0,o.createElement)(cO,{variant:"rectangular",className:"h-3 w-8 rounded"})),(0,o.createElement)("div",{className:"border-t border-border-muted"},(0,o.createElement)("div",{className:"px-3 sm:px-4 py-2"},(0,o.createElement)(cO,{variant:"rectangular",className:"h-3 w-3/4 rounded"})),(0,o.createElement)("div",{className:"border-b border-border-subtle"}),(0,o.createElement)("div",{className:"bg-background-secondary px-3 sm:px-4 divide-y divide-gray-100"},(0,o.createElement)("div",{className:"flex items-center gap-3 px-2 py-2"},(0,o.createElement)(cO,{variant:"circular",className:"size-4 shrink-0"}),(0,o.createElement)("div",{className:"flex-1 min-w-0 space-y-1"},(0,o.createElement)(cO,{variant:"rectangular",className:"h-3 w-32 rounded"}),(0,o.createElement)(cO,{variant:"rectangular",className:"h-3 w-48 rounded"})),(0,o.createElement)(cO,{variant:"rectangular",className:"h-6 w-16 rounded-md"})),(0,o.createElement)("div",{className:"flex items-center gap-3 px-2 py-2"},(0,o.createElement)(cO,{variant:"circular",className:"size-4 shrink-0"}),(0,o.createElement)("div",{className:"flex-1 min-w-0 space-y-1"},(0,o.createElement)(cO,{variant:"rectangular",className:"h-3 w-28 rounded"}),(0,o.createElement)(cO,{variant:"rectangular",className:"h-3 w-40 rounded"})),(0,o.createElement)(cO,{variant:"rectangular",className:"h-6 w-20 rounded-md"})),(0,o.createElement)("div",{className:"flex items-center gap-3 px-2 py-2"},(0,o.createElement)(cO,{variant:"circular",className:"size-4 shrink-0"}),(0,o.createElement)("div",{className:"flex-1 min-w-0 space-y-1"},(0,o.createElement)(cO,{variant:"rectangular",className:"h-3 w-36 rounded"}),(0,o.createElement)(cO,{variant:"rectangular",className:"h-3 w-44 rounded"})),(0,o.createElement)(cO,{variant:"rectangular",className:"h-6 w-16 rounded-md"}))))),["w-44","w-36","w-40"].map((e,t)=>(0,o.createElement)("div",{key:t,className:"flex items-center gap-2 bg-background-primary rounded-lg border border-border-subtle shadow-sm p-3 sm:p-4"},(0,o.createElement)(cO,{variant:"circular",className:"size-4 shrink-0"}),(0,o.createElement)(cO,{variant:"rectangular",className:`flex-1 h-4 ${e} rounded`}),(0,o.createElement)(cO,{variant:"rectangular",className:"h-3 w-8 rounded"})))))},Mne=function({open:e,title:t,videoUrl:n,onClose:r}){return(0,o.createElement)($m,{open:e,setOpen:e=>{e||r()},exitOnClickOutside:!0,exitOnEsc:!0},(0,o.createElement)($m.Panel,{className:"sm:max-w-4xl w-full !p-0 !rounded-lg overflow-hidden relative !border-0 !shadow-none !bg-transparent"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)("div",{className:"absolute top-2 right-2 z-10"},(0,o.createElement)($m.CloseButton,{className:"!bg-white/80 hover:!bg-white !rounded-full !p-1 !shadow-sm","aria-label":(0,z.__)("Close video","cartflows")})),e&&n&&(0,o.createElement)("iframe",{className:"block rounded-lg w-full !h-[200px] sm:!h-[500px]",src:n,title:t,frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})))},Ine=function(){const[e,t]=(0,i.useState)([]),[n,r]=(0,i.useState)(!0),[a,s]=(0,i.useState)(!1),l=(0,i.useRef)(!1),c=(0,i.useCallback)(e=>{t(t=>{let n=!1;if(t.forEach(t=>{t.modules.forEach(t=>{t.id===e&&t.is_pro&&(n=!0)})}),n)return t;const r=t.map(t=>({...t,modules:t.modules.map(t=>t.id===e?{...t,completed:!t.completed}:t)})),a=[];return r.forEach(e=>{e.modules.forEach(e=>{e.completed&&a.push(e.id)})}),function(e){const t=new URLSearchParams;t.set("action","cartflows_save_learn_completed"),t.set("module_ids",JSON.stringify(e)),t.set("nonce",cartflows_admin?.save_learn_completed_nonce||""),fetch(ajaxurl,{method:"POST",body:t})}(a),r})},[]);return(0,i.useEffect)(()=>{l.current||(l.current=!0,L()({path:"/cartflows/v1/admin/learn/",method:"GET"}).then(e=>{t(e),r(!1)}).catch(()=>{t([]),r(!1)}))},[]),n?(0,o.createElement)(Nne,null):(0,o.createElement)("section",{className:"relative overflow-hidden p-4 bg-background-primary rounded-xl flex flex-col gap-6 sm:gap-8"},(0,o.createElement)("div",{className:"px-1 flex items-start justify-between gap-2"},(0,o.createElement)($p,{tag:"h2",size:"sm",title:(0,z.__)("Learn CartFlows","cartflows"),description:(0,z.__)("Set up high-converting funnels in CartFlows with step-by-step guidance and launch with confidence.","cartflows")}),(0,o.createElement)(Va,{variant:"ghost",size:"xs",icon:(0,o.createElement)(bne,{className:"size-4"}),onClick:()=>s(!0),"aria-label":(0,z.__)("Watch video: Learn CartFlows","cartflows"),className:"shrink-0 whitespace-nowrap"},(0,o.createElement)("span",{className:"hidden sm:inline-block"},(0,z.__)("Watch Video","cartflows")))),(0,o.createElement)("div",{className:"w-full"},(0,o.createElement)("div",{className:"bg-background-secondary p-2 rounded-lg"},(0,o.createElement)(Ene,{sections:e,onToggle:c}))),(0,o.createElement)(Mne,{open:a,title:(0,z.__)("Learn CartFlows","cartflows"),videoUrl:"https://www.youtube.com/embed/tCm60PWOd0M?autoplay=1&rel=0",onClose:()=>s(!1)}))},Sne=function(){return(0,o.createElement)("main",{className:"min-h-[calc(100vh_-_8rem)]"},(0,o.createElement)("h1",{className:"sr-only"},(0,z.__)("Learn","cartflows")),(0,o.createElement)(Gp,{containerType:"grid",cols:12,gap:"lg",className:"md:p-8 sm:p-6 p-[0.7rem]"},(0,o.createElement)(Gp.Item,{className:"lg:col-span-8 md:col-span-10 col-span-12 lg:col-start-3 md:col-start-2 flex flex-col gap-8"},(0,o.createElement)(Ine,null))))},kne=function(){const e=new URLSearchParams((0,b.useLocation)().search),t=e.get("page"),n=e.get("path");let r=(0,o.createElement)("p",null,"Default route fallback");if(cartflows_admin.home_slug===t){switch(n){case"flows":r=(0,o.createElement)(NW,null);break;case"store-checkout":r="inactive"===cartflows_admin.woocommerce_status||"not-installed"===cartflows_admin.woocommerce_status?(0,o.createElement)(WZ,null):""===cartflows_admin.global_checkout_id?(0,o.createElement)(eG,null):(0,o.createElement)(gne,{flowType:"storeCheckout"});break;case"store-checkout-library":r=(0,o.createElement)(FH,null);break;case"analytics":r=(0,o.createElement)(lH,null);break;case"addons":r=(0,o.createElement)(VZ,{initialTab:"addons"});break;case"automations":r=(0,o.createElement)(OZ,null);break;case"library":r=(0,o.createElement)(OH,null);break;case"wcf-log":r=(0,o.createElement)(VZ,{initialTab:"log"});break;case"free-vs-pro":r=(0,o.createElement)(wne,null);break;case"learn":r=(0,o.createElement)(Sne,null);break;case"settings":r=(0,o.createElement)(VZ,{initialTab:e.get("tab")||void 0});break;default:r=(0,o.createElement)(MV,null)}wcfWpNavMenuChange(n)}return(0,o.createElement)(o.Fragment,null,r)};function jne({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 0 1-1.043 3.296 3.745 3.745 0 0 1-3.296 1.043A3.745 3.745 0 0 1 12 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 0 1-3.296-1.043 3.745 3.745 0 0 1-1.043-3.296A3.745 3.745 0 0 1 3 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 0 1 1.043-3.296 3.746 3.746 0 0 1 3.296-1.043A3.746 3.746 0 0 1 12 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 0 1 3.296 1.043 3.746 3.746 0 0 1 1.043 3.296A3.745 3.745 0 0 1 21 12Z"}))}const Dne=i.forwardRef(jne);function Cne({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.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.25m.75 12 3 3m0 0 3-3m-3 3v-6m-1.5-9H5.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 Ane=i.forwardRef(Cne);function Tne({title:e,titleId:t,...n},r){return i.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:r,"aria-labelledby":t},n),e?i.createElement("title",{id:t},e):null,i.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0-3-3m3 3 3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"}))}const One=i.forwardRef(Tne),Lne={"top-left":"top-0 bottom-0 left-0 justify-start items-start","top-right":"top-0 bottom-0 right-0 justify-start items-end","bottom-left":"top-0 bottom-0 left-0 justify-end items-start","bottom-right":"top-0 bottom-0 right-0 justify-end items-end"},zne={neutral:"border-alert-border-neutral bg-alert-background-neutral",custom:"border-alert-border-neutral bg-alert-background-neutral",info:"border-alert-border-info bg-alert-background-info",success:"border-alert-border-green bg-alert-background-green",warning:"border-alert-border-warning bg-alert-background-warning",error:"border-alert-border-danger bg-alert-background-danger"},Pne="bg-background-inverse border-background-inverse",Rne={light:"text-icon-secondary",dark:"text-icon-inverse"};let Une=!1;const Bne=({toastItem:e,title:t="",content:n="",autoDismiss:r=!0,dismissAfter:a=5e3,theme:o="light",design:s="stack",icon:l,variant:c="neutral",removeToast:u})=>{const d=(0,i.useRef)(0),f=(0,i.useRef)(0),m=(0,i.useRef)(),p=(e,t=a)=>{if(r&&!(a<0))return d.current=(new Date).getTime(),setTimeout(()=>{"function"==typeof u&&u(e.id)},t)};(0,i.useEffect)(()=>{const t=a;return m.current=p(e,t),()=>{clearTimeout(m.current)}},[]),(0,i.useEffect)(()=>{!e?.dismiss||"function"!=typeof u||u(e.id)},[e]);const h=()=>{"function"==typeof u&&e?.action?.onClick?.(()=>u(e.id))};let g=null;return"stack"===s&&(g=(0,P.jsx)("div",{className:Oe("flex items-center justify-start p-4 gap-2 relative border border-solid rounded-md shadow-lg","dark"===o?Pne:zne?.[c],"w-[22.5rem]"),onMouseEnter:()=>{clearTimeout(m.current),f.current=(new Date).getTime()},onMouseLeave:()=>{m.current=p(e,a-(f.current-d.current))},children:"custom"!==e.type?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Ga({variant:c,icon:l,theme:o})}),(0,P.jsxs)("div",{className:"flex flex-col items-start justify-start gap-0.5 mr-6",children:[$a({title:t,theme:o}),Xa({content:n,theme:o}),e?.action?.label&&"function"==typeof e?.action?.onClick&&(0,P.jsx)("div",{className:"mt-2.5",children:Ha({actionLabel:e?.action?.label,actionType:e?.action?.type??"button",onAction:h,theme:o})})]}),(0,P.jsx)("div",{className:"absolute right-4 top-4 [&_svg]:size-5",children:(0,P.jsx)("button",{className:Oe("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",Rne[o]??Rne.light),onClick:t=>{t.preventDefault(),t.stopPropagation(),"function"==typeof u&&u(e.id)},children:(0,P.jsx)(Ff,{})})})]}):e?.jsx?.({close:()=>u(e.id),action:e?.action?{...e?.action,onClick:h}:null})})),"inline"===s&&(g=(0,P.jsxs)("div",{className:Oe("flex items-center justify-start p-3 gap-2 relative border border-solid rounded-md shadow-lg","dark"===o?Pne:zne?.[c],"lg:w-[47.5rem] w-full"),children:[(0,P.jsx)("div",{className:"self-start flex items-center justify-center [&_svg]:size-5 shrink-0",children:Ga({variant:c,icon:l,theme:o})}),(0,P.jsxs)("div",{className:"flex items-start justify-start gap-1 mr-10 [&>span:first-child]:shrink-0",children:[$a({title:t,theme:o}),Xa({content:n,theme:o})]}),(0,P.jsx)("div",{className:"absolute right-3 top-3 [&_svg]:size-5",children:(0,P.jsx)("button",{className:Oe("bg-transparent m-0 p-0 border-none focus:outline-none active:outline-none cursor-pointer",Rne[o]??Rne.light),onClick:()=>u(e.id),children:(0,P.jsx)(Ff,{})})})]})),g},Fne=(e=>(0,i.memo)(t=>{const n=t.singleTon;return Une&&n?null:(Une=!0,(0,P.jsx)(e,{...t}))}))(({position:e="top-right",design:t="stack",theme:n="light",className:r="",autoDismiss:a=!0,dismissAfter:o=5e3})=>{const[s,l]=(0,i.useState)([]);(0,i.useEffect)(()=>{mp.subscribe(e=>{e?.dismiss?l(t=>t.map(t=>t.id===e.id?{...t,dismiss:!0}:t)):setTimeout(()=>{(0,wn.flushSync)(()=>l(t=>-1!==t.findIndex(t=>t.id===e.id)?t.map(t=>t.id===e.id?{...t,...e}:t):[...t,e]))})})},[]);const c=e=>{l(t=>t.filter(t=>t.id!==e))};return(0,P.jsx)("ul",{className:Oe("fui-toast-container fixed flex flex-col list-none z-20 p-10 pointer-events-none [&>li]:pointer-events-auto gap-3",Lne[e]??Lne["top-right"],r),children:(0,P.jsx)(pm,{initial:!1,children:s.map(e=>(0,P.jsx)(kf.li,{initial:{opacity:0,y:50,scale:.7},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,scale:.6,transition:{duration:.15}},layoutId:`toast-${e.id}`,children:(0,P.jsx)(Bne,{toastItem:e,title:e.title,content:e?.description,icon:e?.icon??void 0,design:e?.design??t,autoDismiss:e?.autoDismiss??a,dismissAfter:e?.dismissAfter??o,removeToast:c,variant:e.type,theme:e?.theme??n})},e.id))})})});class Yne extends i.Component{constructor(e){super(e),this.state={hasError:!1,error:null}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,t){}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,o.createElement)("div",{className:"wcf-error-boundary flex items-center justify-center min-h-[60vh]"},(0,o.createElement)("div",{className:"w-full max-w-md rounded-xl border border-border-subtle bg-background-primary shadow-md text-center overflow-hidden"},(0,o.createElement)("div",{className:"h-1 bg-gradient-to-r from-orange-400 via-red-400 to-orange-400"}),(0,o.createElement)("div",{className:"px-8 pt-8 pb-8"},(0,o.createElement)("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-alert-background-danger ring-8 ring-alert-background-danger/50"},(0,o.createElement)(uh,{className:"h-7 w-7 text-support-error"})),(0,o.createElement)($p,{size:"md",tag:"h2",className:"mb-2"},(0,z.__)("Something went wrong","cartflows")),(0,o.createElement)(th,{size:"sm",color:"tertiary",className:"mb-6 max-w-xs mx-auto"},(0,z.__)("An unexpected error occurred while loading this section. Refreshing the page should fix the issue.","cartflows")),(0,o.createElement)("div",{className:"flex items-center justify-center gap-3"},(0,o.createElement)(Va,{variant:"outline",size:"sm",onClick:()=>window.history.back()},(0,z.__)("Go Back","cartflows")),(0,o.createElement)(Va,{variant:"primary",size:"sm",icon:(0,o.createElement)(Wf,{className:"h-4 w-4"}),onClick:()=>window.location.reload()},(0,z.__)("Refresh Page","cartflows")))))):this.props.children}}const Qne=Yne;(0,o.createRoot)(document.getElementById("wcf-settings-app")).render((0,o.createElement)(l().StrictMode,null,(0,o.createElement)(u,{initialState:m,reducer:p},(0,o.createElement)(({reducer:e,initialState:t,children:n})=>(0,o.createElement)(h.Provider,{value:(0,i.useReducer)(e,t)},n),{initialState:y,reducer:(e,t)=>{switch(t.status){case"SAVED":return window.wcfUnsavedChanges=!1,{...e,settingsProcess:"saved"};case"PROCESSING":return{...e,settingsProcess:"processing"};case"RESET":return{...e,settingsProcess:!1};case"UNSAVED_CHANGES":return"change"===t.trigger?{...e,unsavedChanges:!0}:{...e,unsavedChanges:!1};case"UPDATE_LICENSE_STATUS":return{...e,license_status:t.license_status};case"UPDATE_CANVAS_MODE":return{...e,canvasMode:t.canvasMode};default:return e}}},(0,o.createElement)(function({children:e}){const[t,n]=(0,i.useState)({isOpen:!1}),[r,a]=(0,i.useState)(!1),s=(0,i.useRef)(),l=(0,i.useRef)(),c=(0,i.useCallback)(e=>new Promise(t=>{n({...e,isOpen:!0}),l.current=e.onConfirm,s.current=r=>{t(r),n({...e,isOpen:!1})}}),[n]);return(0,o.createElement)(HV.Provider,{value:c},e,(0,o.createElement)(GV,(0,_.A)({isOpen:t.isOpen,isLoading:r},t,{onClose:()=>s.current(!1),onConfirm:()=>(async()=>{try{a(!0),l.current&&await l.current(),s.current&&s.current(!0)}catch(e){s.current&&s.current(!1)}finally{a(!1)}})()})))},null,(0,o.createElement)(Qne,null,(0,o.createElement)(function(){const[{globaldata:e},t]=d();return dZ(),(0,i.useEffect)(()=>{let n=!0;if(e.length<1){(async()=>{L()({path:"/cartflows/v1/admin/commonsettings/"}).then(e=>{n&&(t({type:"SET_SETTINGS",commondata:e}),t({type:"SET_PAGE_BUILDER",pagebuilder:e.options["_cartflows_common[default_page_builder]"]}))})})()}return()=>{n=!1}},[]),(0,o.createElement)(M,null,(0,o.createElement)(Vm,null),(0,o.createElement)("div",{className:"wcf-app-content-wrapper wcf-app-wrapper--settings-app p-6 md:p-8"},(0,o.createElement)(b.Switch,null,(0,o.createElement)(b.Route,{path:"/"},(0,o.createElement)(kne,null)))))},null)),(0,o.createElement)(function(){const{promiseInProgress:e}=(0,tW.H8)();let t=(0,z.__)("Please wait…","cartflows"),n="";if(e)switch(window.wcfAction){case"cloneFlow":t=(0,z.__)("Please wait. Duplicating funnel…","cartflows"),n=(0,o.createElement)(hW,{className:"w-18 h-18 text-brand-500"});break;case"draftFlow":t=(0,z.__)("Please wait. Drafting funnel…","cartflows"),n=(0,o.createElement)(Pm,{className:"w-18 h-18 text-brand-500"});break;case"deleteFlow":t=(0,z.__)("Please wait. Deleting funnel…","cartflows"),n=(0,o.createElement)(aU,{className:"w-18 h-18 text-brand-500"});break;case"restoreFlow":t=(0,z.__)("Please wait. Restoring funnel…","cartflows"),n=(0,o.createElement)(Dne,{className:"w-18 h-18 text-brand-500"});break;case"exportFlow":t=(0,z.__)("Please wait. Exporting…","cartflows"),n=(0,o.createElement)(Ane,{className:"w-18 h-18 text-brand-500"});break;case"cloneStep":t=(0,z.__)("Please wait. Duplicating step…","cartflows"),n=(0,o.createElement)(hW,{className:"w-18 h-18 text-brand-500"});break;case"deleteStep":t=(0,z.__)("Please wait. Deleting step…","cartflows"),n=(0,o.createElement)(aU,{className:"w-18 h-18 text-brand-500"});break;case"abtestStep":t=(0,z.__)("Please wait. Creating variation…","cartflows"),n=(0,o.createElement)(hW,{className:"w-18 h-18 text-brand-500"});break;case"archiveStep":t=(0,z.__)("Please wait. Archiving variation…","cartflows"),n=(0,o.createElement)(One,{className:"w-18 h-18 text-brand-500"});break;case"winnerStep":t=(0,z.__)("Please wait. Declaring winner…","cartflows"),n=(0,o.createElement)(Dne,{className:"w-18 h-18 text-brand-500"});break;default:t=(0,z.__)("Please wait…","cartflows"),n=""}return(0,o.createElement)($m,{open:!!e,setOpen:()=>{},exitOnClickOutside:!1,exitOnEsc:!1},(0,o.createElement)($m.Panel,{className:"sm:max-w-sm w-full"},(0,o.createElement)($m.Backdrop,null),(0,o.createElement)($m.Body,{className:"flex flex-col items-center py-6"},(0,o.createElement)("div",{className:"relative"},(0,o.createElement)("div",{className:"w-16 h-16 border-brand-200 border-2 rounded-full"}),(0,o.createElement)("div",{className:"w-16 h-16 border-brand-500 border-t-2 animate-spin rounded-full absolute left-0 top-0"}),(0,o.createElement)("div",{className:"w-16 h-16 absolute left-0 top-0 flex justify-center items-center"},n)),(0,o.createElement)("p",{className:"mt-5 text-sm font-normal text-text-secondary text-center m-0"},t))))},null),(0,o.createElement)(Fne,{position:"top-right",design:"stack",theme:"light",autoDismiss:!0,dismissAfter:3e3,className:"z-999999"}))))))})()})(); |