dualvue
Version:
A React library to compare two images with a slider
50 lines (47 loc) • 32.3 kB
JavaScript
(function(de,Z){typeof exports=="object"&&typeof module<"u"?Z(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],Z):(de=typeof globalThis<"u"?globalThis:de||self,Z(de.DualVue={},de.React))})(this,function(de,Z){"use strict";function vr(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Oe={exports:{}},Ee={};/**
* @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 Le;function pr(){if(Le)return Ee;Le=1;var s=Z,Y=Symbol.for("react.element"),I=Symbol.for("react.fragment"),v=Object.prototype.hasOwnProperty,x=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,f={key:!0,ref:!0,__self:!0,__source:!0};function P(l,y,_){var u,d={},k=null,F=null;_!==void 0&&(k=""+_),y.key!==void 0&&(k=""+y.key),y.ref!==void 0&&(F=y.ref);for(u in y)v.call(y,u)&&!f.hasOwnProperty(u)&&(d[u]=y[u]);if(l&&l.defaultProps)for(u in y=l.defaultProps,y)d[u]===void 0&&(d[u]=y[u]);return{$$typeof:Y,type:l,key:k,ref:F,props:d,_owner:x.current}}return Ee.Fragment=I,Ee.jsx=P,Ee.jsxs=P,Ee}var Te={};/**
* @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 We;function yr(){return We||(We=1,process.env.NODE_ENV!=="production"&&function(){var s=Z,Y=Symbol.for("react.element"),I=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),l=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),F=Symbol.for("react.offscreen"),z=Symbol.iterator,$="@@iterator";function L(e){if(e===null||typeof e!="object")return null;var r=z&&e[z]||e[$];return typeof r=="function"?r:null}var U=s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function M(e){{for(var r=arguments.length,o=new Array(r>1?r-1:0),c=1;c<r;c++)o[c-1]=arguments[c];q("error",e,o)}}function q(e,r,o){{var c=U.ReactDebugCurrentFrame,A=c.getStackAddendum();A!==""&&(r+="%s",o=o.concat([A]));var D=o.map(function(O){return String(O)});D.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,D)}}var W=!1,a=!1,te=!1,ue=!1,fe=!1,le;le=Symbol.for("react.module.reference");function K(e){return!!(typeof e=="string"||typeof e=="function"||e===v||e===f||fe||e===x||e===_||e===u||ue||e===F||W||a||te||typeof e=="object"&&e!==null&&(e.$$typeof===k||e.$$typeof===d||e.$$typeof===P||e.$$typeof===l||e.$$typeof===y||e.$$typeof===le||e.getModuleId!==void 0))}function B(e,r,o){var c=e.displayName;if(c)return c;var A=r.displayName||r.name||"";return A!==""?o+"("+A+")":o}function Q(e){return e.displayName||"Context"}function X(e){if(e==null)return null;if(typeof e.tag=="number"&&M("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case v:return"Fragment";case I:return"Portal";case f:return"Profiler";case x:return"StrictMode";case _:return"Suspense";case u:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case l:var r=e;return Q(r)+".Consumer";case P:var o=e;return Q(o._context)+".Provider";case y:return B(e,e.render,"ForwardRef");case d:var c=e.displayName||null;return c!==null?c:X(e.type)||"Memo";case k:{var A=e,D=A._payload,O=A._init;try{return X(O(D))}catch{return null}}}return null}var J=Object.assign,ce=0,re,ie,ve,he,t,i,g;function b(){}b.__reactDisabledLog=!0;function p(){{if(ce===0){re=console.log,ie=console.info,ve=console.warn,he=console.error,t=console.group,i=console.groupCollapsed,g=console.groupEnd;var e={configurable:!0,enumerable:!0,value:b,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}ce++}}function S(){{if(ce--,ce===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:J({},e,{value:re}),info:J({},e,{value:ie}),warn:J({},e,{value:ve}),error:J({},e,{value:he}),group:J({},e,{value:t}),groupCollapsed:J({},e,{value:i}),groupEnd:J({},e,{value:g})})}ce<0&&M("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var h=U.ReactCurrentDispatcher,m;function E(e,r,o){{if(m===void 0)try{throw Error()}catch(A){var c=A.stack.trim().match(/\n( *(at )?)/);m=c&&c[1]||""}return`
`+m+e}}var w=!1,T;{var H=typeof WeakMap=="function"?WeakMap:Map;T=new H}function n(e,r){if(!e||w)return"";{var o=T.get(e);if(o!==void 0)return o}var c;w=!0;var A=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var D;D=h.current,h.current=null,p();try{if(r){var O=function(){throw Error()};if(Object.defineProperty(O.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(O,[])}catch(ee){c=ee}Reflect.construct(e,[],O)}else{try{O.call()}catch(ee){c=ee}e.call(O.prototype)}}else{try{throw Error()}catch(ee){c=ee}e()}}catch(ee){if(ee&&c&&typeof ee.stack=="string"){for(var R=ee.stack.split(`
`),G=c.stack.split(`
`),N=R.length-1,V=G.length-1;N>=1&&V>=0&&R[N]!==G[V];)V--;for(;N>=1&&V>=0;N--,V--)if(R[N]!==G[V]){if(N!==1||V!==1)do if(N--,V--,V<0||R[N]!==G[V]){var ae=`
`+R[N].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),typeof e=="function"&&T.set(e,ae),ae}while(N>=1&&V>=0);break}}}finally{w=!1,h.current=D,S(),Error.prepareStackTrace=A}var ge=e?e.displayName||e.name:"",ye=ge?E(ge):"";return typeof e=="function"&&T.set(e,ye),ye}function ne(e,r,o){return n(e,!1)}function me(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function pe(e,r,o){if(e==null)return"";if(typeof e=="function")return n(e,me(e));if(typeof e=="string")return E(e);switch(e){case _:return E("Suspense");case u:return E("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case y:return ne(e.render);case d:return pe(e.type,r,o);case k:{var c=e,A=c._payload,D=c._init;try{return pe(D(A),r,o)}catch{}}}return""}var Re=Object.prototype.hasOwnProperty,Qe={},er=U.ReactDebugCurrentFrame;function Se(e){if(e){var r=e._owner,o=pe(e.type,e._source,r?r.type:null);er.setExtraStackFrame(o)}else er.setExtraStackFrame(null)}function Or(e,r,o,c,A){{var D=Function.call.bind(Re);for(var O in e)if(D(e,O)){var R=void 0;try{if(typeof e[O]!="function"){var G=Error((c||"React class")+": "+o+" type `"+O+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[O]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw G.name="Invariant Violation",G}R=e[O](r,O,c,o,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(N){R=N}R&&!(R instanceof Error)&&(Se(A),M("%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).",c||"React class",o,O,typeof R),Se(null)),R instanceof Error&&!(R.message in Qe)&&(Qe[R.message]=!0,Se(A),M("Failed %s type: %s",o,R.message),Se(null))}}}var Pr=Array.isArray;function Me(e){return Pr(e)}function wr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,o=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return o}}function xr(e){try{return rr(e),!1}catch{return!0}}function rr(e){return""+e}function tr(e){if(xr(e))return M("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",wr(e)),rr(e)}var nr=U.ReactCurrentOwner,Cr={key:!0,ref:!0,__self:!0,__source:!0},ar,or;function jr(e){if(Re.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ar(e){if(Re.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Ir(e,r){typeof e.ref=="string"&&nr.current}function kr(e,r){{var o=function(){ar||(ar=!0,M("%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))};o.isReactWarning=!0,Object.defineProperty(e,"key",{get:o,configurable:!0})}}function Mr(e,r){{var o=function(){or||(or=!0,M("%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))};o.isReactWarning=!0,Object.defineProperty(e,"ref",{get:o,configurable:!0})}}var Dr=function(e,r,o,c,A,D,O){var R={$$typeof:Y,type:e,key:r,ref:o,props:O,_owner:D};return R._store={},Object.defineProperty(R._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(R,"_self",{configurable:!1,enumerable:!1,writable:!1,value:c}),Object.defineProperty(R,"_source",{configurable:!1,enumerable:!1,writable:!1,value:A}),Object.freeze&&(Object.freeze(R.props),Object.freeze(R)),R};function $r(e,r,o,c,A){{var D,O={},R=null,G=null;o!==void 0&&(tr(o),R=""+o),Ar(r)&&(tr(r.key),R=""+r.key),jr(r)&&(G=r.ref,Ir(r,A));for(D in r)Re.call(r,D)&&!Cr.hasOwnProperty(D)&&(O[D]=r[D]);if(e&&e.defaultProps){var N=e.defaultProps;for(D in N)O[D]===void 0&&(O[D]=N[D])}if(R||G){var V=typeof e=="function"?e.displayName||e.name||"Unknown":e;R&&kr(O,V),G&&Mr(O,V)}return Dr(e,R,G,A,c,nr.current,O)}}var De=U.ReactCurrentOwner,ir=U.ReactDebugCurrentFrame;function be(e){if(e){var r=e._owner,o=pe(e.type,e._source,r?r.type:null);ir.setExtraStackFrame(o)}else ir.setExtraStackFrame(null)}var $e;$e=!1;function Fe(e){return typeof e=="object"&&e!==null&&e.$$typeof===Y}function sr(){{if(De.current){var e=X(De.current.type);if(e)return`
Check the render method of \``+e+"`."}return""}}function Fr(e){return""}var ur={};function Yr(e){{var r=sr();if(!r){var o=typeof e=="string"?e:e.displayName||e.name;o&&(r=`
Check the top-level render call using <`+o+">.")}return r}}function cr(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var o=Yr(r);if(ur[o])return;ur[o]=!0;var c="";e&&e._owner&&e._owner!==De.current&&(c=" It was passed a child from "+X(e._owner.type)+"."),be(e),M('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',o,c),be(null)}}function fr(e,r){{if(typeof e!="object")return;if(Me(e))for(var o=0;o<e.length;o++){var c=e[o];Fe(c)&&cr(c,r)}else if(Fe(e))e._store&&(e._store.validated=!0);else if(e){var A=L(e);if(typeof A=="function"&&A!==e.entries)for(var D=A.call(e),O;!(O=D.next()).done;)Fe(O.value)&&cr(O.value,r)}}}function Lr(e){{var r=e.type;if(r==null||typeof r=="string")return;var o;if(typeof r=="function")o=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===y||r.$$typeof===d))o=r.propTypes;else return;if(o){var c=X(r);Or(o,e.props,"prop",c,e)}else if(r.PropTypes!==void 0&&!$e){$e=!0;var A=X(r);M("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",A||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&M("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Wr(e){{for(var r=Object.keys(e.props),o=0;o<r.length;o++){var c=r[o];if(c!=="children"&&c!=="key"){be(e),M("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",c),be(null);break}}e.ref!==null&&(be(e),M("Invalid attribute `ref` supplied to `React.Fragment`."),be(null))}}var lr={};function dr(e,r,o,c,A,D){{var O=K(e);if(!O){var R="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(R+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var G=Fr();G?R+=G:R+=sr();var N;e===null?N="null":Me(e)?N="array":e!==void 0&&e.$$typeof===Y?(N="<"+(X(e.type)||"Unknown")+" />",R=" Did you accidentally export a JSX literal instead of a component?"):N=typeof e,M("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",N,R)}var V=$r(e,r,o,A,D);if(V==null)return V;if(O){var ae=r.children;if(ae!==void 0)if(c)if(Me(ae)){for(var ge=0;ge<ae.length;ge++)fr(ae[ge],e);Object.freeze&&Object.freeze(ae)}else M("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else fr(ae,e)}if(Re.call(r,"key")){var ye=X(e),ee=Object.keys(r).filter(function(Br){return Br!=="key"}),Ye=ee.length>0?"{key: someKey, "+ee.join(": ..., ")+": ...}":"{key: someKey}";if(!lr[ye+Ye]){var zr=ee.length>0?"{"+ee.join(": ..., ")+": ...}":"{}";M(`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} />`,Ye,ye,zr,ye),lr[ye+Ye]=!0}}return e===v?Wr(V):Lr(V),V}}function Ur(e,r,o){return dr(e,r,o,!0)}function qr(e,r,o){return dr(e,r,o,!1)}var Nr=qr,Vr=Ur;Te.Fragment=v,Te.jsx=Nr,Te.jsxs=Vr}()),Te}process.env.NODE_ENV==="production"?Oe.exports=pr():Oe.exports=yr();var se=Oe.exports,Pe={exports:{}},_e={exports:{}},C={};/** @license React v16.13.1
* react-is.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 hr(){if(Ue)return C;Ue=1;var s=typeof Symbol=="function"&&Symbol.for,Y=s?Symbol.for("react.element"):60103,I=s?Symbol.for("react.portal"):60106,v=s?Symbol.for("react.fragment"):60107,x=s?Symbol.for("react.strict_mode"):60108,f=s?Symbol.for("react.profiler"):60114,P=s?Symbol.for("react.provider"):60109,l=s?Symbol.for("react.context"):60110,y=s?Symbol.for("react.async_mode"):60111,_=s?Symbol.for("react.concurrent_mode"):60111,u=s?Symbol.for("react.forward_ref"):60112,d=s?Symbol.for("react.suspense"):60113,k=s?Symbol.for("react.suspense_list"):60120,F=s?Symbol.for("react.memo"):60115,z=s?Symbol.for("react.lazy"):60116,$=s?Symbol.for("react.block"):60121,L=s?Symbol.for("react.fundamental"):60117,U=s?Symbol.for("react.responder"):60118,M=s?Symbol.for("react.scope"):60119;function q(a){if(typeof a=="object"&&a!==null){var te=a.$$typeof;switch(te){case Y:switch(a=a.type,a){case y:case _:case v:case f:case x:case d:return a;default:switch(a=a&&a.$$typeof,a){case l:case u:case z:case F:case P:return a;default:return te}}case I:return te}}}function W(a){return q(a)===_}return C.AsyncMode=y,C.ConcurrentMode=_,C.ContextConsumer=l,C.ContextProvider=P,C.Element=Y,C.ForwardRef=u,C.Fragment=v,C.Lazy=z,C.Memo=F,C.Portal=I,C.Profiler=f,C.StrictMode=x,C.Suspense=d,C.isAsyncMode=function(a){return W(a)||q(a)===y},C.isConcurrentMode=W,C.isContextConsumer=function(a){return q(a)===l},C.isContextProvider=function(a){return q(a)===P},C.isElement=function(a){return typeof a=="object"&&a!==null&&a.$$typeof===Y},C.isForwardRef=function(a){return q(a)===u},C.isFragment=function(a){return q(a)===v},C.isLazy=function(a){return q(a)===z},C.isMemo=function(a){return q(a)===F},C.isPortal=function(a){return q(a)===I},C.isProfiler=function(a){return q(a)===f},C.isStrictMode=function(a){return q(a)===x},C.isSuspense=function(a){return q(a)===d},C.isValidElementType=function(a){return typeof a=="string"||typeof a=="function"||a===v||a===_||a===f||a===x||a===d||a===k||typeof a=="object"&&a!==null&&(a.$$typeof===z||a.$$typeof===F||a.$$typeof===P||a.$$typeof===l||a.$$typeof===u||a.$$typeof===L||a.$$typeof===U||a.$$typeof===M||a.$$typeof===$)},C.typeOf=q,C}var j={};/** @license React v16.13.1
* react-is.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 qe;function mr(){return qe||(qe=1,process.env.NODE_ENV!=="production"&&function(){var s=typeof Symbol=="function"&&Symbol.for,Y=s?Symbol.for("react.element"):60103,I=s?Symbol.for("react.portal"):60106,v=s?Symbol.for("react.fragment"):60107,x=s?Symbol.for("react.strict_mode"):60108,f=s?Symbol.for("react.profiler"):60114,P=s?Symbol.for("react.provider"):60109,l=s?Symbol.for("react.context"):60110,y=s?Symbol.for("react.async_mode"):60111,_=s?Symbol.for("react.concurrent_mode"):60111,u=s?Symbol.for("react.forward_ref"):60112,d=s?Symbol.for("react.suspense"):60113,k=s?Symbol.for("react.suspense_list"):60120,F=s?Symbol.for("react.memo"):60115,z=s?Symbol.for("react.lazy"):60116,$=s?Symbol.for("react.block"):60121,L=s?Symbol.for("react.fundamental"):60117,U=s?Symbol.for("react.responder"):60118,M=s?Symbol.for("react.scope"):60119;function q(n){return typeof n=="string"||typeof n=="function"||n===v||n===_||n===f||n===x||n===d||n===k||typeof n=="object"&&n!==null&&(n.$$typeof===z||n.$$typeof===F||n.$$typeof===P||n.$$typeof===l||n.$$typeof===u||n.$$typeof===L||n.$$typeof===U||n.$$typeof===M||n.$$typeof===$)}function W(n){if(typeof n=="object"&&n!==null){var ne=n.$$typeof;switch(ne){case Y:var me=n.type;switch(me){case y:case _:case v:case f:case x:case d:return me;default:var pe=me&&me.$$typeof;switch(pe){case l:case u:case z:case F:case P:return pe;default:return ne}}case I:return ne}}}var a=y,te=_,ue=l,fe=P,le=Y,K=u,B=v,Q=z,X=F,J=I,ce=f,re=x,ie=d,ve=!1;function he(n){return ve||(ve=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),t(n)||W(n)===y}function t(n){return W(n)===_}function i(n){return W(n)===l}function g(n){return W(n)===P}function b(n){return typeof n=="object"&&n!==null&&n.$$typeof===Y}function p(n){return W(n)===u}function S(n){return W(n)===v}function h(n){return W(n)===z}function m(n){return W(n)===F}function E(n){return W(n)===I}function w(n){return W(n)===f}function T(n){return W(n)===x}function H(n){return W(n)===d}j.AsyncMode=a,j.ConcurrentMode=te,j.ContextConsumer=ue,j.ContextProvider=fe,j.Element=le,j.ForwardRef=K,j.Fragment=B,j.Lazy=Q,j.Memo=X,j.Portal=J,j.Profiler=ce,j.StrictMode=re,j.Suspense=ie,j.isAsyncMode=he,j.isConcurrentMode=t,j.isContextConsumer=i,j.isContextProvider=g,j.isElement=b,j.isForwardRef=p,j.isFragment=S,j.isLazy=h,j.isMemo=m,j.isPortal=E,j.isProfiler=w,j.isStrictMode=T,j.isSuspense=H,j.isValidElementType=q,j.typeOf=W}()),j}var Ne;function Ve(){return Ne||(Ne=1,process.env.NODE_ENV==="production"?_e.exports=hr():_e.exports=mr()),_e.exports}/*
object-assign
(c) Sindre Sorhus
@license MIT
*/var we,ze;function br(){if(ze)return we;ze=1;var s=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;function v(f){if(f==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(f)}function x(){try{if(!Object.assign)return!1;var f=new String("abc");if(f[5]="de",Object.getOwnPropertyNames(f)[0]==="5")return!1;for(var P={},l=0;l<10;l++)P["_"+String.fromCharCode(l)]=l;var y=Object.getOwnPropertyNames(P).map(function(u){return P[u]});if(y.join("")!=="0123456789")return!1;var _={};return"abcdefghijklmnopqrst".split("").forEach(function(u){_[u]=u}),Object.keys(Object.assign({},_)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}return we=x()?Object.assign:function(f,P){for(var l,y=v(f),_,u=1;u<arguments.length;u++){l=Object(arguments[u]);for(var d in l)Y.call(l,d)&&(y[d]=l[d]);if(s){_=s(l);for(var k=0;k<_.length;k++)I.call(l,_[k])&&(y[_[k]]=l[_[k]])}}return y},we}var xe,Be;function Ce(){if(Be)return xe;Be=1;var s="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return xe=s,xe}var je,Je;function Ke(){return Je||(Je=1,je=Function.call.bind(Object.prototype.hasOwnProperty)),je}var Ae,Xe;function gr(){if(Xe)return Ae;Xe=1;var s=function(){};if(process.env.NODE_ENV!=="production"){var Y=Ce(),I={},v=Ke();s=function(f){var P="Warning: "+f;typeof console<"u"&&console.error(P);try{throw new Error(P)}catch{}}}function x(f,P,l,y,_){if(process.env.NODE_ENV!=="production"){for(var u in f)if(v(f,u)){var d;try{if(typeof f[u]!="function"){var k=Error((y||"React class")+": "+l+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof f[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw k.name="Invariant Violation",k}d=f[u](P,u,y,l,null,Y)}catch(z){d=z}if(d&&!(d instanceof Error)&&s((y||"React class")+": type specification of "+l+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in I)){I[d.message]=!0;var F=_?_():"";s("Failed "+l+" type: "+d.message+(F??""))}}}}return x.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(I={})},Ae=x,Ae}var Ie,He;function Er(){if(He)return Ie;He=1;var s=Ve(),Y=br(),I=Ce(),v=Ke(),x=gr(),f=function(){};process.env.NODE_ENV!=="production"&&(f=function(l){var y="Warning: "+l;typeof console<"u"&&console.error(y);try{throw new Error(y)}catch{}});function P(){return null}return Ie=function(l,y){var _=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(t){var i=t&&(_&&t[_]||t[u]);if(typeof i=="function")return i}var k="<<anonymous>>",F={array:U("array"),bigint:U("bigint"),bool:U("boolean"),func:U("function"),number:U("number"),object:U("object"),string:U("string"),symbol:U("symbol"),any:M(),arrayOf:q,element:W(),elementType:a(),instanceOf:te,node:K(),objectOf:fe,oneOf:ue,oneOfType:le,shape:Q,exact:X};function z(t,i){return t===i?t!==0||1/t===1/i:t!==t&&i!==i}function $(t,i){this.message=t,this.data=i&&typeof i=="object"?i:{},this.stack=""}$.prototype=Error.prototype;function L(t){if(process.env.NODE_ENV!=="production")var i={},g=0;function b(S,h,m,E,w,T,H){if(E=E||k,T=T||m,H!==I){if(y){var n=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 n.name="Invariant Violation",n}else if(process.env.NODE_ENV!=="production"&&typeof console<"u"){var ne=E+":"+m;!i[ne]&&g<3&&(f("You are manually calling a React.PropTypes validation function for the `"+T+"` prop on `"+E+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),i[ne]=!0,g++)}}return h[m]==null?S?h[m]===null?new $("The "+w+" `"+T+"` is marked as required "+("in `"+E+"`, but its value is `null`.")):new $("The "+w+" `"+T+"` is marked as required in "+("`"+E+"`, but its value is `undefined`.")):null:t(h,m,E,w,T)}var p=b.bind(null,!1);return p.isRequired=b.bind(null,!0),p}function U(t){function i(g,b,p,S,h,m){var E=g[b],w=re(E);if(w!==t){var T=ie(E);return new $("Invalid "+S+" `"+h+"` of type "+("`"+T+"` supplied to `"+p+"`, expected ")+("`"+t+"`."),{expectedType:t})}return null}return L(i)}function M(){return L(P)}function q(t){function i(g,b,p,S,h){if(typeof t!="function")return new $("Property `"+h+"` of component `"+p+"` has invalid PropType notation inside arrayOf.");var m=g[b];if(!Array.isArray(m)){var E=re(m);return new $("Invalid "+S+" `"+h+"` of type "+("`"+E+"` supplied to `"+p+"`, expected an array."))}for(var w=0;w<m.length;w++){var T=t(m,w,p,S,h+"["+w+"]",I);if(T instanceof Error)return T}return null}return L(i)}function W(){function t(i,g,b,p,S){var h=i[g];if(!l(h)){var m=re(h);return new $("Invalid "+p+" `"+S+"` of type "+("`"+m+"` supplied to `"+b+"`, expected a single ReactElement."))}return null}return L(t)}function a(){function t(i,g,b,p,S){var h=i[g];if(!s.isValidElementType(h)){var m=re(h);return new $("Invalid "+p+" `"+S+"` of type "+("`"+m+"` supplied to `"+b+"`, expected a single ReactElement type."))}return null}return L(t)}function te(t){function i(g,b,p,S,h){if(!(g[b]instanceof t)){var m=t.name||k,E=he(g[b]);return new $("Invalid "+S+" `"+h+"` of type "+("`"+E+"` supplied to `"+p+"`, expected ")+("instance of `"+m+"`."))}return null}return L(i)}function ue(t){if(!Array.isArray(t))return process.env.NODE_ENV!=="production"&&(arguments.length>1?f("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):f("Invalid argument supplied to oneOf, expected an array.")),P;function i(g,b,p,S,h){for(var m=g[b],E=0;E<t.length;E++)if(z(m,t[E]))return null;var w=JSON.stringify(t,function(H,n){var ne=ie(n);return ne==="symbol"?String(n):n});return new $("Invalid "+S+" `"+h+"` of value `"+String(m)+"` "+("supplied to `"+p+"`, expected one of "+w+"."))}return L(i)}function fe(t){function i(g,b,p,S,h){if(typeof t!="function")return new $("Property `"+h+"` of component `"+p+"` has invalid PropType notation inside objectOf.");var m=g[b],E=re(m);if(E!=="object")return new $("Invalid "+S+" `"+h+"` of type "+("`"+E+"` supplied to `"+p+"`, expected an object."));for(var w in m)if(v(m,w)){var T=t(m,w,p,S,h+"."+w,I);if(T instanceof Error)return T}return null}return L(i)}function le(t){if(!Array.isArray(t))return process.env.NODE_ENV!=="production"&&f("Invalid argument supplied to oneOfType, expected an instance of array."),P;for(var i=0;i<t.length;i++){var g=t[i];if(typeof g!="function")return f("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+ve(g)+" at index "+i+"."),P}function b(p,S,h,m,E){for(var w=[],T=0;T<t.length;T++){var H=t[T],n=H(p,S,h,m,E,I);if(n==null)return null;n.data&&v(n.data,"expectedType")&&w.push(n.data.expectedType)}var ne=w.length>0?", expected one of type ["+w.join(", ")+"]":"";return new $("Invalid "+m+" `"+E+"` supplied to "+("`"+h+"`"+ne+"."))}return L(b)}function K(){function t(i,g,b,p,S){return J(i[g])?null:new $("Invalid "+p+" `"+S+"` supplied to "+("`"+b+"`, expected a ReactNode."))}return L(t)}function B(t,i,g,b,p){return new $((t||"React class")+": "+i+" type `"+g+"."+b+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+p+"`.")}function Q(t){function i(g,b,p,S,h){var m=g[b],E=re(m);if(E!=="object")return new $("Invalid "+S+" `"+h+"` of type `"+E+"` "+("supplied to `"+p+"`, expected `object`."));for(var w in t){var T=t[w];if(typeof T!="function")return B(p,S,h,w,ie(T));var H=T(m,w,p,S,h+"."+w,I);if(H)return H}return null}return L(i)}function X(t){function i(g,b,p,S,h){var m=g[b],E=re(m);if(E!=="object")return new $("Invalid "+S+" `"+h+"` of type `"+E+"` "+("supplied to `"+p+"`, expected `object`."));var w=Y({},g[b],t);for(var T in w){var H=t[T];if(v(t,T)&&typeof H!="function")return B(p,S,h,T,ie(H));if(!H)return new $("Invalid "+S+" `"+h+"` key `"+T+"` supplied to `"+p+"`.\nBad object: "+JSON.stringify(g[b],null," ")+`
Valid keys: `+JSON.stringify(Object.keys(t),null," "));var n=H(m,T,p,S,h+"."+T,I);if(n)return n}return null}return L(i)}function J(t){switch(typeof t){case"number":case"string":case"undefined":return!0;case"boolean":return!t;case"object":if(Array.isArray(t))return t.every(J);if(t===null||l(t))return!0;var i=d(t);if(i){var g=i.call(t),b;if(i!==t.entries){for(;!(b=g.next()).done;)if(!J(b.value))return!1}else for(;!(b=g.next()).done;){var p=b.value;if(p&&!J(p[1]))return!1}}else return!1;return!0;default:return!1}}function ce(t,i){return t==="symbol"?!0:i?i["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&i instanceof Symbol:!1}function re(t){var i=typeof t;return Array.isArray(t)?"array":t instanceof RegExp?"object":ce(i,t)?"symbol":i}function ie(t){if(typeof t>"u"||t===null)return""+t;var i=re(t);if(i==="object"){if(t instanceof Date)return"date";if(t instanceof RegExp)return"regexp"}return i}function ve(t){var i=ie(t);switch(i){case"array":case"object":return"an "+i;case"boolean":case"date":case"regexp":return"a "+i;default:return i}}function he(t){return!t.constructor||!t.constructor.name?k:t.constructor.name}return F.checkPropTypes=x,F.resetWarningCache=x.resetWarningCache,F.PropTypes=F,F},Ie}var ke,Ge;function Tr(){if(Ge)return ke;Ge=1;var s=Ce();function Y(){}function I(){}return I.resetWarningCache=Y,ke=function(){function v(P,l,y,_,u,d){if(d!==s){var k=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 k.name="Invariant Violation",k}}v.isRequired=v;function x(){return v}var f={array:v,bigint:v,bool:v,func:v,number:v,object:v,string:v,symbol:v,any:v,arrayOf:x,element:v,elementType:v,instanceOf:x,node:v,objectOf:x,oneOf:x,oneOfType:x,shape:x,exact:x,checkPropTypes:I,resetWarningCache:Y};return f.PropTypes=f,f},ke}if(process.env.NODE_ENV!=="production"){var Rr=Ve(),_r=!0;Pe.exports=Er()(Rr.isElement,_r)}else Pe.exports=Tr()();var Sr=Pe.exports;const oe=vr(Sr),Ze=({firstImage:s,secondImage:Y,initialPosition:I=50,sliderColor:v="white",sliderWidth:x=2,buttonSize:f=40,width:P="800px",height:l="400px",className:y="",style:_={}})=>{const[u,d]=Z.useState(I),[k,F]=Z.useState(!0),[z,$]=Z.useState(0),L=Z.useRef(null),U=Z.useRef(null),M=Z.useRef(!1),q=()=>{$(K=>K+1)},W=K=>{console.error(`Failed to load image: ${K.target.src}`)},a=K=>{if(!M.current)return;const B=L.current.getBoundingClientRect(),X=Math.max(0,Math.min(K.clientX-B.left,B.width))/B.width*100;d(X)},te=()=>{M.current=!0},ue=()=>{M.current=!1},fe=K=>{if(!M.current)return;const B=K.touches[0],Q=L.current.getBoundingClientRect(),J=Math.max(0,Math.min(B.clientX-Q.left,Q.width))/Q.width*100;d(J)},le=K=>{switch(K.key){case"ArrowLeft":d(B=>Math.max(0,B-1));break;case"ArrowRight":d(B=>Math.min(100,B+1));break;case"Home":d(0);break;case"End":d(100);break}};return Z.useEffect(()=>{var X;(X=U.current)==null||X.focus();const K=L.current,B=J=>{J.preventDefault(),fe(J)};K.addEventListener("touchmove",B,{passive:!1});const Q=()=>{M.current=!1};return window.addEventListener("mouseup",Q),()=>{K.removeEventListener("touchmove",B),window.removeEventListener("mouseup",Q)}},[]),Z.useEffect(()=>{z===2&&F(!1)},[z]),se.jsxs("div",{ref:L,className:`dualvue-container ${y}`,style:{width:P,height:l,margin:"0 auto",..._},onMouseMove:a,onMouseUp:ue,onMouseLeave:ue,onTouchMove:fe,onTouchStart:te,onTouchEnd:ue,children:[k&&se.jsx("div",{className:"dualvue-loading",children:"Loading..."}),se.jsx("div",{className:"image-wrapper",children:se.jsx("img",{src:s,alt:"First",className:"dualvue-image",onLoad:q,onError:W})}),se.jsx("div",{className:"image-wrapper overlay",style:{clipPath:`inset(0 ${100-u}% 0 0)`},children:se.jsx("img",{src:Y,alt:"Second",className:"dualvue-image",onLoad:q,onError:W})}),se.jsxs("div",{ref:U,className:"dualvue-slider",style:{left:`${u}%`},onMouseDown:te,tabIndex:0,onKeyDown:le,role:"slider","aria-label":"Image comparison slider","aria-valuenow":u,"aria-valuemin":0,"aria-valuemax":100,children:[se.jsx("div",{className:"slider-bar",style:{backgroundColor:v,width:`${x}px`}}),se.jsx("div",{className:"slider-button",style:{width:`${f}px`,height:`${f}px`}})]})]})};Ze.propTypes={firstImage:oe.string.isRequired,secondImage:oe.string.isRequired,initialPosition:oe.number,sliderColor:oe.string,sliderWidth:oe.number,buttonSize:oe.number,width:oe.string,height:oe.string,className:oe.string,style:oe.object},de.DualVue=Ze,Object.defineProperty(de,Symbol.toStringTag,{value:"Module"})});