(function(C,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],S):(C=typeof globalThis<"u"?globalThis:C||self,S(C["react-price-animation"]={},C.React))})(this,function(C,S){"use strict";function We(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const o=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(a,i,o.get?o:{enumerable:!0,get:()=>t[i]})}}return a.default=t,Object.freeze(a)}const Me=We(S);function Le(t){if(t.__esModule)return t;var a=t.default;if(typeof a=="function"){var i=function o(){return this instanceof o?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};i.prototype=a.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach(function(o){var d=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(i,o,d.get?d:{enumerable:!0,get:function(){return t[o]}})}),i}var z={exports:{}},V={};const oe=Le(Me);/** * @license React * react-jsx-runtime.production.min.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 ue;function Ue(){if(ue)return V;ue=1;var t=oe,a=Symbol.for("react.element"),i=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,d=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,p={key:!0,ref:!0,__self:!0,__source:!0};function b(_,l,E){var h,y={},R=null,A=null;E!==void 0&&(R=""+E),l.key!==void 0&&(R=""+l.key),l.ref!==void 0&&(A=l.ref);for(h in l)o.call(l,h)&&!p.hasOwnProperty(h)&&(y[h]=l[h]);if(_&&_.defaultProps)for(h in l=_.defaultProps,l)y[h]===void 0&&(y[h]=l[h]);return{$$typeof:a,type:_,key:R,ref:A,props:y,_owner:d.current}}return V.Fragment=i,V.jsx=b,V.jsxs=b,V}var Y={};/** * @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 se;function qe(){return se||(se=1,process.env.NODE_ENV!=="production"&&function(){var t=oe,a=Symbol.for("react.element"),i=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),p=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),_=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),y=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),A=Symbol.for("react.offscreen"),L=Symbol.iterator,X="@@iterator";function U(e){if(e===null||typeof e!="object")return null;var r=L&&e[L]||e[X];return typeof r=="function"?r:null}var k=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function O(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),u=1;u=1&&m>=0&&s[g]!==j[m];)m--;for(;g>=1&&m>=0;g--,m--)if(s[g]!==j[m]){if(g!==1||m!==1)do if(g--,m--,m<0||s[g]!==j[m]){var P=` `+s[g].replace(" at new "," at ");return e.displayName&&P.includes("")&&(P=P.replace("",e.displayName)),typeof e=="function"&&B.set(e,P),P}while(g>=1&&m>=0);break}}}finally{Q=!1,H.current=v,vr(),Error.prepareStackTrace=c}var I=e?e.displayName||e.name:"",D=I?q(I):"";return typeof e=="function"&&B.set(e,D),D}function gr(e,r,n){return Pe(e,!1)}function yr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function K(e,r,n){if(e==null)return"";if(typeof e=="function")return Pe(e,yr(e));if(typeof e=="string")return q(e);switch(e){case E:return q("Suspense");case h:return q("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case l:return gr(e.render);case y:return K(e.type,r,n);case R:{var u=e,c=u._payload,v=u._init;try{return K(v(c),r,n)}catch{}}}return""}var N=Object.prototype.hasOwnProperty,we={},Se=k.ReactDebugCurrentFrame;function J(e){if(e){var r=e._owner,n=K(e.type,e._source,r?r.type:null);Se.setExtraStackFrame(n)}else Se.setExtraStackFrame(null)}function mr(e,r,n,u,c){{var v=Function.call.bind(N);for(var f in e)if(v(e,f)){var s=void 0;try{if(typeof e[f]!="function"){var j=Error((u||"React class")+": "+n+" type `"+f+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[f]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw j.name="Invariant Violation",j}s=e[f](r,f,u,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(g){s=g}s&&!(s instanceof Error)&&(J(c),O("%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).",u||"React class",n,f,typeof s),J(null)),s instanceof Error&&!(s.message in we)&&(we[s.message]=!0,J(c),O("Failed %s type: %s",n,s.message),J(null))}}}var br=Array.isArray;function ee(e){return br(e)}function hr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function _r(e){try{return ke(e),!1}catch{return!0}}function ke(e){return""+e}function Ce(e){if(_r(e))return O("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",hr(e)),ke(e)}var W=k.ReactCurrentOwner,Er={key:!0,ref:!0,__self:!0,__source:!0},xe,De,re;re={};function Rr(e){if(N.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Or(e){if(N.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function jr(e,r){if(typeof e.ref=="string"&&W.current&&r&&W.current.stateNode!==r){var n=w(W.current.type);re[n]||(O('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',w(W.current.type),e.ref),re[n]=!0)}}function Tr(e,r){{var n=function(){xe||(xe=!0,O("%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)",r))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function Pr(e,r){{var n=function(){De||(De=!0,O("%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)",r))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var wr=function(e,r,n,u,c,v,f){var s={$$typeof:a,type:e,key:r,ref:n,props:f,_owner:v};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:u}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:c}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function Sr(e,r,n,u,c){{var v,f={},s=null,j=null;n!==void 0&&(Ce(n),s=""+n),Or(r)&&(Ce(r.key),s=""+r.key),Rr(r)&&(j=r.ref,jr(r,c));for(v in r)N.call(r,v)&&!Er.hasOwnProperty(v)&&(f[v]=r[v]);if(e&&e.defaultProps){var g=e.defaultProps;for(v in g)f[v]===void 0&&(f[v]=g[v])}if(s||j){var m=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&Tr(f,m),j&&Pr(f,m)}return wr(e,s,j,c,u,W.current,f)}}var te=k.ReactCurrentOwner,Ae=k.ReactDebugCurrentFrame;function F(e){if(e){var r=e._owner,n=K(e.type,e._source,r?r.type:null);Ae.setExtraStackFrame(n)}else Ae.setExtraStackFrame(null)}var ne;ne=!1;function ae(e){return typeof e=="object"&&e!==null&&e.$$typeof===a}function Fe(){{if(te.current){var e=w(te.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function kr(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),n=e.lineNumber;return` Check your code at `+r+":"+n+"."}return""}}var Ie={};function Cr(e){{var r=Fe();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=` Check the top-level render call using <`+n+">.")}return r}}function Ve(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=Cr(r);if(Ie[n])return;Ie[n]=!0;var u="";e&&e._owner&&e._owner!==te.current&&(u=" It was passed a child from "+w(e._owner.type)+"."),F(e),O('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,u),F(null)}}function Ye(e,r){{if(typeof e!="object")return;if(ee(e))for(var n=0;n",s=" Did you accidentally export a JSX literal instead of a component?"):g=typeof e,O("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",g,s)}var m=Sr(e,r,n,c,v);if(m==null)return m;if(f){var P=r.children;if(P!==void 0)if(u)if(ee(P)){for(var I=0;I0?"{key: someKey, "+T.join(": ..., ")+": ...}":"{key: someKey}";if(!$e[D+ie]){var Yr=T.length>0?"{"+T.join(": ..., ")+": ...}":"{}";O(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,ie,D,Yr,D),$e[D+ie]=!0}}return e===o?Dr(m):xr(m),m}}function Ar(e,r,n){return Ne(e,r,n,!0)}function Fr(e,r,n){return Ne(e,r,n,!1)}var Ir=Fr,Vr=Ar;Y.Fragment=o,Y.jsx=Ir,Y.jsxs=Vr}()),Y}process.env.NODE_ENV==="production"?z.exports=Ue():z.exports=qe();var M=z.exports;function fe(t){var a=t.match(/^var\((.*)\)$/);return a?a[1]:t}function Be(t,a){var i=t;for(var o of a){if(!(o in i))throw new Error("Path ".concat(a.join(" -> ")," does not exist in object"));i=i[o]}return i}function ce(t,a){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],o={};for(var d in t){var p=t[d],b=[...i,d];typeof p=="string"||typeof p=="number"||p==null?o[d]=a(p,b):typeof p=="object"&&!Array.isArray(p)?o[d]=ce(p,a,b):console.warn('Skipping invalid key "'.concat(b.join("."),'". Should be a string, number, null or object. Received: "').concat(Array.isArray(p)?"Array":typeof p,'"'))}return o}function le(t,a){var i={};if(typeof a=="object"){var o=t;ce(a,(_,l)=>{if(_!=null){var E=Be(o,l);i[fe(E)]=String(_)}})}else{var d=t;for(var p in d){var b=d[p];b!=null&&(i[fe(p)]=b)}}return Object.defineProperty(i,"toString",{value:function(){return Object.keys(this).map(l=>"".concat(l,":").concat(this[l])).join(";")},writable:!1}),i}function Ke(t,a){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var o=i.call(t,a||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(t)}function Je(t){var a=Ke(t,"string");return typeof a=="symbol"?a:String(a)}function ze(t,a,i){return a=Je(a),a in t?Object.defineProperty(t,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[a]=i,t}function de(t,a){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);a&&(o=o.filter(function(d){return Object.getOwnPropertyDescriptor(t,d).enumerable})),i.push.apply(i,o)}return i}function ve(t){for(var a=1;a{for(var o of Object.keys(t)){var d;if(t[o]!==((d=a[o])!==null&&d!==void 0?d:i[o]))return!1}return!0},Xe=t=>{var a=i=>{var o=t.defaultClassName,d=ve(ve({},t.defaultVariants),i);for(var p in d){var b,_=(b=d[p])!==null&&b!==void 0?b:t.defaultVariants[p];if(_!=null){var l=_;typeof l=="boolean"&&(l=l===!0?"true":"false");var E=t.variantClassNames[p][l];E&&(o+=" "+E)}}for(var[h,y]of t.compoundVariants)Ge(h,d,t.defaultVariants)&&(o+=" "+y);return o};return a.variants=()=>Object.keys(t.variantClassNames),a.classNames={get base(){return t.defaultClassName.split(" ")[0]},get variants(){return pe(t.variantClassNames,i=>pe(i,o=>o.split(" ")[0]))}},a},He={height:"var(--prefix_kc7kd30)"},Ze={delay:"var(--prefix_kc7kd31)",translateY:"var(--prefix_kc7kd32)",fromTranslateY:"var(--prefix_kc7kd33)"},Qe="prefix_kc7kd3g",G=Xe({defaultClassName:"prefix_kc7kd3h",variantClassNames:{number:{0:"prefix_kc7kd3i",1:"prefix_kc7kd3j",2:"prefix_kc7kd3k",3:"prefix_kc7kd3l",4:"prefix_kc7kd3m",5:"prefix_kc7kd3n",6:"prefix_kc7kd3o",7:"prefix_kc7kd3p",8:"prefix_kc7kd3q",9:"prefix_kc7kd3r"},delay:{delay:"prefix_kc7kd3s"},change:{change:"prefix_kc7kd3t",noChange:"prefix_kc7kd3u"}},defaultVariants:{},compoundVariants:[]});const ge=[0,1,2,3,4,5,6,7,8,9],er=[...ge,...ge];function rr({number:t=12345,delay:a=.15,height:i="20px",startDirection:o="right",comma:d=!0,initialAnimation:p=!0,...b}){const _=S.useRef(!0),l=S.useRef(t);if(S.useEffect(()=>{l.current=t,_.current=!1},[t]),S.useEffect(()=>{const y=document.getElementById("element");if(y){y.style.willChange="transform",y.classList.add("animate");const R=setTimeout(()=>{y.style.willChange="auto"},200);return()=>clearTimeout(R)}},[t]),t&&!tr(t))return M.jsx("p",{children:"'숫자 or 123,000 같은 문자 형식만 가능합니다.'"});const E=typeof t=="string"?t.replace(/,/g,""):t.toString(),h=typeof l.current=="string"?l.current.replace(/,/g,""):l.current.toString();return M.jsx("div",{...b,children:E.split("").map((y,R)=>{const A=y===h[R],L=Number(y),X=Number(h[R]);return M.jsx("span",{id:"element",className:Qe,style:le(He,{height:i}),children:er.map((U,k)=>M.jsx("span",{className:_.current&&p?G({number:parseInt(y),delay:"delay"}):G(A?{change:"noChange",delay:"delay"}:{change:"change",delay:"delay"}),style:le(Ze,{delay:o=="left"?`${a*R}s`:`${a*(E.length-R)}s`,translateY:`${-L*100}%`,fromTranslateY:`${-X*100}%`}),children:d?nr(E,U,R):U},`${E}-${R}-${k}`))},`${E}-${R}`)})},t)}function tr(t){return typeof t=="number"||/^\d{1,3}(,\d{3})*$/.test(t)||/^\d+$/.test(t)}function nr(t,a,i){return t.length<4||t.length-1==i?a:t.length%3==1&&i%3==0?`${a},`:t.length%3==2&&i%3==1?`${a},`:(t.length%3==3||t.length%3==0)&&i%3==2?`${a},`:a}C.Count=rr,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});