(function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".swipe-card{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:30px;width:100%;height:100%}.backdrop{position:absolute;width:100%;height:100%;background:rgba(22,25,34,.6);z-index:2;opacity:0;pointer-events:none;transition:all .5s;background-blend-mode:multiply;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.backdrop.visible{opacity:1}.swipe-card__wrapper,.swipe-card__cards{position:relative;width:100%;height:100%}.swipe-card__message{position:absolute;z-index:6;width:100%;bottom:40px;color:#fff;display:flex;align-items:center;justify-content:center;opacity:0;transition:all .5s;transition-delay:.5s;transform:translateY(50px)}.swipe-card__message p,.swipe-card__message b{text-align:center}.swipe-card__message.visible{opacity:1;transform:translateY(0)}.swipe-card__container{position:absolute;pointer-events:none;top:0;left:0;width:100%;height:100%;background-color:#fff;display:flex;flex-direction:column;border-radius:18px;gap:10px;cursor:grab;-webkit-user-select:none;-moz-user-select:none;user-select:none;transform:translateY(18px) translate(23px);transition:all .5s;filter:blur(2px);opacity:.3}.card-shake{transition:all .6s;animation:shake .35s;animation-iteration-count:1;--rotation-deg: 2deg;--negative-rotation-deg: -2deg}@keyframes shake{0%{transform:translate(10px,-96px) rotate(0)}10%{transform:translate(10px,-96px) rotate(var(--rotation-deg))}20%{transform:translate(10px,-96px) rotate(var(--negative-rotation-deg))}30%{transform:translate(10px,-96px) rotate(var(--rotation-deg))}40%{transform:translate(10px,-96px) rotate(var(--negative-rotation-deg))}50%{transform:translate(10px,-96px) rotate(var(--rotation-deg))}60%{transform:translate(10px,-96px) rotate(var(--negative-rotation-deg))}70%{transform:translate(10px,-96px) rotate(var(--rotation-deg))}80%{transform:translate(10px,-96px) rotate(var(--negative-rotation-deg))}90%{transform:translate(10px,-96px) rotate(var(--rotation-deg))}to{transform:translate(10px,-96px) rotate(0)}}.swipe-card_flag-container{position:absolute;top:0;right:0;height:70px;width:70px;border-radius:50%;padding:20;display:flex;align-items:center;justify-content:center;z-index:10;margin-top:-39px;margin-right:-28px}.swipe-card_flag-correct,.swipe-card_flag-wrong{display:none}.swipe-card__container:nth-last-child(2){transform:translateY(10px) translate(11px);filter:blur(.5px);opacity:.5}.swipe-card__container:last-of-type{pointer-events:auto;transform:translateY(0) translate(0);filter:none;opacity:1;z-index:3}.swipe-card__header{display:flex}.swipe-card__ribbons-container{position:absolute;width:100%}.swipe-card__ribbon-like,.swipe-card__ribbon-dislike{position:absolute;opacity:0;color:#fff;display:flex;justify-content:center;align-items:center;width:170px;height:60px;font-weight:700;font-size:2rem;top:3rem;z-index:50;padding-block:.25rem;padding-inline:.5rem;border-radius:.375rem;transition:all .4s;box-shadow:0 0 5px #00000040}.swipe-card__ribbon-like{left:2rem;background-color:#4ade80;transform:rotate(-20deg);text-shadow:-2px 0px 1px rgba(0,0,0,.2)}.swipe-card__ribbon-dislike{right:2rem;background-color:#f87171;transform:rotate(20deg);text-shadow:2px 0px 1px rgba(0,0,0,.2)}.swipe-card__ribbon-like.show,.swipe-card__ribbon-dislike.show{opacity:1}.swipe-card__image-container{position:relative;height:250px;width:100%;padding:50px}.swipe-card__image{width:100%;height:100%;-o-object-fit:cover;object-fit:cover}.swipe-card__children{bottom:0;display:flex;justify-content:space-evenly;width:100%;transition:all .7s ease;opacity:1}.swipe-card__children.hide-action-buttons{opacity:0}.swipe-card__action-button{height:65px;width:65px;display:flex;justify-content:center;align-items:center;text-align:center;border-radius:50%;padding:10px;box-shadow:0 0 10px #47474733;cursor:pointer}.swipe-card__empty-state{width:100%;height:100%;opacity:0;display:flex;justify-content:center;align-items:center;transform:scale(.95);transition:all .5s ease}.swipe-card__empty-state.swipe-card__empty-state.show-empty-state{transform:scale(1);opacity:1}@media (max-height: 750px){.swipe-card__container{transform:scale(.95) translateY(25px)}}")),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})(); (function(b,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],h):(b=typeof globalThis<"u"?globalThis:b||self,h(b["React Card Swiper"]={},b.require$$0))})(this,function(b,h){"use strict";var bt=Object.defineProperty;var Rt=(b,h,N)=>h in b?bt(b,h,{enumerable:!0,configurable:!0,writable:!0,value:N}):b[h]=N;var f=(b,h,N)=>(Rt(b,typeof h!="symbol"?h+"":h,N),N);var N={exports:{}},$={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Ce;function Ke(){return Ce||(Ce=1,process.env.NODE_ENV!=="production"&&function(){var a=h,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),v=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),w=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),K=Symbol.for("react.offscreen"),z=Symbol.iterator,te="@@iterator";function re(e){if(e===null||typeof e!="object")return null;var t=z&&e[z]||e[te];return typeof t=="function"?t:null}var A=a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function p(e){{for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s=1&&g>=0&&c[_]!==x[g];)g--;for(;_>=1&&g>=0;_--,g--)if(c[_]!==x[g]){if(_!==1||g!==1)do if(_--,g--,g<0||c[_]!==x[g]){var L=` `+c[_].replace(" at new "," at ");return e.displayName&&L.includes("")&&(L=L.replace("",e.displayName)),typeof e=="function"&&pe.set(e,L),L}while(_>=1&&g>=0);break}}}finally{be=!1,ie.current=m,ve(),Error.prepareStackTrace=d}var Z=e?e.displayName||e.name:"",Ue=Z?me(Z):"";return typeof e=="function"&&pe.set(e,Ue),Ue}function et(e,t,r){return ke(e,!1)}function tt(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function Ee(e,t,r){if(e==null)return"";if(typeof e=="function")return ke(e,tt(e));if(typeof e=="string")return me(e);switch(e){case M:return me("Suspense");case y:return me("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case E:return et(e.render);case j:return Ee(e.type,t,r);case O:{var s=e,d=s._payload,m=s._init;try{return Ee(m(d),t,r)}catch{}}}return""}var _e=Object.prototype.hasOwnProperty,Le={},Oe=A.ReactDebugCurrentFrame;function ge(e){if(e){var t=e._owner,r=Ee(e.type,e._source,t?t.type:null);Oe.setExtraStackFrame(r)}else Oe.setExtraStackFrame(null)}function rt(e,t,r,s,d){{var m=Function.call.bind(_e);for(var u in e)if(m(e,u)){var c=void 0;try{if(typeof e[u]!="function"){var x=Error((s||"React class")+": "+r+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}c=e[u](t,u,s,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(_){c=_}c&&!(c instanceof Error)&&(ge(d),p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",s||"React class",r,u,typeof c),ge(null)),c instanceof Error&&!(c.message in Le)&&(Le[c.message]=!0,ge(d),p("Failed %s type: %s",r,c.message),ge(null))}}}var nt=Array.isArray;function Re(e){return nt(e)}function it(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,r=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r}}function at(e){try{return Ie(e),!1}catch{return!0}}function Ie(e){return""+e}function De(e){if(at(e))return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",it(e)),Ie(e)}var se=A.ReactCurrentOwner,st={key:!0,ref:!0,__self:!0,__source:!0},Me,Fe,xe;xe={};function ot(e){if(_e.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function lt(e){if(_e.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function ct(e,t){if(typeof e.ref=="string"&&se.current&&t&&se.current.stateNode!==t){var r=T(se.current.type);xe[r]||(p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',T(se.current.type),e.ref),xe[r]=!0)}}function ut(e,t){{var r=function(){Me||(Me=!0,p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}}function dt(e,t){{var r=function(){Fe||(Fe=!0,p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}}var ft=function(e,t,r,s,d,m,u){var c={$$typeof:n,type:e,key:t,ref:r,props:u,_owner:m};return c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:s}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function ht(e,t,r,s,d){{var m,u={},c=null,x=null;r!==void 0&&(De(r),c=""+r),lt(t)&&(De(t.key),c=""+t.key),ot(t)&&(x=t.ref,ct(t,d));for(m in t)_e.call(t,m)&&!st.hasOwnProperty(m)&&(u[m]=t[m]);if(e&&e.defaultProps){var _=e.defaultProps;for(m in _)u[m]===void 0&&(u[m]=_[m])}if(c||x){var g=typeof e=="function"?e.displayName||e.name||"Unknown":e;c&&ut(u,g),x&&dt(u,g)}return ft(e,c,x,d,s,se.current,u)}}var Te=A.ReactCurrentOwner,Ne=A.ReactDebugCurrentFrame;function q(e){if(e){var t=e._owner,r=Ee(e.type,e._source,t?t.type:null);Ne.setExtraStackFrame(r)}else Ne.setExtraStackFrame(null)}var Se;Se=!1;function je(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function Ae(){{if(Te.current){var e=T(Te.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function vt(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),r=e.lineNumber;return` Check your code at `+t+":"+r+"."}return""}}var Ve={};function mt(e){{var t=Ae();if(!t){var r=typeof e=="string"?e:e.displayName||e.name;r&&(t=` Check the top-level render call using <`+r+">.")}return t}}function We(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var r=mt(t);if(Ve[r])return;Ve[r]=!0;var s="";e&&e._owner&&e._owner!==Te.current&&(s=" It was passed a child from "+T(e._owner.type)+"."),q(e),p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,s),q(null)}}function Ye(e,t){{if(typeof e!="object")return;if(Re(e))for(var r=0;r",c=" Did you accidentally export a JSX literal instead of a component?"):_=typeof e,p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",_,c)}var g=ht(e,t,r,d,m);if(g==null)return g;if(u){var L=t.children;if(L!==void 0)if(s)if(Re(L)){for(var Z=0;Z(a[a.LEFT=-1]="LEFT",a[a.RIGHT=1]="RIGHT",a))(H||{}),D=(a=>(a.LIKE="like",a.DISLIKE="dislike",a.FINISHED="finished",a))(D||{}),ee=(a=>(a.SWIPE="swipe",a.CLICK="click",a))(ee||{});class Ge{constructor({element:n,id:i,meta:l,onDismiss:v,cardValidateCallback:S,onValidationStart:P,onValidationEnd:w}){f(this,"element");f(this,"id");f(this,"meta");f(this,"onDismiss");f(this,"cardValidateCallback");f(this,"onValidationStart");f(this,"onValidationEnd");f(this,"startPoint",{x:0,y:0});f(this,"offsetX",0);f(this,"offsetY",0);f(this,"isTouchDevice",()=>"ontouchstart"in window||navigator.maxTouchPoints>0);f(this,"init",()=>{this.isTouchDevice()?this.listenToTouchEvents():this.listenToMouseEvents()});f(this,"listenToTouchEvents",()=>{this.element.addEventListener("touchstart",n=>{const i=n.changedTouches[0];if(!i)return;const{clientX:l,clientY:v}=i;this.startPoint={x:l,y:v},document.addEventListener("touchmove",this.handleTouchMove),this.element.style.transition="transform 0s"}),document.addEventListener("touchend",this.handleTouchEnd),document.addEventListener("cancel",this.handleTouchEnd)});f(this,"handleMouseDown",n=>{const{clientX:i,clientY:l}=n;this.startPoint={x:i,y:l},document.addEventListener("mousemove",this.handleMouseMove),this.element.style.transition="transform 0s"});f(this,"listenToMouseEvents",()=>{this.element.addEventListener("mousedown",this.handleMouseDown),document.addEventListener("mouseup",this.handleMoveUp),this.element.addEventListener("dragstart",n=>{n.preventDefault()})});f(this,"handleMove",(n,i)=>{if(!this.startPoint)return;this.showRibbons(),this.offsetX=n-this.startPoint.x;const l=this.offsetX*.07;this.element.style.transform=`translate(${this.offsetX}px,0) rotate(${l}deg)`,Math.abs(this.offsetX)>this.element.clientWidth*.4&&this.validate(this.offsetX>0?D.LIKE:D.DISLIKE)});f(this,"showRibbons",()=>{const n=this.element.querySelector(".swipe-card__ribbon-like"),i=this.element.querySelector(".swipe-card__ribbon-dislike");this.offsetX>10?(n==null||n.classList.add("show"),i==null||i.classList.remove("show")):this.offsetX<-10?(n==null||n.classList.remove("show"),i==null||i.classList.add("show")):(n==null||n.classList.remove("show"),i==null||i.classList.remove("show"))});f(this,"hideRibbons",()=>{const n=this.element.querySelector(".swipe-card__ribbon-like"),i=this.element.querySelector(".swipe-card__ribbon-dislike");n==null||n.classList.remove("show"),i==null||i.classList.remove("show")});f(this,"handleMouseMove",n=>{if(n.preventDefault(),!this.startPoint)return;const{clientX:i,clientY:l}=n;this.handleMove(i,l)});f(this,"handleMoveUp",()=>{this.startPoint=null,document.removeEventListener("mousemove",this.handleMouseMove),this.element.style.transform="",this.element.style.transition="all .5s",this.hideRibbons()});f(this,"handleTouchMove",n=>{if(!this.startPoint)return;const i=n.changedTouches[0];if(!i)return;const{clientX:l,clientY:v}=i;this.handleMove(l,v)});f(this,"handleTouchEnd",()=>{this.startPoint=null,document.removeEventListener("touchmove",this.handleTouchMove),this.element.style.transform="",this.element.style.transition="all .5s",this.hideRibbons()});f(this,"validate",n=>{this.onValidationStart(this.id,n);const{isCorrect:i}=this.cardValidateCallback(this.id,n);this.startPoint=null,document.removeEventListener("mouseup",this.handleMoveUp),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("touchmove",this.handleTouchMove),this.element.removeEventListener("mousedown",this.handleMouseDown),this.element.style.transition="all .3s",this.element.style.transform="translate(10px, -96px) rotate(0deg)";const l=this.element.querySelector(".swipe-card_flag-correct"),v=this.element.querySelector(".swipe-card_flag-wrong");i?(l.style.display="block",v.style.display="none"):(l.style.display="none",v.style.display="block"),i?setTimeout(()=>{this.moveOut(n)},1100):setTimeout(()=>{this.element.classList.add("card-shake"),setTimeout(()=>{this.moveBack(n)},800)},300)});f(this,"moveBack",n=>{var v;this.element.classList.remove("card-shake"),this.element.style.transition="",this.element.style.transform="";const i=this.element.querySelector(".swipe-card_flag-correct"),l=this.element.querySelector(".swipe-card_flag-wrong");i.style.display="none",l.style.display="none",(v=document.getElementById("swipe-card__cards"))==null||v.prepend(this.element),this.init(),this.onValidationEnd(this.id,n)});f(this,"moveOut",n=>{this.element.classList.remove("card-shake"),this.element.style.transform="scale(3)",this.element.style.opacity="0",setTimeout(()=>this.element.remove(),300),this.onValidationEnd(this.id,n)});f(this,"dismiss",(n,i=ee.SWIPE)=>{var l;if(this.element.style.transition="",this.element.style.transform="",(l=document.getElementById("swipe-card__cards"))==null||l.prepend(this.element),typeof this.onDismiss=="function"){const v=n===1?D.DISLIKE:D.LIKE;this.onDismiss(this.element,this.meta,this.id,v,i)}});f(this,"highlight",(n,i=ee.SWIPE)=>{this.startPoint=null,document.removeEventListener("mouseup",this.handleMoveUp),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("touchmove",this.handleTouchMove),this.element.removeEventListener("mousedown",this.handleMouseDown),this.element.style.transition="all 0.6s",this.element.style.transform="translate(10px, -96px) rotate(0deg)";const l=this.element.querySelector(".swipe-card_flag-correct");l&&(l.style.display="block")});f(this,"dismissById",n=>{this.dismiss(n,ee.CLICK)});this.id=i,this.meta=l,this.element=n,this.onDismiss=v,this.cardValidateCallback=S,this.onValidationStart=P,this.onValidationEnd=w,this.init()}}const He=({onDismiss:a,onFinish:n,onEnter:i,data:l,cardValidateCallback:v,onValidationStart:S,onValidationEnd:P})=>{const w=h.useRef([]),[E,M]=h.useState(l.length),[y,j]=h.useState(l),[O,K]=h.useState(!1),z=(p,C,V)=>{if(p){const F=new Ge({element:p,id:C,meta:V,onDismiss:re,cardValidateCallback:v,onValidationStart:S,onValidationEnd:P});w.current.push(F)}},te=(p,C,V)=>{i&&i(p,C,V)},re=(p,C,V,F,X)=>{M(ne=>ne-1),a&&a(p,C,V,F,X),w.current.pop()};return{isFinish:O,dynamicData:y,swiperIndex:E,swiperElements:w,handleEnter:te,setDynamicData:j,handleClickEvents:p=>{if(E){const C=w.current[E-1];C==null||C.dismissById(p)}},handleNewCardSwiper:z}};function oe({buttonContent:a,direction:n,isCustom:i=!1,action:l,onClick:v}){const S=`swipe-card__${i?"custom-":""}action-button`;return o.jsx("div",{className:S,id:`swipe-card__${l}-action-button`,onClick:()=>v(n),children:a})}function ze({isFinish:a,children:n}){const[i,l]=h.useState("");return h.useEffect(()=>{const v=setTimeout(()=>{a&&l("show-empty-state")},100);return()=>clearTimeout(v)},[a]),o.jsx("div",{className:`swipe-card__empty-state ${i}`,id:"swipe-card__empty-state",children:n})}const Je=()=>o.jsx("svg",{viewBox:"0 0 320 512",fill:"lightcoral",height:"2em",width:"2em",children:o.jsx("path",{d:"M310.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L160 210.7 54.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L114.7 256 9.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L160 301.3l105.4 105.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L205.3 256l105.3-105.4z"})});function qe({ribbonColors:a,dislikeRibbonText:n,likeRibbonText:i}){return o.jsxs("div",{className:"swipe-card__ribbons-container",id:"swipe-card__ribbons-container",children:[o.jsx("div",{id:"swipe-card__ribbon-like",className:"swipe-card__ribbon-like",style:{color:a==null?void 0:a.textColor,backgroundColor:a==null?void 0:a.bgLike},children:i||"LIKE"}),o.jsx("div",{id:"swipe-card__ribbon-dislike",className:"swipe-card__ribbon-dislike",style:{color:a==null?void 0:a.textColor,backgroundColor:a==null?void 0:a.bgDislike},children:n||"PASS"})]})}function Ze(){return o.jsx("svg",{viewBox:"0 0 20 20",fill:"palegreen",height:"2em",width:"2em",children:o.jsx("path",{d:"M0 11l2-2 5 5L18 3l2 2L7 18z"})})}const $e=a=>{const{data:n,cardValidateCallback:i,leftIcon:l,rightIcon:v,flagCorrectIcon:S,flagWrongIcon:P,likeButton:w,dislikeButton:E,withActionButtons:M=!1,emptyState:y,onDismiss:j,onFinish:O,onEnter:K,onValidationStart:z,onValidationEnd:te,correctText:re,wrong1Text:A,wrong1Subtext:p,wrong2Text:C,wrong2Subtext:V}=a,[F,X]=h.useState("idle"),ne=(k,Y)=>{const{isCorrect:G,expectedLike:U}=i(k,Y);return X(G?"correct":U?"wrong1":"wrong2"),{isCorrect:G,expectedLike:U}},ye=(k,Y)=>{te(k,Y),X("idle")},{handleEnter:le,handleClickEvents:J,handleNewCardSwiper:we,dynamicData:ce,isFinish:T,swiperIndex:I,swiperElements:W}=He({onDismiss:j,onFinish:O,onEnter:K,cardValidateCallback:ne,onValidationStart:z,onValidationEnd:ye,data:n}),[R,ue]=h.useState(W.current[I]),[de,fe]=h.useState("");h.useEffect(()=>{ue(W.current[I-1])},[W,I]),h.useEffect(()=>{R&&le(R.element,R.meta,R.id)},[R]);const he=h.useMemo(()=>ce.map(({id:k,header:Y,backgroundColor:G,src:U,content:ve,meta:ie})=>o.jsxs("div",{ref:ae=>we(ae,k,ie),className:"swipe-card__container",id:"swipe-card__container",style:{backgroundColor:G},children:[o.jsxs("div",{className:"swipe-card_flag-container",children:[S&&o.jsx("div",{className:"swipe-card_flag-correct",children:S}),P&&o.jsx("div",{className:"swipe-card_flag-wrong",children:P})]}),Y&&o.jsx("div",{className:"swipe-card__header-container",id:"swipe-card__header-container",children:Y}),a.withRibbons&&o.jsx(qe,{likeRibbonText:a.likeRibbonText,dislikeRibbonText:a.dislikeRibbonText,ribbonColors:a.ribbonColors}),U&&o.jsx("div",{className:"swipe-card__image-container",children:o.jsx("img",{className:"swipe-card__image",src:U,alt:U,id:"swipe-card__image"})}),ve&&o.jsx("div",{className:"swipe-card__content",children:ve})]},k)),[]);return h.useEffect(()=>{T&&fe("hide-action-buttons")},[T]),h.useEffect(()=>{const k=()=>{R==null||R.handleTouchEnd(),R==null||R.handleMoveUp()};return window.addEventListener("blur",k),()=>window.removeEventListener("blur",k)},[R]),o.jsxs("div",{className:"swipe-card",id:"swipe-card",children:[l&&o.jsx("div",{className:"swipe-card__left-action",children:l}),o.jsxs("div",{className:"swipe-card__wrapper",children:[o.jsxs("div",{className:"swipe-card__cards",id:"swipe-card__cards",children:[he,y&&T&&o.jsx(ze,{children:y,isFinish:T})]}),o.jsxs("div",{className:F==="idle"?"swipe-card__message":"swipe-card__message visible",children:[F==="correct"&&o.jsx("b",{children:re}),F==="wrong1"&&o.jsxs("p",{children:[o.jsx("b",{children:A}),o.jsx("br",{}),p]}),F==="wrong2"&&o.jsxs("p",{children:[o.jsx("b",{children:C}),o.jsx("br",{}),V]})]})]}),v&&o.jsx("div",{className:"swipe-card__right-action",children:v}),M&&o.jsx("div",{className:`swipe-card__children ${de}`,id:"swipe-card__children",children:w&&E?o.jsxs(o.Fragment,{children:[o.jsx(oe,{isCustom:!0,direction:H.LEFT,action:D.DISLIKE,onClick:J,buttonContent:E}),o.jsx(oe,{isCustom:!0,direction:H.RIGHT,action:D.LIKE,onClick:J,buttonContent:w})]}):o.jsxs(o.Fragment,{children:[o.jsx(oe,{direction:H.LEFT,action:D.DISLIKE,onClick:J,buttonContent:o.jsx(Je,{})}),o.jsx(oe,{direction:H.RIGHT,action:D.LIKE,onClick:J,buttonContent:o.jsx(Ze,{})})]})})]})};b.CardSwiper=$e,b.SwipeAction=D,b.SwipeDirection=H,b.SwipeOperation=ee,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})});