diff --git a/dist/assets/index-BgC4eDEl.js b/dist/assets/index-BgC4eDEl.js deleted file mode 100644 index 371bf95..0000000 --- a/dist/assets/index-BgC4eDEl.js +++ /dev/null @@ -1,5341 +0,0 @@ -var hh=e=>{throw TypeError(e)};var Gc=(e,t,n)=>t.has(e)||hh("Cannot "+n);var k=(e,t,n)=>(Gc(e,t,"read from private field"),n?n.call(e):t.get(e)),te=(e,t,n)=>t.has(e)?hh("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),V=(e,t,n,r)=>(Gc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ue=(e,t,n)=>(Gc(e,t,"access private method"),n);var Ca=(e,t,n,r)=>({set _(o){V(e,t,o,n)},get _(){return k(e,t,r)}});function Cx(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Sx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var kx={exports:{}},ac={},Px={exports:{}},pe={};/** - * @license React - * react.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 oa=Symbol.for("react.element"),Zv=Symbol.for("react.portal"),ew=Symbol.for("react.fragment"),tw=Symbol.for("react.strict_mode"),nw=Symbol.for("react.profiler"),rw=Symbol.for("react.provider"),ow=Symbol.for("react.context"),iw=Symbol.for("react.forward_ref"),sw=Symbol.for("react.suspense"),aw=Symbol.for("react.memo"),lw=Symbol.for("react.lazy"),mh=Symbol.iterator;function cw(e){return e===null||typeof e!="object"?null:(e=mh&&e[mh]||e["@@iterator"],typeof e=="function"?e:null)}var Ex={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Rx=Object.assign,Ax={};function Ti(e,t,n){this.props=e,this.context=t,this.refs=Ax,this.updater=n||Ex}Ti.prototype.isReactComponent={};Ti.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ti.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ix(){}Ix.prototype=Ti.prototype;function _f(e,t,n){this.props=e,this.context=t,this.refs=Ax,this.updater=n||Ex}var Mf=_f.prototype=new Ix;Mf.constructor=_f;Rx(Mf,Ti.prototype);Mf.isPureReactComponent=!0;var gh=Array.isArray,Dx=Object.prototype.hasOwnProperty,$f={current:null},Ox={key:!0,ref:!0,__self:!0,__source:!0};function Tx(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)Dx.call(t,r)&&!Ox.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1>>1,ne=W[ie];if(0>>1;ieo(Ne,X))Ceo(M,Ne)?(W[ie]=M,W[Ce]=X,ie=Ce):(W[ie]=Ne,W[be]=X,ie=be);else if(Ceo(M,X))W[ie]=M,W[Ce]=X,ie=Ce;else break e}}return H}function o(W,H){var X=W.sortIndex-H.sortIndex;return X!==0?X:W.id-H.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var u=[],d=[],p=1,f=null,h=3,b=!1,y=!1,x=!1,j=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(W){for(var H=n(d);H!==null;){if(H.callback===null)r(d);else if(H.startTime<=W)r(d),H.sortIndex=H.expirationTime,t(u,H);else break;H=n(d)}}function C(W){if(x=!1,v(W),!y)if(n(u)!==null)y=!0,he(P);else{var H=n(d);H!==null&&oe(C,H.startTime-W)}}function P(W,H){y=!1,x&&(x=!1,g(I),I=-1),b=!0;var X=h;try{for(v(H),f=n(u);f!==null&&(!(f.expirationTime>H)||W&&!N());){var ie=f.callback;if(typeof ie=="function"){f.callback=null,h=f.priorityLevel;var ne=ie(f.expirationTime<=H);H=e.unstable_now(),typeof ne=="function"?f.callback=ne:f===n(u)&&r(u),v(H)}else r(u);f=n(u)}if(f!==null)var Ve=!0;else{var be=n(d);be!==null&&oe(C,be.startTime-H),Ve=!1}return Ve}finally{f=null,h=X,b=!1}}var S=!1,R=null,I=-1,L=5,B=-1;function N(){return!(e.unstable_now()-BW||125ie?(W.sortIndex=X,t(d,W),n(u)===null&&W===n(d)&&(x?(g(I),I=-1):x=!0,oe(C,X-ie))):(W.sortIndex=ne,t(u,W),y||b||(y=!0,he(P))),W},e.unstable_shouldYield=N,e.unstable_wrapCallback=function(W){var H=h;return function(){var X=h;h=H;try{return W.apply(this,arguments)}finally{h=X}}}})($x);Mx.exports=$x;var bw=Mx.exports;/** - * @license React - * react-dom.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 jw=w,Ht=bw;function z(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ld=Object.prototype.hasOwnProperty,Cw=/^[: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][: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]*$/,yh={},vh={};function Sw(e){return ld.call(vh,e)?!0:ld.call(yh,e)?!1:Cw.test(e)?vh[e]=!0:(yh[e]=!0,!1)}function kw(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Pw(e,t,n,r){if(t===null||typeof t>"u"||kw(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function kt(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var ft={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ft[e]=new kt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ft[t]=new kt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ft[e]=new kt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ft[e]=new kt(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".split(" ").forEach(function(e){ft[e]=new kt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ft[e]=new kt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ft[e]=new kt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ft[e]=new kt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ft[e]=new kt(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ff=/[\-:]([a-z])/g;function Uf(e){return 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".split(" ").forEach(function(e){var t=e.replace(Ff,Uf);ft[t]=new kt(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ff,Uf);ft[t]=new kt(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ff,Uf);ft[t]=new kt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ft[e]=new kt(e,1,!1,e.toLowerCase(),null,!1,!1)});ft.xlinkHref=new kt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ft[e]=new kt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Bf(e,t,n,r){var o=ft.hasOwnProperty(t)?ft[t]:null;(o!==null?o.type!==0:r||!(2l||o[a]!==i[l]){var u=` -`+o[a].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=a&&0<=l);break}}}finally{Jc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ps(e):""}function Ew(e){switch(e.tag){case 5:return ps(e.type);case 16:return ps("Lazy");case 13:return ps("Suspense");case 19:return ps("SuspenseList");case 0:case 2:case 15:return e=Xc(e.type,!1),e;case 11:return e=Xc(e.type.render,!1),e;case 1:return e=Xc(e.type,!0),e;default:return""}}function fd(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Uo:return"Fragment";case Fo:return"Portal";case cd:return"Profiler";case Wf:return"StrictMode";case ud:return"Suspense";case dd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ux:return(e.displayName||"Context")+".Consumer";case Fx:return(e._context.displayName||"Context")+".Provider";case Hf:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Vf:return t=e.displayName||null,t!==null?t:fd(e.type)||"Memo";case dr:t=e._payload,e=e._init;try{return fd(e(t))}catch{}}return null}function Rw(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fd(t);case 8:return t===Wf?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function _r(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Wx(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Aw(e){var t=Wx(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Pa(e){e._valueTracker||(e._valueTracker=Aw(e))}function Hx(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Wx(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function jl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function pd(e,t){var n=t.checked;return Fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function bh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=_r(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Vx(e,t){t=t.checked,t!=null&&Bf(e,"checked",t,!1)}function hd(e,t){Vx(e,t);var n=_r(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?md(e,t.type,n):t.hasOwnProperty("defaultValue")&&md(e,t.type,_r(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function jh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function md(e,t,n){(t!=="number"||jl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var hs=Array.isArray;function Zo(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Ea.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ds(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var ws={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Iw=["Webkit","ms","Moz","O"];Object.keys(ws).forEach(function(e){Iw.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ws[t]=ws[e]})});function qx(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||ws.hasOwnProperty(e)&&ws[e]?(""+t).trim():t+"px"}function Yx(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=qx(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var Dw=Fe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yd(e,t){if(t){if(Dw[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(z(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(z(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(z(61))}if(t.style!=null&&typeof t.style!="object")throw Error(z(62))}}function vd(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wd=null;function Qf(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bd=null,ei=null,ti=null;function kh(e){if(e=aa(e)){if(typeof bd!="function")throw Error(z(280));var t=e.stateNode;t&&(t=fc(t),bd(e.stateNode,e.type,t))}}function Jx(e){ei?ti?ti.push(e):ti=[e]:ei=e}function Xx(){if(ei){var e=ei,t=ti;if(ti=ei=null,kh(e),t)for(e=0;e>>=0,e===0?32:31-(Bw(e)/Ww|0)|0}var Ra=64,Aa=4194304;function ms(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Pl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~o;l!==0?r=ms(l):(i&=a,i!==0&&(r=ms(i)))}else a=n&~o,a!==0?r=ms(a):i!==0&&(r=ms(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function ia(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fn(t),e[t]=n}function Kw(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=js),Nh=" ",Lh=!1;function y0(e,t){switch(e){case"keyup":return bb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function v0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Bo=!1;function Cb(e,t){switch(e){case"compositionend":return v0(t);case"keypress":return t.which!==32?null:(Lh=!0,Nh);case"textInput":return e=t.data,e===Nh&&Lh?null:e;default:return null}}function Sb(e,t){if(Bo)return e==="compositionend"||!ep&&y0(e,t)?(e=g0(),ol=Jf=Sr=null,Bo=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=zh(n)}}function C0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?C0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function S0(){for(var e=window,t=jl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=jl(e.document)}return t}function tp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Tb(e){var t=S0(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&C0(n.ownerDocument.documentElement,n)){if(r!==null&&tp(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Fh(n,i);var a=Fh(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Wo=null,Ed=null,Ss=null,Rd=!1;function Uh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Rd||Wo==null||Wo!==jl(r)||(r=Wo,"selectionStart"in r&&tp(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ss&&Ms(Ss,r)||(Ss=r,r=Al(Ed,"onSelect"),0Qo||(e.current=Nd[Qo],Nd[Qo]=null,Qo--)}function Ie(e,t){Qo++,Nd[Qo]=e.current,e.current=t}var Mr={},yt=zr(Mr),Dt=zr(!1),xo=Mr;function bi(e,t){var n=e.type.contextTypes;if(!n)return Mr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Ot(e){return e=e.childContextTypes,e!=null}function Dl(){Te(Dt),Te(yt)}function Gh(e,t,n){if(yt.current!==Mr)throw Error(z(168));Ie(yt,t),Ie(Dt,n)}function T0(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(z(108,Rw(e)||"Unknown",o));return Fe({},n,r)}function Ol(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Mr,xo=yt.current,Ie(yt,e),Ie(Dt,Dt.current),!0}function qh(e,t,n){var r=e.stateNode;if(!r)throw Error(z(169));n?(e=T0(e,t,xo),r.__reactInternalMemoizedMergedChildContext=e,Te(Dt),Te(yt),Ie(yt,e)):Te(Dt),Ie(Dt,n)}var Wn=null,pc=!1,fu=!1;function N0(e){Wn===null?Wn=[e]:Wn.push(e)}function Vb(e){pc=!0,N0(e)}function Fr(){if(!fu&&Wn!==null){fu=!0;var e=0,t=Pe;try{var n=Wn;for(Pe=1;e>=a,o-=a,Vn=1<<32-fn(t)+o|n<I?(L=R,R=null):L=R.sibling;var B=h(g,R,v[I],C);if(B===null){R===null&&(R=L);break}e&&R&&B.alternate===null&&t(g,R),m=i(B,m,I),S===null?P=B:S.sibling=B,S=B,R=L}if(I===v.length)return n(g,R),_e&&Gr(g,I),P;if(R===null){for(;II?(L=R,R=null):L=R.sibling;var N=h(g,R,B.value,C);if(N===null){R===null&&(R=L);break}e&&R&&N.alternate===null&&t(g,R),m=i(N,m,I),S===null?P=N:S.sibling=N,S=N,R=L}if(B.done)return n(g,R),_e&&Gr(g,I),P;if(R===null){for(;!B.done;I++,B=v.next())B=f(g,B.value,C),B!==null&&(m=i(B,m,I),S===null?P=B:S.sibling=B,S=B);return _e&&Gr(g,I),P}for(R=r(g,R);!B.done;I++,B=v.next())B=b(R,g,I,B.value,C),B!==null&&(e&&B.alternate!==null&&R.delete(B.key===null?I:B.key),m=i(B,m,I),S===null?P=B:S.sibling=B,S=B);return e&&R.forEach(function(O){return t(g,O)}),_e&&Gr(g,I),P}function j(g,m,v,C){if(typeof v=="object"&&v!==null&&v.type===Uo&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case ka:e:{for(var P=v.key,S=m;S!==null;){if(S.key===P){if(P=v.type,P===Uo){if(S.tag===7){n(g,S.sibling),m=o(S,v.props.children),m.return=g,g=m;break e}}else if(S.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===dr&&Xh(P)===S.type){n(g,S.sibling),m=o(S,v.props),m.ref=Zi(g,S,v),m.return=g,g=m;break e}n(g,S);break}else t(g,S);S=S.sibling}v.type===Uo?(m=ho(v.props.children,g.mode,C,v.key),m.return=g,g=m):(C=fl(v.type,v.key,v.props,null,g.mode,C),C.ref=Zi(g,m,v),C.return=g,g=C)}return a(g);case Fo:e:{for(S=v.key;m!==null;){if(m.key===S)if(m.tag===4&&m.stateNode.containerInfo===v.containerInfo&&m.stateNode.implementation===v.implementation){n(g,m.sibling),m=o(m,v.children||[]),m.return=g,g=m;break e}else{n(g,m);break}else t(g,m);m=m.sibling}m=wu(v,g.mode,C),m.return=g,g=m}return a(g);case dr:return S=v._init,j(g,m,S(v._payload),C)}if(hs(v))return y(g,m,v,C);if(Gi(v))return x(g,m,v,C);_a(g,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,m!==null&&m.tag===6?(n(g,m.sibling),m=o(m,v),m.return=g,g=m):(n(g,m),m=vu(v,g.mode,C),m.return=g,g=m),a(g)):n(g,m)}return j}var Ci=$0(!0),z0=$0(!1),Ll=zr(null),_l=null,qo=null,ip=null;function sp(){ip=qo=_l=null}function ap(e){var t=Ll.current;Te(Ll),e._currentValue=t}function Md(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ri(e,t){_l=e,ip=qo=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(It=!0),e.firstContext=null)}function en(e){var t=e._currentValue;if(ip!==e)if(e={context:e,memoizedValue:t,next:null},qo===null){if(_l===null)throw Error(z(308));qo=e,_l.dependencies={lanes:0,firstContext:e}}else qo=qo.next=e;return t}var eo=null;function lp(e){eo===null?eo=[e]:eo.push(e)}function F0(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,lp(t)):(n.next=o.next,o.next=n),t.interleaved=n,Xn(e,r)}function Xn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var fr=!1;function cp(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function U0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Kn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Dr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ve&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Xn(e,n)}return o=r.interleaved,o===null?(t.next=t,lp(r)):(t.next=o.next,o.next=t),r.interleaved=t,Xn(e,n)}function sl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Gf(e,n)}}function Zh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ml(e,t,n,r){var o=e.updateQueue;fr=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var u=l,d=u.next;u.next=null,a===null?i=d:a.next=d,a=u;var p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==a&&(l===null?p.firstBaseUpdate=d:l.next=d,p.lastBaseUpdate=u))}if(i!==null){var f=o.baseState;a=0,p=d=u=null,l=i;do{var h=l.lane,b=l.eventTime;if((r&h)===h){p!==null&&(p=p.next={eventTime:b,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,x=l;switch(h=t,b=n,x.tag){case 1:if(y=x.payload,typeof y=="function"){f=y.call(b,f,h);break e}f=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=x.payload,h=typeof y=="function"?y.call(b,f,h):y,h==null)break e;f=Fe({},f,h);break e;case 2:fr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else b={eventTime:b,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(d=p=b,u=f):p=p.next=b,a|=h;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;h=l,l=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(p===null&&(u=f),o.baseState=u,o.firstBaseUpdate=d,o.lastBaseUpdate=p,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);wo|=a,e.lanes=a,e.memoizedState=f}}function em(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=hu.transition;hu.transition={};try{e(!1),t()}finally{Pe=n,hu.transition=r}}function oy(){return tn().memoizedState}function qb(e,t,n){var r=Tr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},iy(e))sy(t,n);else if(n=F0(e,t,n,r),n!==null){var o=Ct();pn(n,e,r,o),ay(n,t,r)}}function Yb(e,t,n){var r=Tr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(iy(e))sy(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(o.hasEagerState=!0,o.eagerState=l,mn(l,a)){var u=t.interleaved;u===null?(o.next=o,lp(t)):(o.next=u.next,u.next=o),t.interleaved=o;return}}catch{}finally{}n=F0(e,t,o,r),n!==null&&(o=Ct(),pn(n,e,r,o),ay(n,t,r))}}function iy(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function sy(e,t){ks=zl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ay(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Gf(e,n)}}var Fl={readContext:en,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useInsertionEffect:pt,useLayoutEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useMutableSource:pt,useSyncExternalStore:pt,useId:pt,unstable_isNewReconciler:!1},Jb={readContext:en,useCallback:function(e,t){return wn().memoizedState=[e,t===void 0?null:t],e},useContext:en,useEffect:nm,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ll(4194308,4,Z0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ll(4194308,4,e,t)},useInsertionEffect:function(e,t){return ll(4,2,e,t)},useMemo:function(e,t){var n=wn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=wn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=qb.bind(null,ze,e),[r.memoizedState,e]},useRef:function(e){var t=wn();return e={current:e},t.memoizedState=e},useState:tm,useDebugValue:xp,useDeferredValue:function(e){return wn().memoizedState=e},useTransition:function(){var e=tm(!1),t=e[0];return e=Gb.bind(null,e[1]),wn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ze,o=wn();if(_e){if(n===void 0)throw Error(z(407));n=n()}else{if(n=t(),st===null)throw Error(z(349));vo&30||V0(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,nm(K0.bind(null,r,i,e),[e]),r.flags|=2048,Vs(9,Q0.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=wn(),t=st.identifierPrefix;if(_e){var n=Qn,r=Vn;n=(r&~(1<<32-fn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ws++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Pn]=t,e[Fs]=r,xy(e,t,!1,!1),t.stateNode=e;e:{switch(a=vd(n,r),n){case"dialog":De("cancel",e),De("close",e),o=r;break;case"iframe":case"object":case"embed":De("load",e),o=r;break;case"video":case"audio":for(o=0;oPi&&(t.flags|=128,r=!0,es(i,!1),t.lanes=4194304)}else{if(!r)if(e=$l(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),es(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!_e)return ht(t),null}else 2*Qe()-i.renderingStartTime>Pi&&n!==1073741824&&(t.flags|=128,r=!0,es(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Qe(),t.sibling=null,n=$e.current,Ie($e,r?n&1|2:n&1),t):(ht(t),null);case 22:case 23:return Cp(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?zt&1073741824&&(ht(t),t.subtreeFlags&6&&(t.flags|=8192)):ht(t),null;case 24:return null;case 25:return null}throw Error(z(156,t.tag))}function ij(e,t){switch(rp(t),t.tag){case 1:return Ot(t.type)&&Dl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Si(),Te(Dt),Te(yt),fp(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return dp(t),null;case 13:if(Te($e),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(z(340));ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Te($e),null;case 4:return Si(),null;case 10:return ap(t.type._context),null;case 22:case 23:return Cp(),null;case 24:return null;default:return null}}var $a=!1,gt=!1,sj=typeof WeakSet=="function"?WeakSet:Set,Q=null;function Yo(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){He(e,t,r)}else n.current=null}function Qd(e,t,n){try{n()}catch(r){He(e,t,r)}}var pm=!1;function aj(e,t){if(Ad=El,e=S0(),tp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,l=-1,u=-1,d=0,p=0,f=e,h=null;t:for(;;){for(var b;f!==n||o!==0&&f.nodeType!==3||(l=a+o),f!==i||r!==0&&f.nodeType!==3||(u=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(b=f.firstChild)!==null;)h=f,f=b;for(;;){if(f===e)break t;if(h===n&&++d===o&&(l=a),h===i&&++p===r&&(u=a),(b=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=b}n=l===-1||u===-1?null:{start:l,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Id={focusedElem:e,selectionRange:n},El=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var x=y.memoizedProps,j=y.memoizedState,g=t.stateNode,m=g.getSnapshotBeforeUpdate(t.elementType===t.type?x:sn(t.type,x),j);g.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(C){He(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return y=pm,pm=!1,y}function Ps(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Qd(t,n,i)}o=o.next}while(o!==r)}}function gc(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Kd(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function wy(e){var t=e.alternate;t!==null&&(e.alternate=null,wy(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Pn],delete t[Fs],delete t[Td],delete t[Wb],delete t[Hb])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function by(e){return e.tag===5||e.tag===3||e.tag===4}function hm(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||by(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Gd(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Il));else if(r!==4&&(e=e.child,e!==null))for(Gd(e,t,n),e=e.sibling;e!==null;)Gd(e,t,n),e=e.sibling}function qd(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(qd(e,t,n),e=e.sibling;e!==null;)qd(e,t,n),e=e.sibling}var ct=null,ln=!1;function rr(e,t,n){for(n=n.child;n!==null;)jy(e,t,n),n=n.sibling}function jy(e,t,n){if(En&&typeof En.onCommitFiberUnmount=="function")try{En.onCommitFiberUnmount(lc,n)}catch{}switch(n.tag){case 5:gt||Yo(n,t);case 6:var r=ct,o=ln;ct=null,rr(e,t,n),ct=r,ln=o,ct!==null&&(ln?(e=ct,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):ct.removeChild(n.stateNode));break;case 18:ct!==null&&(ln?(e=ct,n=n.stateNode,e.nodeType===8?du(e.parentNode,n):e.nodeType===1&&du(e,n),Ls(e)):du(ct,n.stateNode));break;case 4:r=ct,o=ln,ct=n.stateNode.containerInfo,ln=!0,rr(e,t,n),ct=r,ln=o;break;case 0:case 11:case 14:case 15:if(!gt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Qd(n,t,a),o=o.next}while(o!==r)}rr(e,t,n);break;case 1:if(!gt&&(Yo(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){He(n,t,l)}rr(e,t,n);break;case 21:rr(e,t,n);break;case 22:n.mode&1?(gt=(r=gt)||n.memoizedState!==null,rr(e,t,n),gt=r):rr(e,t,n);break;default:rr(e,t,n)}}function mm(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new sj),t.forEach(function(r){var o=gj.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function rn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=a),r&=~i}if(r=o,r=Qe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*cj(r/1960))-r,10e?16:e,kr===null)var r=!1;else{if(e=kr,kr=null,Wl=0,ve&6)throw Error(z(331));var o=ve;for(ve|=4,Q=e.current;Q!==null;){var i=Q,a=i.child;if(Q.flags&16){var l=i.deletions;if(l!==null){for(var u=0;uQe()-bp?po(e,0):wp|=n),Tt(e,t)}function Iy(e,t){t===0&&(e.mode&1?(t=Aa,Aa<<=1,!(Aa&130023424)&&(Aa=4194304)):t=1);var n=Ct();e=Xn(e,t),e!==null&&(ia(e,t,n),Tt(e,n))}function mj(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Iy(e,n)}function gj(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(z(314))}r!==null&&r.delete(t),Iy(e,n)}var Dy;Dy=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Dt.current)It=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return It=!1,rj(e,t,n);It=!!(e.flags&131072)}else It=!1,_e&&t.flags&1048576&&L0(t,Nl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;cl(e,t),e=t.pendingProps;var o=bi(t,yt.current);ri(t,n),o=hp(null,t,r,e,o,n);var i=mp();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ot(r)?(i=!0,Ol(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,cp(t),o.updater=mc,t.stateNode=o,o._reactInternals=t,zd(t,r,e,n),t=Bd(null,t,r,!0,i,n)):(t.tag=0,_e&&i&&np(t),jt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(cl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=yj(r),e=sn(r,e),o){case 0:t=Ud(null,t,r,e,n);break e;case 1:t=um(null,t,r,e,n);break e;case 11:t=lm(null,t,r,e,n);break e;case 14:t=cm(null,t,r,sn(r.type,e),n);break e}throw Error(z(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),Ud(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),um(e,t,r,o,n);case 3:e:{if(hy(t),e===null)throw Error(z(387));r=t.pendingProps,i=t.memoizedState,o=i.element,U0(e,t),Ml(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=ki(Error(z(423)),t),t=dm(e,t,r,n,o);break e}else if(r!==o){o=ki(Error(z(424)),t),t=dm(e,t,r,n,o);break e}else for(Ut=Ir(t.stateNode.containerInfo.firstChild),Bt=t,_e=!0,un=null,n=z0(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ji(),r===o){t=Zn(e,t,n);break e}jt(e,t,r,n)}t=t.child}return t;case 5:return B0(t),e===null&&_d(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Dd(r,o)?a=null:i!==null&&Dd(r,i)&&(t.flags|=32),py(e,t),jt(e,t,a,n),t.child;case 6:return e===null&&_d(t),null;case 13:return my(e,t,n);case 4:return up(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ci(t,null,r,n):jt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),lm(e,t,r,o,n);case 7:return jt(e,t,t.pendingProps,n),t.child;case 8:return jt(e,t,t.pendingProps.children,n),t.child;case 12:return jt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,Ie(Ll,r._currentValue),r._currentValue=a,i!==null)if(mn(i.value,a)){if(i.children===o.children&&!Dt.current){t=Zn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var u=l.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=Kn(-1,n&-n),u.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var p=d.pending;p===null?u.next=u:(u.next=p.next,p.next=u),d.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Md(i.return,n,t),l.lanes|=n;break}u=u.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(z(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),Md(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}jt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ri(t,n),o=en(o),r=r(o),t.flags|=1,jt(e,t,r,n),t.child;case 14:return r=t.type,o=sn(r,t.pendingProps),o=sn(r.type,o),cm(e,t,r,o,n);case 15:return dy(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sn(r,o),cl(e,t),t.tag=1,Ot(r)?(e=!0,Ol(t)):e=!1,ri(t,n),ly(t,r,o),zd(t,r,o,n),Bd(null,t,r,!0,e,n);case 19:return gy(e,t,n);case 22:return fy(e,t,n)}throw Error(z(156,t.tag))};function Oy(e,t){return i0(e,t)}function xj(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xt(e,t,n,r){return new xj(e,t,n,r)}function kp(e){return e=e.prototype,!(!e||!e.isReactComponent)}function yj(e){if(typeof e=="function")return kp(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Hf)return 11;if(e===Vf)return 14}return 2}function Nr(e,t){var n=e.alternate;return n===null?(n=Xt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function fl(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")kp(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Uo:return ho(n.children,o,i,t);case Wf:a=8,o|=8;break;case cd:return e=Xt(12,n,t,o|2),e.elementType=cd,e.lanes=i,e;case ud:return e=Xt(13,n,t,o),e.elementType=ud,e.lanes=i,e;case dd:return e=Xt(19,n,t,o),e.elementType=dd,e.lanes=i,e;case Bx:return yc(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Fx:a=10;break e;case Ux:a=9;break e;case Hf:a=11;break e;case Vf:a=14;break e;case dr:a=16,r=null;break e}throw Error(z(130,e==null?e:typeof e,""))}return t=Xt(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function ho(e,t,n,r){return e=Xt(7,e,r,t),e.lanes=n,e}function yc(e,t,n,r){return e=Xt(22,e,r,t),e.elementType=Bx,e.lanes=n,e.stateNode={isHidden:!1},e}function vu(e,t,n){return e=Xt(6,e,null,t),e.lanes=n,e}function wu(e,t,n){return t=Xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vj(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=eu(0),this.expirationTimes=eu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eu(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Pp(e,t,n,r,o,i,a,l,u){return e=new vj(e,t,n,l,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Xt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},cp(i),e}function wj(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_y)}catch(e){console.error(e)}}_y(),_x.exports=Vt;var Ip=_x.exports;const kj=Sx(Ip),Pj=Cx({__proto__:null,default:kj},[Ip]);var My,Cm=Ip;My=Cm.createRoot,Cm.hydrateRoot;/** - * @remix-run/router v1.21.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Le(){return Le=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Ei(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Rj(){return Math.random().toString(36).substr(2,8)}function km(e,t){return{usr:e.state,key:e.key,idx:t}}function Ks(e,t,n,r){return n===void 0&&(n=null),Le({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ur(t):t,{state:n,key:t&&t.key||r||Rj()})}function jo(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ur(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function Aj(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,l=qe.Pop,u=null,d=p();d==null&&(d=0,a.replaceState(Le({},a.state,{idx:d}),""));function p(){return(a.state||{idx:null}).idx}function f(){l=qe.Pop;let j=p(),g=j==null?null:j-d;d=j,u&&u({action:l,location:x.location,delta:g})}function h(j,g){l=qe.Push;let m=Ks(x.location,j,g);d=p()+1;let v=km(m,d),C=x.createHref(m);try{a.pushState(v,"",C)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(C)}i&&u&&u({action:l,location:x.location,delta:1})}function b(j,g){l=qe.Replace;let m=Ks(x.location,j,g);d=p();let v=km(m,d),C=x.createHref(m);a.replaceState(v,"",C),i&&u&&u({action:l,location:x.location,delta:0})}function y(j){let g=o.location.origin!=="null"?o.location.origin:o.location.href,m=typeof j=="string"?j:jo(j);return m=m.replace(/ $/,"%20"),fe(g,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,g)}let x={get action(){return l},get location(){return e(o,a)},listen(j){if(u)throw new Error("A history only accepts one active listener");return o.addEventListener(Sm,f),u=j,()=>{o.removeEventListener(Sm,f),u=null}},createHref(j){return t(o,j)},createURL:y,encodeLocation(j){let g=y(j);return{pathname:g.pathname,search:g.search,hash:g.hash}},push:h,replace:b,go(j){return a.go(j)}};return x}var Re;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Re||(Re={}));const Ij=new Set(["lazy","caseSensitive","path","id","index","children"]);function Dj(e){return e.index===!0}function Ql(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let a=[...n,String(i)],l=typeof o.id=="string"?o.id:a.join("-");if(fe(o.index!==!0||!o.children,"Cannot specify children on an index route"),fe(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),Dj(o)){let u=Le({},o,t(o),{id:l});return r[l]=u,u}else{let u=Le({},o,t(o),{id:l,children:void 0});return r[l]=u,o.children&&(u.children=Ql(o.children,t,a,r)),u}})}function Jr(e,t,n){return n===void 0&&(n="/"),pl(e,t,n,!1)}function pl(e,t,n,r){let o=typeof t=="string"?Ur(t):t,i=_i(o.pathname||"/",n);if(i==null)return null;let a=$y(e);Tj(a);let l=null;for(let u=0;l==null&&u{let u={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};u.relativePath.startsWith("/")&&(fe(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let d=Gn([r,u.relativePath]),p=n.concat(u);i.children&&i.children.length>0&&(fe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),$y(i.children,t,p,d)),!(i.path==null&&!i.index)&&t.push({path:d,score:Fj(d,i.index),routesMeta:p})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,a);else for(let u of zy(i.path))o(i,a,u)}),t}function zy(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=zy(r.join("/")),l=[];return l.push(...a.map(u=>u===""?i:[i,u].join("/"))),o&&l.push(...a),l.map(u=>e.startsWith("/")&&u===""?"/":u)}function Tj(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Uj(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Nj=/^:[\w-]+$/,Lj=3,_j=2,Mj=1,$j=10,zj=-2,Pm=e=>e==="*";function Fj(e,t){let n=e.split("/"),r=n.length;return n.some(Pm)&&(r+=zj),t&&(r+=_j),n.filter(o=>!Pm(o)).reduce((o,i)=>o+(Nj.test(i)?Lj:i===""?Mj:$j),r)}function Uj(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Bj(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},i="/",a=[];for(let l=0;l{let{paramName:h,isOptional:b}=p;if(h==="*"){let x=l[f]||"";a=i.slice(0,i.length-x.length).replace(/(.)\/+$/,"$1")}const y=l[f];return b&&!y?d[h]=void 0:d[h]=(y||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:a,pattern:e}}function Wj(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ei(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,u)=>(r.push({paramName:l,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function Hj(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ei(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function _i(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Vj(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Ur(e):e;return{pathname:n?n.startsWith("/")?n:Qj(n,t):t,search:Gj(r),hash:qj(o)}}function Qj(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function bu(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Fy(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Cc(e,t){let n=Fy(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Sc(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Ur(e):(o=Le({},e),fe(!o.pathname||!o.pathname.includes("?"),bu("?","pathname","search",o)),fe(!o.pathname||!o.pathname.includes("#"),bu("#","pathname","hash",o)),fe(!o.search||!o.search.includes("#"),bu("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,l;if(a==null)l=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;o.pathname=h.join("/")}l=f>=0?t[f]:"/"}let u=Vj(o,l),d=a&&a!=="/"&&a.endsWith("/"),p=(i||a===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(d||p)&&(u.pathname+="/"),u}const Gn=e=>e.join("/").replace(/\/\/+/g,"/"),Kj=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Gj=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qj=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Kl{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function ca(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Uy=["post","put","patch","delete"],Yj=new Set(Uy),Jj=["get",...Uy],Xj=new Set(Jj),Zj=new Set([301,302,303,307,308]),eC=new Set([307,308]),ju={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tC={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ns={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Dp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,nC=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),By="remix-router-transitions";function rC(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;fe(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let E=e.detectErrorBoundary;o=A=>({hasErrorBoundary:E(A)})}else o=nC;let i={},a=Ql(e.routes,o,void 0,i),l,u=e.basename||"/",d=e.dataStrategy||aC,p=e.patchRoutesOnNavigation,f=Le({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,b=new Set,y=null,x=null,j=null,g=e.hydrationData!=null,m=Jr(a,e.history.location,u),v=null;if(m==null&&!p){let E=Rt(404,{pathname:e.history.location.pathname}),{matches:A,route:D}=$m(a);m=A,v={[D.id]:E}}m&&!e.hydrationData&&va(m,a,e.history.location.pathname).active&&(m=null);let C;if(m)if(m.some(E=>E.route.lazy))C=!1;else if(!m.some(E=>E.route.loader))C=!0;else if(f.v7_partialHydration){let E=e.hydrationData?e.hydrationData.loaderData:null,A=e.hydrationData?e.hydrationData.errors:null;if(A){let D=m.findIndex(_=>A[_.route.id]!==void 0);C=m.slice(0,D+1).every(_=>!tf(_.route,E,A))}else C=m.every(D=>!tf(D.route,E,A))}else C=e.hydrationData!=null;else if(C=!1,m=[],f.v7_partialHydration){let E=va(null,a,e.history.location.pathname);E.active&&E.matches&&(m=E.matches)}let P,S={historyAction:e.history.action,location:e.history.location,matches:m,initialized:C,navigation:ju,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||v,fetchers:new Map,blockers:new Map},R=qe.Pop,I=!1,L,B=!1,N=new Map,O=null,$=!1,F=!1,se=[],he=new Set,oe=new Map,W=0,H=-1,X=new Map,ie=new Set,ne=new Map,Ve=new Map,be=new Set,Ne=new Map,Ce=new Map,M;function U(){if(h=e.history.listen(E=>{let{action:A,location:D,delta:_}=E;if(M){M(),M=void 0;return}Ei(Ce.size===0||_!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let K=uh({currentLocation:S.location,nextLocation:D,historyAction:A});if(K&&_!=null){let Z=new Promise(le=>{M=le});e.history.go(_*-1),ya(K,{state:"blocked",location:D,proceed(){ya(K,{state:"proceeding",proceed:void 0,reset:void 0,location:D}),Z.then(()=>e.history.go(_))},reset(){let le=new Map(S.blockers);le.set(K,ns),Me({blockers:le})}});return}return at(A,D)}),n){bC(t,N);let E=()=>jC(t,N);t.addEventListener("pagehide",E),O=()=>t.removeEventListener("pagehide",E)}return S.initialized||at(qe.Pop,S.location,{initialHydration:!0}),P}function ae(){h&&h(),O&&O(),b.clear(),L&&L.abort(),S.fetchers.forEach((E,A)=>xa(A)),S.blockers.forEach((E,A)=>ch(A))}function Ke(E){return b.add(E),()=>b.delete(E)}function Me(E,A){A===void 0&&(A={}),S=Le({},S,E);let D=[],_=[];f.v7_fetcherPersist&&S.fetchers.forEach((K,Z)=>{K.state==="idle"&&(be.has(Z)?_.push(Z):D.push(Z))}),[...b].forEach(K=>K(S,{deletedFetchers:_,viewTransitionOpts:A.viewTransitionOpts,flushSync:A.flushSync===!0})),f.v7_fetcherPersist&&(D.forEach(K=>S.fetchers.delete(K)),_.forEach(K=>xa(K)))}function rt(E,A,D){var _,K;let{flushSync:Z}=D===void 0?{}:D,le=S.actionData!=null&&S.navigation.formMethod!=null&&cn(S.navigation.formMethod)&&S.navigation.state==="loading"&&((_=E.state)==null?void 0:_._isRedirect)!==!0,q;A.actionData?Object.keys(A.actionData).length>0?q=A.actionData:q=null:le?q=S.actionData:q=null;let Y=A.loaderData?_m(S.loaderData,A.loaderData,A.matches||[],A.errors):S.loaderData,G=S.blockers;G.size>0&&(G=new Map(G),G.forEach((ye,lt)=>G.set(lt,ns)));let ee=I===!0||S.navigation.formMethod!=null&&cn(S.navigation.formMethod)&&((K=E.state)==null?void 0:K._isRedirect)!==!0;l&&(a=l,l=void 0),$||R===qe.Pop||(R===qe.Push?e.history.push(E,E.state):R===qe.Replace&&e.history.replace(E,E.state));let me;if(R===qe.Pop){let ye=N.get(S.location.pathname);ye&&ye.has(E.pathname)?me={currentLocation:S.location,nextLocation:E}:N.has(E.pathname)&&(me={currentLocation:E,nextLocation:S.location})}else if(B){let ye=N.get(S.location.pathname);ye?ye.add(E.pathname):(ye=new Set([E.pathname]),N.set(S.location.pathname,ye)),me={currentLocation:S.location,nextLocation:E}}Me(Le({},A,{actionData:q,loaderData:Y,historyAction:R,location:E,initialized:!0,navigation:ju,revalidation:"idle",restoreScrollPosition:fh(E,A.matches||S.matches),preventScrollReset:ee,blockers:G}),{viewTransitionOpts:me,flushSync:Z===!0}),R=qe.Pop,I=!1,B=!1,$=!1,F=!1,se=[]}async function J(E,A){if(typeof E=="number"){e.history.go(E);return}let D=ef(S.location,S.matches,u,f.v7_prependBasename,E,f.v7_relativeSplatPath,A==null?void 0:A.fromRouteId,A==null?void 0:A.relative),{path:_,submission:K,error:Z}=Rm(f.v7_normalizeFormMethod,!1,D,A),le=S.location,q=Ks(S.location,_,A&&A.state);q=Le({},q,e.history.encodeLocation(q));let Y=A&&A.replace!=null?A.replace:void 0,G=qe.Push;Y===!0?G=qe.Replace:Y===!1||K!=null&&cn(K.formMethod)&&K.formAction===S.location.pathname+S.location.search&&(G=qe.Replace);let ee=A&&"preventScrollReset"in A?A.preventScrollReset===!0:void 0,me=(A&&A.flushSync)===!0,ye=uh({currentLocation:le,nextLocation:q,historyAction:G});if(ye){ya(ye,{state:"blocked",location:q,proceed(){ya(ye,{state:"proceeding",proceed:void 0,reset:void 0,location:q}),J(E,A)},reset(){let lt=new Map(S.blockers);lt.set(ye,ns),Me({blockers:lt})}});return}return await at(G,q,{submission:K,pendingError:Z,preventScrollReset:ee,replace:A&&A.replace,enableViewTransition:A&&A.viewTransition,flushSync:me})}function ge(){if(Hc(),Me({revalidation:"loading"}),S.navigation.state!=="submitting"){if(S.navigation.state==="idle"){at(S.historyAction,S.location,{startUninterruptedRevalidation:!0});return}at(R||S.historyAction,S.navigation.location,{overrideNavigation:S.navigation,enableViewTransition:B===!0})}}async function at(E,A,D){L&&L.abort(),L=null,R=E,$=(D&&D.startUninterruptedRevalidation)===!0,qv(S.location,S.matches),I=(D&&D.preventScrollReset)===!0,B=(D&&D.enableViewTransition)===!0;let _=l||a,K=D&&D.overrideNavigation,Z=Jr(_,A,u),le=(D&&D.flushSync)===!0,q=va(Z,_,A.pathname);if(q.active&&q.matches&&(Z=q.matches),!Z){let{error:Ae,notFoundMatches:je,route:Ue}=Vc(A.pathname);rt(A,{matches:je,loaderData:{},errors:{[Ue.id]:Ae}},{flushSync:le});return}if(S.initialized&&!F&&pC(S.location,A)&&!(D&&D.submission&&cn(D.submission.formMethod))){rt(A,{matches:Z},{flushSync:le});return}L=new AbortController;let Y=To(e.history,A,L.signal,D&&D.submission),G;if(D&&D.pendingError)G=[Xr(Z).route.id,{type:Re.error,error:D.pendingError}];else if(D&&D.submission&&cn(D.submission.formMethod)){let Ae=await Wi(Y,A,D.submission,Z,q.active,{replace:D.replace,flushSync:le});if(Ae.shortCircuited)return;if(Ae.pendingActionResult){let[je,Ue]=Ae.pendingActionResult;if(Ft(Ue)&&ca(Ue.error)&&Ue.error.status===404){L=null,rt(A,{matches:Ae.matches,loaderData:{},errors:{[je]:Ue.error}});return}}Z=Ae.matches||Z,G=Ae.pendingActionResult,K=Cu(A,D.submission),le=!1,q.active=!1,Y=To(e.history,Y.url,Y.signal)}let{shortCircuited:ee,matches:me,loaderData:ye,errors:lt}=await On(Y,A,Z,q.active,K,D&&D.submission,D&&D.fetcherSubmission,D&&D.replace,D&&D.initialHydration===!0,le,G);ee||(L=null,rt(A,Le({matches:me||Z},Mm(G),{loaderData:ye,errors:lt})))}async function Wi(E,A,D,_,K,Z){Z===void 0&&(Z={}),Hc();let le=vC(A,D);if(Me({navigation:le},{flushSync:Z.flushSync===!0}),K){let G=await wa(_,A.pathname,E.signal);if(G.type==="aborted")return{shortCircuited:!0};if(G.type==="error"){let ee=Xr(G.partialMatches).route.id;return{matches:G.partialMatches,pendingActionResult:[ee,{type:Re.error,error:G.error}]}}else if(G.matches)_=G.matches;else{let{notFoundMatches:ee,error:me,route:ye}=Vc(A.pathname);return{matches:ee,pendingActionResult:[ye.id,{type:Re.error,error:me}]}}}let q,Y=xs(_,A);if(!Y.route.action&&!Y.route.lazy)q={type:Re.error,error:Rt(405,{method:E.method,pathname:A.pathname,routeId:Y.route.id})};else if(q=(await Hr("action",S,E,[Y],_,null))[Y.route.id],E.signal.aborted)return{shortCircuited:!0};if(no(q)){let G;return Z&&Z.replace!=null?G=Z.replace:G=Tm(q.response.headers.get("Location"),new URL(E.url),u)===S.location.pathname+S.location.search,await Ln(E,q,!0,{submission:D,replace:G}),{shortCircuited:!0}}if(Pr(q))throw Rt(400,{type:"defer-action"});if(Ft(q)){let G=Xr(_,Y.route.id);return(Z&&Z.replace)!==!0&&(R=qe.Push),{matches:_,pendingActionResult:[G.route.id,q]}}return{matches:_,pendingActionResult:[Y.route.id,q]}}async function On(E,A,D,_,K,Z,le,q,Y,G,ee){let me=K||Cu(A,Z),ye=Z||le||Fm(me),lt=!$&&(!f.v7_partialHydration||!Y);if(_){if(lt){let Be=Tn(ee);Me(Le({navigation:me},Be!==void 0?{actionData:Be}:{}),{flushSync:G})}let we=await wa(D,A.pathname,E.signal);if(we.type==="aborted")return{shortCircuited:!0};if(we.type==="error"){let Be=Xr(we.partialMatches).route.id;return{matches:we.partialMatches,loaderData:{},errors:{[Be]:we.error}}}else if(we.matches)D=we.matches;else{let{error:Be,notFoundMatches:Io,route:Ki}=Vc(A.pathname);return{matches:Io,loaderData:{},errors:{[Ki.id]:Be}}}}let Ae=l||a,[je,Ue]=Im(e.history,S,D,ye,A,f.v7_partialHydration&&Y===!0,f.v7_skipActionErrorRevalidation,F,se,he,be,ne,ie,Ae,u,ee);if(Qc(we=>!(D&&D.some(Be=>Be.route.id===we))||je&&je.some(Be=>Be.route.id===we)),H=++W,je.length===0&&Ue.length===0){let we=ah();return rt(A,Le({matches:D,loaderData:{},errors:ee&&Ft(ee[1])?{[ee[0]]:ee[1].error}:null},Mm(ee),we?{fetchers:new Map(S.fetchers)}:{}),{flushSync:G}),{shortCircuited:!0}}if(lt){let we={};if(!_){we.navigation=me;let Be=Tn(ee);Be!==void 0&&(we.actionData=Be)}Ue.length>0&&(we.fetchers=ga(Ue)),Me(we,{flushSync:G})}Ue.forEach(we=>{nr(we.key),we.controller&&oe.set(we.key,we.controller)});let Ao=()=>Ue.forEach(we=>nr(we.key));L&&L.signal.addEventListener("abort",Ao);let{loaderResults:Vi,fetcherResults:Mn}=await oh(S,D,je,Ue,E);if(E.signal.aborted)return{shortCircuited:!0};L&&L.signal.removeEventListener("abort",Ao),Ue.forEach(we=>oe.delete(we.key));let yn=Ua(Vi);if(yn)return await Ln(E,yn.result,!0,{replace:q}),{shortCircuited:!0};if(yn=Ua(Mn),yn)return ie.add(yn.key),await Ln(E,yn.result,!0,{replace:q}),{shortCircuited:!0};let{loaderData:Kc,errors:Qi}=Lm(S,D,Vi,ee,Ue,Mn,Ne);Ne.forEach((we,Be)=>{we.subscribe(Io=>{(Io||we.done)&&Ne.delete(Be)})}),f.v7_partialHydration&&Y&&S.errors&&(Qi=Le({},S.errors,Qi));let Vr=ah(),ba=lh(H),ja=Vr||ba||Ue.length>0;return Le({matches:D,loaderData:Kc,errors:Qi},ja?{fetchers:new Map(S.fetchers)}:{})}function Tn(E){if(E&&!Ft(E[1]))return{[E[0]]:E[1].data};if(S.actionData)return Object.keys(S.actionData).length===0?null:S.actionData}function ga(E){return E.forEach(A=>{let D=S.fetchers.get(A.key),_=rs(void 0,D?D.data:void 0);S.fetchers.set(A.key,_)}),new Map(S.fetchers)}function Nn(E,A,D,_){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");nr(E);let K=(_&&_.flushSync)===!0,Z=l||a,le=ef(S.location,S.matches,u,f.v7_prependBasename,D,f.v7_relativeSplatPath,A,_==null?void 0:_.relative),q=Jr(Z,le,u),Y=va(q,Z,le);if(Y.active&&Y.matches&&(q=Y.matches),!q){_n(E,A,Rt(404,{pathname:le}),{flushSync:K});return}let{path:G,submission:ee,error:me}=Rm(f.v7_normalizeFormMethod,!0,le,_);if(me){_n(E,A,me,{flushSync:K});return}let ye=xs(q,G),lt=(_&&_.preventScrollReset)===!0;if(ee&&cn(ee.formMethod)){Hi(E,A,G,ye,q,Y.active,K,lt,ee);return}ne.set(E,{routeId:A,path:G}),Wc(E,A,G,ye,q,Y.active,K,lt,ee)}async function Hi(E,A,D,_,K,Z,le,q,Y){Hc(),ne.delete(E);function G(Ge){if(!Ge.route.action&&!Ge.route.lazy){let Do=Rt(405,{method:Y.formMethod,pathname:D,routeId:A});return _n(E,A,Do,{flushSync:le}),!0}return!1}if(!Z&&G(_))return;let ee=S.fetchers.get(E);tr(E,wC(Y,ee),{flushSync:le});let me=new AbortController,ye=To(e.history,D,me.signal,Y);if(Z){let Ge=await wa(K,D,ye.signal);if(Ge.type==="aborted")return;if(Ge.type==="error"){_n(E,A,Ge.error,{flushSync:le});return}else if(Ge.matches){if(K=Ge.matches,_=xs(K,D),G(_))return}else{_n(E,A,Rt(404,{pathname:D}),{flushSync:le});return}}oe.set(E,me);let lt=W,je=(await Hr("action",S,ye,[_],K,E))[_.route.id];if(ye.signal.aborted){oe.get(E)===me&&oe.delete(E);return}if(f.v7_fetcherPersist&&be.has(E)){if(no(je)||Ft(je)){tr(E,lr(void 0));return}}else{if(no(je))if(oe.delete(E),H>lt){tr(E,lr(void 0));return}else return ie.add(E),tr(E,rs(Y)),Ln(ye,je,!1,{fetcherSubmission:Y,preventScrollReset:q});if(Ft(je)){_n(E,A,je.error);return}}if(Pr(je))throw Rt(400,{type:"defer-action"});let Ue=S.navigation.location||S.location,Ao=To(e.history,Ue,me.signal),Vi=l||a,Mn=S.navigation.state!=="idle"?Jr(Vi,S.navigation.location,u):S.matches;fe(Mn,"Didn't find any matches after fetcher action");let yn=++W;X.set(E,yn);let Kc=rs(Y,je.data);S.fetchers.set(E,Kc);let[Qi,Vr]=Im(e.history,S,Mn,Y,Ue,!1,f.v7_skipActionErrorRevalidation,F,se,he,be,ne,ie,Vi,u,[_.route.id,je]);Vr.filter(Ge=>Ge.key!==E).forEach(Ge=>{let Do=Ge.key,ph=S.fetchers.get(Do),Xv=rs(void 0,ph?ph.data:void 0);S.fetchers.set(Do,Xv),nr(Do),Ge.controller&&oe.set(Do,Ge.controller)}),Me({fetchers:new Map(S.fetchers)});let ba=()=>Vr.forEach(Ge=>nr(Ge.key));me.signal.addEventListener("abort",ba);let{loaderResults:ja,fetcherResults:we}=await oh(S,Mn,Qi,Vr,Ao);if(me.signal.aborted)return;me.signal.removeEventListener("abort",ba),X.delete(E),oe.delete(E),Vr.forEach(Ge=>oe.delete(Ge.key));let Be=Ua(ja);if(Be)return Ln(Ao,Be.result,!1,{preventScrollReset:q});if(Be=Ua(we),Be)return ie.add(Be.key),Ln(Ao,Be.result,!1,{preventScrollReset:q});let{loaderData:Io,errors:Ki}=Lm(S,Mn,ja,void 0,Vr,we,Ne);if(S.fetchers.has(E)){let Ge=lr(je.data);S.fetchers.set(E,Ge)}lh(yn),S.navigation.state==="loading"&&yn>H?(fe(R,"Expected pending action"),L&&L.abort(),rt(S.navigation.location,{matches:Mn,loaderData:Io,errors:Ki,fetchers:new Map(S.fetchers)})):(Me({errors:Ki,loaderData:_m(S.loaderData,Io,Mn,Ki),fetchers:new Map(S.fetchers)}),F=!1)}async function Wc(E,A,D,_,K,Z,le,q,Y){let G=S.fetchers.get(E);tr(E,rs(Y,G?G.data:void 0),{flushSync:le});let ee=new AbortController,me=To(e.history,D,ee.signal);if(Z){let je=await wa(K,D,me.signal);if(je.type==="aborted")return;if(je.type==="error"){_n(E,A,je.error,{flushSync:le});return}else if(je.matches)K=je.matches,_=xs(K,D);else{_n(E,A,Rt(404,{pathname:D}),{flushSync:le});return}}oe.set(E,ee);let ye=W,Ae=(await Hr("loader",S,me,[_],K,E))[_.route.id];if(Pr(Ae)&&(Ae=await Op(Ae,me.signal,!0)||Ae),oe.get(E)===ee&&oe.delete(E),!me.signal.aborted){if(be.has(E)){tr(E,lr(void 0));return}if(no(Ae))if(H>ye){tr(E,lr(void 0));return}else{ie.add(E),await Ln(me,Ae,!1,{preventScrollReset:q});return}if(Ft(Ae)){_n(E,A,Ae.error);return}fe(!Pr(Ae),"Unhandled fetcher deferred data"),tr(E,lr(Ae.data))}}async function Ln(E,A,D,_){let{submission:K,fetcherSubmission:Z,preventScrollReset:le,replace:q}=_===void 0?{}:_;A.response.headers.has("X-Remix-Revalidate")&&(F=!0);let Y=A.response.headers.get("Location");fe(Y,"Expected a Location header on the redirect Response"),Y=Tm(Y,new URL(E.url),u);let G=Ks(S.location,Y,{_isRedirect:!0});if(n){let je=!1;if(A.response.headers.has("X-Remix-Reload-Document"))je=!0;else if(Dp.test(Y)){const Ue=e.history.createURL(Y);je=Ue.origin!==t.location.origin||_i(Ue.pathname,u)==null}if(je){q?t.location.replace(Y):t.location.assign(Y);return}}L=null;let ee=q===!0||A.response.headers.has("X-Remix-Replace")?qe.Replace:qe.Push,{formMethod:me,formAction:ye,formEncType:lt}=S.navigation;!K&&!Z&&me&&ye&<&&(K=Fm(S.navigation));let Ae=K||Z;if(eC.has(A.response.status)&&Ae&&cn(Ae.formMethod))await at(ee,G,{submission:Le({},Ae,{formAction:Y}),preventScrollReset:le||I,enableViewTransition:D?B:void 0});else{let je=Cu(G,K);await at(ee,G,{overrideNavigation:je,fetcherSubmission:Z,preventScrollReset:le||I,enableViewTransition:D?B:void 0})}}async function Hr(E,A,D,_,K,Z){let le,q={};try{le=await lC(d,E,A,D,_,K,Z,i,o)}catch(Y){return _.forEach(G=>{q[G.route.id]={type:Re.error,error:Y}}),q}for(let[Y,G]of Object.entries(le))if(hC(G)){let ee=G.result;q[Y]={type:Re.redirect,response:dC(ee,D,Y,K,u,f.v7_relativeSplatPath)}}else q[Y]=await uC(G);return q}async function oh(E,A,D,_,K){let Z=E.matches,le=Hr("loader",E,K,D,A,null),q=Promise.all(_.map(async ee=>{if(ee.matches&&ee.match&&ee.controller){let ye=(await Hr("loader",E,To(e.history,ee.path,ee.controller.signal),[ee.match],ee.matches,ee.key))[ee.match.route.id];return{[ee.key]:ye}}else return Promise.resolve({[ee.key]:{type:Re.error,error:Rt(404,{pathname:ee.path})}})})),Y=await le,G=(await q).reduce((ee,me)=>Object.assign(ee,me),{});return await Promise.all([xC(A,Y,K.signal,Z,E.loaderData),yC(A,G,_)]),{loaderResults:Y,fetcherResults:G}}function Hc(){F=!0,se.push(...Qc()),ne.forEach((E,A)=>{oe.has(A)&&he.add(A),nr(A)})}function tr(E,A,D){D===void 0&&(D={}),S.fetchers.set(E,A),Me({fetchers:new Map(S.fetchers)},{flushSync:(D&&D.flushSync)===!0})}function _n(E,A,D,_){_===void 0&&(_={});let K=Xr(S.matches,A);xa(E),Me({errors:{[K.route.id]:D},fetchers:new Map(S.fetchers)},{flushSync:(_&&_.flushSync)===!0})}function ih(E){return f.v7_fetcherPersist&&(Ve.set(E,(Ve.get(E)||0)+1),be.has(E)&&be.delete(E)),S.fetchers.get(E)||tC}function xa(E){let A=S.fetchers.get(E);oe.has(E)&&!(A&&A.state==="loading"&&X.has(E))&&nr(E),ne.delete(E),X.delete(E),ie.delete(E),be.delete(E),he.delete(E),S.fetchers.delete(E)}function Qv(E){if(f.v7_fetcherPersist){let A=(Ve.get(E)||0)-1;A<=0?(Ve.delete(E),be.add(E)):Ve.set(E,A)}else xa(E);Me({fetchers:new Map(S.fetchers)})}function nr(E){let A=oe.get(E);A&&(A.abort(),oe.delete(E))}function sh(E){for(let A of E){let D=ih(A),_=lr(D.data);S.fetchers.set(A,_)}}function ah(){let E=[],A=!1;for(let D of ie){let _=S.fetchers.get(D);fe(_,"Expected fetcher: "+D),_.state==="loading"&&(ie.delete(D),E.push(D),A=!0)}return sh(E),A}function lh(E){let A=[];for(let[D,_]of X)if(_0}function Kv(E,A){let D=S.blockers.get(E)||ns;return Ce.get(E)!==A&&Ce.set(E,A),D}function ch(E){S.blockers.delete(E),Ce.delete(E)}function ya(E,A){let D=S.blockers.get(E)||ns;fe(D.state==="unblocked"&&A.state==="blocked"||D.state==="blocked"&&A.state==="blocked"||D.state==="blocked"&&A.state==="proceeding"||D.state==="blocked"&&A.state==="unblocked"||D.state==="proceeding"&&A.state==="unblocked","Invalid blocker state transition: "+D.state+" -> "+A.state);let _=new Map(S.blockers);_.set(E,A),Me({blockers:_})}function uh(E){let{currentLocation:A,nextLocation:D,historyAction:_}=E;if(Ce.size===0)return;Ce.size>1&&Ei(!1,"A router only supports one blocker at a time");let K=Array.from(Ce.entries()),[Z,le]=K[K.length-1],q=S.blockers.get(Z);if(!(q&&q.state==="proceeding")&&le({currentLocation:A,nextLocation:D,historyAction:_}))return Z}function Vc(E){let A=Rt(404,{pathname:E}),D=l||a,{matches:_,route:K}=$m(D);return Qc(),{notFoundMatches:_,route:K,error:A}}function Qc(E){let A=[];return Ne.forEach((D,_)=>{(!E||E(_))&&(D.cancel(),A.push(_),Ne.delete(_))}),A}function Gv(E,A,D){if(y=E,j=A,x=D||null,!g&&S.navigation===ju){g=!0;let _=fh(S.location,S.matches);_!=null&&Me({restoreScrollPosition:_})}return()=>{y=null,j=null,x=null}}function dh(E,A){return x&&x(E,A.map(_=>Oj(_,S.loaderData)))||E.key}function qv(E,A){if(y&&j){let D=dh(E,A);y[D]=j()}}function fh(E,A){if(y){let D=dh(E,A),_=y[D];if(typeof _=="number")return _}return null}function va(E,A,D){if(p)if(E){if(Object.keys(E[0].params).length>0)return{active:!0,matches:pl(A,D,u,!0)}}else return{active:!0,matches:pl(A,D,u,!0)||[]};return{active:!1,matches:null}}async function wa(E,A,D){if(!p)return{type:"success",matches:E};let _=E;for(;;){let K=l==null,Z=l||a,le=i;try{await p({path:A,matches:_,patch:(G,ee)=>{D.aborted||Om(G,ee,Z,le,o)}})}catch(G){return{type:"error",error:G,partialMatches:_}}finally{K&&!D.aborted&&(a=[...a])}if(D.aborted)return{type:"aborted"};let q=Jr(Z,A,u);if(q)return{type:"success",matches:q};let Y=pl(Z,A,u,!0);if(!Y||_.length===Y.length&&_.every((G,ee)=>G.route.id===Y[ee].route.id))return{type:"success",matches:null};_=Y}}function Yv(E){i={},l=Ql(E,o,void 0,i)}function Jv(E,A){let D=l==null;Om(E,A,l||a,i,o),D&&(a=[...a],Me({}))}return P={get basename(){return u},get future(){return f},get state(){return S},get routes(){return a},get window(){return t},initialize:U,subscribe:Ke,enableScrollRestoration:Gv,navigate:J,fetch:Nn,revalidate:ge,createHref:E=>e.history.createHref(E),encodeLocation:E=>e.history.encodeLocation(E),getFetcher:ih,deleteFetcher:Qv,dispose:ae,getBlocker:Kv,deleteBlocker:ch,patchRoutes:Jv,_internalFetchControllers:oe,_internalActiveDeferreds:Ne,_internalSetRoutes:Yv},P}function oC(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ef(e,t,n,r,o,i,a,l){let u,d;if(a){u=[];for(let f of t)if(u.push(f),f.route.id===a){d=f;break}}else u=t,d=t[t.length-1];let p=Sc(o||".",Cc(u,i),_i(e.pathname,n)||e.pathname,l==="path");if(o==null&&(p.search=e.search,p.hash=e.hash),(o==null||o===""||o===".")&&d){let f=Tp(p.search);if(d.route.index&&!f)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&f){let h=new URLSearchParams(p.search),b=h.getAll("index");h.delete("index"),b.filter(x=>x).forEach(x=>h.append("index",x));let y=h.toString();p.search=y?"?"+y:""}}return r&&n!=="/"&&(p.pathname=p.pathname==="/"?n:Gn([n,p.pathname])),jo(p)}function Rm(e,t,n,r){if(!r||!oC(r))return{path:n};if(r.formMethod&&!gC(r.formMethod))return{path:n,error:Rt(405,{method:r.formMethod})};let o=()=>({path:n,error:Rt(400,{type:"invalid-body"})}),i=r.formMethod||"get",a=e?i.toUpperCase():i.toLowerCase(),l=Vy(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!cn(a))return o();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((b,y)=>{let[x,j]=y;return""+b+x+"="+j+` -`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!cn(a))return o();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return o()}}}fe(typeof FormData=="function","FormData is not available in this environment");let u,d;if(r.formData)u=nf(r.formData),d=r.formData;else if(r.body instanceof FormData)u=nf(r.body),d=r.body;else if(r.body instanceof URLSearchParams)u=r.body,d=Nm(u);else if(r.body==null)u=new URLSearchParams,d=new FormData;else try{u=new URLSearchParams(r.body),d=Nm(u)}catch{return o()}let p={formMethod:a,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(cn(p.formMethod))return{path:n,submission:p};let f=Ur(n);return t&&f.search&&Tp(f.search)&&u.append("index",""),f.search="?"+u,{path:jo(f),submission:p}}function Am(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(o=>o.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function Im(e,t,n,r,o,i,a,l,u,d,p,f,h,b,y,x){let j=x?Ft(x[1])?x[1].error:x[1].data:void 0,g=e.createURL(t.location),m=e.createURL(o),v=n;i&&t.errors?v=Am(n,Object.keys(t.errors)[0],!0):x&&Ft(x[1])&&(v=Am(n,x[0]));let C=x?x[1].statusCode:void 0,P=a&&C&&C>=400,S=v.filter((I,L)=>{let{route:B}=I;if(B.lazy)return!0;if(B.loader==null)return!1;if(i)return tf(B,t.loaderData,t.errors);if(iC(t.loaderData,t.matches[L],I)||u.some($=>$===I.route.id))return!0;let N=t.matches[L],O=I;return Dm(I,Le({currentUrl:g,currentParams:N.params,nextUrl:m,nextParams:O.params},r,{actionResult:j,actionStatus:C,defaultShouldRevalidate:P?!1:l||g.pathname+g.search===m.pathname+m.search||g.search!==m.search||Wy(N,O)}))}),R=[];return f.forEach((I,L)=>{if(i||!n.some(F=>F.route.id===I.routeId)||p.has(L))return;let B=Jr(b,I.path,y);if(!B){R.push({key:L,routeId:I.routeId,path:I.path,matches:null,match:null,controller:null});return}let N=t.fetchers.get(L),O=xs(B,I.path),$=!1;h.has(L)?$=!1:d.has(L)?(d.delete(L),$=!0):N&&N.state!=="idle"&&N.data===void 0?$=l:$=Dm(O,Le({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:m,nextParams:n[n.length-1].params},r,{actionResult:j,actionStatus:C,defaultShouldRevalidate:P?!1:l})),$&&R.push({key:L,routeId:I.routeId,path:I.path,matches:B,match:O,controller:new AbortController})}),[S,R]}function tf(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function iC(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function Wy(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Dm(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Om(e,t,n,r,o){var i;let a;if(e){let d=r[e];fe(d,"No route found to patch children into: routeId = "+e),d.children||(d.children=[]),a=d.children}else a=n;let l=t.filter(d=>!a.some(p=>Hy(d,p))),u=Ql(l,o,[e||"_","patch",String(((i=a)==null?void 0:i.length)||"0")],r);a.push(...u)}function Hy(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var o;return(o=t.children)==null?void 0:o.some(i=>Hy(n,i))}):!1}async function sC(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];fe(o,"No route found in manifest");let i={};for(let a in r){let u=o[a]!==void 0&&a!=="hasErrorBoundary";Ei(!u,'Route "'+o.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!u&&!Ij.has(a)&&(i[a]=r[a])}Object.assign(o,i),Object.assign(o,Le({},t(o),{lazy:void 0}))}async function aC(e){let{matches:t}=e,n=t.filter(o=>o.shouldLoad);return(await Promise.all(n.map(o=>o.resolve()))).reduce((o,i,a)=>Object.assign(o,{[n[a].route.id]:i}),{})}async function lC(e,t,n,r,o,i,a,l,u,d){let p=i.map(b=>b.route.lazy?sC(b.route,u,l):void 0),f=i.map((b,y)=>{let x=p[y],j=o.some(m=>m.route.id===b.route.id);return Le({},b,{shouldLoad:j,resolve:async m=>(m&&r.method==="GET"&&(b.route.lazy||b.route.loader)&&(j=!0),j?cC(t,r,b,x,m,d):Promise.resolve({type:Re.data,result:void 0}))})}),h=await e({matches:f,request:r,params:i[0].params,fetcherKey:a,context:d});try{await Promise.all(p)}catch{}return h}async function cC(e,t,n,r,o,i){let a,l,u=d=>{let p,f=new Promise((y,x)=>p=x);l=()=>p(),t.signal.addEventListener("abort",l);let h=y=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):d({request:t,params:n.params,context:i},...y!==void 0?[y]:[]),b=(async()=>{try{return{type:"data",result:await(o?o(x=>h(x)):h())}}catch(y){return{type:"error",result:y}}})();return Promise.race([b,f])};try{let d=n.route[e];if(r)if(d){let p,[f]=await Promise.all([u(d).catch(h=>{p=h}),r]);if(p!==void 0)throw p;a=f}else if(await r,d=n.route[e],d)a=await u(d);else if(e==="action"){let p=new URL(t.url),f=p.pathname+p.search;throw Rt(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:Re.data,result:void 0};else if(d)a=await u(d);else{let p=new URL(t.url),f=p.pathname+p.search;throw Rt(404,{pathname:f})}fe(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:Re.error,result:d}}finally{l&&t.signal.removeEventListener("abort",l)}return a}async function uC(e){let{result:t,type:n}=e;if(Qy(t)){let d;try{let p=t.headers.get("Content-Type");p&&/\bapplication\/json\b/.test(p)?t.body==null?d=null:d=await t.json():d=await t.text()}catch(p){return{type:Re.error,error:p}}return n===Re.error?{type:Re.error,error:new Kl(t.status,t.statusText,d),statusCode:t.status,headers:t.headers}:{type:Re.data,data:d,statusCode:t.status,headers:t.headers}}if(n===Re.error){if(zm(t)){var r;if(t.data instanceof Error){var o;return{type:Re.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status}}t=new Kl(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:Re.error,error:t,statusCode:ca(t)?t.status:void 0}}if(mC(t)){var i,a;return{type:Re.deferred,deferredData:t,statusCode:(i=t.init)==null?void 0:i.status,headers:((a=t.init)==null?void 0:a.headers)&&new Headers(t.init.headers)}}if(zm(t)){var l,u;return{type:Re.data,data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(u=t.init)!=null&&u.headers?new Headers(t.init.headers):void 0}}return{type:Re.data,data:t}}function dC(e,t,n,r,o,i){let a=e.headers.get("Location");if(fe(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!Dp.test(a)){let l=r.slice(0,r.findIndex(u=>u.route.id===n)+1);a=ef(new URL(t.url),l,o,!0,a,i),e.headers.set("Location",a)}return e}function Tm(e,t,n){if(Dp.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=_i(o.pathname,n)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}return e}function To(e,t,n,r){let o=e.createURL(Vy(t)).toString(),i={signal:n};if(r&&cn(r.formMethod)){let{formMethod:a,formEncType:l}=r;i.method=a.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(r.json)):l==="text/plain"?i.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?i.body=nf(r.formData):i.body=r.formData}return new Request(o,i)}function nf(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Nm(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function fC(e,t,n,r,o){let i={},a=null,l,u=!1,d={},p=n&&Ft(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let h=f.route.id,b=t[h];if(fe(!no(b),"Cannot handle redirect results in processLoaderData"),Ft(b)){let y=b.error;p!==void 0&&(y=p,p=void 0),a=a||{};{let x=Xr(e,h);a[x.route.id]==null&&(a[x.route.id]=y)}i[h]=void 0,u||(u=!0,l=ca(b.error)?b.error.status:500),b.headers&&(d[h]=b.headers)}else Pr(b)?(r.set(h,b.deferredData),i[h]=b.deferredData.data,b.statusCode!=null&&b.statusCode!==200&&!u&&(l=b.statusCode),b.headers&&(d[h]=b.headers)):(i[h]=b.data,b.statusCode&&b.statusCode!==200&&!u&&(l=b.statusCode),b.headers&&(d[h]=b.headers))}),p!==void 0&&n&&(a={[n[0]]:p},i[n[0]]=void 0),{loaderData:i,errors:a,statusCode:l||200,loaderHeaders:d}}function Lm(e,t,n,r,o,i,a){let{loaderData:l,errors:u}=fC(t,n,r,a);return o.forEach(d=>{let{key:p,match:f,controller:h}=d,b=i[p];if(fe(b,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(Ft(b)){let y=Xr(e.matches,f==null?void 0:f.route.id);u&&u[y.route.id]||(u=Le({},u,{[y.route.id]:b.error})),e.fetchers.delete(p)}else if(no(b))fe(!1,"Unhandled fetcher revalidation redirect");else if(Pr(b))fe(!1,"Unhandled fetcher deferred data");else{let y=lr(b.data);e.fetchers.set(p,y)}}),{loaderData:l,errors:u}}function _m(e,t,n,r){let o=Le({},t);for(let i of n){let a=i.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(o[a]=t[a]):e[a]!==void 0&&i.route.loader&&(o[a]=e[a]),r&&r.hasOwnProperty(a))break}return o}function Mm(e){return e?Ft(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Xr(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function $m(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Rt(e,t){let{pathname:n,routeId:r,method:o,type:i,message:a}=t===void 0?{}:t,l="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(l="Bad Request",o&&n&&r?u="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?u="defer() is not supported in actions":i==="invalid-body"&&(u="Unable to encode submission body")):e===403?(l="Forbidden",u='Route "'+r+'" does not match URL "'+n+'"'):e===404?(l="Not Found",u='No route matches URL "'+n+'"'):e===405&&(l="Method Not Allowed",o&&n&&r?u="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(u='Invalid request method "'+o.toUpperCase()+'"')),new Kl(e||500,l,new Error(u),!0)}function Ua(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(no(o))return{key:r,result:o}}}function Vy(e){let t=typeof e=="string"?Ur(e):e;return jo(Le({},t,{hash:""}))}function pC(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function hC(e){return Qy(e.result)&&Zj.has(e.result.status)}function Pr(e){return e.type===Re.deferred}function Ft(e){return e.type===Re.error}function no(e){return(e&&e.type)===Re.redirect}function zm(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function mC(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Qy(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function gC(e){return Xj.has(e.toLowerCase())}function cn(e){return Yj.has(e.toLowerCase())}async function xC(e,t,n,r,o){let i=Object.entries(t);for(let a=0;a(h==null?void 0:h.route.id)===l);if(!d)continue;let p=r.find(h=>h.route.id===d.route.id),f=p!=null&&!Wy(p,d)&&(o&&o[d.route.id])!==void 0;Pr(u)&&f&&await Op(u,n,!1).then(h=>{h&&(t[l]=h)})}}async function yC(e,t,n){for(let r=0;r(d==null?void 0:d.route.id)===i)&&Pr(l)&&(fe(a,"Expected an AbortController for revalidating fetcher deferred result"),await Op(l,a.signal,!0).then(d=>{d&&(t[o]=d)}))}}async function Op(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Re.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Re.error,error:o}}return{type:Re.data,data:e.deferredData.data}}}function Tp(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function xs(e,t){let n=typeof t=="string"?Ur(t).search:t.search;if(e[e.length-1].route.index&&Tp(n||""))return e[e.length-1];let r=Fy(e);return r[r.length-1]}function Fm(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:a}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function Cu(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function vC(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function rs(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function wC(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function lr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function bC(e,t){try{let n=e.sessionStorage.getItem(By);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function jC(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(By,JSON.stringify(n))}catch(r){Ei(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** - * React Router v6.28.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Gl(){return Gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),w.useCallback(function(d,p){if(p===void 0&&(p={}),!l.current)return;if(typeof d=="number"){r.go(d);return}let f=Sc(d,JSON.parse(a),i,p.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Gn([t,f.pathname])),(p.replace?r.replace:r.push)(f,p.state,p)},[t,r,a,i,e])}const kC=w.createContext(null);function PC(e){let t=w.useContext(Dn).outlet;return t&&w.createElement(kC.Provider,{value:e},t)}function $i(){let{matches:e}=w.useContext(Dn),t=e[e.length-1];return t?t.params:{}}function Yy(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=w.useContext(Br),{matches:o}=w.useContext(Dn),{pathname:i}=nt(),a=JSON.stringify(Cc(o,r.v7_relativeSplatPath));return w.useMemo(()=>Sc(e,JSON.parse(a),i,n==="path"),[e,a,i,n])}function EC(e,t,n,r){Mi()||fe(!1);let{navigator:o}=w.useContext(Br),{matches:i}=w.useContext(Dn),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let u=a?a.pathnameBase:"/";a&&a.route;let d=nt(),p;p=d;let f=p.pathname||"/",h=f;if(u!=="/"){let x=u.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(x.length).join("/")}let b=Jr(e,{pathname:h});return OC(b&&b.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:Gn([u,o.encodeLocation?o.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?u:Gn([u,o.encodeLocation?o.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r)}function RC(){let e=Zy(),t=ca(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return w.createElement(w.Fragment,null,w.createElement("h2",null,"Unexpected Application Error!"),w.createElement("h3",{style:{fontStyle:"italic"}},t),n?w.createElement("pre",{style:o},n):null,null)}const AC=w.createElement(RC,null);class IC extends w.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?w.createElement(Dn.Provider,{value:this.props.routeContext},w.createElement(Gy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function DC(e){let{routeContext:t,match:n,children:r}=e,o=w.useContext(kc);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),w.createElement(Dn.Provider,{value:t},r)}function OC(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=(o=n)==null?void 0:o.errors;if(l!=null){let p=a.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);p>=0||fe(!1),a=a.slice(0,Math.min(a.length,p+1))}let u=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let p=0;p=0?a=a.slice(0,d+1):a=[a[0]];break}}}return a.reduceRight((p,f,h)=>{let b,y=!1,x=null,j=null;n&&(b=l&&f.route.id?l[f.route.id]:void 0,x=f.route.errorElement||AC,u&&(d<0&&h===0?(MC("route-fallback"),y=!0,j=null):d===h&&(y=!0,j=f.route.hydrateFallbackElement||null)));let g=t.concat(a.slice(0,h+1)),m=()=>{let v;return b?v=x:y?v=j:f.route.Component?v=w.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=p,w.createElement(DC,{match:f,routeContext:{outlet:p,matches:g,isDataRoute:n!=null},children:v})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?w.createElement(IC,{location:n.location,revalidation:n.revalidation,component:x,error:b,children:m(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):m()},null)}var Jy=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(Jy||{}),ql=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ql||{});function TC(e){let t=w.useContext(kc);return t||fe(!1),t}function NC(e){let t=w.useContext(Ky);return t||fe(!1),t}function LC(e){let t=w.useContext(Dn);return t||fe(!1),t}function Xy(e){let t=LC(),n=t.matches[t.matches.length-1];return n.route.id||fe(!1),n.route.id}function Zy(){var e;let t=w.useContext(Gy),n=NC(ql.UseRouteError),r=Xy(ql.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function _C(){let{router:e}=TC(Jy.UseNavigateStable),t=Xy(ql.UseNavigateStable),n=w.useRef(!1);return qy(()=>{n.current=!0}),w.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Gl({fromRouteId:t},i)))},[e,t])}const Um={};function MC(e,t,n){Um[e]||(Um[e]=!0)}const Bm={};function $C(e,t){Bm[t]||(Bm[t]=!0,console.warn(t))}const No=(e,t,n)=>$C(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function zC(e,t){e!=null&&e.v7_startTransition||No("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&(!t||!t.v7_relativeSplatPath)&&No("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(t.v7_fetcherPersist||No("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod||No("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration||No("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation||No("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function FC(e){let{to:t,replace:n,state:r,relative:o}=e;Mi()||fe(!1);let{future:i,static:a}=w.useContext(Br),{matches:l}=w.useContext(Dn),{pathname:u}=nt(),d=Ee(),p=Sc(t,Cc(l,i.v7_relativeSplatPath),u,o==="path"),f=JSON.stringify(p);return w.useEffect(()=>d(JSON.parse(f),{replace:n,state:r,relative:o}),[d,f,o,n,r]),null}function UC(e){return PC(e.context)}function BC(e){let{basename:t="/",children:n=null,location:r,navigationType:o=qe.Pop,navigator:i,static:a=!1,future:l}=e;Mi()&&fe(!1);let u=t.replace(/^\/*/,"/"),d=w.useMemo(()=>({basename:u,navigator:i,static:a,future:Gl({v7_relativeSplatPath:!1},l)}),[u,l,i,a]);typeof r=="string"&&(r=Ur(r));let{pathname:p="/",search:f="",hash:h="",state:b=null,key:y="default"}=r,x=w.useMemo(()=>{let j=_i(p,u);return j==null?null:{location:{pathname:j,search:f,hash:h,state:b,key:y},navigationType:o}},[u,p,f,h,b,y,o]);return x==null?null:w.createElement(Br.Provider,{value:d},w.createElement(Np.Provider,{children:n,value:x}))}new Promise(()=>{});function WC(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:w.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:w.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:w.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** - * React Router DOM v6.28.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Gs(){return Gs=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function VC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function QC(e,t){return e.button===0&&(!t||t==="_self")&&!VC(e)}const KC=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],GC="6";try{window.__reactRouterVersion=GC}catch{}function qC(e,t){return rC({basename:t==null?void 0:t.basename,future:Gs({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:Ej({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||YC(),routes:e,mapRouteProperties:WC,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function YC(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Gs({},t,{errors:JC(t.errors)})),t}function JC(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new Kl(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let a=new i(o.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const XC=w.createContext({isTransitioning:!1}),ZC=w.createContext(new Map),eS="startTransition",Wm=hw[eS],tS="flushSync",Hm=Pj[tS];function nS(e){Wm?Wm(e):e()}function os(e){Hm?Hm(e):e()}class rS{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function oS(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=w.useState(n.state),[a,l]=w.useState(),[u,d]=w.useState({isTransitioning:!1}),[p,f]=w.useState(),[h,b]=w.useState(),[y,x]=w.useState(),j=w.useRef(new Map),{v7_startTransition:g}=r||{},m=w.useCallback(I=>{g?nS(I):I()},[g]),v=w.useCallback((I,L)=>{let{deletedFetchers:B,flushSync:N,viewTransitionOpts:O}=L;B.forEach(F=>j.current.delete(F)),I.fetchers.forEach((F,se)=>{F.data!==void 0&&j.current.set(se,F.data)});let $=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!O||$){N?os(()=>i(I)):m(()=>i(I));return}if(N){os(()=>{h&&(p&&p.resolve(),h.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:O.currentLocation,nextLocation:O.nextLocation})});let F=n.window.document.startViewTransition(()=>{os(()=>i(I))});F.finished.finally(()=>{os(()=>{f(void 0),b(void 0),l(void 0),d({isTransitioning:!1})})}),os(()=>b(F));return}h?(p&&p.resolve(),h.skipTransition(),x({state:I,currentLocation:O.currentLocation,nextLocation:O.nextLocation})):(l(I),d({isTransitioning:!0,flushSync:!1,currentLocation:O.currentLocation,nextLocation:O.nextLocation}))},[n.window,h,p,j,m]);w.useLayoutEffect(()=>n.subscribe(v),[n,v]),w.useEffect(()=>{u.isTransitioning&&!u.flushSync&&f(new rS)},[u]),w.useEffect(()=>{if(p&&a&&n.window){let I=a,L=p.promise,B=n.window.document.startViewTransition(async()=>{m(()=>i(I)),await L});B.finished.finally(()=>{f(void 0),b(void 0),l(void 0),d({isTransitioning:!1})}),b(B)}},[m,a,p,n.window]),w.useEffect(()=>{p&&a&&o.location.key===a.location.key&&p.resolve()},[p,h,o.location,a]),w.useEffect(()=>{!u.isTransitioning&&y&&(l(y.state),d({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),x(void 0))},[u.isTransitioning,y]),w.useEffect(()=>{},[]);let C=w.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:I=>n.navigate(I),push:(I,L,B)=>n.navigate(I,{state:L,preventScrollReset:B==null?void 0:B.preventScrollReset}),replace:(I,L,B)=>n.navigate(I,{replace:!0,state:L,preventScrollReset:B==null?void 0:B.preventScrollReset})}),[n]),P=n.basename||"/",S=w.useMemo(()=>({router:n,navigator:C,static:!1,basename:P}),[n,C,P]),R=w.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return w.useEffect(()=>zC(r,n.future),[r,n.future]),w.createElement(w.Fragment,null,w.createElement(kc.Provider,{value:S},w.createElement(Ky.Provider,{value:o},w.createElement(ZC.Provider,{value:j.current},w.createElement(XC.Provider,{value:u},w.createElement(BC,{basename:P,location:o.location,navigationType:o.historyAction,navigator:C,future:R},o.initialized||n.future.v7_partialHydration?w.createElement(iS,{routes:n.routes,future:n.future,state:o}):t))))),null)}const iS=w.memo(sS);function sS(e){let{routes:t,future:n,state:r}=e;return EC(t,void 0,r,n)}const aS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,An=w.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:l,target:u,to:d,preventScrollReset:p,viewTransition:f}=t,h=HC(t,KC),{basename:b}=w.useContext(Br),y,x=!1;if(typeof d=="string"&&lS.test(d)&&(y=d,aS))try{let v=new URL(window.location.href),C=d.startsWith("//")?new URL(v.protocol+d):new URL(d),P=_i(C.pathname,b);C.origin===v.origin&&P!=null?d=P+C.search+C.hash:x=!0}catch{}let j=CC(d,{relative:o}),g=cS(d,{replace:a,state:l,target:u,preventScrollReset:p,relative:o,viewTransition:f});function m(v){r&&r(v),v.defaultPrevented||g(v)}return w.createElement("a",Gs({},h,{href:y||j,onClick:x||i?r:m,ref:n,target:u}))});var Vm;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Vm||(Vm={}));var Qm;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Qm||(Qm={}));function cS(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a,viewTransition:l}=t===void 0?{}:t,u=Ee(),d=nt(),p=Yy(e,{relative:a});return w.useCallback(f=>{if(QC(f,n)){f.preventDefault();let h=r!==void 0?r:jo(d)===jo(p);u(e,{replace:h,state:o,preventScrollReset:i,relative:a,viewTransition:l})}},[d,u,p,r,o,n,e,i,a,l])}const uS=()=>{var t;const e=Zy();return ca(e)?s.jsxs("div",{children:[s.jsx("h1",{children:"Oops! something is wrong"}),s.jsx("h2",{children:e.status}),s.jsx("p",{children:e.statusText}),((t=e.data)==null?void 0:t.message)&&s.jsx("p",{children:e.data.message})]}):s.jsx("h1",{children:"Oops! something is wrong"})},dS=()=>s.jsx("h1",{children:"NotFoundPage"});var xt=function(){return xt=Object.assign||function(t){for(var n,r=1,o=arguments.length;r0?it(zi,--nn):0,Ai--,Ye===10&&(Ai=1,Ec--),Ye}function hn(){return Ye=nn2||of(Ye)>3?"":" "}function bS(e,t){for(;--t&&hn()&&!(Ye<48||Ye>102||Ye>57&&Ye<65||Ye>70&&Ye<97););return Ac(e,ml()+(t<6&&mo()==32&&hn()==32))}function sf(e){for(;hn();)switch(Ye){case e:return nn;case 34:case 39:e!==34&&e!==39&&sf(Ye);break;case 40:e===41&&sf(e);break;case 92:hn();break}return nn}function jS(e,t){for(;hn()&&e+Ye!==57;)if(e+Ye===84&&mo()===47)break;return"/*"+Ac(t,nn-1)+"*"+_p(e===47?e:hn())}function CS(e){for(;!of(mo());)hn();return Ac(e,nn)}function SS(e){return vS(gl("",null,null,null,[""],e=yS(e),0,[0],e))}function gl(e,t,n,r,o,i,a,l,u){for(var d=0,p=0,f=a,h=0,b=0,y=0,x=1,j=1,g=1,m=0,v="",C=o,P=i,S=r,R=v;j;)switch(y=m,m=hn()){case 40:if(y!=108&&it(R,f-1)==58){hl(R+=de(Su(m),"&","&\f"),"&\f",n1(d?l[d-1]:0))!=-1&&(g=-1);break}case 34:case 39:case 91:R+=Su(m);break;case 9:case 10:case 13:case 32:R+=wS(y);break;case 92:R+=bS(ml()-1,7);continue;case 47:switch(mo()){case 42:case 47:ys(kS(jS(hn(),ml()),t,n,u),u);break;default:R+="/"}break;case 123*x:l[d++]=kn(R)*g;case 125*x:case 59:case 0:switch(m){case 0:case 125:j=0;case 59+p:g==-1&&(R=de(R,/\f/g,"")),b>0&&kn(R)-f&&ys(b>32?qm(R+";",r,n,f-1,u):qm(de(R," ","")+";",r,n,f-2,u),u);break;case 59:R+=";";default:if(ys(S=Gm(R,t,n,d,p,o,l,v,C=[],P=[],f,i),i),m===123)if(p===0)gl(R,t,S,S,C,i,f,l,P);else switch(h===99&&it(R,3)===110?100:h){case 100:case 108:case 109:case 115:gl(e,S,S,r&&ys(Gm(e,S,S,0,0,o,l,v,o,C=[],f,P),P),o,P,f,l,r?C:P);break;default:gl(R,S,S,S,[""],P,0,l,P)}}d=p=b=0,x=g=1,v=R="",f=a;break;case 58:f=1+kn(R),b=y;default:if(x<1){if(m==123)--x;else if(m==125&&x++==0&&xS()==125)continue}switch(R+=_p(m),m*x){case 38:g=p>0?1:(R+="\f",-1);break;case 44:l[d++]=(kn(R)-1)*g,g=1;break;case 64:mo()===45&&(R+=Su(hn())),h=mo(),p=f=kn(v=R+=CS(ml())),m++;break;case 45:y===45&&kn(R)==2&&(x=0)}}return i}function Gm(e,t,n,r,o,i,a,l,u,d,p,f){for(var h=o-1,b=o===0?i:[""],y=o1(b),x=0,j=0,g=0;x0?b[m]+" "+v:de(v,/&\f/g,b[m])))&&(u[g++]=C);return Rc(e,t,n,o===0?Pc:l,u,d,p,f)}function kS(e,t,n,r){return Rc(e,t,n,e1,_p(gS()),Ri(e,2,-2),0,r)}function qm(e,t,n,r,o){return Rc(e,t,n,Lp,Ri(e,0,r),Ri(e,r+1,-1),r,o)}function s1(e,t,n){switch(hS(e,t)){case 5103:return Se+"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 Se+e+e;case 4789:return As+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Se+e+As+e+Oe+e+e;case 5936:switch(it(e,t+11)){case 114:return Se+e+Oe+de(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Se+e+Oe+de(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Se+e+Oe+de(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return Se+e+Oe+e+e;case 6165:return Se+e+Oe+"flex-"+e+e;case 5187:return Se+e+de(e,/(\w+).+(:[^]+)/,Se+"box-$1$2"+Oe+"flex-$1$2")+e;case 5443:return Se+e+Oe+"flex-item-"+de(e,/flex-|-self/g,"")+(Bn(e,/flex-|baseline/)?"":Oe+"grid-row-"+de(e,/flex-|-self/g,""))+e;case 4675:return Se+e+Oe+"flex-line-pack"+de(e,/align-content|flex-|-self/g,"")+e;case 5548:return Se+e+Oe+de(e,"shrink","negative")+e;case 5292:return Se+e+Oe+de(e,"basis","preferred-size")+e;case 6060:return Se+"box-"+de(e,"-grow","")+Se+e+Oe+de(e,"grow","positive")+e;case 4554:return Se+de(e,/([^-])(transform)/g,"$1"+Se+"$2")+e;case 6187:return de(de(de(e,/(zoom-|grab)/,Se+"$1"),/(image-set)/,Se+"$1"),e,"")+e;case 5495:case 3959:return de(e,/(image-set\([^]*)/,Se+"$1$`$1");case 4968:return de(de(e,/(.+:)(flex-)?(.*)/,Se+"box-pack:$3"+Oe+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Se+e+e;case 4200:if(!Bn(e,/flex-|baseline/))return Oe+"grid-column-align"+Ri(e,t)+e;break;case 2592:case 3360:return Oe+de(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,o){return t=o,Bn(r.props,/grid-\w+-end/)})?~hl(e+(n=n[t].value),"span",0)?e:Oe+de(e,"-start","")+e+Oe+"grid-row-span:"+(~hl(n,"span",0)?Bn(n,/\d+/):+Bn(n,/\d+/)-+Bn(e,/\d+/))+";":Oe+de(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return Bn(r.props,/grid-\w+-start/)})?e:Oe+de(de(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return de(e,/(.+)-inline(.+)/,Se+"$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(kn(e)-1-t>6)switch(it(e,t+1)){case 109:if(it(e,t+4)!==45)break;case 102:return de(e,/(.+:)(.+)-([^]+)/,"$1"+Se+"$2-$3$1"+As+(it(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~hl(e,"stretch",0)?s1(de(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return de(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,o,i,a,l,u,d){return Oe+o+":"+i+d+(a?Oe+o+"-span:"+(l?u:+u-+i)+d:"")+e});case 4949:if(it(e,t+6)===121)return de(e,":",":"+Se)+e;break;case 6444:switch(it(e,it(e,14)===45?18:11)){case 120:return de(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+Se+(it(e,14)===45?"inline-":"")+"box$3$1"+Se+"$2$3$1"+Oe+"$2box$3")+e;case 100:return de(e,":",":"+Oe)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return de(e,"scroll-","scroll-snap-")+e}return e}function Yl(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case Lp:e.return=s1(e.value,e.length,n);return;case t1:return Yl([cr(e,{value:de(e.value,"@","@"+Se)})],r);case Pc:if(e.length)return mS(n=e.props,function(o){switch(Bn(o,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":Lo(cr(e,{props:[de(o,/:(read-\w+)/,":"+As+"$1")]})),Lo(cr(e,{props:[o]})),rf(e,{props:Km(n,r)});break;case"::placeholder":Lo(cr(e,{props:[de(o,/:(plac\w+)/,":"+Se+"input-$1")]})),Lo(cr(e,{props:[de(o,/:(plac\w+)/,":"+As+"$1")]})),Lo(cr(e,{props:[de(o,/:(plac\w+)/,Oe+"input-$1")]})),Lo(cr(e,{props:[o]})),rf(e,{props:Km(n,r)});break}return""})}}var IS={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,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},Mt={VITE_API_URL:"http://15.164.5.135:8080",VITE_KAKAO_KEY:"af7394f12b174cad35e87960ddccf91f",ALLUSERSPROFILE:"C:\\ProgramData",APPDATA:"C:\\Users\\yscho\\AppData\\Roaming",ChocolateyInstall:"C:\\ProgramData\\chocolatey",ChocolateyLastPathUpdate:"133643746293195846",CHROME_CRASHPAD_PIPE_NAME:"\\\\.\\pipe\\crashpad_36248_XICQXOUWABLVCZIM",COLOR:"1",COLORTERM:"truecolor",CommonProgramFiles:"C:\\Program Files\\Common Files","CommonProgramFiles(x86)":"C:\\Program Files (x86)\\Common Files",CommonProgramW6432:"C:\\Program Files\\Common Files",COMPUTERNAME:"LAPTOP-1U9BALFB",ComSpec:"C:\\WINDOWS\\system32\\cmd.exe",DriverData:"C:\\Windows\\System32\\Drivers\\DriverData",EDITOR:"C:\\WINDOWS\\notepad.exe",EFC_13440:"1",FPS_BROWSER_APP_PROFILE_STRING:"Internet Explorer",FPS_BROWSER_USER_PROFILE_STRING:"Default",GIT_ASKPASS:"c:\\Users\\yscho\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\extensions\\git\\dist\\askpass.sh",HOME:"C:\\Users\\yscho",HOMEDRIVE:"C:",HOMEPATH:"\\Users\\yscho",INIT_CWD:"C:\\Users\\yscho\\Desktop\\Good Buy Us\\WEB1_2_LinkUP_FE",LANG:"ko_KR.UTF-8",LOCALAPPDATA:"C:\\Users\\yscho\\AppData\\Local",LOGONSERVER:"\\\\LAPTOP-1U9BALFB",NODE:"C:\\Program Files\\nodejs\\node.exe",NODE_ENV:"production",NODE_EXE:"C:\\Program Files\\nodejs\\\\node.exe",NPM_CLI_JS:"C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js",npm_command:"run-script",npm_config_cache:"C:\\Users\\yscho\\AppData\\Local\\npm-cache",npm_config_globalconfig:"C:\\Program Files\\nodejs\\etc\\npmrc",npm_config_global_prefix:"C:\\Program Files\\nodejs",npm_config_init_module:"C:\\Users\\yscho\\.npm-init.js",npm_config_local_prefix:"C:\\Users\\yscho\\Desktop\\Good Buy Us\\WEB1_2_LinkUP_FE",npm_config_metrics_registry:"https://registry.npmjs.org/",npm_config_node_gyp:"C:\\Users\\yscho\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js",npm_config_noproxy:"",npm_config_npm_version:"9.8.1",npm_config_prefix:"C:\\Program Files\\nodejs",npm_config_userconfig:"C:\\Users\\yscho\\.npmrc",npm_config_user_agent:"npm/9.8.1 node/v18.18.2 win32 x64 workspaces/false",npm_execpath:"C:\\Users\\yscho\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\bin\\npm-cli.js",npm_lifecycle_event:"build",npm_lifecycle_script:"vite build",npm_node_execpath:"C:\\Program Files\\nodejs\\node.exe",npm_package_json:"C:\\Users\\yscho\\Desktop\\Good Buy Us\\WEB1_2_LinkUP_FE\\package.json",npm_package_name:"goodbuyus",npm_package_version:"0.1.0",NPM_PREFIX_NPM_CLI_JS:"C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js",NUMBER_OF_PROCESSORS:"8",NVM_HOME:"C:\\Users\\yscho\\AppData\\Roaming\\nvm",NVM_SYMLINK:"C:\\Program Files\\nodejs",OneDrive:"C:\\Users\\yscho\\OneDrive",ORIGINAL_XDG_CURRENT_DESKTOP:"undefined",OS:"Windows_NT",Path:"C:\\Users\\yscho\\Desktop\\Good Buy Us\\WEB1_2_LinkUP_FE\\node_modules\\.bin;C:\\Users\\yscho\\Desktop\\Good Buy Us\\node_modules\\.bin;C:\\Users\\yscho\\Desktop\\node_modules\\.bin;C:\\Users\\yscho\\node_modules\\.bin;C:\\Users\\node_modules\\.bin;C:\\node_modules\\.bin;C:\\Users\\yscho\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\node_modules\\@npmcli\\run-script\\lib\\node-gyp-bin;C:\\Python312\\Scripts\\;C:\\Python312\\;C:\\Program Files\\Common Files\\Oracle\\Java\\javapath;C:\\Program Files (x86)\\NAT Service;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\iCLS\\;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\iCLS\\;C:\\windows\\system32;C:\\windows;C:\\windows\\System32\\Wbem;C:\\windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\DAL;C:\\Program Files (x86)\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files\\Intel\\Intel(R) Management Engine Components\\IPT;C:\\Program Files\\dotnet\\;C:\\Python27\\Scripts;C:\\WINDOWS\\system32;C:\\WINDOWS;C:\\WINDOWS\\System32\\Wbem;C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\;C:\\WINDOWS\\System32\\OpenSSH\\;C:\\ProgramData\\chocolatey\\bin;C:\\Users\\yscho\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;C:\\Program Files\\Git\\cmd;C:\\Users\\yscho\\AppData\\Local\\Programs\\Python\\Launcher\\;C:\\Users\\yscho\\AppData\\Local\\Programs\\Python\\Python36\\Scripts\\;C:\\Users\\yscho\\AppData\\Local\\Programs\\Python\\Python36\\;C:\\Users\\yscho\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\yscho\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\yscho\\AppData\\Roaming\\npm;C:\\Users\\yscho\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;C:\\Users\\yscho\\AppData\\Local\\SOOP",PATHEXT:".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.CPL",PROCESSOR_ARCHITECTURE:"AMD64",PROCESSOR_IDENTIFIER:"Intel64 Family 6 Model 142 Stepping 10, GenuineIntel",PROCESSOR_LEVEL:"6",PROCESSOR_REVISION:"8e0a",ProgramData:"C:\\ProgramData",ProgramFiles:"C:\\Program Files","ProgramFiles(x86)":"C:\\Program Files (x86)",ProgramW6432:"C:\\Program Files",PROMPT:"$P$G",PSModulePath:"C:\\Users\\yscho\\Documents\\WindowsPowerShell\\Modules;C:\\Program Files\\WindowsPowerShell\\Modules;C:\\WINDOWS\\system32\\WindowsPowerShell\\v1.0\\Modules",PUBLIC:"C:\\Users\\Public",SESSIONNAME:"Console",SystemDrive:"C:",SystemRoot:"C:\\WINDOWS",TEMP:"C:\\Users\\yscho\\AppData\\Local\\Temp",TERM_PROGRAM:"vscode",TERM_PROGRAM_VERSION:"1.95.3",TMP:"C:\\Users\\yscho\\AppData\\Local\\Temp",USERDOMAIN:"LAPTOP-1U9BALFB",USERDOMAIN_ROAMINGPROFILE:"LAPTOP-1U9BALFB",USERNAME:"yunsung",USERPROFILE:"C:\\Users\\yscho",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",VSCODE_GIT_ASKPASS_MAIN:"c:\\Users\\yscho\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\extensions\\git\\dist\\askpass-main.js",VSCODE_GIT_ASKPASS_NODE:"C:\\Users\\yscho\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe",VSCODE_GIT_IPC_HANDLE:"\\\\.\\pipe\\vscode-git-ee27cb4a5d-sock",VSCODE_INJECTION:"1",windir:"C:\\WINDOWS"},Ii=typeof process<"u"&&Mt!==void 0&&(Mt.REACT_APP_SC_ATTR||Mt.SC_ATTR)||"data-styled",a1="active",l1="data-styled-version",Ic="6.1.13",Mp=`/*!sc*/ -`,Jl=typeof window<"u"&&"HTMLElement"in window,DS=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Mt!==void 0&&Mt.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Mt.REACT_APP_SC_DISABLE_SPEEDY!==""?Mt.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Mt.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Mt!==void 0&&Mt.SC_DISABLE_SPEEDY!==void 0&&Mt.SC_DISABLE_SPEEDY!==""&&Mt.SC_DISABLE_SPEEDY!=="false"&&Mt.SC_DISABLE_SPEEDY),OS={},Dc=Object.freeze([]),Di=Object.freeze({});function c1(e,t,n){return n===void 0&&(n=Di),e.theme!==n.theme&&e.theme||t||n.theme}var u1=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),TS=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,NS=/(^-|-$)/g;function Ym(e){return e.replace(TS,"-").replace(NS,"")}var LS=/(a)(d)/gi,Ba=52,Jm=function(e){return String.fromCharCode(e+(e>25?39:97))};function af(e){var t,n="";for(t=Math.abs(e);t>Ba;t=t/Ba|0)n=Jm(t%Ba)+n;return(Jm(t%Ba)+n).replace(LS,"$1-$2")}var ku,d1=5381,Xo=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},f1=function(e){return Xo(d1,e)};function p1(e){return af(f1(e)>>>0)}function _S(e){return e.displayName||e.name||"Component"}function Pu(e){return typeof e=="string"&&!0}var h1=typeof Symbol=="function"&&Symbol.for,m1=h1?Symbol.for("react.memo"):60115,MS=h1?Symbol.for("react.forward_ref"):60112,$S={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},zS={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},g1={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},FS=((ku={})[MS]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},ku[m1]=g1,ku);function Xm(e){return("type"in(t=e)&&t.type.$$typeof)===m1?g1:"$$typeof"in e?FS[e.$$typeof]:$S;var t}var US=Object.defineProperty,BS=Object.getOwnPropertyNames,Zm=Object.getOwnPropertySymbols,WS=Object.getOwnPropertyDescriptor,HS=Object.getPrototypeOf,eg=Object.prototype;function x1(e,t,n){if(typeof t!="string"){if(eg){var r=HS(t);r&&r!==eg&&x1(e,r,n)}var o=BS(t);Zm&&(o=o.concat(Zm(t)));for(var i=Xm(e),a=Xm(t),l=0;l0?" Args: ".concat(t.join(", ")):""))}var VS=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,o=r.length,i=o;t>=i;)if((i<<=1)<0)throw ua(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(r),this.length=i;for(var a=o;a=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],o=this.indexOfGroup(t),i=o+r,a=o;a=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(j+="".concat(g,","))}),u+="".concat(y).concat(x,'{content:"').concat(j,'"}').concat(Mp)},p=0;p0?".".concat(t):h},p=u.slice();p.push(function(h){h.type===Pc&&h.value.includes("&")&&(h.props[0]=h.props[0].replace(n2,n).replace(r,d))}),a.prefix&&p.push(AS),p.push(PS);var f=function(h,b,y,x){b===void 0&&(b=""),y===void 0&&(y=""),x===void 0&&(x="&"),t=x,n=b,r=new RegExp("\\".concat(n,"\\b"),"g");var j=h.replace(r2,""),g=SS(y||b?"".concat(y," ").concat(b," { ").concat(j," }"):j);a.namespace&&(g=v1(g,a.namespace));var m=[];return Yl(g,ES(p.concat(RS(function(v){return m.push(v)})))),m};return f.hash=u.length?u.reduce(function(h,b){return b.name||ua(15),Xo(h,b.name)},d1).toString():"",f}var i2=new Zl,uf=o2(),w1=ut.createContext({shouldForwardProp:void 0,styleSheet:i2,stylis:uf});w1.Consumer;ut.createContext(void 0);function df(){return w.useContext(w1)}var s2=function(){function e(t,n){var r=this;this.inject=function(o,i){i===void 0&&(i=uf);var a=r.name+i.hash;o.hasNameForId(r.id,a)||o.insertRules(r.id,a,i(r.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,zp(this,function(){throw ua(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=uf),this.name+t.hash},e}(),a2=function(e){return e>="A"&&e<="Z"};function rg(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,a)){var l=r(i,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,l)}o=ro(o,a),this.staticRulesId=a}else{for(var u=Xo(this.baseHash,r.hash),d="",p=0;p>>0);n.hasNameForId(this.componentId,b)||n.insertRules(this.componentId,b,r(d,".".concat(b),void 0,this.componentId)),o=ro(o,b)}}return o},e}(),Fp=ut.createContext(void 0);Fp.Consumer;var Eu={};function u2(e,t,n){var r=$p(e),o=e,i=!Pu(e),a=t.attrs,l=a===void 0?Dc:a,u=t.componentId,d=u===void 0?function(C,P){var S=typeof C!="string"?"sc":Ym(C);Eu[S]=(Eu[S]||0)+1;var R="".concat(S,"-").concat(p1(Ic+S+Eu[S]));return P?"".concat(P,"-").concat(R):R}(t.displayName,t.parentComponentId):u,p=t.displayName,f=p===void 0?function(C){return Pu(C)?"styled.".concat(C):"Styled(".concat(_S(C),")")}(e):p,h=t.displayName&&t.componentId?"".concat(Ym(t.displayName),"-").concat(t.componentId):t.componentId||d,b=r&&o.attrs?o.attrs.concat(l).filter(Boolean):l,y=t.shouldForwardProp;if(r&&o.shouldForwardProp){var x=o.shouldForwardProp;if(t.shouldForwardProp){var j=t.shouldForwardProp;y=function(C,P){return x(C,P)&&j(C,P)}}else y=x}var g=new c2(n,h,r?o.componentStyle:void 0);function m(C,P){return function(S,R,I){var L=S.attrs,B=S.componentStyle,N=S.defaultProps,O=S.foldedComponentIds,$=S.styledComponentId,F=S.target,se=ut.useContext(Fp),he=df(),oe=S.shouldForwardProp||he.shouldForwardProp,W=c1(R,se,N)||Di,H=function(Ne,Ce,M){for(var U,ae=xt(xt({},Ce),{className:void 0,theme:M}),Ke=0;Ke2&&Zl.registerId(this.componentId+t),this.removeStyles(t,r),this.createStyles(t,n,r,o)},e}();function f2(e){for(var t=[],n=1;n{const t=()=>{const n=[],r=Math.floor(e),o=e%1>=.3&&e%1<=.7,i=e%1<.3&&e%1>0,a=e%1>.7;for(let u=0;ue!=="likes"})` - position: absolute; - bottom: 20px; - right: 30px; - width: 25px; - height: 25px; - cursor: pointer; - content: ${({likes:e})=>`url(${e?E1:P1})`}; - color: ${({likes:e})=>e?"red ":"transparent"}; - - &:hover { - cursor: pointer; - transform: scale(1.2); - transition: transform 0.2s ease-in-out; - } -`,b2=c.div` - width: 100%; - display: flex; - align-items: center; - position: relative; -`,j2=c.div.withConfig({shouldForwardProp:e=>e!=="expanded"})` - display: flex; - flex-wrap: wrap; - gap: 2px; - position: absolute; - top: 15px; - left: 190px; - padding: 10px 20px; - z-index: 10; - visibility: ${e=>e.expanded?"visible":"hidden"}; - opacity: ${e=>e.expanded?1:0}; - transition: - opacity 0.3s ease, - visibility 0.3s ease; -`,C2=c.div` - padding: 5px 10px; - border-radius: 5px; - width: 120px; - font-weight: ${e=>e.selected?"bold":"normal"}; - text-decoration: ${e=>e.selected?"underline":"none"}; - &:hover { - cursor: pointer; - text-decoration: underline; - } -`,z1=c.div` - position: relative; - margin-top: 30px; - display: flex; - justify-content: flex-end; - width: 100%; -`,F1=c(An)` - position: absolute; - right: 20px; - display: inline-block; - padding: 10px 30px; - background-color: black; - color: white; - border-radius: 8px; - text-decoration: none; - font-weight: bold; - font-size: 16px; - transition: background-color 0.3s; - - &:hover { - cursor: pointer; - background-color: gray; - } -`,In="/assets/default-featured-image.png-C2hm5daT.jpg",S2=({products:e})=>{if(!e)return s.jsx("div",{children:"No products available"});const t=o=>[...o].sort((a,l)=>{var u,d;return(((u=l.reviews)==null?void 0:u.length)||0)-(((d=a.reviews)==null?void 0:d.length)||0)}).slice(0,8),n=w.useMemo(()=>t(e),[e]),r=()=>{};return s.jsxs(v2,{children:[s.jsx(w2,{children:"실시간 인기 상품"}),s.jsx(R1,{children:n.map(o=>s.jsxs(A1,{children:[s.jsxs(I1,{to:`/products/${o.id}`,children:[s.jsx(D1,{src:o.url||In,alt:o.name,onError:i=>{i.currentTarget.src=In}}),s.jsxs(O1,{children:[s.jsx(T1,{children:o.name}),s.jsx(N1,{children:s.jsx(da,{rating:o.rating})}),s.jsxs(L1,{children:[s.jsxs(_1,{children:[o.originalprice,"원"]}),s.jsxs(M1,{children:[o.discountprice,"원"]})]})]})]}),s.jsx($1,{likes:o.likes,onClick:r})]},o.id))}),s.jsx(z1,{children:s.jsx(F1,{to:"/products",children:"더보기"})})]})};var Fi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Co=typeof window>"u"||"Deno"in globalThis;function qt(){}function k2(e,t){return typeof e=="function"?e(t):e}function pf(e){return typeof e=="number"&&e>=0&&e!==1/0}function U1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ii(e,t){return typeof e=="function"?e(t):e}function dn(e,t){return typeof e=="function"?e(t):e}function sg(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==Up(a,t.options))return!1}else if(!Js(t.queryKey,a))return!1}if(n!=="all"){const u=t.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||o&&o!==t.state.fetchStatus||i&&!i(t))}function ag(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(So(t.options.mutationKey)!==So(i))return!1}else if(!Js(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Up(e,t){return((t==null?void 0:t.queryKeyHashFn)||So)(e)}function So(e){return JSON.stringify(e,(t,n)=>hf(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Js(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Js(e[n],t[n])):!1}function B1(e,t){if(e===t)return e;const n=lg(e)&&lg(t);if(n||hf(e)&&hf(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),a=i.length,l=n?[]:{};let u=0;for(let d=0;d{setTimeout(t,e)})}function mf(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?B1(e,t):t}function E2(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function R2(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Bp=Symbol();function W1(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Bp?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var io,mr,ai,px,A2=(px=class extends Fi{constructor(){super();te(this,io);te(this,mr);te(this,ai);V(this,ai,t=>{if(!Co&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){k(this,mr)||this.setEventListener(k(this,ai))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,mr))==null||t.call(this),V(this,mr,void 0))}setEventListener(t){var n;V(this,ai,t),(n=k(this,mr))==null||n.call(this),V(this,mr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){k(this,io)!==t&&(V(this,io,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof k(this,io)=="boolean"?k(this,io):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},io=new WeakMap,mr=new WeakMap,ai=new WeakMap,px),Wp=new A2,li,gr,ci,hx,I2=(hx=class extends Fi{constructor(){super();te(this,li,!0);te(this,gr);te(this,ci);V(this,ci,t=>{if(!Co&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){k(this,gr)||this.setEventListener(k(this,ci))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,gr))==null||t.call(this),V(this,gr,void 0))}setEventListener(t){var n;V(this,ci,t),(n=k(this,gr))==null||n.call(this),V(this,gr,t(this.setOnline.bind(this)))}setOnline(t){k(this,li)!==t&&(V(this,li,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return k(this,li)}},li=new WeakMap,gr=new WeakMap,ci=new WeakMap,hx),tc=new I2;function gf(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function D2(e){return Math.min(1e3*2**e,3e4)}function H1(e){return(e??"online")==="online"?tc.isOnline():!0}var V1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ru(e){return e instanceof V1}function Q1(e){let t=!1,n=0,r=!1,o;const i=gf(),a=x=>{var j;r||(h(new V1(x)),(j=e.abort)==null||j.call(e))},l=()=>{t=!0},u=()=>{t=!1},d=()=>Wp.isFocused()&&(e.networkMode==="always"||tc.isOnline())&&e.canRun(),p=()=>H1(e.networkMode)&&e.canRun(),f=x=>{var j;r||(r=!0,(j=e.onSuccess)==null||j.call(e,x),o==null||o(),i.resolve(x))},h=x=>{var j;r||(r=!0,(j=e.onError)==null||j.call(e,x),o==null||o(),i.reject(x))},b=()=>new Promise(x=>{var j;o=g=>{(r||d())&&x(g)},(j=e.onPause)==null||j.call(e)}).then(()=>{var x;o=void 0,r||(x=e.onContinue)==null||x.call(e)}),y=()=>{if(r)return;let x;const j=n===0?e.initialPromise:void 0;try{x=j??e.fn()}catch(g){x=Promise.reject(g)}Promise.resolve(x).then(f).catch(g=>{var S;if(r)return;const m=e.retry??(Co?0:3),v=e.retryDelay??D2,C=typeof v=="function"?v(n,g):v,P=m===!0||typeof m=="number"&&nd()?void 0:b()).then(()=>{t?h(g):y()})})};return{promise:i,cancel:a,continue:()=>(o==null||o(),i),cancelRetry:l,continueRetry:u,canStart:p,start:()=>(p()?y():b().then(y),i)}}function O2(){let e=[],t=0,n=l=>{l()},r=l=>{l()},o=l=>setTimeout(l,0);const i=l=>{t?e.push(l):o(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&o(()=>{r(()=>{l.forEach(u=>{n(u)})})})};return{batch:l=>{let u;t++;try{u=l()}finally{t--,t||a()}return u},batchCalls:l=>(...u)=>{i(()=>{l(...u)})},schedule:i,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{o=l}}}var et=O2(),so,mx,K1=(mx=class{constructor(){te(this,so)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),pf(this.gcTime)&&V(this,so,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Co?1/0:5*60*1e3))}clearGcTimeout(){k(this,so)&&(clearTimeout(k(this,so)),V(this,so,void 0))}},so=new WeakMap,mx),ui,di,Gt,mt,ea,ao,an,Fn,gx,T2=(gx=class extends K1{constructor(t){super();te(this,an);te(this,ui);te(this,di);te(this,Gt);te(this,mt);te(this,ea);te(this,ao);V(this,ao,!1),V(this,ea,t.defaultOptions),this.setOptions(t.options),this.observers=[],V(this,Gt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,V(this,ui,N2(this.options)),this.state=t.state??k(this,ui),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=k(this,mt))==null?void 0:t.promise}setOptions(t){this.options={...k(this,ea),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,Gt).remove(this)}setData(t,n){const r=mf(this.state.data,t,this.options);return ue(this,an,Fn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ue(this,an,Fn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=k(this,mt))==null?void 0:r.promise;return(o=k(this,mt))==null||o.cancel(t),n?n.then(qt).catch(qt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(k(this,ui))}isActive(){return this.observers.some(t=>dn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Bp||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!U1(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,mt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=k(this,mt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),k(this,Gt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(k(this,mt)&&(k(this,ao)?k(this,mt).cancel({revert:!0}):k(this,mt).cancelRetry()),this.scheduleGc()),k(this,Gt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ue(this,an,Fn).call(this,{type:"invalidate"})}fetch(t,n){var u,d,p;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(k(this,mt))return k(this,mt).continueRetry(),k(this,mt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,o=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(V(this,ao,!0),r.signal)})},i=()=>{const f=W1(this.options,n),h={queryKey:this.queryKey,meta:this.meta};return o(h),V(this,ao,!1),this.options.persister?this.options.persister(f,h,this):f(h)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};o(a),(u=this.options.behavior)==null||u.onFetch(a,this),V(this,di,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&ue(this,an,Fn).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=f=>{var h,b,y,x;Ru(f)&&f.silent||ue(this,an,Fn).call(this,{type:"error",error:f}),Ru(f)||((b=(h=k(this,Gt).config).onError)==null||b.call(h,f,this),(x=(y=k(this,Gt).config).onSettled)==null||x.call(y,this.state.data,f,this)),this.scheduleGc()};return V(this,mt,Q1({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,b,y,x;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(j){l(j);return}(b=(h=k(this,Gt).config).onSuccess)==null||b.call(h,f,this),(x=(y=k(this,Gt).config).onSettled)==null||x.call(y,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{ue(this,an,Fn).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{ue(this,an,Fn).call(this,{type:"pause"})},onContinue:()=>{ue(this,an,Fn).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),k(this,mt).start()}},ui=new WeakMap,di=new WeakMap,Gt=new WeakMap,mt=new WeakMap,ea=new WeakMap,ao=new WeakMap,an=new WeakSet,Fn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...G1(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Ru(o)&&o.revert&&k(this,di)?{...k(this,di),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),et.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),k(this,Gt).notify({query:this,type:"updated",action:t})})},gx);function G1(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:H1(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function N2(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var bn,xx,L2=(xx=class extends Fi{constructor(t={}){super();te(this,bn);this.config=t,V(this,bn,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Up(o,n);let a=this.get(i);return a||(a=new T2({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(a)),a}add(t){k(this,bn).has(t.queryHash)||(k(this,bn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=k(this,bn).get(t.queryHash);n&&(t.destroy(),n===t&&k(this,bn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){et.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return k(this,bn).get(t)}getAll(){return[...k(this,bn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>sg(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>sg(t,r)):n}notify(t){et.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){et.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){et.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},bn=new WeakMap,xx),jn,wt,lo,Cn,ur,yx,_2=(yx=class extends K1{constructor(t){super();te(this,Cn);te(this,jn);te(this,wt);te(this,lo);this.mutationId=t.mutationId,V(this,wt,t.mutationCache),V(this,jn,[]),this.state=t.state||q1(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){k(this,jn).includes(t)||(k(this,jn).push(t),this.clearGcTimeout(),k(this,wt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){V(this,jn,k(this,jn).filter(n=>n!==t)),this.scheduleGc(),k(this,wt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){k(this,jn).length||(this.state.status==="pending"?this.scheduleGc():k(this,wt).remove(this))}continue(){var t;return((t=k(this,lo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,a,l,u,d,p,f,h,b,y,x,j,g,m,v,C,P,S,R;V(this,lo,Q1({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(I,L)=>{ue(this,Cn,ur).call(this,{type:"failed",failureCount:I,error:L})},onPause:()=>{ue(this,Cn,ur).call(this,{type:"pause"})},onContinue:()=>{ue(this,Cn,ur).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,wt).canRun(this)}));const n=this.state.status==="pending",r=!k(this,lo).canStart();try{if(!n){ue(this,Cn,ur).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=k(this,wt).config).onMutate)==null?void 0:i.call(o,t,this));const L=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));L!==this.state.context&&ue(this,Cn,ur).call(this,{type:"pending",context:L,variables:t,isPaused:r})}const I=await k(this,lo).start();return await((d=(u=k(this,wt).config).onSuccess)==null?void 0:d.call(u,I,t,this.state.context,this)),await((f=(p=this.options).onSuccess)==null?void 0:f.call(p,I,t,this.state.context)),await((b=(h=k(this,wt).config).onSettled)==null?void 0:b.call(h,I,null,this.state.variables,this.state.context,this)),await((x=(y=this.options).onSettled)==null?void 0:x.call(y,I,null,t,this.state.context)),ue(this,Cn,ur).call(this,{type:"success",data:I}),I}catch(I){try{throw await((g=(j=k(this,wt).config).onError)==null?void 0:g.call(j,I,t,this.state.context,this)),await((v=(m=this.options).onError)==null?void 0:v.call(m,I,t,this.state.context)),await((P=(C=k(this,wt).config).onSettled)==null?void 0:P.call(C,void 0,I,this.state.variables,this.state.context,this)),await((R=(S=this.options).onSettled)==null?void 0:R.call(S,void 0,I,t,this.state.context)),I}finally{ue(this,Cn,ur).call(this,{type:"error",error:I})}}finally{k(this,wt).runNext(this)}}},jn=new WeakMap,wt=new WeakMap,lo=new WeakMap,Cn=new WeakSet,ur=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),et.batch(()=>{k(this,jn).forEach(r=>{r.onMutationUpdate(t)}),k(this,wt).notify({mutation:this,type:"updated",action:t})})},yx);function q1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var $t,ta,vx,M2=(vx=class extends Fi{constructor(t={}){super();te(this,$t);te(this,ta);this.config=t,V(this,$t,new Map),V(this,ta,Date.now())}build(t,n,r){const o=new _2({mutationCache:this,mutationId:++Ca(this,ta)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){const n=Ha(t),r=k(this,$t).get(n)??[];r.push(t),k(this,$t).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=Ha(t);if(k(this,$t).has(n)){const o=(r=k(this,$t).get(n))==null?void 0:r.filter(i=>i!==t);o&&(o.length===0?k(this,$t).delete(n):k(this,$t).set(n,o))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=k(this,$t).get(Ha(t)))==null?void 0:r.find(o=>o.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=k(this,$t).get(Ha(t)))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){et.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...k(this,$t).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ag(n,r))}findAll(t={}){return this.getAll().filter(n=>ag(t,n))}notify(t){et.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return et.batch(()=>Promise.all(t.map(n=>n.continue().catch(qt))))}},$t=new WeakMap,ta=new WeakMap,vx);function Ha(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function ug(e){return{onFetch:(t,n)=>{var p,f,h,b,y;const r=t.options,o=(h=(f=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,i=((b=t.state.data)==null?void 0:b.pages)||[],a=((y=t.state.data)==null?void 0:y.pageParams)||[];let l={pages:[],pageParams:[]},u=0;const d=async()=>{let x=!1;const j=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?x=!0:t.signal.addEventListener("abort",()=>{x=!0}),t.signal)})},g=W1(t.options,t.fetchOptions),m=async(v,C,P)=>{if(x)return Promise.reject();if(C==null&&v.pages.length)return Promise.resolve(v);const S={queryKey:t.queryKey,pageParam:C,direction:P?"backward":"forward",meta:t.options.meta};j(S);const R=await g(S),{maxPages:I}=t.options,L=P?R2:E2;return{pages:L(v.pages,R,I),pageParams:L(v.pageParams,C,I)}};if(o&&i.length){const v=o==="backward",C=v?$2:dg,P={pages:i,pageParams:a},S=C(r,P);l=await m(P,S,v)}else{const v=e??i.length;do{const C=u===0?a[0]??r.initialPageParam:dg(r,l);if(u>0&&C==null)break;l=await m(l,C),u++}while(u{var x,j;return(j=(x=t.options).persister)==null?void 0:j.call(x,d,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function dg(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function $2(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var We,xr,yr,fi,pi,vr,hi,mi,wx,z2=(wx=class{constructor(e={}){te(this,We);te(this,xr);te(this,yr);te(this,fi);te(this,pi);te(this,vr);te(this,hi);te(this,mi);V(this,We,e.queryCache||new L2),V(this,xr,e.mutationCache||new M2),V(this,yr,e.defaultOptions||{}),V(this,fi,new Map),V(this,pi,new Map),V(this,vr,0)}mount(){Ca(this,vr)._++,k(this,vr)===1&&(V(this,hi,Wp.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,We).onFocus())})),V(this,mi,tc.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,We).onOnline())})))}unmount(){var e,t;Ca(this,vr)._--,k(this,vr)===0&&((e=k(this,hi))==null||e.call(this),V(this,hi,void 0),(t=k(this,mi))==null||t.call(this),V(this,mi,void 0))}isFetching(e){return k(this,We).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,xr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,We).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=k(this,We).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(ii(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return k(this,We).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=k(this,We).get(r.queryHash),i=o==null?void 0:o.state.data,a=k2(t,i);if(a!==void 0)return k(this,We).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return et.batch(()=>k(this,We).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=k(this,We).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=k(this,We);et.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=k(this,We),r={type:"active",...e};return et.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=et.batch(()=>k(this,We).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(qt).catch(qt)}invalidateQueries(e={},t={}){return et.batch(()=>{if(k(this,We).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=et.batch(()=>k(this,We).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(qt)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(qt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=k(this,We).build(this,t);return n.isStaleByTime(ii(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(qt).catch(qt)}fetchInfiniteQuery(e){return e.behavior=ug(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(qt).catch(qt)}ensureInfiniteQueryData(e){return e.behavior=ug(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return tc.isOnline()?k(this,xr).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,We)}getMutationCache(){return k(this,xr)}getDefaultOptions(){return k(this,yr)}setDefaultOptions(e){V(this,yr,e)}setQueryDefaults(e,t){k(this,fi).set(So(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...k(this,fi).values()];let n={};return t.forEach(r=>{Js(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){k(this,pi).set(So(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...k(this,pi).values()];let n={};return t.forEach(r=>{Js(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...k(this,yr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Up(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===Bp&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,yr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,We).clear(),k(this,xr).clear()}},We=new WeakMap,xr=new WeakMap,yr=new WeakMap,fi=new WeakMap,pi=new WeakMap,vr=new WeakMap,hi=new WeakMap,mi=new WeakMap,wx),Pt,xe,na,bt,co,gi,wr,Sn,ra,xi,yi,uo,fo,br,vi,ke,vs,xf,yf,vf,wf,bf,jf,Cf,Y1,bx,F2=(bx=class extends Fi{constructor(t,n){super();te(this,ke);te(this,Pt);te(this,xe);te(this,na);te(this,bt);te(this,co);te(this,gi);te(this,wr);te(this,Sn);te(this,ra);te(this,xi);te(this,yi);te(this,uo);te(this,fo);te(this,br);te(this,vi,new Set);this.options=n,V(this,Pt,t),V(this,Sn,null),V(this,wr,gf()),this.options.experimental_prefetchInRender||k(this,wr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,xe).addObserver(this),fg(k(this,xe),this.options)?ue(this,ke,vs).call(this):this.updateResult(),ue(this,ke,wf).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Sf(k(this,xe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Sf(k(this,xe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ue(this,ke,bf).call(this),ue(this,ke,jf).call(this),k(this,xe).removeObserver(this)}setOptions(t,n){const r=this.options,o=k(this,xe);if(this.options=k(this,Pt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof dn(this.options.enabled,k(this,xe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ue(this,ke,Cf).call(this),k(this,xe).setOptions(this.options),r._defaulted&&!ec(this.options,r)&&k(this,Pt).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,xe),observer:this});const i=this.hasListeners();i&&pg(k(this,xe),o,this.options,r)&&ue(this,ke,vs).call(this),this.updateResult(n),i&&(k(this,xe)!==o||dn(this.options.enabled,k(this,xe))!==dn(r.enabled,k(this,xe))||ii(this.options.staleTime,k(this,xe))!==ii(r.staleTime,k(this,xe)))&&ue(this,ke,xf).call(this);const a=ue(this,ke,yf).call(this);i&&(k(this,xe)!==o||dn(this.options.enabled,k(this,xe))!==dn(r.enabled,k(this,xe))||a!==k(this,br))&&ue(this,ke,vf).call(this,a)}getOptimisticResult(t){const n=k(this,Pt).getQueryCache().build(k(this,Pt),t),r=this.createResult(n,t);return B2(this,r)&&(V(this,bt,r),V(this,gi,this.options),V(this,co,k(this,xe).state)),r}getCurrentResult(){return k(this,bt)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){k(this,vi).add(t)}getCurrentQuery(){return k(this,xe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=k(this,Pt).defaultQueryOptions(t),r=k(this,Pt).getQueryCache().build(k(this,Pt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ue(this,ke,vs).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,bt)))}createResult(t,n){var I;const r=k(this,xe),o=this.options,i=k(this,bt),a=k(this,co),l=k(this,gi),d=t!==r?t.state:k(this,na),{state:p}=t;let f={...p},h=!1,b;if(n._optimisticResults){const L=this.hasListeners(),B=!L&&fg(t,n),N=L&&pg(t,r,n,o);(B||N)&&(f={...f,...G1(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:y,errorUpdatedAt:x,status:j}=f;if(n.select&&f.data!==void 0)if(i&&f.data===(a==null?void 0:a.data)&&n.select===k(this,ra))b=k(this,xi);else try{V(this,ra,n.select),b=n.select(f.data),b=mf(i==null?void 0:i.data,b,n),V(this,xi,b),V(this,Sn,null)}catch(L){V(this,Sn,L)}else b=f.data;if(n.placeholderData!==void 0&&b===void 0&&j==="pending"){let L;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))L=i.data;else if(L=typeof n.placeholderData=="function"?n.placeholderData((I=k(this,yi))==null?void 0:I.state.data,k(this,yi)):n.placeholderData,n.select&&L!==void 0)try{L=n.select(L),V(this,Sn,null)}catch(B){V(this,Sn,B)}L!==void 0&&(j="success",b=mf(i==null?void 0:i.data,L,n),h=!0)}k(this,Sn)&&(y=k(this,Sn),b=k(this,xi),x=Date.now(),j="error");const g=f.fetchStatus==="fetching",m=j==="pending",v=j==="error",C=m&&g,P=b!==void 0,R={status:j,fetchStatus:f.fetchStatus,isPending:m,isSuccess:j==="success",isError:v,isInitialLoading:C,isLoading:C,data:b,dataUpdatedAt:f.dataUpdatedAt,error:y,errorUpdatedAt:x,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:g,isRefetching:g&&!m,isLoadingError:v&&!P,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:v&&P,isStale:Hp(t,n),refetch:this.refetch,promise:k(this,wr)};if(this.options.experimental_prefetchInRender){const L=O=>{R.status==="error"?O.reject(R.error):R.data!==void 0&&O.resolve(R.data)},B=()=>{const O=V(this,wr,R.promise=gf());L(O)},N=k(this,wr);switch(N.status){case"pending":t.queryHash===r.queryHash&&L(N);break;case"fulfilled":(R.status==="error"||R.data!==N.value)&&B();break;case"rejected":(R.status!=="error"||R.error!==N.reason)&&B();break}}return R}updateResult(t){const n=k(this,bt),r=this.createResult(k(this,xe),this.options);if(V(this,co,k(this,xe).state),V(this,gi,this.options),k(this,co).data!==void 0&&V(this,yi,k(this,xe)),ec(r,n))return;V(this,bt,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,l=typeof a=="function"?a():a;if(l==="all"||!l&&!k(this,vi).size)return!0;const u=new Set(l??k(this,vi));return this.options.throwOnError&&u.add("error"),Object.keys(k(this,bt)).some(d=>{const p=d;return k(this,bt)[p]!==n[p]&&u.has(p)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),ue(this,ke,Y1).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ue(this,ke,wf).call(this)}},Pt=new WeakMap,xe=new WeakMap,na=new WeakMap,bt=new WeakMap,co=new WeakMap,gi=new WeakMap,wr=new WeakMap,Sn=new WeakMap,ra=new WeakMap,xi=new WeakMap,yi=new WeakMap,uo=new WeakMap,fo=new WeakMap,br=new WeakMap,vi=new WeakMap,ke=new WeakSet,vs=function(t){ue(this,ke,Cf).call(this);let n=k(this,xe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(qt)),n},xf=function(){ue(this,ke,bf).call(this);const t=ii(this.options.staleTime,k(this,xe));if(Co||k(this,bt).isStale||!pf(t))return;const r=U1(k(this,bt).dataUpdatedAt,t)+1;V(this,uo,setTimeout(()=>{k(this,bt).isStale||this.updateResult()},r))},yf=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,xe)):this.options.refetchInterval)??!1},vf=function(t){ue(this,ke,jf).call(this),V(this,br,t),!(Co||dn(this.options.enabled,k(this,xe))===!1||!pf(k(this,br))||k(this,br)===0)&&V(this,fo,setInterval(()=>{(this.options.refetchIntervalInBackground||Wp.isFocused())&&ue(this,ke,vs).call(this)},k(this,br)))},wf=function(){ue(this,ke,xf).call(this),ue(this,ke,vf).call(this,ue(this,ke,yf).call(this))},bf=function(){k(this,uo)&&(clearTimeout(k(this,uo)),V(this,uo,void 0))},jf=function(){k(this,fo)&&(clearInterval(k(this,fo)),V(this,fo,void 0))},Cf=function(){const t=k(this,Pt).getQueryCache().build(k(this,Pt),this.options);if(t===k(this,xe))return;const n=k(this,xe);V(this,xe,t),V(this,na,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Y1=function(t){et.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(k(this,bt))}),k(this,Pt).getQueryCache().notify({query:k(this,xe),type:"observerResultsUpdated"})})},bx);function U2(e,t){return dn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function fg(e,t){return U2(e,t)||e.state.data!==void 0&&Sf(e,t,t.refetchOnMount)}function Sf(e,t,n){if(dn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Hp(e,t)}return!1}function pg(e,t,n,r){return(e!==t||dn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Hp(e,n)}function Hp(e,t){return dn(t.enabled,e)!==!1&&e.isStaleByTime(ii(t.staleTime,e))}function B2(e,t){return!ec(e.getCurrentResult(),t)}var jr,Cr,Et,Hn,qn,vl,kf,jx,W2=(jx=class extends Fi{constructor(n,r){super();te(this,qn);te(this,jr);te(this,Cr);te(this,Et);te(this,Hn);V(this,jr,n),this.setOptions(r),this.bindMethods(),ue(this,qn,vl).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=k(this,jr).defaultMutationOptions(n),ec(this.options,r)||k(this,jr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:k(this,Et),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&So(r.mutationKey)!==So(this.options.mutationKey)?this.reset():((o=k(this,Et))==null?void 0:o.state.status)==="pending"&&k(this,Et).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=k(this,Et))==null||n.removeObserver(this)}onMutationUpdate(n){ue(this,qn,vl).call(this),ue(this,qn,kf).call(this,n)}getCurrentResult(){return k(this,Cr)}reset(){var n;(n=k(this,Et))==null||n.removeObserver(this),V(this,Et,void 0),ue(this,qn,vl).call(this),ue(this,qn,kf).call(this)}mutate(n,r){var o;return V(this,Hn,r),(o=k(this,Et))==null||o.removeObserver(this),V(this,Et,k(this,jr).getMutationCache().build(k(this,jr),this.options)),k(this,Et).addObserver(this),k(this,Et).execute(n)}},jr=new WeakMap,Cr=new WeakMap,Et=new WeakMap,Hn=new WeakMap,qn=new WeakSet,vl=function(){var r;const n=((r=k(this,Et))==null?void 0:r.state)??q1();V(this,Cr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},kf=function(n){et.batch(()=>{var r,o,i,a,l,u,d,p;if(k(this,Hn)&&this.hasListeners()){const f=k(this,Cr).variables,h=k(this,Cr).context;(n==null?void 0:n.type)==="success"?((o=(r=k(this,Hn)).onSuccess)==null||o.call(r,n.data,f,h),(a=(i=k(this,Hn)).onSettled)==null||a.call(i,n.data,null,f,h)):(n==null?void 0:n.type)==="error"&&((u=(l=k(this,Hn)).onError)==null||u.call(l,n.error,f,h),(p=(d=k(this,Hn)).onSettled)==null||p.call(d,void 0,n.error,f,h))}this.listeners.forEach(f=>{f(k(this,Cr))})})},jx),J1=w.createContext(void 0),Oc=e=>{const t=w.useContext(J1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},H2=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(J1.Provider,{value:e,children:t})),X1=w.createContext(!1),V2=()=>w.useContext(X1);X1.Provider;function Q2(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var K2=w.createContext(Q2()),G2=()=>w.useContext(K2);function Z1(e,t){return typeof e=="function"?e(...t):!!e}function Pf(){}var q2=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Y2=e=>{w.useEffect(()=>{e.clearReset()},[e])},J2=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Z1(n,[e.error,r]),X2=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Z2=(e,t)=>e.isLoading&&e.isFetching&&!t,ek=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,hg=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function tk(e,t,n){var p,f,h,b,y;const r=Oc(),o=V2(),i=G2(),a=r.defaultQueryOptions(e);(f=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||f.call(p,a),a._optimisticResults=o?"isRestoring":"optimistic",X2(a),q2(a,i),Y2(i);const l=!r.getQueryCache().get(a.queryHash),[u]=w.useState(()=>new t(r,a)),d=u.getOptimisticResult(a);if(w.useSyncExternalStore(w.useCallback(x=>{const j=o?Pf:u.subscribe(et.batchCalls(x));return u.updateResult(),j},[u,o]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),w.useEffect(()=>{u.setOptions(a,{listeners:!1})},[a,u]),ek(a,d))throw hg(a,u,i);if(J2({result:d,errorResetBoundary:i,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw d.error;if((b=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||b.call(h,a,d),a.experimental_prefetchInRender&&!Co&&Z2(d,o)){const x=l?hg(a,u,i):(y=r.getQueryCache().get(a.queryHash))==null?void 0:y.promise;x==null||x.catch(Pf).finally(()=>{u.updateResult()})}return a.notifyOnChangeProps?d:u.trackResult(d)}function Vp(e,t){return tk(e,F2)}function Yr(e,t){const n=Oc(),[r]=w.useState(()=>new W2(n,e));w.useEffect(()=>{r.setOptions(e)},[r,e]);const o=w.useSyncExternalStore(w.useCallback(a=>r.subscribe(et.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=w.useCallback((a,l)=>{r.mutate(a,l).catch(Pf)},[r]);if(o.error&&Z1(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}function ev(e,t){return function(){return e.apply(t,arguments)}}const{toString:nk}=Object.prototype,{getPrototypeOf:Qp}=Object,Tc=(e=>t=>{const n=nk.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),gn=e=>(e=e.toLowerCase(),t=>Tc(t)===e),Nc=e=>t=>typeof t===e,{isArray:Ui}=Array,Xs=Nc("undefined");function rk(e){return e!==null&&!Xs(e)&&e.constructor!==null&&!Xs(e.constructor)&&Wt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const tv=gn("ArrayBuffer");function ok(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&tv(e.buffer),t}const ik=Nc("string"),Wt=Nc("function"),nv=Nc("number"),Lc=e=>e!==null&&typeof e=="object",sk=e=>e===!0||e===!1,wl=e=>{if(Tc(e)!=="object")return!1;const t=Qp(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},ak=gn("Date"),lk=gn("File"),ck=gn("Blob"),uk=gn("FileList"),dk=e=>Lc(e)&&Wt(e.pipe),fk=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Wt(e.append)&&((t=Tc(e))==="formdata"||t==="object"&&Wt(e.toString)&&e.toString()==="[object FormData]"))},pk=gn("URLSearchParams"),[hk,mk,gk,xk]=["ReadableStream","Request","Response","Headers"].map(gn),yk=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function pa(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),Ui(e))for(r=0,o=e.length;r0;)if(o=n[r],t===o.toLowerCase())return o;return null}const oo=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ov=e=>!Xs(e)&&e!==oo;function Ef(){const{caseless:e}=ov(this)&&this||{},t={},n=(r,o)=>{const i=e&&rv(t,o)||o;wl(t[i])&&wl(r)?t[i]=Ef(t[i],r):wl(r)?t[i]=Ef({},r):Ui(r)?t[i]=r.slice():t[i]=r};for(let r=0,o=arguments.length;r(pa(t,(o,i)=>{n&&Wt(o)?e[i]=ev(o,n):e[i]=o},{allOwnKeys:r}),e),wk=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),bk=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},jk=(e,t,n,r)=>{let o,i,a;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),i=o.length;i-- >0;)a=o[i],(!r||r(a,e,t))&&!l[a]&&(t[a]=e[a],l[a]=!0);e=n!==!1&&Qp(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Ck=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Sk=e=>{if(!e)return null;if(Ui(e))return e;let t=e.length;if(!nv(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},kk=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Qp(Uint8Array)),Pk=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const i=o.value;t.call(e,i[0],i[1])}},Ek=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Rk=gn("HTMLFormElement"),Ak=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),mg=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Ik=gn("RegExp"),iv=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};pa(n,(o,i)=>{let a;(a=t(o,i,e))!==!1&&(r[i]=a||o)}),Object.defineProperties(e,r)},Dk=e=>{iv(e,(t,n)=>{if(Wt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Wt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ok=(e,t)=>{const n={},r=o=>{o.forEach(i=>{n[i]=!0})};return Ui(e)?r(e):r(String(e).split(t)),n},Tk=()=>{},Nk=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Au="abcdefghijklmnopqrstuvwxyz",gg="0123456789",sv={DIGIT:gg,ALPHA:Au,ALPHA_DIGIT:Au+Au.toUpperCase()+gg},Lk=(e=16,t=sv.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function _k(e){return!!(e&&Wt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Mk=e=>{const t=new Array(10),n=(r,o)=>{if(Lc(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const i=Ui(r)?[]:{};return pa(r,(a,l)=>{const u=n(a,o+1);!Xs(u)&&(i[l]=u)}),t[o]=void 0,i}}return r};return n(e,0)},$k=gn("AsyncFunction"),zk=e=>e&&(Lc(e)||Wt(e))&&Wt(e.then)&&Wt(e.catch),av=((e,t)=>e?setImmediate:t?((n,r)=>(oo.addEventListener("message",({source:o,data:i})=>{o===oo&&i===n&&r.length&&r.shift()()},!1),o=>{r.push(o),oo.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Wt(oo.postMessage)),Fk=typeof queueMicrotask<"u"?queueMicrotask.bind(oo):typeof process<"u"&&process.nextTick||av,T={isArray:Ui,isArrayBuffer:tv,isBuffer:rk,isFormData:fk,isArrayBufferView:ok,isString:ik,isNumber:nv,isBoolean:sk,isObject:Lc,isPlainObject:wl,isReadableStream:hk,isRequest:mk,isResponse:gk,isHeaders:xk,isUndefined:Xs,isDate:ak,isFile:lk,isBlob:ck,isRegExp:Ik,isFunction:Wt,isStream:dk,isURLSearchParams:pk,isTypedArray:kk,isFileList:uk,forEach:pa,merge:Ef,extend:vk,trim:yk,stripBOM:wk,inherits:bk,toFlatObject:jk,kindOf:Tc,kindOfTest:gn,endsWith:Ck,toArray:Sk,forEachEntry:Pk,matchAll:Ek,isHTMLForm:Rk,hasOwnProperty:mg,hasOwnProp:mg,reduceDescriptors:iv,freezeMethods:Dk,toObjectSet:Ok,toCamelCase:Ak,noop:Tk,toFiniteNumber:Nk,findKey:rv,global:oo,isContextDefined:ov,ALPHABET:sv,generateString:Lk,isSpecCompliantForm:_k,toJSONObject:Mk,isAsyncFn:$k,isThenable:zk,setImmediate:av,asap:Fk};function ce(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}T.inherits(ce,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:T.toJSONObject(this.config),code:this.code,status:this.status}}});const lv=ce.prototype,cv={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{cv[e]={value:e}});Object.defineProperties(ce,cv);Object.defineProperty(lv,"isAxiosError",{value:!0});ce.from=(e,t,n,r,o,i)=>{const a=Object.create(lv);return T.toFlatObject(e,a,function(u){return u!==Error.prototype},l=>l!=="isAxiosError"),ce.call(a,e.message,t,n,r,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};const Uk=null;function Rf(e){return T.isPlainObject(e)||T.isArray(e)}function uv(e){return T.endsWith(e,"[]")?e.slice(0,-2):e}function xg(e,t,n){return e?e.concat(t).map(function(o,i){return o=uv(o),!n&&i?"["+o+"]":o}).join(n?".":""):t}function Bk(e){return T.isArray(e)&&!e.some(Rf)}const Wk=T.toFlatObject(T,{},null,function(t){return/^is[A-Z]/.test(t)});function _c(e,t,n){if(!T.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=T.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,j){return!T.isUndefined(j[x])});const r=n.metaTokens,o=n.visitor||p,i=n.dots,a=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&T.isSpecCompliantForm(t);if(!T.isFunction(o))throw new TypeError("visitor must be a function");function d(y){if(y===null)return"";if(T.isDate(y))return y.toISOString();if(!u&&T.isBlob(y))throw new ce("Blob is not supported. Use a Buffer instead.");return T.isArrayBuffer(y)||T.isTypedArray(y)?u&&typeof Blob=="function"?new Blob([y]):Buffer.from(y):y}function p(y,x,j){let g=y;if(y&&!j&&typeof y=="object"){if(T.endsWith(x,"{}"))x=r?x:x.slice(0,-2),y=JSON.stringify(y);else if(T.isArray(y)&&Bk(y)||(T.isFileList(y)||T.endsWith(x,"[]"))&&(g=T.toArray(y)))return x=uv(x),g.forEach(function(v,C){!(T.isUndefined(v)||v===null)&&t.append(a===!0?xg([x],C,i):a===null?x:x+"[]",d(v))}),!1}return Rf(y)?!0:(t.append(xg(j,x,i),d(y)),!1)}const f=[],h=Object.assign(Wk,{defaultVisitor:p,convertValue:d,isVisitable:Rf});function b(y,x){if(!T.isUndefined(y)){if(f.indexOf(y)!==-1)throw Error("Circular reference detected in "+x.join("."));f.push(y),T.forEach(y,function(g,m){(!(T.isUndefined(g)||g===null)&&o.call(t,g,T.isString(m)?m.trim():m,x,h))===!0&&b(g,x?x.concat(m):[m])}),f.pop()}}if(!T.isObject(e))throw new TypeError("data must be an object");return b(e),t}function yg(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Kp(e,t){this._pairs=[],e&&_c(e,this,t)}const dv=Kp.prototype;dv.append=function(t,n){this._pairs.push([t,n])};dv.toString=function(t){const n=t?function(r){return t.call(this,r,yg)}:yg;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Hk(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function fv(e,t,n){if(!t)return e;const r=n&&n.encode||Hk,o=n&&n.serialize;let i;if(o?i=o(t,n):i=T.isURLSearchParams(t)?t.toString():new Kp(t,n).toString(r),i){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+i}return e}class vg{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){T.forEach(this.handlers,function(r){r!==null&&t(r)})}}const pv={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Vk=typeof URLSearchParams<"u"?URLSearchParams:Kp,Qk=typeof FormData<"u"?FormData:null,Kk=typeof Blob<"u"?Blob:null,Gk={isBrowser:!0,classes:{URLSearchParams:Vk,FormData:Qk,Blob:Kk},protocols:["http","https","file","blob","url","data"]},Gp=typeof window<"u"&&typeof document<"u",Af=typeof navigator=="object"&&navigator||void 0,qk=Gp&&(!Af||["ReactNative","NativeScript","NS"].indexOf(Af.product)<0),Yk=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Jk=Gp&&window.location.href||"http://localhost",Xk=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Gp,hasStandardBrowserEnv:qk,hasStandardBrowserWebWorkerEnv:Yk,navigator:Af,origin:Jk},Symbol.toStringTag,{value:"Module"})),Nt={...Xk,...Gk};function Zk(e,t){return _c(e,new Nt.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,i){return Nt.isNode&&T.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)}},t))}function eP(e){return T.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function tP(e){const t={},n=Object.keys(e);let r;const o=n.length;let i;for(r=0;r=n.length;return a=!a&&T.isArray(o)?o.length:a,u?(T.hasOwnProp(o,a)?o[a]=[o[a],r]:o[a]=r,!l):((!o[a]||!T.isObject(o[a]))&&(o[a]=[]),t(n,r,o[a],i)&&T.isArray(o[a])&&(o[a]=tP(o[a])),!l)}if(T.isFormData(e)&&T.isFunction(e.entries)){const n={};return T.forEachEntry(e,(r,o)=>{t(eP(r),o,n,0)}),n}return null}function nP(e,t,n){if(T.isString(e))try{return(t||JSON.parse)(e),T.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const ha={transitional:pv,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,i=T.isObject(t);if(i&&T.isHTMLForm(t)&&(t=new FormData(t)),T.isFormData(t))return o?JSON.stringify(hv(t)):t;if(T.isArrayBuffer(t)||T.isBuffer(t)||T.isStream(t)||T.isFile(t)||T.isBlob(t)||T.isReadableStream(t))return t;if(T.isArrayBufferView(t))return t.buffer;if(T.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Zk(t,this.formSerializer).toString();if((l=T.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return _c(l?{"files[]":t}:t,u&&new u,this.formSerializer)}}return i||o?(n.setContentType("application/json",!1),nP(t)):t}],transformResponse:[function(t){const n=this.transitional||ha.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(T.isResponse(t)||T.isReadableStream(t))return t;if(t&&T.isString(t)&&(r&&!this.responseType||o)){const a=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(l){if(a)throw l.name==="SyntaxError"?ce.from(l,ce.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Nt.classes.FormData,Blob:Nt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};T.forEach(["delete","get","head","post","put","patch"],e=>{ha.headers[e]={}});const rP=T.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),oP=e=>{const t={};let n,r,o;return e&&e.split(` -`).forEach(function(a){o=a.indexOf(":"),n=a.substring(0,o).trim().toLowerCase(),r=a.substring(o+1).trim(),!(!n||t[n]&&rP[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},wg=Symbol("internals");function is(e){return e&&String(e).trim().toLowerCase()}function bl(e){return e===!1||e==null?e:T.isArray(e)?e.map(bl):String(e)}function iP(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const sP=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Iu(e,t,n,r,o){if(T.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!T.isString(t)){if(T.isString(r))return t.indexOf(r)!==-1;if(T.isRegExp(r))return r.test(t)}}function aP(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function lP(e,t){const n=T.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,i,a){return this[r].call(this,t,o,i,a)},configurable:!0})})}class Lt{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function i(l,u,d){const p=is(u);if(!p)throw new Error("header name must be a non-empty string");const f=T.findKey(o,p);(!f||o[f]===void 0||d===!0||d===void 0&&o[f]!==!1)&&(o[f||u]=bl(l))}const a=(l,u)=>T.forEach(l,(d,p)=>i(d,p,u));if(T.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(T.isString(t)&&(t=t.trim())&&!sP(t))a(oP(t),n);else if(T.isHeaders(t))for(const[l,u]of t.entries())i(u,l,r);else t!=null&&i(n,t,r);return this}get(t,n){if(t=is(t),t){const r=T.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return iP(o);if(T.isFunction(n))return n.call(this,o,r);if(T.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=is(t),t){const r=T.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Iu(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function i(a){if(a=is(a),a){const l=T.findKey(r,a);l&&(!n||Iu(r,r[l],l,n))&&(delete r[l],o=!0)}}return T.isArray(t)?t.forEach(i):i(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const i=n[r];(!t||Iu(this,this[i],i,t,!0))&&(delete this[i],o=!0)}return o}normalize(t){const n=this,r={};return T.forEach(this,(o,i)=>{const a=T.findKey(r,i);if(a){n[a]=bl(o),delete n[i];return}const l=t?aP(i):String(i).trim();l!==i&&delete n[i],n[l]=bl(o),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return T.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&T.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` -`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[wg]=this[wg]={accessors:{}}).accessors,o=this.prototype;function i(a){const l=is(a);r[l]||(lP(o,a),r[l]=!0)}return T.isArray(t)?t.forEach(i):i(t),this}}Lt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);T.reduceDescriptors(Lt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});T.freezeMethods(Lt);function Du(e,t){const n=this||ha,r=t||n,o=Lt.from(r.headers);let i=r.data;return T.forEach(e,function(l){i=l.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function mv(e){return!!(e&&e.__CANCEL__)}function Bi(e,t,n){ce.call(this,e??"canceled",ce.ERR_CANCELED,t,n),this.name="CanceledError"}T.inherits(Bi,ce,{__CANCEL__:!0});function gv(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new ce("Request failed with status code "+n.status,[ce.ERR_BAD_REQUEST,ce.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function cP(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function uP(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,a;return t=t!==void 0?t:1e3,function(u){const d=Date.now(),p=r[i];a||(a=d),n[o]=u,r[o]=d;let f=i,h=0;for(;f!==o;)h+=n[f++],f=f%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),d-a{n=p,o=null,i&&(clearTimeout(i),i=null),e.apply(null,d)};return[(...d)=>{const p=Date.now(),f=p-n;f>=r?a(d,p):(o=d,i||(i=setTimeout(()=>{i=null,a(o)},r-f)))},()=>o&&a(o)]}const nc=(e,t,n=3)=>{let r=0;const o=uP(50,250);return dP(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,u=a-r,d=o(u),p=a<=l;r=a;const f={loaded:a,total:l,progress:l?a/l:void 0,bytes:u,rate:d||void 0,estimated:d&&l&&p?(l-a)/d:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},bg=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},jg=e=>(...t)=>T.asap(()=>e(...t)),fP=Nt.hasStandardBrowserEnv?function(){const t=Nt.navigator&&/(msie|trident)/i.test(Nt.navigator.userAgent),n=document.createElement("a");let r;function o(i){let a=i;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(a){const l=T.isString(a)?o(a):a;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}(),pP=Nt.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];T.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),T.isString(r)&&a.push("path="+r),T.isString(o)&&a.push("domain="+o),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function hP(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function mP(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function xv(e,t){return e&&!hP(t)?mP(e,t):t}const Cg=e=>e instanceof Lt?{...e}:e;function ko(e,t){t=t||{};const n={};function r(d,p,f){return T.isPlainObject(d)&&T.isPlainObject(p)?T.merge.call({caseless:f},d,p):T.isPlainObject(p)?T.merge({},p):T.isArray(p)?p.slice():p}function o(d,p,f){if(T.isUndefined(p)){if(!T.isUndefined(d))return r(void 0,d,f)}else return r(d,p,f)}function i(d,p){if(!T.isUndefined(p))return r(void 0,p)}function a(d,p){if(T.isUndefined(p)){if(!T.isUndefined(d))return r(void 0,d)}else return r(void 0,p)}function l(d,p,f){if(f in t)return r(d,p);if(f in e)return r(void 0,d)}const u={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(d,p)=>o(Cg(d),Cg(p),!0)};return T.forEach(Object.keys(Object.assign({},e,t)),function(p){const f=u[p]||o,h=f(e[p],t[p],p);T.isUndefined(h)&&f!==l||(n[p]=h)}),n}const yv=e=>{const t=ko({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:l}=t;t.headers=a=Lt.from(a),t.url=fv(xv(t.baseURL,t.url),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(T.isFormData(n)){if(Nt.hasStandardBrowserEnv||Nt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((u=a.getContentType())!==!1){const[d,...p]=u?u.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([d||"multipart/form-data",...p].join("; "))}}if(Nt.hasStandardBrowserEnv&&(r&&T.isFunction(r)&&(r=r(t)),r||r!==!1&&fP(t.url))){const d=o&&i&&pP.read(i);d&&a.set(o,d)}return t},gP=typeof XMLHttpRequest<"u",xP=gP&&function(e){return new Promise(function(n,r){const o=yv(e);let i=o.data;const a=Lt.from(o.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:d}=o,p,f,h,b,y;function x(){b&&b(),y&&y(),o.cancelToken&&o.cancelToken.unsubscribe(p),o.signal&&o.signal.removeEventListener("abort",p)}let j=new XMLHttpRequest;j.open(o.method.toUpperCase(),o.url,!0),j.timeout=o.timeout;function g(){if(!j)return;const v=Lt.from("getAllResponseHeaders"in j&&j.getAllResponseHeaders()),P={data:!l||l==="text"||l==="json"?j.responseText:j.response,status:j.status,statusText:j.statusText,headers:v,config:e,request:j};gv(function(R){n(R),x()},function(R){r(R),x()},P),j=null}"onloadend"in j?j.onloadend=g:j.onreadystatechange=function(){!j||j.readyState!==4||j.status===0&&!(j.responseURL&&j.responseURL.indexOf("file:")===0)||setTimeout(g)},j.onabort=function(){j&&(r(new ce("Request aborted",ce.ECONNABORTED,e,j)),j=null)},j.onerror=function(){r(new ce("Network Error",ce.ERR_NETWORK,e,j)),j=null},j.ontimeout=function(){let C=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const P=o.transitional||pv;o.timeoutErrorMessage&&(C=o.timeoutErrorMessage),r(new ce(C,P.clarifyTimeoutError?ce.ETIMEDOUT:ce.ECONNABORTED,e,j)),j=null},i===void 0&&a.setContentType(null),"setRequestHeader"in j&&T.forEach(a.toJSON(),function(C,P){j.setRequestHeader(P,C)}),T.isUndefined(o.withCredentials)||(j.withCredentials=!!o.withCredentials),l&&l!=="json"&&(j.responseType=o.responseType),d&&([h,y]=nc(d,!0),j.addEventListener("progress",h)),u&&j.upload&&([f,b]=nc(u),j.upload.addEventListener("progress",f),j.upload.addEventListener("loadend",b)),(o.cancelToken||o.signal)&&(p=v=>{j&&(r(!v||v.type?new Bi(null,e,j):v),j.abort(),j=null)},o.cancelToken&&o.cancelToken.subscribe(p),o.signal&&(o.signal.aborted?p():o.signal.addEventListener("abort",p)));const m=cP(o.url);if(m&&Nt.protocols.indexOf(m)===-1){r(new ce("Unsupported protocol "+m+":",ce.ERR_BAD_REQUEST,e));return}j.send(i||null)})},yP=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const i=function(d){if(!o){o=!0,l();const p=d instanceof Error?d:this.reason;r.abort(p instanceof ce?p:new Bi(p instanceof Error?p.message:p))}};let a=t&&setTimeout(()=>{a=null,i(new ce(`timeout ${t} of ms exceeded`,ce.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(i):d.removeEventListener("abort",i)}),e=null)};e.forEach(d=>d.addEventListener("abort",i));const{signal:u}=r;return u.unsubscribe=()=>T.asap(l),u}},vP=function*(e,t){let n=e.byteLength;if(n{const o=wP(e,t);let i=0,a,l=u=>{a||(a=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:d,value:p}=await o.next();if(d){l(),u.close();return}let f=p.byteLength;if(n){let h=i+=f;n(h)}u.enqueue(new Uint8Array(p))}catch(d){throw l(d),d}},cancel(u){return l(u),o.return()}},{highWaterMark:2})},Mc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",vv=Mc&&typeof ReadableStream=="function",jP=Mc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),wv=(e,...t)=>{try{return!!e(...t)}catch{return!1}},CP=vv&&wv(()=>{let e=!1;const t=new Request(Nt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),kg=64*1024,If=vv&&wv(()=>T.isReadableStream(new Response("").body)),rc={stream:If&&(e=>e.body)};Mc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!rc[t]&&(rc[t]=T.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new ce(`Response type '${t}' is not supported`,ce.ERR_NOT_SUPPORT,r)})})})(new Response);const SP=async e=>{if(e==null)return 0;if(T.isBlob(e))return e.size;if(T.isSpecCompliantForm(e))return(await new Request(Nt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(T.isArrayBufferView(e)||T.isArrayBuffer(e))return e.byteLength;if(T.isURLSearchParams(e)&&(e=e+""),T.isString(e))return(await jP(e)).byteLength},kP=async(e,t)=>{const n=T.toFiniteNumber(e.getContentLength());return n??SP(t)},PP=Mc&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:l,onUploadProgress:u,responseType:d,headers:p,withCredentials:f="same-origin",fetchOptions:h}=yv(e);d=d?(d+"").toLowerCase():"text";let b=yP([o,i&&i.toAbortSignal()],a),y;const x=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let j;try{if(u&&CP&&n!=="get"&&n!=="head"&&(j=await kP(p,r))!==0){let P=new Request(t,{method:"POST",body:r,duplex:"half"}),S;if(T.isFormData(r)&&(S=P.headers.get("content-type"))&&p.setContentType(S),P.body){const[R,I]=bg(j,nc(jg(u)));r=Sg(P.body,kg,R,I)}}T.isString(f)||(f=f?"include":"omit");const g="credentials"in Request.prototype;y=new Request(t,{...h,signal:b,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:g?f:void 0});let m=await fetch(y);const v=If&&(d==="stream"||d==="response");if(If&&(l||v&&x)){const P={};["status","statusText","headers"].forEach(L=>{P[L]=m[L]});const S=T.toFiniteNumber(m.headers.get("content-length")),[R,I]=l&&bg(S,nc(jg(l),!0))||[];m=new Response(Sg(m.body,kg,R,()=>{I&&I(),x&&x()}),P)}d=d||"text";let C=await rc[T.findKey(rc,d)||"text"](m,e);return!v&&x&&x(),await new Promise((P,S)=>{gv(P,S,{data:C,headers:Lt.from(m.headers),status:m.status,statusText:m.statusText,config:e,request:y})})}catch(g){throw x&&x(),g&&g.name==="TypeError"&&/fetch/i.test(g.message)?Object.assign(new ce("Network Error",ce.ERR_NETWORK,e,y),{cause:g.cause||g}):ce.from(g,g&&g.code,e,y)}}),Df={http:Uk,xhr:xP,fetch:PP};T.forEach(Df,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Pg=e=>`- ${e}`,EP=e=>T.isFunction(e)||e===null||e===!1,bv={getAdapter:e=>{e=T.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let a=t?i.length>1?`since : -`+i.map(Pg).join(` -`):" "+Pg(i[0]):"as no adapter specified";throw new ce("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:Df};function Ou(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Bi(null,e)}function Eg(e){return Ou(e),e.headers=Lt.from(e.headers),e.data=Du.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),bv.getAdapter(e.adapter||ha.adapter)(e).then(function(r){return Ou(e),r.data=Du.call(e,e.transformResponse,r),r.headers=Lt.from(r.headers),r},function(r){return mv(r)||(Ou(e),r&&r.response&&(r.response.data=Du.call(e,e.transformResponse,r.response),r.response.headers=Lt.from(r.response.headers))),Promise.reject(r)})}const jv="1.7.7",qp={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{qp[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Rg={};qp.transitional=function(t,n,r){function o(i,a){return"[Axios v"+jv+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,l)=>{if(t===!1)throw new ce(o(a," has been removed"+(n?" in "+n:"")),ce.ERR_DEPRECATED);return n&&!Rg[a]&&(Rg[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,l):!0}};function RP(e,t,n){if(typeof e!="object")throw new ce("options must be an object",ce.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const l=e[i],u=l===void 0||a(l,i,e);if(u!==!0)throw new ce("option "+i+" must be "+u,ce.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ce("Unknown option "+i,ce.ERR_BAD_OPTION)}}const Of={assertOptions:RP,validators:qp},or=Of.validators;class go{constructor(t){this.defaults=t,this.interceptors={request:new vg,response:new vg}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` -`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ko(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Of.assertOptions(r,{silentJSONParsing:or.transitional(or.boolean),forcedJSONParsing:or.transitional(or.boolean),clarifyTimeoutError:or.transitional(or.boolean)},!1),o!=null&&(T.isFunction(o)?n.paramsSerializer={serialize:o}:Of.assertOptions(o,{encode:or.function,serialize:or.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&T.merge(i.common,i[n.method]);i&&T.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=Lt.concat(a,i);const l=[];let u=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(n)===!1||(u=u&&x.synchronous,l.unshift(x.fulfilled,x.rejected))});const d=[];this.interceptors.response.forEach(function(x){d.push(x.fulfilled,x.rejected)});let p,f=0,h;if(!u){const y=[Eg.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,d),h=y.length,p=Promise.resolve(n);f{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(l=>{r.subscribe(l),i=l}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,l){r.reason||(r.reason=new Bi(i,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Yp(function(o){t=o}),cancel:t}}}function AP(e){return function(n){return e.apply(null,n)}}function IP(e){return T.isObject(e)&&e.isAxiosError===!0}const Tf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Tf).forEach(([e,t])=>{Tf[t]=e});function Cv(e){const t=new go(e),n=ev(go.prototype.request,t);return T.extend(n,go.prototype,t,{allOwnKeys:!0}),T.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Cv(ko(e,o))},n}const Xe=Cv(ha);Xe.Axios=go;Xe.CanceledError=Bi;Xe.CancelToken=Yp;Xe.isCancel=mv;Xe.VERSION=jv;Xe.toFormData=_c;Xe.AxiosError=ce;Xe.Cancel=Xe.CanceledError;Xe.all=function(t){return Promise.all(t)};Xe.spread=AP;Xe.isAxiosError=IP;Xe.mergeConfig=ko;Xe.AxiosHeaders=Lt;Xe.formToJSON=e=>hv(T.isHTMLForm(e)?new FormData(e):e);Xe.getAdapter=bv.getAdapter;Xe.HttpStatusCode=Tf;Xe.default=Xe;const re=Xe.create({baseURL:"http://15.164.5.135:8080",timeout:5e3,headers:{"Content-Type":"application/json"}});re.interceptors.request.use(e=>{const t=localStorage.getItem("token");return t&&(e.headers.Authorization=`Bearer ${t}`),e});const DP=async e=>{try{const t=`/goodbuyUs/product?postid=${e}`;return(await re.get(t)).data}catch{throw new Error("상품 정보를 가져오는 데 실패했습니다.")}},OP=async()=>{try{return(await re.get("/goodbuyUs")).data}catch{throw new Error("상품 정보를 가져오는 데 실패했습니다.")}},ma=e=>Vp({queryKey:["product",e],queryFn:()=>DP(e)}),Sv=()=>Vp({queryKey:["products"],queryFn:OP}),Ro=({isLoading:e,isError:t,children:n})=>e?s.jsx("div",{children:"로딩 중..."}):t?s.jsx("div",{children:"잠시 후 다시 시도해주세요."}):s.jsx(s.Fragment,{children:n}),TP=({popular:e,category:t})=>{if(!e)return s.jsx("div",{children:"No popular product available"});const{data:n,isLoading:r,isError:o}=ma(e.id);return n?s.jsx(s.Fragment,{children:s.jsx(Ro,{isLoading:r,isError:o,children:s.jsx(NP,{children:s.jsxs(LP,{children:[s.jsx(_P,{children:s.jsx(MP,{src:n.url||In,alt:n.name,onError:i=>{i.currentTarget.src=In}})}),s.jsxs($P,{children:[s.jsx(zP,{children:s.jsx(da,{rating:n.rating})}),s.jsxs(FP,{children:[s.jsxs(UP,{children:[s.jsx(BP,{children:n.name}),s.jsx(WP,{children:t})]}),s.jsx(HP,{children:n.description})]})]})]})})})}):s.jsx("div",{children:"Product data is not available"})},NP=c.div` - width: 80%; - margin: 0 auto; - display: block; -`,LP=c.div` - height: 300px; - width: 1100px; - display: flex; - background-color: #f5f5f5; - border-radius: 12px; - overflow: hidden; - box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); - transition: all 0.3s ease-in-out; - &:hover { - cursor: pointer; - transform: translateY(-5px); - } - @media (min-width: 768px) and (max-width: 1024px) { - width: 750px; - height: 300px; - } - @media (min-width: 576px) and (max-width: 767px) { - width: 550px; - height: 200px; - } -`,_P=c.div` - width: 300px; - height: 300px; - display: flex; - justify-content: center; - align-items: center; - background-color: white; - @media (min-width: 576px) and (max-width: 767px) { - width: 200px; - height: 200px; - } -`,MP=c.img` - height: 300px; - width: auto; - object-fit: contain; -`,$P=c.div` - background: linear-gradient(to top, rgba(155, 155, 155, 0.7), transparent); - flex-grow: 1; - display: flex; - flex-direction: column; - justify-content: center; - padding: 0 50px; - background-color: #f5f5f5; - position: relative; -`,zP=c.div` - position: absolute; - top: 20px; - right: 20px; - font-size: 20px; - @media (min-width: 576px) and (max-width: 767px) { - font-size: 15px; - top: 10px; - } -`,FP=c.div` - display: flex; - flex-direction: column; - width: 100%; -`,UP=c.div` - display: flex; - align-items: baseline; - margin-bottom: 15px; - @media (min-width: 768px) and (max-width: 1024px) { - flex-direction: column; - } - @media (min-width: 576px) and (max-width: 767px) { - flex-direction: column; - } -`,BP=c.h3` - font-size: 24px; - font-weight: 700; - color: #333; - margin-right: 15px; - @media (min-width: 576px) and (max-width: 767px) { - font-size: 19px; - } -`,WP=c.p` - font-size: 16px; - color: #666; - @media (min-width: 768px) and (max-width: 1024px) { - margin-top: -10px; - } - @media (min-width: 576px) and (max-width: 767px) { - font-size: 12px; - } -`,HP=c.p` - font-size: 14px; - color: #555; - line-height: 1.6; - display: -webkit-box; - -webkit-line-clamp: 3; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; - @media (min-width: 768px) and (max-width: 1024px) { - display: -webkit-box; - -webkit-line-clamp: 2; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; - } - @media (min-width: 576px) and (max-width: 767px) { - display: none; - } -`,VP=({categories:e,products:t})=>{if(!t)return s.jsx("div",{children:"No products available"});const[n,r]=w.useState(!1),[o,i]=w.useState("LIFESTYLE"),a=()=>r(!n),l=p=>{i(p),r(!1)},u=w.useMemo(()=>(t==null?void 0:t.filter(p=>p.category.toLowerCase().includes(o.toLowerCase())))||[],[o,t]),d=w.useMemo(()=>[...u].sort(()=>.5-Math.random()).slice(0,8),[u]);return s.jsxs(QP,{children:[s.jsxs(b2,{children:[s.jsx(KP,{onClick:a,children:o}),s.jsx(j2,{expanded:n,children:e.map(p=>s.jsx(C2,{selected:p==o,onClick:()=>l(p),children:p},p))})]}),s.jsx(R1,{children:d.map(p=>s.jsxs(A1,{children:[s.jsxs(I1,{to:`/products/${p.id}`,children:[s.jsx(D1,{src:p.url||In,alt:p.name,onError:f=>{f.currentTarget.src=In}}),s.jsxs(O1,{children:[s.jsx(T1,{children:p.name}),s.jsxs(N1,{children:[" ",s.jsx(da,{rating:p.rating})]}),s.jsxs(L1,{children:[s.jsxs(_1,{children:[p.originalprice,"원"]}),s.jsxs(M1,{children:[p.discountprice,"원"]})]})]})]}),s.jsx($1,{likes:p.likes})]},p.id))}),s.jsx(z1,{children:s.jsx(F1,{to:`/products?category=${o}`,children:"더보기"})})]})},QP=c.div` - display: flex; - flex-wrap: wrap; - width: 80%; - height: auto; - margin: 0 auto; -`,KP=c.h2` - text-decoration: underline; - margin-left: 10px; - margin-bottom: 20px; - font-size: 1.5rem; - color: #333; - &:hover { - cursor: pointer; - } -`;var kv={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Ag=ut.createContext&&ut.createContext(kv),GP=["attr","size","title"];function qP(e,t){if(e==null)return{};var n=YP(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function YP(e,t){if(e==null)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}function oc(){return oc=Object.assign?Object.assign.bind():function(e){for(var t=1;tut.createElement(t.tag,ic({key:n},t.attr),Pv(t.child)))}function xn(e){return t=>ut.createElement(eE,oc({attr:ic({},e.attr)},t),Pv(e.child))}function eE(e){var t=n=>{var{attr:r,size:o,title:i}=e,a=qP(e,GP),l=o||n.size||"1em",u;return n.className&&(u=n.className),e.className&&(u=(u?u+" ":"")+e.className),ut.createElement("svg",oc({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:u,style:ic(ic({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),i&&ut.createElement("title",null,i),e.children)};return Ag!==void 0?ut.createElement(Ag.Consumer,null,n=>t(n)):t(kv)}function tE(e){return xn({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M177 255.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 351.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 425.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1zm-34-192L7 199.7c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l96.4-96.4 96.4 96.4c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9l-136-136c-9.2-9.4-24.4-9.4-33.8 0z"},child:[]}]})(e)}function $c(e){return xn({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"},child:[]}]})(e)}function zc(e){return xn({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"},child:[]}]})(e)}function Jp(e){return xn({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M576 64H205.26A63.97 63.97 0 0 0 160 82.75L9.37 233.37c-12.5 12.5-12.5 32.76 0 45.25L160 429.25c12 12 28.28 18.75 45.25 18.75H576c35.35 0 64-28.65 64-64V128c0-35.35-28.65-64-64-64zm-84.69 254.06c6.25 6.25 6.25 16.38 0 22.63l-22.62 22.62c-6.25 6.25-16.38 6.25-22.63 0L384 301.25l-62.06 62.06c-6.25 6.25-16.38 6.25-22.63 0l-22.62-22.62c-6.25-6.25-6.25-16.38 0-22.63L338.75 256l-62.06-62.06c-6.25-6.25-6.25-16.38 0-22.63l22.62-22.62c6.25-6.25 16.38-6.25 22.63 0L384 210.75l62.06-62.06c6.25-6.25 16.38-6.25 22.63 0l22.62 22.62c6.25 6.25 6.25 16.38 0 22.63L429.25 256l62.06 62.06z"},child:[]}]})(e)}function Ev(e){return xn({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"},child:[]}]})(e)}function Xp(e){return xn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zM124 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H124z"},child:[]}]})(e)}function nE(e){return xn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"},child:[]}]})(e)}function Zp(e){return xn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"},child:[]}]})(e)}function rE(e){return xn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"},child:[]}]})(e)}function oE(e){return xn({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"},child:[]}]})(e)}function iE(e){return xn({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 32C114.6 32 0 125.1 0 240c0 47.6 19.9 91.2 52.9 126.3C38 405.7 7 439.1 6.5 439.5c-6.6 7-8.4 17.2-4.6 26S14.4 480 24 480c61.5 0 110-25.7 139.1-46.3C192 442.8 223.2 448 256 448c141.4 0 256-93.1 256-208S397.4 32 256 32zm0 368c-26.7 0-53.1-4.1-78.4-12.1l-22.7-7.2-19.5 13.8c-14.3 10.1-33.9 21.4-57.5 29 7.3-12.1 14.4-25.7 19.9-40.2l10.6-28.1-20.6-21.8C69.7 314.1 48 282.2 48 240c0-88.2 93.3-160 208-160s208 71.8 208 160-93.3 160-208 160z"},child:[]}]})(e)}const eh=()=>{const[e,t]=w.useState(!1);w.useEffect(()=>{const r=()=>{window.scrollY>200?t(!0):t(!1)};return window.addEventListener("scroll",r),()=>window.removeEventListener("scroll",r)},[]);const n=()=>{window.scrollTo({top:0,behavior:"smooth"})};return e?s.jsx(sE,{onClick:n,children:s.jsx(tE,{})}):null},sE=c.button` - position: fixed; - bottom: 20px; - right: 20px; - width: 50px; - height: 50px; - background-color: #000; - color: #fff; - border: 1px solid #333; - border-radius: 50%; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - cursor: pointer; - font-size: 1.5rem; - display: flex; - justify-content: center; - align-items: center; - transition: background-color 0.3s; - - &:hover { - background-color: #333; - } -`,aE=["FOOD","LIFESTYLE","FASHION"],lE=()=>{const{data:e,isLoading:t,isError:n}=Sv(),r=e==null?void 0:e.filter(i=>i.available===!0&&new Date(i.deadline)>new Date),o=r==null?void 0:r.sort((i,a)=>a.currentStock-i.currentStock)[0];return s.jsx(s.Fragment,{children:s.jsxs(Ro,{isLoading:t,isError:n,children:[s.jsx(Tu,{children:s.jsx(Nu,{children:s.jsxs(cE,{to:`/products/${o==null?void 0:o.id}`,children:[" ",s.jsx(TP,{popular:o,category:o==null?void 0:o.category})]})})}),s.jsx(Tu,{children:s.jsx(Nu,{children:s.jsx(S2,{products:r})})}),s.jsxs(Tu,{children:[s.jsx(Nu,{children:s.jsx(VP,{categories:aE,products:r})}),s.jsx(eh,{})]})]})})},cE=c(An)` - text-decoration: none; - color: inherit; - width: 100%; - &:link, - &:visited, - &:hover, - &:active { - color: inherit; - text-decoration: none; - } -`,Tu=c.div` - display: flex; - margin-top: 5vh; - align-items: center; - justify-content: center; - width: 100%; - max-width: 1400px; - margin-left: auto; - margin-right: auto; -`,Nu=c.div` - display: flex; - align-items: center; - width: 100%; -`,Fc=({categories:e,selectedCategory:t,onCategoryChange:n,title:r="카테고리"})=>{const[o,i]=w.useState(t);w.useEffect(()=>{i(t)},[t]);const a=l=>{i(l),n(l)};return s.jsxs(uE,{children:[s.jsx(dE,{children:r}),e.map(l=>s.jsx(fE,{active:l.id===o,onClick:()=>a(l.id),children:l.name},l.id))]})},uE=c.div` - display: flex; - flex-wrap: wrap; - gap: 5px 10px; - width: 100%; - justify-content: flex-start; - align-items: center; -`,dE=c.h2` - font-size: 1.2rem; - font-weight: bold; - margin: 0 50px 0 0; - white-space: nowrap; /* 텍스트 줄바꿈 방지 */ -`,fE=c.div` - padding: 1rem 1rem; - font-weight: ${({active:e})=>e?"bold":"normal"}; - cursor: pointer; - position: relative; - - &::after { - content: ''; - display: ${({active:e})=>e?"block":"none"}; - height: 2px; - background-color: black; - width: 100%; - position: absolute; - bottom: 0; - left: 0; - } -`,_t={NOT_APPROVED:"NOT_APPROVED",APPROVED:"APPROVED",REJECTED:"REJECTED",PAYMENT_STANDBY:"PAYMENT_STANDBY",PAYMENT_COMPLETED:"PAYMENT_COMPLETED",DELECTED:"DELECTED"},Rv={communityPostId:0,title:"",description:"",imageUrls:[],productUrl:"",userId:"",nickname:"",currentQuantity:0,availableNumber:0,createdAt:"",closeAt:"",period:0,totalAmount:0,unitAmount:0,category:"",participants:[],comments:[],status:"NOT_APPROVED",cancelledUsers:[]},pE=async(e,t)=>(await re.get("/post",{params:{category:e,search:t}})).data.filter(r=>r.status!=="DELECTED"),hE=async e=>(await re.post("/post",e)).data,sc=async(e,t,n)=>{const o=(await re.get(`/post/${e}`)).data;switch(t){case"APPROVED":if(o.status==="NOT_APPROVED"||o.status==="REJECTED"){const i=o.title.startsWith("(수정요망)")?o.title.replace(/^\(수정요망\)/,"").trim():o.title,a=new Date().toISOString(),l=new Date(new Date(a).getTime()+0*24*60*60*1e3).toISOString();return(await re.patch(`/post/${e}/status`,{status:t,title:i,createdAt:a,closeAt:l})).data}else throw new Error("현재 상태에서 APPROVED로 변경할 수 없습니다.");case"REJECTED":if(o.status==="NOT_APPROVED"||o.status==="REJECTED"){const i=o.title.startsWith("(수정요망)")?o.title:`(수정요망)${o.title}`;return(await re.patch(`/post/${e}/status`,{status:t,title:i})).data}else throw new Error("REJECTED 상태로 변경할 수 없습니다.");case"PAYMENT_STANDBY":if(o.status==="APPROVED"&&o.currentQuantity===o.availableNumber){const i=new Date().toISOString();return(await re.patch(`/post/${e}/status`,{status:t,stateUpdatedAt:i})).data}else throw new Error("PAYMENT_STANDBY 상태로 변경할 수 없습니다.");case"PAYMENT_COMPLETED":{if(o.participants.every(a=>a.isPaymentCompleted&&!a.isCancelled))return(await re.patch(`/post/${e}/status`,{status:t})).data;throw new Error("PAYMENT_COMPLETED 상태로 변경할 수 없습니다.")}case"DELECTED":{if(o.status==="APPROVED"||o.status==="PAYMENT_STANDBY")return(await re.patch(`/post/${e}/status`,{status:t})).data;throw new Error("DELETED 상태로 변경할 수 없습니다.")}default:throw new Error("잘못된 상태 변경 요청입니다.")}},si=async e=>(await re.get(`/post/${e}`)).data,mE=async(e,t)=>(await re.patch(`/mypage/post/${e}`,t)).data,Av=async e=>{await re.delete(`/post/${e}`)},gE=async(e,t,n)=>{await re.post(`/community/post/${e}/join`,{userId:t,quantity:n})},xE=async(e,t)=>{await re.post(`community/post/${e}/cancel`,{userId:t})},yE=async(e,t,n,r)=>{await re.post(`/post/${e}/comments`,{userId:t,userNickname:n,content:r})},vE=async(e,t)=>{await re.delete(`/post/${e}/comments/${t}`)},wE=async(e,t,n)=>{await re.put(`/post/${e}/comments/${t}`,{content:n})},bE=({onClick:e})=>s.jsxs(jE,{onClick:e,children:[s.jsx(nE,{})," 글 작성"]}),jE=c.button` - padding: 8px 16px; - font-size: 1rem; - font-weight: bold; - color: #fff; - background-color: #000; - border: none; - border-radius: 4px; - cursor: pointer; - - &:hover { - background-color: #333; - } -`,CE=({placeholder:e="검색어를 입력해주세요.",value:t,onChange:n,onSearch:r})=>{const o=i=>{i.key==="Enter"&&r()};return s.jsxs(SE,{children:[s.jsx(kE,{type:"text",placeholder:e,value:t,onChange:n,onKeyDown:o}),s.jsx(PE,{onClick:r})," "]})},SE=c.div` - display: flex; - align-items: center; - padding: 1.5px; - border: 1px solid #ddd; - border-radius: 4px; - background-color: #fff; - width: 100%; - max-width: 280px; - - &:focus-within { - border-color: #000; - } -`,kE=c.input` - flex: 1; - border: none; - font-size: 1rem; - padding: 8px; - outline: none; - - &::placeholder { - color: #aaa; - } -`,PE=c(rE)` - color: #333; - margin: 0 8px; - font-size: 1.2rem; - cursor: pointer; /* 클릭 가능 */ -`,th=({currentPage:e,totalPages:t,onPageChange:n})=>t<=1?null:s.jsx(EE,{children:Array.from({length:t},(r,o)=>s.jsx(RE,{active:e===o+1,onClick:()=>n(o+1),children:o+1},o+1))}),EE=c.div` - display: flex; - justify-content: center; - margin-top: 16px; - gap: 8px; -`,RE=c.button.withConfig({shouldForwardProp:e=>e!=="active"})` - padding: 8px 16px; - font-size: 1rem; - font-weight: 500; - border-radius: 8px; - border: 1px solid #fff; - background-color: ${({active:e})=>e?"#000":"#fff"}; - color: ${({active:e})=>e?"#fff":"#333"}; - cursor: pointer; - - &:hover { - background-color: #333; - color: #fff; - } -`,Lu=6,Iv=({selectedCategory:e,hideWriteButton:t})=>{const n=Ee(),[r,o]=w.useState([]),[i,a]=w.useState(1),[l,u]=w.useState(""),[d,p]=w.useState(""),[f,h]=w.useState(!1),b=async()=>{try{h(!0);const P=await pE(e,d);o(P)}catch(P){console.error("게시물 조회 중 오류 발생:",P),alert("게시물 조회 중 오류가 발생했습니다. 다시 시도해주세요.")}finally{h(!1)}};w.useEffect(()=>{b()},[e,d]);const y=r.filter(P=>e==="NOT_APPROVED"?P.status==="NOT_APPROVED"||P.status==="REJECTED":P.category===e&&P.status!=="NOT_APPROVED"&&P.status!=="REJECTED").sort((P,S)=>new Date(S.createdAt).getTime()-new Date(P.createdAt).getTime()),x=Math.ceil(y.length/Lu),j=(i-1)*Lu,g=y.slice(j,j+Lu),m=()=>{p(l),a(1)};w.useEffect(()=>{p(""),u(""),a(1)},[e]);const v=()=>{n("/community/post/create",{state:{selectedCategory:e}})},C=P=>{e==="NOT_APPROVED"?n(`/admin/post/approval/${P}`,{state:{communityPostId:P}}):n(`/community/post/${P}`)};return s.jsxs(AE,{children:[s.jsxs(IE,{children:[!t&&s.jsx(bE,{onClick:v}),s.jsx(CE,{value:l,onChange:P=>u(P.target.value),onSearch:m})]}),f?s.jsx(_u,{children:"게시물을 불러오는 중입니다..."}):y.length===0?s.jsx(_u,{children:"선택된 카테고리에 해당하는 게시글이 없습니다."}):g.length===0?s.jsxs(_u,{children:["'",d,"'의 검색 결과가 존재하지 않습니다."]}):g.map(P=>s.jsxs(DE,{onClick:()=>C(P.communityPostId),children:[s.jsx(OE,{src:P.imageUrls[0],alt:P.title}),s.jsxs(TE,{children:[s.jsx(NE,{children:P.title}),s.jsxs(_E,{children:[s.jsx(ME,{children:P.nickname}),s.jsxs($E,{children:[s.jsx(zE,{children:new Date(P.createdAt).toLocaleString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})}),"~",s.jsx(FE,{children:new Date(P.closeAt).toLocaleString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})})]}),s.jsxs(UE,{children:["참여 현황: ",P.currentQuantity," / ",P.availableNumber]})]}),s.jsx(LE,{children:P.description})]})]},P.communityPostId)),x>1&&s.jsx(th,{currentPage:i,totalPages:x,onPageChange:P=>a(P)})]})},AE=c.div` - display: flex; - flex-direction: column; - margin: 20px auto; - max-width: 800px; -`,IE=c.div` - display: flex; - justify-content: flex-end; /* 오른쪽 정렬 */ - align-items: center; - margin-bottom: 16px; - gap: 20px; /* 버튼과 검색바 사이의 간격 */ -`,DE=c.div` - display: flex; - flex-direction: row; - align-items: flex-start; - border: 1px solid #e0e0e0; - border-radius: 8px; - margin-bottom: 16px; - padding: 16px; - background-color: #fff; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); - transition: box-shadow 0.3s ease; - cursor: pointer; - - &:hover { - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); - } -`,OE=c.img` - width: 172px; - height: 100px; - object-fit: cover; - border-radius: 8px; - margin-right: 16px; -`,TE=c.div` - flex: 1; - display: flex; - flex-direction: column; - justify-content: space-between; - align-items: flex-start; - height: 100%; - padding: 4px 0; -`,NE=c.h3` - font-size: 1.4rem; - font-weight: 700; - margin-top: 0; - margin-bottom: 8px; - color: #333; - display: -webkit-box; - -webkit-line-clamp: 1; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; -`,LE=c.p` - font-size: 0.9rem; - margin-bottom: 0; - color: #555; - line-height: 1.5; - display: -webkit-box; - -webkit-line-clamp: 1; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; -`,_E=c.div` - display: flex; - flex-wrap: wrap; - gap: 15px; - font-size: 0.9rem; - color: #777; -`,ME=c.span` - font-weight: 400; -`,$E=c.span` - font-weight: 400; -`,zE=c.span` - font-weight: 400; - margin-right: 10px; -`,FE=c.span` - font-weight: 400; - margin-left: 10px; -`,UE=c.div` - font-weight: 400; -`,_u=c.p` - text-align: center; - color: #888; - font-size: 1.2rem; - padding: 20px; -`,nh=[{id:"LIFESTYLE",name:"생활용품"},{id:"FOOD",name:"식료품"},{id:"FASHION",name:"패션/의류"},{id:"ELECTRONICS",name:"전자제품"},{id:"FURNITURE",name:"가구/인테리어"},{id:"KIDS",name:"유아/아동용품"},{id:"SPORTS",name:"스포츠/레저"}],BE=()=>{var o;const t=((o=nt().state)==null?void 0:o.selectedCategory)||"LIFESTYLE",[n,r]=w.useState(t);return s.jsx("div",{children:s.jsx(WE,{children:s.jsxs(HE,{children:[s.jsx(VE,{children:"공구 모집 및 진행"}),s.jsx(QE,{children:s.jsx(Fc,{categories:nh,selectedCategory:n,onCategoryChange:i=>r(i)})}),s.jsx(Iv,{selectedCategory:n,posts:[]})]})})})},WE=c.div` - display: flex; - justify-content: center; - padding: 20px; -`,HE=c.div` - width: 100%; - max-width: 1120px; - margin: 0 auto; -`,VE=c.h1` - font-size: 1.8rem; - font-weight: bold; - margin-bottom: 1.5rem; - text-align: left; -`,QE=c.div` - display: flex; - justify-content: flex-end; - margin-left: 50px; -`,KE=()=>{var Ce;const e=Ee(),t=nt(),n=Oc(),r=((Ce=t.state)==null?void 0:Ce.selectedCategory)||"LIFESTYLE",[o,i]=w.useState(r),[a,l]=w.useState(""),[u,d]=w.useState(""),[p,f]=w.useState(!1),[h,b]=w.useState("마감 기한 "),[y,x]=w.useState(""),[j,g]=w.useState(""),[m,v]=w.useState([]),[C,P]=w.useState(-1),[S,R]=w.useState(""),[I,L]=w.useState(!1),B=Yr({mutationFn:M=>hE(M),onSuccess:()=>{n.invalidateQueries({queryKey:["postList"]}),alert("포스트가 작성되었습니다. 관리자의 승인을 대기 중입니다."),e("/community/post")},onError:M=>{console.error("포스트 생성 중 오류 발생:",M),alert("포스트 생성에 실패했습니다.")}}),N=()=>{f(!p)},O=M=>{b(M),f(!1)},$=async()=>{if(!y||!a||!u||h==="마감 기한"||m.length===0||!S||!j){alert("모든 필수 정보를 입력하세요.");return}if(!be(S)){L(!0);return}const M=parseInt(u.replace(/,/g,""),10),U=parseInt(a,10),ae=h!=="마감 기한"?parseInt(h.replace(/[^0-9]/g,""),10):0;if(ae<=0){alert("마감 기한을 올바르게 설정하세요.");return}const Ke={title:y.trim(),description:j.trim(),imageUrls:m,category:o,currentQuantity:0,availableNumber:U,totalAmount:M,unitAmount:Math.floor(M/U),productUrl:S.trim(),period:ae,status:"NOT_APPROVED"};B.mutate(Ke)},F=M=>{const U=M.target.value.replace(/[^0-9]/g,""),ae=Number(U);U===""||ae<=0?l(""):l(U)},se=M=>{const U=M.target.value.replace(/[^0-9]/g,""),ae=Number(U);U===""||ae<=0?d(""):d(oe(U))},he=()=>{e("/community/post",{state:{selectedCategory:o}})},oe=M=>{const U=M.replace(/\D/g,"");return new Intl.NumberFormat().format(Number(U))},W=u&&a?oe(String(Math.floor(parseInt(u.replace(/,/g,""),10)/parseInt(a,10)))):"자동 계산",H=M=>{if(M.target.files){const U=Array.from(M.target.files).map(ae=>URL.createObjectURL(ae));v(ae=>[...ae,...U]),P(m.length)}},X=()=>{C>=0&&v(M=>{const U=M.filter((ae,Ke)=>Ke!==C);if(U.length>0){const ae=C>=U.length?C-1:C;P(ae)}else P(-1);return U})},ie=()=>{CM+1):C===m.length-1&&P(-1)},ne=()=>{P(C===-1?m.length-1:M=>Math.max(M-1,0))},Ve=M=>{P(M)},be=M=>!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|(\\d{1,3}\\.){3}\\d{1,3})(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(M),Ne=M=>{R(M.target.value),L(!be(M.target.value))};return s.jsx("div",{children:s.jsx(GE,{children:s.jsxs(qE,{children:[s.jsx(YE,{children:"공구 모집 및 진행"}),s.jsxs(JE,{children:[s.jsxs(XE,{children:[s.jsxs(ZE,{children:[s.jsxs(e3,{children:[s.jsx(o3,{children:m.length>0&&(C>0||C===-1)&&s.jsx(s3,{onClick:ne,children:s.jsx($c,{size:20})})}),C===-1?s.jsxs(n3,{children:[s.jsx(Zp,{size:30}),"이미지 추가",s.jsx("input",{type:"file",multiple:!0,accept:"image/*",onChange:H})]}):s.jsxs(t3,{children:[s.jsx("img",{src:m[C],alt:"이미지 미리보기"}),s.jsx(r3,{onClick:X,children:s.jsx(Xp,{size:30})})]}),s.jsx(i3,{children:m.length>0&&C!==-1&&s.jsx(a3,{onClick:ie,children:s.jsx(zc,{size:20})})})]}),s.jsx(l3,{children:m.length>0&&s.jsx(c3,{children:m.map((M,U)=>s.jsx("span",{className:C===U?"active":"",onClick:()=>Ve(U)},U))})}),s.jsxs(u3,{children:[s.jsxs(d3,{children:[s.jsx(_o,{htmlFor:"urlInput",children:"URL 주소"}),s.jsx(f3,{id:"urlInput",type:"text",placeholder:"상품 관련 URL 주소를 입력해주세요.",value:S,onChange:Ne,isError:I,spellCheck:!1})]}),I&&s.jsx(p3,{children:"올바른 URL을 입력해주세요."})]})]}),s.jsxs(h3,{children:[s.jsxs(m3,{children:[s.jsxs(ss,{children:[s.jsx(_o,{children:"제목"}),s.jsx(g3,{placeholder:"제목을 입력해주세요.",value:y,onChange:M=>x(M.target.value),spellCheck:!1})]}),s.jsx(x3,{children:s.jsx(y3,{title:"카테고리 선택",categories:nh,selectedCategory:o,onCategoryChange:M=>i(M)})})]}),s.jsxs(v3,{children:[s.jsxs(ss,{children:[s.jsx(_o,{children:"참여 필요 수량 선택"}),s.jsx(Mu,{type:"text",placeholder:"수량 입력",value:a,onChange:F})]}),s.jsxs(ss,{children:[s.jsx(_o,{children:"모집 마감 기한 설정"}),s.jsxs(w3,{children:[s.jsxs(b3,{onClick:N,children:[h,s.jsx(Ev,{})]}),p&&s.jsx(j3,{children:Array.from({length:7},(M,U)=>s.jsxs(C3,{onClick:()=>O(`${U+1}일 `),isSelected:h===`${U+1}일 `,children:[U+1,"일"]},U))})]})]}),s.jsxs(S3,{children:[s.jsxs(ss,{children:[s.jsx(_o,{children:"총 가격 설정"}),s.jsx(Mu,{type:"text",placeholder:"총 가격 입력",value:u,onChange:se})," 원"]}),s.jsxs(ss,{children:[s.jsx(_o,{children:"개당 가격"}),s.jsx(Mu,{disabled:!0,value:W})," 원"]})]})]})]})]}),s.jsx(k3,{children:s.jsx(P3,{placeholder:"내용을 입력해주세요.",value:j,onChange:M=>g(M.target.value),spellCheck:!1})}),s.jsxs(E3,{children:[s.jsx(Dg,{onClick:$,children:"확인"}),s.jsx(Dg,{onClick:he,children:"취소"})]})]})]})})})},GE=c.div` - display: flex; - justify-content: center; - padding: 20px; -`,qE=c.div` - width: 100%; - max-width: 1120px; - margin: 0 auto; -`,YE=c.h1` - font-size: 1.8rem; - font-weight: bold; - margin-bottom: 1.5rem; - text-align: left; -`,JE=c.div` - display: flex; - flex-direction: column; /* 내부 요소를 세로로 정렬 */ - background: #fff; - padding: 20px; - border-radius: 10px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -`,XE=c.div` - display: flex; /* 가로 정렬 */ - flex-direction: row; /* 기본값이므로 명시적으로 추가 */ - align-items: stretch; /* 양쪽 요소의 높이를 동일하게 */ - justify-content: center; /* 양쪽 여백 균등 배치 */ - gap: 20px; /* 두 컨테이너 사이 간격 */ - margin-bottom: 20px; /* 아래 요소와의 간격 */ -`,ZE=c.div` - display: flex; - flex-direction: column; - align-items: center; - width: 490px; - height: 495px; /* 고정된 높이 설정 */ - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px 11px; - position: relative; - box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ -`,e3=c.div` - display: flex; - justify-content: space-between; /* 좌우 버튼 공간 확보 */ - align-items: center; /* 수직 중앙 정렬 */ - width: 100%; - height: 320px; /* 기준 높이 */ - position: relative; /* 자식 요소 위치 기준 */ - overflow: hidden; /* 높이를 벗어난 콘텐츠 숨김 */ -`,t3=c.div` - flex: 1; /* 이미지 영역이 버튼 사이에 위치 */ - display: flex; - align-items: center; - justify-content: center; - width: 400px; - height: 100%; - border: 1px solid #ccc; - border-radius: 10px; - overflow: hidden; /* 콘텐츠가 영역을 벗어나지 않도록 */ - - img { - max-width: 100%; /* 부모 너비를 넘지 않도록 */ - max-height: 100%; /* 부모 높이를 넘지 않도록 */ - object-fit: contain; /* 비율을 유지하며 부모 크기 안에 맞춤 */ - } -`,n3=c.label` - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: 1.2rem; - color: #555; - cursor: pointer; - border-radius: 10px; - width: 400px; /* img의 크기와 동일하게 설정 */ - height: 100%; /* img의 높이와 동일하게 설정 */ - background-color: #ececec; /* 요구된 배경색 추가 */ - - input { - display: none; - } -`,r3=c.button` - position: absolute; - top: 0px; - right: 45px; - background: none; - border: none; - padding: 8px; - cursor: pointer; - z-index: 1; -`,o3=c.div` - flex: 0 0 32px; /* 버튼 고정 너비 */ - display: flex; - justify-content: center; - align-items: center; - height: 100%; /* PreviewWrapper의 높이에 맞춤 */ -`,i3=c.div` - flex: 0 0 32px; /* 버튼 고정 너비 */ - display: flex; - justify-content: center; - align-items: center; - height: 100%; /* PreviewWrapper의 높이에 맞춤 */ -`,s3=c.button` - background: none; - border: none; - color: #333; - cursor: pointer; -`,a3=c.button` - background: none; - border: none; - color: #333; - cursor: pointer; -`,l3=c.div` - width: 100%; - height: 54px; /* 높이 설정 */ - display: flex; /* 플렉스 박스로 변경 */ - align-items: center; /* 세로 중앙 정렬 */ - justify-content: center; /* 가로 중앙 정렬 */ -`,c3=c.div` - display: flex; - justify-content: center; - gap: 5px; - - span { - width: 8px; - height: 8px; - border-radius: 50%; - background: #ddd; - cursor: pointer; - } - - span.active { - background: #000; - } -`,u3=c.div` - display: flex; - flex-direction: column; - align-items: flex-start; /* 세로로 가운데 정렬 */ - width: 100%; -`,d3=c.div` - margin-left: 20px; - display: flex; - align-items: center; /* Label과 Url을 같은 높이에 배치 */ - gap: 10px; /* Label과 Url 사이 간격 */ - padding: 10px; - border: none; -`,f3=c.input` - width: 285px; - flex: 1; - padding: 10px; - background-color: #ececec; - border: 1px solid ${({isError:e})=>e?"red":"#ccc"}; - border-radius: 5px; -`,p3=c.span` - margin-left: 125px; - color: red; - font-size: 0.8rem; - margin-top: 5px; -`,h3=c.div` - display: flex; - flex-direction: column; /* 세로 정렬 */ - align-items: flex-start; /* 왼쪽 정렬 */ - width: 490px; - height: 495px; /* ImageUploadContainer와 동일한 고정 높이 */ - flex-grow: 1; /* 가로 공간을 균등 분배 */ - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px; - gap: 20px; - box-sizing: border-box; -`,m3=c.div` - display: flex; - flex-direction: column; /* 세로 정렬 */ - gap: 20px; /* 컴포넌트 간 간격 */ - width: 100%; -`,ss=c.div` - display: flex; - flex-direction: row; /* 가로 배치 */ - align-items: center; /* 세로 중앙 정렬 */ - gap: 10px; /* 컴포넌트 간 간격 */ - width: 100%; -`,_o=c.label` - font-size: 1.2rem; - font-weight: bold; - flex-shrink: 0; /* 라벨 크기를 고정 */ - text-align: left; /* 라벨 텍스트 왼쪽 정렬 */ -`,g3=c.input` - width: 80%; - padding: 10px; - background-color: #ececec; - border: 1px solid #ccc; - border-radius: 5px; -`,x3=c.div` - display: flex; - justify-content: flex-start; -`,y3=c(Fc)` - display: flex; - margin-left: 50px; - flex-wrap: wrap; - gap: 8px; - padding: 10px 0; - - div { - padding: 12px !important; /* 강제로 적용 */ - flex: 1 1 calc(25% - 8px); - box-sizing: border-box; - - &:hover { - background-color: #f0f0f0 !important; /* 호버 스타일도 강제 */ - } - - &.active { - font-weight: bold !important; /* 활성 상태 스타일 강제 */ - border-bottom: 2px solid black !important; - } - } -`,v3=c.div` - display: flex; - flex-direction: column; /* 세로 정렬 */ - gap: 20px; /* 컴포넌트 간 간격 */ - width: 100%; -`,Mu=c.input` - width: 100px; - padding: 10px 0px; - text-align: center; - background-color: #ececec; - border: 1px solid #ccc; - border-radius: 5px; -`,w3=c.div` - position: relative; -`,b3=c.button` - width: 120px; - padding: 10px; - border: 1px solid #ccc; - border-radius: 5px; - font-weight: bold; - display: flex; - gap: 10px; - justify-content: center; - align-items: center; - box-sizing: border-box; -`,j3=c.div` - position: absolute; - width: 120px; - top: 100%; - left: 0; - right: 0; - font-size: 0.9rem; - border: 1px solid #ccc; - border-radius: 5px; - background: #fff; - z-index: 1000; - box-sizing: border-box; -`,C3=c.div` - padding: 10px; - text-align: center; - cursor: pointer; - background: ${({isSelected:e})=>e?"#f0f0f0":"#fff"}; - font-weight: ${({isSelected:e})=>e?"bold":"normal"}; - - &:hover { - background: #eaeaea; - } -`,S3=c.div` - display: flex; - flex-direction: row; /* 가로 배치 */ - gap: 20px; /* 두 요소 간 간격 */ - width: 100%; /* 부모 컨테이너에 맞게 확장 */ - align-items: center; /* 세로 중앙 정렬 */ -`,k3=c.div` - width: 100%; /* Wrapper 크기는 기존 유지 */ - max-width: 1100px; - margin: 0 auto; - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px; /* 내부 여백 */ - margin-bottom: 20px; - box-sizing: border-box; -`,P3=c.textarea` - width: 100%; - height: 460px; /* 고정된 높이 */ - background-color: #ececec; - border: none; /* 테두리 제거 */ - border-radius: 10px; - padding: 20px; - outline: none; /* 포커스 시 외곽선 제거 */ - resize: none; /* 크기 조절 비활성화 */ - font-size: 1rem; /* 텍스트 크기 */ - line-height: 1.5; - color: #333; /* 텍스트 색상 */ - box-sizing: border-box; -`,E3=c.div` - display: flex; - justify-content: flex-end; - gap: 10px; -`,Dg=c.button` - padding: 10px 20px; - background: #000; - color: #fff; - border: 1px solid #000; - border-radius: 5px; - cursor: pointer; - - &:hover { - background: #333; - } -`;class R3{constructor(t){this.url=t,this.socket=null,this.subscriptions=new Map,this.reconnectSubscriptions=new Set,this.reconnectAttempts=0,this.maxReconnectAttempts=5}connect(t,n,r,o){this.socket=new WebSocket(this.url),this.socket.onopen=()=>{console.log("WebSocket connected"),n&&n(),this.reconnectAttempts=0,this.resubscribe()},this.socket.onmessage=i=>{const a=JSON.parse(i.data),l=a.destination;if(l&&this.subscriptions.has(l)){const u=this.subscriptions.get(l);u&&u(a.message)}else console.warn("No subscription found for destination:",l)},this.socket.onclose=()=>{console.log("WebSocket disconnected"),r&&r(),this.reconnect()},this.socket.onerror=i=>{console.error("WebSocket error:",i),o&&o(i)}}subscribe(t,n,r=!1){this.subscriptions.has(t)?console.warn(`Already subscribed to ${t}`):(this.subscriptions.set(t,n),console.log(`Subscribed to ${t}`)),r&&this.reconnectSubscriptions.add(t)}unsubscribe(t){this.subscriptions.has(t)?(this.subscriptions.delete(t),this.reconnectSubscriptions.delete(t),console.log(`Unsubscribed from ${t}`)):console.warn(`No subscription found for ${t}`)}send(t,n){if(!this.socket||this.socket.readyState!==WebSocket.OPEN){console.warn("WebSocket is not connected");return}const r=JSON.stringify({destination:t,message:n});console.log(`Sending message to ${t}:`,r),this.socket.send(r)}isConnected(){var t;return((t=this.socket)==null?void 0:t.readyState)===WebSocket.OPEN}close(){this.socket&&(this.socket.close(),console.log("WebSocket connection closed"))}reconnect(){this.reconnectAttempts{this.connect(t=>console.log("Reconnected message:",t),()=>console.log("Reconnected successfully"),()=>console.log("Reconnection closed"),t=>console.error("Reconnection error:",t))},3e3)):console.error("Max reconnect attempts reached")}resubscribe(){this.reconnectSubscriptions.size>0&&(console.log("Resubscribing to specific channels after reconnect"),this.reconnectSubscriptions.forEach(t=>{const n=this.subscriptions.get(t);n&&(console.log(`Resubscribing to ${t}`),this.subscribe(t,n))}))}}const Zs=new R3("ws://your-api-endpoint.com/websocket"),on="user-00001",A3="사용자 A",I3=()=>{var rt;const{communityPostId:e}=$i(),t=Ee(),n=Oc(),r=Number(e);if(!r)return alert("잘못된 게시물 ID입니다."),t("/community"),null;const[o,i]=w.useState(Rv),[a,l]=w.useState(1),[u,d]=w.useState(!1),[p,f]=w.useState(0),[h,b]=w.useState(""),[y,x]=w.useState(""),[j,g]=w.useState(""),[m,v]=w.useState(null),[C,P]=w.useState(""),S=["postDetail",r],{data:R,isLoading:I,isError:L}=Vp({queryKey:S,queryFn:()=>si(r),enabled:!!e});w.useEffect(()=>{if(R){i(R);const J=R.participants.find(ge=>ge.userId===on&&!ge.isCancelled);l(J?J.quantity:1),d(R.userId===on),R.participants.some(ge=>ge.userId===on&&ge.isCancelled)&&(alert("참여를 취소한 게시물에는 접근할 수 없습니다."),t("/community"))}},[R,on,t]),w.useEffect(()=>{L&&(alert("게시물을 불러오는 데 실패했습니다."),t("/community"))},[L,t]),w.useEffect(()=>{if(e){const J=ge=>{ge.type==="STATUS_UPDATE"?i(at=>({...at,status:ge.status})):ge.type==="USER_UPDATE"&&i(at=>({...at,participants:ge.participants,cancelledUsers:ge.cancelledUsers}))};return Zs.connect(J,()=>console.log("WebSocket connected"),()=>console.log("WebSocket disconnected"),ge=>console.error("WebSocket error:",ge)),()=>{Zs.close()}}},[e]),w.useEffect(()=>{const J=o==null?void 0:o.closeAt;if(!J)return;const ge=On=>{const Tn=new Date().getTime(),Nn=new Date(On).getTime()-Tn;if(Nn<=0)return"마감되었습니다.";const Hi=Math.floor(Nn/(1e3*60*60*24)),Wc=Math.floor(Nn%(1e3*60*60*24)/(1e3*60*60)),Ln=Math.floor(Nn%(1e3*60*60)/(1e3*60)),Hr=Math.floor(Nn%(1e3*60)/1e3);return`${Hi}일 ${Wc}시간 ${Ln}분 ${Hr}초 남음`},at=()=>{const On=ge(J);b(On)};at();const Wi=setInterval(at,1e3);return()=>clearInterval(Wi)},[o]),w.useEffect(()=>{if(o.status===_t.PAYMENT_STANDBY&&o.stateUpdatedAt){const J=new Date(o.stateUpdatedAt).getTime()+432e5,ge=()=>{const On=new Date().getTime(),Tn=J-On;if(Tn<=0)return"결제 마감되었습니다.";const ga=Math.floor(Tn/(1e3*60*60)),Nn=Math.floor(Tn%(1e3*60*60)/(1e3*60)),Hi=Math.floor(Tn%(1e3*60)/1e3);return`${ga}시간 ${Nn}분 ${Hi}초 남음`},at=()=>{const On=ge();x(On)};at();const Wi=setInterval(at,1e3);return()=>clearInterval(Wi)}else x("")},[o]);const B=Yr({mutationFn:Av,onSuccess:()=>{n.invalidateQueries({queryKey:S}),alert("게시물이 삭제되었습니다."),t("/community")},onError:J=>{console.error(J),alert("게시물 삭제에 실패했습니다.")}}),N=()=>{window.confirm("정말 이 게시물을 삭제하시겠습니까?")&&B.mutate(r)},O=()=>{o&&f(J=>(J+1)%o.imageUrls.length)},$=()=>{o&&f(J=>(J-1+o.imageUrls.length)%o.imageUrls.length)},F=J=>{f(J)},se=Yr({mutationFn:()=>gE(r,on,a),onSuccess:async()=>{n.invalidateQueries({queryKey:S}),alert("참여가 완료되었습니다.");const J=await si(r);J.currentQuantity===J.availableNumber&&J.status===_t.APPROVED&&(await sc(r,_t.PAYMENT_STANDBY),n.invalidateQueries({queryKey:S}))},onError:()=>{alert("참여에 실패했습니다.")}}),he=()=>{o.status===_t.APPROVED?se.mutate():alert("현재 참여할 수 없는 상태입니다.")},oe=Yr({mutationFn:()=>xE(r,on),onSuccess:async()=>{n.invalidateQueries({queryKey:S}),alert("참여가 취소되었습니다.");const J=await si(r);J.status===_t.PAYMENT_STANDBY&&J.currentQuantity{alert("참여 취소에 실패했습니다.")}}),W=()=>{[_t.APPROVED,_t.PAYMENT_STANDBY].includes(o.status)?oe.mutate():alert("현재 취소할 수 없는 상태입니다.")},H=()=>{window.confirm("진행자가 공구 진행 취소를 할 경우, 포스트 자체도 삭제됩니다. 정말 취소하시겠습니까?")&&B.mutate(r)},X=()=>{t(`/community/post/${e}/report`)},ie=J=>{if(o){const ge=a+J;ge>=1&&ge<=o.availableNumber-o.currentQuantity&&l(ge)}},ne=((rt=o==null?void 0:o.participants)==null?void 0:rt.some(J=>J.userId===on&&!J.isCancelled))||!1,Ve=Yr({mutationFn:()=>yE(r,on,A3,j),onSuccess:()=>{n.invalidateQueries({queryKey:["postDetail",r]}),g("")},onError:()=>{alert("댓글 작성에 실패했습니다.")}}),be=()=>{if(!j.trim()){alert("댓글을 입력해주세요.");return}if(j.length>300){alert("댓글은 최대 300자까지만 입력 가능합니다.");return}Ve.mutate()},Ne=Yr({mutationFn:J=>vE(r,J),onSuccess:()=>{n.invalidateQueries({queryKey:["postDetail",r]})},onError:()=>{alert("댓글 삭제에 실패했습니다.")}}),Ce=J=>{window.confirm("이 댓글을 삭제하시겠습니까?")&&Ne.mutate(J)},M=(J,ge)=>{v(J),P(ge)},U=Yr({mutationFn:()=>wE(Number(e),m,C),onSuccess:()=>{n.invalidateQueries({queryKey:["postDetail",e]}),v(null),P("")},onError:()=>{alert("댓글 수정에 실패했습니다.")}}),ae=()=>{if(!C.trim()){alert("수정할 댓글 내용을 입력하세요.");return}if(C.length>300){alert("댓글은 최대 300자까지만 입력 가능합니다.");return}U.mutate()},Ke=()=>{if(o.status!==_t.PAYMENT_STANDBY){alert("현재 결제할 수 없는 상태입니다.");return}const J={post:{title:o.title,unitAmount:o.unitAmount,imageUrls:o.imageUrls},quantity:a};u?t(`/community/post/${e}/payment/author`,{state:J}):t(`/community/post/${e}/payment/participant`,{state:J})},Me=()=>{o.participants.find(ge=>ge.userId===on&&!ge.isCancelled&&ge.isPaymentCompleted)?t(`/community/post/${e}/refund`):alert("환불 요청은 결제를 완료한 이용자만 가능합니다.")};return w.useEffect(()=>{o.status===_t.PAYMENT_STANDBY&&!ne&&(alert("모집이 완료되어 더 이상 접근할 수 없습니다."),t("/community"))},[o.status,ne,t]),I?s.jsx("div",{children:"Loading..."}):o?s.jsx(D3,{children:s.jsxs(O3,{children:[s.jsxs(T3,{children:[s.jsx(M3,{children:"공구 모집 및 진행"}),s.jsxs(N3,{children:[s.jsx(L3,{onClick:()=>t(-1),children:s.jsx(Jp,{size:24})}),s.jsx(_3,{children:u?ne?"":s.jsx(Og,{onClick:N,children:"글 삭제"}):s.jsx(Og,{onClick:X,children:"글 신고"})})]})]}),s.jsxs($3,{children:[s.jsxs(z3,{children:[s.jsxs(F3,{children:[s.jsxs(U3,{children:[s.jsx(W3,{children:o.imageUrls.length>1&&p>0&&s.jsx(V3,{onClick:$,children:s.jsx($c,{size:20})})}),s.jsx(B3,{children:s.jsx("img",{src:o.imageUrls[p],alt:`이미지 ${p+1}`})}),s.jsx(H3,{children:o.imageUrls.length>1&&p1&&s.jsx(G3,{children:o.imageUrls.map((J,ge)=>s.jsx("span",{className:p===ge?"active":"",onClick:()=>F(ge)},ge))})}),s.jsx(q3,{children:s.jsxs(Y3,{children:[s.jsx(Kt,{htmlFor:"urlInput",children:"URL 주소"}),s.jsx(J3,{children:o.productUrl})]})})]}),s.jsx(X3,{children:s.jsxs(Z3,{children:[s.jsxs($n,{children:[s.jsx(Kt,{children:"제목"}),s.jsx(Tg,{children:o.title})]}),s.jsxs(as,{children:[s.jsxs(e4,{children:[s.jsx(Kt,{children:"작성자"}),s.jsx(t4,{children:o.nickname})]}),s.jsxs(n4,{children:[s.jsx(Kt,{children:"작성일"})," ",new Date(o.createdAt).toLocaleString()]})]}),s.jsxs(as,{children:[s.jsxs($n,{children:[s.jsx(Kt,{children:"카테고리"})," ",o.category]}),s.jsxs($n,{children:[s.jsx(Kt,{children:"참여 현황"})," ",o.currentQuantity," / ",o.availableNumber]})]}),s.jsxs(as,{children:[s.jsxs($n,{children:[s.jsx(Kt,{children:"모집 마감"})," ",h]}),(o==null?void 0:o.status)===_t.PAYMENT_STANDBY&&s.jsxs($n,{children:[s.jsx(Kt,{children:"결제 마감"}),s.jsx(Tg,{children:y})]})]}),s.jsxs(as,{children:[s.jsxs($n,{children:[s.jsx(Kt,{children:"총 가격"})," ",o.totalAmount.toLocaleString()," ","원"]}),s.jsxs($n,{children:[s.jsx(Kt,{children:"개당 가격"})," ",o.unitAmount.toLocaleString()," ","원"]})]}),s.jsxs(as,{children:[s.jsxs($n,{children:[s.jsx(Kt,{children:"수량"})," ",s.jsxs(r4,{children:[!ne&&s.jsxs(s.Fragment,{children:[s.jsx(Xp,{onClick:()=>ie(-1)}),s.jsx("span",{children:a}),s.jsx(Zp,{onClick:()=>ie(1)})]}),ne&&s.jsx("span",{children:a})," "]})]}),ne&&s.jsxs($n,{children:[s.jsx(Kt,{children:"결제 금액"})," ",s.jsxs(o4,{children:[(a*o.unitAmount).toLocaleString()," 원"]})]}),o&&o.status&&s.jsx(a4,{children:o.participants.some(J=>J.userId===on&&!J.isCancelled&&J.isPaymentCompleted)?s.jsx(ir,{primary:!0,onClick:Me,children:"환불"}):o.status===_t.PAYMENT_STANDBY?s.jsx(s.Fragment,{children:ne&&s.jsxs(s.Fragment,{children:[s.jsx(ir,{primary:!0,onClick:Ke,children:"결제"}),s.jsx(ir,{onClick:W,children:"취소"})]})}):o.status===_t.APPROVED?s.jsx(s.Fragment,{children:ne?u?s.jsx(ir,{onClick:H,children:"취소"}):s.jsx(ir,{onClick:W,children:"취소"}):s.jsx(ir,{primary:!0,onClick:he,children:"참여"})}):null})]})]})})]}),s.jsx(i4,{children:s.jsx(s4,{readOnly:!0,value:o.description})}),s.jsxs(l4,{children:[s.jsx(c4,{children:"댓글"}),s.jsxs(u4,{children:[o.comments.map(J=>s.jsxs(d4,{children:[s.jsxs(f4,{children:[s.jsx(p4,{children:J.userNickname}),s.jsx(h4,{children:new Date(J.createdAt).toLocaleString()})]}),m===J.commentId?s.jsxs(x4,{children:[s.jsx(y4,{value:C,onChange:ge=>P(ge.target.value),maxLength:300}),s.jsxs(Lg,{children:[s.jsxs(Ng,{overLimit:C.length>300,children:["(",C.length,"/300)"]}),s.jsx(ir,{onClick:ae,children:"확인"}),s.jsx(ir,{onClick:()=>v(null),children:"취소"})]})]}):s.jsxs(s.Fragment,{children:[s.jsx(m4,{children:J.content}),J.userId===on&&s.jsxs(g4,{children:[s.jsx(v4,{onClick:()=>M(J.commentId,J.content),children:"수정"}),s.jsx(w4,{onClick:()=>Ce(J.commentId),children:"삭제"})]})]})]},J.commentId)),s.jsxs(b4,{children:[s.jsx(j4,{value:j,onChange:J=>g(J.target.value),placeholder:"댓글 내용을 입력해주세요.",maxLength:300}),s.jsxs(Lg,{children:[s.jsxs(Ng,{overLimit:j.length>300,children:["(",j.length,"/300)"]}),s.jsx(C4,{onClick:be,children:"작성"})]})]})]})]})]})]})}):s.jsx("div",{children:"게시물이 없습니다."})},D3=c.div` - display: flex; - justify-content: center; - padding: 20px; -`,O3=c.div` - width: 100%; - max-width: 1120px; - margin: 0 auto; -`,T3=c.div` - display: flex; - flex-direction: column; /* Title과 HeaderWrapper를 세로로 배치 */ - gap: 10px; /* Title과 HeaderWrapper 사이 간격 */ - margin-bottom: 1.5rem; -`,N3=c.div` - width: 1000px; - margin: 30px auto 0; - display: flex; - justify-content: space-between; - align-items: center; -`,L3=c.button` - background: none; - border: none; - cursor: pointer; -`,_3=c.div` - display: flex; - gap: 10px; -`,Og=c.button` - padding: 10px 15px; - background: #000; - color: #fff; - border: 1px solid #000; - border-radius: 5px; - cursor: pointer; -`,M3=c.h1` - font-size: 1.8rem; - font-weight: bold; - text-align: left; - margin: 0; /* Title의 기본 마진 제거 */ -`,$3=c.div` - display: flex; - flex-direction: column; - background: #fff; - padding: 20px; - border-radius: 10px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -`,z3=c.div` - display: flex; /* 가로 정렬 */ - flex-direction: row; /* 기본값이므로 명시적으로 추가 */ - align-items: stretch; /* 양쪽 요소의 높이를 동일하게 */ - justify-content: center; /* 양쪽 여백 균등 배치 */ - gap: 20px; /* 두 컨테이너 사이 간격 */ - margin-bottom: 20px; /* 아래 요소와의 간격 */ -`,F3=c.div` - display: flex; - flex-direction: column; - align-items: center; - width: 490px; - height: 470px; /* 고정된 높이 설정 */ - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px 11px; - position: relative; - box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ -`,U3=c.div` - display: flex; - justify-content: space-between; /* 좌우 버튼 공간 확보 */ - align-items: center; /* 수직 중앙 정렬 */ - width: 100%; - height: 320px; /* 기준 높이 */ - position: relative; /* 자식 요소 위치 기준 */ - overflow: hidden; /* 높이를 벗어난 콘텐츠 숨김 */ -`,B3=c.div` - flex: 1; /* 이미지 영역이 버튼 사이에 위치 */ - display: flex; - align-items: center; - justify-content: center; - width: 400px; - height: 100%; - border: 1px solid #ccc; - border-radius: 10px; - overflow: hidden; /* 콘텐츠가 영역을 벗어나지 않도록 */ - - img { - max-width: 100%; /* 부모 너비를 넘지 않도록 */ - max-height: 100%; /* 부모 높이를 넘지 않도록 */ - object-fit: contain; /* 비율을 유지하며 부모 크기 안에 맞춤 */ - } -`,W3=c.div` - flex: 0 0 32px; /* 버튼 고정 너비 */ - display: flex; - justify-content: center; - align-items: center; - height: 100%; /* PreviewWrapper의 높이에 맞춤 */ -`,H3=c.div` - flex: 0 0 32px; /* 버튼 고정 너비 */ - display: flex; - justify-content: center; - align-items: center; - height: 100%; /* PreviewWrapper의 높이에 맞춤 */ -`,V3=c.button` - background: none; - border: none; - color: #333; - cursor: pointer; -`,Q3=c.button` - background: none; - border: none; - color: #333; - cursor: pointer; -`,K3=c.div` - width: 100%; - height: 54px; /* 높이 설정 */ - display: flex; /* 플렉스 박스로 변경 */ - align-items: center; /* 세로 중앙 정렬 */ - justify-content: center; /* 가로 중앙 정렬 */ -`,G3=c.div` - display: flex; - justify-content: center; - gap: 5px; - - span { - width: 8px; - height: 8px; - border-radius: 50%; - background: #ddd; - cursor: pointer; - } - - span.active { - background: #000; - } -`,q3=c.div` - display: flex; - flex-direction: column; - align-items: flex-start; /* 세로로 가운데 정렬 */ - width: 100%; -`,Y3=c.div` - margin-left: 20px; - display: flex; - align-items: center; /* Label과 Url을 같은 높이에 배치 */ - gap: 10px; /* Label과 Url 사이 간격 */ - padding: 10px; - border: none; -`,J3=c.div` - width: 285px; - flex: 1; - padding: 10px; - border: none; - border-radius: 5px; -`,X3=c.div` - display: flex; - flex-direction: column; /* 세로 정렬 */ - align-items: flex-start; /* 왼쪽 정렬 */ - justify-content: space-between; /* 위아래 요소 간격 균등 */ - width: 490px; - max-width: 490px; /* 최대 너비 고정 */ - height: 470px; /* ImageUploadContainer와 동일한 고정 높이 */ - flex-grow: 1; /* 가로 공간을 균등 분배 */ - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px; - box-sizing: border-box; -`,Z3=c.div` - display: flex; - flex-direction: column; - gap: 20px; /* 컴포넌트 간 간격 */ - width: 100%; -`,$n=c.div` - display: flex; - flex-direction: column; - font-size: 1rem; -`,Kt=c.label` - font-size: 1.2rem; - font-weight: bold; - margin-bottom: 4px; /* Label과 텍스트 사이 간격 */ -`,Tg=c.span` - display: -webkit-box; /* Flexbox 기반으로 동작 */ - -webkit-line-clamp: 2; /* 두 줄까지만 표시 */ - -webkit-box-orient: vertical; /* 수직 방향 박스 정렬 */ - overflow: hidden; /* 넘치는 텍스트 숨김 */ - text-overflow: ellipsis; /* 넘치는 텍스트에 ... 표시 */ - white-space: normal; /* 줄바꿈 허용 */ - color: #333; /* 텍스트 색상 */ -`,as=c.div` - display: flex; /* 한 줄로 배치 */ - align-items: center; /* 세로 가운데 정렬 */ - justify-content: space-between; /* 양쪽 여백 균등 배치 */ - width: 100%; /* 부모 컨테이너 너비 */ - - & > div { - flex: 1; /* 내부 요소들이 동일한 크기로 영역 나눔 */ - } -`,e4=c.div` - display: flex; /* 가로 배치 */ - flex-direction: column; /* 내부 요소가 한 줄씩 배치되도록 */ - gap: 5px; /* 내부 요소 간 간격 */ -`,t4=c.div` - display: flex; /* 한 줄로 배치 */ - align-items: center; /* 세로로 가운데 정렬 */ - font-size: 1rem; /* 텍스트 크기 설정 */ -`,n4=c.div` - display: flex; /* 가로 배치 */ - flex-direction: column; /* 내부 요소가 한 줄씩 배치되도록 */ - gap: 5px; /* 내부 요소 간 간격 */ -`,r4=c.div` - display: flex; - gap: 10px; - align-items: center; - - svg { - cursor: pointer; - } -`,o4=c.div` - display: flex; - gap: 10px; - align-items: center; -`,i4=c.div` - width: 100%; - max-width: 1000px; - margin: 0 auto; - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px; - margin-bottom: 20px; - box-sizing: border-box; -`,s4=c.textarea` - width: 100%; - height: 460px; /* 고정된 높이 */ - border: none; /* 테두리 제거 */ - border-radius: 10px; - padding: 20px; - outline: none; /* 포커스 시 외곽선 제거 */ - resize: none; /* 크기 조절 비활성화 */ - font-size: 1rem; /* 텍스트 크기 */ - line-height: 1.5; - color: #333; /* 텍스트 색상 */ - box-sizing: border-box; -`,a4=c.div` - display: flex; - justify-content: right; /* 버튼을 가운데 정렬 */ - align-items: center; /* 세로 정렬 */ - gap: 10px; /* 버튼 간 간격 */ -`,ir=c.button` - padding: 10px 20px; - background: #000; - color: #fff; - border: 1px solid #000; - border-radius: 5px; - cursor: pointer; -`,l4=c.div` - width: 1000px; - margin: 0 auto; - border: 1px solid #ccc; - border-radius: 10px; -`,c4=c.h3` - font-size: 1.5rem; - font-weight: bold; - margin-left: 40px; - margin-bottom: 0; -`,u4=c.ul` - list-style: none; - padding: 20px; - margin: 0; -`,d4=c.li` - margin-bottom: 15px; - padding: 15px; - border: 1px solid #ddd; - border-radius: 8px; - display: flex; - flex-direction: column; -`,f4=c.div` - display: flex; - justify-content: left; - align-items: center; - margin-bottom: 10px; -`,p4=c.div` - display: flex; - align-items: center; - font-weight: bold; - - &::before { - content: ''; - display: inline-block; - width: 32px; - height: 32px; - border-radius: 50%; - background-color: #ccc; - margin-right: 8px; - } -`,h4=c.span` - margin-left: 20px; - font-size: 0.9rem; - color: #666; -`,m4=c.p` - margin: 10px 0; - font-size: 1rem; - color: #333; - word-wrap: break-word; -`,g4=c.div` - display: flex; - justify-content: flex-end; - gap: 10px; -`,x4=c.div` - display: flex; - flex-direction: column; /* 세로 배치 */ - gap: 10px; /* EditCommentInput과 ActionButtonsWrapper 간격 */ -`,Ng=c.span` - font-size: 0.9rem; - color: ${e=>e.overLimit?"red":"#666"}; /* 300자를 초과하면 빨간색 */ - margin-right: 10px; /* 버튼과 간격 */ -`,y4=c.textarea` - width: 100%; /* CommentContent와 동일한 너비 */ - min-height: 60px; /* 기본 높이 */ - max-height: 120px; /* 최대 높이 */ - padding: 10px; - border: 1px solid #ddd; - border-radius: 8px; - background-color: #ececec; /* 배경색 설정 */ - font-size: 1rem; /* 글씨 크기 */ - line-height: 1.5; /* 줄 간격 */ - color: #333; /* 글씨 색상 */ - resize: none; /* 크기 조절 비활성화 */ - font-family: inherit; /* 기본 글꼴 사용 */ - box-sizing: border-box; /* 패딩 포함 크기 계산 */ -`,v4=c.button` - padding: 10px 20px; - background: #000; - color: #fff; - border: 1px solid #000; - border-radius: 5px; - cursor: pointer; -`,w4=c.button` - padding: 10px 20px; - background: #000; - color: #fff; - border: 1px solid #000; - border-radius: 5px; - cursor: pointer; -`,b4=c.div` - border: 1px solid #ddd; - border-radius: 8px; - padding: 15px; - display: flex; - flex-direction: column; /* 세로 정렬 */ - gap: 10px; /* 요소 간 간격 */ - box-sizing: border-box; /* 패딩과 보더를 포함한 크기 계산 */ -`,j4=c.textarea` - width: 100%; - min-height: 60px; - max-height: 120px; - padding: 10px; - border: 1px solid #ddd; - border-radius: 8px; - background-color: #ececec; - font-size: 1rem; /* CommentContent와 동일한 글꼴 크기 */ - color: #333; /* CommentContent와 동일한 텍스트 색상 */ - resize: none; /* 크기 조절 비활성화 */ - font-family: inherit; - box-sizing: border-box; /* 패딩과 보더를 포함한 너비 계산 */ -`,C4=c.button` - padding: 10px 20px; - background: #000; - color: #fff; - border: 1px solid #000; - border-radius: 5px; - cursor: pointer; - align-self: flex-end; /* 오른쪽 정렬 */ -`,Lg=c.div` - display: flex; - gap: 10px; - justify-content: flex-end; - align-items: center; - margin-top: 10px; -`,S4="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAATCAYAAACKsM07AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAD8SURBVHgBtZXtDcIgEIZfSP/bEToCG8gIdYK6ihu4gSMYJ5BuUCeoG6gT4F0osSX9SKE+yZuWAncH1wNhrT0CqPDjIIR4YyMkKe+1NanEv6DVvEhnbEgWtBtSRU522IZb6KCG2yaNdArSZ/CFItfWkZQHmq+8HRn0Nd1TIw0d2Bt4v7OQAM2/klp+lyP9DxIvMUc8qrMz6sDA1YZCBBRYAZdgM+fARxGDCuyMRtHG5oELlQvWt+XEuBrxK9ij9/dkE4MMXEXzsbH24OPATrMjOFE2Hj7Pllff5eGCRLKZPs5DSU5qrIO31CzeKXwR2Xi0tyMWnBSIgKJ/+vcviL7xJoSwybgAAAAASUVORK5CYII=",k4="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA5MDAgNDAwIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjogd2hpdGU7Ij4NCiAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAwLCA1MCkiPg0KICAgIDxjaXJjbGUgY3g9IjE1MCIgY3k9IjEyMCIgcj0iNTAiIGZpbGw9IiM0MkE1RjUiIG9wYWNpdHk9IjAuMyIvPg0KICAgIDxjaXJjbGUgY3g9IjI1MCIgY3k9IjEyMCIgcj0iNTAiIGZpbGw9IiM2NEI1RjYiIG9wYWNpdHk9IjAuMyIvPg0KICAgIDxjaXJjbGUgY3g9IjIwMCIgY3k9IjIyMCIgcj0iNTAiIGZpbGw9IiMyMTk2RjMiIG9wYWNpdHk9IjAuMyIvPg0KICAgIA0KICAgIDxwYXRoIGQ9Ik0xNTAsMTIwIEwyNTAsMTIwIE0yMDAsMjIwIEwxNTAsMTIwIE0yMDAsMjIwIEwyNTAsMTIwIiANCiAgICAgICAgICBzdHJva2U9IiMxRTg4RTUiIA0KICAgICAgICAgIHN0cm9rZS13aWR0aD0iNCIgDQogICAgICAgICAgc3Ryb2tlLWRhc2hhcnJheT0iMTAsMTAiLz4NCiAgICANCiAgICA8dGV4dCB4PSIzNTAiIHk9IjIwMCIgDQogICAgICAgICAgZm9udC1mYW1pbHk9IkFyaWFsIEJsYWNrLCBzYW5zLXNlcmlmIiANCiAgICAgICAgICBmb250LXNpemU9IjcwIiANCiAgICAgICAgICBmb250LXdlaWdodD0iOTAwIj4NCiAgICAgIDx0c3BhbiB4PSIyNTAiIGR5PSItMjAiIGZpbGw9IiMxNTY1QzAiPkdvb2Q8L3RzcGFuPg0KICAgICAgPHRzcGFuIHg9IjMwMCIgZHk9IjcwIiBmaWxsPSIjMjE5NkYzIj5CdXlVczwvdHNwYW4+DQogICAgPC90ZXh0Pg0KICA8L2c+DQo8L3N2Zz4=",P4="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='30px'%20viewBox='0%20-960%20960%20960'%20width='30px'%20fill='%23434343'%3e%3cpath%20d='M144-264v-72h672v72H144Zm0-180v-72h672v72H144Zm0-180v-72h672v72H144Z'/%3e%3c/svg%3e",Dv=w.createContext(null),E4=({children:e})=>{const[t,n]=w.useState(!1),[r,o]=w.useState(!1),i=()=>{const u=localStorage.getItem("token"),d=localStorage.getItem("role");n(!!u),o(d==="ROLE_ADMIN")};w.useEffect(()=>{i()},[t]);const a=()=>{n(!0);const u=localStorage.getItem("role");o(u==="ROLE_ADMIN")},l=()=>{localStorage.removeItem("role"),localStorage.removeItem("token"),n(!1),o(!1)};return s.jsx(Dv.Provider,{value:{isLoggedIn:t,isAdmin:r,login:a,logout:l},children:e})},Uc=()=>{const e=w.useContext(Dv);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},R4=()=>{const{isLoggedIn:e,isAdmin:t,logout:n}=Uc(),[r,o]=w.useState(!1),i=()=>{o(!r)};return s.jsx(A4,{children:s.jsxs(I4,{children:[s.jsx(D4,{children:s.jsx(An,{to:"/",children:s.jsx("img",{src:k4,alt:"로고"})})}),s.jsx(O4,{onClick:i,children:s.jsx("img",{src:P4,alt:"메뉴버튼"})}),s.jsx(T4,{$isOpen:r,children:s.jsxs(N4,{children:[s.jsx(ls,{children:s.jsx(sr,{to:"/",onClick:i,children:"Home"})}),s.jsx(ls,{children:s.jsx(sr,{to:"/products",onClick:i,children:"Products"})}),s.jsx(ls,{children:s.jsx(sr,{to:"/mypage/notification",onClick:i,children:"Notifications"})}),s.jsx(ls,{children:s.jsx(sr,{to:"/community/post",onClick:i,children:"Community"})}),s.jsxs(ls,{children:[e&&s.jsx(sr,{to:t?"/adminpage":"/mypage/setting",onClick:i,children:t?"Admin Page":"My Page"}),t&&s.jsxs(Nf,{children:[s.jsx(_g,{children:s.jsx(sr,{to:"/adminpage/post-management",children:"Post Management"})}),s.jsx(_g,{children:s.jsx(sr,{to:"/adminpage/chat-management",children:"Chat Management"})})]})]}),e?s.jsxs(s.Fragment,{children:[s.jsx(Mg,{onClick:n,children:s.jsx("a",{children:"LogOut"})}),s.jsx(Mg,{children:s.jsx(_4,{children:s.jsx(sr,{to:"/cart",onClick:i,children:s.jsx("img",{src:S4,alt:"장바구니 아이콘"})})})})]}):s.jsx(L4,{children:s.jsx(An,{to:"/signin",onClick:i,children:"Login"})})," "]})})]})})},A4=c.header` - display: flex; - align-items: center; - justify-content: space-between; - padding: 10px 20px; - position: relative; -`,I4=c.div` - display: flex; - align-items: center; - justify-content: space-between; - width: 100%; - max-width: 1120px; - margin-left: auto; - margin-right: auto; - position: relative; -`,D4=c.div` - img { - margin-top: -10%; - margin-left: -25%; - height: auto; - width: 250px; - } - - @media (min-width: 576px) and (max-width: 767px) { - img { - margin-top: 0; - margin-left: 0; - width: 150px; - } - } -`,O4=c.button` - display: none; - - @media (min-width: 576px) and (max-width: 767px) { - display: block; - background: none; - border: none; - cursor: pointer; - position: absolute; - right: 0; - top: 50%; - transform: translateY(-50%); - z-index: 20; - } -`,T4=c.nav` - display: flex; - justify-content: flex-end; - flex-grow: 1; - - @media (min-width: 576px) and (max-width: 767px) { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100vh; - background-color: white; - z-index: 10; - display: ${({$isOpen:e})=>e?"flex":"none"}; - align-items: center; - justify-content: center; - } -`,N4=c.ul` - display: flex; - list-style: none; - gap: 10px; - margin: 0; - padding: 0; - align-items: center; - - @media (min-width: 576px) and (max-width: 767px) { - flex-direction: column; - gap: 20px; - width: 100%; - align-items: center; - } -`,Nf=c.ul` - display: none; - position: absolute; - top: 100%; - left: 0; - background: white; - border: 1px solid #ccc; - border-radius: 8px; - box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); - list-style: none; - padding: 5px 0; - margin: 0; - z-index: 1000; - - @media (min-width: 576px) and (max-width: 767px) { - position: static; - box-shadow: none; - border: none; - padding: 0; - background: transparent; - } -`,_g=c.li` - padding: 8px 12px; - - a { - text-decoration: none; - color: black; - display: block; - } - - &:hover { - background: #f4f4f4; - } - - @media (min-width: 576px) and (max-width: 767px) { - padding: 10px; - text-align: center; - } -`,ls=c.li` - margin: 0; - position: relative; - a { - display: block; - padding-bottom: 15px; - text-decoration: none; - color: #000; - font-weight: bold; - border-radius: 5px; - } - &:hover > ${Nf} { - display: block; - } - &:hover { - background-color: #f4f4f4; - border-radius: 8px; - } - - @media (min-width: 576px) and (max-width: 767px) { - width: 100%; - text-align: center; - &:hover > ${Nf} { - display: flex; - flex-direction: column; - align-items: center; - gap: 10px; - } - a { - padding: 10px; - width: 100%; - } - } -`,L4=c.li` - background-color: black; - height: 30px; - width: 70px; - border-radius: 5px; - overflow: hidden; - - a { - color: white; - text-decoration: none; - display: block; - text-align: center; - margin-top: 5px; - font-weight: bold; - } - - &:hover { - background-color: #333; - } - - @media (min-width: 576px) and (max-width: 767px) { - width: 130px; - height: 40px; - margin-left: 10px; - a { - margin-top: 10px; - font-size: 16px; - } - } -`,Mg=c.li` - background-color: black; - height: 30px; - border-radius: 5px; - overflow: hidden; - display: inline-flex; - align-items: center; - padding: 0px 10px; - - a { - font-size: 15px; - color: white; - text-decoration: none; - display: block; - text-align: center; - font-weight: bold; - } - - &:hover { - background-color: #333; - } - - @media (min-width: 576px) and (max-width: 767px) { - width: 130px; - height: 40px; - margin-left: 10px; - - a { - margin-top: -1px; - margin-left: -8px; - font-size: 16px; - } - } -`,sr=c(An)` - text-decoration: none; - color: #000; - padding: 5px 12px; - margin-top: 10px; - transition: background-color 0.2s; - border-radius: 5px; - - @media (min-width: 576px) and (max-width: 767px) { - color: black; - padding: 10px; - width: 100%; - text-align: center; - } -`,_4=c.div` - img { - margin-top: -4px; - width: 22px; - height: 22px; - } - - @media (min-width: 576px) and (max-width: 767px) { - img { - width: 25px; - height: 25px; - } - } -`,M4=()=>s.jsx($4,{children:s.jsx(z4,{children:"© 2024 LinkUp. All Rights Reserved."})}),$4=c.footer` - width: 100%; - - color: white; - background-color: black; - text-align: center; - padding: 1rem 0; - margin-top: auto; -`,z4=c.p` - margin: 0; - font-size: 1rem; -`,F4=()=>s.jsxs(U4,{children:[s.jsx(R4,{}),s.jsx(B4,{children:s.jsx(UC,{})}),s.jsx(M4,{})]}),U4=c.div` - display: flex; - flex-direction: column; - min-height: 100vh; -`,B4=c.main` - flex: 1; /* 남은 공간을 모두 차지 */ - padding: 1rem; - margin-bottom: 150px; -`,W4=async e=>(await re.post("/users/checkemail",e)).data,H4=async e=>(await re.post("/users/checkaddress",e)).data,V4=async e=>(await re.post("/users/checknickname",e)).data,$g=async e=>{const t=localStorage.getItem("email"),n=localStorage.getItem("password"),r=localStorage.getItem("password_confirm"),o=localStorage.getItem("name"),i=localStorage.getItem("phone"),a=localStorage.getItem("nickname"),l=localStorage.getItem("address"),u={email:t,password:n,password_confirm:r,name:o,phone:i,nickname:a,address:l},d=new FormData;if(d.append("user",new Blob([JSON.stringify(u)],{type:"application/json"})),e)d.append("profile",e);else{const h=await fetch("/public/images/origin.png").then(y=>y.blob()),b=new File([h],"origin.png",{type:h.type});d.append("profile",b)}return(await re.post("/users",d,{headers:{"Content-Type":"multipart/form-data"}})).data},Q4=async e=>{const t=await re.post("/users/login",e),n=t.headers.authorization||t.headers.Authorization;return n&&localStorage.setItem("token",n),t},K4=async e=>(await re.post("/users/find",e)).data,G4=async(e,t)=>(await re.post(`/users/reset?token=${t}`,e)).data,q4=()=>{const e=Ee(),[t,n]=w.useState(""),[r,o]=w.useState(""),{login:i}=Uc();return s.jsxs(nR,{children:[s.jsx(eR,{children:s.jsx("img",{src:"/images/login1.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"contain"}})}),s.jsxs(tR,{children:[s.jsx(Z4,{children:"Welcome 👋🏼"}),s.jsx(Ug,{children:"email address"}),s.jsx(Fg,{placeholder:"이메일 입력",value:t,onChange:a=>{n(a.target.value)}}),s.jsx(Ug,{children:"password"}),s.jsx(Fg,{placeholder:"비밀번호 입력 (8 ~ 16자리)",value:r,type:"password",onChange:a=>{o(a.target.value)}}),s.jsx(X4,{onClick:async()=>{(await Q4({email:t,password:r})).status===200?(i(),e("/")):alert("틀렸습니다.")},children:"Login"}),s.jsx(J4,{children:s.jsxs("a",{href:"http://15.164.5.135:8080/users/sociallogin",style:{textDecoration:"none",color:"inherit",display:"inline-flex",alignItems:"center",gap:"8px"},children:[s.jsx("img",{src:"/images/naverlogo.png",alt:"Naver Logo",style:{width:"50px",height:"15px"}}),"계정으로 로그인"]})}),s.jsxs(Y4,{children:[s.jsx(zg,{onClick:()=>{e("/signup")},children:"회원가입 하기"}),s.jsx(zg,{onClick:()=>{e("/findpassword")},children:"비밀번호 찾기"})]})]})]})},zg=c.div` - font-size: 13px; - font-weight: 400; - cursor: pointer; -`,Y4=c.div` - margin-top: 35px; - width: calc(100% - 20px); - display: inline-flex; - justify-content: space-around; -`,J4=c.div` - border: 1px solid #000; - width: calc(100% - 20px); - height: 35px; - display: inline-flex; - align-items: center; - justify-content: center; - margin-top: 10px; - border-radius: 5px; - font-size: 13px; - cursor: pointer; - gap: 5px; -`,X4=c.div` - background-color: #000; - color: #fff; - border-radius: 5px; - width: calc(100% - 20px); - height: 35px; - display: inline-flex; - align-items: center; - justify-content: center; - margin-top: 35px; - cursor: pointer; -`,Fg=c.input` - width: calc(100% - 40px); - height: 25px; - border: 1px solid #ccc; - border-radius: 5px; - font-size: 13px; - padding: 5px 10px; - box-shadow: none; - outline: none; - transition: border-color 0.3s ease; - - &:focus { - border-color: #000; - } -`,Ug=c.div` - font-size: 12px; - font-weight: 500; - margin-top: 10px; -`,Z4=c.div` - font-size: 30px; - font-weight: 900; - margin-bottom: 20px; -`,eR=c.div` - flex: 6; - background-color: #fff; - display: flex; - align-items: center; - justify-content: center; - overflow: hidden; -`,tR=c.div` - flex: 4; - background-color: #fff; - display: flex; - align-items: flex-start; - justify-content: center; - flex-direction: column; - padding-left: 20px; -`,nR=c.div` - display: flex; - width: 100%; - height: 100vh; -`;function rR(){const e=Ee(),[t,n]=w.useState(""),[r,o]=w.useState(""),[i,a]=w.useState(""),[l,u]=w.useState(""),[d,p]=w.useState("");return s.jsxs(uR,{children:[s.jsx(lR,{children:s.jsx("img",{src:"/images/login4.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"contain"}})}),s.jsxs(cR,{children:[s.jsx(aR,{children:"회원가입"}),s.jsx(us,{children:"Name"}),s.jsx(cs,{placeholder:"이름 입력",value:t,onChange:f=>{n(f.target.value)}}),s.jsx(us,{children:"Phone Number"}),s.jsx(cs,{placeholder:"휴대폰 번호 입력",value:r,onChange:f=>{o(f.target.value)}}),s.jsx(us,{children:"Email Address"}),s.jsx(cs,{placeholder:"이메일 입력",value:i,onChange:f=>{a(f.target.value)}}),s.jsx(us,{children:"Password"}),s.jsx(cs,{placeholder:"비밀번호 입력 (8 ~ 16자리)",value:l,onChange:f=>{u(f.target.value)}}),s.jsx(us,{children:"Confirm Password"}),s.jsx(cs,{placeholder:"비밀번호 확인",value:d,onChange:f=>{p(f.target.value)}}),s.jsx(sR,{onClick:async()=>{l!==d?alert("비밀번호가 일치하지 않습니다."):(await W4({email:i,password:l,password_confirm:d,name:t,phone:r})).message==="이메일, 전화번호 중복 확인 완료"?(localStorage.setItem("email",i),localStorage.setItem("password",l),localStorage.setItem("password_confirm",d),localStorage.setItem("name",t),localStorage.setItem("phone",r),e("/termsandservice")):alert("이메일 또는 전화번호가 중복 되었습니다.")},children:"Signup"}),s.jsx(iR,{children:s.jsx(oR,{onClick:()=>{e("/signin")},children:"로그인하기"})})]})]})}const oR=c.div` - font-size: 13px; - font-weight: 400; - cursor: pointer; -`,iR=c.div` - margin-top: 35px; - width: calc(100% - 20px); - display: inline-flex; - justify-content: center; -`,sR=c.div` - background-color: #000; - color: #fff; - border-radius: 5px; - width: calc(100% - 20px); - height: 35px; - display: inline-flex; - align-items: center; - justify-content: center; - margin-top: 35px; - cursor: pointer; -`,cs=c.input` - width: calc(100% - 40px); - height: 25px; - border: 1px solid #ccc; - border-radius: 5px; - font-size: 13px; - padding: 5px 10px; - box-shadow: none; - outline: none; - transition: border-color 0.3s ease; - - &:focus { - border-color: #000; - } -`,us=c.div` - font-size: 12px; - font-weight: 500; - margin-top: 10px; -`,aR=c.div` - font-size: 30px; - font-weight: 900; - margin-bottom: 20px; -`,lR=c.div` - flex: 6; - background-color: #fff; - display: flex; - align-items: center; - justify-content: center; - overflow: hidden; -`,cR=c.div` - flex: 4; - background-color: #fff; - display: flex; - align-items: flex-start; - justify-content: center; - flex-direction: column; - padding-left: 20px; -`,uR=c.div` - display: flex; - width: 100%; - height: 100vh; -`,dR=()=>{const e=Ee(),[t,n]=w.useState(!1),[r,o]=w.useState("");return s.jsxs(s.Fragment,{children:[s.jsxs(SR,{children:[s.jsx(jR,{children:s.jsx("img",{src:"/images/login7.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"contain"}})}),s.jsxs(CR,{children:[s.jsxs(gR,{onClick:()=>{e(-1)},children:[s.jsx("img",{src:"/images/arrow-left.png",alt:"left arrow",style:{width:"20px",height:"20px"}}),"Back"]}),s.jsx(bR,{children:"비밀번호 찾기"}),s.jsx(xR,{children:"등록된 이메일 주소를 입력하고 확인 버튼을 클릭해주세요"}),s.jsx(wR,{children:"email address"}),s.jsx(vR,{placeholder:"이메일 입력",value:r,onChange:i=>{o(i.target.value)}}),s.jsx(yR,{onClick:async()=>{n(!0),(await K4({email:r})).message==="비밀번호 재설정 링크가 이메일로 전송되었습니다."&&e("/resetpassword")},children:"확인"})]})]}),t&&s.jsx(mR,{children:s.jsxs(hR,{children:[s.jsx(pR,{children:"이메일을 확인해주세요"}),s.jsx(fR,{onClick:()=>n(!1),children:"확인"})]})})]})},fR=c.button` - background-color: #000; - color: #fff; - border: none; - border-radius: 5px; - padding: 8px 20px; - cursor: pointer; - width: 100px; - height: 35px; - font-size: 14px; - - &:hover { - opacity: 0.9; - } -`,pR=c.div` - font-size: 16px; - font-weight: 500; - color: #333; -`,hR=c.div` - background-color: white; - padding: 30px; - border-radius: 10px; - width: 300px; - display: flex; - flex-direction: column; - align-items: center; - gap: 20px; -`,mR=c.div` - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); - display: flex; - justify-content: center; - align-items: center; - z-index: 1000; -`,gR=c.div` - margin-bottom: 35px; - display: inline-flex; - align-items: center; - cursor: pointer; -`,xR=c.div` - margin-bottom: 20px; - color: #a4a1aa; - font-size: 14px; - font-weight: 500; - margin-top: 10px; -`,yR=c.div` - background-color: #000; - color: #fff; - border-radius: 5px; - width: calc(100% - 20px); - height: 35px; - display: inline-flex; - align-items: center; - justify-content: center; - margin-top: 35px; - cursor: pointer; -`,vR=c.input` - width: calc(100% - 40px); - height: 25px; - border: 1px solid #ccc; - border-radius: 5px; - font-size: 13px; - padding: 5px 10px; - box-shadow: none; - outline: none; - transition: border-color 0.3s ease; - - &:focus { - border-color: #000; - } -`,wR=c.div` - font-size: 12px; - font-weight: 500; - margin-top: 10px; -`,bR=c.div` - font-size: 30px; - font-weight: 900; -`,jR=c.div` - flex: 6; - background-color: #fff; - display: flex; - align-items: center; - justify-content: center; - overflow: hidden; -`,CR=c.div` - flex: 4; - background-color: #fff; - display: flex; - align-items: flex-start; - justify-content: center; - flex-direction: column; - padding-left: 20px; -`,SR=c.div` - display: flex; - width: 100%; - height: 100vh; -`,kR=()=>{const e=Ee(),t=nt(),[n,r]=w.useState(""),[o,i]=w.useState(""),[a,l]=w.useState(!1),d=new URLSearchParams(t.search).get("token"),p=async()=>{n===o&&n.length>=8&&d?(await G4({newPassword:n},d),l(!0)):alert("비밀번호가 일치하지 않거나 유효하지 않습니다.")};return s.jsxs(NR,{children:[s.jsx(OR,{children:s.jsx("img",{src:"/images/login6.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"contain"}})}),s.jsxs(TR,{children:[s.jsx(DR,{children:"비밀번호 재설정"}),s.jsx(Wg,{children:"password"}),s.jsx(Bg,{type:"password",placeholder:"비밀번호 입력 (8 ~ 16자리)",value:n,onChange:f=>r(f.target.value)}),s.jsx(Wg,{children:"confirm password"}),s.jsx(Bg,{type:"password",placeholder:"비밀번호 확인",value:o,onChange:f=>i(f.target.value)}),s.jsx(IR,{onClick:p,children:"Confirm"})]}),a&&s.jsx(ER,{children:s.jsxs(RR,{children:[s.jsx(AR,{children:"비밀번호가 변경되었습니다."}),s.jsx(PR,{onClick:()=>{e("/signin")},children:"Back to Login"})]})})]})},PR=c.div` - background-color: #000; - color: #fff; - border-radius: 5px; - width: calc(100% - 40px); - height: 50px; - display: inline-flex; - align-items: center; - justify-content: center; - margin-top: 35px; - cursor: pointer; -`,ER=c.div` - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.7); - display: flex; - justify-content: center; - align-items: center; - z-index: 1000; -`,RR=c.div` - width: 432px; - height: 332px; - background-color: white; - border-radius: 10px; - display: flex; - justify-content: center; - align-items: center; - text-align: center; - flex-direction: column; - z-index: 1001; -`,AR=c.div` - font-size: 18px; - font-weight: 800; - color: #333; -`,IR=c.div` - background-color: #000; - color: #fff; - border-radius: 5px; - width: calc(100% - 20px); - height: 35px; - display: inline-flex; - align-items: center; - justify-content: center; - margin-top: 35px; - cursor: pointer; -`,Bg=c.input` - width: calc(100% - 20px); - height: 25px; - border: 1px solid #ccc; - border-radius: 5px; - font-size: 13px; - padding: 5px 10px; - box-shadow: none; - outline: none; - transition: border-color 0.3s ease; - - &:focus { - border-color: #000; - } -`,Wg=c.div` - font-size: 12px; - font-weight: 500; - margin-top: 10px; -`,DR=c.div` - font-size: 30px; - font-weight: 900; - margin-bottom: 20px; -`,OR=c.div` - flex: 6; - background-color: #fff; - display: flex; - align-items: center; - justify-content: center; - overflow: hidden; -`,TR=c.div` - flex: 4; - background-color: #fff; - display: flex; - align-items: flex-start; - justify-content: center; - flex-direction: column; - padding-left: 20px; -`,NR=c.div` - display: flex; - width: 100%; - height: 100vh; -`,LR=` -1. 서비스 이용약관 동의 - -제1조 (목적) - -이 약관은 사용자가 제공받는 서비스의 이용 조건 및 절차, 회사와 사용자 간의 권리·의무 및 책임사항, 기타 필요한 사항을 규정함을 목적으로 합니다. - -제2조 (서비스 제공의 범위 및 이용자의 책임) - -1. 회사는 사용자가 공동구매 및 할인 플랫폼에서 상품을 검색, 구매, 참여할 수 있는 서비스를 제공합니다. -2. 사용자는 서비스 이용 시 타인의 권리를 침해하거나 법령을 위반하는 행위를 해서는 안 됩니다. -3. 사용자는 자신의 계정 정보를 안전하게 관리할 책임이 있으며, 이를 제3자에게 공유하거나 양도해서는 안 됩니다. - -제3조 (서비스 이용 제한 및 해지 조건) - -1. 회사는 다음의 경우 사용자에게 사전 통지 없이 서비스 이용을 제한하거나 해지할 수 있습니다. - - 약관을 위반한 경우 - - 부정한 방법으로 서비스를 이용한 경우 - - 기타 공공질서 및 미풍양속에 반하는 행위를 한 경우 -2. 사용자는 서비스 이용을 원하지 않을 경우 언제든지 탈퇴 신청을 할 수 있습니다. - -제4조 (분쟁 해결 및 법적 준거법) - -1. 이 약관과 관련된 모든 분쟁은 회사가 위치한 지역의 법률을 준거법으로 합니다. -2. 분쟁이 발생할 경우, 회사와 사용자는 상호 협의하여 해결을 위해 노력합니다. -`,_R=` -2. 전자 금융거래 이용약관 동의 - -제1조 (목적) - -이 약관은 사용자가 전자 금융거래를 이용하는 경우 발생하는 권리, 의무 및 책임사항을 규정하는 것을 목적으로 합니다. - -제2조 (전자 금융거래의 정의 및 적용 범위) - -1. 전자 금융거래란 인터넷, 모바일 애플리케이션 등 전자적 매체를 통해 상품 구매 시 발생하는 결제 행위를 말합니다. -2. 본 약관은 사용자가 결제 서비스, 환불 절차 등과 관련하여 전자 금융거래를 이용하는 모든 경우에 적용됩니다. - -제3조 (전자 금융거래 이용자의 권리와 의무) - -1. 사용자는 정확한 결제 정보를 입력하고, 비밀번호 등 중요한 정보를 안전하게 관리해야 합니다. -2. 회사는 전자 금융거래와 관련된 모든 정보를 투명하고 명확하게 제공하며, 이용자의 권리를 보호합니다. - -제4조 (사고 발생 시 손해 배상 기준 및 절차) - -1. 사용자가 전자 금융거래 이용 중 사고를 경험한 경우, 회사는 관련 법령에 따라 손해를 배상합니다. -2. 사용자는 사고 발생 시 지체 없이 회사에 알리고 필요한 증빙 자료를 제출해야 합니다. -`,MR=` -3. 개인정보 제공 동의 - -제1조 (수집되는 개인정보의 항목 및 이용 목적) - -1. 회사는 서비스 제공을 위해 다음과 같은 개인정보를 수집합니다: - - 필수 정보: 이름, 연락처, 이메일, 결제 정보 - - 선택 정보: 배송 주소, 기타 서비스 이용 시 필요한 정보 -2. 수집된 개인정보는 다음 목적으로 이용됩니다: - - 회원 가입 및 관리 - - 상품 구매 및 배송 - - 고객 서비스 및 공지사항 전달 - -제2조 (개인정보 보관 기간 및 삭제 절차) - -1. 회사는 사용자의 개인정보를 법령에서 정한 기간 동안 보관하며, 그 이후에는 즉시 삭제합니다. - - 회원 정보: 회원 탈퇴 후 30일 내 삭제 - - 결제 정보: 거래 완료 후 5년간 보관 (전자상거래법에 의거) -2. 개인정보 삭제 요청 시, 회사는 7일 이내에 삭제를 완료합니다. - -제3조 (개인정보 제3자 제공 여부와 제공 목적) - -1. 회사는 사용자의 동의 없이 개인정보를 제3자에게 제공하지 않습니다. -2. 서비스 제공 과정에서 필요한 경우, 제3자에게 제공될 수 있으며, 주요 제공 대상과 목적은 다음과 같습니다: - - 배송 업체: 상품 배송 - - 결제 대행사: 결제 처리 - - 법적 요청: 관련 법령 준수를 위한 제공 - `,$R=()=>{const e=Ee(),[t,n]=w.useState(!1),[r,o]=w.useState(""),[i,a]=w.useState(""),l=h=>{switch(h){case"service":a("서비스 이용약관"),o(LR);break;case"finance":a("전자 금융거래 이용약관"),o(_R);break;case"privacy":a("개인정보 제공 동의"),o(MR);break}n(!0)},[u,d]=w.useState({all:!1,age:!1,service:!1,finance:!1,privacy:!1,marketing:!1}),p=()=>{const h=!u.all;d({all:h,age:h,service:h,finance:h,privacy:h,marketing:h})},f=h=>{d(b=>{const y={...b,[h]:!b[h]};return y.all=y.age&&y.service&&y.finance&&y.privacy&&y.marketing,y})};return s.jsxs(s.Fragment,{children:[s.jsxs(JR,{children:[s.jsx(qR,{children:s.jsx("img",{src:"/images/login2.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"contain"}})}),s.jsxs(YR,{children:[s.jsxs(GR,{children:["서비스 약관에",s.jsx("br",{}),"동의해주세요."]}),s.jsxs(VR,{children:[s.jsxs(Mo,{children:[s.jsx("input",{type:"checkbox",checked:u.all,onChange:p}),"약관에 모두 동의"]}),s.jsx(QR,{}),s.jsxs(Qa,{children:[s.jsxs(Mo,{children:[s.jsx("input",{type:"checkbox",checked:u.age,onChange:()=>f("age")}),"(필수) 만 14세 이상입니다."]}),s.jsx(Va,{})]}),s.jsxs(Qa,{children:[s.jsxs(Mo,{children:[s.jsx("input",{type:"checkbox",checked:u.service,onChange:()=>f("service")}),"(필수) 서비스 이용약관 동의"]}),s.jsx(Va,{onClick:()=>l("service"),children:"보기"})]}),s.jsxs(Qa,{children:[s.jsxs(Mo,{children:[s.jsx("input",{type:"checkbox",checked:u.finance,onChange:()=>f("finance")}),"(필수) 전자 금융거래 이용약관 동의"]}),s.jsx(Va,{onClick:()=>l("finance"),children:"보기"})]}),s.jsxs(Qa,{children:[s.jsxs(Mo,{children:[s.jsx("input",{type:"checkbox",checked:u.privacy,onChange:()=>f("privacy")}),"(필수) 개인정보 제공 동의"]}),s.jsx(Va,{onClick:()=>l("privacy"),children:"보기"})]}),s.jsxs(Mo,{children:[s.jsx("input",{type:"checkbox",checked:u.marketing,onChange:()=>f("marketing")}),"(선택) 마케팅 수신 동의"]})]}),s.jsx(KR,{onClick:()=>{u.age&&u.service&&u.finance&&u.privacy?e("/setlocation"):alert("필수 항목을 모두 동의해주세요.")},children:"Next"})]})]}),t&&s.jsx(HR,{children:s.jsxs(WR,{children:[s.jsxs(BR,{children:[s.jsx(UR,{children:i}),s.jsx(FR,{onClick:()=>n(!1),children:"×"})]}),s.jsx(zR,{children:s.jsx("pre",{children:r})})]})})]})},zR=c.div` - padding: 20px; - max-height: calc(80vh - 100px); - overflow-y: auto; - - pre { - white-space: pre-wrap; - font-family: inherit; - margin: 0; - } -`,FR=c.button` - background: none; - border: none; - font-size: 24px; - cursor: pointer; - padding: 0; -`,UR=c.h2` - margin: 0; - font-size: 20px; - font-weight: 600; -`,BR=c.div` - display: flex; - justify-content: space-between; - align-items: center; - padding: 20px; - border-bottom: 1px solid #eee; -`,WR=c.div` - background-color: white; - width: 80%; - max-width: 600px; - max-height: 80vh; - border-radius: 10px; - overflow: hidden; -`,HR=c.div` - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); - display: flex; - justify-content: center; - align-items: center; - z-index: 1000; -`,Va=c.div` - font-size: 10px; - color: #737171; - cursor: pointer; -`,VR=c.div` - margin-top: 20px; - width: calc(100% - 20px); -`,Qa=c.div` - display: inline-flex; - justify-content: space-between; - width: 100%; -`,Mo=c.div` - margin-bottom: 10px; - display: flex; - align-items: center; - font-size: 14px; - - input { - margin-right: 10px; - } -`,QR=c.div` - height: 1px; - background-color: #ddd; - margin: 15px 0; -`,KR=c.div` - background-color: #000; - color: #fff; - border-radius: 5px; - width: calc(100% - 20px); - height: 35px; - display: inline-flex; - align-items: center; - justify-content: center; - margin-top: 35px; - cursor: pointer; -`,GR=c.div` - font-size: 30px; - font-weight: 900; - margin-bottom: 20px; -`,qR=c.div` - flex: 6; - background-color: #fff; - display: flex; - align-items: center; - justify-content: center; - overflow: hidden; -`,YR=c.div` - flex: 4; - background-color: #fff; - display: flex; - align-items: flex-start; - justify-content: center; - flex-direction: column; - padding-left: 20px; -`,JR=c.div` - display: flex; - width: 100%; - height: 100vh; -`,XR=({input:e,setInput:t})=>s.jsx(ZR,{children:s.jsx(e5,{type:"text",value:e,onChange:n=>t(n.target.value),placeholder:"검색어를 입력하세요"})}),ZR=c.div` - display: flex; - justify-content: center; - align-items: center; - width: 100%; - height: 100%; - margin-top: 2rem; -`,e5=c.input` - padding: 1rem 2rem; - font-size: 1.5rem; - width: 60%; - border: 2px solid #ccc; - border-radius: 8px; - outline: none; - transition: all 0.3s ease; - - &:focus { - border-color: #4f86e6; - box-shadow: 0 0 10px rgba(79, 134, 230, 0.3); - } - - ::placeholder { - color: #888; - } - @media (min-width: 576px) and (max-width: 767px) { - font-size: 1rem; - } -`,t5=({input:e,products:t})=>{const[n,r]=w.useState(1),[o,i]=w.useState("판매 상품"),a=16,l=(n-1)*a,u=o==="마감 상품"?t.filter(f=>f.available===!1&&new Date(f.deadline)f.available===!0&&new Date(f.deadline)>new Date),d=Math.ceil(u.length/a);w.useEffect(()=>{r(1)},[o]);const p=u.slice(l,l+a);return s.jsxs(n5,{children:[s.jsxs(r5,{children:[s.jsxs(o5,{children:[s.jsx(Hg,{selected:o==="판매 상품",onClick:()=>i("판매 상품"),children:"판매 상품"}),s.jsx(Hg,{selected:o==="마감 상품",onClick:()=>i("마감 상품"),children:"마감 상품"})]}),e?`${e}에 대한 검색 결과`:""]}),s.jsx(i5,{children:p.map(f=>s.jsxs(s5,{selected:o==="판매 상품",children:[s.jsxs(a5,{to:`/products/${f.id}`,children:[s.jsx(l5,{src:f.url||In,alt:f.name,onError:h=>{h.currentTarget.src=In}}),s.jsxs(c5,{children:[s.jsx(u5,{children:f.name}),s.jsxs(d5,{children:[" ",s.jsx(da,{rating:f.rating})]}),s.jsx(f5,{children:f.available?s.jsxs(s.Fragment,{children:[s.jsxs(p5,{children:[f.originalprice,"원"]}),s.jsxs(h5,{children:[f.discountprice,"원"]})]}):s.jsx(m5,{children:"∞ (판매 종료)"})})]})]}),s.jsx(g5,{likes:f.likes})]},f.id))}),d>1&&s.jsx(x5,{children:s.jsx(th,{currentPage:n,totalPages:d,onPageChange:f=>r(f)})})]})},n5=c.div` - display: flex; - flex-wrap: wrap; - width: 80%; - height: auto; - margin: 0 auto; -`,r5=c.h2` - margin-left: 10px; - margin-bottom: 20px; - font-size: 1.5rem; - color: #333; -`,o5=c.div` - width: 200px; - display: flex; - gap: 25px; - margin-top: -15%; - margin-bottom: 5%; -`,Hg=c.h2.withConfig({shouldForwardProp:e=>e!=="selected"})` - cursor: pointer; - text-decoration: ${({selected:e})=>e?"underline":"none"}; - font-size: 16px; -`,i5=c.div` - display: grid; - grid-template-columns: repeat(4, 1fr); - width: 100%; - gap: 20px; - margin-top: 20px; - @media (min-width: 576px) and (max-width: 767px) { - gap: 5px; - } -`,s5=c.div.withConfig({shouldForwardProp:e=>e!=="selected"})` - display: flex; - flex-direction: column; - justify-content: space-between; - padding: 15px; - margin: 10px; - width: 200px; - background-color: ${({selected:e})=>e?"white":"#474545"}; - border-radius: 8px; - box-shadow: ${({selected:e})=>e?"0 4px 6px rgba(0, 0, 0, 0.1)":"none"}; - opacity: ${({selected:e})=>e?1:.6}; - align-items: center; - position: relative; - transition: all 0.3s ease-in-out; - &::after { - content: ${({selected:e})=>e?'""':'"판매 종료"'}; - position: absolute; - top: 10px; - left: 50%; - transform: translateX(-50%); - color: #474545; - font-size: 14px; - font-weight: bold; - padding: 5px 10px; - border-radius: 5px; - } - &:hover { - cursor: pointer; - box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.4); - transform: translateY(-5px); - } - @media (min-width: 768px) and (max-width: 1024px) { - width: 130px; - } - @media (min-width: 576px) and (max-width: 767px) { - width: 90px; - } -`,a5=c(An)` - text-decoration: none; - &:link { - color: inherit; - } - &:visited { - color: inherit; - } - &:active { - color: inherit; - } -`,l5=c.img` - width: 90%; - height: 200px; - background-color: #e0e0e0; - border-radius: 8px; - object-fit: cover; - @media (min-width: 576px) and (max-width: 767px) { - width: 110px; - height: 110px; - } -`,c5=c.div` - display: flex; - flex-direction: column; - width: 90%; -`,u5=c.div` - font-size: 16px; - font-weight: bold; - margin-top: 10px; - text-align: left; - @media (min-width: 576px) and (max-width: 767px) { - font-size: 12px; - } -`,d5=c.div` - font-size: 20px; - color: #ffaa00; - text-align: left; - margin-left: -5px; - margin-top: 5px; - @media (min-width: 576px) and (max-width: 767px) { - display: none; - } -`,f5=c.div` - display: flex; - flex-direction: column; - width: 100%; - margin-top: 30px; - text-align: left; -`,p5=c.div` - text-decoration: line-through; - color: #999; - font-size: 14px; - @media (min-width: 576px) and (max-width: 767px) { - font-size: 10px; - position: absolute; - bottom: 25px; - } -`,h5=c.div` - font-size: 16px; - font-weight: bold; - color: #ff4d4f; - @media (min-width: 576px) and (max-width: 767px) { - font-size: 12px; - position: absolute; - bottom: 10px; - } -`,m5=c.div` - font-size: 20px; - color: gray; - @media (min-width: 576px) and (max-width: 767px) { - font-size: 12px; - position: absolute; - bottom: 10px; - } -`,g5=c.img.withConfig({shouldForwardProp:e=>e!=="likes"})` - position: absolute; - bottom: 20px; - right: 30px; - width: 25px; - height: 25px; - cursor: pointer; - content: ${({likes:e})=>`url(${e?E1:P1})`}; - color: ${({likes:e})=>e?"red ":"transparent"}; - - &:hover { - cursor: pointer; - transform: scale(1.2); - transition: transform 0.2s ease-in-out; - } - @media (min-width: 576px) and (max-width: 767px) { - bottom: 10px; - right: 10px; - width: 18px; - height: 18px; - } -`,x5=c.div` - margin-top: 100px; - display: flex; - justify-content: center; - width: 100%; -`,y5=()=>{const{data:e,isLoading:t,isError:n}=Sv(),[r,o]=w.useState(""),i=nt();w.useEffect(()=>{const p=new URLSearchParams(i.search).get("category");p&&o(p)},[]);const a=d=>[...d].sort((f,h)=>{var b,y;return(((b=h.reviews)==null?void 0:b.length)||0)-(((y=f.reviews)==null?void 0:y.length)||0)}),u=w.useMemo(()=>e?a(e):[],[e]).filter(d=>d.name.toLowerCase().includes(r.toLowerCase())||d.category.toLowerCase().includes(r.toLowerCase()));return s.jsx(s.Fragment,{children:s.jsxs(Ro,{isLoading:t,isError:n,children:[s.jsx(Vg,{children:s.jsx(Qg,{children:s.jsx(XR,{input:r,setInput:o})})}),s.jsxs(Vg,{children:[s.jsx(Qg,{children:s.jsx(t5,{input:r,products:u})}),s.jsx(eh,{})]})]})})},Vg=c.div` - display: flex; - margin-top: 5vh; - align-items: center; - justify-content: center; - width: 100%; - max-width: 1400px; - margin-left: auto; - margin-right: auto; -`,Qg=c.div` - display: flex; - align-items: center; - width: 100%; -`,v5=async(e,t)=>{try{const n=`/api/v1/orders?postId=${e}`;return(await re.post(n,{amount:t})).data}catch{throw new Error("주문에 실패하였습니다.")}},w5=async e=>{try{const t="/products/wishlist",{data:n}=await re.post(t,e);return n}catch{throw new Error("위시리스트 추가에 실패하였습니다.")}},b5=async(e,t)=>{const n=`/api/review/${e}`;return await re.post(n,t)},j5=async(e,t)=>{const n=`/api/review/update/${e}`;return await re.put(n,t)},C5=async e=>{const t=`/api/review/remove/${e}`;return await re.put(t)},S5=({initReviews:e,productId:t})=>{const[n,r]=w.useState(e),[o,i]=w.useState(""),[a,l]=w.useState(5),[u,d]=w.useState(10),[p,f]=w.useState(null),[h,b]=w.useState(""),[y,x]=w.useState(5),j=n.map((R,I)=>({...R,originalIndex:I})).filter(R=>R.using===!0),g=()=>{d(R=>R+10)},m=async R=>{R.preventDefault();try{await b5(t,{content:o,rate:a}),r(I=>[...I,{content:o,rating:a,using:!0}]),i(""),l(5)}catch{alert("현재 댓글을 작성할 수 없는 상태입니다.")}},v=(R,I,L)=>{f(R),b(I),x(L)},C=async R=>{try{const I=j[R].originalIndex,L=I+1;await j5(L,{content:h,rate:y}),r(B=>B.map((N,O)=>O===I?{...N,content:h,rating:y}:N)),f(null),b(""),x(5)}catch{alert("현재 댓글을 수정할 수 없는 상태입니다.")}},P=()=>{f(null),b(""),x(5)},S=async R=>{try{const I=j[R].originalIndex,L=I+1;await C5(L),r(B=>B.map((N,O)=>O===I?{...N,using:!1}:N))}catch{alert("현재 댓글을 삭제할 수 없는 상태입니다.")}};return s.jsxs($5,{children:[s.jsx(k5,{onSubmit:m,children:s.jsxs(P5,{children:[s.jsx(E5,{value:o,onChange:R=>i(R.target.value),placeholder:"댓글을 입력하세요"}),s.jsx(Kg,{value:a,onChange:R=>l(Number(R.target.value)),children:[1,2,3,4,5].map(R=>s.jsx("option",{value:R,children:"⭐".repeat(R)},R))}),s.jsx(R5,{type:"submit",children:"댓글 달기"})]})}),s.jsxs("div",{children:[j.slice(0,u).map((R,I)=>s.jsx(A5,{children:p===I?s.jsxs(L5,{children:[s.jsx(_5,{value:h,onChange:L=>b(L.target.value)}),s.jsx(Kg,{value:y,onChange:L=>x(Number(L.target.value)),children:[1,2,3,4,5].map(L=>s.jsx("option",{value:L,children:"⭐".repeat(L)},L))}),s.jsxs(M5,{children:[s.jsx(Ka,{onClick:()=>C(I),color:"primary",children:"저장"}),s.jsx(Ka,{onClick:P,color:"secondary",children:"취소"})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs(I5,{children:[s.jsx(D5,{children:R.content}),s.jsx(O5,{children:"⭐".repeat(R.rating)})]}),s.jsxs(Ov,{children:[s.jsx(Ka,{onClick:()=>v(I,R.content,R.rating),children:"수정"}),s.jsx(Ka,{onClick:()=>S(I),children:"삭제"})]})]})},R.originalIndex)),s.jsx(T5,{children:u{const[t,n]=w.useState(1);return s.jsx(Tv.Provider,{value:{quantity:t,setQuantity:n},children:e})},Nv=()=>{const e=w.useContext(Tv);if(!e)throw new Error("useQuantity must be used within a QuantityProvider");return e},F5=()=>{const{id:e}=$i(),t=w.useMemo(()=>e&&!isNaN(Number(e))?Number(e):null,[e]);if(!t)return s.jsx("p",{children:"잘못된 상품 ID입니다."});const{data:n,isLoading:r,isError:o}=ma(t||0),{quantity:i,setQuantity:a}=Nv(),[l,u]=w.useState(""),d=Ee(),h=(n?n.now>=n.currentStock:!1)||l==="마감되었습니다.";w.useEffect(()=>{if(!n)return;const g=()=>{const v=new Date,P=new Date(n.deadline).getTime()-v.getTime();if(P<=0||n.available===!1){u("마감되었습니다.");return}const S=Math.floor(P/(1e3*60*60*24)),R=Math.floor(P%(1e3*60*60*24)/(1e3*60*60)),I=Math.floor(P%(1e3*60*60)/(1e3*60));u(`${S}일 ${R}시간 ${I}분 남음`)};g();const m=setInterval(g,6e4);return()=>clearInterval(m)},[n]);const b=g=>{const m=parseInt(g.target.value);m>0&&a(m)},y=async()=>{await v5(t,i),d(`/products/payment/${t}`)};if(!n)return s.jsx("p",{children:"상품 정보를 불러올 수 없습니다."});const x=n.minamount-(n.initstock-n.currentStock),j=Math.min((n.initstock-n.currentStock)/n.currentStock*100,100);return s.jsx(s.Fragment,{children:s.jsx(Ro,{isLoading:r,isError:o,children:s.jsxs(U5,{children:[s.jsxs(B5,{children:[s.jsxs(W5,{children:[s.jsx(V5,{src:n.url||In,alt:n.name,onError:g=>g.currentTarget.src=In}),s.jsx(K5,{children:s.jsx(da,{rating:n.rating})})]}),s.jsxs(H5,{children:[s.jsx(Q5,{children:n.name}),s.jsx(G5,{children:n.available?s.jsxs(s.Fragment,{children:[s.jsxs(X5,{children:[n.originalprice,"원"]}),s.jsxs(Y5,{children:[s.jsxs(Z5,{children:[n.discountprice,"원"]}),s.jsxs(J5,{children:[n.minamount,"개부터 할인 적용"]})]}),x>0&&s.jsxs(eA,{children:["할인 적용까지 ",x,"개 남음"]})]}):s.jsx(q5,{children:"∞ (판매 종료)"})})," ",n.available&&s.jsx(tA,{children:n.description}),s.jsx(nA,{children:l}),s.jsxs(rA,{children:[s.jsx(oA,{children:"현재 구매 현황"}),s.jsx(iA,{children:s.jsx(sA,{style:{width:`${j}%`}})}),s.jsxs(aA,{children:[n.initstock-n.currentStock," /"," ",n.initstock," 구매됨"]})]}),s.jsxs(lA,{children:[s.jsxs(cA,{children:[s.jsx(uA,{children:"수량"}),s.jsx(dA,{type:"number",min:"1",value:i,onChange:b})]}),s.jsxs(fA,{children:[s.jsx(pA,{disabled:h,onClick:y,children:"구매하기"}),s.jsx(hA,{onClick:()=>w5(n.id),children:"찜하기"})]})]})]})]}),s.jsx(S5,{productId:t,initReviews:n.reviews})]})})})},U5=c.div` - width: 90%; - max-width: 1200px; - margin: 0 auto; - padding: 20px; -`,B5=c.div` - display: flex; - gap: 40px; - margin-bottom: 40px; -`,W5=c.div` - position: relative; - flex: 1; - @media (min-width: 576px) and (max-width: 767px) { - height: 300px; - width: 300px; - } -`,H5=c.div` - flex: 1; -`,V5=c.img` - width: 100%; - height: 400px; - background-color: #f5f5f5; - object-fit: cover; - @media (min-width: 576px) and (max-width: 767px) { - height: 300px; - width: 300px; - } -`,Q5=c.h2` - font-size: 24px; - font-weight: bold; - margin-bottom: 10px; -`,K5=c.div` - position: absolute; - font-size: 20px; - color: #ffaa00; - bottom: 80px; - right: 2%; - - @media (min-width: 768px) and (max-width: 1024px) { - bottom: 80px; - } - @media (min-width: 576px) and (max-width: 767px) { - bottom: 10px; - } -`,G5=c.div` - display: flex; - gap: 10px; - margin-bottom: 20px; - @media (min-width: 576px) and (max-width: 767px) { - flex-direction: column; - } -`,q5=c.div` - font-size: 2.3rem; - color: gray; -`,Y5=c.div` - display: flex; - flex-direction: column; - gap: 4px; -`,J5=c.div` - font-size: 14px; - color: #888; - @media (min-width: 768px) and (max-width: 1024px) { - margin-left: -50%; - } - @media (min-width: 576px) and (max-width: 767px) { - font-size: 12px; - } -`,X5=c.div` - text-decoration: line-through; - color: #999; - font-size: 18px; - @media (min-width: 576px) and (max-width: 767px) { - font-size: 12px; - } -`,Z5=c.div` - font-weight: bold; - color: #ff4d4f; - font-size: 24px; - @media (min-width: 576px) and (max-width: 767px) { - margin-top: -10px; - font-size: 18px; - } -`,eA=c.div` - display: inline-flex; - align-items: center; - background-color: #fff3f3; - border: 1px solid #ffcdd2; - border-radius: 20px; - padding: 8px 16px; - color: #ff4d4f; - font-size: 14px; - font-weight: 600; - &::before { - content: '🏷️'; - margin-right: 8px; - font-size: 16px; - } - @media (min-width: 768px) and (max-width: 1024px) { - width: 220px; - } -`,tA=c.p` - margin-bottom: 30px; - line-height: 1.6; - color: #666; - display: -webkit-box; - -webkit-line-clamp: 3; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; - @media (min-width: 576px) and (max-width: 767px) { - -webkit-line-clamp: 2; - } -`,nA=c.div` - font-size: 16px; - color: #ff4d4f; - margin-bottom: 20px; -`,rA=c.div` - margin-bottom: 20px; -`,oA=c.div` - font-size: 16px; - margin-bottom: 5px; - color: #333; -`,iA=c.div` - width: 100%; - height: 10px; - background-color: #ddd; - border-radius: 5px; - overflow: hidden; -`,sA=c.div` - height: 100%; - background-color: #4caf50; - transition: width 0.3s ease; -`,aA=c.div` - margin-top: 5px; - font-size: 14px; - color: #555; -`,lA=c.div` - display: flex; - flex-direction: column; - gap: 20px; - @media (min-width: 576px) and (max-width: 767px) { - margin-top: -40px; - margin-left: -340px; - } -`,cA=c.div` - display: flex; - align-items: center; - justify-content: space-between; - margin-top: 10px; - width: 120px; - font-size: 16px; - border-radius: 8px; - padding: 10px 15px; -`,uA=c.span` - font-weight: bold; - color: #333; -`,dA=c.input` - width: 40px; - height: 40px; - text-align: center; - font-size: 16px; - padding: 0 10px; - border: 1px solid #ccc; - border-radius: 5px; - background-color: #fff; - transition: border-color 0.3s ease; - - &:focus { - border-color: #4a90e2; - outline: none; - } - - &::placeholder { - color: #aaa; - } -`,fA=c.div` - display: flex; - gap: 10px; -`,pA=c.button` - flex: 2; - padding: 15px; - background-color: ${({disabled:e})=>e?"#d1d5db":"#2563eb"}; - color: ${({disabled:e})=>e?"#9ca3af":"white"}; - border: none; - border-radius: 5px; - cursor: ${({disabled:e})=>e?"not-allowed":"pointer"}; - font-size: 16px; - font-weight: bold; - text-decoration: none; - text-align: center; - pointer-events: ${({disabled:e})=>e?"none":"auto"}; /* 비활성화 시 클릭 불가 */ - - &:hover { - cursor: ${({disabled:e})=>e?"not-allowed":"pointer"}; /* 비활성화 상태에서 hover 시 커서 변경 */ - background-color: ${({disabled:e})=>e?"#d1d5db":"white"}; - color: ${({disabled:e})=>e?"#9ca3af":"#2563eb"}; - border: ${({disabled:e})=>e?"none":"1px solid #2563eb"}; - } -`,hA=c.button` - flex: 1; - padding: 15px; - background-color: white; - color: #2563eb; - border: 1px solid #2563eb; - border-radius: 5px; - cursor: pointer; - font-size: 16px; - font-weight: bold; - &:hover { - cursor: pointer; - background-color: #2563eb; - color: white; - } -`,mA=c.div` - display: inline-flex; - gap: 20px; - width: 100%; -`,gA=c.div` - width: 100%; - padding: 0px 20px; -`,vt={Wrapper:mA,Content:gA},xA=async e=>(await re.post("/api/mypage/verify",e)).data,yA=async e=>(await re.post("/api/mypage/change",e)).data,vA=async e=>(await re.put("/api/mypage/changeneighbor",e)).data,wA=async()=>{const e=await re.get("/api/mypage/orders");return e.status!==204?e.data:[]},bA=async()=>(await re.get("/api/mypage/refund_orders")).data,Lv=async()=>(await re.get("/api/mypage")).data,jA=async()=>(await re.get("/api/mypage/community")).data,CA=async()=>(await re.get("/api/mypage/post")).data,SA=async e=>(await re.delete(`/api/mypage/post/${e}`)).data,kA=async e=>(await re.post("/api/v1/main-payments/cancel",e)).data,PA=async e=>{const t=new FormData;return t.append("profile",e),(await re.put("/api/mypage/editprofile",t,{headers:{"Content-Type":"multipart/form-data"}})).data},Wr=()=>{const e=Ee(),t=nt(),[n,r]=w.useState(null),[o,i]=w.useState(""),a=l=>t.pathname===l;return w.useEffect(()=>{(async()=>{try{const u=await Lv();r(u.profile),i(u.name)}catch(u){console.error("failed",u)}})()},[]),s.jsxs(RA,{children:[s.jsxs(AA,{children:[s.jsx(IA,{src:n||"/images/origin.png",alt:"Profile"}),s.jsxs(DA,{children:[s.jsx(OA,{children:"Hello 👋"}),s.jsx(TA,{children:o})]})]}),s.jsx(EA,{}),s.jsxs(NA,{children:[s.jsxs(ar,{$isActive:a("/mypage/setting"),onClick:()=>e("/mypage/setting"),children:[s.jsx("img",{src:`/images/setting${a("/mypage/setting")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"설정"]}),s.jsxs(ar,{$isActive:a("/mypage/orderlist"),onClick:()=>e("/mypage/orderlist"),children:[s.jsx("img",{src:`/images/orderlist${a("/mypage/orderlist")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"주문 내역"]}),s.jsxs(ar,{$isActive:a("/mypage/wishlist"),onClick:()=>e("/mypage/wishlist"),children:[s.jsx("img",{src:`/images/wishlist${a("/mypage/wishlist")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"찜한 상품"]}),s.jsxs(ar,{$isActive:a("/mypage/location"),onClick:()=>e("/mypage/location"),children:[s.jsx("img",{src:`/images/location${a("/mypage/location")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"동네인증"]}),s.jsxs(ar,{$isActive:a("/mypage/refund"),onClick:()=>e("/mypage/refund"),children:[s.jsx("img",{src:`/images/refund${a("/mypage/refund")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"환불계좌 관리"]}),s.jsxs(ar,{$isActive:a("/mypage/notification"),onClick:()=>e("/mypage/notification"),children:[s.jsx("img",{src:`/images/notification${a("/mypage/notification")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"알림내역"]}),s.jsxs(ar,{$isActive:a("/mypage/myposts"),onClick:()=>e("/mypage/myposts"),children:[s.jsx("img",{src:`/images/myposts${a("/mypage/myposts")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"나의 게시글"]}),s.jsxs(ar,{$isActive:a("/mypage/chatlist"),onClick:()=>e("/mypage/chatlist"),children:[s.jsx("img",{src:`/images/chatlist${a("/mypage/chatlist")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"나의 채팅방 목록"]})]})]})},EA=c.div` - width: 100%; - border: 0.5px solid #888; -`,RA=c.div` - width: 260px; - min-width: 260px; - background-color: #fff; - border-radius: 10px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -`,AA=c.div` - display: flex; - align-items: center; - padding: 10px 20px; -`,IA=c.img` - width: 50px; - height: 50px; - border-radius: 50%; - margin-right: 15px; -`,DA=c.div` - display: flex; - flex-direction: column; -`,OA=c.div` - font-size: 14px; - color: #888; -`,TA=c.div` - margin-top: 15px; - font-size: 16px; - font-weight: bold; -`,NA=c.div` - display: flex; - flex-direction: column; - gap: 15px; - padding: 10px 20px; -`,ar=c.div` - display: flex; - align-items: center; - font-size: 14px; - font-weight: 500; - color: ${({$isActive:e})=>e?"#fff":"#333"}; - cursor: pointer; - height: 30px; - gap: 10px; - background-color: ${({$isActive:e})=>e?"#000":"transparent"}; - border-radius: 5px; - padding: 5px 10px; - - &:hover { - background-color: ${({$isActive:e})=>e?"#000":"#f1f1f1"}; - color: ${({$isActive:e})=>e?"#fff":"#000"}; - } -`,LA={addressList:[{id:1,name:"홍길동",address:"경기 성남시 분당구 판교역로 4",phone:"010-0000-0000"}]},_A=[{id:1,name:"Women Textured Handheld Bag",quantity:1,price:"$80.00",status:"환불 처리 중",thumb:""},{id:2,name:"Tailored Cotton Casual Shirt",quantity:1,price:"$40.00",status:"환불 완료",thumb:""}],MA=[{id:1,name:"트렌치코트",quantity:1,price:"148500원",thumb:"/images/trenchcoat.jpeg"},{id:2,name:"싱싱한 사과",quantity:1,price:"3500원",thumb:"/images/apple.png"},{id:3,name:"무선청소기",quantity:1,price:"118500원",thumb:"/images/vacuum.png"},{id:4,name:"목욕 수건",quantity:1,price:"3500원",thumb:"/images/towel.jpeg"}],$A=[{id:1,icon:"bell",title:"{제목} 공동구매 모집이 완료되었습니다.",time:"2024-11-20 13:30"},{id:2,icon:"bell",title:"{제목} 인원 부족으로 모집이 취소되었습니다.",time:"2024-11-19 11:30"},{id:3,icon:"chat",title:"{닉네임}님과 채팅을 시작했습니다.",time:"2024-11-17 15:00"},{id:4,icon:"comment",title:"{닉네임}님이 댓글을 남겼습니다.",time:"2024-11-16 11:10"}],zA=({onClose:e})=>{const[t,n]=w.useState(1),[r,o]=w.useState(""),[i,a]=w.useState(""),[l,u]=w.useState(""),d=async()=>{t===1?(await xA({currentPassword:r}),n(2)):t===2&&(i===l?(await yA({newPassword:i}),e()):alert("비밀번호가 일치하지 않습니다."))};return s.jsx(FA,{onClick:e,children:s.jsx(UA,{onClick:p=>p.stopPropagation(),children:s.jsxs(BA,{children:[t===1&&s.jsxs(s.Fragment,{children:[s.jsx($u,{children:"현재 비밀번호"}),s.jsxs(zu,{children:[s.jsx(Fu,{type:"password",placeholder:"현재 비밀번호를 입력하세요",value:r,onChange:p=>o(p.target.value)}),s.jsx(Gg,{onClick:d,children:"확인"})]})]}),t===2&&s.jsxs(s.Fragment,{children:[s.jsx($u,{children:"변경할 비밀번호"}),s.jsx(zu,{children:s.jsx(Fu,{type:"password",placeholder:"새 비밀번호를 입력하세요",value:i,onChange:p=>a(p.target.value)})}),s.jsx($u,{children:"비밀번호 확인"}),s.jsxs(zu,{children:[s.jsx(Fu,{type:"password",placeholder:"비밀번호를 다시 입력하세요",value:l,onChange:p=>u(p.target.value)}),s.jsx(Gg,{onClick:d,children:"변경"})]})]})]})})})},FA=c.div` - position: fixed; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - background-color: rgba(0, 0, 0, 0.7); - display: flex; - justify-content: center; - align-items: center; - z-index: 1000; -`,UA=c.div` - background-color: #fff; - width: 400px; - padding: 20px; - border-radius: 10px; - box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); - z-index: 1001; -`,BA=c.div` - font-size: 16px; - margin-bottom: 20px; -`,$u=c.div` - font-size: 14px; - font-weight: bold; - margin-bottom: 10px; -`,zu=c.div` - display: flex; - gap: 10px; - margin-bottom: 20px; -`,Fu=c.input` - flex: 1; - padding: 10px; - border: 1px solid #ccc; - border-radius: 5px; - font-size: 14px; -`,Gg=c.button` - background-color: #000; - color: #fff; - border: none; - padding: 10px 20px; - border-radius: 5px; - cursor: pointer; - - &:hover { - background-color: #333; - } -`,WA=({onClose:e})=>{const t=Ee(),{logout:n}=Uc();return s.jsx(HA,{onClick:e,children:s.jsx(VA,{onClick:r=>r.stopPropagation(),children:s.jsxs(QA,{children:[s.jsx(KA,{children:"로그아웃 하시겠습니까?"}),s.jsx(GA,{onClick:()=>{n(),t("/")},children:"확인"})]})})})},HA=c.div` - position: fixed; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - background-color: rgba(0, 0, 0, 0.7); - display: flex; - justify-content: center; - align-items: center; - z-index: 1000; -`,VA=c.div` - background-color: #fff; - width: 300px; - padding: 20px; - border-radius: 10px; - box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); - z-index: 1001; -`,QA=c.div` - font-size: 16px; -`,KA=c.div` - font-size: 14px; - font-weight: bold; - margin-bottom: 10px; -`,GA=c.button` - background-color: #000; - color: #fff; - border: none; - padding: 10px 20px; - border-radius: 5px; - cursor: pointer; - - &:hover { - background-color: #333; - } -`,qA=({onClose:e})=>{const t=Ee();return s.jsx(YA,{onClick:e,children:s.jsx(JA,{onClick:n=>n.stopPropagation(),children:s.jsxs(XA,{children:[s.jsx(ZA,{children:"회원탈퇴 하시겠습니까?"}),s.jsx(eI,{onClick:()=>{t("/")},children:"확인"})]})})})},YA=c.div` - position: fixed; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - background-color: rgba(0, 0, 0, 0.7); - display: flex; - justify-content: center; - align-items: center; - z-index: 1000; -`,JA=c.div` - background-color: #fff; - width: 300px; - padding: 20px; - border-radius: 10px; - box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); - z-index: 1001; -`,XA=c.div` - font-size: 16px; -`,ZA=c.div` - font-size: 14px; - font-weight: bold; - margin-bottom: 10px; -`,eI=c.button` - background-color: #000; - color: #fff; - border: none; - padding: 10px 20px; - border-radius: 5px; - cursor: pointer; - - &:hover { - background-color: #333; - } -`;var _v={},Mv={},Bc={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.postcodeScriptUrl=void 0;var t="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js";e.postcodeScriptUrl="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js";var n=function(){var o=null;return function(){var i=0"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function C(N){return C=Object.setPrototypeOf?Object.getPrototypeOf:function(O){return O.__proto__||Object.getPrototypeOf(O)},C(N)}function P(N,O,$){return O in N?Object.defineProperty(N,O,{value:$,enumerable:!0,configurable:!0,writable:!0}):N[O]=$,N}var S=n.default.createElement("p",null,"현재 Daum 우편번호 서비스를 이용할 수 없습니다. 잠시 후 다시 시도해주세요."),R={width:"100%",height:400},I={scriptUrl:r.postcodeScriptUrl,errorMessage:S,autoClose:!0},L=function(N){function O(){var F;f(this,O);for(var se=arguments.length,he=Array(se),oe=0;oe{const[e,t]=w.useState(LA.addressList),[n,r]=w.useState(!1),[o,i]=w.useState(!1),[a,l]=w.useState(!1),[u,d]=w.useState(""),[p,f]=w.useState(""),[h,b]=w.useState(""),[y,x]=w.useState(""),[j,g]=w.useState(""),[m,v]=w.useState(!1),[C,P]=w.useState(null),R=_v.useDaumPostcodePopup("https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"),I=O=>{d(O.zonecode+" "+O.jibunAddress)},L=()=>{if(p&&h&&y&&j&&u){const O=`${h}-${y}-${j}`;e.push({id:Date.now(),name:p,address:u,phone:O}),f(""),b(""),x(""),g(""),d(""),v(!1)}},B=O=>{var F;const $=(F=O.target.files)==null?void 0:F[0];if($){const se=new FileReader;se.onload=()=>{se.result&&P(se.result.toString())},se.readAsDataURL($)}},N=O=>{t($=>$.filter(F=>F.id!==O))};return w.useEffect(()=>{(async()=>{try{const $=await Lv();P($.profile)}catch($){console.error("failed",$)}})()},[]),s.jsxs(vt.Wrapper,{children:[s.jsx(Wr,{}),s.jsxs(vt.Content,{children:[s.jsxs(AI,{children:[s.jsx("img",{src:C||"/images/origin.png",alt:"Profile",width:80,height:80,onClick:()=>{var O;return(O=document.getElementById("fileInput"))==null?void 0:O.click()},style:{cursor:"pointer"}}),s.jsx(RI,{onClick:async()=>{if(!C){alert("이미지를 먼저 업로드해주세요.");return}try{const O=await fetch(C).then(F=>F.blob()),$=new File([O],"profile.jpg",{type:O.type});await PA($),alert("프로필이 성공적으로 업데이트되었습니다.")}catch(O){alert("프로필 업데이트 중 오류가 발생했습니다."),console.error("API 오류:",O)}},children:"Edit Profile"}),s.jsx("input",{id:"fileInput",type:"file",accept:"image/*",style:{display:"none"},onChange:B})]}),s.jsxs(EI,{children:[s.jsx(Hu,{children:"닉네임 변경"}),s.jsx(PI,{placeholder:"최소 2자 이상 ~ 15자 이내, 띄어쓰기 및 특수문자 사용 불가"}),s.jsx(kI,{children:"변경하기"})]}),s.jsxs(SI,{children:[s.jsx(Hu,{children:"배송지 주소 변경"}),m?s.jsxs(nI,{children:[s.jsxs(oI,{children:[s.jsxs(Wu,{children:[s.jsx(Bu,{children:"이름"}),s.jsx(zv,{placeholder:"이름 입력",value:p,onChange:O=>f(O.target.value)})]}),s.jsxs(Wu,{children:[s.jsx(Bu,{children:"휴대폰 번호"}),s.jsxs(rI,{children:[s.jsx(Uu,{placeholder:"010",value:h,onChange:O=>b(O.target.value),maxLength:3}),s.jsx(qg,{children:"-"}),s.jsx(Uu,{placeholder:"0000",value:y,onChange:O=>x(O.target.value),maxLength:4}),s.jsx(qg,{children:"-"}),s.jsx(Uu,{placeholder:"0000",value:j,onChange:O=>g(O.target.value),maxLength:4})]})]})]}),s.jsx(lI,{children:s.jsxs(Wu,{children:[s.jsx(Bu,{children:"주소"}),s.jsxs(aI,{children:[s.jsx(iI,{onClick:()=>{R({onComplete:I})},children:"주소 검색"}),u&&s.jsx(sI,{children:u})]})]})}),s.jsxs(dI,{children:[s.jsx(cI,{onClick:L,children:"완료"}),s.jsx(uI,{onClick:()=>v(!1),children:"취소"})]})]}):s.jsx(CI,{onClick:()=>v(!0),children:"Add New Address"}),s.jsx(pI,{children:e==null?void 0:e.map(O=>s.jsxs(hI,{children:[s.jsxs(mI,{children:[s.jsx(gI,{children:O.name}),s.jsx(xI,{children:O.address}),s.jsx(yI,{children:O.phone})]}),s.jsx(vI,{children:s.jsx(fI,{onClick:()=>N(O.id),children:"Delete"})})]},O.id))})]}),s.jsxs(jI,{children:[s.jsx(Hu,{children:"비밀번호 변경"}),s.jsx(bI,{onClick:()=>{r(!0)},children:"비밀번호 변경하기"})]}),s.jsxs(wI,{children:[s.jsx(Yg,{onClick:()=>{i(!0)},children:"로그아웃"}),s.jsx(Yg,{onClick:()=>{l(!0)},children:"회원탈퇴"})]}),n&&s.jsx(zA,{onClose:()=>{r(!1)}}),o&&s.jsx(WA,{onClose:()=>{i(!1)}}),a&&s.jsx(qA,{onClose:()=>{l(!1)}})]})]})},nI=c.div` - display: flex; - flex-direction: column; - gap: 5px; -`,qg=c.span` - color: #000; - font-size: 16px; -`,Uu=c.input` - width: 60px; - height: 25px; - border: 1px solid #ccc; - border-radius: 5px; - font-size: 13px; - padding: 5px 10px; - box-shadow: none; - outline: none; - transition: border-color 0.3s ease; - text-align: center; - - &:focus { - border-color: #000; - } -`,rI=c.div` - display: flex; - align-items: center; - gap: 8px; -`,Bu=c.div` - font-size: 12px; - color: #131118; - margin-top: 15px; - margin-bottom: 5px; -`,Wu=c.div` - display: flex; - flex-direction: column; -`,oI=c.div` - display: flex; - gap: 20px; - align-items: flex-end; -`,iI=c.div` - background-color: #000; - color: #fff; - border-radius: 5px; - padding: 5px 15px; - text-align: center; - cursor: pointer; - width: 90px; - height: 25px; - display: flex; - align-items: center; - justify-content: center; -`,sI=c.div` - margin-top: 5px; - font-size: 12px; - color: #555; -`,aI=c.div` - display: flex; - align-items: center; - gap: 15px; -`,lI=c.div``,cI=c.div` - display: inline-flex; - justify-content: center; - background-color: #f1f1f1; - border: 1px solid #ccc; - border-radius: 5px; - padding: 10px 20px; - text-align: center; - cursor: pointer; - flex: 1; - max-width: 175px; - - &:hover { - background-color: #ddd; - } -`,uI=c.div` - display: inline-flex; - justify-content: center; - background-color: #ffeded; - border: 1px solid #f5c6cb; - border-radius: 5px; - padding: 10px 20px; - text-align: center; - cursor: pointer; - color: #d9534f; - flex: 1; - max-width: 175px; - - &:hover { - background-color: #f8d7da; - } -`,dI=c.div` - display: flex; - gap: 10px; - margin-top: 10px; - width: 350px; -`,fI=c.div` - display: inline-flex; - justify-content: center; - background-color: #ffeded; - border: 1px solid #f5c6cb; - border-radius: 5px; - padding: 5px 10px; - cursor: pointer; - color: #d9534f; - - &:hover { - background-color: #f8d7da; - } -`,pI=c.div` - margin-top: 20px; -`,hI=c.div` - display: flex; - justify-content: space-between; - align-items: center; - padding: 10px; - border-bottom: 1px solid #ddd; - border-radius: 5px; - margin-bottom: 10px; -`,mI=c.div` - display: flex; - flex-direction: column; -`,gI=c.div` - font-size: 14px; - font-weight: bold; -`,xI=c.div` - font-size: 12px; - color: #555; - margin-top: 5px; -`,yI=c.div` - font-size: 12px; - color: #555; - margin-top: 5px; -`,vI=c.div` - display: flex; - gap: 10px; - flex-direction: column; -`,Yg=c.div` - margin-top: 20px; - cursor: pointer; -`,wI=c.div` - margin-top: 10px; -`,bI=c.div` - margin-top: 10px; - background-color: #000; - color: #fff; - border-radius: 5px; - padding: 10px 20px; - display: inline-flex; - align-items: center; - justify-content: center; - cursor: pointer; -`,jI=c.div` - margin-top: 30px; -`,CI=c.div` - margin-top: 10px; - background-color: #000; - color: #fff; - border-radius: 5px; - padding: 10px 50px; - display: inline-flex; - align-items: center; - justify-content: center; - cursor: pointer; -`,SI=c.div` - margin-top: 30px; -`,zv=c.input` - width: 150px; - height: 25px; - border: 1px solid #ccc; - border-radius: 5px; - font-size: 13px; - padding: 5px 10px; - box-shadow: none; - outline: none; - transition: border-color 0.3s ease; - - &:focus { - border-color: #000; - } -`,kI=c.div` - margin-top: 10px; - background-color: #000; - color: #fff; - border-radius: 5px; - padding: 10px 50px; - display: inline-flex; - align-items: center; - justify-content: center; - cursor: pointer; - margin-left: 15px; -`,PI=c(zv)` - width: 350px; -`,Hu=c.div` - font-size: 12px; - color: #131118; -`,EI=c.div` - margin-top: 20px; -`,RI=c.div` - background-color: #000; - color: #fff; - border-radius: 5px; - padding: 10px 20px; - display: inline-flex; - align-items: center; - justify-content: center; - cursor: pointer; -`,AI=c.div` - display: inline-flex; - align-items: center; - justify-content: space-between; - width: 100%; -`,II=()=>{const[e,t]=w.useState(!1),[n,r]=w.useState([]),[o,i]=w.useState(""),a=Ee(),l=()=>{t(!0)},u=async()=>{await kA({paymentKey:o,cancelReason:"test"}),t(!1)},d=()=>{t(!1)},p=f=>{switch(f){case"PENDING":return"결제 대기 중";case"AUTH_COMPLETED":return"결제 요청 인증 성공";case"DONE":return"결제 완료";case"FAILED":return"결제 실패";case"CANCELD":return"결제 취소";case"PARTIAL_CANCELED":return"부분 취소";default:return"알 수 없는 상태"}};return w.useEffect(()=>{(async()=>{const h=await wA();r(h)})()},[]),s.jsxs(OI,{children:[s.jsx(TI,{children:n.map((f,h)=>s.jsxs(NI,{children:[s.jsxs(DI,{children:[s.jsx(LI,{children:s.jsx(_I,{})}),s.jsxs(MI,{children:[s.jsx($I,{children:f.productName}),s.jsxs(zI,{children:["Quantity: ",f.quantity]}),s.jsx(FI,{children:p(f.paymentStatus)})]})]}),s.jsxs(UI,{children:[f.price,"원"]}),s.jsxs(BI,{children:[s.jsx(WI,{onClick:()=>{a(`/products/${f.postId}`)},children:"상품 페이지 이동"}),s.jsx(HI,{onClick:()=>{l(),f.payment_key&&i(f.payment_key)},children:"주문 취소/환불"}),f.paymentStatus==="DONE"&&s.jsxs(VI,{children:[s.jsx(QI,{src:"/images/qricon.png",alt:"review icon"}),s.jsx("span",{children:"리뷰 작성하기"})]})]})]},h))}),e&&s.jsx(KI,{children:s.jsxs(GI,{children:[s.jsx(qI,{children:"주문을 취소/환불하시겠습니까?"}),s.jsxs(YI,{children:[s.jsx(Fv,{onClick:u,children:"Yes"}),s.jsx(JI,{onClick:d,children:"No"})]})]})})]})},DI=c.div` - display: inline-flex; - flex-direction: row; - width: 400px; -`,OI=c.div` - width: 100%; - margin: 20px 0; -`,TI=c.div` - display: flex; - flex-direction: column; - gap: 20px; -`,NI=c.div` - display: flex; - align-items: center; - justify-content: space-between; - padding: 20px; - border: 1px solid #ddd; - border-radius: 8px; - background-color: #fff; -`,LI=c.div` - flex-shrink: 0; -`,_I=c.div` - width: 60px; - height: 60px; - background-color: #f0f0f0; - border-radius: 8px; -`,MI=c.div` - margin-left: 20px; -`,$I=c.div` - font-size: 16px; - font-weight: bold; -`,zI=c.div` - font-size: 14px; - color: #555; - margin-top: 4px; -`,FI=c.div` - margin-top: 10px; - font-size: 12px; - font-weight: bold; - color: #000; -`,UI=c.div` - font-size: 16px; - font-weight: bold; -`,BI=c.div` - display: flex; - flex-direction: column; - gap: 10px; -`,WI=c.div` - background: #fff; - color: #131118; - border: 1px solid #131118; - padding: 10px 10px; - border-radius: 8px; - cursor: pointer; - &:hover { - background: #131118; - color: #fff; - } -`,HI=c.div` - background: #fff; - color: #ff7262; - border: 1px solid #ff7262; - padding: 10px 10px; - border-radius: 8px; - cursor: pointer; - display: inline-flex; - justify-content: center; - transition: all 0.3s ease; - - &:hover { - background: #ff7262; - color: #fff; - } -`,VI=c.div` - display: flex; - align-items: center; - gap: 4px; - cursor: pointer; - margin-top: 8px; - - span { - border-bottom: 1px solid #131118; - } -`,QI=c.img` - width: 16px; - height: 16px; -`,KI=c.div` - position: fixed; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: rgba(0, 0, 0, 0.5); - display: flex; - justify-content: center; - align-items: center; - z-index: 1000; -`,GI=c.div` - background-color: white; - padding: 24px; - border-radius: 8px; - width: 300px; - text-align: center; -`,qI=c.p` - margin-bottom: 20px; - font-size: 16px; -`,YI=c.div` - display: flex; - justify-content: center; - gap: 12px; -`,Fv=c.button` - padding: 8px 24px; - border-radius: 4px; - border: 1px solid #ff7262; - background-color: #fff; - color: #ff7262; - cursor: pointer; - transition: all 0.3s ease; - - &:hover { - background-color: #ff7262; - color: #fff; - } -`,JI=c(Fv)` - border: 1px solid #131118; - color: #131118; - - &:hover { - background-color: #131118; - color: #fff; - } -`,XI=()=>(w.useEffect(()=>{(async()=>{const t=await bA();console.log(t)})()},[]),s.jsx(e6,{children:s.jsx(t6,{children:_A.map(e=>s.jsxs(n6,{children:[s.jsxs(ZI,{children:[s.jsx(r6,{children:s.jsx(o6,{})}),s.jsxs(i6,{children:[s.jsx(s6,{children:e.name}),s.jsxs(a6,{children:["Quantity: ",e.quantity]}),s.jsx(l6,{status:e.status,children:e.status})]})]}),s.jsx(c6,{children:e.price}),s.jsx(d6,{children:s.jsx(u6,{children:"상품 페이지 이동"})})]},e.id))})})),ZI=c.div` - display: inline-flex; - flex-direction: row; - width: 400px; -`,e6=c.div` - width: 100%; - margin: 20px 0; -`,t6=c.div` - display: flex; - flex-direction: column; - gap: 20px; -`,n6=c.div` - display: flex; - align-items: center; - justify-content: space-between; - padding: 20px; - border: 1px solid #ddd; - border-radius: 8px; - background-color: #fff; -`,r6=c.div` - flex-shrink: 0; -`,o6=c.div` - width: 60px; - height: 60px; - background-color: #f0f0f0; - border-radius: 8px; -`,i6=c.div` - margin-left: 20px; -`,s6=c.div` - font-size: 16px; - font-weight: bold; -`,a6=c.div` - font-size: 14px; - color: #555; - margin-top: 4px; -`,l6=c.div` - margin-top: 10px; - font-size: 12px; - font-weight: bold; - color: ${e=>e.status==="환불 처리 중"?"#dc3545":"#007bff"}; -`,c6=c.div` - font-size: 16px; - font-weight: bold; -`,u6=c.div` - background: #fff; - color: #131118; - border: 1px solid #131118; - padding: 10px 10px; - border-radius: 8px; - cursor: pointer; - &:hover { - background-color: #131118; - color: #fff; - } -`,d6=c.div` - display: flex; - flex-direction: column; - gap: 10px; -`,f6=()=>{const[e,t]=w.useState([]),n=Ee();w.useEffect(()=>{(async()=>{try{const i=await jA();t(i)}catch(i){console.error("failed",i)}})()},[]);const r=o=>p6[o]||"알 수 없는 상태";return s.jsx(m6,{children:s.jsx(g6,{children:e.map((o,i)=>s.jsxs(x6,{children:[s.jsxs(h6,{children:[s.jsx(y6,{children:o.imageUrls[0]!==""?s.jsx("img",{src:o.imageUrls[0],width:60,height:60}):s.jsx(v6,{})}),s.jsxs(w6,{children:[s.jsx(b6,{children:o.title}),s.jsxs(j6,{children:["Quantity: ",o.availableNumber]}),s.jsx(C6,{children:r(o.status)})]})]}),s.jsxs(S6,{children:[o.unitAmount,"원"]}),s.jsxs(k6,{children:[s.jsx(P6,{onClick:()=>{n(`/community/post/${o.communityPostId}`)},children:"상품 페이지 이동"}),o.status==="APPROVED"&&s.jsxs(s.Fragment,{children:[s.jsx(I6,{children:"QR 코드 확인"}),s.jsxs(R6,{children:[s.jsx(A6,{src:"/images/qricon.png",alt:"review icon"}),s.jsx("span",{children:"리뷰 작성하기"})]})]}),o.status==="NOT_APPROVED"&&s.jsx(s.Fragment,{children:s.jsx(E6,{children:"주문 취소하기"})})]})]},i))})})},p6={NOT_APPROVED:"승인대기",APPROVED:"승인완료",PAYMENT_STANDBY:"결제 대기",PAYMENT_COMPLETED:"결제 완료",REJECTED:"승인 거절",DELETED:"글 삭제"},h6=c.div` - display: inline-flex; - flex-direction: row; - width: 400px; -`,m6=c.div` - width: 100%; - margin: 20px 0; -`,g6=c.div` - display: flex; - flex-direction: column; - gap: 20px; -`,x6=c.div` - display: flex; - align-items: center; - justify-content: space-between; - padding: 20px; - border: 1px solid #ddd; - border-radius: 8px; - background-color: #fff; -`,y6=c.div` - flex-shrink: 0; -`,v6=c.div` - width: 60px; - height: 60px; - background-color: #f0f0f0; - border-radius: 8px; -`,w6=c.div` - margin-left: 20px; -`,b6=c.div` - font-size: 16px; - font-weight: bold; -`,j6=c.div` - font-size: 14px; - color: #555; - margin-top: 4px; -`,C6=c.div` - margin-top: 10px; - font-size: 12px; - font-weight: bold; - color: #000; -`,S6=c.div` - font-size: 16px; - font-weight: bold; -`,k6=c.div` - display: flex; - flex-direction: column; - gap: 10px; -`,P6=c.div` - background: #fff; - color: #131118; - border: 1px solid #131118; - padding: 10px 10px; - border-radius: 8px; - cursor: pointer; - &:hover { - background-color: #131118; - color: #fff; - } -`,E6=c.div` - background: #fff; - color: #ff7262; - border: 1px solid #ff7262; - padding: 10px 10px; - border-radius: 8px; - cursor: pointer; - display: inline-flex; - justify-content: center; - transition: all 0.3s ease; - - &:hover { - background: #ff7262; - color: #fff; - } -`,R6=c.div` - display: flex; - align-items: center; - gap: 4px; - cursor: pointer; - margin-top: 8px; - - span { - border-bottom: 1px solid #000; - } -`,A6=c.img` - width: 16px; - height: 16px; -`,I6=c.div` - background: #fff; - color: #131118; - border: 1px solid #131118; - padding: 10px 10px; - border-radius: 8px; - cursor: pointer; - display: inline-flex; - justify-content: center; - &:hover { - background: #131118; - color: #fff; - } -`;function D6(){const[e,t]=w.useState("order"),n=()=>{switch(e){case"order":return s.jsx(II,{});case"refund":return s.jsx(XI,{});case"group":return s.jsx(f6,{});default:return null}};return s.jsxs(vt.Wrapper,{children:[s.jsx(Wr,{}),s.jsxs(vt.Content,{children:[s.jsxs(O6,{children:[s.jsx(Vu,{$isActive:e==="order",onClick:()=>t("order"),children:"주문내역"}),s.jsx(Vu,{$isActive:e==="refund",onClick:()=>t("refund"),children:"환불내역"}),s.jsx(Vu,{$isActive:e==="group",onClick:()=>t("group"),children:"공동구매 참여내역"})]}),n()]})]})}const O6=c.div` - display: flex; -`,Vu=c.div` - padding: 10px 20px; - cursor: pointer; - font-size: 16px; - font-weight: ${e=>e.$isActive?"bold":"500"}; - color: ${e=>e.$isActive?"#000":"#555"}; - position: relative; - - &:after { - content: ''; - position: absolute; - bottom: -1px; - left: 0; - right: 0; - height: ${e=>e.$isActive?"2px":"0"}; - background-color: #000; - transition: height 0.3s ease; - } -`;function T6(){const[e,t]=w.useState(MA),n=r=>{t(o=>o.filter(i=>i.id!==r))};return s.jsxs(vt.Wrapper,{children:[s.jsx(Wr,{}),s.jsxs(vt.Content,{children:[s.jsx(L6,{children:"찜한 상품"}),s.jsx(M6,{children:s.jsx($6,{children:e.map(r=>s.jsxs(z6,{children:[s.jsxs(_6,{children:[s.jsx(F6,{children:r.thumb!==""?s.jsx("img",{src:r.thumb,alt:r.name,width:60,height:60}):s.jsx(U6,{})}),s.jsxs(B6,{children:[s.jsx(W6,{children:r.name}),s.jsxs(H6,{children:["수량: ",r.quantity]})]})]}),s.jsx(V6,{children:r.price}),s.jsx(Q6,{children:s.jsx(N6,{src:"/images/wish_on.png",onClick:()=>n(r.id),alt:"찜하기"})})]},r.id))})})]})]})}const N6=c.img` - width: 24px; - height: 24px; - cursor: pointer; - transition: transform 0.2s; - - &:hover { - transform: scale(1.1); - } -`,L6=c.div` - font-size: 16px; - font-weight: bold; -`,_6=c.div` - display: inline-flex; - flex-direction: row; - width: 400px; -`,M6=c.div` - width: 100%; - margin: 20px 0; -`,$6=c.div` - display: flex; - flex-direction: column; - gap: 20px; -`,z6=c.div` - display: flex; - align-items: center; - justify-content: space-between; - padding: 20px; - border: 1px solid #ddd; - border-radius: 8px; - background-color: #fff; -`,F6=c.div` - flex-shrink: 0; -`,U6=c.div` - width: 60px; - height: 60px; - background-color: #f0f0f0; - border-radius: 8px; -`,B6=c.div` - margin-left: 20px; -`,W6=c.div` - font-size: 16px; - font-weight: bold; -`,H6=c.div` - font-size: 14px; - color: #555; - margin-top: 4px; -`,V6=c.div` - font-size: 16px; - font-weight: bold; -`,Q6=c.div` - display: flex; - flex-direction: column; - gap: 10px; -`,K6=e=>new Promise((t,n)=>{if(document.getElementById("kakao-map-script")){t(window.kakao);return}const r=document.createElement("script");r.id="kakao-map-script",r.src=`https://dapi.kakao.com/v2/maps/sdk.js?appkey=${e}&libraries=services&autoload=false`,r.onload=()=>{window.kakao.maps.load(()=>t(window.kakao))},r.onerror=()=>n(new Error("카카오맵 스크립트를 로드할 수 없습니다.")),document.head.appendChild(r)}),Uv=({latitude:e,longitude:t,appKey:n,width:r})=>{const o=w.useRef(null);return w.useEffect(()=>{(async()=>{try{const a=await K6(n);if(!o.current)return;const l={center:new a.maps.LatLng(e,t),level:3},u=new a.maps.Map(o.current,l),d=new a.maps.LatLng(e,t);new a.maps.Marker({position:d}).setMap(u)}catch(a){console.error("카카오맵 초기화 중 오류 발생:",a)}})()},[e,t,n]),s.jsx("div",{ref:o,style:{width:`${r}px`,height:"350px"}})};function G6(){const[e,t]=w.useState(null),[n,r]=w.useState(null),[o,i]=w.useState(!1);return w.useEffect(()=>{navigator.geolocation&&!o&&navigator.geolocation.getCurrentPosition(a=>{const{latitude:l,longitude:u}=a.coords;t({latitude:l,longitude:u}),window.kakao&&new window.kakao.maps.services.Geocoder().coord2RegionCode(u,l,(p,f)=>{var h;if(f===window.kakao.maps.services.Status.OK){const b=((h=p[0])==null?void 0:h.region_3depth_name)||"";r(b),i(!0)}else console.error("주소를 가져오지 못했습니다.")})},a=>{console.error("위치 정보를 가져올 수 없습니다:",a)})},[e]),s.jsxs(vt.Wrapper,{children:[s.jsx(Wr,{}),s.jsxs(vt.Content,{children:[s.jsx(X6,{children:"동네 인증"}),s.jsxs(J6,{children:[e?s.jsx(Uv,{latitude:e.latitude,longitude:e.longitude,appKey:"af7394f12b174cad35e87960ddccf91f",width:600}):s.jsx("p",{children:"위치 정보를 불러오는 중..."}),s.jsxs(Y6,{children:["현재 위치가 내 동네로 설정한 ",n||"00동","에 있습니다."]}),s.jsx(q6,{onClick:async()=>{n&&await vA({newAddress:n})},children:"동네인증 완료하기"})]})]})]})}const q6=c.div` - background-color: #000; - color: #fff; - border-radius: 5px; - width: 445px; - height: 56px; - display: inline-flex; - align-items: center; - justify-content: center; - cursor: pointer; -`,Y6=c.div` - color: #88868c; -`,J6=c.div` - display: inline-flex; - align-items: center; - justify-content: center; - width: 100%; - flex-direction: column; - gap: 20px; -`,X6=c.div` - font-size: 16px; - font-weight: bold; - margin-bottom: 20px; -`;function Z6(){const[e,t]=w.useState(!1),[n,r]=w.useState({bank:"신한은행",owner:"굿바이어",accountNumber:"111-111-111111"}),[o,i]=w.useState(n),a=()=>{i(n),t(!0)},l=()=>{t(!1)},u=()=>{r(o),t(!1)},d=p=>{const{name:f,value:h}=p.target;i(b=>({...b,[f]:h}))};return s.jsxs(vt.Wrapper,{children:[s.jsx(Wr,{}),s.jsxs(vt.Content,{children:[s.jsx(tD,{children:"환불계좌 관리"}),s.jsxs(eD,{children:["계좌는 1개만 등록 가능하며 본인명의 계좌만 등록/변경 가능합니다.",s.jsx("br",{}),"등록된 계좌는 현금결제 주문 취소 시 해당 계좌로 환불 금액이 입금되오니 정확하게 기입해 주시기 바랍니다."]}),s.jsx(nD,{children:s.jsxs(rD,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx(Qr,{children:"은행명"}),s.jsx(Qr,{children:"예금주"}),s.jsx(Qr,{children:"계좌번호"}),s.jsx(Qr,{children:" "})]})}),s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx(Kr,{children:n.bank}),s.jsx(Kr,{children:n.owner}),s.jsx(Kr,{children:n.accountNumber}),s.jsx(Kr,{children:s.jsxs(oD,{children:[s.jsx(iD,{onClick:a,children:"수정"}),s.jsx(sD,{children:"삭제"})]})})]})})]})}),e&&s.jsx(aD,{children:s.jsxs(lD,{children:[s.jsxs(cD,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx(Qr,{children:"은행명"}),s.jsx(Qr,{children:"예금주"}),s.jsx(Qr,{children:"계좌번호"})]})}),s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx(Kr,{children:s.jsx(Qu,{type:"text",name:"bank",value:o.bank,onChange:d})}),s.jsx(Kr,{children:s.jsx(Qu,{type:"text",name:"owner",value:o.owner,onChange:d})}),s.jsx(Kr,{children:s.jsx(Qu,{type:"text",name:"accountNumber",value:o.accountNumber,onChange:d})})]})})]}),s.jsxs(uD,{children:[s.jsx(dD,{onClick:u,children:"등록"}),s.jsx(fD,{onClick:l,children:"취소"})]})]})})]})]})}const eD=c.div` - color: #88868c; - margin-bottom: 20px; -`,tD=c.div` - font-size: 16px; - font-weight: bold; - margin-bottom: 20px; -`,nD=c.div` - width: 100%; - overflow-x: auto; - margin-top: 20px; - border-top: 1px solid #000; - border-bottom: 1px solid #000; -`,rD=c.table` - width: 100%; - border-collapse: collapse; - text-align: left; -`,Qr=c.th` - padding: 12px; - background-color: #f9f9f9; - border-bottom: 1px solid #ddd; - font-size: 14px; - font-weight: bold; - color: #333; - text-align: center; -`,Kr=c.td` - padding: 12px; - border-bottom: 1px solid #ddd; - font-size: 14px; - color: #555; - text-align: center; -`,oD=c.div` - display: flex; - gap: 10px; - justify-content: center; -`,iD=c.button` - padding: 8px 16px; - font-size: 14px; - color: #fff; - background-color: #333; - border: none; - border-radius: 4px; - cursor: pointer; -`,sD=c.button` - padding: 8px 16px; - font-size: 14px; - color: #333; - background-color: #fff; - border: 1px solid #333; - border-radius: 4px; - cursor: pointer; -`,aD=c.div` - position: fixed; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - background-color: rgba(0, 0, 0, 0.8); - display: flex; - justify-content: center; - align-items: center; - z-index: 1000; -`,lD=c.div` - background: #fff; - padding: 20px; - border-radius: 8px; - width: 500px; - max-width: 90%; - text-align: center; -`,cD=c.table` - width: 100%; - border-collapse: collapse; - margin-bottom: 20px; -`,Qu=c.input` - width: 100%; - padding: 8px; - font-size: 14px; - border: 1px solid #ddd; - border-radius: 4px; -`,uD=c.div` - display: flex; - justify-content: space-evenly; -`,dD=c.button` - padding: 10px 20px; - background-color: #333; - color: #fff; - border: none; - border-radius: 4px; - cursor: pointer; -`,fD=c.button` - padding: 10px 20px; - background-color: #fff; - color: #333; - border: 1px solid #333; - border-radius: 4px; - cursor: pointer; -`;function pD(){return s.jsxs(vt.Wrapper,{children:[s.jsx(Wr,{}),s.jsxs(vt.Content,{children:[s.jsx(wD,{children:"알림내역"}),s.jsx(mD,{children:$A.map(e=>s.jsxs(gD,{children:[s.jsxs(hD,{children:[s.jsx(xD,{children:s.jsx("img",{src:"/images/"+e.icon+".png"})}),s.jsx(yD,{children:e.title})]}),s.jsx(vD,{children:e.time})]},e.id))})]})]})}const hD=c.div` - display: inline-flex; - align-items: center; -`,mD=c.div` - border: 1px solid #000; - border-radius: 5px; - padding: 16px; - background: #fff; - height: 450px; -`,gD=c.div` - display: flex; - align-items: center; - padding: 12px 0; - border-bottom: 1px solid #ddd; - justify-content: space-between; - - &:last-child { - border-bottom: none; - } -`,xD=c.div` - font-size: 20px; - margin-right: 12px; - - img { - width: 22px; - height: 22px; - } -`,yD=c.div` - font-size: 14px; - color: #333; - margin-bottom: 4px; - display: inline-flex; - align-items: center; -`,vD=c.div` - font-size: 12px; - color: #000; -`,wD=c.div` - font-size: 16px; - font-weight: bold; - margin-bottom: 20px; -`;function bD(){const e=Ee(),[t,n]=w.useState(!1),[r,o]=w.useState([]),[i,a]=w.useState(""),l=()=>{n(!0)},u=()=>{n(!1)},d=p=>{const f=new Date(p),h=f.getFullYear(),b=String(f.getMonth()+1).padStart(2,"0"),y=String(f.getDate()).padStart(2,"0"),x=String(f.getHours()).padStart(2,"0"),j=String(f.getMinutes()).padStart(2,"0"),g=String(f.getSeconds()).padStart(2,"0");return`${h}-${b}-${y} ${x}:${j}:${g}`};return w.useEffect(()=>{(async()=>{try{const f=await CA();console.log(f),o(f)}catch(f){console.error("failed",f)}})()},[]),s.jsxs(vt.Wrapper,{children:[s.jsx(Wr,{}),s.jsxs(vt.Content,{children:[s.jsx(ED,{children:"나의 게시글"}),s.jsx(jD,{children:s.jsxs(CD,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx(Ku,{children:"제목"}),s.jsx(Ku,{children:"날짜"}),s.jsx(Ku,{children:" "})]})}),s.jsx("tbody",{children:r.map((p,f)=>s.jsxs("tr",{children:[s.jsx(Gu,{children:p.title}),s.jsx(Gu,{children:d(p.createdAt)}),s.jsx(Gu,{children:s.jsxs(SD,{children:[s.jsx(kD,{onClick:()=>{e(`/community/post/${p.communityPostId}`)},children:"수정"}),s.jsx(PD,{onClick:()=>{l(),a(p.communityPostId+"")},children:"삭제"})]})})]},f))})]})}),t&&s.jsx(RD,{children:s.jsxs(AD,{children:["삭제하시겠습니까?",s.jsxs(ID,{children:[s.jsx(DD,{onClick:async()=>{n(!1),await SA(i)},children:"예"}),s.jsx(OD,{onClick:u,children:"아니요"})]})]})})]})]})}const jD=c.div` - width: 100%; - overflow-x: auto; - margin-top: 20px; - border-top: 1px solid #000; - border-bottom: 1px solid #000; -`,CD=c.table` - width: 100%; - border-collapse: collapse; - text-align: left; -`,Ku=c.th` - padding: 12px; - background-color: #f9f9f9; - border-bottom: 1px solid #ddd; - font-size: 14px; - font-weight: bold; - color: #333; - text-align: center; -`,Gu=c.td` - padding: 12px; - border-bottom: 1px solid #ddd; - font-size: 14px; - color: #555; - text-align: center; -`,SD=c.div` - display: flex; - gap: 10px; - justify-content: center; -`,kD=c.button` - padding: 8px 16px; - font-size: 14px; - color: #fff; - background-color: #333; - border: none; - border-radius: 4px; - cursor: pointer; -`,PD=c.button` - padding: 8px 16px; - font-size: 14px; - color: #333; - background-color: #fff; - border: 1px solid #333; - border-radius: 4px; - cursor: pointer; -`,ED=c.div` - font-size: 16px; - font-weight: bold; - margin-bottom: 20px; -`,RD=c.div` - position: fixed; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - background-color: rgba(0, 0, 0, 0.8); - display: flex; - justify-content: center; - align-items: center; - z-index: 1000; -`,AD=c.div` - background: #fff; - padding: 20px; - border-radius: 8px; - width: 250px; - max-width: 90%; - text-align: center; -`,ID=c.div` - margin-top: 30px; - display: flex; - justify-content: space-evenly; -`,DD=c.button` - padding: 10px 20px; - background-color: #333; - color: #fff; - border: none; - border-radius: 4px; - cursor: pointer; -`,OD=c.button` - padding: 10px 20px; - background-color: #fff; - color: #333; - border: 1px solid #333; - border-radius: 4px; - cursor: pointer; -`;function TD(){return s.jsxs(vt.Wrapper,{children:[s.jsx(Wr,{}),s.jsx(vt.Content,{children:"asd"})]})}const ND=()=>{const e=Ee(),[t,n]=w.useState(""),[r,o]=w.useState(!0),[i,a]=w.useState(!0),l=d=>{o(d.length>=2&&d.length<=15),a(/^[가-힣ㄱ-ㅎㅏ-ㅣa-zA-Z0-9]+$/.test(d))},u=d=>{const p=d.target.value;n(p),l(p)};return s.jsxs(FD,{children:[s.jsx($D,{children:s.jsx("img",{src:"/images/login5.jpeg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"contain"}})}),s.jsxs(zD,{children:[s.jsxs(MD,{children:["굿바이어스에서 사용할",s.jsx("br",{}),"닉네임을 정해주세요"]}),s.jsx(_D,{placeholder:"닉네임을 입력해주세요",value:t,onChange:u}),s.jsx(Jg,{isValid:r,children:"최소 2자 이상 ~ 15자 이내"}),s.jsx(Jg,{isValid:i,children:"띄어쓰기 및 특수문자 사용 불가"}),s.jsx(LD,{onClick:async()=>{r&&i?(await V4({nickname:t})).message==="닉네임 중복 확인 완료"?(localStorage.setItem("nickname",t),e("/setprofile")):alert("닉네임이 중복입니다."):alert("닉네임 조건을 만족시켜 주세요.")},children:"Next"})]})]})},Jg=c.div` - color: ${({isValid:e})=>e?"#858282":"#EF2626"}; - margin-top: 20px; - font-size: 12px; -`,LD=c.div` - background-color: #000; - color: #fff; - border-radius: 5px; - width: calc(100% - 20px); - height: 35px; - display: inline-flex; - align-items: center; - justify-content: center; - margin-top: 235px; - cursor: pointer; -`,_D=c.input` - width: calc(100% - 42px); - height: 25px; - border: 1px solid #ccc; - border-radius: 5px; - font-size: 13px; - padding: 5px 10px; - box-shadow: none; - outline: none; - transition: border-color 0.3s ease; - - &:focus { - border-color: #000; - } -`,MD=c.div` - font-size: 30px; - font-weight: 900; - margin-bottom: 20px; -`,$D=c.div` - flex: 6; - background-color: #fff; - display: flex; - align-items: center; - justify-content: center; - overflow: hidden; -`,zD=c.div` - flex: 4; - background-color: #fff; - display: flex; - align-items: flex-start; - justify-content: center; - flex-direction: column; - padding-left: 20px; -`,FD=c.div` - display: flex; - width: 100%; - height: 100vh; -`,UD=()=>{const e=Ee(),[t,n]=w.useState(null),[r,o]=w.useState(null),i=a=>{var u;const l=(u=a.target.files)==null?void 0:u[0];if(l){const d=new FileReader;d.onload=()=>{n(d.result)},d.readAsDataURL(l),o(l)}};return s.jsxs(YD,{children:[s.jsx(GD,{children:s.jsx("img",{src:"/images/login3.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"contain"}})}),s.jsxs(qD,{children:[s.jsxs(KD,{children:["프로필 사진을",s.jsx("br",{}),"추가해주세요"]}),s.jsxs(WD,{children:[s.jsx(BD,{htmlFor:"file-input",children:s.jsx("img",{src:t||"/images/origin.png",alt:"Profile Preview",width:217,height:217})}),s.jsx("input",{type:"file",id:"file-input",accept:"image/*",onChange:i,style:{display:"none"}}),"사진 추가하기"]}),s.jsx(QD,{onClick:async()=>{await $g(r),e("/logincomplete")},children:"Next"}),s.jsx(HD,{children:s.jsx(VD,{onClick:async()=>{await $g(null),e("/logincomplete")},children:"건너뛰기"})})]})]})},BD=c.label` - cursor: pointer; -`,WD=c.div` - display: inline-flex; - justify-content: center; - width: calc(100% - 10px); - flex-direction: column; - align-items: center; - font-size: 12px; - color: #858282; -`,HD=c.div` - display: inline-flex; - justify-content: center; - width: calc(100% - 20px); -`,VD=c.div` - color: #858282; - font-size: 12px; - margin-top: 30px; -`,QD=c.div` - background-color: #000; - color: #fff; - border-radius: 5px; - width: calc(100% - 20px); - height: 35px; - display: inline-flex; - align-items: center; - justify-content: center; - margin-top: 100px; - cursor: pointer; -`,KD=c.div` - font-size: 30px; - font-weight: 900; - margin-bottom: 20px; -`,GD=c.div` - flex: 6; - background-color: #fff; - display: flex; - align-items: center; - justify-content: center; - overflow: hidden; -`,qD=c.div` - flex: 4; - background-color: #fff; - display: flex; - align-items: flex-start; - justify-content: center; - flex-direction: column; - padding-left: 20px; -`,YD=c.div` - display: flex; - width: 100%; - height: 100vh; -`,JD=()=>{const e=Ee();return s.jsxs(oO,{children:[s.jsx(nO,{children:s.jsx("img",{src:"/images/login-compl.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"contain"}})}),s.jsxs(rO,{children:[s.jsx(tO,{children:"회원가입 완료!"}),s.jsx(ZD,{children:s.jsx("img",{src:"/images/check.png",alt:"check",width:120,height:120})}),s.jsxs(XD,{children:[s.jsx(Xg,{children:"굿바이어스에 오신것을 환영합니다."}),s.jsx(Xg,{children:"공동구매를 시작해보세요."})]}),s.jsx(eO,{onClick:()=>{e("/")},children:"메인으로 가기"})]})]})},Xg=c.div` - color: #302f2f; -`,XD=c.div` - margin-top: 50px; - display: inline-flex; - align-items: center; - justify-content: center; - width: calc(100% - 20px); - flex-direction: column; - gap: 10px; -`,ZD=c.div` - display: inline-flex; - justify-content: center; - width: calc(100% - 10px); - flex-direction: column; - align-items: center; - font-size: 12px; - color: #858282; - margin-top: 50px; -`,eO=c.div` - background-color: #000; - color: #fff; - border-radius: 5px; - width: calc(100% - 20px); - height: 35px; - display: inline-flex; - align-items: center; - justify-content: center; - margin-top: 80px; - cursor: pointer; -`,tO=c.div` - font-size: 30px; - font-weight: 900; - margin-bottom: 20px; -`,nO=c.div` - flex: 6; - background-color: #fff; - display: flex; - align-items: center; - justify-content: center; - overflow: hidden; -`,rO=c.div` - flex: 4; - background-color: #fff; - display: flex; - align-items: flex-start; - justify-content: center; - flex-direction: column; - padding-left: 20px; -`,oO=c.div` - display: flex; - width: 100%; - height: 100vh; -`,iO=async(e,t)=>{try{const n=`/api/v1/main-payments?postId=${e}`;return(await re.post(n,t)).data.checkoutPageUrl}catch{throw new Error("결제에 실패하였습니다.")}},sO=()=>{const{quantity:e}=Nv(),{id:t}=$i(),n=w.useMemo(()=>!t||isNaN(Number(t))?null:Number(t),[t]);if(!n)return s.jsx("p",{children:"잘못된 상품 ID입니다."});const{data:r,isLoading:o,isError:i}=ma(n);if(!r)return s.jsx("p",{children:"해당 상품을 찾을 수 없습니다."});const[a,l]=w.useState(""),[u,d]=w.useState(""),[p,f]=w.useState(""),[h,b]=w.useState(""),[y,x]=w.useState(""),j=()=>a.trim()?u.trim()?p.trim()?h.trim()?y?!0:(alert("결제 방법을 선택해주세요."),!1):(alert("배송 시 요청사항을 입력해주세요."),!1):(alert("상세 주소를 입력해주세요."),!1):(alert("기본 주소를 입력해주세요."),!1):(alert("수령인을 입력해주세요."),!1),g={productName:r.name,url:r.url,price:r.discountprice*e,quantity:e,payMethod:y,deliveryRequestDTO:{name:a,address:{street:u,detail:p},needed:h}},m=C=>{x(C.target.value)},v=async()=>{if(j())try{const C=await iO(n,g);window.location.href=C}catch(C){alert(`결제에 실패하였습니다 ${C}`)}};return s.jsx(s.Fragment,{children:s.jsx(Ro,{isLoading:o,isError:i,children:s.jsxs(aO,{children:[s.jsxs(qu,{children:[s.jsx(Ju,{children:"주문 상품 정보"}),s.jsxs(Yu,{children:[s.jsxs(Lf,{children:[s.jsx(cO,{children:r.name}),s.jsxs(uO,{children:[r.discountprice,"원"]})]}),s.jsx(Lf,{children:s.jsxs(fO,{children:["수량 : ",e]})}),s.jsxs(lO,{children:[s.jsx("span",{children:"합계:"}),s.jsxs(dO,{children:[r.discountprice*e,"원"]})]})]})]}),s.jsxs(qu,{children:[s.jsx(Ju,{children:"배송 정보 확인"}),s.jsxs(Yu,{children:[s.jsx(Xu,{children:s.jsxs(Zu,{children:["수령인",s.jsx(Ga,{children:s.jsx(rh,{type:"text",placeholder:"이름 입력",value:a,onChange:C=>l(C.target.value)})})]})}),s.jsxs(Xu,{children:[s.jsx(Zu,{children:"배송지"}),s.jsx(Ga,{children:s.jsx(pO,{type:"text",placeholder:"기본 주소를 입력해주세요",value:u,onChange:C=>d(C.target.value)})}),s.jsx(Ga,{children:s.jsx(hO,{type:"text",placeholder:"상세 주소를 입력해주세요",value:p,onChange:C=>f(C.target.value)})})]}),s.jsx(Xu,{children:s.jsxs(Zu,{children:["배송 시 요청사항",s.jsx(Ga,{children:s.jsx(mO,{rows:2,placeholder:"요청사항 입력",value:h,onChange:C=>b(C.target.value)})})]})})]})]}),s.jsxs(qu,{children:[s.jsx(Ju,{children:"결제 정보 확인"}),s.jsx(Yu,{children:s.jsx(gO,{children:s.jsxs(xO,{children:[s.jsx(yO,{type:"radio",name:"payment-method",value:"카드",onChange:m}),s.jsx(vO,{children:"카드 결제"})]})})})]}),s.jsxs(wO,{children:[s.jsx(CO,{onClick:()=>{v()},children:"결제하기"}),s.jsx(jO,{to:`/products/${r.id}`,children:"뒤로 가기"})]})]})})})},aO=c.div` - width: 100%; - max-width: 650px; - margin: 0 auto; - padding: 20px; - background-color: #f8fafc; -`,qu=c.div` - margin-bottom: 24px; - background-color: white; - border-radius: 12px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); - overflow: hidden; -`,Yu=c.div` - padding: 20px; -`,Ju=c.h2` - font-size: 1.125rem; - font-weight: 600; - color: #1e293b; - padding: 16px; - border-bottom: 1px solid #e2e8f0; - margin: 0; -`,Lf=c.div` - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 12px; -`,lO=c(Lf)` - margin-top: 16px; - padding-top: 16px; - border-top: 1px solid #e2e8f0; - font-weight: 600; - color: #1e293b; -`,cO=c.span` - font-weight: 500; - color: #1e293b; -`,uO=c.span` - color: #1e293b; - font-weight: 500; -`,dO=c.span` - color: #2563eb; - font-weight: 600; - font-size: 1.125rem; -`,fO=c.span` - color: #64748b; - font-size: 0.875rem; -`,Xu=c.div` - margin-bottom: 16px; - - &:last-child { - margin-bottom: 0; - } -`,Zu=c.label` - display: block; - color: #475569; - font-size: 0.875rem; - margin-bottom: 4px; -`,rh=c.input` - width: 100%; - padding: 10px 12px; - margin-top: 4px; - border: 1px solid #e2e8f0; - border-radius: 8px; - font-size: 0.875rem; - transition: all 0.2s; - - &:focus { - outline: none; - border-color: #2563eb; - box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); - } - - &::placeholder { - color: #94a3b8; - } -`,Ga=c.div` - display: flex; - gap: 8px; - margin-bottom: 8px; -`,pO=c(rh)` - flex-grow: 1; - cursor: pointer; -`,hO=c(rh)` - margin-top: 8px; -`,mO=c.textarea` - width: 100%; - padding: 10px 12px; - margin-top: 4px; - border: 1px solid #e2e8f0; - border-radius: 8px; - font-size: 0.875rem; - resize: vertical; - min-height: 80px; - transition: all 0.2s; - - &:focus { - outline: none; - border-color: #2563eb; - box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); - } - - &::placeholder { - color: #94a3b8; - } -`,gO=c.div` - display: flex; - flex-direction: column; - gap: 12px; -`,xO=c.label` - display: flex; - align-items: center; - cursor: pointer; -`,yO=c.input` - width: 18px; - height: 18px; - margin: 0; - cursor: pointer; - - &:checked { - accent-color: #2563eb; - } -`,vO=c.span` - margin-left: 8px; - color: #1e293b; - font-size: 0.875rem; -`,wO=c.div` - display: flex; - gap: 12px; - margin-top: 32px; -`,bO=c.button` - flex: 1; - padding: 12px; - border-radius: 8px; - font-weight: 600; - font-size: 0.875rem; - cursor: pointer; - transition: all 0.2s; -`,jO=c(An)` - text-decoration: none; /* 링크의 기본 밑줄 제거 */ - display: flex; /* 버튼 스타일 유지 */ - justify-content: center; - align-items: center; - - background-color: white; - border: 1px solid #e2e8f0; - color: #475569; - border-radius: 8px; - padding: 12px; - font-weight: 600; - font-size: 0.875rem; - cursor: pointer; - transition: all 0.2s; - - &:hover { - cursor: pointer; - background-color: #f8fafc; - } -`,CO=c(bO)` - background-color: #2563eb; - border: none; - color: white; - - &:hover { - cursor: pointer; - background-color: #1d4ed8; - } -`,SO=()=>{const{id:e}=$i();if(!e)return s.jsx("p",{children:"상품 번호가 유실되었습니다."});const t=Number(e),n=window.location.search,o=new URLSearchParams(n).get("totalAmount"),{data:i,isLoading:a,isError:l}=ma(t);return i?s.jsx(s.Fragment,{children:s.jsx(Ro,{isLoading:a,isError:l,children:s.jsxs(kO,{children:[s.jsxs(PO,{children:[s.jsx(EO,{children:"결제 완료"}),s.jsx(RO,{children:"주문해주셔서 감사합니다!"}),s.jsxs(AO,{children:[s.jsxs(Zg,{children:[s.jsx(ex,{children:"상품명"}),s.jsx(tx,{children:i==null?void 0:i.name})]}),s.jsxs(Zg,{children:[s.jsx(ex,{children:"결제 금액"}),s.jsxs(tx,{children:[o,"원"]})]})]})]}),s.jsxs(IO,{children:[s.jsx(DO,{to:"/mypage/orderlist",children:"주문 내역 보기"}),s.jsx(OO,{to:"/",children:"메인으로 돌아가기"})]})]})})}):s.jsx("p",{children:"해당 상품을 찾을 수 없습니다."})},kO=c.div` - width: 100%; - max-width: 650px; - margin: 0 auto; - padding: 20px; - background-color: #f8fafc; - display: flex; - flex-direction: column; - align-items: center; -`,PO=c.div` - width: 100%; - background-color: white; - border-radius: 12px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); - padding: 32px 20px; - text-align: center; - margin-bottom: 24px; -`,EO=c.h1` - font-size: 1.5rem; - font-weight: 700; - color: #1e293b; - margin-bottom: 12px; -`,RO=c.p` - color: #64748b; - font-size: 1rem; - margin-bottom: 24px; -`,AO=c.div` - background-color: #f8fafc; - border-radius: 8px; - padding: 16px; - margin-top: 20px; -`,Zg=c.div` - display: flex; - justify-content: space-between; - margin-bottom: 12px; - - &:last-child { - margin-bottom: 0; - } -`,ex=c.span` - color: #64748b; - font-size: 0.875rem; -`,tx=c.span` - color: #1e293b; - font-weight: 500; -`,IO=c.div` - display: flex; - gap: 12px; - width: 100%; -`,Bv=c(An)` - flex: 1; - text-decoration: none; - display: flex; - justify-content: center; - align-items: center; - padding: 12px; - border-radius: 8px; - font-weight: 600; - font-size: 0.875rem; - cursor: pointer; - transition: all 0.2s; -`,DO=c(Bv)` - background-color: #2563eb; - border: none; - color: white; - - &:hover { - background-color: #1d4ed8; - } -`,OO=c(Bv)` - background-color: white; - border: 1px solid #e2e8f0; - color: #475569; - - &:hover { - background-color: #f8fafc; - } -`,TO=()=>{const{pathname:e}=nt();return w.useEffect(()=>{window.scrollTo(0,0)},[e]),null},NO=()=>{const e=Ee(),{communityPostId:t}=$i(),[n,r]=w.useState(Rv),[o,i]=w.useState(""),[a,l]=w.useState(""),[u,d]=w.useState(""),[p,f]=w.useState(!1),[h,b]=w.useState("마감 기한 "),[y,x]=w.useState(""),[j,g]=w.useState(""),[m,v]=w.useState([]),[C,P]=w.useState(-1),[S,R]=w.useState(""),[I,L]=w.useState(!1);w.useEffect(()=>{if(!t){alert("유효하지 않은 접근입니다."),e("/mypage/post");return}(async()=>{try{const U=await si(Number(t));if(U)r(U),x(U.title),g(U.description),v(U.imageUrls||[]),i(U.category),l(U.availableNumber.toString()),d(U.totalAmount.toString()),R(U.productUrl),b(B(U.createdAt,U.closeAt));else throw new Error("게시물이 존재하지 않습니다.")}catch(U){console.error("게시글 불러오기 실패:",U),alert("게시글 정보를 불러오는 데 실패했습니다."),e("/mypage/post")}})()},[t,e]);const B=(M,U)=>{const ae=new Date(M),Ke=new Date(U);return`${Math.ceil((Ke.getTime()-ae.getTime())/(1e3*60*60*24))}일`},N=()=>{f(!p)},O=M=>{if(b(M),n){const U=new Date(n.createdAt),ae=parseInt(M.replace(/[^0-9]/g,""),10),Ke=new Date(U);Ke.setDate(U.getDate()+ae),r({...n,closeAt:Ke.toISOString()})}f(!1)},$=async()=>{if(!y||!a||!u||h==="마감 기한"||m.length===0||!S||!j){alert("모든 필수 정보를 입력하세요.");return}if(!be(S)){L(!0);return}if(!n){alert("게시글 정보를 로드하는 데 실패했습니다.");return}const M=parseInt(u.replace(/,/g,""),10),U=parseInt(a,10),ae={...n,title:y,description:j,imageUrls:m,category:o,availableNumber:U,totalAmount:M,unitAmount:Math.floor(M/U),productUrl:S};try{await mE(Number(t),ae),alert("게시글이 성공적으로 수정되었습니다."),e(`/mypage/post/${t}`)}catch(Ke){console.error("게시글 수정 중 오류 발생:",Ke),alert("게시글 수정에 실패했습니다. 다시 시도해주세요.")}},F=M=>{const U=M.target.value.replace(/[^0-9]/g,""),ae=Number(U);U===""||ae<=0?l(""):l(U)},se=M=>{const U=M.target.value.replace(/[^0-9]/g,""),ae=Number(U);U===""||ae<=0?d(""):d(oe(U))},he=()=>{e(`/mypage/post/${t}`)},oe=M=>{const U=M.replace(/\D/g,"");return new Intl.NumberFormat().format(Number(U))},W=u&&a?oe(String(Math.floor(parseInt(u.replace(/,/g,""),10)/parseInt(a,10)))):"자동 계산",H=M=>{if(M.target.files){const U=Array.from(M.target.files).map(ae=>URL.createObjectURL(ae));v(ae=>[...ae,...U]),P(m.length)}},X=()=>{C>=0&&v(M=>{const U=M.filter((ae,Ke)=>Ke!==C);if(U.length>0){const ae=C>=U.length?C-1:C;P(ae)}else P(-1);return U})},ie=()=>{CM+1):C===m.length-1&&P(-1)},ne=()=>{P(C===-1?m.length-1:M=>Math.max(M-1,0))},Ve=M=>{P(M)},be=M=>!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|(\\d{1,3}\\.){3}\\d{1,3})(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(M),Ne=M=>{R(M.target.value),L(!be(M.target.value))},Ce=async()=>{if(!n){alert("삭제할 게시글이 존재하지 않습니다.");return}if(window.confirm("정말 이 게시글을 삭제하시겠습니까?"))try{await Av(Number(t)),alert("게시글이 성공적으로 삭제되었습니다."),e("/mypage/post")}catch(U){console.error("게시글 삭제 중 오류 발생:",U),alert("게시글 삭제에 실패했습니다. 다시 시도해주세요.")}};return s.jsx("div",{children:s.jsx(LO,{children:s.jsxs(_O,{children:[s.jsx(MO,{children:"공구 모집 및 진행"}),s.jsxs($O,{children:[s.jsxs(zO,{children:[s.jsxs(FO,{children:[s.jsxs(UO,{children:[s.jsx(VO,{children:m.length>0&&(C>0||C===-1)&&s.jsx(KO,{onClick:ne,children:s.jsx($c,{size:20})})}),C===-1?s.jsxs(WO,{children:[s.jsx(Zp,{size:30}),"이미지 추가",s.jsx("input",{type:"file",multiple:!0,accept:"image/*",onChange:H})]}):s.jsxs(BO,{children:[s.jsx("img",{src:m[C],alt:"이미지 미리보기"}),s.jsx(HO,{onClick:X,children:s.jsx(Xp,{size:30})})]}),s.jsx(QO,{children:m.length>0&&C!==-1&&s.jsx(GO,{onClick:ie,children:s.jsx(zc,{size:20})})})]}),s.jsx(qO,{children:m.length>0&&s.jsx(YO,{children:m.map((M,U)=>s.jsx("span",{className:C===U?"active":"",onClick:()=>Ve(U)},U))})}),s.jsxs(JO,{children:[s.jsxs(XO,{children:[s.jsx($o,{htmlFor:"urlInput",children:"URL 주소"}),s.jsx(ZO,{id:"urlInput",type:"text",placeholder:"상품 관련 URL 주소를 입력해주세요.",value:S,onChange:Ne,isError:I,spellCheck:!1})]}),I&&s.jsx(eT,{children:"올바른 URL을 입력해주세요."})]})]}),s.jsxs(tT,{children:[s.jsxs(nT,{children:[s.jsxs(ds,{children:[s.jsx($o,{children:"제목"}),s.jsx(rT,{placeholder:"제목을 입력해주세요.",value:y,onChange:M=>x(M.target.value),spellCheck:!1})]}),s.jsxs(oT,{children:[s.jsx(iT,{children:"카테고리 선택"}),s.jsx(sT,{categories:nh,selectedCategory:o,onCategoryChange:M=>i(M)})]})]}),s.jsxs(aT,{children:[s.jsxs(ds,{children:[s.jsx($o,{children:"참여 필요 수량 선택"}),s.jsx(ed,{type:"text",placeholder:"수량 입력",value:a,onChange:F})]}),s.jsxs(ds,{children:[s.jsx($o,{children:"모집 마감 기한 설정"}),s.jsxs(lT,{children:[s.jsxs(cT,{onClick:N,children:[h,s.jsx(Ev,{})]}),p&&s.jsx(uT,{children:Array.from({length:7},(M,U)=>s.jsxs(dT,{onClick:()=>O(`${U+1}일 `),isSelected:h===`${U+1}일 `,children:[U+1,"일"]},U))})]})]}),s.jsxs(fT,{children:[s.jsxs(ds,{children:[s.jsx($o,{children:"총 가격 설정"}),s.jsx(ed,{type:"text",placeholder:"총 가격 입력",value:u,onChange:se})," 원"]}),s.jsxs(ds,{children:[s.jsx($o,{children:"개당 가격"}),s.jsx(ed,{disabled:!0,value:W})," 원"]})]})]})]})]}),s.jsx(pT,{children:s.jsx(hT,{placeholder:"내용을 입력해주세요.",value:j,onChange:M=>g(M.target.value),spellCheck:!1})}),s.jsxs(mT,{children:[s.jsx(td,{onClick:$,children:"확인"}),s.jsx(td,{onClick:he,children:"취소"}),s.jsx(td,{onClick:Ce,children:"삭제"})]})]})]})})})},LO=c.div` - display: flex; - justify-content: center; - padding: 20px; -`,_O=c.div` - width: 100%; - max-width: 1120px; - margin: 0 auto; -`,MO=c.h1` - font-size: 1.8rem; - font-weight: bold; - margin-bottom: 1.5rem; - text-align: left; -`,$O=c.div` - display: flex; - flex-direction: column; /* 내부 요소를 세로로 정렬 */ - background: #fff; - padding: 20px; - border-radius: 10px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -`,zO=c.div` - display: flex; /* 가로 정렬 */ - flex-direction: row; /* 기본값이므로 명시적으로 추가 */ - align-items: stretch; /* 양쪽 요소의 높이를 동일하게 */ - justify-content: center; /* 양쪽 여백 균등 배치 */ - gap: 20px; /* 두 컨테이너 사이 간격 */ - margin-bottom: 20px; /* 아래 요소와의 간격 */ -`,FO=c.div` - display: flex; - flex-direction: column; - align-items: center; - width: 490px; - height: 495px; /* 고정된 높이 설정 */ - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px 11px; - position: relative; - box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ -`,UO=c.div` - display: flex; - justify-content: space-between; /* 좌우 버튼 공간 확보 */ - align-items: center; /* 수직 중앙 정렬 */ - width: 100%; - height: 320px; /* 기준 높이 */ - position: relative; /* 자식 요소 위치 기준 */ - overflow: hidden; /* 높이를 벗어난 콘텐츠 숨김 */ -`,BO=c.div` - flex: 1; /* 이미지 영역이 버튼 사이에 위치 */ - display: flex; - align-items: center; - justify-content: center; - width: 400px; - height: 100%; - border: 1px solid #ccc; - border-radius: 10px; - overflow: hidden; /* 콘텐츠가 영역을 벗어나지 않도록 */ - - img { - max-width: 100%; /* 부모 너비를 넘지 않도록 */ - max-height: 100%; /* 부모 높이를 넘지 않도록 */ - object-fit: contain; /* 비율을 유지하며 부모 크기 안에 맞춤 */ - } -`,WO=c.label` - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: 1.2rem; - color: #555; - cursor: pointer; - border-radius: 10px; - width: 400px; /* img의 크기와 동일하게 설정 */ - height: 100%; /* img의 높이와 동일하게 설정 */ - background-color: #ececec; /* 요구된 배경색 추가 */ - - input { - display: none; - } -`,HO=c.button` - position: absolute; - top: 0px; - right: 45px; - background: none; - border: none; - padding: 8px; - cursor: pointer; - z-index: 1; -`,VO=c.div` - flex: 0 0 32px; /* 버튼 고정 너비 */ - display: flex; - justify-content: center; - align-items: center; - height: 100%; /* PreviewWrapper의 높이에 맞춤 */ -`,QO=c.div` - flex: 0 0 32px; /* 버튼 고정 너비 */ - display: flex; - justify-content: center; - align-items: center; - height: 100%; /* PreviewWrapper의 높이에 맞춤 */ -`,KO=c.button` - background: none; - border: none; - color: #333; - cursor: pointer; -`,GO=c.button` - background: none; - border: none; - color: #333; - cursor: pointer; -`,qO=c.div` - width: 100%; - height: 54px; /* 높이 설정 */ - display: flex; /* 플렉스 박스로 변경 */ - align-items: center; /* 세로 중앙 정렬 */ - justify-content: center; /* 가로 중앙 정렬 */ -`,YO=c.div` - display: flex; - justify-content: center; - gap: 5px; - - span { - width: 8px; - height: 8px; - border-radius: 50%; - background: #ddd; - cursor: pointer; - } - - span.active { - background: #000; - } -`,JO=c.div` - display: flex; - flex-direction: column; - align-items: flex-start; /* 세로로 가운데 정렬 */ - width: 100%; -`,XO=c.div` - margin-left: 20px; - display: flex; - align-items: center; /* Label과 Url을 같은 높이에 배치 */ - gap: 10px; /* Label과 Url 사이 간격 */ - padding: 10px; - border: none; -`,ZO=c.input` - width: 285px; - flex: 1; - padding: 10px; - background-color: #ececec; - border: 1px solid ${({isError:e})=>e?"red":"#ccc"}; - border-radius: 5px; -`,eT=c.span` - margin-left: 125px; - color: red; - font-size: 0.8rem; - margin-top: 5px; -`,tT=c.div` - display: flex; - flex-direction: column; /* 세로 정렬 */ - align-items: flex-start; /* 왼쪽 정렬 */ - justify-content: space-between; /* 위아래 요소 간격 균등 */ - width: 490px; - height: 495px; /* ImageUploadContainer와 동일한 고정 높이 */ - flex-grow: 1; /* 가로 공간을 균등 분배 */ - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px; - box-sizing: border-box; -`,nT=c.div` - display: flex; - flex-direction: column; /* 세로 정렬 */ - gap: 50px; /* 컴포넌트 간 간격 */ - width: 100%; -`,ds=c.div` - display: flex; - flex-direction: row; /* 가로 배치 */ - align-items: center; /* 세로 중앙 정렬 */ - gap: 10px; /* 컴포넌트 간 간격 */ - width: 100%; -`,$o=c.label` - font-size: 1.2rem; - font-weight: bold; - flex-shrink: 0; /* 라벨 크기를 고정 */ - text-align: left; /* 라벨 텍스트 왼쪽 정렬 */ -`,rT=c.input` - width: 80%; - padding: 10px; - background-color: #ececec; - border: 1px solid #ccc; - border-radius: 5px; -`,oT=c.div` - display: flex; - flex-direction: column; /* 라벨과 카테고리를 세로로 배치 */ -`,iT=c.label` - font-size: 1.2rem; - font-weight: bold; - margin-bottom: 10px; /* 라벨과 카테고리 사이 간격 */ -`,sT=c(Fc)` - display: flex; - flex-wrap: wrap; - gap: 8px; - padding: 10px 0; - - div { - padding: 12px !important; /* 강제로 적용 */ - flex: 1 1 calc(25% - 8px); - box-sizing: border-box; - - &:hover { - background-color: #f0f0f0 !important; /* 호버 스타일도 강제 */ - } - - &.active { - font-weight: bold !important; /* 활성 상태 스타일 강제 */ - border-bottom: 2px solid black !important; - } - } -`,aT=c.div` - display: flex; - flex-direction: column; /* 세로 정렬 */ - gap: 20px; /* 컴포넌트 간 간격 */ - width: 100%; -`,ed=c.input` - width: 100px; - padding: 10px 0px; - text-align: center; - background-color: #ececec; - border: 1px solid #ccc; - border-radius: 5px; -`,lT=c.div` - position: relative; -`,cT=c.button` - width: 120px; - padding: 10px; - border: 1px solid #ccc; - border-radius: 5px; - font-weight: bold; - display: flex; - gap: 10px; - justify-content: center; - align-items: center; - box-sizing: border-box; -`,uT=c.div` - position: absolute; - width: 120px; - top: 100%; - left: 0; - right: 0; - font-size: 0.9rem; - border: 1px solid #ccc; - border-radius: 5px; - background: #fff; - z-index: 1000; - box-sizing: border-box; -`,dT=c.div` - padding: 10px; - text-align: center; - cursor: pointer; - background: ${({isSelected:e})=>e?"#f0f0f0":"#fff"}; - font-weight: ${({isSelected:e})=>e?"bold":"normal"}; - - &:hover { - background: #eaeaea; - } -`,fT=c.div` - display: flex; - flex-direction: row; /* 가로 배치 */ - gap: 20px; /* 두 요소 간 간격 */ - width: 100%; /* 부모 컨테이너에 맞게 확장 */ - align-items: center; /* 세로 중앙 정렬 */ -`,pT=c.div` - width: 100%; /* Wrapper 크기는 기존 유지 */ - max-width: 1100px; - margin: 0 auto; - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px; /* 내부 여백 */ - margin-bottom: 20px; - box-sizing: border-box; -`,hT=c.textarea` - width: 100%; - height: 460px; /* 고정된 높이 */ - background-color: #ececec; - border: none; /* 테두리 제거 */ - border-radius: 10px; - padding: 20px; - outline: none; /* 포커스 시 외곽선 제거 */ - resize: none; /* 크기 조절 비활성화 */ - font-size: 1rem; /* 텍스트 크기 */ - line-height: 1.5; - color: #333; /* 텍스트 색상 */ - box-sizing: border-box; -`,mT=c.div` - display: flex; - justify-content: flex-end; - gap: 10px; -`,td=c.button` - padding: 10px 20px; - background: #000; - color: #fff; - border: 1px solid #000; - border-radius: 5px; - cursor: pointer; - - &:hover { - background: #333; - } -`;function gT(){const e=Ee(),[t,n]=w.useState(null),[r,o]=w.useState(null),[i,a]=w.useState(!1);return w.useEffect(()=>{navigator.geolocation&&!i&&navigator.geolocation.getCurrentPosition(l=>{const{latitude:u,longitude:d}=l.coords;n({latitude:u,longitude:d}),window.kakao&&new window.kakao.maps.services.Geocoder().coord2RegionCode(d,u,(f,h)=>{var b;if(h===window.kakao.maps.services.Status.OK){const y=((b=f[0])==null?void 0:b.region_3depth_name)||"";o(y),a(!0)}else console.error("주소를 가져오지 못했습니다.")})},l=>{console.error("위치 정보를 가져올 수 없습니다:",l)})},[t]),s.jsxs(ST,{children:[s.jsx(jT,{children:s.jsx("img",{src:"/images/login10.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"cover"}})}),s.jsxs(CT,{children:[s.jsxs(bT,{children:["우리동네를 인증하고",s.jsx("br",{}),"공동구매를 시작하세요"]}),s.jsx(wT,{children:"위치서비스를 허용해주세요"}),s.jsxs(yT,{children:[t?s.jsx(Uv,{latitude:t.latitude,longitude:t.longitude,appKey:"af7394f12b174cad35e87960ddccf91f",width:400}):s.jsx("p",{children:"위치 정보를 불러오는 중..."}),s.jsxs(xT,{children:["현재 위치가 내 동네로 설정한 ",r||"00동","에 있습니다."]})]}),s.jsx(vT,{onClick:async()=>{r&&((await H4({address:r})).message==="주소 확인 완료"?(localStorage.setItem("address",r),e("/setnickname")):alert("주소를 다시 확인해주세요."))},children:"Next"})]})]})}const xT=c.div` - color: #88868c; -`,yT=c.div` - display: inline-flex; - align-items: center; - justify-content: center; - width: 100%; - flex-direction: column; - gap: 20px; - margin-top: 20px; -`,vT=c.div` - background-color: #000; - color: #fff; - border-radius: 5px; - width: calc(100% - 20px); - height: 35px; - display: inline-flex; - align-items: center; - justify-content: center; - margin-top: 35px; - cursor: pointer; -`,wT=c.div` - font-size: 12px; - font-weight: 500; - margin-top: 10px; -`,bT=c.div` - font-size: 30px; - font-weight: 900; - margin-bottom: 20px; -`,jT=c.div` - flex: 6; - display: flex; - align-items: center; - justify-content: center; - overflow: hidden; -`,CT=c.div` - flex: 4; - background-color: #fff; - display: flex; - align-items: flex-start; - justify-content: center; - flex-direction: column; - padding-left: 20px; -`,ST=c.div` - display: flex; - width: 100%; - height: 100vh; -`,nd="http://localhost:8080/api/v1/virtual",Wv=({orderId:e,amount:t,title:n,customerName:r,customerEmail:o,onClose:i,onComplete:a})=>{const[l,u]=w.useState(!1),d=async()=>{u(!0);try{const p=await re.post(`${nd}`,{orderId:e,amount:t,orderName:n,customerName:r,customerEmail:o,validHours:12,successUrl:`${nd}/success`,failUrl:`${nd}/fail`,method:"VIRTUAL_ACCOUNT"},{headers:{Authorization:`Basic ${btoa("토스 시크릿 키:")}`,"Content-Type":"application/json"}});a(p.data)}catch(p){console.error("가상 계좌 발급 실패:",p),alert("가상 계좌 발급에 실패했습니다.")}finally{u(!1)}};return s.jsx(kT,{children:s.jsxs(PT,{children:[s.jsx(ET,{children:"가상 계좌 발급"}),s.jsxs(RT,{children:[s.jsxs("p",{children:["상품명: ",n]}),s.jsxs("p",{children:["결제 금액: ",t.toLocaleString()," 원"]})]}),s.jsxs(AT,{children:[s.jsx(IT,{onClick:d,disabled:l,children:l?"발급 중...":"발급"}),s.jsx(DT,{onClick:i,children:"닫기"})]})]})})},kT=c.div` - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background: rgba(0, 0, 0, 0.5); - display: flex; - justify-content: center; - align-items: center; - z-index: 1000; -`,PT=c.div` - background: #fff; - padding: 20px; - border-radius: 10px; - width: 400px; - text-align: center; - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); -`,ET=c.h2` - font-size: 1.5rem; - font-weight: bold; - margin-bottom: 20px; -`,RT=c.div` - margin-bottom: 20px; - - p { - margin: 5px 0; - font-size: 1rem; - } -`,AT=c.div` - display: flex; - justify-content: space-between; -`,IT=c.button` - padding: 10px 20px; - font-size: 1rem; - background-color: #007bff; - color: #fff; - border: none; - border-radius: 5px; - cursor: pointer; - - &:disabled { - background-color: #ccc; - cursor: not-allowed; - } - - &:hover:not(:disabled) { - background-color: #0056b3; - } -`,DT=c.button` - padding: 10px 20px; - font-size: 1rem; - background-color: #6c757d; - color: #fff; - border: none; - border-radius: 5px; - cursor: pointer; - - &:hover { - background-color: #5a6268; - } -`,OT=()=>{const e=Ee(),{state:t}=nt(),{post:n,quantity:r}=t||{},[o,i]=w.useState(null),[a,l]=w.useState(!1),[u,d]=w.useState({name:"",address:"",detailaddress:"",request:""});if(!n)return s.jsx("div",{children:"잘못된 접근입니다. 게시물 정보를 찾을 수 없습니다."});const p=()=>l(!1),f=y=>{var x;i(y),l(!1),alert(`가상계좌 발급 완료: ${(x=y.virtualAccount)==null?void 0:x.accountNumber}`)},h=y=>{const{name:x,value:j}=y.target;d({...u,[x]:j})},b=()=>{var y,x;if(!o){alert("먼저 가상계좌를 발급받아야 합니다.");return}e(`/community/post/${n.id}/payment/deposit`,{state:{bankCode:(y=o.virtualAccount)==null?void 0:y.bankCode,accountNumber:(x=o.virtualAccount)==null?void 0:x.accountNumber,totalAmount:r*n.unitAmount,onConfirm:()=>{alert("결제가 완료되었습니다."),e(`/community/post/${n.id}/payment/complete`,{state:{paymentKey:o.paymentKey,orderId:o.orderId,totalAmount:o.totalAmount,title:n.title,unitPrice:n.unitAmount,quantity:r}})}}})};return s.jsxs(TT,{children:[s.jsxs(NT,{children:[s.jsx(LT,{children:s.jsx(nx,{children:"공구 진행 결제(공구 참여자)"})}),s.jsxs(_T,{children:[s.jsxs(rd,{children:[s.jsx(rx,{children:"공구 모집 상품 정보"}),s.jsxs(MT,{children:[s.jsx($T,{children:s.jsx(zT,{children:s.jsx(FT,{children:s.jsx("img",{src:n.imageUrls[0],alt:"이미지"})})})}),s.jsxs(UT,{children:[s.jsxs(qa,{children:[s.jsx(Ya,{children:"제목"}),s.jsx(BT,{children:n.title})]}),s.jsxs(qa,{children:[s.jsx(Ya,{children:"개당 가격"}),n.unitAmount.toLocaleString()," 원"]}),s.jsxs(qa,{children:[s.jsx(Ya,{children:"수량"})," ",s.jsx(WT,{children:r})]}),s.jsxs(qa,{children:[s.jsx(Ya,{children:"결제 금액"})," ",s.jsxs(HT,{children:[(r*n.unitAmount).toLocaleString()," 원"]})]})]})]})]}),s.jsxs(rd,{children:[s.jsx(nx,{children:"배송 정보 확인"}),s.jsxs(QT,{children:[s.jsx(Ja,{placeholder:"이름을 입력하세요.",name:"name",value:u.name,onChange:h}),s.jsx(Ja,{placeholder:"주소를 입력하세요.",name:"address",value:u.address,onChange:h}),s.jsx(Ja,{placeholder:"상세 주소를 입력하세요.",name:"detailaddress",value:u.detailaddress,onChange:h}),s.jsx(Ja,{placeholder:"배송 요청사항을 입력하세요.",name:"request",value:u.request,onChange:h})]})]}),s.jsxs(rd,{children:[s.jsx(rx,{children:"결제 정보 확인"}),s.jsx(VT,{children:s.jsx(KT,{onClick:()=>l(!0),children:"가상계좌 발급"})})]}),s.jsxs(GT,{children:[s.jsx(ox,{onClick:b,children:"결제하기"}),s.jsx(ox,{onClick:()=>e(-1),children:"뒤로가기"})]})]})]}),a&&s.jsx(Wv,{orderId:`order-${Date.now()}`,amount:r*n.unitPrice,title:n.title,customerName:"홍길동",customerEmail:"customer@example.com",onClose:p,onComplete:f})]})},TT=c.div` - display: flex; - justify-content: center; - align-items: center; - padding: 20px; -`,NT=c.div` - width: 100%; - max-width: 1120px; - margin: 0 auto; -`,LT=c.div` - margin-bottom: 30px; -`,nx=c.h1` - font-size: 1.8rem; - font-weight: bold; - color: #333; -`,_T=c.div` - display: flex; - flex-direction: column; - gap: 20px; - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px 11px; - margin-top: 50px; - position: relative; - box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ -`,rd=c.div` - background-color: #fff; - padding: 20px; - margin: 20px; - border: 1px solid #ccc; - border-radius: 10px; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - box-sizing: border-box; -`,rx=c.div` - font-size: 1.6rem; - font-weight: bold; - margin: 15px 20px; - color: #333; -`,MT=c.div` - display: flex; - flex-direction: row; - gap: 20px; -`,$T=c.div` - display: flex; - flex-direction: column; - align-items: center; - width: 490px; - height: 400px; /* 고정된 높이 설정 */ - padding: 20px; - position: relative; - box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ -`,zT=c.div` - display: flex; - justify-content: space-between; /* 좌우 버튼 공간 확보 */ - align-items: center; /* 수직 중앙 정렬 */ - margin: auto 0; - width: 100%; - position: relative; /* 자식 요소 위치 기준 */ - overflow: hidden; /* 높이를 벗어난 콘텐츠 숨김 */ -`,FT=c.div` - flex: 1; /* 이미지 영역이 버튼 사이에 위치 */ - display: flex; - align-items: center; - justify-content: center; - width: 400px; - height: 100%; - border: 1px solid #fff; - border-radius: 10px; - overflow: hidden; /* 콘텐츠가 영역을 벗어나지 않도록 */ - - img { - max-width: 100%; /* 부모 너비를 넘지 않도록 */ - max-height: 100%; /* 부모 높이를 넘지 않도록 */ - object-fit: contain; /* 비율을 유지하며 부모 크기 안에 맞춤 */ - } -`,UT=c.div` - display: flex; - flex-direction: column; - justify-content: space-between; - width: 490px; - height: 400px; /* 고정된 높이 설정 */ - padding: 50px 20px; - position: relative; - box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ -`,qa=c.div` - display: flex; - align-items: center; -`,Ya=c.div` - margin-right: 15px; - font-size: 1.4rem; - font-weight: bold; - flex-shrink: 0; /* 라벨 크기를 고정 */ -`,BT=c.div` - display: -webkit-box; /* Flexbox 기반으로 동작 */ - -webkit-line-clamp: 1; - -webkit-box-orient: vertical; /* 수직 방향 박스 정렬 */ - overflow: hidden; /* 넘치는 텍스트 숨김 */ - text-overflow: ellipsis; /* 넘치는 텍스트에 ... 표시 */ - white-space: normal; /* 줄바꿈 허용 */ - color: #333; /* 텍스트 색상 */ -`,WT=c.div` - display: flex; - gap: 10px; - align-items: center; -`,HT=c.div` - display: flex; - gap: 10px; - align-items: center; -`,VT=c.div` - display: flex; - margin: 50px 0; - justify-content: center; - align-items: center; -`,QT=c.div` - border: 1px solid #ccc; - padding: 20px; - border-radius: 8px; -`,Ja=c.input` - width: 100%; - margin-bottom: 10px; - padding: 10px; - border: 1px solid #ccc; - border-radius: 4px; -`,KT=c.button` - padding: 40px 50px; - font-size: 1.2rem; - font-weight: bold; - background-color: #f5f5f5; - border: 1px solid #000; - border-radius: 10px; - cursor: pointer; - box-sizing: border-box; - box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.1); - - &:hover { - background-color: #e5e5e5; - } -`,GT=c.div` - display: flex; - justify-content: flex-end; - padding: 0 20px; - gap: 20px; -`,ox=c.button` - padding: 10px 20px; - font-size: 16px; - font-weight: bold; - background-color: #000; - color: #fff; - border: none; - border-radius: 5px; - cursor: pointer; - - &:hover { - background-color: #444; - } -`,qT=()=>{const e=Ee(),{state:t}=nt(),{post:n,quantity:r}=t||{},[o,i]=w.useState(null),[a,l]=w.useState(!1);if(!n)return s.jsx("div",{children:"잘못된 접근입니다. 게시물 정보를 찾을 수 없습니다."});const u=()=>l(!1),d=f=>{var h;i(f),l(!1),alert(`가상계좌 발급 완료: ${(h=f.virtualAccount)==null?void 0:h.accountNumber}`)},p=()=>{var f,h;if(!o){alert("먼저 가상계좌를 발급받아야 합니다.");return}e(`/community/post/${n.id}/payment/deposit`,{state:{bankCode:(f=o.virtualAccount)==null?void 0:f.bankCode,accountNumber:(h=o.virtualAccount)==null?void 0:h.accountNumber,totalAmount:r*n.unitAmount,onConfirm:()=>{alert("결제가 완료되었습니다."),e(`/community/post/${n.id}/payment/complete`,{state:{paymentKey:o.paymentKey,orderId:o.orderId,totalAmount:o.totalAmount,title:n.title,unitPrice:n.unitAmount,quantity:r}})}}})};return s.jsxs(YT,{children:[s.jsxs(JT,{children:[s.jsx(XT,{children:s.jsx(ZT,{children:"공구 진행 결제(공구 참여자)"})}),s.jsxs(eN,{children:[s.jsxs(ix,{children:[s.jsx(sx,{children:"공구 모집 상품 정보"}),s.jsxs(tN,{children:[s.jsx(nN,{children:s.jsx(rN,{children:s.jsx(oN,{children:s.jsx("img",{src:n.imageUrls[0],alt:"이미지"})})})}),s.jsxs(iN,{children:[s.jsxs(Xa,{children:[s.jsx(Za,{children:"제목"}),s.jsx(sN,{children:n.title})]}),s.jsxs(Xa,{children:[s.jsx(Za,{children:"개당 가격"}),n.unitAmount.toLocaleString()," 원"]}),s.jsxs(Xa,{children:[s.jsx(Za,{children:"수량"})," ",s.jsx(aN,{children:r})]}),s.jsxs(Xa,{children:[s.jsx(Za,{children:"결제 금액"})," ",s.jsxs(lN,{children:[(r*n.unitAmount).toLocaleString()," 원"]})]})]})]})]}),s.jsxs(ix,{children:[s.jsx(sx,{children:"결제 정보 확인"}),s.jsx(cN,{children:s.jsx(uN,{onClick:()=>l(!0),children:"가상계좌 발급"})})]}),s.jsxs(dN,{children:[s.jsx(ax,{onClick:p,children:"결제하기"}),s.jsx(ax,{onClick:()=>e(-1),children:"뒤로가기"})]})]})]}),a&&s.jsx(Wv,{orderId:`order-${Date.now()}`,amount:r*n.unitPrice,title:n.title,customerName:"홍길동",customerEmail:"customer@example.com",onClose:u,onComplete:d})]})},YT=c.div` - display: flex; - justify-content: center; - align-items: center; - padding: 20px; -`,JT=c.div` - width: 100%; - max-width: 1120px; - margin: 0 auto; -`,XT=c.div` - margin-bottom: 30px; -`,ZT=c.h1` - font-size: 1.8rem; - font-weight: bold; - color: #333; -`,eN=c.div` - display: flex; - flex-direction: column; - gap: 20px; - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px 11px; - margin-top: 50px; - position: relative; - box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ -`,ix=c.div` - background-color: #fff; - padding: 20px; - margin: 20px; - border: 1px solid #ccc; - border-radius: 10px; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - box-sizing: border-box; -`,sx=c.div` - font-size: 1.6rem; - font-weight: bold; - margin: 15px 20px; - color: #333; -`,tN=c.div` - display: flex; - flex-direction: row; - gap: 20px; -`,nN=c.div` - display: flex; - flex-direction: column; - align-items: center; - width: 490px; - height: 400px; /* 고정된 높이 설정 */ - padding: 20px; - position: relative; - box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ -`,rN=c.div` - display: flex; - justify-content: space-between; /* 좌우 버튼 공간 확보 */ - align-items: center; /* 수직 중앙 정렬 */ - margin: auto 0; - width: 100%; - position: relative; /* 자식 요소 위치 기준 */ - overflow: hidden; /* 높이를 벗어난 콘텐츠 숨김 */ -`,oN=c.div` - flex: 1; /* 이미지 영역이 버튼 사이에 위치 */ - display: flex; - align-items: center; - justify-content: center; - width: 400px; - height: 100%; - border: 1px solid #fff; - border-radius: 10px; - overflow: hidden; /* 콘텐츠가 영역을 벗어나지 않도록 */ - - img { - max-width: 100%; /* 부모 너비를 넘지 않도록 */ - max-height: 100%; /* 부모 높이를 넘지 않도록 */ - object-fit: contain; /* 비율을 유지하며 부모 크기 안에 맞춤 */ - } -`,iN=c.div` - display: flex; - flex-direction: column; - justify-content: space-between; - width: 490px; - height: 400px; /* 고정된 높이 설정 */ - padding: 50px 20px; - position: relative; - box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ -`,Xa=c.div` - display: flex; - align-items: center; -`,Za=c.div` - margin-right: 15px; - font-size: 1.4rem; - font-weight: bold; - flex-shrink: 0; /* 라벨 크기를 고정 */ -`,sN=c.div` - display: -webkit-box; /* Flexbox 기반으로 동작 */ - -webkit-line-clamp: 1; - -webkit-box-orient: vertical; /* 수직 방향 박스 정렬 */ - overflow: hidden; /* 넘치는 텍스트 숨김 */ - text-overflow: ellipsis; /* 넘치는 텍스트에 ... 표시 */ - white-space: normal; /* 줄바꿈 허용 */ - color: #333; /* 텍스트 색상 */ -`,aN=c.div` - display: flex; - gap: 10px; - align-items: center; -`,lN=c.div` - display: flex; - gap: 10px; - align-items: center; -`,cN=c.div` - display: flex; - margin: 50px 0; - justify-content: center; - align-items: center; -`,uN=c.button` - padding: 40px 50px; - font-size: 1.2rem; - font-weight: bold; - background-color: #f5f5f5; - border: 1px solid #000; - border-radius: 10px; - cursor: pointer; - box-sizing: border-box; - box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.1); - - &:hover { - background-color: #e5e5e5; - } -`,dN=c.div` - display: flex; - justify-content: flex-end; - padding: 0 20px; - gap: 20px; -`,ax=c.button` - padding: 10px 20px; - font-size: 16px; - font-weight: bold; - background-color: #000; - color: #fff; - border: none; - border-radius: 5px; - cursor: pointer; - - &:hover { - background-color: #444; - } -`,fN=async e=>{try{return(await re.get(`/api/v1/virtual/update-payment/${e}`)).data}catch(t){throw console.error("결제 상태 확인 실패:",t),new Error("결제 상태 확인에 실패했습니다.")}},pN=async e=>{try{return(await re.post("/chat",{postId:e})).data}catch(t){throw console.error("채팅방 생성 오류:",t),new Error("채팅방을 생성할 수 없습니다.")}},hN=async()=>{try{return(await re.get("/admin/chatlist")).data}catch(e){throw console.error("채팅방 목록 조회 오류:",e),new Error("채팅방 목록을 불러올 수 없습니다.")}},mN=async e=>{try{return(await re.get(`/chat/${e}/messages`)).data}catch(t){throw console.error("채팅 메시지 조회 오류:",t),new Error("채팅 메시지를 조회할 수 없습니다.")}},gN=async e=>{try{return(await re.delete(`/chat/${e}`)).data}catch(t){throw console.error("채팅방 삭제 오류:",t),new Error("채팅방을 삭제할 수 없습니다.")}},xN=({chatRoomId:e,chatMembers:t,webSocketService:n,isAdmin:r=!1})=>{const[o,i]=w.useState([]),[a,l]=w.useState(""),u=w.useRef(null),d="user-00001";w.useEffect(()=>{(async()=>{try{const j=await mN(e),g={senderId:"system",content:`${t.map(v=>p(v)).join(", ")}님이 입장하셨습니다.`,timestamp:null};i([g,{senderId:"system",content:` -안내사항: 환불 및 이탈 관련 정책 - 1. 환불 및 수령 시간/위치 조율 - - 공구 진행 중(최종 승인 이후)인 채팅방에서 - 수령 위치 및 시간을 조율합니다. - - 이탈자가 발생하거나 환불 요청이 있을 경우, - 이탈자는 채팅방에서 환불 의사를 명확히 - 표시해야 하며, 모든 참여 인원이 동의한 - 경우에 한해 환불이 진행됩니다. - 2. 환불 및 비용 부담 - - 환불 진행 시, 전체 환불 처리 및 해당 인원에 - 대한 신고 접수가 이루어지며, 이로 인해 - 발생하는 모든 비용(공구 물품 반송 등)은 - 이탈자 본인이 전액 부담합니다. - 3. 이탈자에 대한 페널티 제도 - - 이탈 행위가 반복될 경우, 아래와 같은 - 경고 시스템이 적용됩니다. - - 1회 경고: 계정 일주일 정지 - - 3회 경고: 계정 한 달 정지 - - 5회 경고: 계정 영구 정지 - - 💡 주의: 본 안내사항을 숙지하지 않아 발생하는 - 불이익은 본인에게 책임이 있습니다. - -공구 진행에 차질이 없도록 적극적인 협조 -부탁드립니다. 😊`,timestamp:null},...j])}catch(j){console.error("Failed to fetch messages:",j)}})()},[e,t]);const p=x=>x==="system"?"":x===d?"나":x;w.useEffect(()=>{const x=j=>{i(g=>[...g,j])};return n.connect(()=>{n.subscribe(`/sub/message/${e}`,j=>{const g=JSON.parse(j.body);x(g)}),console.log("WebSocket connected to room")},()=>console.log("WebSocket disconnected"),()=>console.error("WebSocket connection error")),()=>{n.unsubscribe(`/sub/message/${e}`),n.close()}},[e,n]),w.useEffect(()=>{u.current&&(u.current.scrollTop=u.current.scrollHeight)},[o]);const f=()=>{if(!a.trim())return;const x={senderId:r?"system":d,content:r?`[관리자 메시지] ${a.trim()}`:a.trim(),timestamp:new Date().toISOString()};n.send(`/pub/message/${e}`,JSON.stringify(x)),i(j=>[...j,x]),l("")},h=x=>new Date(x).toLocaleDateString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",weekday:"short"}),y=(x=>{const j=[];let g="";for(const m of x){const v=m.timestamp?h(m.timestamp):null;v&&v!==g&&(j.push({type:"date",content:v,senderId:"system",timestamp:null}),g=v),j.push(m)}return j})(o);return s.jsxs(yN,{children:[s.jsxs(vN,{children:[y.map((x,j)=>{var m;const g=x.senderId==="system"&&((m=x.content)==null?void 0:m.includes("안내사항: 환불 및 이탈 관련 정책"));return x.type==="date"?s.jsx(wN,{children:x.content},`date-${j}`):s.jsxs(bN,{isCurrentUser:x.senderId===d,isSystemMessage:x.senderId==="system",children:[s.jsx(jN,{children:x.senderId==="system"?"":p(x.senderId)}),s.jsx(CN,{isCurrentUser:x.senderId===d,isGroupNotice:g,isSystemMessage:x.senderId==="system",children:x.content}),x.timestamp&&x.senderId!=="system"&&s.jsx(SN,{children:new Date(x.timestamp).toLocaleTimeString()})]},j)}),s.jsx("div",{ref:u})]}),s.jsxs(kN,{children:[s.jsx(PN,{type:"text",value:a,onChange:x=>l(x.target.value),placeholder:"메시지를 입력하세요.",onKeyDown:x=>x.key==="Enter"&&f()}),s.jsx(EN,{onClick:f,disabled:!a.trim(),children:s.jsx(iE,{})})]})]})},yN=c.div` - display: flex; - flex-direction: column; - height: 100%; - max-height: 600px; - border: 1px solid #ccc; - border-radius: 8px; - overflow: hidden; - background-color: #fff; -`,vN=c.div` - flex: 1; - padding: 16px; - overflow-y: auto; - background-color: #f9f9f9; -`,wN=c.div` - text-align: center; - margin: 10px 0; - font-size: 0.9rem; - color: #888; - font-weight: bold; -`,bN=c.div` - display: flex; - flex-direction: column; - align-items: ${({isCurrentUser:e,isSystemMessage:t})=>t?"center":e?"flex-end":"flex-start"}; - margin-bottom: 12px; -`,jN=c.div` - font-size: 0.9rem; - font-weight: bold; - color: #333; - margin-bottom: 4px; -`,CN=c.div` - max-width: 70%; - background-color: ${({isCurrentUser:e,isGroupNotice:t,isSystemMessage:n})=>t||n?"#cecece":e?"#d9f9d9":"#e9e9e9"}; - color: #333; - padding: 10px; - border-radius: 12px; - word-wrap: break-word; - font-size: 1rem; - white-space: pre-wrap; /* 줄바꿈 유지 */ - text-align: ${({isGroupNotice:e})=>e?"left":"inherit"}; -`,SN=c.div` - font-size: 0.8rem; - color: #888; - margin-top: 4px; -`,kN=c.div` - display: flex; - padding: 12px; - border-top: 1px solid #ccc; - background-color: #fff; -`,PN=c.input` - flex: 1; - padding: 10px; - font-size: 1rem; - border: 1px solid #ccc; - border-radius: 8px; - outline: none; - margin-right: 8px; -`,EN=c.button` - padding: 10px 16px; - font-size: 1rem; - font-weight: bold; - color: #fff; - background-color: #4caf50; - border: none; - border-radius: 8px; - cursor: pointer; - - &:hover { - background-color: #45a049; - } - - &:disabled { - background-color: #ccc; - cursor: not-allowed; - } -`,Hv=({isOpen:e,onClose:t,chatRoomId:n,chatRoomTitle:r,isAdminPage:o=!1})=>{const i=Ee(),a=nt(),l=o||a.pathname==="/admin/chat";w.useEffect(()=>{e?i(`?roomId=${n}`,{replace:!0}):i(-1)},[e,n,i]);const u=async()=>{try{const p=new URLSearchParams(window.location.search).get("roomId");p&&(await gN(parseInt(p)),alert("채팅방이 성공적으로 삭제되었습니다."),t())}catch(d){console.error("채팅방 삭제 실패:",d),alert("채팅방을 삭제할 수 없습니다.")}};return e?s.jsx(RN,{children:s.jsxs(AN,{children:[s.jsxs(IN,{children:[s.jsx(DN,{children:r}),s.jsxs(ON,{children:[l&&s.jsx(TN,{onClick:u,children:s.jsx(oE,{})}),s.jsx(NN,{onClick:t,children:"×"})]})]}),s.jsx(LN,{children:s.jsx(xN,{chatRoomId:parseInt(n,10),chatMembers:[],webSocketService:Zs,isAdmin:o})})]})}):null},RN=c.div` - position: fixed; - top: 0; - left: 0; - width: 100%; - height: 100%; - background-color: rgba(0, 0, 0, 0.5); - display: flex; - justify-content: center; - align-items: center; - z-index: 9999; -`,AN=c.div` - width: 90%; - max-width: 600px; - background-color: #fff; - border-radius: 10px; - overflow: hidden; - display: flex; - flex-direction: column; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); -`,IN=c.div` - padding: 16px; - background-color: #f7f7f7; - border-bottom: 1px solid #ddd; - display: flex; - justify-content: space-between; - align-items: center; -`,DN=c.h2` - font-size: 18px; - font-weight: bold; - color: #333; - display: -webkit-box; - -webkit-line-clamp: 1; - -webkit-box-orient: vertical; - overflow: hidden; - text-overflow: ellipsis; -`,ON=c.div` - display: flex; - gap: 8px; -`,TN=c.button` - background: none; - border: none; - padding: 6px 12px; - cursor: pointer; - color: #666; - - &:hover { - color: #333; - } -`,NN=c.button` - background: none; - border: none; - font-size: 20px; - cursor: pointer; - color: #666; - - &:hover { - color: #333; - } -`,LN=c.div` - flex: 1; - padding: 16px; - overflow-y: auto; -`,_N=()=>{const e=Ee(),n=nt().state;if(!n||!n.communityPostId||!n.quantity)return s.jsx("div",{children:"잘못된 접근입니다."});const{communityPostId:r,quantity:o}=n,[i,a]=w.useState(null),[l,u]=w.useState(null),[d,p]=w.useState("WAITING_FOR_DEPOSIT"),[f,h]=w.useState(!1),[b,y]=w.useState(null);w.useEffect(()=>{const m=async()=>{try{const C=await fN(r);a(C),C.status==="DONE"&&p("DONE")}catch(C){console.error("결제 상태 조회 오류:",C),alert("결제 상태를 확인할 수 없습니다.")}},v=async()=>{try{const C=await si(Number(r));u({title:C.title,unitAmount:C.unitAmount})}catch(C){console.error("게시물 정보 조회 오류:",C),alert("게시물 정보를 가져올 수 없습니다.")}};m(),v()},[r]);const x=async()=>{try{const m=await pN(parseInt(r));y(m)}catch(m){console.error("채팅방 생성 오류:",m),alert("채팅방을 생성할 수 없습니다.")}},j=async()=>{b||await x(),h(!0)},g=()=>h(!1);return!i||!l?s.jsx("div",{children:"로딩 중..."}):s.jsxs(MN,{children:[d==="WAITING_FOR_DEPOSIT"?s.jsx(s.Fragment,{children:s.jsx(lx,{children:"결제 상태를 확인 중입니다..."})}):s.jsxs(s.Fragment,{children:[s.jsx(lx,{children:"결제가 정상적으로 완료되었습니다."}),s.jsxs($N,{children:[s.jsxs("p",{children:["주문 ID: ",i.orderId]}),s.jsxs("p",{children:["상품명: ",l.title]}),s.jsxs("p",{children:["개당 가격: ",l.unitAmount.toLocaleString()," 원"]}),s.jsxs("p",{children:["수량: ",o]}),s.jsxs("p",{children:["결제 금액: ",i.totalAmount.toLocaleString()," 원"]})]})]}),s.jsxs(zN,{children:[s.jsx(cx,{onClick:j,children:"채팅방 열기"}),s.jsx(cx,{onClick:()=>e("/mypage/orderlist"),children:"주문내역 보기"})]}),b&&s.jsx(Hv,{isOpen:f,onClose:g,chatRoomId:b.id.toString(),chatRoomTitle:b.roomName,webSocketService:Zs,isAdminPage:!1})]})},MN=c.div` - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - padding: 20px; - height: 100vh; - text-align: center; -`,lx=c.h1` - font-size: 2rem; - font-weight: bold; - color: #333; - margin-bottom: 20px; -`,$N=c.div` - display: flex; - flex-direction: column; - align-items: center; - gap: 10px; - margin-bottom: 20px; -`,zN=c.div` - display: flex; - gap: 20px; - margin-top: 20px; -`,cx=c.button` - padding: 10px 20px; - font-size: 1rem; - font-weight: bold; - color: #fff; - background-color: #000; - border: none; - border-radius: 5px; - cursor: pointer; - - &:hover { - background-color: #444; - } -`,FN=[{id:"NOT_APPROVED",name:"작성글 게시 승인 대기 목록"},{id:"REPORTED",name:"신고 접수 된 글 목록"}],UN=async e=>{try{return(await re.get("/admin/post",{params:{category:e}})).data}catch(t){throw console.error("Failed to fetch admin posts:",t),t}},BN=()=>{var a;const t=((a=nt().state)==null?void 0:a.selectedCategory)||"NOT_APPROVED",[n,r]=w.useState(t),[o,i]=w.useState([]);return w.useEffect(()=>{(async()=>{try{const u=await UN(n);i(n==="NOT_APPROVED"?u.filter(d=>d.status==="NOT_APPROVED"||d.status==="REJECTED"):u)}catch(u){console.error("Failed to fetch posts:",u)}})()},[n]),s.jsx("div",{children:s.jsx(WN,{children:s.jsxs(HN,{children:[s.jsx(QN,{children:"관리자 페이지"}),s.jsx(VN,{children:s.jsxs(KN,{children:[" ",s.jsx(Fc,{categories:FN,selectedCategory:n,onCategoryChange:l=>r(l),title:"게시글 관리"})]})}),s.jsx(Iv,{posts:o,selectedCategory:n,hideWriteButton:!0})]})})})},WN=c.div` - display: flex; - justify-content: center; - padding: 20px; -`,HN=c.div` - width: 100%; - max-width: 1120px; - margin: 0 auto; -`,VN=c.div` - display: flex; - align-items: center; /* 세로 가운데 정렬 */ - justify-content: flex-start; - margin-bottom: 20px; -`,QN=c.h1` - font-size: 1.8rem; - font-weight: bold; - margin-bottom: 1.5rem; - text-align: left; -`,KN=c.div` - display: flex; - justify-content: flex-end; - margin-left: 50px; -`,GN=()=>{const e=nt(),t=Ee(),{postId:n}=e.state||{},[r,o]=w.useState(null),[i,a]=w.useState(0);w.useEffect(()=>{(async()=>{if(!n){t("/admin/posts");return}try{const b=await si(n);o(b)}catch(b){console.error("Failed to fetch post details:",b)}})()},[n,t]);const l=()=>{r&&a(h=>(h+1)%r.imageUrls.length)},u=()=>{r&&a(h=>(h-1+r.imageUrls.length)%r.imageUrls.length)},d=h=>{a(h)},p=async()=>{if(r)try{await sc(n,"APPROVED"),alert("게시물이 승인되었습니다."),t("/admin/post")}catch(h){console.error("Failed to approve post:",h),alert("승인 처리 중 오류가 발생했습니다.")}},f=async()=>{if(r)try{await sc(n,"REJECTED"),alert("게시물이 거절 처리되었습니다."),t("/admin/post")}catch(h){console.error("Failed to reject post:",h),alert("거절 처리 중 오류가 발생했습니다.")}};return r?s.jsx(qN,{children:s.jsxs(YN,{children:[s.jsxs(JN,{children:[s.jsx(XN,{children:"작성글 게시 승인 대기"}),s.jsx(ZN,{children:s.jsx(eL,{onClick:()=>t(-1),children:s.jsx(Jp,{size:24})})})]}),s.jsxs(tL,{children:[s.jsxs(nL,{children:[s.jsxs(rL,{children:[s.jsxs(oL,{children:[s.jsx(sL,{children:r.imageUrls.length>1&&i>0&&s.jsx(lL,{onClick:u,children:s.jsx($c,{size:20})})}),s.jsx(iL,{children:s.jsx("img",{src:r.imageUrls[i],alt:`이미지 ${i+1}`})}),s.jsx(aL,{children:r.imageUrls.length>1&&i1&&s.jsx(dL,{children:r.imageUrls.map((h,b)=>s.jsx("span",{className:i===b?"active":"",onClick:()=>d(b)},b))})}),s.jsx(fL,{children:s.jsxs(pL,{children:[s.jsx(zn,{htmlFor:"urlInput",children:"URL 주소"}),s.jsx(hL,{children:r.productUrl})]})})]}),s.jsx(mL,{children:s.jsxs(gL,{children:[s.jsxs(zo,{children:[s.jsx(zn,{children:"제목"}),s.jsx(xL,{children:r.title})]}),s.jsxs(el,{children:[s.jsxs(yL,{children:[s.jsx(zn,{children:"작성자"}),s.jsx(vL,{children:r.nickname})]}),s.jsxs(wL,{children:[s.jsx(zn,{children:"작성일"})," ",new Date(r.createdAt).toLocaleString()]})]}),s.jsxs(el,{children:[s.jsxs(zo,{children:[s.jsx(zn,{children:"카테고리"})," ",r.category]}),s.jsxs(zo,{children:[s.jsx(zn,{children:"참여 현황"})," ",r.currentQuantity," / ",r.availableNumber]})]}),s.jsx(el,{children:s.jsxs(zo,{children:[s.jsx(zn,{children:"모집 마감 기간"})," ",r.period,"일"]})}),s.jsxs(el,{children:[s.jsxs(zo,{children:[s.jsx(zn,{children:"총 가격"})," ",r.totalAmount.toLocaleString()," ","원"]}),s.jsxs(zo,{children:[s.jsx(zn,{children:"개당 가격"})," ",r.unitAmount.toLocaleString()," ","원"]})]})]})})]}),s.jsx(bL,{children:s.jsx(jL,{readOnly:!0,value:r.description})}),s.jsxs(CL,{children:[s.jsx(SL,{onClick:p,children:"승인"}),s.jsx(kL,{onClick:f,children:"거절"})]})]})]})}):s.jsx("div",{children:"Loading..."})},qN=c.div` - padding: 20px; - display: flex; - flex-direction: column; - align-items: center; -`,YN=c.div` - width: 100%; - max-width: 1120px; - margin: 0 auto; -`,JN=c.div` - display: flex; - flex-direction: column; /* Title과 HeaderWrapper를 세로로 배치 */ - gap: 10px; /* Title과 HeaderWrapper 사이 간격 */ - margin-bottom: 1.5rem; -`,XN=c.h1` - font-size: 1.8rem; - font-weight: bold; - text-align: left; - margin: 0; /* Title의 기본 마진 제거 */ -`,ZN=c.div` - width: 1000px; - margin: 30px auto 0; - display: flex; - justify-content: space-between; - align-items: center; -`,eL=c.button` - background: none; - border: none; - cursor: pointer; -`,tL=c.div` - display: flex; - flex-direction: column; - background: #fff; - padding: 20px; - border-radius: 10px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -`,nL=c.div` - display: flex; /* 가로 정렬 */ - flex-direction: row; /* 기본값이므로 명시적으로 추가 */ - align-items: stretch; /* 양쪽 요소의 높이를 동일하게 */ - justify-content: center; /* 양쪽 여백 균등 배치 */ - gap: 20px; /* 두 컨테이너 사이 간격 */ - margin-bottom: 20px; /* 아래 요소와의 간격 */ -`,rL=c.div` - display: flex; - flex-direction: column; - align-items: center; - width: 490px; - height: 470px; /* 고정된 높이 설정 */ - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px 11px; - position: relative; - box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ -`,oL=c.div` - display: flex; - justify-content: space-between; /* 좌우 버튼 공간 확보 */ - align-items: center; /* 수직 중앙 정렬 */ - width: 100%; - height: 320px; /* 기준 높이 */ - position: relative; /* 자식 요소 위치 기준 */ - overflow: hidden; /* 높이를 벗어난 콘텐츠 숨김 */ -`,iL=c.div` - flex: 1; /* 이미지 영역이 버튼 사이에 위치 */ - display: flex; - align-items: center; - justify-content: center; - width: 400px; - height: 100%; - border: 1px solid #ccc; - border-radius: 10px; - overflow: hidden; /* 콘텐츠가 영역을 벗어나지 않도록 */ - - img { - max-width: 100%; /* 부모 너비를 넘지 않도록 */ - max-height: 100%; /* 부모 높이를 넘지 않도록 */ - object-fit: contain; /* 비율을 유지하며 부모 크기 안에 맞춤 */ - } -`,sL=c.div` - flex: 0 0 32px; /* 버튼 고정 너비 */ - display: flex; - justify-content: center; - align-items: center; - height: 100%; /* PreviewWrapper의 높이에 맞춤 */ -`,aL=c.div` - flex: 0 0 32px; /* 버튼 고정 너비 */ - display: flex; - justify-content: center; - align-items: center; - height: 100%; /* PreviewWrapper의 높이에 맞춤 */ -`,lL=c.button` - background: none; - border: none; - color: #333; - cursor: pointer; -`,cL=c.button` - background: none; - border: none; - color: #333; - cursor: pointer; -`,uL=c.div` - width: 100%; - height: 54px; /* 높이 설정 */ - display: flex; /* 플렉스 박스로 변경 */ - align-items: center; /* 세로 중앙 정렬 */ - justify-content: center; /* 가로 중앙 정렬 */ -`,dL=c.div` - display: flex; - justify-content: center; - gap: 5px; - - span { - width: 8px; - height: 8px; - border-radius: 50%; - background: #ddd; - cursor: pointer; - } - - span.active { - background: #000; - } -`,fL=c.div` - display: flex; - flex-direction: column; - align-items: flex-start; /* 세로로 가운데 정렬 */ - width: 100%; -`,pL=c.div` - margin-left: 20px; - display: flex; - align-items: center; /* Label과 Url을 같은 높이에 배치 */ - gap: 10px; /* Label과 Url 사이 간격 */ - padding: 10px; - border: none; -`,hL=c.div` - width: 285px; - flex: 1; - padding: 10px; - border: none; - border-radius: 5px; -`,mL=c.div` - display: flex; - flex-direction: column; /* 세로 정렬 */ - align-items: flex-start; /* 왼쪽 정렬 */ - justify-content: space-between; /* 위아래 요소 간격 균등 */ - width: 490px; - max-width: 490px; /* 최대 너비 고정 */ - height: 470px; /* ImageUploadContainer와 동일한 고정 높이 */ - flex-grow: 1; /* 가로 공간을 균등 분배 */ - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px; - box-sizing: border-box; -`,gL=c.div` - display: flex; - flex-direction: column; - gap: 20px; /* 컴포넌트 간 간격 */ - width: 100%; -`,zo=c.div` - display: flex; - flex-direction: column; - font-size: 1rem; -`,zn=c.label` - font-size: 1.2rem; - font-weight: bold; - margin-bottom: 4px; /* Label과 텍스트 사이 간격 */ -`,xL=c.span` - display: -webkit-box; /* Flexbox 기반으로 동작 */ - -webkit-line-clamp: 2; /* 두 줄까지만 표시 */ - -webkit-box-orient: vertical; /* 수직 방향 박스 정렬 */ - overflow: hidden; /* 넘치는 텍스트 숨김 */ - text-overflow: ellipsis; /* 넘치는 텍스트에 ... 표시 */ - white-space: normal; /* 줄바꿈 허용 */ - color: #333; /* 텍스트 색상 */ -`,el=c.div` - display: flex; /* 한 줄로 배치 */ - align-items: center; /* 세로 가운데 정렬 */ - justify-content: space-between; /* 양쪽 여백 균등 배치 */ - width: 100%; /* 부모 컨테이너 너비 */ - - & > div { - flex: 1; /* 내부 요소들이 동일한 크기로 영역 나눔 */ - } -`,yL=c.div` - display: flex; /* 가로 배치 */ - flex-direction: column; /* 내부 요소가 한 줄씩 배치되도록 */ - gap: 5px; /* 내부 요소 간 간격 */ -`,vL=c.div` - display: flex; /* 한 줄로 배치 */ - align-items: center; /* 세로로 가운데 정렬 */ - font-size: 1rem; /* 텍스트 크기 설정 */ -`,wL=c.div` - display: flex; /* 가로 배치 */ - flex-direction: column; /* 내부 요소가 한 줄씩 배치되도록 */ - gap: 5px; /* 내부 요소 간 간격 */ -`,bL=c.div` - width: 100%; - max-width: 1000px; - margin: 0 auto; - border: 1px solid #ccc; - border-radius: 10px; - padding: 20px; - margin-bottom: 20px; - box-sizing: border-box; -`,jL=c.textarea` - width: 100%; - height: 460px; /* 고정된 높이 */ - border: none; /* 테두리 제거 */ - border-radius: 10px; - padding: 20px; - outline: none; /* 포커스 시 외곽선 제거 */ - resize: none; /* 크기 조절 비활성화 */ - font-size: 1rem; /* 텍스트 크기 */ - line-height: 1.5; - color: #333; /* 텍스트 색상 */ - box-sizing: border-box; -`,CL=c.div` - display: flex; - justify-content: flex-end; - margin-top: 20px; - gap: 10px; -`,SL=c.button` - padding: 10px 20px; - background-color: #000; - color: white; - font-size: 1rem; - font-weight: bold; - border: none; - border-radius: 5px; - cursor: pointer; - - &:hover { - background-color: #484848; - } -`,kL=c.button` - padding: 10px 20px; - background-color: #ff0000; - color: white; - font-size: 1rem; - font-weight: bold; - border: none; - border-radius: 5px; - cursor: pointer; - - &:hover { - background-color: #ff1e1b; - } -`,PL=()=>{const{id:e}=$i();if(!e)return s.jsx("p",{children:"상품 번호가 유실되었습니다."});const t=Number(e),n=window.location.search,o=new URLSearchParams(n).get("totalAmount"),{data:i,isLoading:a,isError:l}=ma(t);return i?s.jsx(s.Fragment,{children:s.jsx(Ro,{isLoading:a,isError:l,children:s.jsxs(EL,{children:[s.jsxs(RL,{children:[s.jsx(AL,{children:"결제 실패"}),s.jsx(IL,{children:"죄송합니다. 결제에 실패하였습니다."}),s.jsxs(DL,{children:[s.jsxs(ux,{children:[s.jsx(dx,{children:"상품명"}),s.jsx(fx,{children:i==null?void 0:i.name})]}),s.jsxs(ux,{children:[s.jsx(dx,{children:"결제 금액"}),s.jsxs(fx,{children:[o," 원"]})]})]})]}),s.jsxs(OL,{children:[s.jsx(TL,{to:`/products/${t}`,children:"다시 시도하기"}),s.jsx(NL,{to:"/",children:"메인으로 돌아가기"})]})]})})}):s.jsx("p",{children:"해당 상품을 찾을 수 없습니다."})},EL=c.div` - width: 100%; - max-width: 650px; - margin: 0 auto; - padding: 20px; - background-color: #f8fafc; - display: flex; - flex-direction: column; - align-items: center; -`,RL=c.div` - width: 100%; - background-color: white; - border-radius: 12px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); - padding: 32px 20px; - text-align: center; - margin-bottom: 24px; -`,AL=c.h1` - font-size: 1.5rem; - font-weight: 700; - color: #1e293b; - margin-bottom: 12px; -`,IL=c.p` - color: #64748b; - font-size: 1rem; - margin-bottom: 24px; -`,DL=c.div` - background-color: #f8fafc; - border-radius: 8px; - padding: 16px; - margin-top: 20px; -`,ux=c.div` - display: flex; - justify-content: space-between; - margin-bottom: 12px; - - &:last-child { - margin-bottom: 0; - } -`,dx=c.span` - color: #64748b; - font-size: 0.875rem; -`,fx=c.span` - color: #1e293b; - font-weight: 500; -`,OL=c.div` - display: flex; - gap: 12px; - width: 100%; -`,Vv=c(An)` - flex: 1; - text-decoration: none; - display: flex; - justify-content: center; - align-items: center; - padding: 12px; - border-radius: 8px; - font-weight: 600; - font-size: 0.875rem; - cursor: pointer; - transition: all 0.2s; -`,TL=c(Vv)` - background-color: #2563eb; - border: none; - color: white; - - &:hover { - background-color: #1d4ed8; - } -`,NL=c(Vv)` - background-color: white; - border: 1px solid #e2e8f0; - color: #475569; - - &:hover { - background-color: #f8fafc; - } -`,od=12,LL=()=>{var x;const e=Ee(),t=nt(),[n,r]=w.useState([]),[o,i]=w.useState(1),[a,l]=w.useState(!1),d=new URLSearchParams(t.search).get("roomId"),p=Math.ceil(n.length/od);w.useEffect(()=>{(async()=>{try{const g=await hN();r(g)}catch(g){console.error("Failed to fetch chat rooms:",g)}})()},[]);const f=(o-1)*od,h=n.slice(f,f+od),b=()=>{l(!0)},y=()=>{l(!1),e(-1)};return s.jsx(_L,{children:s.jsxs(ML,{children:[s.jsxs($L,{children:[s.jsx(zL,{children:"채팅방 관리"}),s.jsx(FL,{children:s.jsx(UL,{onClick:()=>e(-1),children:s.jsx(Jp,{size:24})})})]}),s.jsxs(BL,{children:[s.jsx(WL,{children:h.map(j=>s.jsxs(HL,{onClick:b,children:[s.jsx(VL,{children:j.roomName}),s.jsxs(QL,{children:["참여자: ",j.chatMembers.join(", ")]})]},j.postId))}),s.jsx(th,{currentPage:o,totalPages:p,onPageChange:j=>i(j)}),a&&d&&s.jsx(Hv,{chatRoomId:d,chatRoomTitle:((x=n.find(j=>j.postId.toString()===d))==null?void 0:x.roomName)||"",isOpen:a,onClose:y,webSocketService:Zs,isAdminPage:!0})]})]})})},_L=c.div` - padding: 20px; - display: flex; - flex-direction: column; - align-items: center; -`,ML=c.div` - width: 100%; - max-width: 1120px; - margin: 0 auto; -`,$L=c.div` - display: flex; - flex-direction: column; /* Title과 HeaderWrapper를 세로로 배치 */ - gap: 10px; /* Title과 HeaderWrapper 사이 간격 */ - margin-bottom: 1.5rem; -`,zL=c.h1` - font-size: 1.8rem; - font-weight: bold; - text-align: left; - margin: 0; /* Title의 기본 마진 제거 */ -`,FL=c.div` - width: 1000px; - margin: 30px auto 0; - display: flex; - justify-content: space-between; - align-items: center; -`,UL=c.button` - background: none; - border: none; - cursor: pointer; -`,BL=c.div` - display: flex; - flex-direction: column; - background: #fff; - padding: 20px; - border-radius: 10px; - box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); -`,WL=c.div` - display: flex; - flex-wrap: wrap; - gap: 20px; - justify-content: flex-start; -`,HL=c.div` - background: #f9f9f9; - border: 1px solid #ddd; - border-radius: 10px; - padding: 20px; - width: 300px; - cursor: pointer; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - - &:hover { - background: #f1f1f1; - } -`,VL=c.h3` - font-size: 18px; - margin-bottom: 10px; -`,QL=c.p` - font-size: 14px; - color: #666; -`,KL=e=>({"004":"KB국민은행","045":"MG새마을금고","034":"광주은행","011":"NH농협은행","003":"IBK기업은행","088":"신한은행","020":"우리은행","007":"수협은행"})[e]||"알 수 없는 은행",GL=()=>{const e=nt(),t=Ee(),n=e.state;if(!n)return s.jsx("div",{children:"잘못된 접근입니다."});const{bankCode:r,accountNumber:o,totalAmount:i,onConfirm:a,communityPostId:l}=n,[u,d]=w.useState(""),[p,f]=w.useState(""),[h,b]=w.useState("");w.useEffect(()=>{d(KL(r))},[r]);const y=j=>{f(j.target.value),b("")},x=()=>{const j=Number(p);if(j!==i){b(`입금 금액이 정확하지 않습니다. 총 금액: ${i.toLocaleString()} 원`);return}a(j),t(`/community/post/${l}/payment/complete`,{state:{communityPostId:l}})};return s.jsx(qL,{children:s.jsxs(YL,{children:[s.jsx(JL,{children:"입금 정보 확인"}),s.jsxs(XL,{children:[s.jsxs(id,{children:[s.jsx(sd,{children:"은행명:"}),s.jsx(ad,{children:u})]}),s.jsxs(id,{children:[s.jsx(sd,{children:"계좌 번호:"}),s.jsx(ad,{children:o})]}),s.jsxs(id,{children:[s.jsx(sd,{children:"결제 금액:"}),s.jsxs(ad,{children:[i.toLocaleString()," 원"]})]})]}),s.jsxs(ZL,{children:[s.jsx(e_,{type:"number",placeholder:"입금 금액을 입력하세요",value:p,onChange:y}),h&&s.jsx(t_,{children:h})]}),s.jsx(n_,{children:s.jsx(r_,{onClick:x,children:"확인"})})]})})},qL=c.div` - display: flex; - justify-content: center; - align-items: center; - height: 100vh; - background-color: #f8f9fa; -`,YL=c.div` - background: #fff; - padding: 30px; - border-radius: 10px; - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); - max-width: 400px; - width: 100%; -`,JL=c.h1` - font-size: 1.5rem; - font-weight: bold; - text-align: center; - margin-bottom: 20px; -`,XL=c.div` - margin-bottom: 20px; -`,id=c.div` - display: flex; - justify-content: space-between; - margin-bottom: 10px; -`,sd=c.span` - font-weight: bold; - color: #333; -`,ad=c.span` - color: #555; -`,ZL=c.div` - margin-bottom: 20px; -`,e_=c.input` - width: 100%; - padding: 10px; - font-size: 1rem; - border: 1px solid #ccc; - border-radius: 5px; -`,t_=c.p` - color: red; - font-size: 0.9rem; - margin-top: 10px; -`,n_=c.div` - display: flex; - justify-content: center; -`,r_=c.button` - padding: 10px 20px; - font-size: 1rem; - font-weight: bold; - color: #fff; - background-color: #007bff; - border: none; - border-radius: 5px; - cursor: pointer; - - &:hover { - background-color: #0056b3; - } -`,fs=({children:e})=>{const{isLoggedIn:t}=Uc();return t?s.jsx(s.Fragment,{children:e}):s.jsx(FC,{to:"/signin"})},o_=qC([{path:"/",element:s.jsxs(s.Fragment,{children:[s.jsx(F4,{}),s.jsx(TO,{}),s.jsx(eh,{})]}),errorElement:s.jsx(uS,{}),children:[{path:"/",element:s.jsx(lE,{})},{path:"/products",element:s.jsx(fs,{children:s.jsx(y5,{})})},{path:"/products/:id",element:s.jsx(fs,{children:s.jsx(F5,{})})},{path:"/products/payment/:id",element:s.jsx(sO,{})},{path:"/products/payment-success/:id",element:s.jsx(SO,{})},{path:"/products/payment-fail/:id",element:s.jsx(PL,{})},{path:"/community/post",element:s.jsx(fs,{children:s.jsx(BE,{})})},{path:"/community/post/create",element:s.jsx(KE,{})},{path:"/community/post/:communityPostId",element:s.jsx(I3,{})},{path:"/mypage/post/:communityPostId/edit",element:s.jsx(NO,{})},{path:"/community/post/:communityPostId/payment/author",element:s.jsx(OT,{})},{path:"/community/post/:communityPostId/payment/participant",element:s.jsx(qT,{})},{path:"/community/post/:communityPostId/payment/deposit",element:s.jsx(GL,{})},{path:"/community/post/:communityPostId/payment/complete",element:s.jsx(_N,{})},{path:"/admin/post",element:s.jsx(fs,{children:s.jsx(BN,{})})},{path:"/admin/post/approve/:communityPostId",element:s.jsx(GN,{})},{path:"/admin/chatlist",element:s.jsxs(fs,{children:[" ",s.jsx(LL,{})]})},{path:"/mypage",children:[{path:"setting",element:s.jsx(tI,{})},{path:"orderlist",element:s.jsx(D6,{})},{path:"wishlist",element:s.jsx(T6,{})},{path:"location",element:s.jsx(G6,{})},{path:"refund",element:s.jsx(Z6,{})},{path:"notification",element:s.jsx(pD,{})},{path:"myposts",element:s.jsx(bD,{})},{path:"chatlist",element:s.jsx(TD,{})}]}]},{path:"/signin",element:s.jsx(q4,{})},{path:"/signup",element:s.jsx(rR,{})},{path:"/findpassword",element:s.jsx(dR,{})},{path:"/resetpassword",element:s.jsx(kR,{})},{path:"/termsandservice",element:s.jsx($R,{})},{path:"/setlocation",element:s.jsx(gT,{})},{path:"/setnickname",element:s.jsx(ND,{})},{path:"/setprofile",element:s.jsx(UD,{})},{path:"/logincomplete",element:s.jsx(JD,{})},{path:"*",element:s.jsx(dS,{})}],{future:{v7_relativeSplatPath:!0,v7_fetcherPersist:!0,v7_normalizeFormMethod:!0,v7_partialHydration:!0,v7_skipActionErrorRevalidation:!0}}),i_=f2` - body { - margin: 0; - font-family: 'Arial', sans-serif; - background-color: #fff; - } -`,s_=new z2({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});My(document.getElementById("root")).render(s.jsx(H2,{client:s_,children:s.jsx(E4,{children:s.jsxs(z5,{children:[s.jsx(i_,{}),s.jsx(oS,{router:o_,future:{v7_startTransition:!0}})]})})})); diff --git a/dist/assets/index-Dp4wxnjx.js b/dist/assets/index-Dp4wxnjx.js new file mode 100644 index 0000000..137d050 --- /dev/null +++ b/dist/assets/index-Dp4wxnjx.js @@ -0,0 +1,5299 @@ +var Ym=e=>{throw TypeError(e)};var ld=(e,t,n)=>t.has(e)||Ym("Cannot "+n);var y=(e,t,n)=>(ld(e,t,"read from private field"),n?n.call(e):t.get(e)),U=(e,t,n)=>t.has(e)?Ym("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),L=(e,t,n,r)=>(ld(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),K=(e,t,n)=>(ld(e,t,"access private method"),n);var xi=(e,t,n,r)=>({set _(i){L(e,t,i,n)},get _(){return y(e,t,r)}});function Ry(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function Ay(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Iy={exports:{}},Cu={},Oy={exports:{}},xe={};/** + * @license React + * react.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 dl=Symbol.for("react.element"),Cj=Symbol.for("react.portal"),Sj=Symbol.for("react.fragment"),Pj=Symbol.for("react.strict_mode"),Ej=Symbol.for("react.profiler"),kj=Symbol.for("react.provider"),Rj=Symbol.for("react.context"),Aj=Symbol.for("react.forward_ref"),Ij=Symbol.for("react.suspense"),Oj=Symbol.for("react.memo"),_j=Symbol.for("react.lazy"),Xm=Symbol.iterator;function Dj(e){return e===null||typeof e!="object"?null:(e=Xm&&e[Xm]||e["@@iterator"],typeof e=="function"?e:null)}var _y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Dy=Object.assign,Ty={};function Is(e,t,n){this.props=e,this.context=t,this.refs=Ty,this.updater=n||_y}Is.prototype.isReactComponent={};Is.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Is.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function My(){}My.prototype=Is.prototype;function gh(e,t,n){this.props=e,this.context=t,this.refs=Ty,this.updater=n||_y}var xh=gh.prototype=new My;xh.constructor=gh;Dy(xh,Is.prototype);xh.isPureReactComponent=!0;var Zm=Array.isArray,Ly=Object.prototype.hasOwnProperty,yh={current:null},Ny={key:!0,ref:!0,__self:!0,__source:!0};function $y(e,t,n){var r,i={},o=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(o=""+t.key),t)Ly.call(t,r)&&!Ny.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1>>1,Q=H[B];if(0>>1;Bi(he,ee))mei(te,he)?(H[B]=te,H[me]=ee,B=me):(H[B]=he,H[le]=ee,B=le);else if(mei(te,ee))H[B]=te,H[me]=ee,B=me;else break e}}return V}function i(H,V){var ee=H.sortIndex-V.sortIndex;return ee!==0?ee:H.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],d=[],p=1,f=null,h=3,j=!1,x=!1,g=!1,S=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(H){for(var V=n(d);V!==null;){if(V.callback===null)r(d);else if(V.startTime<=H)r(d),V.sortIndex=V.expirationTime,t(c,V);else break;V=n(d)}}function b(H){if(g=!1,v(H),!x)if(n(c)!==null)x=!0,ue(E);else{var V=n(d);V!==null&&oe(b,V.startTime-H)}}function E(H,V){x=!1,g&&(g=!1,w(R),R=-1),j=!0;var ee=h;try{for(v(V),f=n(c);f!==null&&(!(f.expirationTime>V)||H&&!_());){var B=f.callback;if(typeof B=="function"){f.callback=null,h=f.priorityLevel;var Q=B(f.expirationTime<=V);V=e.unstable_now(),typeof Q=="function"?f.callback=Q:f===n(c)&&r(c),v(V)}else r(c);f=n(c)}if(f!==null)var ae=!0;else{var le=n(d);le!==null&&oe(b,le.startTime-V),ae=!1}return ae}finally{f=null,h=ee,j=!1}}var P=!1,k=null,R=-1,I=5,D=-1;function _(){return!(e.unstable_now()-DH||125B?(H.sortIndex=ee,t(d,H),n(c)===null&&H===n(d)&&(g?(w(R),R=-1):g=!0,oe(b,ee-B))):(H.sortIndex=Q,t(c,H),x||j||(x=!0,ue(E))),H},e.unstable_shouldYield=_,e.unstable_wrapCallback=function(H){var V=h;return function(){var ee=h;h=V;try{return H.apply(this,arguments)}finally{h=ee}}}})(Wy);By.exports=Wy;var Qj=By.exports;/** + * @license React + * react-dom.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 Vj=C,Xt=Qj;function W(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kf=Object.prototype.hasOwnProperty,Kj=/^[: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][: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]*$/,tg={},ng={};function Gj(e){return kf.call(ng,e)?!0:kf.call(tg,e)?!1:Kj.test(e)?ng[e]=!0:(tg[e]=!0,!1)}function qj(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Jj(e,t,n,r){if(t===null||typeof t>"u"||qj(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ot(e,t,n,r,i,o,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var ht={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ht[e]=new Ot(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ht[t]=new Ot(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ht[e]=new Ot(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ht[e]=new Ot(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".split(" ").forEach(function(e){ht[e]=new Ot(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ht[e]=new Ot(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ht[e]=new Ot(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ht[e]=new Ot(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ht[e]=new Ot(e,5,!1,e.toLowerCase(),null,!1,!1)});var wh=/[\-:]([a-z])/g;function bh(e){return 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".split(" ").forEach(function(e){var t=e.replace(wh,bh);ht[t]=new Ot(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(wh,bh);ht[t]=new Ot(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(wh,bh);ht[t]=new Ot(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ht[e]=new Ot(e,1,!1,e.toLowerCase(),null,!1,!1)});ht.xlinkHref=new Ot("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ht[e]=new Ot(e,1,!1,e.toLowerCase(),null,!0,!0)});function jh(e,t,n,r){var i=ht.hasOwnProperty(t)?ht[t]:null;(i!==null?i.type!==0:r||!(2l||i[a]!==o[l]){var c=` +`+i[a].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{dd=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?fa(e):""}function Yj(e){switch(e.tag){case 5:return fa(e.type);case 16:return fa("Lazy");case 13:return fa("Suspense");case 19:return fa("SuspenseList");case 0:case 2:case 15:return e=fd(e.type,!1),e;case 11:return e=fd(e.type.render,!1),e;case 1:return e=fd(e.type,!0),e;default:return""}}function Of(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case So:return"Fragment";case Co:return"Portal";case Rf:return"Profiler";case Ch:return"StrictMode";case Af:return"Suspense";case If:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Vy:return(e.displayName||"Context")+".Consumer";case Qy:return(e._context.displayName||"Context")+".Provider";case Sh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ph:return t=e.displayName||null,t!==null?t:Of(e.type)||"Memo";case Rr:t=e._payload,e=e._init;try{return Of(e(t))}catch{}}return null}function Xj(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Of(t);case 8:return t===Ch?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function ai(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Gy(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Zj(e){var t=Gy(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(a){r=""+a,o.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function $l(e){e._valueTracker||(e._valueTracker=Zj(e))}function qy(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Gy(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Nc(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function _f(e,t){var n=t.checked;return Be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ig(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ai(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Jy(e,t){t=t.checked,t!=null&&jh(e,"checked",t,!1)}function Df(e,t){Jy(e,t);var n=ai(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Tf(e,t.type,n):t.hasOwnProperty("defaultValue")&&Tf(e,t.type,ai(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function og(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Tf(e,t,n){(t!=="number"||Nc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var pa=Array.isArray;function Lo(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Fl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Oa(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var wa={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},eC=["Webkit","ms","Moz","O"];Object.keys(wa).forEach(function(e){eC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),wa[t]=wa[e]})});function ev(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||wa.hasOwnProperty(e)&&wa[e]?(""+t).trim():t+"px"}function tv(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=ev(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var tC=Be({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Nf(e,t){if(t){if(tC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function $f(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ff=null;function Eh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zf=null,No=null,$o=null;function lg(e){if(e=hl(e)){if(typeof zf!="function")throw Error(W(280));var t=e.stateNode;t&&(t=Ru(t),zf(e.stateNode,e.type,t))}}function nv(e){No?$o?$o.push(e):$o=[e]:No=e}function rv(){if(No){var e=No,t=$o;if($o=No=null,lg(e),t)for(e=0;e>>=0,e===0?32:31-(fC(e)/pC|0)|0}var zl=64,Ul=4194304;function ha(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Uc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~i;l!==0?r=ha(l):(o&=a,o!==0&&(r=ha(o)))}else a=n&~i,a!==0?r=ha(a):o!==0&&(r=ha(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function fl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-En(t),e[t]=n}function xC(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=ja),xg=" ",yg=!1;function Cv(e,t){switch(e){case"keyup":return QC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sv(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Po=!1;function KC(e,t){switch(e){case"compositionend":return Sv(t);case"keypress":return t.which!==32?null:(yg=!0,xg);case"textInput":return e=t.data,e===xg&&yg?null:e;default:return null}}function GC(e,t){if(Po)return e==="compositionend"||!Th&&Cv(e,t)?(e=bv(),vc=Oh=Gr=null,Po=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=jg(n)}}function Rv(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Rv(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Av(){for(var e=window,t=Nc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nc(e.document)}return t}function Mh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function rS(e){var t=Av(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Rv(n.ownerDocument.documentElement,n)){if(r!==null&&Mh(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=Cg(n,o);var a=Cg(n,r);i&&a&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Eo=null,Vf=null,Sa=null,Kf=!1;function Sg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Kf||Eo==null||Eo!==Nc(r)||(r=Eo,"selectionStart"in r&&Mh(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Sa&&Na(Sa,r)||(Sa=r,r=Hc(Vf,"onSelect"),0Ao||(e.current=Zf[Ao],Zf[Ao]=null,Ao--)}function Te(e,t){Ao++,Zf[Ao]=e.current,e.current=t}var li={},bt=ui(li),Ft=ui(!1),Ji=li;function xs(e,t){var n=e.type.contextTypes;if(!n)return li;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function zt(e){return e=e.childContextTypes,e!=null}function Vc(){Ne(Ft),Ne(bt)}function Og(e,t,n){if(bt.current!==li)throw Error(W(168));Te(bt,t),Te(Ft,n)}function $v(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(W(108,Xj(e)||"Unknown",i));return Be({},n,r)}function Kc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||li,Ji=bt.current,Te(bt,e),Te(Ft,Ft.current),!0}function _g(e,t,n){var r=e.stateNode;if(!r)throw Error(W(169));n?(e=$v(e,t,Ji),r.__reactInternalMemoizedMergedChildContext=e,Ne(Ft),Ne(bt),Te(bt,e)):Ne(Ft),Te(Ft,n)}var or=null,Au=!1,Ed=!1;function Fv(e){or===null?or=[e]:or.push(e)}function mS(e){Au=!0,Fv(e)}function di(){if(!Ed&&or!==null){Ed=!0;var e=0,t=Oe;try{var n=or;for(Oe=1;e>=a,i-=a,ar=1<<32-En(t)+i|n<R?(I=k,k=null):I=k.sibling;var D=h(w,k,v[R],b);if(D===null){k===null&&(k=I);break}e&&k&&D.alternate===null&&t(w,k),m=o(D,m,R),P===null?E=D:P.sibling=D,P=D,k=I}if(R===v.length)return n(w,k),Fe&&wi(w,R),E;if(k===null){for(;RR?(I=k,k=null):I=k.sibling;var _=h(w,k,D.value,b);if(_===null){k===null&&(k=I);break}e&&k&&_.alternate===null&&t(w,k),m=o(_,m,R),P===null?E=_:P.sibling=_,P=_,k=I}if(D.done)return n(w,k),Fe&&wi(w,R),E;if(k===null){for(;!D.done;R++,D=v.next())D=f(w,D.value,b),D!==null&&(m=o(D,m,R),P===null?E=D:P.sibling=D,P=D);return Fe&&wi(w,R),E}for(k=r(w,k);!D.done;R++,D=v.next())D=j(k,w,R,D.value,b),D!==null&&(e&&D.alternate!==null&&k.delete(D.key===null?R:D.key),m=o(D,m,R),P===null?E=D:P.sibling=D,P=D);return e&&k.forEach(function(N){return t(w,N)}),Fe&&wi(w,R),E}function S(w,m,v,b){if(typeof v=="object"&&v!==null&&v.type===So&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case Nl:e:{for(var E=v.key,P=m;P!==null;){if(P.key===E){if(E=v.type,E===So){if(P.tag===7){n(w,P.sibling),m=i(P,v.props.children),m.return=w,w=m;break e}}else if(P.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Rr&&Mg(E)===P.type){n(w,P.sibling),m=i(P,v.props),m.ref=Ys(w,P,v),m.return=w,w=m;break e}n(w,P);break}else t(w,P);P=P.sibling}v.type===So?(m=Vi(v.props.children,w.mode,b,v.key),m.return=w,w=m):(b=kc(v.type,v.key,v.props,null,w.mode,b),b.ref=Ys(w,m,v),b.return=w,w=b)}return a(w);case Co:e:{for(P=v.key;m!==null;){if(m.key===P)if(m.tag===4&&m.stateNode.containerInfo===v.containerInfo&&m.stateNode.implementation===v.implementation){n(w,m.sibling),m=i(m,v.children||[]),m.return=w,w=m;break e}else{n(w,m);break}else t(w,m);m=m.sibling}m=Td(v,w.mode,b),m.return=w,w=m}return a(w);case Rr:return P=v._init,S(w,m,P(v._payload),b)}if(pa(v))return x(w,m,v,b);if(Vs(v))return g(w,m,v,b);Gl(w,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,m!==null&&m.tag===6?(n(w,m.sibling),m=i(m,v),m.return=w,w=m):(n(w,m),m=Dd(v,w.mode,b),m.return=w,w=m),a(w)):n(w,m)}return S}var vs=Wv(!0),Hv=Wv(!1),Jc=ui(null),Yc=null,_o=null,Fh=null;function zh(){Fh=_o=Yc=null}function Uh(e){var t=Jc.current;Ne(Jc),e._currentValue=t}function np(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function zo(e,t){Yc=e,Fh=_o=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Nt=!0),e.firstContext=null)}function fn(e){var t=e._currentValue;if(Fh!==e)if(e={context:e,memoizedValue:t,next:null},_o===null){if(Yc===null)throw Error(W(308));_o=e,Yc.dependencies={lanes:0,firstContext:e}}else _o=_o.next=e;return t}var Ei=null;function Bh(e){Ei===null?Ei=[e]:Ei.push(e)}function Qv(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Bh(t)):(n.next=i.next,i.next=n),t.interleaved=n,hr(e,r)}function hr(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Ar=!1;function Wh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Vv(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function cr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ti(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,je&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,hr(e,n)}return i=r.interleaved,i===null?(t.next=t,Bh(r)):(t.next=i.next,i.next=t),r.interleaved=t,hr(e,n)}function bc(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rh(e,n)}}function Lg(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,o=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};o===null?i=o=a:o=o.next=a,n=n.next}while(n!==null);o===null?i=o=t:o=o.next=t}else i=o=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Xc(e,t,n,r){var i=e.updateQueue;Ar=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,d=c.next;c.next=null,a===null?o=d:a.next=d,a=c;var p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==a&&(l===null?p.firstBaseUpdate=d:l.next=d,p.lastBaseUpdate=c))}if(o!==null){var f=i.baseState;a=0,p=d=c=null,l=o;do{var h=l.lane,j=l.eventTime;if((r&h)===h){p!==null&&(p=p.next={eventTime:j,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,g=l;switch(h=t,j=n,g.tag){case 1:if(x=g.payload,typeof x=="function"){f=x.call(j,f,h);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=g.payload,h=typeof x=="function"?x.call(j,f,h):x,h==null)break e;f=Be({},f,h);break e;case 2:Ar=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=i.effects,h===null?i.effects=[l]:h.push(l))}else j={eventTime:j,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(d=p=j,c=f):p=p.next=j,a|=h;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;h=l,l=h.next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}while(!0);if(p===null&&(c=f),i.baseState=c,i.firstBaseUpdate=d,i.lastBaseUpdate=p,t=i.shared.interleaved,t!==null){i=t;do a|=i.lane,i=i.next;while(i!==t)}else o===null&&(i.shared.lanes=0);Zi|=a,e.lanes=a,e.memoizedState=f}}function Ng(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Rd.transition;Rd.transition={};try{e(!1),t()}finally{Oe=n,Rd.transition=r}}function c1(){return pn().memoizedState}function vS(e,t,n){var r=ri(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},u1(e))d1(t,n);else if(n=Qv(e,t,n,r),n!==null){var i=At();kn(n,e,r,i),f1(n,t,r)}}function wS(e,t,n){var r=ri(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(u1(e))d1(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var a=t.lastRenderedState,l=o(a,n);if(i.hasEagerState=!0,i.eagerState=l,An(l,a)){var c=t.interleaved;c===null?(i.next=i,Bh(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=Qv(e,t,i,r),n!==null&&(i=At(),kn(n,e,r,i),f1(n,t,r))}}function u1(e){var t=e.alternate;return e===Ue||t!==null&&t===Ue}function d1(e,t){Pa=eu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function f1(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Rh(e,n)}}var tu={readContext:fn,useCallback:mt,useContext:mt,useEffect:mt,useImperativeHandle:mt,useInsertionEffect:mt,useLayoutEffect:mt,useMemo:mt,useReducer:mt,useRef:mt,useState:mt,useDebugValue:mt,useDeferredValue:mt,useTransition:mt,useMutableSource:mt,useSyncExternalStore:mt,useId:mt,unstable_isNewReconciler:!1},bS={readContext:fn,useCallback:function(e,t){return Tn().memoizedState=[e,t===void 0?null:t],e},useContext:fn,useEffect:Fg,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Cc(4194308,4,i1.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Cc(4194308,4,e,t)},useInsertionEffect:function(e,t){return Cc(4,2,e,t)},useMemo:function(e,t){var n=Tn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Tn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=vS.bind(null,Ue,e),[r.memoizedState,e]},useRef:function(e){var t=Tn();return e={current:e},t.memoizedState=e},useState:$g,useDebugValue:Yh,useDeferredValue:function(e){return Tn().memoizedState=e},useTransition:function(){var e=$g(!1),t=e[0];return e=yS.bind(null,e[1]),Tn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ue,i=Tn();if(Fe){if(n===void 0)throw Error(W(407));n=n()}else{if(n=t(),lt===null)throw Error(W(349));Xi&30||Jv(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Fg(Xv.bind(null,r,o,e),[e]),r.flags|=2048,Qa(9,Yv.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=Tn(),t=lt.identifierPrefix;if(Fe){var n=lr,r=ar;n=(r&~(1<<32-En(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Wa++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Qn]=t,e[za]=r,j1(e,t,!1,!1),t.stateNode=e;e:{switch(a=$f(n,r),n){case"dialog":Me("cancel",e),Me("close",e),i=r;break;case"iframe":case"object":case"embed":Me("load",e),i=r;break;case"video":case"audio":for(i=0;ijs&&(t.flags|=128,r=!0,Xs(o,!1),t.lanes=4194304)}else{if(!r)if(e=Zc(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Xs(o,!0),o.tail===null&&o.tailMode==="hidden"&&!a.alternate&&!Fe)return gt(t),null}else 2*Je()-o.renderingStartTime>js&&n!==1073741824&&(t.flags|=128,r=!0,Xs(o,!1),t.lanes=4194304);o.isBackwards?(a.sibling=t.child,t.child=a):(n=o.last,n!==null?n.sibling=a:t.child=a,o.last=a)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Je(),t.sibling=null,n=ze.current,Te(ze,r?n&1|2:n&1),t):(gt(t),null);case 22:case 23:return rm(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Kt&1073741824&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function AS(e,t){switch(Nh(t),t.tag){case 1:return zt(t.type)&&Vc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ws(),Ne(Ft),Ne(bt),Vh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Qh(t),null;case 13:if(Ne(ze),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ne(ze),null;case 4:return ws(),null;case 10:return Uh(t.type._context),null;case 22:case 23:return rm(),null;case 24:return null;default:return null}}var Jl=!1,vt=!1,IS=typeof WeakSet=="function"?WeakSet:Set,G=null;function Do(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ge(e,t,r)}else n.current=null}function dp(e,t,n){try{n()}catch(r){Ge(e,t,r)}}var Jg=!1;function OS(e,t){if(Gf=Bc,e=Av(),Mh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,d=0,p=0,f=e,h=null;t:for(;;){for(var j;f!==n||i!==0&&f.nodeType!==3||(l=a+i),f!==o||r!==0&&f.nodeType!==3||(c=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(j=f.firstChild)!==null;)h=f,f=j;for(;;){if(f===e)break t;if(h===n&&++d===i&&(l=a),h===o&&++p===r&&(c=a),(j=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=j}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(qf={focusedElem:e,selectionRange:n},Bc=!1,G=t;G!==null;)if(t=G,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,G=e;else for(;G!==null;){t=G;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var g=x.memoizedProps,S=x.memoizedState,w=t.stateNode,m=w.getSnapshotBeforeUpdate(t.elementType===t.type?g:yn(t.type,g),S);w.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(b){Ge(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,G=e;break}G=t.return}return x=Jg,Jg=!1,x}function Ea(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&dp(t,n,o)}i=i.next}while(i!==r)}}function _u(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function fp(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function P1(e){var t=e.alternate;t!==null&&(e.alternate=null,P1(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Qn],delete t[za],delete t[Xf],delete t[pS],delete t[hS])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function E1(e){return e.tag===5||e.tag===3||e.tag===4}function Yg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||E1(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function pp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Qc));else if(r!==4&&(e=e.child,e!==null))for(pp(e,t,n),e=e.sibling;e!==null;)pp(e,t,n),e=e.sibling}function hp(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hp(e,t,n),e=e.sibling;e!==null;)hp(e,t,n),e=e.sibling}var dt=null,bn=!1;function vr(e,t,n){for(n=n.child;n!==null;)k1(e,t,n),n=n.sibling}function k1(e,t,n){if(Vn&&typeof Vn.onCommitFiberUnmount=="function")try{Vn.onCommitFiberUnmount(Su,n)}catch{}switch(n.tag){case 5:vt||Do(n,t);case 6:var r=dt,i=bn;dt=null,vr(e,t,n),dt=r,bn=i,dt!==null&&(bn?(e=dt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):dt.removeChild(n.stateNode));break;case 18:dt!==null&&(bn?(e=dt,n=n.stateNode,e.nodeType===8?Pd(e.parentNode,n):e.nodeType===1&&Pd(e,n),Ma(e)):Pd(dt,n.stateNode));break;case 4:r=dt,i=bn,dt=n.stateNode.containerInfo,bn=!0,vr(e,t,n),dt=r,bn=i;break;case 0:case 11:case 14:case 15:if(!vt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,a=o.destroy;o=o.tag,a!==void 0&&(o&2||o&4)&&dp(n,t,a),i=i.next}while(i!==r)}vr(e,t,n);break;case 1:if(!vt&&(Do(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ge(n,t,l)}vr(e,t,n);break;case 21:vr(e,t,n);break;case 22:n.mode&1?(vt=(r=vt)||n.memoizedState!==null,vr(e,t,n),vt=r):vr(e,t,n);break;default:vr(e,t,n)}}function Xg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new IS),t.forEach(function(r){var i=zS.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function gn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~o}if(r=i,r=Je()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*DS(r/1960))-r,10e?16:e,qr===null)var r=!1;else{if(e=qr,qr=null,iu=0,je&6)throw Error(W(331));var i=je;for(je|=4,G=e.current;G!==null;){var o=G,a=o.child;if(G.flags&16){var l=o.deletions;if(l!==null){for(var c=0;cJe()-tm?Qi(e,0):em|=n),Ut(e,t)}function M1(e,t){t===0&&(e.mode&1?(t=Ul,Ul<<=1,!(Ul&130023424)&&(Ul=4194304)):t=1);var n=At();e=hr(e,t),e!==null&&(fl(e,t,n),Ut(e,n))}function FS(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),M1(e,n)}function zS(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(W(314))}r!==null&&r.delete(t),M1(e,n)}var L1;L1=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ft.current)Nt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Nt=!1,kS(e,t,n);Nt=!!(e.flags&131072)}else Nt=!1,Fe&&t.flags&1048576&&zv(t,qc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Sc(e,t),e=t.pendingProps;var i=xs(t,bt.current);zo(t,n),i=Gh(null,t,r,e,i,n);var o=qh();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,zt(r)?(o=!0,Kc(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Wh(t),i.updater=Ou,t.stateNode=i,i._reactInternals=t,ip(t,r,e,n),t=ap(null,t,r,!0,o,n)):(t.tag=0,Fe&&o&&Lh(t),kt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Sc(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=BS(r),e=yn(r,e),i){case 0:t=sp(null,t,r,e,n);break e;case 1:t=Kg(null,t,r,e,n);break e;case 11:t=Qg(null,t,r,e,n);break e;case 14:t=Vg(null,t,r,yn(r.type,e),n);break e}throw Error(W(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yn(r,i),sp(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yn(r,i),Kg(e,t,r,i,n);case 3:e:{if(v1(t),e===null)throw Error(W(387));r=t.pendingProps,o=t.memoizedState,i=o.element,Vv(e,t),Xc(t,r,null,n);var a=t.memoizedState;if(r=a.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=bs(Error(W(423)),t),t=Gg(e,t,r,n,i);break e}else if(r!==i){i=bs(Error(W(424)),t),t=Gg(e,t,r,n,i);break e}else for(qt=ei(t.stateNode.containerInfo.firstChild),Jt=t,Fe=!0,Cn=null,n=Hv(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ys(),r===i){t=mr(e,t,n);break e}kt(e,t,r,n)}t=t.child}return t;case 5:return Kv(t),e===null&&tp(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,a=i.children,Jf(r,i)?a=null:o!==null&&Jf(r,o)&&(t.flags|=32),y1(e,t),kt(e,t,a,n),t.child;case 6:return e===null&&tp(t),null;case 13:return w1(e,t,n);case 4:return Hh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=vs(t,null,r,n):kt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yn(r,i),Qg(e,t,r,i,n);case 7:return kt(e,t,t.pendingProps,n),t.child;case 8:return kt(e,t,t.pendingProps.children,n),t.child;case 12:return kt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,a=i.value,Te(Jc,r._currentValue),r._currentValue=a,o!==null)if(An(o.value,a)){if(o.children===i.children&&!Ft.current){t=mr(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var l=o.dependencies;if(l!==null){a=o.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(o.tag===1){c=cr(-1,n&-n),c.tag=2;var d=o.updateQueue;if(d!==null){d=d.shared;var p=d.pending;p===null?c.next=c:(c.next=p.next,p.next=c),d.pending=c}}o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),np(o.return,n,t),l.lanes|=n;break}c=c.next}}else if(o.tag===10)a=o.type===t.type?null:o.child;else if(o.tag===18){if(a=o.return,a===null)throw Error(W(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),np(a,n,t),a=o.sibling}else a=o.child;if(a!==null)a.return=o;else for(a=o;a!==null;){if(a===t){a=null;break}if(o=a.sibling,o!==null){o.return=a.return,a=o;break}a=a.return}o=a}kt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,zo(t,n),i=fn(i),r=r(i),t.flags|=1,kt(e,t,r,n),t.child;case 14:return r=t.type,i=yn(r,t.pendingProps),i=yn(r.type,i),Vg(e,t,r,i,n);case 15:return g1(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:yn(r,i),Sc(e,t),t.tag=1,zt(r)?(e=!0,Kc(t)):e=!1,zo(t,n),p1(t,r,i),ip(t,r,i,n),ap(null,t,r,!0,e,n);case 19:return b1(e,t,n);case 22:return x1(e,t,n)}throw Error(W(156,t.tag))};function N1(e,t){return uv(e,t)}function US(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function un(e,t,n,r){return new US(e,t,n,r)}function om(e){return e=e.prototype,!(!e||!e.isReactComponent)}function BS(e){if(typeof e=="function")return om(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Sh)return 11;if(e===Ph)return 14}return 2}function ii(e,t){var n=e.alternate;return n===null?(n=un(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function kc(e,t,n,r,i,o){var a=2;if(r=e,typeof e=="function")om(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case So:return Vi(n.children,i,o,t);case Ch:a=8,i|=8;break;case Rf:return e=un(12,n,t,i|2),e.elementType=Rf,e.lanes=o,e;case Af:return e=un(13,n,t,i),e.elementType=Af,e.lanes=o,e;case If:return e=un(19,n,t,i),e.elementType=If,e.lanes=o,e;case Ky:return Tu(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Qy:a=10;break e;case Vy:a=9;break e;case Sh:a=11;break e;case Ph:a=14;break e;case Rr:a=16,r=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=un(a,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Vi(e,t,n,r){return e=un(7,e,r,t),e.lanes=n,e}function Tu(e,t,n,r){return e=un(22,e,r,t),e.elementType=Ky,e.lanes=n,e.stateNode={isHidden:!1},e}function Dd(e,t,n){return e=un(6,e,null,t),e.lanes=n,e}function Td(e,t,n){return t=un(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function WS(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=hd(0),this.expirationTimes=hd(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hd(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function sm(e,t,n,r,i,o,a,l,c){return e=new WS(e,t,n,l,c),t===1?(t=1,o===!0&&(t|=8)):t=0,o=un(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Wh(o),e}function HS(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(U1)}catch(e){console.error(e)}}U1(),Uy.exports=Zt;var um=Uy.exports;const qS=Ay(um),JS=Ry({__proto__:null,default:qS},[um]);var B1,sx=um;B1=sx.createRoot,sx.hydrateRoot;/** + * @remix-run/router v1.21.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function $e(){return $e=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Cs(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function XS(){return Math.random().toString(36).substr(2,8)}function lx(e,t){return{usr:e.state,key:e.key,idx:t}}function Ka(e,t,n,r){return n===void 0&&(n=null),$e({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?fi(t):t,{state:n,key:t&&t.key||r||XS()})}function to(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function fi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ZS(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,a=i.history,l=Xe.Pop,c=null,d=p();d==null&&(d=0,a.replaceState($e({},a.state,{idx:d}),""));function p(){return(a.state||{idx:null}).idx}function f(){l=Xe.Pop;let S=p(),w=S==null?null:S-d;d=S,c&&c({action:l,location:g.location,delta:w})}function h(S,w){l=Xe.Push;let m=Ka(g.location,S,w);d=p()+1;let v=lx(m,d),b=g.createHref(m);try{a.pushState(v,"",b)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;i.location.assign(b)}o&&c&&c({action:l,location:g.location,delta:1})}function j(S,w){l=Xe.Replace;let m=Ka(g.location,S,w);d=p();let v=lx(m,d),b=g.createHref(m);a.replaceState(v,"",b),o&&c&&c({action:l,location:g.location,delta:0})}function x(S){let w=i.location.origin!=="null"?i.location.origin:i.location.href,m=typeof S=="string"?S:to(S);return m=m.replace(/ $/,"%20"),ge(w,"No window.location.(origin|href) available to create URL for href: "+m),new URL(m,w)}let g={get action(){return l},get location(){return e(i,a)},listen(S){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(ax,f),c=S,()=>{i.removeEventListener(ax,f),c=null}},createHref(S){return t(i,S)},createURL:x,encodeLocation(S){let w=x(S);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:h,replace:j,go(S){return a.go(S)}};return g}var _e;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(_e||(_e={}));const eP=new Set(["lazy","caseSensitive","path","id","index","children"]);function tP(e){return e.index===!0}function au(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,o)=>{let a=[...n,String(o)],l=typeof i.id=="string"?i.id:a.join("-");if(ge(i.index!==!0||!i.children,"Cannot specify children on an index route"),ge(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),tP(i)){let c=$e({},i,t(i),{id:l});return r[l]=c,c}else{let c=$e({},i,t(i),{id:l,children:void 0});return r[l]=c,i.children&&(c.children=au(i.children,t,a,r)),c}})}function ji(e,t,n){return n===void 0&&(n="/"),Rc(e,t,n,!1)}function Rc(e,t,n,r){let i=typeof t=="string"?fi(t):t,o=Ds(i.pathname||"/",n);if(o==null)return null;let a=W1(e);rP(a);let l=null;for(let c=0;l==null&&c{let c={relativePath:l===void 0?o.path||"":l,caseSensitive:o.caseSensitive===!0,childrenIndex:a,route:o};c.relativePath.startsWith("/")&&(ge(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let d=ur([r,c.relativePath]),p=n.concat(c);o.children&&o.children.length>0&&(ge(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),W1(o.children,t,p,d)),!(o.path==null&&!o.index)&&t.push({path:d,score:uP(d,o.index),routesMeta:p})};return e.forEach((o,a)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))i(o,a);else for(let c of H1(o.path))i(o,a,c)}),t}function H1(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let a=H1(r.join("/")),l=[];return l.push(...a.map(c=>c===""?o:[o,c].join("/"))),i&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function rP(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:dP(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const iP=/^:[\w-]+$/,oP=3,sP=2,aP=1,lP=10,cP=-2,cx=e=>e==="*";function uP(e,t){let n=e.split("/"),r=n.length;return n.some(cx)&&(r+=cP),t&&(r+=sP),n.filter(i=>!cx(i)).reduce((i,o)=>i+(iP.test(o)?oP:o===""?aP:lP),r)}function dP(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function fP(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},o="/",a=[];for(let l=0;l{let{paramName:h,isOptional:j}=p;if(h==="*"){let g=l[f]||"";a=o.slice(0,o.length-g.length).replace(/(.)\/+$/,"$1")}const x=l[f];return j&&!x?d[h]=void 0:d[h]=(x||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:a,pattern:e}}function pP(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Cs(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(a,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function hP(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Cs(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Ds(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function mP(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?fi(e):e;return{pathname:n?n.startsWith("/")?n:gP(n,t):t,search:yP(r),hash:vP(i)}}function gP(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Md(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Q1(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Fu(e,t){let n=Q1(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function zu(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=fi(e):(i=$e({},e),ge(!i.pathname||!i.pathname.includes("?"),Md("?","pathname","search",i)),ge(!i.pathname||!i.pathname.includes("#"),Md("#","pathname","hash",i)),ge(!i.search||!i.search.includes("#"),Md("#","search","hash",i)));let o=e===""||i.pathname==="",a=o?"/":i.pathname,l;if(a==null)l=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;i.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=mP(i,l),d=a&&a!=="/"&&a.endsWith("/"),p=(o||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(d||p)&&(c.pathname+="/"),c}const ur=e=>e.join("/").replace(/\/\/+/g,"/"),xP=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),yP=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,vP=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class lu{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function gl(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const V1=["post","put","patch","delete"],wP=new Set(V1),bP=["get",...V1],jP=new Set(bP),CP=new Set([301,302,303,307,308]),SP=new Set([307,308]),Ld={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},PP={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ea={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},dm=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,EP=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),K1="remix-router-transitions";function kP(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;ge(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let A=e.detectErrorBoundary;i=O=>({hasErrorBoundary:A(O)})}else i=EP;let o={},a=au(e.routes,i,void 0,o),l,c=e.basename||"/",d=e.dataStrategy||OP,p=e.patchRoutesOnNavigation,f=$e({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,j=new Set,x=null,g=null,S=null,w=e.hydrationData!=null,m=ji(a,e.history.location,c),v=null;if(m==null&&!p){let A=Mt(404,{pathname:e.history.location.pathname}),{matches:O,route:T}=bx(a);m=O,v={[T.id]:A}}m&&!e.hydrationData&&_l(m,a,e.history.location.pathname).active&&(m=null);let b;if(m)if(m.some(A=>A.route.lazy))b=!1;else if(!m.some(A=>A.route.loader))b=!0;else if(f.v7_partialHydration){let A=e.hydrationData?e.hydrationData.loaderData:null,O=e.hydrationData?e.hydrationData.errors:null;if(O){let T=m.findIndex(z=>O[z.route.id]!==void 0);b=m.slice(0,T+1).every(z=>!wp(z.route,A,O))}else b=m.every(T=>!wp(T.route,A,O))}else b=e.hydrationData!=null;else if(b=!1,m=[],f.v7_partialHydration){let A=_l(null,a,e.history.location.pathname);A.active&&A.matches&&(m=A.matches)}let E,P={historyAction:e.history.action,location:e.history.location,matches:m,initialized:b,navigation:Ld,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||v,fetchers:new Map,blockers:new Map},k=Xe.Pop,R=!1,I,D=!1,_=new Map,N=null,F=!1,$=!1,X=[],ue=new Set,oe=new Map,H=0,V=-1,ee=new Map,B=new Set,Q=new Map,ae=new Map,le=new Set,he=new Map,me=new Map,te;function de(){if(h=e.history.listen(A=>{let{action:O,location:T,delta:z}=A;if(te){te(),te=void 0;return}Cs(me.size===0||z!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let q=Km({currentLocation:P.location,nextLocation:T,historyAction:O});if(q&&z!=null){let ne=new Promise(ce=>{te=ce});e.history.go(z*-1),Ol(q,{state:"blocked",location:T,proceed(){Ol(q,{state:"proceeding",proceed:void 0,reset:void 0,location:T}),ne.then(()=>e.history.go(z))},reset(){let ce=new Map(P.blockers);ce.set(q,ea),We({blockers:ce})}});return}return tn(O,T)}),n){QP(t,_);let A=()=>VP(t,_);t.addEventListener("pagehide",A),N=()=>t.removeEventListener("pagehide",A)}return P.initialized||tn(Xe.Pop,P.location,{initialHydration:!0}),E}function Ce(){h&&h(),N&&N(),j.clear(),I&&I.abort(),P.fetchers.forEach((A,O)=>Il(O)),P.blockers.forEach((A,O)=>Vm(O))}function mn(A){return j.add(A),()=>j.delete(A)}function We(A,O){O===void 0&&(O={}),P=$e({},P,A);let T=[],z=[];f.v7_fetcherPersist&&P.fetchers.forEach((q,ne)=>{q.state==="idle"&&(le.has(ne)?z.push(ne):T.push(ne))}),[...j].forEach(q=>q(P,{deletedFetchers:z,viewTransitionOpts:O.viewTransitionOpts,flushSync:O.flushSync===!0})),f.v7_fetcherPersist&&(T.forEach(q=>P.fetchers.delete(q)),z.forEach(q=>Il(q)))}function ie(A,O,T){var z,q;let{flushSync:ne}=T===void 0?{}:T,ce=P.actionData!=null&&P.navigation.formMethod!=null&&jn(P.navigation.formMethod)&&P.navigation.state==="loading"&&((z=A.state)==null?void 0:z._isRedirect)!==!0,Y;O.actionData?Object.keys(O.actionData).length>0?Y=O.actionData:Y=null:ce?Y=P.actionData:Y=null;let Z=O.loaderData?vx(P.loaderData,O.loaderData,O.matches||[],O.errors):P.loaderData,J=P.blockers;J.size>0&&(J=new Map(J),J.forEach((be,ut)=>J.set(ut,ea)));let re=R===!0||P.navigation.formMethod!=null&&jn(P.navigation.formMethod)&&((q=A.state)==null?void 0:q._isRedirect)!==!0;l&&(a=l,l=void 0),F||k===Xe.Pop||(k===Xe.Push?e.history.push(A,A.state):k===Xe.Replace&&e.history.replace(A,A.state));let ye;if(k===Xe.Pop){let be=_.get(P.location.pathname);be&&be.has(A.pathname)?ye={currentLocation:P.location,nextLocation:A}:_.has(A.pathname)&&(ye={currentLocation:A,nextLocation:P.location})}else if(D){let be=_.get(P.location.pathname);be?be.add(A.pathname):(be=new Set([A.pathname]),_.set(P.location.pathname,be)),ye={currentLocation:P.location,nextLocation:A}}We($e({},O,{actionData:Y,loaderData:Z,historyAction:k,location:A,initialized:!0,navigation:Ld,revalidation:"idle",restoreScrollPosition:qm(A,O.matches||P.matches),preventScrollReset:re,blockers:J}),{viewTransitionOpts:ye,flushSync:ne===!0}),k=Xe.Pop,R=!1,D=!1,F=!1,$=!1,X=[]}async function Pe(A,O){if(typeof A=="number"){e.history.go(A);return}let T=vp(P.location,P.matches,c,f.v7_prependBasename,A,f.v7_relativeSplatPath,O==null?void 0:O.fromRouteId,O==null?void 0:O.relative),{path:z,submission:q,error:ne}=dx(f.v7_normalizeFormMethod,!1,T,O),ce=P.location,Y=Ka(P.location,z,O&&O.state);Y=$e({},Y,e.history.encodeLocation(Y));let Z=O&&O.replace!=null?O.replace:void 0,J=Xe.Push;Z===!0?J=Xe.Replace:Z===!1||q!=null&&jn(q.formMethod)&&q.formAction===P.location.pathname+P.location.search&&(J=Xe.Replace);let re=O&&"preventScrollReset"in O?O.preventScrollReset===!0:void 0,ye=(O&&O.flushSync)===!0,be=Km({currentLocation:ce,nextLocation:Y,historyAction:J});if(be){Ol(be,{state:"blocked",location:Y,proceed(){Ol(be,{state:"proceeding",proceed:void 0,reset:void 0,location:Y}),Pe(A,O)},reset(){let ut=new Map(P.blockers);ut.set(be,ea),We({blockers:ut})}});return}return await tn(J,Y,{submission:q,pendingError:ne,preventScrollReset:re,replace:O&&O.replace,enableViewTransition:O&&O.viewTransition,flushSync:ye})}function ct(){if(id(),We({revalidation:"loading"}),P.navigation.state!=="submitting"){if(P.navigation.state==="idle"){tn(P.historyAction,P.location,{startUninterruptedRevalidation:!0});return}tn(k||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation,enableViewTransition:D===!0})}}async function tn(A,O,T){I&&I.abort(),I=null,k=A,F=(T&&T.startUninterruptedRevalidation)===!0,vj(P.location,P.matches),R=(T&&T.preventScrollReset)===!0,D=(T&&T.enableViewTransition)===!0;let z=l||a,q=T&&T.overrideNavigation,ne=ji(z,O,c),ce=(T&&T.flushSync)===!0,Y=_l(ne,z,O.pathname);if(Y.active&&Y.matches&&(ne=Y.matches),!ne){let{error:De,notFoundMatches:Ee,route:He}=od(O.pathname);ie(O,{matches:Ee,loaderData:{},errors:{[He.id]:De}},{flushSync:ce});return}if(P.initialized&&!$&&NP(P.location,O)&&!(T&&T.submission&&jn(T.submission.formMethod))){ie(O,{matches:ne},{flushSync:ce});return}I=new AbortController;let Z=mo(e.history,O,I.signal,T&&T.submission),J;if(T&&T.pendingError)J=[Ci(ne).route.id,{type:_e.error,error:T.pendingError}];else if(T&&T.submission&&jn(T.submission.formMethod)){let De=await El(Z,O,T.submission,ne,Y.active,{replace:T.replace,flushSync:ce});if(De.shortCircuited)return;if(De.pendingActionResult){let[Ee,He]=De.pendingActionResult;if(Gt(He)&&gl(He.error)&&He.error.status===404){I=null,ie(O,{matches:De.matches,loaderData:{},errors:{[Ee]:He.error}});return}}ne=De.matches||ne,J=De.pendingActionResult,q=Nd(O,T.submission),ce=!1,Y.active=!1,Z=mo(e.history,Z.url,Z.signal)}let{shortCircuited:re,matches:ye,loaderData:be,errors:ut}=await kl(Z,O,ne,Y.active,q,T&&T.submission,T&&T.fetcherSubmission,T&&T.replace,T&&T.initialHydration===!0,ce,J);re||(I=null,ie(O,$e({matches:ye||ne},wx(J),{loaderData:be,errors:ut})))}async function El(A,O,T,z,q,ne){ne===void 0&&(ne={}),id();let ce=WP(O,T);if(We({navigation:ce},{flushSync:ne.flushSync===!0}),q){let J=await Dl(z,O.pathname,A.signal);if(J.type==="aborted")return{shortCircuited:!0};if(J.type==="error"){let re=Ci(J.partialMatches).route.id;return{matches:J.partialMatches,pendingActionResult:[re,{type:_e.error,error:J.error}]}}else if(J.matches)z=J.matches;else{let{notFoundMatches:re,error:ye,route:be}=od(O.pathname);return{matches:re,pendingActionResult:[be.id,{type:_e.error,error:ye}]}}}let Y,Z=ga(z,O);if(!Z.route.action&&!Z.route.lazy)Y={type:_e.error,error:Mt(405,{method:A.method,pathname:O.pathname,routeId:Z.route.id})};else if(Y=(await Bs("action",P,A,[Z],z,null))[Z.route.id],A.signal.aborted)return{shortCircuited:!0};if(Ri(Y)){let J;return ne&&ne.replace!=null?J=ne.replace:J=gx(Y.response.headers.get("Location"),new URL(A.url),c)===P.location.pathname+P.location.search,await mi(A,Y,!0,{submission:T,replace:J}),{shortCircuited:!0}}if(Jr(Y))throw Mt(400,{type:"defer-action"});if(Gt(Y)){let J=Ci(z,Z.route.id);return(ne&&ne.replace)!==!0&&(k=Xe.Push),{matches:z,pendingActionResult:[J.route.id,Y]}}return{matches:z,pendingActionResult:[Z.route.id,Y]}}async function kl(A,O,T,z,q,ne,ce,Y,Z,J,re){let ye=q||Nd(O,ne),be=ne||ce||Cx(ye),ut=!F&&(!f.v7_partialHydration||!Z);if(z){if(ut){let Qe=Us(re);We($e({navigation:ye},Qe!==void 0?{actionData:Qe}:{}),{flushSync:J})}let Se=await Dl(T,O.pathname,A.signal);if(Se.type==="aborted")return{shortCircuited:!0};if(Se.type==="error"){let Qe=Ci(Se.partialMatches).route.id;return{matches:Se.partialMatches,loaderData:{},errors:{[Qe]:Se.error}}}else if(Se.matches)T=Se.matches;else{let{error:Qe,notFoundMatches:fo,route:Qs}=od(O.pathname);return{matches:fo,loaderData:{},errors:{[Qs.id]:Qe}}}}let De=l||a,[Ee,He]=px(e.history,P,T,be,O,f.v7_partialHydration&&Z===!0,f.v7_skipActionErrorRevalidation,$,X,ue,le,Q,B,De,c,re);if(sd(Se=>!(T&&T.some(Qe=>Qe.route.id===Se))||Ee&&Ee.some(Qe=>Qe.route.id===Se)),V=++H,Ee.length===0&&He.length===0){let Se=Hm();return ie(O,$e({matches:T,loaderData:{},errors:re&&Gt(re[1])?{[re[0]]:re[1].error}:null},wx(re),Se?{fetchers:new Map(P.fetchers)}:{}),{flushSync:J}),{shortCircuited:!0}}if(ut){let Se={};if(!z){Se.navigation=ye;let Qe=Us(re);Qe!==void 0&&(Se.actionData=Qe)}He.length>0&&(Se.fetchers=Rl(He)),We(Se,{flushSync:J})}He.forEach(Se=>{yr(Se.key),Se.controller&&oe.set(Se.key,Se.controller)});let uo=()=>He.forEach(Se=>yr(Se.key));I&&I.signal.addEventListener("abort",uo);let{loaderResults:Ws,fetcherResults:Xn}=await Um(P,T,Ee,He,A);if(A.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",uo),He.forEach(Se=>oe.delete(Se.key));let _n=Zl(Ws);if(_n)return await mi(A,_n.result,!0,{replace:Y}),{shortCircuited:!0};if(_n=Zl(Xn),_n)return B.add(_n.key),await mi(A,_n.result,!0,{replace:Y}),{shortCircuited:!0};let{loaderData:ad,errors:Hs}=yx(P,T,Ws,re,He,Xn,he);he.forEach((Se,Qe)=>{Se.subscribe(fo=>{(fo||Se.done)&&he.delete(Qe)})}),f.v7_partialHydration&&Z&&P.errors&&(Hs=$e({},P.errors,Hs));let gi=Hm(),Tl=Qm(V),Ml=gi||Tl||He.length>0;return $e({matches:T,loaderData:ad,errors:Hs},Ml?{fetchers:new Map(P.fetchers)}:{})}function Us(A){if(A&&!Gt(A[1]))return{[A[0]]:A[1].data};if(P.actionData)return Object.keys(P.actionData).length===0?null:P.actionData}function Rl(A){return A.forEach(O=>{let T=P.fetchers.get(O.key),z=ta(void 0,T?T.data:void 0);P.fetchers.set(O.key,z)}),new Map(P.fetchers)}function Al(A,O,T,z){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");yr(A);let q=(z&&z.flushSync)===!0,ne=l||a,ce=vp(P.location,P.matches,c,f.v7_prependBasename,T,f.v7_relativeSplatPath,O,z==null?void 0:z.relative),Y=ji(ne,ce,c),Z=_l(Y,ne,ce);if(Z.active&&Z.matches&&(Y=Z.matches),!Y){Yn(A,O,Mt(404,{pathname:ce}),{flushSync:q});return}let{path:J,submission:re,error:ye}=dx(f.v7_normalizeFormMethod,!0,ce,z);if(ye){Yn(A,O,ye,{flushSync:q});return}let be=ga(Y,J),ut=(z&&z.preventScrollReset)===!0;if(re&&jn(re.formMethod)){hj(A,O,J,be,Y,Z.active,q,ut,re);return}Q.set(A,{routeId:O,path:J}),mj(A,O,J,be,Y,Z.active,q,ut,re)}async function hj(A,O,T,z,q,ne,ce,Y,Z){id(),Q.delete(A);function J(Ye){if(!Ye.route.action&&!Ye.route.lazy){let po=Mt(405,{method:Z.formMethod,pathname:T,routeId:O});return Yn(A,O,po,{flushSync:ce}),!0}return!1}if(!ne&&J(z))return;let re=P.fetchers.get(A);xr(A,HP(Z,re),{flushSync:ce});let ye=new AbortController,be=mo(e.history,T,ye.signal,Z);if(ne){let Ye=await Dl(q,T,be.signal);if(Ye.type==="aborted")return;if(Ye.type==="error"){Yn(A,O,Ye.error,{flushSync:ce});return}else if(Ye.matches){if(q=Ye.matches,z=ga(q,T),J(z))return}else{Yn(A,O,Mt(404,{pathname:T}),{flushSync:ce});return}}oe.set(A,ye);let ut=H,Ee=(await Bs("action",P,be,[z],q,A))[z.route.id];if(be.signal.aborted){oe.get(A)===ye&&oe.delete(A);return}if(f.v7_fetcherPersist&&le.has(A)){if(Ri(Ee)||Gt(Ee)){xr(A,Sr(void 0));return}}else{if(Ri(Ee))if(oe.delete(A),V>ut){xr(A,Sr(void 0));return}else return B.add(A),xr(A,ta(Z)),mi(be,Ee,!1,{fetcherSubmission:Z,preventScrollReset:Y});if(Gt(Ee)){Yn(A,O,Ee.error);return}}if(Jr(Ee))throw Mt(400,{type:"defer-action"});let He=P.navigation.location||P.location,uo=mo(e.history,He,ye.signal),Ws=l||a,Xn=P.navigation.state!=="idle"?ji(Ws,P.navigation.location,c):P.matches;ge(Xn,"Didn't find any matches after fetcher action");let _n=++H;ee.set(A,_n);let ad=ta(Z,Ee.data);P.fetchers.set(A,ad);let[Hs,gi]=px(e.history,P,Xn,Z,He,!1,f.v7_skipActionErrorRevalidation,$,X,ue,le,Q,B,Ws,c,[z.route.id,Ee]);gi.filter(Ye=>Ye.key!==A).forEach(Ye=>{let po=Ye.key,Jm=P.fetchers.get(po),jj=ta(void 0,Jm?Jm.data:void 0);P.fetchers.set(po,jj),yr(po),Ye.controller&&oe.set(po,Ye.controller)}),We({fetchers:new Map(P.fetchers)});let Tl=()=>gi.forEach(Ye=>yr(Ye.key));ye.signal.addEventListener("abort",Tl);let{loaderResults:Ml,fetcherResults:Se}=await Um(P,Xn,Hs,gi,uo);if(ye.signal.aborted)return;ye.signal.removeEventListener("abort",Tl),ee.delete(A),oe.delete(A),gi.forEach(Ye=>oe.delete(Ye.key));let Qe=Zl(Ml);if(Qe)return mi(uo,Qe.result,!1,{preventScrollReset:Y});if(Qe=Zl(Se),Qe)return B.add(Qe.key),mi(uo,Qe.result,!1,{preventScrollReset:Y});let{loaderData:fo,errors:Qs}=yx(P,Xn,Ml,void 0,gi,Se,he);if(P.fetchers.has(A)){let Ye=Sr(Ee.data);P.fetchers.set(A,Ye)}Qm(_n),P.navigation.state==="loading"&&_n>V?(ge(k,"Expected pending action"),I&&I.abort(),ie(P.navigation.location,{matches:Xn,loaderData:fo,errors:Qs,fetchers:new Map(P.fetchers)})):(We({errors:Qs,loaderData:vx(P.loaderData,fo,Xn,Qs),fetchers:new Map(P.fetchers)}),$=!1)}async function mj(A,O,T,z,q,ne,ce,Y,Z){let J=P.fetchers.get(A);xr(A,ta(Z,J?J.data:void 0),{flushSync:ce});let re=new AbortController,ye=mo(e.history,T,re.signal);if(ne){let Ee=await Dl(q,T,ye.signal);if(Ee.type==="aborted")return;if(Ee.type==="error"){Yn(A,O,Ee.error,{flushSync:ce});return}else if(Ee.matches)q=Ee.matches,z=ga(q,T);else{Yn(A,O,Mt(404,{pathname:T}),{flushSync:ce});return}}oe.set(A,re);let be=H,De=(await Bs("loader",P,ye,[z],q,A))[z.route.id];if(Jr(De)&&(De=await fm(De,ye.signal,!0)||De),oe.get(A)===re&&oe.delete(A),!ye.signal.aborted){if(le.has(A)){xr(A,Sr(void 0));return}if(Ri(De))if(V>be){xr(A,Sr(void 0));return}else{B.add(A),await mi(ye,De,!1,{preventScrollReset:Y});return}if(Gt(De)){Yn(A,O,De.error);return}ge(!Jr(De),"Unhandled fetcher deferred data"),xr(A,Sr(De.data))}}async function mi(A,O,T,z){let{submission:q,fetcherSubmission:ne,preventScrollReset:ce,replace:Y}=z===void 0?{}:z;O.response.headers.has("X-Remix-Revalidate")&&($=!0);let Z=O.response.headers.get("Location");ge(Z,"Expected a Location header on the redirect Response"),Z=gx(Z,new URL(A.url),c);let J=Ka(P.location,Z,{_isRedirect:!0});if(n){let Ee=!1;if(O.response.headers.has("X-Remix-Reload-Document"))Ee=!0;else if(dm.test(Z)){const He=e.history.createURL(Z);Ee=He.origin!==t.location.origin||Ds(He.pathname,c)==null}if(Ee){Y?t.location.replace(Z):t.location.assign(Z);return}}I=null;let re=Y===!0||O.response.headers.has("X-Remix-Replace")?Xe.Replace:Xe.Push,{formMethod:ye,formAction:be,formEncType:ut}=P.navigation;!q&&!ne&&ye&&be&&ut&&(q=Cx(P.navigation));let De=q||ne;if(SP.has(O.response.status)&&De&&jn(De.formMethod))await tn(re,J,{submission:$e({},De,{formAction:Z}),preventScrollReset:ce||R,enableViewTransition:T?D:void 0});else{let Ee=Nd(J,q);await tn(re,J,{overrideNavigation:Ee,fetcherSubmission:ne,preventScrollReset:ce||R,enableViewTransition:T?D:void 0})}}async function Bs(A,O,T,z,q,ne){let ce,Y={};try{ce=await _P(d,A,O,T,z,q,ne,o,i)}catch(Z){return z.forEach(J=>{Y[J.route.id]={type:_e.error,error:Z}}),Y}for(let[Z,J]of Object.entries(ce))if($P(J)){let re=J.result;Y[Z]={type:_e.redirect,response:MP(re,T,Z,q,c,f.v7_relativeSplatPath)}}else Y[Z]=await TP(J);return Y}async function Um(A,O,T,z,q){let ne=A.matches,ce=Bs("loader",A,q,T,O,null),Y=Promise.all(z.map(async re=>{if(re.matches&&re.match&&re.controller){let be=(await Bs("loader",A,mo(e.history,re.path,re.controller.signal),[re.match],re.matches,re.key))[re.match.route.id];return{[re.key]:be}}else return Promise.resolve({[re.key]:{type:_e.error,error:Mt(404,{pathname:re.path})}})})),Z=await ce,J=(await Y).reduce((re,ye)=>Object.assign(re,ye),{});return await Promise.all([UP(O,Z,q.signal,ne,A.loaderData),BP(O,J,z)]),{loaderResults:Z,fetcherResults:J}}function id(){$=!0,X.push(...sd()),Q.forEach((A,O)=>{oe.has(O)&&ue.add(O),yr(O)})}function xr(A,O,T){T===void 0&&(T={}),P.fetchers.set(A,O),We({fetchers:new Map(P.fetchers)},{flushSync:(T&&T.flushSync)===!0})}function Yn(A,O,T,z){z===void 0&&(z={});let q=Ci(P.matches,O);Il(A),We({errors:{[q.route.id]:T},fetchers:new Map(P.fetchers)},{flushSync:(z&&z.flushSync)===!0})}function Bm(A){return f.v7_fetcherPersist&&(ae.set(A,(ae.get(A)||0)+1),le.has(A)&&le.delete(A)),P.fetchers.get(A)||PP}function Il(A){let O=P.fetchers.get(A);oe.has(A)&&!(O&&O.state==="loading"&&ee.has(A))&&yr(A),Q.delete(A),ee.delete(A),B.delete(A),le.delete(A),ue.delete(A),P.fetchers.delete(A)}function gj(A){if(f.v7_fetcherPersist){let O=(ae.get(A)||0)-1;O<=0?(ae.delete(A),le.add(A)):ae.set(A,O)}else Il(A);We({fetchers:new Map(P.fetchers)})}function yr(A){let O=oe.get(A);O&&(O.abort(),oe.delete(A))}function Wm(A){for(let O of A){let T=Bm(O),z=Sr(T.data);P.fetchers.set(O,z)}}function Hm(){let A=[],O=!1;for(let T of B){let z=P.fetchers.get(T);ge(z,"Expected fetcher: "+T),z.state==="loading"&&(B.delete(T),A.push(T),O=!0)}return Wm(A),O}function Qm(A){let O=[];for(let[T,z]of ee)if(z0}function xj(A,O){let T=P.blockers.get(A)||ea;return me.get(A)!==O&&me.set(A,O),T}function Vm(A){P.blockers.delete(A),me.delete(A)}function Ol(A,O){let T=P.blockers.get(A)||ea;ge(T.state==="unblocked"&&O.state==="blocked"||T.state==="blocked"&&O.state==="blocked"||T.state==="blocked"&&O.state==="proceeding"||T.state==="blocked"&&O.state==="unblocked"||T.state==="proceeding"&&O.state==="unblocked","Invalid blocker state transition: "+T.state+" -> "+O.state);let z=new Map(P.blockers);z.set(A,O),We({blockers:z})}function Km(A){let{currentLocation:O,nextLocation:T,historyAction:z}=A;if(me.size===0)return;me.size>1&&Cs(!1,"A router only supports one blocker at a time");let q=Array.from(me.entries()),[ne,ce]=q[q.length-1],Y=P.blockers.get(ne);if(!(Y&&Y.state==="proceeding")&&ce({currentLocation:O,nextLocation:T,historyAction:z}))return ne}function od(A){let O=Mt(404,{pathname:A}),T=l||a,{matches:z,route:q}=bx(T);return sd(),{notFoundMatches:z,route:q,error:O}}function sd(A){let O=[];return he.forEach((T,z)=>{(!A||A(z))&&(T.cancel(),O.push(z),he.delete(z))}),O}function yj(A,O,T){if(x=A,S=O,g=T||null,!w&&P.navigation===Ld){w=!0;let z=qm(P.location,P.matches);z!=null&&We({restoreScrollPosition:z})}return()=>{x=null,S=null,g=null}}function Gm(A,O){return g&&g(A,O.map(z=>nP(z,P.loaderData)))||A.key}function vj(A,O){if(x&&S){let T=Gm(A,O);x[T]=S()}}function qm(A,O){if(x){let T=Gm(A,O),z=x[T];if(typeof z=="number")return z}return null}function _l(A,O,T){if(p)if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:Rc(O,T,c,!0)}}else return{active:!0,matches:Rc(O,T,c,!0)||[]};return{active:!1,matches:null}}async function Dl(A,O,T){if(!p)return{type:"success",matches:A};let z=A;for(;;){let q=l==null,ne=l||a,ce=o;try{await p({path:O,matches:z,patch:(J,re)=>{T.aborted||mx(J,re,ne,ce,i)}})}catch(J){return{type:"error",error:J,partialMatches:z}}finally{q&&!T.aborted&&(a=[...a])}if(T.aborted)return{type:"aborted"};let Y=ji(ne,O,c);if(Y)return{type:"success",matches:Y};let Z=Rc(ne,O,c,!0);if(!Z||z.length===Z.length&&z.every((J,re)=>J.route.id===Z[re].route.id))return{type:"success",matches:null};z=Z}}function wj(A){o={},l=au(A,i,void 0,o)}function bj(A,O){let T=l==null;mx(A,O,l||a,o,i),T&&(a=[...a],We({}))}return E={get basename(){return c},get future(){return f},get state(){return P},get routes(){return a},get window(){return t},initialize:de,subscribe:mn,enableScrollRestoration:yj,navigate:Pe,fetch:Al,revalidate:ct,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Bm,deleteFetcher:gj,dispose:Ce,getBlocker:xj,deleteBlocker:Vm,patchRoutes:bj,_internalFetchControllers:oe,_internalActiveDeferreds:he,_internalSetRoutes:wj},E}function RP(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function vp(e,t,n,r,i,o,a,l){let c,d;if(a){c=[];for(let f of t)if(c.push(f),f.route.id===a){d=f;break}}else c=t,d=t[t.length-1];let p=zu(i||".",Fu(c,o),Ds(e.pathname,n)||e.pathname,l==="path");if(i==null&&(p.search=e.search,p.hash=e.hash),(i==null||i===""||i===".")&&d){let f=pm(p.search);if(d.route.index&&!f)p.search=p.search?p.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&f){let h=new URLSearchParams(p.search),j=h.getAll("index");h.delete("index"),j.filter(g=>g).forEach(g=>h.append("index",g));let x=h.toString();p.search=x?"?"+x:""}}return r&&n!=="/"&&(p.pathname=p.pathname==="/"?n:ur([n,p.pathname])),to(p)}function dx(e,t,n,r){if(!r||!RP(r))return{path:n};if(r.formMethod&&!zP(r.formMethod))return{path:n,error:Mt(405,{method:r.formMethod})};let i=()=>({path:n,error:Mt(400,{type:"invalid-body"})}),o=r.formMethod||"get",a=e?o.toUpperCase():o.toLowerCase(),l=J1(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!jn(a))return i();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((j,x)=>{let[g,S]=x;return""+j+g+"="+S+` +`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!jn(a))return i();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return i()}}}ge(typeof FormData=="function","FormData is not available in this environment");let c,d;if(r.formData)c=bp(r.formData),d=r.formData;else if(r.body instanceof FormData)c=bp(r.body),d=r.body;else if(r.body instanceof URLSearchParams)c=r.body,d=xx(c);else if(r.body==null)c=new URLSearchParams,d=new FormData;else try{c=new URLSearchParams(r.body),d=xx(c)}catch{return i()}let p={formMethod:a,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(jn(p.formMethod))return{path:n,submission:p};let f=fi(n);return t&&f.search&&pm(f.search)&&c.append("index",""),f.search="?"+c,{path:to(f),submission:p}}function fx(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function px(e,t,n,r,i,o,a,l,c,d,p,f,h,j,x,g){let S=g?Gt(g[1])?g[1].error:g[1].data:void 0,w=e.createURL(t.location),m=e.createURL(i),v=n;o&&t.errors?v=fx(n,Object.keys(t.errors)[0],!0):g&&Gt(g[1])&&(v=fx(n,g[0]));let b=g?g[1].statusCode:void 0,E=a&&b&&b>=400,P=v.filter((R,I)=>{let{route:D}=R;if(D.lazy)return!0;if(D.loader==null)return!1;if(o)return wp(D,t.loaderData,t.errors);if(AP(t.loaderData,t.matches[I],R)||c.some(F=>F===R.route.id))return!0;let _=t.matches[I],N=R;return hx(R,$e({currentUrl:w,currentParams:_.params,nextUrl:m,nextParams:N.params},r,{actionResult:S,actionStatus:b,defaultShouldRevalidate:E?!1:l||w.pathname+w.search===m.pathname+m.search||w.search!==m.search||G1(_,N)}))}),k=[];return f.forEach((R,I)=>{if(o||!n.some($=>$.route.id===R.routeId)||p.has(I))return;let D=ji(j,R.path,x);if(!D){k.push({key:I,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let _=t.fetchers.get(I),N=ga(D,R.path),F=!1;h.has(I)?F=!1:d.has(I)?(d.delete(I),F=!0):_&&_.state!=="idle"&&_.data===void 0?F=l:F=hx(N,$e({currentUrl:w,currentParams:t.matches[t.matches.length-1].params,nextUrl:m,nextParams:n[n.length-1].params},r,{actionResult:S,actionStatus:b,defaultShouldRevalidate:E?!1:l})),F&&k.push({key:I,routeId:R.routeId,path:R.path,matches:D,match:N,controller:new AbortController})}),[P,k]}function wp(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function AP(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function G1(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function hx(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function mx(e,t,n,r,i){var o;let a;if(e){let d=r[e];ge(d,"No route found to patch children into: routeId = "+e),d.children||(d.children=[]),a=d.children}else a=n;let l=t.filter(d=>!a.some(p=>q1(d,p))),c=au(l,i,[e||"_","patch",String(((o=a)==null?void 0:o.length)||"0")],r);a.push(...c)}function q1(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(o=>q1(n,o))}):!1}async function IP(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];ge(i,"No route found in manifest");let o={};for(let a in r){let c=i[a]!==void 0&&a!=="hasErrorBoundary";Cs(!c,'Route "'+i.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!c&&!eP.has(a)&&(o[a]=r[a])}Object.assign(i,o),Object.assign(i,$e({},t(i),{lazy:void 0}))}async function OP(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,o,a)=>Object.assign(i,{[n[a].route.id]:o}),{})}async function _P(e,t,n,r,i,o,a,l,c,d){let p=o.map(j=>j.route.lazy?IP(j.route,c,l):void 0),f=o.map((j,x)=>{let g=p[x],S=i.some(m=>m.route.id===j.route.id);return $e({},j,{shouldLoad:S,resolve:async m=>(m&&r.method==="GET"&&(j.route.lazy||j.route.loader)&&(S=!0),S?DP(t,r,j,g,m,d):Promise.resolve({type:_e.data,result:void 0}))})}),h=await e({matches:f,request:r,params:o[0].params,fetcherKey:a,context:d});try{await Promise.all(p)}catch{}return h}async function DP(e,t,n,r,i,o){let a,l,c=d=>{let p,f=new Promise((x,g)=>p=g);l=()=>p(),t.signal.addEventListener("abort",l);let h=x=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):d({request:t,params:n.params,context:o},...x!==void 0?[x]:[]),j=(async()=>{try{return{type:"data",result:await(i?i(g=>h(g)):h())}}catch(x){return{type:"error",result:x}}})();return Promise.race([j,f])};try{let d=n.route[e];if(r)if(d){let p,[f]=await Promise.all([c(d).catch(h=>{p=h}),r]);if(p!==void 0)throw p;a=f}else if(await r,d=n.route[e],d)a=await c(d);else if(e==="action"){let p=new URL(t.url),f=p.pathname+p.search;throw Mt(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:_e.data,result:void 0};else if(d)a=await c(d);else{let p=new URL(t.url),f=p.pathname+p.search;throw Mt(404,{pathname:f})}ge(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(d){return{type:_e.error,result:d}}finally{l&&t.signal.removeEventListener("abort",l)}return a}async function TP(e){let{result:t,type:n}=e;if(Y1(t)){let d;try{let p=t.headers.get("Content-Type");p&&/\bapplication\/json\b/.test(p)?t.body==null?d=null:d=await t.json():d=await t.text()}catch(p){return{type:_e.error,error:p}}return n===_e.error?{type:_e.error,error:new lu(t.status,t.statusText,d),statusCode:t.status,headers:t.headers}:{type:_e.data,data:d,statusCode:t.status,headers:t.headers}}if(n===_e.error){if(jx(t)){var r;if(t.data instanceof Error){var i;return{type:_e.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status}}t=new lu(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:_e.error,error:t,statusCode:gl(t)?t.status:void 0}}if(FP(t)){var o,a;return{type:_e.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((a=t.init)==null?void 0:a.headers)&&new Headers(t.init.headers)}}if(jx(t)){var l,c;return{type:_e.data,data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}}return{type:_e.data,data:t}}function MP(e,t,n,r,i,o){let a=e.headers.get("Location");if(ge(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!dm.test(a)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);a=vp(new URL(t.url),l,i,!0,a,o),e.headers.set("Location",a)}return e}function gx(e,t,n){if(dm.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=Ds(i.pathname,n)!=null;if(i.origin===t.origin&&o)return i.pathname+i.search+i.hash}return e}function mo(e,t,n,r){let i=e.createURL(J1(t)).toString(),o={signal:n};if(r&&jn(r.formMethod)){let{formMethod:a,formEncType:l}=r;o.method=a.toUpperCase(),l==="application/json"?(o.headers=new Headers({"Content-Type":l}),o.body=JSON.stringify(r.json)):l==="text/plain"?o.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?o.body=bp(r.formData):o.body=r.formData}return new Request(i,o)}function bp(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function xx(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function LP(e,t,n,r,i){let o={},a=null,l,c=!1,d={},p=n&&Gt(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let h=f.route.id,j=t[h];if(ge(!Ri(j),"Cannot handle redirect results in processLoaderData"),Gt(j)){let x=j.error;p!==void 0&&(x=p,p=void 0),a=a||{};{let g=Ci(e,h);a[g.route.id]==null&&(a[g.route.id]=x)}o[h]=void 0,c||(c=!0,l=gl(j.error)?j.error.status:500),j.headers&&(d[h]=j.headers)}else Jr(j)?(r.set(h,j.deferredData),o[h]=j.deferredData.data,j.statusCode!=null&&j.statusCode!==200&&!c&&(l=j.statusCode),j.headers&&(d[h]=j.headers)):(o[h]=j.data,j.statusCode&&j.statusCode!==200&&!c&&(l=j.statusCode),j.headers&&(d[h]=j.headers))}),p!==void 0&&n&&(a={[n[0]]:p},o[n[0]]=void 0),{loaderData:o,errors:a,statusCode:l||200,loaderHeaders:d}}function yx(e,t,n,r,i,o,a){let{loaderData:l,errors:c}=LP(t,n,r,a);return i.forEach(d=>{let{key:p,match:f,controller:h}=d,j=o[p];if(ge(j,"Did not find corresponding fetcher result"),!(h&&h.signal.aborted))if(Gt(j)){let x=Ci(e.matches,f==null?void 0:f.route.id);c&&c[x.route.id]||(c=$e({},c,{[x.route.id]:j.error})),e.fetchers.delete(p)}else if(Ri(j))ge(!1,"Unhandled fetcher revalidation redirect");else if(Jr(j))ge(!1,"Unhandled fetcher deferred data");else{let x=Sr(j.data);e.fetchers.set(p,x)}}),{loaderData:l,errors:c}}function vx(e,t,n,r){let i=$e({},t);for(let o of n){let a=o.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(i[a]=t[a]):e[a]!==void 0&&o.route.loader&&(i[a]=e[a]),r&&r.hasOwnProperty(a))break}return i}function wx(e){return e?Gt(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ci(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function bx(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Mt(e,t){let{pathname:n,routeId:r,method:i,type:o,message:a}=t===void 0?{}:t,l="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(l="Bad Request",i&&n&&r?c="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":o==="defer-action"?c="defer() is not supported in actions":o==="invalid-body"&&(c="Unable to encode submission body")):e===403?(l="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):e===404?(l="Not Found",c='No route matches URL "'+n+'"'):e===405&&(l="Method Not Allowed",i&&n&&r?c="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(c='Invalid request method "'+i.toUpperCase()+'"')),new lu(e||500,l,new Error(c),!0)}function Zl(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Ri(i))return{key:r,result:i}}}function J1(e){let t=typeof e=="string"?fi(e):e;return to($e({},t,{hash:""}))}function NP(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function $P(e){return Y1(e.result)&&CP.has(e.result.status)}function Jr(e){return e.type===_e.deferred}function Gt(e){return e.type===_e.error}function Ri(e){return(e&&e.type)===_e.redirect}function jx(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function FP(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Y1(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function zP(e){return jP.has(e.toLowerCase())}function jn(e){return wP.has(e.toLowerCase())}async function UP(e,t,n,r,i){let o=Object.entries(t);for(let a=0;a(h==null?void 0:h.route.id)===l);if(!d)continue;let p=r.find(h=>h.route.id===d.route.id),f=p!=null&&!G1(p,d)&&(i&&i[d.route.id])!==void 0;Jr(c)&&f&&await fm(c,n,!1).then(h=>{h&&(t[l]=h)})}}async function BP(e,t,n){for(let r=0;r(d==null?void 0:d.route.id)===o)&&Jr(l)&&(ge(a,"Expected an AbortController for revalidating fetcher deferred result"),await fm(l,a.signal,!0).then(d=>{d&&(t[i]=d)}))}}async function fm(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:_e.data,data:e.deferredData.unwrappedData}}catch(i){return{type:_e.error,error:i}}return{type:_e.data,data:e.deferredData.data}}}function pm(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ga(e,t){let n=typeof t=="string"?fi(t).search:t.search;if(e[e.length-1].route.index&&pm(n||""))return e[e.length-1];let r=Q1(e);return r[r.length-1]}function Cx(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:o,json:a}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function Nd(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function WP(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function ta(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function HP(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Sr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function QP(e,t){try{let n=e.sessionStorage.getItem(K1);if(n){let r=JSON.parse(n);for(let[i,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(i,new Set(o||[]))}}catch{}}function VP(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(K1,JSON.stringify(n))}catch(r){Cs(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** + * React Router v6.28.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function cu(){return cu=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),C.useCallback(function(d,p){if(p===void 0&&(p={}),!l.current)return;if(typeof d=="number"){r.go(d);return}let f=zu(d,JSON.parse(a),o,p.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ur([t,f.pathname])),(p.replace?r.replace:r.push)(f,p.state,p)},[t,r,a,o,e])}const qP=C.createContext(null);function JP(e){let t=C.useContext(Jn).outlet;return t&&C.createElement(qP.Provider,{value:e},t)}function ao(){let{matches:e}=C.useContext(Jn),t=e[e.length-1];return t?t.params:{}}function tw(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=C.useContext(pi),{matches:i}=C.useContext(Jn),{pathname:o}=it(),a=JSON.stringify(Fu(i,r.v7_relativeSplatPath));return C.useMemo(()=>zu(e,JSON.parse(a),o,n==="path"),[e,a,o,n])}function YP(e,t,n,r){Ts()||ge(!1);let{navigator:i}=C.useContext(pi),{matches:o}=C.useContext(Jn),a=o[o.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let d=it(),p;p=d;let f=p.pathname||"/",h=f;if(c!=="/"){let g=c.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(g.length).join("/")}let j=ji(e,{pathname:h});return n2(j&&j.map(g=>Object.assign({},g,{params:Object.assign({},l,g.params),pathname:ur([c,i.encodeLocation?i.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?c:ur([c,i.encodeLocation?i.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,n,r)}function XP(){let e=iw(),t=gl(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return C.createElement(C.Fragment,null,C.createElement("h2",null,"Unexpected Application Error!"),C.createElement("h3",{style:{fontStyle:"italic"}},t),n?C.createElement("pre",{style:i},n):null,null)}const ZP=C.createElement(XP,null);class e2 extends C.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?C.createElement(Jn.Provider,{value:this.props.routeContext},C.createElement(Z1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function t2(e){let{routeContext:t,match:n,children:r}=e,i=C.useContext(Uu);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),C.createElement(Jn.Provider,{value:t},r)}function n2(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if(!n)return null;if(n.errors)e=n.matches;else if((o=r)!=null&&o.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let p=a.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);p>=0||ge(!1),a=a.slice(0,Math.min(a.length,p+1))}let c=!1,d=-1;if(n&&r&&r.v7_partialHydration)for(let p=0;p=0?a=a.slice(0,d+1):a=[a[0]];break}}}return a.reduceRight((p,f,h)=>{let j,x=!1,g=null,S=null;n&&(j=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||ZP,c&&(d<0&&h===0?(a2("route-fallback"),x=!0,S=null):d===h&&(x=!0,S=f.route.hydrateFallbackElement||null)));let w=t.concat(a.slice(0,h+1)),m=()=>{let v;return j?v=g:x?v=S:f.route.Component?v=C.createElement(f.route.Component,null):f.route.element?v=f.route.element:v=p,C.createElement(t2,{match:f,routeContext:{outlet:p,matches:w,isDataRoute:n!=null},children:v})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?C.createElement(e2,{location:n.location,revalidation:n.revalidation,component:g,error:j,children:m(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):m()},null)}var nw=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(nw||{}),uu=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(uu||{});function r2(e){let t=C.useContext(Uu);return t||ge(!1),t}function i2(e){let t=C.useContext(X1);return t||ge(!1),t}function o2(e){let t=C.useContext(Jn);return t||ge(!1),t}function rw(e){let t=o2(),n=t.matches[t.matches.length-1];return n.route.id||ge(!1),n.route.id}function iw(){var e;let t=C.useContext(Z1),n=i2(uu.UseRouteError),r=rw(uu.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function s2(){let{router:e}=r2(nw.UseNavigateStable),t=rw(uu.UseNavigateStable),n=C.useRef(!1);return ew(()=>{n.current=!0}),C.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,cu({fromRouteId:t},o)))},[e,t])}const Sx={};function a2(e,t,n){Sx[e]||(Sx[e]=!0)}const Px={};function l2(e,t){Px[t]||(Px[t]=!0,console.warn(t))}const go=(e,t,n)=>l2(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function c2(e,t){e!=null&&e.v7_startTransition||go("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&(!t||!t.v7_relativeSplatPath)&&go("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(t.v7_fetcherPersist||go("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod||go("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration||go("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation||go("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function u2(e){let{to:t,replace:n,state:r,relative:i}=e;Ts()||ge(!1);let{future:o,static:a}=C.useContext(pi),{matches:l}=C.useContext(Jn),{pathname:c}=it(),d=Ie(),p=zu(t,Fu(l,o.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(p);return C.useEffect(()=>d(JSON.parse(f),{replace:n,state:r,relative:i}),[d,f,i,n,r]),null}function d2(e){return JP(e.context)}function f2(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Xe.Pop,navigator:o,static:a=!1,future:l}=e;Ts()&&ge(!1);let c=t.replace(/^\/*/,"/"),d=C.useMemo(()=>({basename:c,navigator:o,static:a,future:cu({v7_relativeSplatPath:!1},l)}),[c,l,o,a]);typeof r=="string"&&(r=fi(r));let{pathname:p="/",search:f="",hash:h="",state:j=null,key:x="default"}=r,g=C.useMemo(()=>{let S=Ds(p,c);return S==null?null:{location:{pathname:S,search:f,hash:h,state:j,key:x},navigationType:i}},[c,p,f,h,j,x,i]);return g==null?null:C.createElement(pi.Provider,{value:d},C.createElement(hm.Provider,{children:n,value:g}))}new Promise(()=>{});function p2(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:C.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:C.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:C.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** + * React Router DOM v6.28.0 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function Ga(){return Ga=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function m2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function g2(e,t){return e.button===0&&(!t||t==="_self")&&!m2(e)}const x2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],y2="6";try{window.__reactRouterVersion=y2}catch{}function v2(e,t){return kP({basename:t==null?void 0:t.basename,future:Ga({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:YS({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||w2(),routes:e,mapRouteProperties:p2,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function w2(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Ga({},t,{errors:b2(t.errors)})),t}function b2(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new lu(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let o=window[i.__subType];if(typeof o=="function")try{let a=new o(i.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let o=new Error(i.message);o.stack="",n[r]=o}}else n[r]=i;return n}const j2=C.createContext({isTransitioning:!1}),C2=C.createContext(new Map),S2="startTransition",Ex=$j[S2],P2="flushSync",kx=JS[P2];function E2(e){Ex?Ex(e):e()}function na(e){kx?kx(e):e()}class k2{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function R2(e){let{fallbackElement:t,router:n,future:r}=e,[i,o]=C.useState(n.state),[a,l]=C.useState(),[c,d]=C.useState({isTransitioning:!1}),[p,f]=C.useState(),[h,j]=C.useState(),[x,g]=C.useState(),S=C.useRef(new Map),{v7_startTransition:w}=r||{},m=C.useCallback(R=>{w?E2(R):R()},[w]),v=C.useCallback((R,I)=>{let{deletedFetchers:D,flushSync:_,viewTransitionOpts:N}=I;D.forEach($=>S.current.delete($)),R.fetchers.forEach(($,X)=>{$.data!==void 0&&S.current.set(X,$.data)});let F=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!N||F){_?na(()=>o(R)):m(()=>o(R));return}if(_){na(()=>{h&&(p&&p.resolve(),h.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:N.currentLocation,nextLocation:N.nextLocation})});let $=n.window.document.startViewTransition(()=>{na(()=>o(R))});$.finished.finally(()=>{na(()=>{f(void 0),j(void 0),l(void 0),d({isTransitioning:!1})})}),na(()=>j($));return}h?(p&&p.resolve(),h.skipTransition(),g({state:R,currentLocation:N.currentLocation,nextLocation:N.nextLocation})):(l(R),d({isTransitioning:!0,flushSync:!1,currentLocation:N.currentLocation,nextLocation:N.nextLocation}))},[n.window,h,p,S,m]);C.useLayoutEffect(()=>n.subscribe(v),[n,v]),C.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new k2)},[c]),C.useEffect(()=>{if(p&&a&&n.window){let R=a,I=p.promise,D=n.window.document.startViewTransition(async()=>{m(()=>o(R)),await I});D.finished.finally(()=>{f(void 0),j(void 0),l(void 0),d({isTransitioning:!1})}),j(D)}},[m,a,p,n.window]),C.useEffect(()=>{p&&a&&i.location.key===a.location.key&&p.resolve()},[p,h,i.location,a]),C.useEffect(()=>{!c.isTransitioning&&x&&(l(x.state),d({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),g(void 0))},[c.isTransitioning,x]),C.useEffect(()=>{},[]);let b=C.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:R=>n.navigate(R),push:(R,I,D)=>n.navigate(R,{state:I,preventScrollReset:D==null?void 0:D.preventScrollReset}),replace:(R,I,D)=>n.navigate(R,{replace:!0,state:I,preventScrollReset:D==null?void 0:D.preventScrollReset})}),[n]),E=n.basename||"/",P=C.useMemo(()=>({router:n,navigator:b,static:!1,basename:E}),[n,b,E]),k=C.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return C.useEffect(()=>c2(r,n.future),[r,n.future]),C.createElement(C.Fragment,null,C.createElement(Uu.Provider,{value:P},C.createElement(X1.Provider,{value:i},C.createElement(C2.Provider,{value:S.current},C.createElement(j2.Provider,{value:c},C.createElement(f2,{basename:E,location:i.location,navigationType:i.historyAction,navigator:b,future:k},i.initialized||n.future.v7_partialHydration?C.createElement(A2,{routes:n.routes,future:n.future,state:i}):t))))),null)}const A2=C.memo(I2);function I2(e){let{routes:t,future:n,state:r}=e;return YP(t,void 0,r,n)}const O2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gn=C.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:a,state:l,target:c,to:d,preventScrollReset:p,viewTransition:f}=t,h=h2(t,x2),{basename:j}=C.useContext(pi),x,g=!1;if(typeof d=="string"&&_2.test(d)&&(x=d,O2))try{let v=new URL(window.location.href),b=d.startsWith("//")?new URL(v.protocol+d):new URL(d),E=Ds(b.pathname,j);b.origin===v.origin&&E!=null?d=E+b.search+b.hash:g=!0}catch{}let S=KP(d,{relative:i}),w=D2(d,{replace:a,state:l,target:c,preventScrollReset:p,relative:i,viewTransition:f});function m(v){r&&r(v),v.defaultPrevented||w(v)}return C.createElement("a",Ga({},h,{href:x||S,onClick:g||o?r:m,ref:n,target:c}))});var Rx;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Rx||(Rx={}));var Ax;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ax||(Ax={}));function D2(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:a,viewTransition:l}=t===void 0?{}:t,c=Ie(),d=it(),p=tw(e,{relative:a});return C.useCallback(f=>{if(g2(f,n)){f.preventDefault();let h=r!==void 0?r:to(d)===to(p);c(e,{replace:h,state:i,preventScrollReset:o,relative:a,viewTransition:l})}},[d,c,p,r,i,n,e,o,a,l])}const T2=()=>{var t;const e=iw();return gl(e)?s.jsxs("div",{children:[s.jsx("h1",{children:"Oops! something is wrong"}),s.jsx("h2",{children:e.status}),s.jsx("p",{children:e.statusText}),((t=e.data)==null?void 0:t.message)&&s.jsx("p",{children:e.data.message})]}):s.jsx("h1",{children:"Oops! something is wrong"})},M2=()=>s.jsx("h1",{children:"NotFoundPage"});var wt=function(){return wt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r0?st(Ms,--hn):0,Ps--,Ze===10&&(Ps=1,Wu--),Ze}function Rn(){return Ze=hn2||Cp(Ze)>3?"":" "}function Q2(e,t){for(;--t&&Rn()&&!(Ze<48||Ze>102||Ze>57&&Ze<65||Ze>70&&Ze<97););return Qu(e,Ic()+(t<6&&Ki()==32&&Rn()==32))}function Sp(e){for(;Rn();)switch(Ze){case e:return hn;case 34:case 39:e!==34&&e!==39&&Sp(Ze);break;case 40:e===41&&Sp(e);break;case 92:Rn();break}return hn}function V2(e,t){for(;Rn()&&e+Ze!==57;)if(e+Ze===84&&Ki()===47)break;return"/*"+Qu(t,hn-1)+"*"+gm(e===47?e:Rn())}function K2(e){for(;!Cp(Ki());)Rn();return Qu(e,hn)}function G2(e){return W2(Oc("",null,null,null,[""],e=B2(e),0,[0],e))}function Oc(e,t,n,r,i,o,a,l,c){for(var d=0,p=0,f=a,h=0,j=0,x=0,g=1,S=1,w=1,m=0,v="",b=i,E=o,P=r,k=v;S;)switch(x=m,m=Rn()){case 40:if(x!=108&&st(k,f-1)==58){Ac(k+=pe($d(m),"&","&\f"),"&\f",aw(d?l[d-1]:0))!=-1&&(w=-1);break}case 34:case 39:case 91:k+=$d(m);break;case 9:case 10:case 13:case 32:k+=H2(x);break;case 92:k+=Q2(Ic()-1,7);continue;case 47:switch(Ki()){case 42:case 47:xa(q2(V2(Rn(),Ic()),t,n,c),c);break;default:k+="/"}break;case 123*g:l[d++]=Wn(k)*w;case 125*g:case 59:case 0:switch(m){case 0:case 125:S=0;case 59+p:w==-1&&(k=pe(k,/\f/g,"")),j>0&&Wn(k)-f&&xa(j>32?_x(k+";",r,n,f-1,c):_x(pe(k," ","")+";",r,n,f-2,c),c);break;case 59:k+=";";default:if(xa(P=Ox(k,t,n,d,p,i,l,v,b=[],E=[],f,o),o),m===123)if(p===0)Oc(k,t,P,P,b,o,f,l,E);else switch(h===99&&st(k,3)===110?100:h){case 100:case 108:case 109:case 115:Oc(e,P,P,r&&xa(Ox(e,P,P,0,0,i,l,v,i,b=[],f,E),E),i,E,f,l,r?b:E);break;default:Oc(k,P,P,P,[""],E,0,l,E)}}d=p=j=0,g=w=1,v=k="",f=a;break;case 58:f=1+Wn(k),j=x;default:if(g<1){if(m==123)--g;else if(m==125&&g++==0&&U2()==125)continue}switch(k+=gm(m),m*g){case 38:w=p>0?1:(k+="\f",-1);break;case 44:l[d++]=(Wn(k)-1)*w,w=1;break;case 64:Ki()===45&&(k+=$d(Rn())),h=Ki(),p=f=Wn(v=k+=K2(Ic())),m++;break;case 45:x===45&&Wn(k)==2&&(g=0)}}return o}function Ox(e,t,n,r,i,o,a,l,c,d,p,f){for(var h=i-1,j=i===0?o:[""],x=cw(j),g=0,S=0,w=0;g0?j[m]+" "+v:pe(v,/&\f/g,j[m])))&&(c[w++]=b);return Hu(e,t,n,i===0?Bu:l,c,d,p,f)}function q2(e,t,n,r){return Hu(e,t,n,ow,gm(z2()),Ss(e,2,-2),0,r)}function _x(e,t,n,r,i){return Hu(e,t,n,mm,Ss(e,0,r),Ss(e,r+1,-1),r,i)}function dw(e,t,n){switch($2(e,t)){case 5103:return ke+"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 ke+e+e;case 4789:return Aa+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return ke+e+Aa+e+Le+e+e;case 5936:switch(st(e,t+11)){case 114:return ke+e+Le+pe(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return ke+e+Le+pe(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return ke+e+Le+pe(e,/[svh]\w+-[tblr]{2}/,"lr")+e}case 6828:case 4268:case 2903:return ke+e+Le+e+e;case 6165:return ke+e+Le+"flex-"+e+e;case 5187:return ke+e+pe(e,/(\w+).+(:[^]+)/,ke+"box-$1$2"+Le+"flex-$1$2")+e;case 5443:return ke+e+Le+"flex-item-"+pe(e,/flex-|-self/g,"")+(ir(e,/flex-|baseline/)?"":Le+"grid-row-"+pe(e,/flex-|-self/g,""))+e;case 4675:return ke+e+Le+"flex-line-pack"+pe(e,/align-content|flex-|-self/g,"")+e;case 5548:return ke+e+Le+pe(e,"shrink","negative")+e;case 5292:return ke+e+Le+pe(e,"basis","preferred-size")+e;case 6060:return ke+"box-"+pe(e,"-grow","")+ke+e+Le+pe(e,"grow","positive")+e;case 4554:return ke+pe(e,/([^-])(transform)/g,"$1"+ke+"$2")+e;case 6187:return pe(pe(pe(e,/(zoom-|grab)/,ke+"$1"),/(image-set)/,ke+"$1"),e,"")+e;case 5495:case 3959:return pe(e,/(image-set\([^]*)/,ke+"$1$`$1");case 4968:return pe(pe(e,/(.+:)(flex-)?(.*)/,ke+"box-pack:$3"+Le+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ke+e+e;case 4200:if(!ir(e,/flex-|baseline/))return Le+"grid-column-align"+Ss(e,t)+e;break;case 2592:case 3360:return Le+pe(e,"template-","")+e;case 4384:case 3616:return n&&n.some(function(r,i){return t=i,ir(r.props,/grid-\w+-end/)})?~Ac(e+(n=n[t].value),"span",0)?e:Le+pe(e,"-start","")+e+Le+"grid-row-span:"+(~Ac(n,"span",0)?ir(n,/\d+/):+ir(n,/\d+/)-+ir(e,/\d+/))+";":Le+pe(e,"-start","")+e;case 4896:case 4128:return n&&n.some(function(r){return ir(r.props,/grid-\w+-start/)})?e:Le+pe(pe(e,"-end","-span"),"span ","")+e;case 4095:case 3583:case 4068:case 2532:return pe(e,/(.+)-inline(.+)/,ke+"$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(Wn(e)-1-t>6)switch(st(e,t+1)){case 109:if(st(e,t+4)!==45)break;case 102:return pe(e,/(.+:)(.+)-([^]+)/,"$1"+ke+"$2-$3$1"+Aa+(st(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Ac(e,"stretch",0)?dw(pe(e,"stretch","fill-available"),t,n)+e:e}break;case 5152:case 5920:return pe(e,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,function(r,i,o,a,l,c,d){return Le+i+":"+o+d+(a?Le+i+"-span:"+(l?c:+c-+o)+d:"")+e});case 4949:if(st(e,t+6)===121)return pe(e,":",":"+ke)+e;break;case 6444:switch(st(e,st(e,14)===45?18:11)){case 120:return pe(e,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+ke+(st(e,14)===45?"inline-":"")+"box$3$1"+ke+"$2$3$1"+Le+"$2box$3")+e;case 100:return pe(e,":",":"+Le)+e}break;case 5719:case 2647:case 2135:case 3927:case 2391:return pe(e,"scroll-","scroll-snap-")+e}return e}function du(e,t){for(var n="",r=0;r-1&&!e.return)switch(e.type){case mm:e.return=dw(e.value,e.length,n);return;case sw:return du([Pr(e,{value:pe(e.value,"@","@"+ke)})],r);case Bu:if(e.length)return F2(n=e.props,function(i){switch(ir(i,r=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":xo(Pr(e,{props:[pe(i,/:(read-\w+)/,":"+Aa+"$1")]})),xo(Pr(e,{props:[i]})),jp(e,{props:Ix(n,r)});break;case"::placeholder":xo(Pr(e,{props:[pe(i,/:(plac\w+)/,":"+ke+"input-$1")]})),xo(Pr(e,{props:[pe(i,/:(plac\w+)/,":"+Aa+"$1")]})),xo(Pr(e,{props:[pe(i,/:(plac\w+)/,Le+"input-$1")]})),xo(Pr(e,{props:[i]})),jp(e,{props:Ix(n,r)});break}return""})}}var eE={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,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},Ht={VITE_API_URL:"http://localhost:8000",VITE_KAKAO_KEY:"af7394f12b174cad35e87960ddccf91f",ACSetupSvcPort:"23210",ACSvcPort:"17532",ALLUSERSPROFILE:"C:\\ProgramData",APPDATA:"C:\\Users\\Sun_glitter\\AppData\\Roaming",ChocolateyInstall:"C:\\ProgramData\\chocolatey",ChocolateyLastPathUpdate:"133668974099245266",CHROME_CRASHPAD_PIPE_NAME:"\\\\.\\pipe\\crashpad_30528_TLIWLWZNYIKGYOAI",COLOR:"1",COLORTERM:"truecolor",CommonProgramFiles:"C:\\Program Files\\Common Files","CommonProgramFiles(x86)":"C:\\Program Files (x86)\\Common Files",CommonProgramW6432:"C:\\Program Files\\Common Files",COMPUTERNAME:"DESKTOP-MLJO4KS",ComSpec:"C:\\Windows\\system32\\cmd.exe",CONDA_PROMPT_MODIFIER:"False",DriverData:"C:\\Windows\\System32\\Drivers\\DriverData",EDITOR:"C:\\Windows\\notepad.exe",EFC_8688:"1",FPS_BROWSER_APP_PROFILE_STRING:"Internet Explorer",FPS_BROWSER_USER_PROFILE_STRING:"Default",GIT_ASKPASS:"c:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\extensions\\git\\dist\\askpass.sh",HOME:"C:\\Users\\Sun_glitter",HOMEDRIVE:"C:",HOMEPATH:"\\Users\\Sun_glitter",INIT_CWD:"C:\\final-project\\WEB1_2_LinkUP_FE",LANG:"ko_KR.UTF-8",LOCALAPPDATA:"C:\\Users\\Sun_glitter\\AppData\\Local",LOGONSERVER:"\\\\DESKTOP-MLJO4KS",NODE:"C:\\Program Files\\nodejs\\node.exe",NODE_ENV:"production",NODE_EXE:"C:\\Program Files\\nodejs\\\\node.exe",NODE_HOME:"C:\\Program Files\\nodejs",NPM_CLI_JS:"C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js",npm_command:"run-script",npm_config_cache:"C:\\Users\\Sun_glitter\\AppData\\Local\\npm-cache",npm_config_globalconfig:"C:\\Program Files\\nodejs\\etc\\npmrc",npm_config_global_prefix:"C:\\Program Files\\nodejs",npm_config_init_module:"C:\\Users\\Sun_glitter\\.npm-init.js",npm_config_local_prefix:"C:\\final-project\\WEB1_2_LinkUP_FE",npm_config_metrics_registry:"https://registry.npmjs.org/",npm_config_node_gyp:"C:\\Users\\Sun_glitter\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js",npm_config_noproxy:"",npm_config_npm_version:"9.8.1",npm_config_prefix:"C:\\Program Files\\nodejs",npm_config_userconfig:"C:\\Users\\Sun_glitter\\.npmrc",npm_config_user_agent:"npm/9.8.1 node/v18.18.2 win32 x64 workspaces/false",npm_execpath:"C:\\Users\\Sun_glitter\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\bin\\npm-cli.js",npm_lifecycle_event:"build",npm_lifecycle_script:"vite build",npm_node_execpath:"C:\\Program Files\\nodejs\\node.exe",npm_package_json:"C:\\final-project\\WEB1_2_LinkUP_FE\\package.json",npm_package_name:"goodbuyus",npm_package_version:"0.1.0",NPM_PREFIX_NPM_CLI_JS:"C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js",NUMBER_OF_PROCESSORS:"12",NVM_HOME:"C:\\Users\\Sun_glitter\\AppData\\Roaming\\nvm",NVM_SYMLINK:"C:\\Program Files\\nodejs",OneDrive:"C:\\Users\\Sun_glitter\\OneDrive",ORIGINAL_XDG_CURRENT_DESKTOP:"undefined",OS:"Windows_NT",Path:"C:\\final-project\\WEB1_2_LinkUP_FE\\node_modules\\.bin;C:\\final-project\\node_modules\\.bin;C:\\node_modules\\.bin;C:\\Users\\Sun_glitter\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\node_modules\\@npmcli\\run-script\\lib\\node-gyp-bin;C:\\Python312\\Scripts\\;C:\\Python312\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\Bandizip\\;C:\\Program Files\\dotnet\\;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\ProgramData\\chocolatey\\bin;C:\\Git\\cmd;C:\\Users\\Sun_glitter\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;C:\\Program Files\\MongoDB\\Server\\7.0\\bin;C:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\Python\\Python311\\Scripts\\;C:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\Python\\Python311\\;C:\\Users\\Sun_glitter\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Sun_glitter\\AppData\\Local\\GitHubDesktop\\bin;C:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\Sun_glitter\\AppData\\Local\\Microsoft\\WinGet\\Packages\\Schniz.fnm_Microsoft.Winget.Source_8wekyb3d8bbwe;C:\\Users\\Sun_glitter\\AppData\\Roaming\\npm;C:\\Users\\Sun_glitter\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;C:\\Program Files\\nodejs;;C:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\oh-my-posh\\bin",PATHEXT:".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.CPL",POSH_CURSOR_COLUMN:"1",POSH_CURSOR_LINE:"13",POSH_INSTALLER:"winget",POSH_PID:"16676",POSH_SHELL_VERSION:"5.1.26100.2161",POSH_THEMES_PATH:"C:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\oh-my-posh\\themes",POWERLINE_COMMAND:"oh-my-posh",PROCESSOR_ARCHITECTURE:"AMD64",PROCESSOR_IDENTIFIER:"AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD",PROCESSOR_LEVEL:"25",PROCESSOR_REVISION:"6102",ProgramData:"C:\\ProgramData",ProgramFiles:"C:\\Program Files","ProgramFiles(x86)":"C:\\Program Files (x86)",ProgramW6432:"C:\\Program Files",PROMPT:"$P$G",PSModulePath:"C:\\Users\\Sun_glitter\\Documents\\WindowsPowerShell\\Modules;C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules",PUBLIC:"C:\\Users\\Public",RlsSvcPort:"22112",SESSIONNAME:"Console",SystemDrive:"C:",SystemRoot:"C:\\Windows",TEMP:"C:\\Users\\SUN_GL~1\\AppData\\Local\\Temp",TERM_PROGRAM:"vscode",TERM_PROGRAM_VERSION:"1.95.3",TMP:"C:\\Users\\SUN_GL~1\\AppData\\Local\\Temp",USERDOMAIN:"DESKTOP-MLJO4KS",USERDOMAIN_ROAMINGPROFILE:"DESKTOP-MLJO4KS",USERNAME:"Sun_glitter",USERPROFILE:"C:\\Users\\Sun_glitter",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",VSCODE_GIT_ASKPASS_MAIN:"c:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\extensions\\git\\dist\\askpass-main.js",VSCODE_GIT_ASKPASS_NODE:"C:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe",VSCODE_GIT_IPC_HANDLE:"\\\\.\\pipe\\vscode-git-2f822d37cb-sock",VSCODE_INJECTION:"1",windir:"C:\\Windows"},Es=typeof process<"u"&&Ht!==void 0&&(Ht.REACT_APP_SC_ATTR||Ht.SC_ATTR)||"data-styled",fw="active",pw="data-styled-version",Vu="6.1.13",xm=`/*!sc*/ +`,fu=typeof window<"u"&&"HTMLElement"in window,tE=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&Ht!==void 0&&Ht.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&Ht.REACT_APP_SC_DISABLE_SPEEDY!==""?Ht.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&Ht.REACT_APP_SC_DISABLE_SPEEDY:typeof process<"u"&&Ht!==void 0&&Ht.SC_DISABLE_SPEEDY!==void 0&&Ht.SC_DISABLE_SPEEDY!==""&&Ht.SC_DISABLE_SPEEDY!=="false"&&Ht.SC_DISABLE_SPEEDY),nE={},Ku=Object.freeze([]),ks=Object.freeze({});function hw(e,t,n){return n===void 0&&(n=ks),e.theme!==n.theme&&e.theme||t||n.theme}var mw=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),rE=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,iE=/(^-|-$)/g;function Dx(e){return e.replace(rE,"-").replace(iE,"")}var oE=/(a)(d)/gi,ec=52,Tx=function(e){return String.fromCharCode(e+(e>25?39:97))};function Pp(e){var t,n="";for(t=Math.abs(e);t>ec;t=t/ec|0)n=Tx(t%ec)+n;return(Tx(t%ec)+n).replace(oE,"$1-$2")}var Fd,gw=5381,Mo=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},xw=function(e){return Mo(gw,e)};function yw(e){return Pp(xw(e)>>>0)}function sE(e){return e.displayName||e.name||"Component"}function zd(e){return typeof e=="string"&&!0}var vw=typeof Symbol=="function"&&Symbol.for,ww=vw?Symbol.for("react.memo"):60115,aE=vw?Symbol.for("react.forward_ref"):60112,lE={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},cE={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},bw={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},uE=((Fd={})[aE]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Fd[ww]=bw,Fd);function Mx(e){return("type"in(t=e)&&t.type.$$typeof)===ww?bw:"$$typeof"in e?uE[e.$$typeof]:lE;var t}var dE=Object.defineProperty,fE=Object.getOwnPropertyNames,Lx=Object.getOwnPropertySymbols,pE=Object.getOwnPropertyDescriptor,hE=Object.getPrototypeOf,Nx=Object.prototype;function jw(e,t,n){if(typeof t!="string"){if(Nx){var r=hE(t);r&&r!==Nx&&jw(e,r,n)}var i=fE(t);Lx&&(i=i.concat(Lx(t)));for(var o=Mx(e),a=Mx(t),l=0;l0?" Args: ".concat(t.join(", ")):""))}var mE=function(){function e(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return e.prototype.indexOfGroup=function(t){for(var n=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,i=r.length,o=i;t>=o;)if((o<<=1)<0)throw xl(16,"".concat(t));this.groupSizes=new Uint32Array(o),this.groupSizes.set(r),this.length=o;for(var a=i;a=this.length||this.groupSizes[t]===0)return n;for(var r=this.groupSizes[t],i=this.indexOfGroup(t),o=i+r,a=i;a=0){var r=document.createTextNode(n);return this.element.insertBefore(r,this.nodes[t]||null),this.length++,!0}return!1},e.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},e.prototype.getRule=function(t){return t0&&(S+="".concat(w,","))}),c+="".concat(x).concat(g,'{content:"').concat(S,'"}').concat(xm)},p=0;p0?".".concat(t):h},p=c.slice();p.push(function(h){h.type===Bu&&h.value.includes("&")&&(h.props[0]=h.props[0].replace(EE,n).replace(r,d))}),a.prefix&&p.push(Z2),p.push(J2);var f=function(h,j,x,g){j===void 0&&(j=""),x===void 0&&(x=""),g===void 0&&(g="&"),t=g,n=j,r=new RegExp("\\".concat(n,"\\b"),"g");var S=h.replace(kE,""),w=G2(x||j?"".concat(x," ").concat(j," { ").concat(S," }"):S);a.namespace&&(w=Sw(w,a.namespace));var m=[];return du(w,Y2(p.concat(X2(function(v){return m.push(v)})))),m};return f.hash=c.length?c.reduce(function(h,j){return j.name||xl(15),Mo(h,j.name)},gw).toString():"",f}var AE=new hu,Rp=RE(),Pw=at.createContext({shouldForwardProp:void 0,styleSheet:AE,stylis:Rp});Pw.Consumer;at.createContext(void 0);function Ap(){return C.useContext(Pw)}var IE=function(){function e(t,n){var r=this;this.inject=function(i,o){o===void 0&&(o=Rp);var a=r.name+o.hash;i.hasNameForId(r.id,a)||i.insertRules(r.id,a,o(r.rules,a,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=n,vm(this,function(){throw xl(12,String(r.name))})}return e.prototype.getName=function(t){return t===void 0&&(t=Rp),this.name+t.hash},e}(),OE=function(e){return e>="A"&&e<="Z"};function zx(e){for(var t="",n=0;n>>0);if(!n.hasNameForId(this.componentId,a)){var l=r(o,".".concat(a),void 0,this.componentId);n.insertRules(this.componentId,a,l)}i=Ai(i,a),this.staticRulesId=a}else{for(var c=Mo(this.baseHash,r.hash),d="",p=0;p>>0);n.hasNameForId(this.componentId,j)||n.insertRules(this.componentId,j,r(d,".".concat(j),void 0,this.componentId)),i=Ai(i,j)}}return i},e}(),wm=at.createContext(void 0);wm.Consumer;var Ud={};function TE(e,t,n){var r=ym(e),i=e,o=!zd(e),a=t.attrs,l=a===void 0?Ku:a,c=t.componentId,d=c===void 0?function(b,E){var P=typeof b!="string"?"sc":Dx(b);Ud[P]=(Ud[P]||0)+1;var k="".concat(P,"-").concat(yw(Vu+P+Ud[P]));return E?"".concat(E,"-").concat(k):k}(t.displayName,t.parentComponentId):c,p=t.displayName,f=p===void 0?function(b){return zd(b)?"styled.".concat(b):"Styled(".concat(sE(b),")")}(e):p,h=t.displayName&&t.componentId?"".concat(Dx(t.displayName),"-").concat(t.componentId):t.componentId||d,j=r&&i.attrs?i.attrs.concat(l).filter(Boolean):l,x=t.shouldForwardProp;if(r&&i.shouldForwardProp){var g=i.shouldForwardProp;if(t.shouldForwardProp){var S=t.shouldForwardProp;x=function(b,E){return g(b,E)&&S(b,E)}}else x=g}var w=new DE(n,h,r?i.componentStyle:void 0);function m(b,E){return function(P,k,R){var I=P.attrs,D=P.componentStyle,_=P.defaultProps,N=P.foldedComponentIds,F=P.styledComponentId,$=P.target,X=at.useContext(wm),ue=Ap(),oe=P.shouldForwardProp||ue.shouldForwardProp,H=hw(k,X,_)||ks,V=function(he,me,te){for(var de,Ce=wt(wt({},me),{className:void 0,theme:te}),mn=0;mn2&&hu.registerId(this.componentId+t),this.removeStyles(t,r),this.createStyles(t,n,r,i)},e}();function LE(e){for(var t=[],n=1;n{const t=()=>{const n=[],r=Math.floor(e),i=e%1>=.3&&e%1<=.7,o=e%1<.3&&e%1>0,a=e%1>.7;for(let c=0;ce!=="likes"})` + position: absolute; + bottom: 20px; + right: 30px; + width: 25px; + height: 25px; + cursor: pointer; + content: ${({likes:e})=>`url(${e?_w:Ow})`}; + color: ${({likes:e})=>e?"red ":"transparent"}; + + &:hover { + cursor: pointer; + transform: scale(1.2); + transition: transform 0.2s ease-in-out; + } +`,QE=u.div` + width: 100%; + display: flex; + align-items: center; + position: relative; +`,VE=u.div.withConfig({shouldForwardProp:e=>e!=="expanded"})` + display: flex; + flex-wrap: wrap; + gap: 2px; + position: absolute; + top: 15px; + left: 190px; + padding: 10px 20px; + z-index: 10; + visibility: ${e=>e.expanded?"visible":"hidden"}; + opacity: ${e=>e.expanded?1:0}; + transition: + opacity 0.3s ease, + visibility 0.3s ease; +`,KE=u.div` + padding: 5px 10px; + border-radius: 5px; + width: 120px; + font-weight: ${e=>e.selected?"bold":"normal"}; + text-decoration: ${e=>e.selected?"underline":"none"}; + &:hover { + cursor: pointer; + text-decoration: underline; + } +`,Hw=u.div` + position: relative; + margin-top: 30px; + display: flex; + justify-content: flex-end; + width: 100%; +`,Qw=u(Gn)` + position: absolute; + right: 20px; + display: inline-block; + padding: 10px 30px; + background-color: black; + color: white; + border-radius: 8px; + text-decoration: none; + font-weight: bold; + font-size: 16px; + transition: background-color 0.3s; + + &:hover { + cursor: pointer; + background-color: gray; + } +`,qn="/assets/default-featured-image.png-C2hm5daT.jpg",GE=({products:e})=>{if(!e)return s.jsx("div",{children:"No products available"});const t=i=>[...i].sort((a,l)=>{var c,d;return(((c=l.reviews)==null?void 0:c.length)||0)-(((d=a.reviews)==null?void 0:d.length)||0)}).slice(0,8),n=C.useMemo(()=>t(e),[e]),r=()=>{};return s.jsxs(WE,{children:[s.jsx(HE,{children:"실시간 인기 상품"}),s.jsx(Dw,{children:n.map(i=>s.jsxs(Tw,{children:[s.jsxs(Mw,{to:`/products/${i.id}`,children:[s.jsx(Lw,{src:i.url||qn,alt:i.name,onError:o=>{o.currentTarget.src=qn}}),s.jsxs(Nw,{children:[s.jsx($w,{children:i.name}),s.jsx(Fw,{children:s.jsx(yl,{rating:i.rating})}),s.jsxs(zw,{children:[s.jsxs(Uw,{children:[i.originalprice,"원"]}),s.jsxs(Bw,{children:[i.discountprice,"원"]})]})]})]}),s.jsx(Ww,{likes:i.likes,onClick:r})]},i.id))}),s.jsx(Hw,{children:s.jsx(Qw,{to:"/products",children:"더보기"})})]})};var Ls=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},no=typeof window>"u"||"Deno"in globalThis;function on(){}function qE(e,t){return typeof e=="function"?e(t):e}function Op(e){return typeof e=="number"&&e>=0&&e!==1/0}function Vw(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Bo(e,t){return typeof e=="function"?e(t):e}function Sn(e,t){return typeof e=="function"?e(t):e}function Wx(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==bm(a,t.options))return!1}else if(!Ya(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||o&&!o(t))}function Hx(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(ro(t.options.mutationKey)!==ro(o))return!1}else if(!Ya(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function bm(e,t){return((t==null?void 0:t.queryKeyHashFn)||ro)(e)}function ro(e){return JSON.stringify(e,(t,n)=>_p(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function Ya(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Ya(e[n],t[n])):!1}function Kw(e,t){if(e===t)return e;const n=Qx(e)&&Qx(t);if(n||_p(e)&&_p(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),a=o.length,l=n?[]:{};let c=0;for(let d=0;d{setTimeout(t,e)})}function Dp(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Kw(e,t):t}function YE(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function XE(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var jm=Symbol();function Gw(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===jm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var Oi,_r,Ho,cy,ZE=(cy=class extends Ls{constructor(){super();U(this,Oi);U(this,_r);U(this,Ho);L(this,Ho,n=>{if(!no&&window.addEventListener){const r=()=>n();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){y(this,_r)||this.setEventListener(y(this,Ho))}onUnsubscribe(){var n;this.hasListeners()||((n=y(this,_r))==null||n.call(this),L(this,_r,void 0))}setEventListener(n){var r;L(this,Ho,n),(r=y(this,_r))==null||r.call(this),L(this,_r,n(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(n){y(this,Oi)!==n&&(L(this,Oi,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(r=>{r(n)})}isFocused(){var n;return typeof y(this,Oi)=="boolean"?y(this,Oi):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},Oi=new WeakMap,_r=new WeakMap,Ho=new WeakMap,cy),Cm=new ZE,Qo,Dr,Vo,uy,ek=(uy=class extends Ls{constructor(){super();U(this,Qo,!0);U(this,Dr);U(this,Vo);L(this,Vo,n=>{if(!no&&window.addEventListener){const r=()=>n(!0),i=()=>n(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",i)}}})}onSubscribe(){y(this,Dr)||this.setEventListener(y(this,Vo))}onUnsubscribe(){var n;this.hasListeners()||((n=y(this,Dr))==null||n.call(this),L(this,Dr,void 0))}setEventListener(n){var r;L(this,Vo,n),(r=y(this,Dr))==null||r.call(this),L(this,Dr,n(this.setOnline.bind(this)))}setOnline(n){y(this,Qo)!==n&&(L(this,Qo,n),this.listeners.forEach(i=>{i(n)}))}isOnline(){return y(this,Qo)}},Qo=new WeakMap,Dr=new WeakMap,Vo=new WeakMap,uy),gu=new ek;function Tp(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function tk(e){return Math.min(1e3*2**e,3e4)}function qw(e){return(e??"online")==="online"?gu.isOnline():!0}var Jw=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Bd(e){return e instanceof Jw}function Yw(e){let t=!1,n=0,r=!1,i;const o=Tp(),a=g=>{var S;r||(h(new Jw(g)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>Cm.isFocused()&&(e.networkMode==="always"||gu.isOnline())&&e.canRun(),p=()=>qw(e.networkMode)&&e.canRun(),f=g=>{var S;r||(r=!0,(S=e.onSuccess)==null||S.call(e,g),i==null||i(),o.resolve(g))},h=g=>{var S;r||(r=!0,(S=e.onError)==null||S.call(e,g),i==null||i(),o.reject(g))},j=()=>new Promise(g=>{var S;i=w=>{(r||d())&&g(w)},(S=e.onPause)==null||S.call(e)}).then(()=>{var g;i=void 0,r||(g=e.onContinue)==null||g.call(e)}),x=()=>{if(r)return;let g;const S=n===0?e.initialPromise:void 0;try{g=S??e.fn()}catch(w){g=Promise.reject(w)}Promise.resolve(g).then(f).catch(w=>{var P;if(r)return;const m=e.retry??(no?0:3),v=e.retryDelay??tk,b=typeof v=="function"?v(n,w):v,E=m===!0||typeof m=="number"&&nd()?void 0:j()).then(()=>{t?h(w):x()})})};return{promise:o,cancel:a,continue:()=>(i==null||i(),o),cancelRetry:l,continueRetry:c,canStart:p,start:()=>(p()?x():j().then(x),o)}}function nk(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=l=>setTimeout(l,0);const o=l=>{t?e.push(l):i(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||a()}return c},batchCalls:l=>(...c)=>{o(()=>{l(...c)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var nt=nk(),_i,dy,Xw=(dy=class{constructor(){U(this,_i)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Op(this.gcTime)&&L(this,_i,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(no?1/0:5*60*1e3))}clearGcTimeout(){y(this,_i)&&(clearTimeout(y(this,_i)),L(this,_i,void 0))}},_i=new WeakMap,dy),Ko,Go,nn,xt,rl,Di,vn,tr,fy,rk=(fy=class extends Xw{constructor(n){super();U(this,vn);U(this,Ko);U(this,Go);U(this,nn);U(this,xt);U(this,rl);U(this,Di);L(this,Di,!1),L(this,rl,n.defaultOptions),this.setOptions(n.options),this.observers=[],L(this,nn,n.cache),this.queryKey=n.queryKey,this.queryHash=n.queryHash,L(this,Ko,ik(this.options)),this.state=n.state??y(this,Ko),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var n;return(n=y(this,xt))==null?void 0:n.promise}setOptions(n){this.options={...y(this,rl),...n},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&y(this,nn).remove(this)}setData(n,r){const i=Dp(this.state.data,n,this.options);return K(this,vn,tr).call(this,{data:i,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),i}setState(n,r){K(this,vn,tr).call(this,{type:"setState",state:n,setStateOptions:r})}cancel(n){var i,o;const r=(i=y(this,xt))==null?void 0:i.promise;return(o=y(this,xt))==null||o.cancel(n),r?r.then(on).catch(on):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(y(this,Ko))}isActive(){return this.observers.some(n=>Sn(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===jm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(n=0){return this.state.isInvalidated||this.state.data===void 0||!Vw(this.state.dataUpdatedAt,n)}onFocus(){var r;const n=this.observers.find(i=>i.shouldFetchOnWindowFocus());n==null||n.refetch({cancelRefetch:!1}),(r=y(this,xt))==null||r.continue()}onOnline(){var r;const n=this.observers.find(i=>i.shouldFetchOnReconnect());n==null||n.refetch({cancelRefetch:!1}),(r=y(this,xt))==null||r.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),y(this,nn).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(r=>r!==n),this.observers.length||(y(this,xt)&&(y(this,Di)?y(this,xt).cancel({revert:!0}):y(this,xt).cancelRetry()),this.scheduleGc()),y(this,nn).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||K(this,vn,tr).call(this,{type:"invalidate"})}fetch(n,r){var d,p,f;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(y(this,xt))return y(this,xt).continueRetry(),y(this,xt).promise}if(n&&this.setOptions(n),!this.options.queryFn){const h=this.observers.find(j=>j.options.queryFn);h&&this.setOptions(h.options)}const i=new AbortController,o=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>(L(this,Di,!0),i.signal)})},a=()=>{const h=Gw(this.options,r),j={queryKey:this.queryKey,meta:this.meta};return o(j),L(this,Di,!1),this.options.persister?this.options.persister(h,j,this):h(j)},l={fetchOptions:r,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:a};o(l),(d=this.options.behavior)==null||d.onFetch(l,this),L(this,Go,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=l.fetchOptions)==null?void 0:p.meta))&&K(this,vn,tr).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta});const c=h=>{var j,x,g,S;Bd(h)&&h.silent||K(this,vn,tr).call(this,{type:"error",error:h}),Bd(h)||((x=(j=y(this,nn).config).onError)==null||x.call(j,h,this),(S=(g=y(this,nn).config).onSettled)==null||S.call(g,this.state.data,h,this)),this.scheduleGc()};return L(this,xt,Yw({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,abort:i.abort.bind(i),onSuccess:h=>{var j,x,g,S;if(h===void 0){c(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(h)}catch(w){c(w);return}(x=(j=y(this,nn).config).onSuccess)==null||x.call(j,h,this),(S=(g=y(this,nn).config).onSettled)==null||S.call(g,h,this.state.error,this),this.scheduleGc()},onError:c,onFail:(h,j)=>{K(this,vn,tr).call(this,{type:"failed",failureCount:h,error:j})},onPause:()=>{K(this,vn,tr).call(this,{type:"pause"})},onContinue:()=>{K(this,vn,tr).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0})),y(this,xt).start()}},Ko=new WeakMap,Go=new WeakMap,nn=new WeakMap,xt=new WeakMap,rl=new WeakMap,Di=new WeakMap,vn=new WeakSet,tr=function(n){const r=i=>{switch(n.type){case"failed":return{...i,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...Zw(i.data,this.options),fetchMeta:n.meta??null};case"success":return{...i,data:n.data,dataUpdateCount:i.dataUpdateCount+1,dataUpdatedAt:n.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=n.error;return Bd(o)&&o.revert&&y(this,Go)?{...y(this,Go),fetchStatus:"idle"}:{...i,error:o,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...n.state}}};this.state=r(this.state),nt.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),y(this,nn).notify({query:this,type:"updated",action:n})})},fy);function Zw(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qw(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function ik(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Mn,py,ok=(py=class extends Ls{constructor(n={}){super();U(this,Mn);this.config=n,L(this,Mn,new Map)}build(n,r,i){const o=r.queryKey,a=r.queryHash??bm(o,r);let l=this.get(a);return l||(l=new rk({cache:this,queryKey:o,queryHash:a,options:n.defaultQueryOptions(r),state:i,defaultOptions:n.getQueryDefaults(o)}),this.add(l)),l}add(n){y(this,Mn).has(n.queryHash)||(y(this,Mn).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const r=y(this,Mn).get(n.queryHash);r&&(n.destroy(),r===n&&y(this,Mn).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){nt.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return y(this,Mn).get(n)}getAll(){return[...y(this,Mn).values()]}find(n){const r={exact:!0,...n};return this.getAll().find(i=>Wx(r,i))}findAll(n={}){const r=this.getAll();return Object.keys(n).length>0?r.filter(i=>Wx(n,i)):r}notify(n){nt.batch(()=>{this.listeners.forEach(r=>{r(n)})})}onFocus(){nt.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){nt.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Mn=new WeakMap,py),Ln,Ct,Ti,Nn,Er,hy,sk=(hy=class extends Xw{constructor(n){super();U(this,Nn);U(this,Ln);U(this,Ct);U(this,Ti);this.mutationId=n.mutationId,L(this,Ct,n.mutationCache),L(this,Ln,[]),this.state=n.state||eb(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){y(this,Ln).includes(n)||(y(this,Ln).push(n),this.clearGcTimeout(),y(this,Ct).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){L(this,Ln,y(this,Ln).filter(r=>r!==n)),this.scheduleGc(),y(this,Ct).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){y(this,Ln).length||(this.state.status==="pending"?this.scheduleGc():y(this,Ct).remove(this))}continue(){var n;return((n=y(this,Ti))==null?void 0:n.continue())??this.execute(this.state.variables)}async execute(n){var o,a,l,c,d,p,f,h,j,x,g,S,w,m,v,b,E,P,k,R;L(this,Ti,Yw({fn:()=>this.options.mutationFn?this.options.mutationFn(n):Promise.reject(new Error("No mutationFn found")),onFail:(I,D)=>{K(this,Nn,Er).call(this,{type:"failed",failureCount:I,error:D})},onPause:()=>{K(this,Nn,Er).call(this,{type:"pause"})},onContinue:()=>{K(this,Nn,Er).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>y(this,Ct).canRun(this)}));const r=this.state.status==="pending",i=!y(this,Ti).canStart();try{if(!r){K(this,Nn,Er).call(this,{type:"pending",variables:n,isPaused:i}),await((a=(o=y(this,Ct).config).onMutate)==null?void 0:a.call(o,n,this));const D=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,n));D!==this.state.context&&K(this,Nn,Er).call(this,{type:"pending",context:D,variables:n,isPaused:i})}const I=await y(this,Ti).start();return await((p=(d=y(this,Ct).config).onSuccess)==null?void 0:p.call(d,I,n,this.state.context,this)),await((h=(f=this.options).onSuccess)==null?void 0:h.call(f,I,n,this.state.context)),await((x=(j=y(this,Ct).config).onSettled)==null?void 0:x.call(j,I,null,this.state.variables,this.state.context,this)),await((S=(g=this.options).onSettled)==null?void 0:S.call(g,I,null,n,this.state.context)),K(this,Nn,Er).call(this,{type:"success",data:I}),I}catch(I){try{throw await((m=(w=y(this,Ct).config).onError)==null?void 0:m.call(w,I,n,this.state.context,this)),await((b=(v=this.options).onError)==null?void 0:b.call(v,I,n,this.state.context)),await((P=(E=y(this,Ct).config).onSettled)==null?void 0:P.call(E,void 0,I,this.state.variables,this.state.context,this)),await((R=(k=this.options).onSettled)==null?void 0:R.call(k,void 0,I,n,this.state.context)),I}finally{K(this,Nn,Er).call(this,{type:"error",error:I})}}finally{y(this,Ct).runNext(this)}}},Ln=new WeakMap,Ct=new WeakMap,Ti=new WeakMap,Nn=new WeakSet,Er=function(n){const r=i=>{switch(n.type){case"failed":return{...i,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...i,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:n.error,failureCount:i.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=r(this.state),nt.batch(()=>{y(this,Ln).forEach(i=>{i.onMutationUpdate(n)}),y(this,Ct).notify({mutation:this,type:"updated",action:n})})},hy);function eb(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Qt,il,my,ak=(my=class extends Ls{constructor(n={}){super();U(this,Qt);U(this,il);this.config=n,L(this,Qt,new Map),L(this,il,Date.now())}build(n,r,i){const o=new sk({mutationCache:this,mutationId:++xi(this,il)._,options:n.defaultMutationOptions(r),state:i});return this.add(o),o}add(n){const r=nc(n),i=y(this,Qt).get(r)??[];i.push(n),y(this,Qt).set(r,i),this.notify({type:"added",mutation:n})}remove(n){var i;const r=nc(n);if(y(this,Qt).has(r)){const o=(i=y(this,Qt).get(r))==null?void 0:i.filter(a=>a!==n);o&&(o.length===0?y(this,Qt).delete(r):y(this,Qt).set(r,o))}this.notify({type:"removed",mutation:n})}canRun(n){var i;const r=(i=y(this,Qt).get(nc(n)))==null?void 0:i.find(o=>o.state.status==="pending");return!r||r===n}runNext(n){var i;const r=(i=y(this,Qt).get(nc(n)))==null?void 0:i.find(o=>o!==n&&o.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}clear(){nt.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}getAll(){return[...y(this,Qt).values()].flat()}find(n){const r={exact:!0,...n};return this.getAll().find(i=>Hx(r,i))}findAll(n={}){return this.getAll().filter(r=>Hx(n,r))}notify(n){nt.batch(()=>{this.listeners.forEach(r=>{r(n)})})}resumePausedMutations(){const n=this.getAll().filter(r=>r.state.isPaused);return nt.batch(()=>Promise.all(n.map(r=>r.continue().catch(on))))}},Qt=new WeakMap,il=new WeakMap,my);function nc(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function Kx(e){return{onFetch:(t,n)=>{var p,f,h,j,x;const r=t.options,i=(h=(f=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,o=((j=t.state.data)==null?void 0:j.pages)||[],a=((x=t.state.data)==null?void 0:x.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let g=!1;const S=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},w=Gw(t.options,t.fetchOptions),m=async(v,b,E)=>{if(g)return Promise.reject();if(b==null&&v.pages.length)return Promise.resolve(v);const P={queryKey:t.queryKey,pageParam:b,direction:E?"backward":"forward",meta:t.options.meta};S(P);const k=await w(P),{maxPages:R}=t.options,I=E?XE:YE;return{pages:I(v.pages,k,R),pageParams:I(v.pageParams,b,R)}};if(i&&o.length){const v=i==="backward",b=v?lk:Gx,E={pages:o,pageParams:a},P=b(r,E);l=await m(E,P,v)}else{const v=e??o.length;do{const b=c===0?a[0]??r.initialPageParam:Gx(r,l);if(c>0&&b==null)break;l=await m(l,b),c++}while(c{var g,S;return(S=(g=t.options).persister)==null?void 0:S.call(g,d,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function Gx(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function lk(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ve,Tr,Mr,qo,Jo,Lr,Yo,Xo,gy,ck=(gy=class{constructor(t={}){U(this,Ve);U(this,Tr);U(this,Mr);U(this,qo);U(this,Jo);U(this,Lr);U(this,Yo);U(this,Xo);L(this,Ve,t.queryCache||new ok),L(this,Tr,t.mutationCache||new ak),L(this,Mr,t.defaultOptions||{}),L(this,qo,new Map),L(this,Jo,new Map),L(this,Lr,0)}mount(){xi(this,Lr)._++,y(this,Lr)===1&&(L(this,Yo,Cm.subscribe(async t=>{t&&(await this.resumePausedMutations(),y(this,Ve).onFocus())})),L(this,Xo,gu.subscribe(async t=>{t&&(await this.resumePausedMutations(),y(this,Ve).onOnline())})))}unmount(){var t,n;xi(this,Lr)._--,y(this,Lr)===0&&((t=y(this,Yo))==null||t.call(this),L(this,Yo,void 0),(n=y(this,Xo))==null||n.call(this),L(this,Xo,void 0))}isFetching(t){return y(this,Ve).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return y(this,Tr).findAll({...t,status:"pending"}).length}getQueryData(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=y(this,Ve).get(n.queryHash))==null?void 0:r.state.data}ensureQueryData(t){const n=this.getQueryData(t.queryKey);if(n===void 0)return this.fetchQuery(t);{const r=this.defaultQueryOptions(t),i=y(this,Ve).build(this,r);return t.revalidateIfStale&&i.isStaleByTime(Bo(r.staleTime,i))&&this.prefetchQuery(r),Promise.resolve(n)}}getQueriesData(t){return y(this,Ve).findAll(t).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(t,n,r){const i=this.defaultQueryOptions({queryKey:t}),o=y(this,Ve).get(i.queryHash),a=o==null?void 0:o.state.data,l=qE(n,a);if(l!==void 0)return y(this,Ve).build(this,i).setData(l,{...r,manual:!0})}setQueriesData(t,n,r){return nt.batch(()=>y(this,Ve).findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(t){var r;const n=this.defaultQueryOptions({queryKey:t});return(r=y(this,Ve).get(n.queryHash))==null?void 0:r.state}removeQueries(t){const n=y(this,Ve);nt.batch(()=>{n.findAll(t).forEach(r=>{n.remove(r)})})}resetQueries(t,n){const r=y(this,Ve),i={type:"active",...t};return nt.batch(()=>(r.findAll(t).forEach(o=>{o.reset()}),this.refetchQueries(i,n)))}cancelQueries(t={},n={}){const r={revert:!0,...n},i=nt.batch(()=>y(this,Ve).findAll(t).map(o=>o.cancel(r)));return Promise.all(i).then(on).catch(on)}invalidateQueries(t={},n={}){return nt.batch(()=>{if(y(this,Ve).findAll(t).forEach(i=>{i.invalidate()}),t.refetchType==="none")return Promise.resolve();const r={...t,type:t.refetchType??t.type??"active"};return this.refetchQueries(r,n)})}refetchQueries(t={},n){const r={...n,cancelRefetch:(n==null?void 0:n.cancelRefetch)??!0},i=nt.batch(()=>y(this,Ve).findAll(t).filter(o=>!o.isDisabled()).map(o=>{let a=o.fetch(void 0,r);return r.throwOnError||(a=a.catch(on)),o.state.fetchStatus==="paused"?Promise.resolve():a}));return Promise.all(i).then(on)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const r=y(this,Ve).build(this,n);return r.isStaleByTime(Bo(n.staleTime,r))?r.fetch(n):Promise.resolve(r.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(on).catch(on)}fetchInfiniteQuery(t){return t.behavior=Kx(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(on).catch(on)}ensureInfiniteQueryData(t){return t.behavior=Kx(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return gu.isOnline()?y(this,Tr).resumePausedMutations():Promise.resolve()}getQueryCache(){return y(this,Ve)}getMutationCache(){return y(this,Tr)}getDefaultOptions(){return y(this,Mr)}setDefaultOptions(t){L(this,Mr,t)}setQueryDefaults(t,n){y(this,qo).set(ro(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...y(this,qo).values()];let r={};return n.forEach(i=>{Ya(t,i.queryKey)&&(r={...r,...i.defaultOptions})}),r}setMutationDefaults(t,n){y(this,Jo).set(ro(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...y(this,Jo).values()];let r={};return n.forEach(i=>{Ya(t,i.mutationKey)&&(r={...r,...i.defaultOptions})}),r}defaultQueryOptions(t){if(t._defaulted)return t;const n={...y(this,Mr).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=bm(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.enabled!==!0&&n.queryFn===jm&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...y(this,Mr).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){y(this,Ve).clear(),y(this,Tr).clear()}},Ve=new WeakMap,Tr=new WeakMap,Mr=new WeakMap,qo=new WeakMap,Jo=new WeakMap,Lr=new WeakMap,Yo=new WeakMap,Xo=new WeakMap,gy),_t,ve,ol,St,Mi,Zo,Nr,$n,sl,es,ts,Li,Ni,$r,ns,Re,ya,Mp,Lp,Np,$p,Fp,zp,Up,tb,xy,uk=(xy=class extends Ls{constructor(n,r){super();U(this,Re);U(this,_t);U(this,ve);U(this,ol);U(this,St);U(this,Mi);U(this,Zo);U(this,Nr);U(this,$n);U(this,sl);U(this,es);U(this,ts);U(this,Li);U(this,Ni);U(this,$r);U(this,ns,new Set);this.options=r,L(this,_t,n),L(this,$n,null),L(this,Nr,Tp()),this.options.experimental_prefetchInRender||y(this,Nr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(y(this,ve).addObserver(this),qx(y(this,ve),this.options)?K(this,Re,ya).call(this):this.updateResult(),K(this,Re,$p).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Bp(y(this,ve),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Bp(y(this,ve),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,K(this,Re,Fp).call(this),K(this,Re,zp).call(this),y(this,ve).removeObserver(this)}setOptions(n,r){const i=this.options,o=y(this,ve);if(this.options=y(this,_t).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Sn(this.options.enabled,y(this,ve))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");K(this,Re,Up).call(this),y(this,ve).setOptions(this.options),i._defaulted&&!mu(this.options,i)&&y(this,_t).getQueryCache().notify({type:"observerOptionsUpdated",query:y(this,ve),observer:this});const a=this.hasListeners();a&&Jx(y(this,ve),o,this.options,i)&&K(this,Re,ya).call(this),this.updateResult(r),a&&(y(this,ve)!==o||Sn(this.options.enabled,y(this,ve))!==Sn(i.enabled,y(this,ve))||Bo(this.options.staleTime,y(this,ve))!==Bo(i.staleTime,y(this,ve)))&&K(this,Re,Mp).call(this);const l=K(this,Re,Lp).call(this);a&&(y(this,ve)!==o||Sn(this.options.enabled,y(this,ve))!==Sn(i.enabled,y(this,ve))||l!==y(this,$r))&&K(this,Re,Np).call(this,l)}getOptimisticResult(n){const r=y(this,_t).getQueryCache().build(y(this,_t),n),i=this.createResult(r,n);return fk(this,i)&&(L(this,St,i),L(this,Zo,this.options),L(this,Mi,y(this,ve).state)),i}getCurrentResult(){return y(this,St)}trackResult(n,r){const i={};return Object.keys(n).forEach(o=>{Object.defineProperty(i,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),r==null||r(o),n[o])})}),i}trackProp(n){y(this,ns).add(n)}getCurrentQuery(){return y(this,ve)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const r=y(this,_t).defaultQueryOptions(n),i=y(this,_t).getQueryCache().build(y(this,_t),r);return i.fetch().then(()=>this.createResult(i,r))}fetch(n){return K(this,Re,ya).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),y(this,St)))}createResult(n,r){var I;const i=y(this,ve),o=this.options,a=y(this,St),l=y(this,Mi),c=y(this,Zo),p=n!==i?n.state:y(this,ol),{state:f}=n;let h={...f},j=!1,x;if(r._optimisticResults){const D=this.hasListeners(),_=!D&&qx(n,r),N=D&&Jx(n,i,r,o);(_||N)&&(h={...h,...Zw(f.data,n.options)}),r._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:g,errorUpdatedAt:S,status:w}=h;if(r.select&&h.data!==void 0)if(a&&h.data===(l==null?void 0:l.data)&&r.select===y(this,sl))x=y(this,es);else try{L(this,sl,r.select),x=r.select(h.data),x=Dp(a==null?void 0:a.data,x,r),L(this,es,x),L(this,$n,null)}catch(D){L(this,$n,D)}else x=h.data;if(r.placeholderData!==void 0&&x===void 0&&w==="pending"){let D;if(a!=null&&a.isPlaceholderData&&r.placeholderData===(c==null?void 0:c.placeholderData))D=a.data;else if(D=typeof r.placeholderData=="function"?r.placeholderData((I=y(this,ts))==null?void 0:I.state.data,y(this,ts)):r.placeholderData,r.select&&D!==void 0)try{D=r.select(D),L(this,$n,null)}catch(_){L(this,$n,_)}D!==void 0&&(w="success",x=Dp(a==null?void 0:a.data,D,r),j=!0)}y(this,$n)&&(g=y(this,$n),x=y(this,es),S=Date.now(),w="error");const m=h.fetchStatus==="fetching",v=w==="pending",b=w==="error",E=v&&m,P=x!==void 0,R={status:w,fetchStatus:h.fetchStatus,isPending:v,isSuccess:w==="success",isError:b,isInitialLoading:E,isLoading:E,data:x,dataUpdatedAt:h.dataUpdatedAt,error:g,errorUpdatedAt:S,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>p.dataUpdateCount||h.errorUpdateCount>p.errorUpdateCount,isFetching:m,isRefetching:m&&!v,isLoadingError:b&&!P,isPaused:h.fetchStatus==="paused",isPlaceholderData:j,isRefetchError:b&&P,isStale:Sm(n,r),refetch:this.refetch,promise:y(this,Nr)};if(this.options.experimental_prefetchInRender){const D=F=>{R.status==="error"?F.reject(R.error):R.data!==void 0&&F.resolve(R.data)},_=()=>{const F=L(this,Nr,R.promise=Tp());D(F)},N=y(this,Nr);switch(N.status){case"pending":n.queryHash===i.queryHash&&D(N);break;case"fulfilled":(R.status==="error"||R.data!==N.value)&&_();break;case"rejected":(R.status!=="error"||R.error!==N.reason)&&_();break}}return R}updateResult(n){const r=y(this,St),i=this.createResult(y(this,ve),this.options);if(L(this,Mi,y(this,ve).state),L(this,Zo,this.options),y(this,Mi).data!==void 0&&L(this,ts,y(this,ve)),mu(i,r))return;L(this,St,i);const o={},a=()=>{if(!r)return!0;const{notifyOnChangeProps:l}=this.options,c=typeof l=="function"?l():l;if(c==="all"||!c&&!y(this,ns).size)return!0;const d=new Set(c??y(this,ns));return this.options.throwOnError&&d.add("error"),Object.keys(y(this,St)).some(p=>{const f=p;return y(this,St)[f]!==r[f]&&d.has(f)})};(n==null?void 0:n.listeners)!==!1&&a()&&(o.listeners=!0),K(this,Re,tb).call(this,{...o,...n})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&K(this,Re,$p).call(this)}},_t=new WeakMap,ve=new WeakMap,ol=new WeakMap,St=new WeakMap,Mi=new WeakMap,Zo=new WeakMap,Nr=new WeakMap,$n=new WeakMap,sl=new WeakMap,es=new WeakMap,ts=new WeakMap,Li=new WeakMap,Ni=new WeakMap,$r=new WeakMap,ns=new WeakMap,Re=new WeakSet,ya=function(n){K(this,Re,Up).call(this);let r=y(this,ve).fetch(this.options,n);return n!=null&&n.throwOnError||(r=r.catch(on)),r},Mp=function(){K(this,Re,Fp).call(this);const n=Bo(this.options.staleTime,y(this,ve));if(no||y(this,St).isStale||!Op(n))return;const i=Vw(y(this,St).dataUpdatedAt,n)+1;L(this,Li,setTimeout(()=>{y(this,St).isStale||this.updateResult()},i))},Lp=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(y(this,ve)):this.options.refetchInterval)??!1},Np=function(n){K(this,Re,zp).call(this),L(this,$r,n),!(no||Sn(this.options.enabled,y(this,ve))===!1||!Op(y(this,$r))||y(this,$r)===0)&&L(this,Ni,setInterval(()=>{(this.options.refetchIntervalInBackground||Cm.isFocused())&&K(this,Re,ya).call(this)},y(this,$r)))},$p=function(){K(this,Re,Mp).call(this),K(this,Re,Np).call(this,K(this,Re,Lp).call(this))},Fp=function(){y(this,Li)&&(clearTimeout(y(this,Li)),L(this,Li,void 0))},zp=function(){y(this,Ni)&&(clearInterval(y(this,Ni)),L(this,Ni,void 0))},Up=function(){const n=y(this,_t).getQueryCache().build(y(this,_t),this.options);if(n===y(this,ve))return;const r=y(this,ve);L(this,ve,n),L(this,ol,n.state),this.hasListeners()&&(r==null||r.removeObserver(this),n.addObserver(this))},tb=function(n){nt.batch(()=>{n.listeners&&this.listeners.forEach(r=>{r(y(this,St))}),y(this,_t).getQueryCache().notify({query:y(this,ve),type:"observerResultsUpdated"})})},xy);function dk(e,t){return Sn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function qx(e,t){return dk(e,t)||e.state.data!==void 0&&Bp(e,t,t.refetchOnMount)}function Bp(e,t,n){if(Sn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Sm(e,t)}return!1}function Jx(e,t,n,r){return(e!==t||Sn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Sm(e,n)}function Sm(e,t){return Sn(t.enabled,e)!==!1&&e.isStaleByTime(Bo(t.staleTime,e))}function fk(e,t){return!mu(e.getCurrentResult(),t)}var Fr,zr,Dt,sr,dr,Tc,Wp,yy,pk=(yy=class extends Ls{constructor(n,r){super();U(this,dr);U(this,Fr);U(this,zr);U(this,Dt);U(this,sr);L(this,Fr,n),this.setOptions(r),this.bindMethods(),K(this,dr,Tc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const r=this.options;this.options=y(this,Fr).defaultMutationOptions(n),mu(this.options,r)||y(this,Fr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:y(this,Dt),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&ro(r.mutationKey)!==ro(this.options.mutationKey)?this.reset():((i=y(this,Dt))==null?void 0:i.state.status)==="pending"&&y(this,Dt).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=y(this,Dt))==null||n.removeObserver(this)}onMutationUpdate(n){K(this,dr,Tc).call(this),K(this,dr,Wp).call(this,n)}getCurrentResult(){return y(this,zr)}reset(){var n;(n=y(this,Dt))==null||n.removeObserver(this),L(this,Dt,void 0),K(this,dr,Tc).call(this),K(this,dr,Wp).call(this)}mutate(n,r){var i;return L(this,sr,r),(i=y(this,Dt))==null||i.removeObserver(this),L(this,Dt,y(this,Fr).getMutationCache().build(y(this,Fr),this.options)),y(this,Dt).addObserver(this),y(this,Dt).execute(n)}},Fr=new WeakMap,zr=new WeakMap,Dt=new WeakMap,sr=new WeakMap,dr=new WeakSet,Tc=function(){var r;const n=((r=y(this,Dt))==null?void 0:r.state)??eb();L(this,zr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Wp=function(n){nt.batch(()=>{var r,i,o,a,l,c,d,p;if(y(this,sr)&&this.hasListeners()){const f=y(this,zr).variables,h=y(this,zr).context;(n==null?void 0:n.type)==="success"?((i=(r=y(this,sr)).onSuccess)==null||i.call(r,n.data,f,h),(a=(o=y(this,sr)).onSettled)==null||a.call(o,n.data,null,f,h)):(n==null?void 0:n.type)==="error"&&((c=(l=y(this,sr)).onError)==null||c.call(l,n.error,f,h),(p=(d=y(this,sr)).onSettled)==null||p.call(d,void 0,n.error,f,h))}this.listeners.forEach(f=>{f(y(this,zr))})})},yy),nb=C.createContext(void 0),Ns=e=>{const t=C.useContext(nb);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},hk=({client:e,children:t})=>(C.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),s.jsx(nb.Provider,{value:e,children:t})),rb=C.createContext(!1),mk=()=>C.useContext(rb);rb.Provider;function gk(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xk=C.createContext(gk()),yk=()=>C.useContext(xk);function ib(e,t){return typeof e=="function"?e(...t):!!e}function Hp(){}var vk=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},wk=e=>{C.useEffect(()=>{e.clearReset()},[e])},bk=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&ib(n,[e.error,r]),jk=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},Ck=(e,t)=>e.isLoading&&e.isFetching&&!t,Sk=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Yx=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Pk(e,t,n){var p,f,h,j,x;const r=Ns(),i=mk(),o=yk(),a=r.defaultQueryOptions(e);(f=(p=r.getDefaultOptions().queries)==null?void 0:p._experimental_beforeQuery)==null||f.call(p,a),a._optimisticResults=i?"isRestoring":"optimistic",jk(a),vk(a,o),wk(o);const l=!r.getQueryCache().get(a.queryHash),[c]=C.useState(()=>new t(r,a)),d=c.getOptimisticResult(a);if(C.useSyncExternalStore(C.useCallback(g=>{const S=i?Hp:c.subscribe(nt.batchCalls(g));return c.updateResult(),S},[c,i]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),C.useEffect(()=>{c.setOptions(a,{listeners:!1})},[a,c]),Sk(a,d))throw Yx(a,c,o);if(bk({result:d,errorResetBoundary:o,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw d.error;if((j=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||j.call(h,a,d),a.experimental_prefetchInRender&&!no&&Ck(d,i)){const g=l?Yx(a,c,o):(x=r.getQueryCache().get(a.queryHash))==null?void 0:x.promise;g==null||g.catch(Hp).finally(()=>{c.updateResult()})}return a.notifyOnChangeProps?d:c.trackResult(d)}function Pm(e,t){return Pk(e,uk)}function Gi(e,t){const n=Ns(),[r]=C.useState(()=>new pk(n,e));C.useEffect(()=>{r.setOptions(e)},[r,e]);const i=C.useSyncExternalStore(C.useCallback(a=>r.subscribe(nt.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=C.useCallback((a,l)=>{r.mutate(a,l).catch(Hp)},[r]);if(i.error&&ib(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function ob(e,t){return function(){return e.apply(t,arguments)}}const{toString:Ek}=Object.prototype,{getPrototypeOf:Em}=Object,Gu=(e=>t=>{const n=Ek.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),In=e=>(e=e.toLowerCase(),t=>Gu(t)===e),qu=e=>t=>typeof t===e,{isArray:$s}=Array,Xa=qu("undefined");function kk(e){return e!==null&&!Xa(e)&&e.constructor!==null&&!Xa(e.constructor)&&Yt(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const sb=In("ArrayBuffer");function Rk(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&sb(e.buffer),t}const Ak=qu("string"),Yt=qu("function"),ab=qu("number"),Ju=e=>e!==null&&typeof e=="object",Ik=e=>e===!0||e===!1,Mc=e=>{if(Gu(e)!=="object")return!1;const t=Em(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Ok=In("Date"),_k=In("File"),Dk=In("Blob"),Tk=In("FileList"),Mk=e=>Ju(e)&&Yt(e.pipe),Lk=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Yt(e.append)&&((t=Gu(e))==="formdata"||t==="object"&&Yt(e.toString)&&e.toString()==="[object FormData]"))},Nk=In("URLSearchParams"),[$k,Fk,zk,Uk]=["ReadableStream","Request","Response","Headers"].map(In),Bk=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function wl(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),$s(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Ii=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,cb=e=>!Xa(e)&&e!==Ii;function Qp(){const{caseless:e}=cb(this)&&this||{},t={},n=(r,i)=>{const o=e&&lb(t,i)||i;Mc(t[o])&&Mc(r)?t[o]=Qp(t[o],r):Mc(r)?t[o]=Qp({},r):$s(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r(wl(t,(i,o)=>{n&&Yt(i)?e[o]=ob(i,n):e[o]=i},{allOwnKeys:r}),e),Hk=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),Qk=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Vk=(e,t,n,r)=>{let i,o,a;const l={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!r||r(a,e,t))&&!l[a]&&(t[a]=e[a],l[a]=!0);e=n!==!1&&Em(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Kk=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},Gk=e=>{if(!e)return null;if($s(e))return e;let t=e.length;if(!ab(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},qk=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&Em(Uint8Array)),Jk=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},Yk=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},Xk=In("HTMLFormElement"),Zk=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),Xx=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),eR=In("RegExp"),ub=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};wl(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},tR=e=>{ub(e,(t,n)=>{if(Yt(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(Yt(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},nR=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return $s(e)?r(e):r(String(e).split(t)),n},rR=()=>{},iR=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Wd="abcdefghijklmnopqrstuvwxyz",Zx="0123456789",db={DIGIT:Zx,ALPHA:Wd,ALPHA_DIGIT:Wd+Wd.toUpperCase()+Zx},oR=(e=16,t=db.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function sR(e){return!!(e&&Yt(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const aR=e=>{const t=new Array(10),n=(r,i)=>{if(Ju(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=$s(r)?[]:{};return wl(r,(a,l)=>{const c=n(a,i+1);!Xa(c)&&(o[l]=c)}),t[i]=void 0,o}}return r};return n(e,0)},lR=In("AsyncFunction"),cR=e=>e&&(Ju(e)||Yt(e))&&Yt(e.then)&&Yt(e.catch),fb=((e,t)=>e?setImmediate:t?((n,r)=>(Ii.addEventListener("message",({source:i,data:o})=>{i===Ii&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Ii.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Yt(Ii.postMessage)),uR=typeof queueMicrotask<"u"?queueMicrotask.bind(Ii):typeof process<"u"&&process.nextTick||fb,M={isArray:$s,isArrayBuffer:sb,isBuffer:kk,isFormData:Lk,isArrayBufferView:Rk,isString:Ak,isNumber:ab,isBoolean:Ik,isObject:Ju,isPlainObject:Mc,isReadableStream:$k,isRequest:Fk,isResponse:zk,isHeaders:Uk,isUndefined:Xa,isDate:Ok,isFile:_k,isBlob:Dk,isRegExp:eR,isFunction:Yt,isStream:Mk,isURLSearchParams:Nk,isTypedArray:qk,isFileList:Tk,forEach:wl,merge:Qp,extend:Wk,trim:Bk,stripBOM:Hk,inherits:Qk,toFlatObject:Vk,kindOf:Gu,kindOfTest:In,endsWith:Kk,toArray:Gk,forEachEntry:Jk,matchAll:Yk,isHTMLForm:Xk,hasOwnProperty:Xx,hasOwnProp:Xx,reduceDescriptors:ub,freezeMethods:tR,toObjectSet:nR,toCamelCase:Zk,noop:rR,toFiniteNumber:iR,findKey:lb,global:Ii,isContextDefined:cb,ALPHABET:db,generateString:oR,isSpecCompliantForm:sR,toJSONObject:aR,isAsyncFn:lR,isThenable:cR,setImmediate:fb,asap:uR};function fe(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}M.inherits(fe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:M.toJSONObject(this.config),code:this.code,status:this.status}}});const pb=fe.prototype,hb={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{hb[e]={value:e}});Object.defineProperties(fe,hb);Object.defineProperty(pb,"isAxiosError",{value:!0});fe.from=(e,t,n,r,i,o)=>{const a=Object.create(pb);return M.toFlatObject(e,a,function(c){return c!==Error.prototype},l=>l!=="isAxiosError"),fe.call(a,e.message,t,n,r,i),a.cause=e,a.name=e.name,o&&Object.assign(a,o),a};const dR=null;function Vp(e){return M.isPlainObject(e)||M.isArray(e)}function mb(e){return M.endsWith(e,"[]")?e.slice(0,-2):e}function e0(e,t,n){return e?e.concat(t).map(function(i,o){return i=mb(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function fR(e){return M.isArray(e)&&!e.some(Vp)}const pR=M.toFlatObject(M,{},null,function(t){return/^is[A-Z]/.test(t)});function Yu(e,t,n){if(!M.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=M.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(g,S){return!M.isUndefined(S[g])});const r=n.metaTokens,i=n.visitor||p,o=n.dots,a=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&M.isSpecCompliantForm(t);if(!M.isFunction(i))throw new TypeError("visitor must be a function");function d(x){if(x===null)return"";if(M.isDate(x))return x.toISOString();if(!c&&M.isBlob(x))throw new fe("Blob is not supported. Use a Buffer instead.");return M.isArrayBuffer(x)||M.isTypedArray(x)?c&&typeof Blob=="function"?new Blob([x]):Buffer.from(x):x}function p(x,g,S){let w=x;if(x&&!S&&typeof x=="object"){if(M.endsWith(g,"{}"))g=r?g:g.slice(0,-2),x=JSON.stringify(x);else if(M.isArray(x)&&fR(x)||(M.isFileList(x)||M.endsWith(g,"[]"))&&(w=M.toArray(x)))return g=mb(g),w.forEach(function(v,b){!(M.isUndefined(v)||v===null)&&t.append(a===!0?e0([g],b,o):a===null?g:g+"[]",d(v))}),!1}return Vp(x)?!0:(t.append(e0(S,g,o),d(x)),!1)}const f=[],h=Object.assign(pR,{defaultVisitor:p,convertValue:d,isVisitable:Vp});function j(x,g){if(!M.isUndefined(x)){if(f.indexOf(x)!==-1)throw Error("Circular reference detected in "+g.join("."));f.push(x),M.forEach(x,function(w,m){(!(M.isUndefined(w)||w===null)&&i.call(t,w,M.isString(m)?m.trim():m,g,h))===!0&&j(w,g?g.concat(m):[m])}),f.pop()}}if(!M.isObject(e))throw new TypeError("data must be an object");return j(e),t}function t0(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function km(e,t){this._pairs=[],e&&Yu(e,this,t)}const gb=km.prototype;gb.append=function(t,n){this._pairs.push([t,n])};gb.toString=function(t){const n=t?function(r){return t.call(this,r,t0)}:t0;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function hR(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function xb(e,t,n){if(!t)return e;const r=n&&n.encode||hR,i=n&&n.serialize;let o;if(i?o=i(t,n):o=M.isURLSearchParams(t)?t.toString():new km(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class n0{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){M.forEach(this.handlers,function(r){r!==null&&t(r)})}}const yb={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},mR=typeof URLSearchParams<"u"?URLSearchParams:km,gR=typeof FormData<"u"?FormData:null,xR=typeof Blob<"u"?Blob:null,yR={isBrowser:!0,classes:{URLSearchParams:mR,FormData:gR,Blob:xR},protocols:["http","https","file","blob","url","data"]},Rm=typeof window<"u"&&typeof document<"u",Kp=typeof navigator=="object"&&navigator||void 0,vR=Rm&&(!Kp||["ReactNative","NativeScript","NS"].indexOf(Kp.product)<0),wR=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",bR=Rm&&window.location.href||"http://localhost",jR=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Rm,hasStandardBrowserEnv:vR,hasStandardBrowserWebWorkerEnv:wR,navigator:Kp,origin:bR},Symbol.toStringTag,{value:"Module"})),Bt={...jR,...yR};function CR(e,t){return Yu(e,new Bt.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return Bt.isNode&&M.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function SR(e){return M.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function PR(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r=n.length;return a=!a&&M.isArray(i)?i.length:a,c?(M.hasOwnProp(i,a)?i[a]=[i[a],r]:i[a]=r,!l):((!i[a]||!M.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&M.isArray(i[a])&&(i[a]=PR(i[a])),!l)}if(M.isFormData(e)&&M.isFunction(e.entries)){const n={};return M.forEachEntry(e,(r,i)=>{t(SR(r),i,n,0)}),n}return null}function ER(e,t,n){if(M.isString(e))try{return(t||JSON.parse)(e),M.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const bl={transitional:yb,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=M.isObject(t);if(o&&M.isHTMLForm(t)&&(t=new FormData(t)),M.isFormData(t))return i?JSON.stringify(vb(t)):t;if(M.isArrayBuffer(t)||M.isBuffer(t)||M.isStream(t)||M.isFile(t)||M.isBlob(t)||M.isReadableStream(t))return t;if(M.isArrayBufferView(t))return t.buffer;if(M.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return CR(t,this.formSerializer).toString();if((l=M.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Yu(l?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),ER(t)):t}],transformResponse:[function(t){const n=this.transitional||bl.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(M.isResponse(t)||M.isReadableStream(t))return t;if(t&&M.isString(t)&&(r&&!this.responseType||i)){const a=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(l){if(a)throw l.name==="SyntaxError"?fe.from(l,fe.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Bt.classes.FormData,Blob:Bt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};M.forEach(["delete","get","head","post","put","patch"],e=>{bl.headers[e]={}});const kR=M.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),RR=e=>{const t={};let n,r,i;return e&&e.split(` +`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||t[n]&&kR[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},r0=Symbol("internals");function ra(e){return e&&String(e).trim().toLowerCase()}function Lc(e){return e===!1||e==null?e:M.isArray(e)?e.map(Lc):String(e)}function AR(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const IR=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Hd(e,t,n,r,i){if(M.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!M.isString(t)){if(M.isString(r))return t.indexOf(r)!==-1;if(M.isRegExp(r))return r.test(t)}}function OR(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function _R(e,t){const n=M.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,a){return this[r].call(this,t,i,o,a)},configurable:!0})})}class Wt{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(l,c,d){const p=ra(c);if(!p)throw new Error("header name must be a non-empty string");const f=M.findKey(i,p);(!f||i[f]===void 0||d===!0||d===void 0&&i[f]!==!1)&&(i[f||c]=Lc(l))}const a=(l,c)=>M.forEach(l,(d,p)=>o(d,p,c));if(M.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(M.isString(t)&&(t=t.trim())&&!IR(t))a(RR(t),n);else if(M.isHeaders(t))for(const[l,c]of t.entries())o(c,l,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=ra(t),t){const r=M.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return AR(i);if(M.isFunction(n))return n.call(this,i,r);if(M.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=ra(t),t){const r=M.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Hd(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(a){if(a=ra(a),a){const l=M.findKey(r,a);l&&(!n||Hd(r,r[l],l,n))&&(delete r[l],i=!0)}}return M.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||Hd(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return M.forEach(this,(i,o)=>{const a=M.findKey(r,o);if(a){n[a]=Lc(i),delete n[o];return}const l=t?OR(o):String(o).trim();l!==o&&delete n[o],n[l]=Lc(i),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return M.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&M.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[r0]=this[r0]={accessors:{}}).accessors,i=this.prototype;function o(a){const l=ra(a);r[l]||(_R(i,a),r[l]=!0)}return M.isArray(t)?t.forEach(o):o(t),this}}Wt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);M.reduceDescriptors(Wt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});M.freezeMethods(Wt);function Qd(e,t){const n=this||bl,r=t||n,i=Wt.from(r.headers);let o=r.data;return M.forEach(e,function(l){o=l.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function wb(e){return!!(e&&e.__CANCEL__)}function Fs(e,t,n){fe.call(this,e??"canceled",fe.ERR_CANCELED,t,n),this.name="CanceledError"}M.inherits(Fs,fe,{__CANCEL__:!0});function bb(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new fe("Request failed with status code "+n.status,[fe.ERR_BAD_REQUEST,fe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function DR(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function TR(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),p=r[o];a||(a=d),n[i]=c,r[i]=d;let f=o,h=0;for(;f!==i;)h+=n[f++],f=f%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),d-a{n=p,i=null,o&&(clearTimeout(o),o=null),e.apply(null,d)};return[(...d)=>{const p=Date.now(),f=p-n;f>=r?a(d,p):(i=d,o||(o=setTimeout(()=>{o=null,a(i)},r-f)))},()=>i&&a(i)]}const xu=(e,t,n=3)=>{let r=0;const i=TR(50,250);return MR(o=>{const a=o.loaded,l=o.lengthComputable?o.total:void 0,c=a-r,d=i(c),p=a<=l;r=a;const f={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:d||void 0,estimated:d&&l&&p?(l-a)/d:void 0,event:o,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},i0=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},o0=e=>(...t)=>M.asap(()=>e(...t)),LR=Bt.hasStandardBrowserEnv?function(){const t=Bt.navigator&&/(msie|trident)/i.test(Bt.navigator.userAgent),n=document.createElement("a");let r;function i(o){let a=o;return t&&(n.setAttribute("href",a),a=n.href),n.setAttribute("href",a),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(a){const l=M.isString(a)?i(a):a;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}(),NR=Bt.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const a=[e+"="+encodeURIComponent(t)];M.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),M.isString(r)&&a.push("path="+r),M.isString(i)&&a.push("domain="+i),o===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $R(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function FR(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function jb(e,t){return e&&!$R(t)?FR(e,t):t}const s0=e=>e instanceof Wt?{...e}:e;function io(e,t){t=t||{};const n={};function r(d,p,f){return M.isPlainObject(d)&&M.isPlainObject(p)?M.merge.call({caseless:f},d,p):M.isPlainObject(p)?M.merge({},p):M.isArray(p)?p.slice():p}function i(d,p,f){if(M.isUndefined(p)){if(!M.isUndefined(d))return r(void 0,d,f)}else return r(d,p,f)}function o(d,p){if(!M.isUndefined(p))return r(void 0,p)}function a(d,p){if(M.isUndefined(p)){if(!M.isUndefined(d))return r(void 0,d)}else return r(void 0,p)}function l(d,p,f){if(f in t)return r(d,p);if(f in e)return r(void 0,d)}const c={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(d,p)=>i(s0(d),s0(p),!0)};return M.forEach(Object.keys(Object.assign({},e,t)),function(p){const f=c[p]||i,h=f(e[p],t[p],p);M.isUndefined(h)&&f!==l||(n[p]=h)}),n}const Cb=e=>{const t=io({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:a,auth:l}=t;t.headers=a=Wt.from(a),t.url=xb(jb(t.baseURL,t.url),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(M.isFormData(n)){if(Bt.hasStandardBrowserEnv||Bt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[d,...p]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([d||"multipart/form-data",...p].join("; "))}}if(Bt.hasStandardBrowserEnv&&(r&&M.isFunction(r)&&(r=r(t)),r||r!==!1&&LR(t.url))){const d=i&&o&&NR.read(o);d&&a.set(i,d)}return t},zR=typeof XMLHttpRequest<"u",UR=zR&&function(e){return new Promise(function(n,r){const i=Cb(e);let o=i.data;const a=Wt.from(i.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:d}=i,p,f,h,j,x;function g(){j&&j(),x&&x(),i.cancelToken&&i.cancelToken.unsubscribe(p),i.signal&&i.signal.removeEventListener("abort",p)}let S=new XMLHttpRequest;S.open(i.method.toUpperCase(),i.url,!0),S.timeout=i.timeout;function w(){if(!S)return;const v=Wt.from("getAllResponseHeaders"in S&&S.getAllResponseHeaders()),E={data:!l||l==="text"||l==="json"?S.responseText:S.response,status:S.status,statusText:S.statusText,headers:v,config:e,request:S};bb(function(k){n(k),g()},function(k){r(k),g()},E),S=null}"onloadend"in S?S.onloadend=w:S.onreadystatechange=function(){!S||S.readyState!==4||S.status===0&&!(S.responseURL&&S.responseURL.indexOf("file:")===0)||setTimeout(w)},S.onabort=function(){S&&(r(new fe("Request aborted",fe.ECONNABORTED,e,S)),S=null)},S.onerror=function(){r(new fe("Network Error",fe.ERR_NETWORK,e,S)),S=null},S.ontimeout=function(){let b=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const E=i.transitional||yb;i.timeoutErrorMessage&&(b=i.timeoutErrorMessage),r(new fe(b,E.clarifyTimeoutError?fe.ETIMEDOUT:fe.ECONNABORTED,e,S)),S=null},o===void 0&&a.setContentType(null),"setRequestHeader"in S&&M.forEach(a.toJSON(),function(b,E){S.setRequestHeader(E,b)}),M.isUndefined(i.withCredentials)||(S.withCredentials=!!i.withCredentials),l&&l!=="json"&&(S.responseType=i.responseType),d&&([h,x]=xu(d,!0),S.addEventListener("progress",h)),c&&S.upload&&([f,j]=xu(c),S.upload.addEventListener("progress",f),S.upload.addEventListener("loadend",j)),(i.cancelToken||i.signal)&&(p=v=>{S&&(r(!v||v.type?new Fs(null,e,S):v),S.abort(),S=null)},i.cancelToken&&i.cancelToken.subscribe(p),i.signal&&(i.signal.aborted?p():i.signal.addEventListener("abort",p)));const m=DR(i.url);if(m&&Bt.protocols.indexOf(m)===-1){r(new fe("Unsupported protocol "+m+":",fe.ERR_BAD_REQUEST,e));return}S.send(o||null)})},BR=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(d){if(!i){i=!0,l();const p=d instanceof Error?d:this.reason;r.abort(p instanceof fe?p:new Fs(p instanceof Error?p.message:p))}};let a=t&&setTimeout(()=>{a=null,o(new fe(`timeout ${t} of ms exceeded`,fe.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),e=null)};e.forEach(d=>d.addEventListener("abort",o));const{signal:c}=r;return c.unsubscribe=()=>M.asap(l),c}},WR=function*(e,t){let n=e.byteLength;if(n{const i=HR(e,t);let o=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:p}=await i.next();if(d){l(),c.close();return}let f=p.byteLength;if(n){let h=o+=f;n(h)}c.enqueue(new Uint8Array(p))}catch(d){throw l(d),d}},cancel(c){return l(c),i.return()}},{highWaterMark:2})},Xu=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Sb=Xu&&typeof ReadableStream=="function",VR=Xu&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),Pb=(e,...t)=>{try{return!!e(...t)}catch{return!1}},KR=Sb&&Pb(()=>{let e=!1;const t=new Request(Bt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),l0=64*1024,Gp=Sb&&Pb(()=>M.isReadableStream(new Response("").body)),yu={stream:Gp&&(e=>e.body)};Xu&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!yu[t]&&(yu[t]=M.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new fe(`Response type '${t}' is not supported`,fe.ERR_NOT_SUPPORT,r)})})})(new Response);const GR=async e=>{if(e==null)return 0;if(M.isBlob(e))return e.size;if(M.isSpecCompliantForm(e))return(await new Request(Bt.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(M.isArrayBufferView(e)||M.isArrayBuffer(e))return e.byteLength;if(M.isURLSearchParams(e)&&(e=e+""),M.isString(e))return(await VR(e)).byteLength},qR=async(e,t)=>{const n=M.toFiniteNumber(e.getContentLength());return n??GR(t)},JR=Xu&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:a,onDownloadProgress:l,onUploadProgress:c,responseType:d,headers:p,withCredentials:f="same-origin",fetchOptions:h}=Cb(e);d=d?(d+"").toLowerCase():"text";let j=BR([i,o&&o.toAbortSignal()],a),x;const g=j&&j.unsubscribe&&(()=>{j.unsubscribe()});let S;try{if(c&&KR&&n!=="get"&&n!=="head"&&(S=await qR(p,r))!==0){let E=new Request(t,{method:"POST",body:r,duplex:"half"}),P;if(M.isFormData(r)&&(P=E.headers.get("content-type"))&&p.setContentType(P),E.body){const[k,R]=i0(S,xu(o0(c)));r=a0(E.body,l0,k,R)}}M.isString(f)||(f=f?"include":"omit");const w="credentials"in Request.prototype;x=new Request(t,{...h,signal:j,method:n.toUpperCase(),headers:p.normalize().toJSON(),body:r,duplex:"half",credentials:w?f:void 0});let m=await fetch(x);const v=Gp&&(d==="stream"||d==="response");if(Gp&&(l||v&&g)){const E={};["status","statusText","headers"].forEach(I=>{E[I]=m[I]});const P=M.toFiniteNumber(m.headers.get("content-length")),[k,R]=l&&i0(P,xu(o0(l),!0))||[];m=new Response(a0(m.body,l0,k,()=>{R&&R(),g&&g()}),E)}d=d||"text";let b=await yu[M.findKey(yu,d)||"text"](m,e);return!v&&g&&g(),await new Promise((E,P)=>{bb(E,P,{data:b,headers:Wt.from(m.headers),status:m.status,statusText:m.statusText,config:e,request:x})})}catch(w){throw g&&g(),w&&w.name==="TypeError"&&/fetch/i.test(w.message)?Object.assign(new fe("Network Error",fe.ERR_NETWORK,e,x),{cause:w.cause||w}):fe.from(w,w&&w.code,e,x)}}),qp={http:dR,xhr:UR,fetch:JR};M.forEach(qp,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const c0=e=>`- ${e}`,YR=e=>M.isFunction(e)||e===null||e===!1,Eb={getAdapter:e=>{e=M.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?o.length>1?`since : +`+o.map(c0).join(` +`):" "+c0(o[0]):"as no adapter specified";throw new fe("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:qp};function Vd(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Fs(null,e)}function u0(e){return Vd(e),e.headers=Wt.from(e.headers),e.data=Qd.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Eb.getAdapter(e.adapter||bl.adapter)(e).then(function(r){return Vd(e),r.data=Qd.call(e,e.transformResponse,r),r.headers=Wt.from(r.headers),r},function(r){return wb(r)||(Vd(e),r&&r.response&&(r.response.data=Qd.call(e,e.transformResponse,r.response),r.response.headers=Wt.from(r.response.headers))),Promise.reject(r)})}const kb="1.7.7",Am={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Am[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const d0={};Am.transitional=function(t,n,r){function i(o,a){return"[Axios v"+kb+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,l)=>{if(t===!1)throw new fe(i(a," has been removed"+(n?" in "+n:"")),fe.ERR_DEPRECATED);return n&&!d0[a]&&(d0[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,l):!0}};function XR(e,t,n){if(typeof e!="object")throw new fe("options must be an object",fe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=t[o];if(a){const l=e[o],c=l===void 0||a(l,o,e);if(c!==!0)throw new fe("option "+o+" must be "+c,fe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new fe("Unknown option "+o,fe.ERR_BAD_OPTION)}}const Jp={assertOptions:XR,validators:Am},wr=Jp.validators;class qi{constructor(t){this.defaults=t,this.interceptors={request:new n0,response:new n0}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=io(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&Jp.assertOptions(r,{silentJSONParsing:wr.transitional(wr.boolean),forcedJSONParsing:wr.transitional(wr.boolean),clarifyTimeoutError:wr.transitional(wr.boolean)},!1),i!=null&&(M.isFunction(i)?n.paramsSerializer={serialize:i}:Jp.assertOptions(i,{encode:wr.function,serialize:wr.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&M.merge(o.common,o[n.method]);o&&M.forEach(["delete","get","head","post","put","patch","common"],x=>{delete o[x]}),n.headers=Wt.concat(a,o);const l=[];let c=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(c=c&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});const d=[];this.interceptors.response.forEach(function(g){d.push(g.fulfilled,g.rejected)});let p,f=0,h;if(!c){const x=[u0.bind(this),void 0];for(x.unshift.apply(x,l),x.push.apply(x,d),h=x.length,p=Promise.resolve(n);f{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(l=>{r.subscribe(l),o=l}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,l){r.reason||(r.reason=new Fs(o,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Im(function(i){t=i}),cancel:t}}}function ZR(e){return function(n){return e.apply(null,n)}}function eA(e){return M.isObject(e)&&e.isAxiosError===!0}const Yp={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Yp).forEach(([e,t])=>{Yp[t]=e});function Rb(e){const t=new qi(e),n=ob(qi.prototype.request,t);return M.extend(n,qi.prototype,t,{allOwnKeys:!0}),M.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return Rb(io(e,i))},n}const qe=Rb(bl);qe.Axios=qi;qe.CanceledError=Fs;qe.CancelToken=Im;qe.isCancel=wb;qe.VERSION=kb;qe.toFormData=Yu;qe.AxiosError=fe;qe.Cancel=qe.CanceledError;qe.all=function(t){return Promise.all(t)};qe.spread=ZR;qe.isAxiosError=eA;qe.mergeConfig=io;qe.AxiosHeaders=Wt;qe.formToJSON=e=>vb(M.isHTMLForm(e)?new FormData(e):e);qe.getAdapter=Eb.getAdapter;qe.HttpStatusCode=Yp;qe.default=qe;const se=qe.create({baseURL:"http://localhost:8000",timeout:5e3});se.interceptors.request.use(e=>{const t=localStorage.getItem("token");return t&&(e.headers.Authorization=`Bearer ${t}`),e});const tA=async e=>{try{const t=`/goodbuyUs/product?postid=${e}`;return(await se.get(t)).data}catch{throw new Error("상품 정보를 가져오는 데 실패했습니다.")}},nA=async()=>{try{return(await se.get("/goodbuyUs")).data}catch{throw new Error("상품 정보를 가져오는 데 실패했습니다.")}},jl=e=>Pm({queryKey:["product",e],queryFn:()=>tA(e)}),Ab=()=>Pm({queryKey:["products"],queryFn:nA}),lo=({isLoading:e,isError:t,children:n})=>e?s.jsx("div",{children:"로딩 중..."}):t?s.jsx("div",{children:"잠시 후 다시 시도해주세요."}):s.jsx(s.Fragment,{children:n}),rA=({popular:e,category:t})=>{if(!e)return s.jsx("div",{children:"No popular product available"});const{data:n,isLoading:r,isError:i}=jl(e.id);return n?s.jsx(s.Fragment,{children:s.jsx(lo,{isLoading:r,isError:i,children:s.jsx(iA,{children:s.jsxs(oA,{children:[s.jsx(sA,{children:s.jsx(aA,{src:n.url||qn,alt:n.name,onError:o=>{o.currentTarget.src=qn}})}),s.jsxs(lA,{children:[s.jsx(cA,{children:s.jsx(yl,{rating:n.rating})}),s.jsxs(uA,{children:[s.jsxs(dA,{children:[s.jsx(fA,{children:n.name}),s.jsx(pA,{children:t})]}),s.jsx(hA,{children:n.description})]})]})]})})})}):s.jsx("div",{children:"Product data is not available"})},iA=u.div` + width: 80%; + margin: 0 auto; + display: block; +`,oA=u.div` + height: 300px; + width: 1100px; + display: flex; + background-color: #f5f5f5; + border-radius: 12px; + overflow: hidden; + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); + transition: all 0.3s ease-in-out; + &:hover { + cursor: pointer; + transform: translateY(-5px); + } + @media (min-width: 768px) and (max-width: 1024px) { + width: 750px; + height: 300px; + } + @media (min-width: 576px) and (max-width: 767px) { + width: 550px; + height: 200px; + } +`,sA=u.div` + width: 300px; + height: 300px; + display: flex; + justify-content: center; + align-items: center; + background-color: white; + @media (min-width: 576px) and (max-width: 767px) { + width: 200px; + height: 200px; + } +`,aA=u.img` + height: 300px; + width: auto; + object-fit: contain; +`,lA=u.div` + background: linear-gradient(to top, rgba(155, 155, 155, 0.7), transparent); + flex-grow: 1; + display: flex; + flex-direction: column; + justify-content: center; + padding: 0 50px; + background-color: #f5f5f5; + position: relative; +`,cA=u.div` + position: absolute; + top: 20px; + right: 20px; + font-size: 20px; + @media (min-width: 576px) and (max-width: 767px) { + font-size: 15px; + top: 10px; + } +`,uA=u.div` + display: flex; + flex-direction: column; + width: 100%; +`,dA=u.div` + display: flex; + align-items: baseline; + margin-bottom: 15px; + @media (min-width: 768px) and (max-width: 1024px) { + flex-direction: column; + } + @media (min-width: 576px) and (max-width: 767px) { + flex-direction: column; + } +`,fA=u.h3` + font-size: 24px; + font-weight: 700; + color: #333; + margin-right: 15px; + @media (min-width: 576px) and (max-width: 767px) { + font-size: 19px; + } +`,pA=u.p` + font-size: 16px; + color: #666; + @media (min-width: 768px) and (max-width: 1024px) { + margin-top: -10px; + } + @media (min-width: 576px) and (max-width: 767px) { + font-size: 12px; + } +`,hA=u.p` + font-size: 14px; + color: #555; + line-height: 1.6; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + @media (min-width: 768px) and (max-width: 1024px) { + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + } + @media (min-width: 576px) and (max-width: 767px) { + display: none; + } +`,mA=({categories:e,products:t})=>{if(!t)return s.jsx("div",{children:"No products available"});const[n,r]=C.useState(!1),[i,o]=C.useState("LIFESTYLE"),a=()=>r(!n),l=p=>{o(p),r(!1)},c=C.useMemo(()=>(t==null?void 0:t.filter(p=>p.category.toLowerCase().includes(i.toLowerCase())))||[],[i,t]),d=C.useMemo(()=>[...c].sort(()=>.5-Math.random()).slice(0,8),[c]);return s.jsxs(gA,{children:[s.jsxs(QE,{children:[s.jsx(xA,{onClick:a,children:i}),s.jsx(VE,{expanded:n,children:e.map(p=>s.jsx(KE,{selected:p==i,onClick:()=>l(p),children:p},p))})]}),s.jsx(Dw,{children:d.map(p=>s.jsxs(Tw,{children:[s.jsxs(Mw,{to:`/products/${p.id}`,children:[s.jsx(Lw,{src:p.url||qn,alt:p.name,onError:f=>{f.currentTarget.src=qn}}),s.jsxs(Nw,{children:[s.jsx($w,{children:p.name}),s.jsxs(Fw,{children:[" ",s.jsx(yl,{rating:p.rating})]}),s.jsxs(zw,{children:[s.jsxs(Uw,{children:[p.originalprice,"원"]}),s.jsxs(Bw,{children:[p.discountprice,"원"]})]})]})]}),s.jsx(Ww,{likes:p.likes})]},p.id))}),s.jsx(Hw,{children:s.jsx(Qw,{to:`/products?category=${i}`,children:"더보기"})})]})},gA=u.div` + display: flex; + flex-wrap: wrap; + width: 80%; + height: auto; + margin: 0 auto; +`,xA=u.h2` + text-decoration: underline; + margin-left: 10px; + margin-bottom: 20px; + font-size: 1.5rem; + color: #333; + &:hover { + cursor: pointer; + } +`;var Ib={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},f0=at.createContext&&at.createContext(Ib),yA=["attr","size","title"];function vA(e,t){if(e==null)return{};var n=wA(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function wA(e,t){if(e==null)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}function vu(){return vu=Object.assign?Object.assign.bind():function(e){for(var t=1;tat.createElement(t.tag,wu({key:n},t.attr),Ob(t.child)))}function On(e){return t=>at.createElement(SA,vu({attr:wu({},e.attr)},t),Ob(e.child))}function SA(e){var t=n=>{var{attr:r,size:i,title:o}=e,a=vA(e,yA),l=i||n.size||"1em",c;return n.className&&(c=n.className),e.className&&(c=(c?c+" ":"")+e.className),at.createElement("svg",vu({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:c,style:wu(wu({color:e.color||n.color},n.style),e.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),o&&at.createElement("title",null,o),e.children)};return f0!==void 0?at.createElement(f0.Consumer,null,n=>t(n)):t(Ib)}function PA(e){return On({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M177 255.7l136 136c9.4 9.4 9.4 24.6 0 33.9l-22.6 22.6c-9.4 9.4-24.6 9.4-33.9 0L160 351.9l-96.4 96.4c-9.4 9.4-24.6 9.4-33.9 0L7 425.7c-9.4-9.4-9.4-24.6 0-33.9l136-136c9.4-9.5 24.6-9.5 34-.1zm-34-192L7 199.7c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l96.4-96.4 96.4 96.4c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9l-136-136c-9.2-9.4-24.4-9.4-33.8 0z"},child:[]}]})(e)}function Zu(e){return On({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"},child:[]}]})(e)}function ed(e){return On({tag:"svg",attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"},child:[]}]})(e)}function Om(e){return On({tag:"svg",attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M576 64H205.26A63.97 63.97 0 0 0 160 82.75L9.37 233.37c-12.5 12.5-12.5 32.76 0 45.25L160 429.25c12 12 28.28 18.75 45.25 18.75H576c35.35 0 64-28.65 64-64V128c0-35.35-28.65-64-64-64zm-84.69 254.06c6.25 6.25 6.25 16.38 0 22.63l-22.62 22.62c-6.25 6.25-16.38 6.25-22.63 0L384 301.25l-62.06 62.06c-6.25 6.25-16.38 6.25-22.63 0l-22.62-22.62c-6.25-6.25-6.25-16.38 0-22.63L338.75 256l-62.06-62.06c-6.25-6.25-6.25-16.38 0-22.63l22.62-22.62c6.25-6.25 16.38-6.25 22.63 0L384 210.75l62.06-62.06c6.25-6.25 16.38-6.25 22.63 0l22.62 22.62c6.25 6.25 6.25 16.38 0 22.63L429.25 256l62.06 62.06z"},child:[]}]})(e)}function _b(e){return On({tag:"svg",attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"},child:[]}]})(e)}function _m(e){return On({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zM124 296c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h264c6.6 0 12 5.4 12 12v56c0 6.6-5.4 12-12 12H124z"},child:[]}]})(e)}function EA(e){return On({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M290.74 93.24l128.02 128.02-277.99 277.99-114.14 12.6C11.35 513.54-1.56 500.62.14 485.34l12.7-114.22 277.9-277.88zm207.2-19.06l-60.11-60.11c-18.75-18.75-49.16-18.75-67.91 0l-56.55 56.55 128.02 128.02 56.55-56.55c18.75-18.76 18.75-49.16 0-67.91z"},child:[]}]})(e)}function Dm(e){return On({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm144 276c0 6.6-5.4 12-12 12h-92v92c0 6.6-5.4 12-12 12h-56c-6.6 0-12-5.4-12-12v-92h-92c-6.6 0-12-5.4-12-12v-56c0-6.6 5.4-12 12-12h92v-92c0-6.6 5.4-12 12-12h56c6.6 0 12 5.4 12 12v92h92c6.6 0 12 5.4 12 12v56z"},child:[]}]})(e)}function kA(e){return On({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"},child:[]}]})(e)}function RA(e){return On({tag:"svg",attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M32 464a48 48 0 0 0 48 48h288a48 48 0 0 0 48-48V128H32zm272-256a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zm-96 0a16 16 0 0 1 32 0v224a16 16 0 0 1-32 0zM432 32H312l-9.4-18.7A24 24 0 0 0 281.1 0H166.8a23.72 23.72 0 0 0-21.4 13.3L136 32H16A16 16 0 0 0 0 48v32a16 16 0 0 0 16 16h416a16 16 0 0 0 16-16V48a16 16 0 0 0-16-16z"},child:[]}]})(e)}function AA(e){return On({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 32C114.6 32 0 125.1 0 240c0 47.6 19.9 91.2 52.9 126.3C38 405.7 7 439.1 6.5 439.5c-6.6 7-8.4 17.2-4.6 26S14.4 480 24 480c61.5 0 110-25.7 139.1-46.3C192 442.8 223.2 448 256 448c141.4 0 256-93.1 256-208S397.4 32 256 32zm0 368c-26.7 0-53.1-4.1-78.4-12.1l-22.7-7.2-19.5 13.8c-14.3 10.1-33.9 21.4-57.5 29 7.3-12.1 14.4-25.7 19.9-40.2l10.6-28.1-20.6-21.8C69.7 314.1 48 282.2 48 240c0-88.2 93.3-160 208-160s208 71.8 208 160-93.3 160-208 160z"},child:[]}]})(e)}const Tm=()=>{const[e,t]=C.useState(!1);C.useEffect(()=>{const r=()=>{window.scrollY>200?t(!0):t(!1)};return window.addEventListener("scroll",r),()=>window.removeEventListener("scroll",r)},[]);const n=()=>{window.scrollTo({top:0,behavior:"smooth"})};return e?s.jsx(IA,{onClick:n,children:s.jsx(PA,{})}):null},IA=u.button` + position: fixed; + bottom: 20px; + right: 20px; + width: 50px; + height: 50px; + background-color: #000; + color: #fff; + border: 1px solid #333; + border-radius: 50%; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + cursor: pointer; + font-size: 1.5rem; + display: flex; + justify-content: center; + align-items: center; + transition: background-color 0.3s; + + &:hover { + background-color: #333; + } +`,OA=["FOOD","LIFESTYLE","FASHION"],_A=()=>{const{data:e,isLoading:t,isError:n}=Ab(),r=e==null?void 0:e.filter(o=>o.available===!0&&new Date(o.deadline)>new Date),i=r==null?void 0:r.sort((o,a)=>a.currentStock-o.currentStock)[0];return s.jsx(s.Fragment,{children:s.jsxs(lo,{isLoading:t,isError:n,children:[s.jsx(Kd,{children:s.jsx(Gd,{children:s.jsxs(DA,{to:`/products/${i==null?void 0:i.id}`,children:[" ",s.jsx(rA,{popular:i,category:i==null?void 0:i.category})]})})}),s.jsx(Kd,{children:s.jsx(Gd,{children:s.jsx(GE,{products:r})})}),s.jsxs(Kd,{children:[s.jsx(Gd,{children:s.jsx(mA,{categories:OA,products:r})}),s.jsx(Tm,{})]})]})})},DA=u(Gn)` + text-decoration: none; + color: inherit; + width: 100%; + &:link, + &:visited, + &:hover, + &:active { + color: inherit; + text-decoration: none; + } +`,Kd=u.div` + display: flex; + margin-top: 5vh; + align-items: center; + justify-content: center; + width: 100%; + max-width: 1400px; + margin-left: auto; + margin-right: auto; +`,Gd=u.div` + display: flex; + align-items: center; + width: 100%; +`,cn={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_API_URL:"http://localhost:8000",VITE_KAKAO_KEY:"af7394f12b174cad35e87960ddccf91f"};let TA=0;function Rt(e,t){const n=`atom${++TA}`,r={toString(){return(cn?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=MA,r.write=LA),t&&(r.write=t),r}function MA(e){return e(this)}function LA(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const h0=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,qd=e=>"init"in e,Jd=e=>!!e.write,bu=new WeakMap,Xp=e=>{var t;return Zp(e)&&!((t=bu.get(e))!=null&&t[1])},NA=(e,t)=>{const n=bu.get(e);if(n)n[1]=!0,n[0].forEach(r=>r(t));else if((cn?"production":void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},$A=e=>{if(bu.has(e))return;const t=[new Set,!1];bu.set(e,t);const n=()=>{t[1]=!0};e.then(n,n),e.onCancel=r=>{t[0].add(r)}},Zp=e=>typeof(e==null?void 0:e.then)=="function",m0=e=>"v"in e||"e"in e,rc=e=>{if("e"in e)throw e.e;if((cn?"production":void 0)!=="production"&&!("v"in e))throw new Error("[Bug] atom state is not initialized");return e.v},Db=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},g0=(e,t,n,r,i)=>{var o;if((cn?"production":void 0)!=="production"&&r===t)throw new Error("[Bug] atom cannot depend on itself");n.d.set(r,i.n),Xp(n.v)&&Db(t,n.v,i),(o=i.m)==null||o.t.add(t),e&&FA(e,r,t)},yo=()=>[new Map,new Map,new Set],Yd=(e,t,n)=>{e[0].has(t)||e[0].set(t,new Set),e[1].set(t,n)},FA=(e,t,n)=>{const r=e[0].get(t);r&&r.add(n)},zA=(e,t)=>e[0].get(t),x0=(e,t)=>{e[2].add(t)},br=e=>{let t,n=!1;const r=i=>{try{i()}catch(o){n||(t=o,n=!0)}};for(;e[1].size||e[2].size;){e[0].clear();const i=new Set(e[1].values());e[1].clear();const o=new Set(e[2]);e[2].clear(),i.forEach(a=>{var l;return(l=a.m)==null?void 0:l.l.forEach(r)}),o.forEach(r)}if(n)throw t},Tb=(...[e,t,n,r])=>{let i;(cn?"production":void 0)!=="production"&&(i=new Set);const o=(v,b,E)=>{const P="v"in b,k=b.v,R=Xp(b.v)?b.v:null;if(Zp(E)){$A(E);for(const I of b.d.keys())Db(v,E,e(I));b.v=E,delete b.e}else b.v=E,delete b.e;(!P||!Object.is(k,b.v))&&(++b.n,R&&NA(R,E))},a=(v,b,E)=>{var P;const k=e(b);if(m0(k)&&(k.m&&!(E!=null&&E.has(b))||Array.from(k.d).every(([F,$])=>a(v,F,E).n===$)))return k;k.d.clear();let R=!0;const I=F=>{if(h0(b,F)){const X=e(F);if(!m0(X))if(qd(F))o(F,X,F.init);else throw new Error("no atom init");return rc(X)}const $=a(v,F,E);try{return rc($)}finally{if(R)g0(v,b,k,F,$);else{const X=yo();g0(X,b,k,F,$),j(X,b,k),br(X)}}};let D,_;const N={get signal(){return D||(D=new AbortController),D.signal},get setSelf(){return(cn?"production":void 0)!=="production"&&!Jd(b)&&console.warn("setSelf function cannot be used with read-only atom"),!_&&Jd(b)&&(_=(...F)=>{if((cn?"production":void 0)!=="production"&&R&&console.warn("setSelf function cannot be called in sync"),!R)return h(b,...F)}),_}};try{const F=t(b,I,N);if(o(b,k,F),Zp(F)){(P=F.onCancel)==null||P.call(F,()=>D==null?void 0:D.abort());const $=()=>{if(k.m){const X=yo();j(X,b,k),br(X)}};F.then($,$)}return k}catch(F){return delete k.v,k.e=F,++k.n,k}finally{R=!1}},l=v=>rc(a(void 0,v)),c=(v,b,E)=>{var P,k;const R=new Map;for(const I of((P=E.m)==null?void 0:P.t)||[])R.set(I,e(I));for(const I of E.p)R.set(I,e(I));return(k=zA(v,b))==null||k.forEach(I=>{R.set(I,e(I))}),R};function d(v,b,E){const P=[],k=new Set,R=new Set,I=[[b,E]];for(;I.length>0;){const[D,_]=I[I.length-1];if(R.has(D)){I.pop();continue}if(k.has(D)){P.push([D,_,_.n]),R.add(D),I.pop();continue}k.add(D);for(const[N,F]of c(v,D,_))D!==N&&!k.has(N)&&I.push([N,F])}return[P,R]}const p=(v,b,E)=>{const[P,k]=d(v,b,E),R=new Set([b]);for(let I=P.length-1;I>=0;--I){const[D,_,N]=P[I];let F=!1;for(const $ of _.d.keys())if($!==D&&R.has($)){F=!0;break}F&&(a(v,D,k),j(v,D,_),N!==_.n&&(Yd(v,D,_),R.add(D))),k.delete(D)}},f=(v,b,...E)=>{let P=!0;const k=I=>rc(a(v,I)),R=(I,...D)=>{const _=e(I);try{if(h0(b,I)){if(!qd(I))throw new Error("atom not writable");const N=_.n,F=D[0];o(I,_,F),j(v,I,_),N!==_.n&&(Yd(v,I,_),p(v,I,_));return}else return f(v,I,...D)}finally{P||br(v)}};try{return n(b,k,R,...E)}finally{P=!1}},h=(v,...b)=>{const E=yo();try{return f(E,v,...b)}finally{br(E)}},j=(v,b,E)=>{if(E.m&&!Xp(E.v)){for(const P of E.d.keys())E.m.d.has(P)||(x(v,P,e(P)).t.add(b),E.m.d.add(P));for(const P of E.m.d||[])if(!E.d.has(P)){E.m.d.delete(P);const k=g(v,P,e(P));k==null||k.t.delete(b)}}},x=(v,b,E)=>{if(!E.m){a(v,b);for(const P of E.d.keys())x(v,P,e(P)).t.add(b);if(E.m={l:new Set,d:new Set(E.d.keys()),t:new Set},(cn?"production":void 0)!=="production"&&i.add(b),Jd(b)){const P=E.m;let k;const R=(I,D)=>{let _=!0;k=(...N)=>{try{return f(I,b,...N)}finally{_||br(I)}};try{return D()}finally{_=!1}};x0(v,()=>{const I=R(v,()=>r(b,(...D)=>k(...D)));I&&(P.u=D=>R(D,I))})}}return E.m},g=(v,b,E)=>{if(E.m&&!E.m.l.size&&!Array.from(E.m.t).some(P=>{var k;return(k=e(P).m)==null?void 0:k.d.has(b)})){const P=E.m.u;P&&x0(v,()=>P(v)),delete E.m,(cn?"production":void 0)!=="production"&&i.delete(b);for(const k of E.d.keys()){const R=g(v,k,e(k));R==null||R.t.delete(b)}return}return E.m},m={get:l,set:h,sub:(v,b)=>{const E=yo(),P=e(v),R=x(E,v,P).l;return R.add(b),br(E),()=>{R.delete(b);const I=yo();g(I,v,P),br(I)}},unstable_derive:v=>Tb(...v(e,t,n,r))};return(cn?"production":void 0)!=="production"&&Object.assign(m,{dev4_get_internal_weak_map:()=>({get:b=>{const E=e(b);if(E.n!==0)return E}}),dev4_get_mounted_atoms:()=>i,dev4_restore_atoms:b=>{const E=yo();for(const[P,k]of b)if(qd(P)){const R=e(P),I=R.n;o(P,R,k),j(E,P,R),I!==R.n&&(Yd(E,P,R),p(E,P,R))}br(E)}}),m},UA=()=>{const e=new WeakMap;return Tb(n=>{if((cn?"production":void 0)!=="production"&&!n)throw new Error("Atom is undefined or null");let r=e.get(n);return r||(r={d:new Map,p:new Set,n:0},e.set(n,r)),r},(n,...r)=>n.read(...r),(n,...r)=>n.write(...r),(n,...r)=>{var i;return(i=n.onMount)==null?void 0:i.call(n,...r)})};let ia;const BA=()=>(ia||(ia=UA(),(cn?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=ia),globalThis.__JOTAI_DEFAULT_STORE__!==ia&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),ia),Mb={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_API_URL:"http://localhost:8000",VITE_KAKAO_KEY:"af7394f12b174cad35e87960ddccf91f"},WA=C.createContext(void 0),Lb=e=>C.useContext(WA)||BA(),Nb=e=>typeof(e==null?void 0:e.then)=="function",HA=e=>{e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})},QA=at.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(HA(e),e)}),Xd=new WeakMap,VA=e=>{let t=Xd.get(e);return t||(t=new Promise((n,r)=>{let i=e;const o=c=>d=>{i===c&&n(d)},a=c=>d=>{i===c&&r(d)},l=c=>{"onCancel"in c&&typeof c.onCancel=="function"&&c.onCancel(d=>{if((Mb?"production":void 0)!=="production"&&d===c)throw new Error("[Bug] p is not updated even after cancelation");Nb(d)?(Xd.set(d,t),i=d,d.then(o(d),a(d)),l(d)):n(d)})};e.then(o(e),a(e)),l(e)}),Xd.set(e,t)),t};function KA(e,t){const n=Lb(),[[r,i,o],a]=C.useReducer(d=>{const p=n.get(e);return Object.is(d[0],p)&&d[1]===n&&d[2]===e?d:[p,n,e]},void 0,()=>[n.get(e),n,e]);let l=r;if((i!==n||o!==e)&&(a(),l=n.get(e)),C.useEffect(()=>{const d=n.sub(e,()=>{a()});return a(),d},[n,e,void 0]),C.useDebugValue(l),Nb(l)){const d=VA(l);return QA(d)}return l}function GA(e,t){const n=Lb();return C.useCallback((...i)=>{if((Mb?"production":void 0)!=="production"&&!("write"in e))throw new Error("not writable atom");return n.set(e,...i)},[n,e])}function $t(e,t){return[KA(e),GA(e)]}var Cl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},As=typeof window>"u"||"Deno"in globalThis;function sn(){}function qA(e,t){return typeof e=="function"?e(t):e}function eh(e){return typeof e=="number"&&e>=0&&e!==1/0}function $b(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Wo(e,t){return typeof e=="function"?e(t):e}function Pn(e,t){return typeof e=="function"?e(t):e}function y0(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:a,stale:l}=e;if(a){if(r){if(t.queryHash!==Mm(a,t.options))return!1}else if(!el(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||i&&i!==t.state.fetchStatus||o&&!o(t))}function v0(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Za(t.options.mutationKey)!==Za(o))return!1}else if(!el(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Mm(e,t){return((t==null?void 0:t.queryKeyHashFn)||Za)(e)}function Za(e){return JSON.stringify(e,(t,n)=>nh(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function el(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!el(e[n],t[n])):!1}function Fb(e,t){if(e===t)return e;const n=w0(e)&&w0(t);if(n||nh(e)&&nh(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),a=o.length,l=n?[]:{};let c=0;for(let d=0;d{setTimeout(t,e)})}function rh(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Fb(e,t):t}function YA(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function XA(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Lm=Symbol();function zb(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Lm?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var $i,Ur,rs,vy,ZA=(vy=class extends Cl{constructor(){super();U(this,$i);U(this,Ur);U(this,rs);L(this,rs,t=>{if(!As&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){y(this,Ur)||this.setEventListener(y(this,rs))}onUnsubscribe(){var t;this.hasListeners()||((t=y(this,Ur))==null||t.call(this),L(this,Ur,void 0))}setEventListener(t){var n;L(this,rs,t),(n=y(this,Ur))==null||n.call(this),L(this,Ur,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){y(this,$i)!==t&&(L(this,$i,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof y(this,$i)=="boolean"?y(this,$i):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},$i=new WeakMap,Ur=new WeakMap,rs=new WeakMap,vy),Nm=new ZA,is,Br,os,wy,e3=(wy=class extends Cl{constructor(){super();U(this,is,!0);U(this,Br);U(this,os);L(this,os,t=>{if(!As&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){y(this,Br)||this.setEventListener(y(this,os))}onUnsubscribe(){var t;this.hasListeners()||((t=y(this,Br))==null||t.call(this),L(this,Br,void 0))}setEventListener(t){var n;L(this,os,t),(n=y(this,Br))==null||n.call(this),L(this,Br,t(this.setOnline.bind(this)))}setOnline(t){y(this,is)!==t&&(L(this,is,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return y(this,is)}},is=new WeakMap,Br=new WeakMap,os=new WeakMap,wy),ju=new e3;function ih(){let e,t;const n=new Promise((i,o)=>{e=i,t=o});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function t3(e){return Math.min(1e3*2**e,3e4)}function Ub(e){return(e??"online")==="online"?ju.isOnline():!0}var Bb=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Zd(e){return e instanceof Bb}function Wb(e){let t=!1,n=0,r=!1,i;const o=ih(),a=g=>{var S;r||(h(new Bb(g)),(S=e.abort)==null||S.call(e))},l=()=>{t=!0},c=()=>{t=!1},d=()=>Nm.isFocused()&&(e.networkMode==="always"||ju.isOnline())&&e.canRun(),p=()=>Ub(e.networkMode)&&e.canRun(),f=g=>{var S;r||(r=!0,(S=e.onSuccess)==null||S.call(e,g),i==null||i(),o.resolve(g))},h=g=>{var S;r||(r=!0,(S=e.onError)==null||S.call(e,g),i==null||i(),o.reject(g))},j=()=>new Promise(g=>{var S;i=w=>{(r||d())&&g(w)},(S=e.onPause)==null||S.call(e)}).then(()=>{var g;i=void 0,r||(g=e.onContinue)==null||g.call(e)}),x=()=>{if(r)return;let g;const S=n===0?e.initialPromise:void 0;try{g=S??e.fn()}catch(w){g=Promise.reject(w)}Promise.resolve(g).then(f).catch(w=>{var P;if(r)return;const m=e.retry??(As?0:3),v=e.retryDelay??t3,b=typeof v=="function"?v(n,w):v,E=m===!0||typeof m=="number"&&nd()?void 0:j()).then(()=>{t?h(w):x()})})};return{promise:o,cancel:a,continue:()=>(i==null||i(),o),cancelRetry:l,continueRetry:c,canStart:p,start:()=>(p()?x():j().then(x),o)}}function n3(){let e=[],t=0,n=l=>{l()},r=l=>{l()},i=l=>setTimeout(l,0);const o=l=>{t?e.push(l):i(()=>{n(l)})},a=()=>{const l=e;e=[],l.length&&i(()=>{r(()=>{l.forEach(c=>{n(c)})})})};return{batch:l=>{let c;t++;try{c=l()}finally{t--,t||a()}return c},batchCalls:l=>(...c)=>{o(()=>{l(...c)})},schedule:o,setNotifyFunction:l=>{n=l},setBatchNotifyFunction:l=>{r=l},setScheduler:l=>{i=l}}}var ft=n3(),Fi,by,Hb=(by=class{constructor(){U(this,Fi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),eh(this.gcTime)&&L(this,Fi,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(As?1/0:5*60*1e3))}clearGcTimeout(){y(this,Fi)&&(clearTimeout(y(this,Fi)),L(this,Fi,void 0))}},Fi=new WeakMap,by),ss,as,rn,yt,al,zi,wn,nr,jy,r3=(jy=class extends Hb{constructor(t){super();U(this,wn);U(this,ss);U(this,as);U(this,rn);U(this,yt);U(this,al);U(this,zi);L(this,zi,!1),L(this,al,t.defaultOptions),this.setOptions(t.options),this.observers=[],L(this,rn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,L(this,ss,i3(this.options)),this.state=t.state??y(this,ss),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=y(this,yt))==null?void 0:t.promise}setOptions(t){this.options={...y(this,al),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&y(this,rn).remove(this)}setData(t,n){const r=rh(this.state.data,t,this.options);return K(this,wn,nr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){K(this,wn,nr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=y(this,yt))==null?void 0:r.promise;return(i=y(this,yt))==null||i.cancel(t),n?n.then(sn).catch(sn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(y(this,ss))}isActive(){return this.observers.some(t=>Pn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Lm||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!$b(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=y(this,yt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=y(this,yt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),y(this,rn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(y(this,yt)&&(y(this,zi)?y(this,yt).cancel({revert:!0}):y(this,yt).cancelRetry()),this.scheduleGc()),y(this,rn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||K(this,wn,nr).call(this,{type:"invalidate"})}fetch(t,n){var c,d,p;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(y(this,yt))return y(this,yt).continueRetry(),y(this,yt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=this.observers.find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(L(this,zi,!0),r.signal)})},o=()=>{const f=zb(this.options,n),h={queryKey:this.queryKey,meta:this.meta};return i(h),L(this,zi,!1),this.options.persister?this.options.persister(f,h,this):f(h)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:o};i(a),(c=this.options.behavior)==null||c.onFetch(a,this),L(this,as,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((d=a.fetchOptions)==null?void 0:d.meta))&&K(this,wn,nr).call(this,{type:"fetch",meta:(p=a.fetchOptions)==null?void 0:p.meta});const l=f=>{var h,j,x,g;Zd(f)&&f.silent||K(this,wn,nr).call(this,{type:"error",error:f}),Zd(f)||((j=(h=y(this,rn).config).onError)==null||j.call(h,f,this),(g=(x=y(this,rn).config).onSettled)==null||g.call(x,this.state.data,f,this)),this.scheduleGc()};return L(this,yt,Wb({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,j,x,g;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(f)}catch(S){l(S);return}(j=(h=y(this,rn).config).onSuccess)==null||j.call(h,f,this),(g=(x=y(this,rn).config).onSettled)==null||g.call(x,f,this.state.error,this),this.scheduleGc()},onError:l,onFail:(f,h)=>{K(this,wn,nr).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{K(this,wn,nr).call(this,{type:"pause"})},onContinue:()=>{K(this,wn,nr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),y(this,yt).start()}},ss=new WeakMap,as=new WeakMap,rn=new WeakMap,yt=new WeakMap,al=new WeakMap,zi=new WeakMap,wn=new WeakSet,nr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...Qb(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return Zd(i)&&i.revert&&y(this,as)?{...y(this,as),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),ft.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),y(this,rn).notify({query:this,type:"updated",action:t})})},jy);function Qb(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ub(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function i3(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Fn,Cy,o3=(Cy=class extends Cl{constructor(t={}){super();U(this,Fn);this.config=t,L(this,Fn,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??Mm(i,n);let a=this.get(o);return a||(a=new r3({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){y(this,Fn).has(t.queryHash)||(y(this,Fn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=y(this,Fn).get(t.queryHash);n&&(t.destroy(),n===t&&y(this,Fn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ft.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return y(this,Fn).get(t)}getAll(){return[...y(this,Fn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>y0(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>y0(t,r)):n}notify(t){ft.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){ft.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ft.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Fn=new WeakMap,Cy),zn,Pt,Ui,Un,kr,Sy,s3=(Sy=class extends Hb{constructor(t){super();U(this,Un);U(this,zn);U(this,Pt);U(this,Ui);this.mutationId=t.mutationId,L(this,Pt,t.mutationCache),L(this,zn,[]),this.state=t.state||a3(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){y(this,zn).includes(t)||(y(this,zn).push(t),this.clearGcTimeout(),y(this,Pt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){L(this,zn,y(this,zn).filter(n=>n!==t)),this.scheduleGc(),y(this,Pt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){y(this,zn).length||(this.state.status==="pending"?this.scheduleGc():y(this,Pt).remove(this))}continue(){var t;return((t=y(this,Ui))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,a,l,c,d,p,f,h,j,x,g,S,w,m,v,b,E,P,k;L(this,Ui,Wb({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(R,I)=>{K(this,Un,kr).call(this,{type:"failed",failureCount:R,error:I})},onPause:()=>{K(this,Un,kr).call(this,{type:"pause"})},onContinue:()=>{K(this,Un,kr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>y(this,Pt).canRun(this)}));const n=this.state.status==="pending",r=!y(this,Ui).canStart();try{if(!n){K(this,Un,kr).call(this,{type:"pending",variables:t,isPaused:r}),await((o=(i=y(this,Pt).config).onMutate)==null?void 0:o.call(i,t,this));const I=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,t));I!==this.state.context&&K(this,Un,kr).call(this,{type:"pending",context:I,variables:t,isPaused:r})}const R=await y(this,Ui).start();return await((d=(c=y(this,Pt).config).onSuccess)==null?void 0:d.call(c,R,t,this.state.context,this)),await((f=(p=this.options).onSuccess)==null?void 0:f.call(p,R,t,this.state.context)),await((j=(h=y(this,Pt).config).onSettled)==null?void 0:j.call(h,R,null,this.state.variables,this.state.context,this)),await((g=(x=this.options).onSettled)==null?void 0:g.call(x,R,null,t,this.state.context)),K(this,Un,kr).call(this,{type:"success",data:R}),R}catch(R){try{throw await((w=(S=y(this,Pt).config).onError)==null?void 0:w.call(S,R,t,this.state.context,this)),await((v=(m=this.options).onError)==null?void 0:v.call(m,R,t,this.state.context)),await((E=(b=y(this,Pt).config).onSettled)==null?void 0:E.call(b,void 0,R,this.state.variables,this.state.context,this)),await((k=(P=this.options).onSettled)==null?void 0:k.call(P,void 0,R,t,this.state.context)),R}finally{K(this,Un,kr).call(this,{type:"error",error:R})}}finally{y(this,Pt).runNext(this)}}},zn=new WeakMap,Pt=new WeakMap,Ui=new WeakMap,Un=new WeakSet,kr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),ft.batch(()=>{y(this,zn).forEach(r=>{r.onMutationUpdate(t)}),y(this,Pt).notify({mutation:this,type:"updated",action:t})})},Sy);function a3(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Vt,ll,Py,l3=(Py=class extends Cl{constructor(t={}){super();U(this,Vt);U(this,ll);this.config=t,L(this,Vt,new Map),L(this,ll,Date.now())}build(t,n,r){const i=new s3({mutationCache:this,mutationId:++xi(this,ll)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){const n=ic(t),r=y(this,Vt).get(n)??[];r.push(t),y(this,Vt).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=ic(t);if(y(this,Vt).has(n)){const i=(r=y(this,Vt).get(n))==null?void 0:r.filter(o=>o!==t);i&&(i.length===0?y(this,Vt).delete(n):y(this,Vt).set(n,i))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=y(this,Vt).get(ic(t)))==null?void 0:r.find(i=>i.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=y(this,Vt).get(ic(t)))==null?void 0:r.find(i=>i!==t&&i.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){ft.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[...y(this,Vt).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>v0(n,r))}findAll(t={}){return this.getAll().filter(n=>v0(t,n))}notify(t){ft.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return ft.batch(()=>Promise.all(t.map(n=>n.continue().catch(sn))))}},Vt=new WeakMap,ll=new WeakMap,Py);function ic(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function j0(e){return{onFetch:(t,n)=>{var p,f,h,j,x;const r=t.options,i=(h=(f=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:f.fetchMore)==null?void 0:h.direction,o=((j=t.state.data)==null?void 0:j.pages)||[],a=((x=t.state.data)==null?void 0:x.pageParams)||[];let l={pages:[],pageParams:[]},c=0;const d=async()=>{let g=!1;const S=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},w=zb(t.options,t.fetchOptions),m=async(v,b,E)=>{if(g)return Promise.reject();if(b==null&&v.pages.length)return Promise.resolve(v);const P={queryKey:t.queryKey,pageParam:b,direction:E?"backward":"forward",meta:t.options.meta};S(P);const k=await w(P),{maxPages:R}=t.options,I=E?XA:YA;return{pages:I(v.pages,k,R),pageParams:I(v.pageParams,b,R)}};if(i&&o.length){const v=i==="backward",b=v?c3:C0,E={pages:o,pageParams:a},P=b(r,E);l=await m(E,P,v)}else{const v=e??o.length;do{const b=c===0?a[0]??r.initialPageParam:C0(r,l);if(c>0&&b==null)break;l=await m(l,b),c++}while(c{var g,S;return(S=(g=t.options).persister)==null?void 0:S.call(g,d,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function C0(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function c3(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ke,Wr,Hr,ls,cs,Qr,us,ds,Ey,u3=(Ey=class{constructor(e={}){U(this,Ke);U(this,Wr);U(this,Hr);U(this,ls);U(this,cs);U(this,Qr);U(this,us);U(this,ds);L(this,Ke,e.queryCache||new o3),L(this,Wr,e.mutationCache||new l3),L(this,Hr,e.defaultOptions||{}),L(this,ls,new Map),L(this,cs,new Map),L(this,Qr,0)}mount(){xi(this,Qr)._++,y(this,Qr)===1&&(L(this,us,Nm.subscribe(async e=>{e&&(await this.resumePausedMutations(),y(this,Ke).onFocus())})),L(this,ds,ju.subscribe(async e=>{e&&(await this.resumePausedMutations(),y(this,Ke).onOnline())})))}unmount(){var e,t;xi(this,Qr)._--,y(this,Qr)===0&&((e=y(this,us))==null||e.call(this),L(this,us,void 0),(t=y(this,ds))==null||t.call(this),L(this,ds,void 0))}isFetching(e){return y(this,Ke).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return y(this,Wr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=y(this,Ke).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=y(this,Ke).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Wo(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return y(this,Ke).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=y(this,Ke).get(r.queryHash),o=i==null?void 0:i.state.data,a=qA(t,o);if(a!==void 0)return y(this,Ke).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ft.batch(()=>y(this,Ke).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=y(this,Ke).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=y(this,Ke);ft.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=y(this,Ke),r={type:"active",...e};return ft.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=ft.batch(()=>y(this,Ke).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(sn).catch(sn)}invalidateQueries(e,t={}){return ft.batch(()=>{if(y(this,Ke).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=ft.batch(()=>y(this,Ke).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(sn)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(sn)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=y(this,Ke).build(this,t);return n.isStaleByTime(Wo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(sn).catch(sn)}fetchInfiniteQuery(e){return e.behavior=j0(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(sn).catch(sn)}ensureInfiniteQueryData(e){return e.behavior=j0(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ju.isOnline()?y(this,Wr).resumePausedMutations():Promise.resolve()}getQueryCache(){return y(this,Ke)}getMutationCache(){return y(this,Wr)}getDefaultOptions(){return y(this,Hr)}setDefaultOptions(e){L(this,Hr,e)}setQueryDefaults(e,t){y(this,ls).set(Za(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...y(this,ls).values()],n={};return t.forEach(r=>{el(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){y(this,cs).set(Za(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...y(this,cs).values()];let n={};return t.forEach(r=>{el(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...y(this,Hr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Mm(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Lm&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...y(this,Hr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){y(this,Ke).clear(),y(this,Wr).clear()}},Ke=new WeakMap,Wr=new WeakMap,Hr=new WeakMap,ls=new WeakMap,cs=new WeakMap,Qr=new WeakMap,us=new WeakMap,ds=new WeakMap,Ey),Tt,we,cl,Et,Bi,fs,Vr,Bn,ul,ps,hs,Wi,Hi,Kr,ms,Ae,va,oh,sh,ah,lh,ch,uh,dh,Vb,ky,d3=(ky=class extends Cl{constructor(t,n){super();U(this,Ae);U(this,Tt);U(this,we);U(this,cl);U(this,Et);U(this,Bi);U(this,fs);U(this,Vr);U(this,Bn);U(this,ul);U(this,ps);U(this,hs);U(this,Wi);U(this,Hi);U(this,Kr);U(this,ms,new Set);this.options=n,L(this,Tt,t),L(this,Bn,null),L(this,Vr,ih()),this.options.experimental_prefetchInRender||y(this,Vr).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(y(this,we).addObserver(this),S0(y(this,we),this.options)?K(this,Ae,va).call(this):this.updateResult(),K(this,Ae,lh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fh(y(this,we),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fh(y(this,we),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,K(this,Ae,ch).call(this),K(this,Ae,uh).call(this),y(this,we).removeObserver(this)}setOptions(t,n){const r=this.options,i=y(this,we);if(this.options=y(this,Tt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Pn(this.options.enabled,y(this,we))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");K(this,Ae,dh).call(this),y(this,we).setOptions(this.options),r._defaulted&&!th(this.options,r)&&y(this,Tt).getQueryCache().notify({type:"observerOptionsUpdated",query:y(this,we),observer:this});const o=this.hasListeners();o&&P0(y(this,we),i,this.options,r)&&K(this,Ae,va).call(this),this.updateResult(n),o&&(y(this,we)!==i||Pn(this.options.enabled,y(this,we))!==Pn(r.enabled,y(this,we))||Wo(this.options.staleTime,y(this,we))!==Wo(r.staleTime,y(this,we)))&&K(this,Ae,oh).call(this);const a=K(this,Ae,sh).call(this);o&&(y(this,we)!==i||Pn(this.options.enabled,y(this,we))!==Pn(r.enabled,y(this,we))||a!==y(this,Kr))&&K(this,Ae,ah).call(this,a)}getOptimisticResult(t){const n=y(this,Tt).getQueryCache().build(y(this,Tt),t),r=this.createResult(n,t);return p3(this,r)&&(L(this,Et,r),L(this,fs,this.options),L(this,Bi,y(this,we).state)),r}getCurrentResult(){return y(this,Et)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){y(this,ms).add(t)}getCurrentQuery(){return y(this,we)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=y(this,Tt).defaultQueryOptions(t),r=y(this,Tt).getQueryCache().build(y(this,Tt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return K(this,Ae,va).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),y(this,Et)))}createResult(t,n){var R;const r=y(this,we),i=this.options,o=y(this,Et),a=y(this,Bi),l=y(this,fs),d=t!==r?t.state:y(this,cl),{state:p}=t;let f={...p},h=!1,j;if(n._optimisticResults){const I=this.hasListeners(),D=!I&&S0(t,n),_=I&&P0(t,r,n,i);(D||_)&&(f={...f,...Qb(p.data,t.options)}),n._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:x,errorUpdatedAt:g,status:S}=f;if(n.select&&f.data!==void 0)if(o&&f.data===(a==null?void 0:a.data)&&n.select===y(this,ul))j=y(this,ps);else try{L(this,ul,n.select),j=n.select(f.data),j=rh(o==null?void 0:o.data,j,n),L(this,ps,j),L(this,Bn,null)}catch(I){L(this,Bn,I)}else j=f.data;if(n.placeholderData!==void 0&&j===void 0&&S==="pending"){let I;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))I=o.data;else if(I=typeof n.placeholderData=="function"?n.placeholderData((R=y(this,hs))==null?void 0:R.state.data,y(this,hs)):n.placeholderData,n.select&&I!==void 0)try{I=n.select(I),L(this,Bn,null)}catch(D){L(this,Bn,D)}I!==void 0&&(S="success",j=rh(o==null?void 0:o.data,I,n),h=!0)}y(this,Bn)&&(x=y(this,Bn),j=y(this,ps),g=Date.now(),S="error");const w=f.fetchStatus==="fetching",m=S==="pending",v=S==="error",b=m&&w,E=j!==void 0,k={status:S,fetchStatus:f.fetchStatus,isPending:m,isSuccess:S==="success",isError:v,isInitialLoading:b,isLoading:b,data:j,dataUpdatedAt:f.dataUpdatedAt,error:x,errorUpdatedAt:g,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>d.dataUpdateCount||f.errorUpdateCount>d.errorUpdateCount,isFetching:w,isRefetching:w&&!m,isLoadingError:v&&!E,isPaused:f.fetchStatus==="paused",isPlaceholderData:h,isRefetchError:v&&E,isStale:$m(t,n),refetch:this.refetch,promise:y(this,Vr)};if(this.options.experimental_prefetchInRender){const I=N=>{k.status==="error"?N.reject(k.error):k.data!==void 0&&N.resolve(k.data)},D=()=>{const N=L(this,Vr,k.promise=ih());I(N)},_=y(this,Vr);switch(_.status){case"pending":t.queryHash===r.queryHash&&I(_);break;case"fulfilled":(k.status==="error"||k.data!==_.value)&&D();break;case"rejected":(k.status!=="error"||k.error!==_.reason)&&D();break}}return k}updateResult(t){const n=y(this,Et),r=this.createResult(y(this,we),this.options);if(L(this,Bi,y(this,we).state),L(this,fs,this.options),y(this,Bi).data!==void 0&&L(this,hs,y(this,we)),th(r,n))return;L(this,Et,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,l=typeof a=="function"?a():a;if(l==="all"||!l&&!y(this,ms).size)return!0;const c=new Set(l??y(this,ms));return this.options.throwOnError&&c.add("error"),Object.keys(y(this,Et)).some(d=>{const p=d;return y(this,Et)[p]!==n[p]&&c.has(p)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),K(this,Ae,Vb).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&K(this,Ae,lh).call(this)}},Tt=new WeakMap,we=new WeakMap,cl=new WeakMap,Et=new WeakMap,Bi=new WeakMap,fs=new WeakMap,Vr=new WeakMap,Bn=new WeakMap,ul=new WeakMap,ps=new WeakMap,hs=new WeakMap,Wi=new WeakMap,Hi=new WeakMap,Kr=new WeakMap,ms=new WeakMap,Ae=new WeakSet,va=function(t){K(this,Ae,dh).call(this);let n=y(this,we).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(sn)),n},oh=function(){K(this,Ae,ch).call(this);const t=Wo(this.options.staleTime,y(this,we));if(As||y(this,Et).isStale||!eh(t))return;const r=$b(y(this,Et).dataUpdatedAt,t)+1;L(this,Wi,setTimeout(()=>{y(this,Et).isStale||this.updateResult()},r))},sh=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(y(this,we)):this.options.refetchInterval)??!1},ah=function(t){K(this,Ae,uh).call(this),L(this,Kr,t),!(As||Pn(this.options.enabled,y(this,we))===!1||!eh(y(this,Kr))||y(this,Kr)===0)&&L(this,Hi,setInterval(()=>{(this.options.refetchIntervalInBackground||Nm.isFocused())&&K(this,Ae,va).call(this)},y(this,Kr)))},lh=function(){K(this,Ae,oh).call(this),K(this,Ae,ah).call(this,K(this,Ae,sh).call(this))},ch=function(){y(this,Wi)&&(clearTimeout(y(this,Wi)),L(this,Wi,void 0))},uh=function(){y(this,Hi)&&(clearInterval(y(this,Hi)),L(this,Hi,void 0))},dh=function(){const t=y(this,Tt).getQueryCache().build(y(this,Tt),this.options);if(t===y(this,we))return;const n=y(this,we);L(this,we,t),L(this,cl,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},Vb=function(t){ft.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(y(this,Et))}),y(this,Tt).getQueryCache().notify({query:y(this,we),type:"observerResultsUpdated"})})},ky);function f3(e,t){return Pn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function S0(e,t){return f3(e,t)||e.state.data!==void 0&&fh(e,t,t.refetchOnMount)}function fh(e,t,n){if(Pn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&$m(e,t)}return!1}function P0(e,t,n,r){return(e!==t||Pn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&$m(e,n)}function $m(e,t){return Pn(t.enabled,e)!==!1&&e.isStaleByTime(Wo(t.staleTime,e))}function p3(e,t){return!th(e.getCurrentResult(),t)}const Kb=Rt(new u3);function ph(){return ph=Object.assign?Object.assign.bind():function(e){for(var t=1;t(e==null?void 0:e.suspense)&&m3(t,n),m3=(e,t)=>e.isPending&&!t,g3=({result:e,throwOnError:t,query:n})=>e.isError&&!e.isFetching&&x3(t,[e.error,n]);function x3(e,t){return typeof e=="function"?e(...t):!!e}const y3=e=>e.suspense&&typeof e.staleTime!="number"?ph({},e,{staleTime:1e3}):e;function v3(e,t,n=r=>r(Kb)){const r=Rt(0),i=Rt(n),o=Rt(()=>new WeakMap),a=Rt(d=>{const p=d(i),f=e(d),h=p.defaultQueryOptions(f),j=d(o).get(p);return h._optimisticResults="optimistic",j&&j.setOptions(h,{listeners:!1}),y3(h)}),l=Rt(d=>{const p=d(i),f=d(a),h=d(o),j=h.get(p);if(j)return j;const x=new t(p,f);return h.set(p,x),x}),c=Rt(d=>{const p=d(l),f=d(a),h=p.getOptimisticResult(f),j=Rt(h);return j.onMount=x=>{const g=p.subscribe(ft.batchCalls(x));return()=>{p.getCurrentResult().isError&&p.getCurrentQuery().reset(),g()}},j});return Rt(d=>{d(r);const p=d(l),f=d(a),h=d(d(c));if(h3(f,h,!1))return p.fetchOptimistic(f);if(g3({result:h,query:p.getCurrentQuery(),throwOnError:f.throwOnError}))throw h.error;return h},(d,p)=>{p(r,f=>f+1)})}function Gb(e,t=n=>n(Kb)){return v3(e,d3,t)}const Sl=async e=>{const t=await se.get(`/api/community/post/${e}`,{headers:{Authorization:`Bearer ${localStorage.getItem("jwt")}`}});if(t.status!==200)throw new Error("Failed to fetch post details");return t.data},w3=async e=>{const t=new FormData,n=JSON.stringify({title:e.title,category:e.category,availableNumber:e.availableNumber,period:e.period,totalAmount:e.totalAmount,unitAmount:e.unitAmount,productUrl:e.productUrl,description:e.description}),r=new Blob([n],{type:"application/json"});t.append("content",r),e.imageUrls.forEach(o=>{o instanceof File&&t.append("images",o)});const i=await se.post("/api/community/post",t,{headers:{Authorization:`Bearer ${localStorage.getItem("jwt")}`}});if(i.status!==200)throw new Error("Failed to create post");return i.data},b3=async(e,t)=>(await se.patch(`/api/mypage/post/${e}`,t)).data,qb=async e=>{await se.delete(`/api/community/post/${e}`)},j3=async(e,t)=>{const n=await se.post(`/api/community/post/${e}/join`,{number:t});if(n.status!==200)throw new Error("Failed to join post");return n.data},C3=async e=>{const t=await se.put(`/api/community/post/${e}/cancel`);if(t.status!==200)throw new Error("Failed to cancel participation");return t.data},Si=(e,t)=>{const n=`/api/community/post/${e}/participants`,r=new XMLHttpRequest;r.open("GET",n,!0),r.send();const i=new EventSource(n);i.onmessage=o=>{JSON.parse(o.data)},i.onerror=()=>{i.close()}},S3=async(e,t,n,r)=>{await se.post(`/api/community/post/${e}/comments`,{userId:t,userNickname:n,content:r})},P3=async(e,t)=>{await se.delete(`/api/community/post/${e}/comments/${t}`)},E3=async(e,t,n)=>{await se.put(`/api/community/post/${e}/comments/${t}`,{content:n})},k3=Gb(()=>({queryKey:["posts"],queryFn:async()=>{const e=await se.get("/api/community/post");if(e.status!==200)throw new Error("Failed to fetch posts");return e.data},onError:()=>{alert("포스트를 불러오는 데 실패했습니다.")}})),si=Rt(null),R3=Rt(null),A3=Gb(e=>({queryKey:["selectedPost",e(si)],queryFn:async()=>{const t=e(si);return t?await Sl(t):null},enabled:!!e(si),onError:()=>{alert("선택된 포스트를 불러오는 데 실패했습니다.")}})),td=Rt(null),I3=(e,t)=>{const n=new EventSource(`/api/community/post/${e}/participants`);return n.onmessage=r=>{const i=JSON.parse(r.data);t(i)},n.onerror=()=>{n.close()},n};Rt(e=>{const t=e(si);return t?n=>{const r=I3(t,i=>{n(td,i)});return()=>{r.close()}}:null});const nd=({categories:e,selectedCategory:t,onCategoryChange:n,title:r="카테고리"})=>{const[i,o]=C.useState(t);C.useEffect(()=>{o(t)},[t]);const a=l=>{o(l),n(l)};return s.jsxs(O3,{children:[s.jsx(_3,{children:r}),e.map(l=>s.jsx(D3,{$active:l.id===i,onClick:()=>a(l.id),children:l.name},l.id))]})},O3=u.div` + display: flex; + flex-wrap: wrap; + gap: 5px 10px; + width: 100%; + justify-content: flex-start; + align-items: center; +`,_3=u.h2` + font-size: 1.2rem; + font-weight: bold; + margin: 0 50px 0 0; + white-space: nowrap; /* 텍스트 줄바꿈 방지 */ +`,D3=u.div` + padding: 1rem 1rem; + font-weight: ${({$active:e})=>e?"bold":"normal"}; + cursor: pointer; + position: relative; + + &::after { + content: ''; + display: ${({$active:e})=>e?"block":"none"}; + height: 2px; + background-color: black; + width: 100%; + position: absolute; + bottom: 0; + left: 0; + } +`,T3=({onClick:e})=>s.jsxs(M3,{onClick:e,children:[s.jsx(EA,{})," 글 작성"]}),M3=u.button` + padding: 8px 16px; + font-size: 1rem; + font-weight: bold; + color: #fff; + background-color: #000; + border: none; + border-radius: 4px; + cursor: pointer; + + &:hover { + background-color: #333; + } +`,L3=({placeholder:e="검색어를 입력해주세요.",value:t,onChange:n,onSearch:r})=>{const i=o=>{o.key==="Enter"&&r()};return s.jsxs(N3,{children:[s.jsx($3,{type:"text",placeholder:e,value:t,onChange:n,onKeyDown:i}),s.jsx(F3,{onClick:r})," "]})},N3=u.div` + display: flex; + align-items: center; + padding: 1.5px; + border: 1px solid #ddd; + border-radius: 4px; + background-color: #fff; + width: 100%; + max-width: 280px; + + &:focus-within { + border-color: #000; + } +`,$3=u.input` + flex: 1; + border: none; + font-size: 1rem; + padding: 8px; + outline: none; + + &::placeholder { + color: #aaa; + } +`,F3=u(kA)` + color: #333; + margin: 0 8px; + font-size: 1.2rem; + cursor: pointer; /* 클릭 가능 */ +`,Fm=({currentPage:e,totalPages:t,onPageChange:n})=>t<=1?null:s.jsx(z3,{children:Array.from({length:t},(r,i)=>s.jsx(U3,{active:e===i+1,onClick:()=>n(i+1),children:i+1},i+1))}),z3=u.div` + display: flex; + justify-content: center; + margin-top: 16px; + gap: 8px; +`,U3=u.button.withConfig({shouldForwardProp:e=>e!=="active"})` + padding: 8px 16px; + font-size: 1rem; + font-weight: 500; + border-radius: 8px; + border: 1px solid #fff; + background-color: ${({active:e})=>e?"#000":"#fff"}; + color: ${({active:e})=>e?"#fff":"#333"}; + cursor: pointer; + + &:hover { + background-color: #333; + color: #fff; + } +`,tl=(e,t=9)=>{const n=new Date(e);return new Date(n.getTime()+t*60*60*1e3).toLocaleString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1})};var B3={VITE_API_URL:"http://localhost:8000",VITE_KAKAO_KEY:"af7394f12b174cad35e87960ddccf91f",ACSetupSvcPort:"23210",ACSvcPort:"17532",ALLUSERSPROFILE:"C:\\ProgramData",APPDATA:"C:\\Users\\Sun_glitter\\AppData\\Roaming",ChocolateyInstall:"C:\\ProgramData\\chocolatey",ChocolateyLastPathUpdate:"133668974099245266",CHROME_CRASHPAD_PIPE_NAME:"\\\\.\\pipe\\crashpad_30528_TLIWLWZNYIKGYOAI",COLOR:"1",COLORTERM:"truecolor",CommonProgramFiles:"C:\\Program Files\\Common Files","CommonProgramFiles(x86)":"C:\\Program Files (x86)\\Common Files",CommonProgramW6432:"C:\\Program Files\\Common Files",COMPUTERNAME:"DESKTOP-MLJO4KS",ComSpec:"C:\\Windows\\system32\\cmd.exe",CONDA_PROMPT_MODIFIER:"False",DriverData:"C:\\Windows\\System32\\Drivers\\DriverData",EDITOR:"C:\\Windows\\notepad.exe",EFC_8688:"1",FPS_BROWSER_APP_PROFILE_STRING:"Internet Explorer",FPS_BROWSER_USER_PROFILE_STRING:"Default",GIT_ASKPASS:"c:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\extensions\\git\\dist\\askpass.sh",HOME:"C:\\Users\\Sun_glitter",HOMEDRIVE:"C:",HOMEPATH:"\\Users\\Sun_glitter",INIT_CWD:"C:\\final-project\\WEB1_2_LinkUP_FE",LANG:"ko_KR.UTF-8",LOCALAPPDATA:"C:\\Users\\Sun_glitter\\AppData\\Local",LOGONSERVER:"\\\\DESKTOP-MLJO4KS",NODE:"C:\\Program Files\\nodejs\\node.exe",NODE_ENV:"production",NODE_EXE:"C:\\Program Files\\nodejs\\\\node.exe",NODE_HOME:"C:\\Program Files\\nodejs",NPM_CLI_JS:"C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js",npm_command:"run-script",npm_config_cache:"C:\\Users\\Sun_glitter\\AppData\\Local\\npm-cache",npm_config_globalconfig:"C:\\Program Files\\nodejs\\etc\\npmrc",npm_config_global_prefix:"C:\\Program Files\\nodejs",npm_config_init_module:"C:\\Users\\Sun_glitter\\.npm-init.js",npm_config_local_prefix:"C:\\final-project\\WEB1_2_LinkUP_FE",npm_config_metrics_registry:"https://registry.npmjs.org/",npm_config_node_gyp:"C:\\Users\\Sun_glitter\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js",npm_config_noproxy:"",npm_config_npm_version:"9.8.1",npm_config_prefix:"C:\\Program Files\\nodejs",npm_config_userconfig:"C:\\Users\\Sun_glitter\\.npmrc",npm_config_user_agent:"npm/9.8.1 node/v18.18.2 win32 x64 workspaces/false",npm_execpath:"C:\\Users\\Sun_glitter\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\bin\\npm-cli.js",npm_lifecycle_event:"build",npm_lifecycle_script:"vite build",npm_node_execpath:"C:\\Program Files\\nodejs\\node.exe",npm_package_json:"C:\\final-project\\WEB1_2_LinkUP_FE\\package.json",npm_package_name:"goodbuyus",npm_package_version:"0.1.0",NPM_PREFIX_NPM_CLI_JS:"C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js",NUMBER_OF_PROCESSORS:"12",NVM_HOME:"C:\\Users\\Sun_glitter\\AppData\\Roaming\\nvm",NVM_SYMLINK:"C:\\Program Files\\nodejs",OneDrive:"C:\\Users\\Sun_glitter\\OneDrive",ORIGINAL_XDG_CURRENT_DESKTOP:"undefined",OS:"Windows_NT",Path:"C:\\final-project\\WEB1_2_LinkUP_FE\\node_modules\\.bin;C:\\final-project\\node_modules\\.bin;C:\\node_modules\\.bin;C:\\Users\\Sun_glitter\\AppData\\Roaming\\nvm\\v18.18.2\\node_modules\\npm\\node_modules\\@npmcli\\run-script\\lib\\node-gyp-bin;C:\\Python312\\Scripts\\;C:\\Python312\\;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\Windows\\System32\\OpenSSH\\;C:\\Program Files\\Bandizip\\;C:\\Program Files\\dotnet\\;C:\\Program Files (x86)\\NVIDIA Corporation\\PhysX\\Common;C:\\Program Files\\NVIDIA Corporation\\NVIDIA NvDLISR;C:\\ProgramData\\chocolatey\\bin;C:\\Git\\cmd;C:\\Users\\Sun_glitter\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;C:\\Program Files\\MongoDB\\Server\\7.0\\bin;C:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\Python\\Python311\\Scripts\\;C:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\Python\\Python311\\;C:\\Users\\Sun_glitter\\AppData\\Local\\Microsoft\\WindowsApps;C:\\Users\\Sun_glitter\\AppData\\Local\\GitHubDesktop\\bin;C:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\Microsoft VS Code\\bin;C:\\Users\\Sun_glitter\\AppData\\Local\\Microsoft\\WinGet\\Packages\\Schniz.fnm_Microsoft.Winget.Source_8wekyb3d8bbwe;C:\\Users\\Sun_glitter\\AppData\\Roaming\\npm;C:\\Users\\Sun_glitter\\AppData\\Roaming\\nvm;C:\\Program Files\\nodejs;C:\\Program Files\\nodejs;;C:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\oh-my-posh\\bin",PATHEXT:".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW;.CPL",POSH_CURSOR_COLUMN:"1",POSH_CURSOR_LINE:"13",POSH_INSTALLER:"winget",POSH_PID:"16676",POSH_SHELL_VERSION:"5.1.26100.2161",POSH_THEMES_PATH:"C:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\oh-my-posh\\themes",POWERLINE_COMMAND:"oh-my-posh",PROCESSOR_ARCHITECTURE:"AMD64",PROCESSOR_IDENTIFIER:"AMD64 Family 25 Model 97 Stepping 2, AuthenticAMD",PROCESSOR_LEVEL:"25",PROCESSOR_REVISION:"6102",ProgramData:"C:\\ProgramData",ProgramFiles:"C:\\Program Files","ProgramFiles(x86)":"C:\\Program Files (x86)",ProgramW6432:"C:\\Program Files",PROMPT:"$P$G",PSModulePath:"C:\\Users\\Sun_glitter\\Documents\\WindowsPowerShell\\Modules;C:\\Program Files\\WindowsPowerShell\\Modules;C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\Modules",PUBLIC:"C:\\Users\\Public",RlsSvcPort:"22112",SESSIONNAME:"Console",SystemDrive:"C:",SystemRoot:"C:\\Windows",TEMP:"C:\\Users\\SUN_GL~1\\AppData\\Local\\Temp",TERM_PROGRAM:"vscode",TERM_PROGRAM_VERSION:"1.95.3",TMP:"C:\\Users\\SUN_GL~1\\AppData\\Local\\Temp",USERDOMAIN:"DESKTOP-MLJO4KS",USERDOMAIN_ROAMINGPROFILE:"DESKTOP-MLJO4KS",USERNAME:"Sun_glitter",USERPROFILE:"C:\\Users\\Sun_glitter",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"",VSCODE_GIT_ASKPASS_MAIN:"c:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\Microsoft VS Code\\resources\\app\\extensions\\git\\dist\\askpass-main.js",VSCODE_GIT_ASKPASS_NODE:"C:\\Users\\Sun_glitter\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe",VSCODE_GIT_IPC_HANDLE:"\\\\.\\pipe\\vscode-git-2f822d37cb-sock",VSCODE_INJECTION:"1",windir:"C:\\Windows"};const co=e=>e?typeof e=="string"?e.startsWith("http")?e:`${B3.VITE_API_URL}/${e}`:e instanceof File?URL.createObjectURL(e):"":"",ef=6,Jb=({selectedCategory:e,posts:t,realTimeData:n,onPostSelect:r,hideWriteButton:i})=>{const o=Ie(),[a,l]=C.useState(1),[c,d]=C.useState(""),[p,f]=C.useState(""),h=t.filter(b=>e==="NOT_APPROVED"?b.status==="NOT_APPROVED"||b.status==="REJECTED":b.category===e&&b.status!=="NOT_APPROVED"&&b.status!=="REJECTED").sort((b,E)=>new Date(E.createdAt).getTime()-new Date(b.createdAt).getTime()),j=Math.ceil(h.length/ef),x=(a-1)*ef,g=h.slice(x,x+ef),S=()=>{f(c),l(1)};C.useEffect(()=>{f(""),d(""),l(1)},[e]);const w=()=>{o("/community/post/create",{state:{selectedCategory:e}})},m=b=>{r&&r(b),e==="NOT_APPROVED"?o(`/admin/post/approval/${b}`,{state:{communityPostId:b}}):o(`/community/post/${b}`)},v=b=>{var E;return((E=n[b])==null?void 0:E.participationCount)||0};return s.jsxs(W3,{children:[s.jsxs(H3,{children:[!i&&s.jsx(T3,{onClick:w}),s.jsx(L3,{value:c,onChange:b=>d(b.target.value),onSearch:S})]}),h.length===0?s.jsx(E0,{children:"선택된 카테고리에 해당하는 게시글이 없습니다."}):g.length===0?s.jsxs(E0,{children:["'",p,"'의 검색 결과가 존재하지 않습니다."]}):g.map(b=>s.jsxs(Q3,{onClick:()=>m(b.communityPostId),children:[s.jsx(V3,{src:co(b.imageUrls[0]),alt:"post.title"}),s.jsxs(K3,{children:[s.jsx(G3,{children:b.title}),s.jsxs(J3,{children:[s.jsx(Y3,{children:b.nickname}),s.jsxs(X3,{children:[s.jsx(Z3,{children:tl(b.createdAt)}),e!=="NOT_APPROVED"&&s.jsxs(s.Fragment,{children:["~",s.jsx(e4,{children:tl(b.closeAt)})]})]}),s.jsxs(t4,{children:["참여 현황: ",v(b.communityPostId)," /"," ",b.availableNumber]})]}),s.jsx(q3,{children:b.description})]})]},b.communityPostId)),j>1&&s.jsx(Fm,{currentPage:a,totalPages:j,onPageChange:b=>l(b)})]})},W3=u.div` + display: flex; + flex-direction: column; + margin: 20px auto; + max-width: 800px; +`,H3=u.div` + display: flex; + justify-content: flex-end; /* 오른쪽 정렬 */ + align-items: center; + margin-bottom: 16px; + gap: 20px; /* 버튼과 검색바 사이의 간격 */ +`,Q3=u.div` + display: flex; + flex-direction: row; + align-items: flex-start; + border: 1px solid #e0e0e0; + border-radius: 8px; + margin-bottom: 16px; + padding: 16px; + background-color: #fff; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); + transition: box-shadow 0.3s ease; + cursor: pointer; + + &:hover { + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); + } +`,V3=u.img` + width: 172px; + height: 100px; + object-fit: cover; + border-radius: 8px; + margin-right: 16px; +`,K3=u.div` + flex: 1; + display: flex; + flex-direction: column; + justify-content: space-between; + align-items: flex-start; + height: 100%; + padding: 4px 0; +`,G3=u.h3` + font-size: 1.4rem; + font-weight: 700; + margin-top: 0; + margin-bottom: 8px; + color: #333; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; +`,q3=u.p` + font-size: 0.9rem; + margin-bottom: 0; + color: #555; + line-height: 1.5; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; +`,J3=u.div` + display: flex; + flex-wrap: wrap; + gap: 15px; + font-size: 0.9rem; + color: #777; +`,Y3=u.span` + font-weight: 400; +`,X3=u.span` + font-weight: 400; +`,Z3=u.span` + font-weight: 400; + margin-right: 10px; +`,e4=u.span` + font-weight: 400; + margin-left: 10px; +`,t4=u.div` + font-weight: 400; +`,E0=u.p` + text-align: center; + color: #888; + font-size: 1.2rem; + padding: 20px; +`,nl=[{id:"생활용품",name:"생활용품"},{id:"식료품",name:"식료품"},{id:"패션/의류",name:"패션/의류"},{id:"전자제품",name:"전자제품"},{id:"가구/인테리어",name:"가구/인테리어"},{id:"유아/아동용품",name:"유아/아동용품"},{id:"스포츠/레저",name:"스포츠/레저"}],n4=()=>{const[e]=$t(k3),t=(e==null?void 0:e.data)||[],[n]=$t(td),[r,i]=C.useState(nl[0].id),[,o]=$t(si),a=typeof n=="object"&&n!==null?n:{},l=d=>{i(d)},c=d=>{o(d)};return s.jsx("div",{children:s.jsx(r4,{children:s.jsxs(i4,{children:[s.jsx(o4,{children:"공구 모집 및 진행"}),s.jsx(s4,{children:s.jsx(nd,{categories:nl,selectedCategory:r,onCategoryChange:l})}),s.jsx(Jb,{selectedCategory:r,posts:t,realTimeData:a,onPostSelect:c})]})})})},r4=u.div` + display: flex; + justify-content: center; + padding: 20px; +`,i4=u.div` + width: 100%; + max-width: 1120px; + margin: 0 auto; +`,o4=u.h1` + font-size: 1.8rem; + font-weight: bold; + margin-bottom: 1.5rem; + text-align: left; +`,s4=u.div` + display: flex; + justify-content: flex-end; + margin-left: 50px; +`,a4=()=>{var me;const e=Ie(),t=it(),n=Ns(),r=((me=t.state)==null?void 0:me.selectedCategory)||nl[0].id,[i,o]=C.useState(r),[a,l]=C.useState(""),[c,d]=C.useState(""),[p,f]=C.useState(!1),[h,j]=C.useState("마감 기한 "),[x,g]=C.useState(""),[S,w]=C.useState(""),[m,v]=C.useState([]),[b,E]=C.useState(-1),[P,k]=C.useState(""),[R,I]=C.useState(!1),D=Gi({mutationFn:te=>w3(te),onSuccess:()=>{n.invalidateQueries({queryKey:["postList"]}),alert("포스트가 작성되었습니다. 관리자의 승인을 대기 중입니다."),e("/community/post")},onError:()=>{alert("포스트 생성에 실패했습니다.")}}),_=()=>{f(!p)},N=te=>{j(te),f(!1)},F=async()=>{if(!x||!a||!c||h==="마감 기한"||m.length===0||!P||!S){alert("모든 필수 정보를 입력하세요.");return}if(!le(P)){I(!0);return}const te=parseInt(c.replace(/,/g,""),10),de=parseInt(a,10),Ce=parseInt(h.replace(/[^0-9]/g,""),10);if(Ce<=0){alert("마감 기한을 올바르게 설정하세요.");return}const mn={title:x.trim(),description:S.trim(),imageUrls:m,category:i,availableNumber:de,totalAmount:te,unitAmount:Math.floor(te/de),productUrl:P.trim(),period:Ce};D.mutate(mn)},$=te=>{const de=te.target.value.replace(/[^0-9]/g,""),Ce=Number(de);de===""||Ce<=0?l(""):l(de)},X=te=>{const de=te.target.value.replace(/[^0-9]/g,""),Ce=Number(de);de===""||Ce<=0?d(""):d(oe(de))},ue=()=>{e("/community/post",{state:{selectedCategory:i}})},oe=te=>{const de=te.replace(/\D/g,"");return new Intl.NumberFormat().format(Number(de))},H=c&&a?oe(String(Math.floor(parseInt(c.replace(/,/g,""),10)/parseInt(a,10)))):"자동 계산",V=te=>{if(te.target.files){const de=Array.from(te.target.files).filter(Ce=>Ce instanceof File);v(Ce=>[...Ce,...de])}},ee=()=>{b>=0&&v(te=>{const de=te.filter((Ce,mn)=>mn!==b);if(de.length>0){const Ce=b>=de.length?b-1:b;E(Ce)}else E(-1);return de})},B=()=>{bte+1):b===m.length-1&&E(-1)},Q=()=>{E(b===-1?m.length-1:te=>Math.max(te-1,0))},ae=te=>{E(te)},le=te=>!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|(\\d{1,3}\\.){3}\\d{1,3})(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(te),he=te=>{k(te.target.value),I(!le(te.target.value))};return s.jsx("div",{children:s.jsx(l4,{children:s.jsxs(c4,{children:[s.jsx(u4,{children:"공구 모집 및 진행"}),s.jsxs(d4,{children:[s.jsxs(f4,{children:[s.jsxs(p4,{children:[s.jsxs(h4,{children:[s.jsx(y4,{children:m.length>0&&(b>0||b===-1)&&s.jsx(w4,{onClick:Q,children:s.jsx(Zu,{size:20})})}),b===-1?s.jsxs(g4,{children:[s.jsx(Dm,{size:30}),"이미지 추가",s.jsx("input",{type:"file",multiple:!0,accept:"image/*",onChange:V})]}):s.jsxs(m4,{children:[s.jsx("img",{src:co(m[b]),alt:"이미지 미리보기"}),s.jsx(x4,{onClick:ee,children:s.jsx(_m,{size:30})})]}),s.jsx(v4,{children:m.length>0&&b!==-1&&s.jsx(b4,{onClick:B,children:s.jsx(ed,{size:20})})})]}),s.jsx(j4,{children:m.length>0&&s.jsx(C4,{children:m.map((te,de)=>s.jsx("span",{className:b===de?"active":"",onClick:()=>ae(de)},de))})}),s.jsxs(S4,{children:[s.jsxs(P4,{children:[s.jsx(vo,{htmlFor:"urlInput",children:"URL 주소"}),s.jsx(E4,{id:"urlInput",type:"text",placeholder:"상품 관련 URL 주소를 입력해주세요.",value:P,onChange:he,$isError:R,spellCheck:!1})]}),R&&s.jsx(k4,{children:"올바른 URL을 입력해주세요."})]})]}),s.jsxs(R4,{children:[s.jsxs(A4,{children:[s.jsxs(oa,{children:[s.jsx(vo,{children:"제목"}),s.jsx(I4,{placeholder:"제목을 입력해주세요.",value:x,onChange:te=>g(te.target.value),spellCheck:!1})]}),s.jsx(O4,{children:s.jsx(_4,{title:"카테고리 선택",categories:nl,selectedCategory:i,onCategoryChange:te=>o(te)})})]}),s.jsxs(D4,{children:[s.jsxs(oa,{children:[s.jsx(vo,{children:"참여 필요 수량 선택"}),s.jsx(tf,{type:"text",placeholder:"수량 입력",value:a,onChange:$})]}),s.jsxs(oa,{children:[s.jsx(vo,{children:"모집 마감 기한 설정"}),s.jsxs(T4,{children:[s.jsxs(M4,{onClick:_,children:[h,s.jsx(_b,{})]}),p&&s.jsx(L4,{children:Array.from({length:7},(te,de)=>s.jsxs(N4,{onClick:()=>N(`${de+1}일 `),$isSelected:h===`${de+1}일 `,children:[de+1,"일"]},de))})]})]}),s.jsxs($4,{children:[s.jsxs(oa,{children:[s.jsx(vo,{children:"총 가격 설정"}),s.jsx(tf,{type:"text",placeholder:"총 가격 입력",value:c,onChange:X})," 원"]}),s.jsxs(oa,{children:[s.jsx(vo,{children:"개당 가격"}),s.jsx(tf,{disabled:!0,value:H})," 원"]})]})]})]})]}),s.jsx(F4,{children:s.jsx(z4,{placeholder:"내용을 입력해주세요.",value:S,onChange:te=>w(te.target.value),spellCheck:!1})}),s.jsxs(U4,{children:[s.jsx(k0,{onClick:F,children:"확인"}),s.jsx(k0,{onClick:ue,children:"취소"})]})]})]})})})},l4=u.div` + display: flex; + justify-content: center; + padding: 20px; +`,c4=u.div` + width: 100%; + max-width: 1120px; + margin: 0 auto; +`,u4=u.h1` + font-size: 1.8rem; + font-weight: bold; + margin-bottom: 1.5rem; + text-align: left; +`,d4=u.div` + display: flex; + flex-direction: column; /* 내부 요소를 세로로 정렬 */ + background: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +`,f4=u.div` + display: flex; /* 가로 정렬 */ + flex-direction: row; /* 기본값이므로 명시적으로 추가 */ + align-items: stretch; /* 양쪽 요소의 높이를 동일하게 */ + justify-content: center; /* 양쪽 여백 균등 배치 */ + gap: 20px; /* 두 컨테이너 사이 간격 */ + margin-bottom: 20px; /* 아래 요소와의 간격 */ +`,p4=u.div` + display: flex; + flex-direction: column; + align-items: center; + width: 490px; + height: 495px; /* 고정된 높이 설정 */ + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px 11px; + position: relative; + box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ +`,h4=u.div` + display: flex; + justify-content: space-between; /* 좌우 버튼 공간 확보 */ + align-items: center; /* 수직 중앙 정렬 */ + width: 100%; + height: 320px; /* 기준 높이 */ + position: relative; /* 자식 요소 위치 기준 */ + overflow: hidden; /* 높이를 벗어난 콘텐츠 숨김 */ +`,m4=u.div` + flex: 1; /* 이미지 영역이 버튼 사이에 위치 */ + display: flex; + align-items: center; + justify-content: center; + width: 400px; + height: 100%; + border: 1px solid #ccc; + border-radius: 10px; + overflow: hidden; /* 콘텐츠가 영역을 벗어나지 않도록 */ + + img { + max-width: 100%; /* 부모 너비를 넘지 않도록 */ + max-height: 100%; /* 부모 높이를 넘지 않도록 */ + object-fit: contain; /* 비율을 유지하며 부모 크기 안에 맞춤 */ + } +`,g4=u.label` + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: 1.2rem; + color: #555; + cursor: pointer; + border-radius: 10px; + width: 400px; /* img의 크기와 동일하게 설정 */ + height: 100%; /* img의 높이와 동일하게 설정 */ + background-color: #ececec; /* 요구된 배경색 추가 */ + + input { + display: none; + } +`,x4=u.button` + position: absolute; + top: 0px; + right: 45px; + background: none; + border: none; + padding: 8px; + cursor: pointer; + z-index: 1; +`,y4=u.div` + flex: 0 0 32px; /* 버튼 고정 너비 */ + display: flex; + justify-content: center; + align-items: center; + height: 100%; /* PreviewWrapper의 높이에 맞춤 */ +`,v4=u.div` + flex: 0 0 32px; /* 버튼 고정 너비 */ + display: flex; + justify-content: center; + align-items: center; + height: 100%; /* PreviewWrapper의 높이에 맞춤 */ +`,w4=u.button` + background: none; + border: none; + color: #333; + cursor: pointer; +`,b4=u.button` + background: none; + border: none; + color: #333; + cursor: pointer; +`,j4=u.div` + width: 100%; + height: 54px; /* 높이 설정 */ + display: flex; /* 플렉스 박스로 변경 */ + align-items: center; /* 세로 중앙 정렬 */ + justify-content: center; /* 가로 중앙 정렬 */ +`,C4=u.div` + display: flex; + justify-content: center; + gap: 5px; + + span { + width: 8px; + height: 8px; + border-radius: 50%; + background: #ddd; + cursor: pointer; + } + + span.active { + background: #000; + } +`,S4=u.div` + display: flex; + flex-direction: column; + align-items: flex-start; /* 세로로 가운데 정렬 */ + width: 100%; +`,P4=u.div` + margin-left: 20px; + display: flex; + align-items: center; /* Label과 Url을 같은 높이에 배치 */ + gap: 10px; /* Label과 Url 사이 간격 */ + padding: 10px; + border: none; +`,E4=u.input` + width: 285px; + flex: 1; + padding: 10px; + background-color: #ececec; + border: 1px solid ${({$isError:e})=>e?"red":"#ccc"}; + border-radius: 5px; +`,k4=u.span` + margin-left: 125px; + color: red; + font-size: 0.8rem; + margin-top: 5px; +`,R4=u.div` + display: flex; + flex-direction: column; /* 세로 정렬 */ + align-items: flex-start; /* 왼쪽 정렬 */ + width: 490px; + height: 495px; /* ImageUploadContainer와 동일한 고정 높이 */ + flex-grow: 1; /* 가로 공간을 균등 분배 */ + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px; + gap: 20px; + box-sizing: border-box; +`,A4=u.div` + display: flex; + flex-direction: column; /* 세로 정렬 */ + gap: 20px; /* 컴포넌트 간 간격 */ + width: 100%; +`,oa=u.div` + display: flex; + flex-direction: row; /* 가로 배치 */ + align-items: center; /* 세로 중앙 정렬 */ + gap: 10px; /* 컴포넌트 간 간격 */ + width: 100%; +`,vo=u.label` + font-size: 1.2rem; + font-weight: bold; + flex-shrink: 0; /* 라벨 크기를 고정 */ + text-align: left; /* 라벨 텍스트 왼쪽 정렬 */ +`,I4=u.input` + width: 80%; + padding: 10px; + background-color: #ececec; + border: 1px solid #ccc; + border-radius: 5px; +`,O4=u.div` + display: flex; + justify-content: flex-start; +`,_4=u(nd)` + display: flex; + margin-left: 50px; + flex-wrap: wrap; + gap: 8px; + padding: 10px 0; + + div { + padding: 12px !important; /* 강제로 적용 */ + flex: 1 1 calc(25% - 8px); + box-sizing: border-box; + + &:hover { + background-color: #f0f0f0 !important; /* 호버 스타일도 강제 */ + } + + &.active { + font-weight: bold !important; /* 활성 상태 스타일 강제 */ + border-bottom: 2px solid black !important; + } + } +`,D4=u.div` + display: flex; + flex-direction: column; /* 세로 정렬 */ + gap: 20px; /* 컴포넌트 간 간격 */ + width: 100%; +`,tf=u.input` + width: 100px; + padding: 10px 0px; + text-align: center; + background-color: #ececec; + border: 1px solid #ccc; + border-radius: 5px; +`,T4=u.div` + position: relative; +`,M4=u.button` + width: 120px; + padding: 10px; + border: 1px solid #ccc; + border-radius: 5px; + font-weight: bold; + display: flex; + gap: 10px; + justify-content: center; + align-items: center; + box-sizing: border-box; +`,L4=u.div` + position: absolute; + width: 120px; + top: 100%; + left: 0; + right: 0; + font-size: 0.9rem; + border: 1px solid #ccc; + border-radius: 5px; + background: #fff; + z-index: 1000; + box-sizing: border-box; +`,N4=u.div` + padding: 10px; + text-align: center; + cursor: pointer; + background: ${({$isSelected:e})=>e?"#f0f0f0":"#fff"}; + font-weight: ${({$isSelected:e})=>e?"bold":"normal"}; + + &:hover { + background: #eaeaea; + } +`,$4=u.div` + display: flex; + flex-direction: row; /* 가로 배치 */ + gap: 20px; /* 두 요소 간 간격 */ + width: 100%; /* 부모 컨테이너에 맞게 확장 */ + align-items: center; /* 세로 중앙 정렬 */ +`,F4=u.div` + width: 100%; /* Wrapper 크기는 기존 유지 */ + max-width: 1100px; + margin: 0 auto; + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px; /* 내부 여백 */ + margin-bottom: 20px; + box-sizing: border-box; +`,z4=u.textarea` + width: 100%; + height: 460px; /* 고정된 높이 */ + background-color: #ececec; + border: none; /* 테두리 제거 */ + border-radius: 10px; + padding: 20px; + outline: none; /* 포커스 시 외곽선 제거 */ + resize: none; /* 크기 조절 비활성화 */ + font-size: 1rem; /* 텍스트 크기 */ + line-height: 1.5; + color: #333; /* 텍스트 색상 */ + box-sizing: border-box; +`,U4=u.div` + display: flex; + justify-content: flex-end; + gap: 10px; +`,k0=u.button` + padding: 10px 20px; + background: #000; + color: #fff; + border: 1px solid #000; + border-radius: 5px; + cursor: pointer; + + &:hover { + background: #333; + } +`,Yb=Rt(null);var Hn=(e=>(e.NOT_APPROVED="NOT_APPROVED",e.APPROVED="APPROVED",e.PAYMENT_STANDBY="PAYMENT_STANDBY",e.PAYMENT_COMPLETED="PAYMENT_COMPLETED",e.REJECTED="REJECTED",e.DELETED="DELETED",e))(Hn||{});const B4=({selectedPost:e,currentIndex:t,setCurrentIndex:n})=>{if(!e)return null;const r=()=>{n(a=>(a+1)%e.imageUrls.length)},i=()=>{n(a=>(a-1+e.imageUrls.length)%e.imageUrls.length)},o=a=>{n(a)};return s.jsxs(W4,{children:[s.jsxs(H4,{children:[s.jsx(V4,{children:e.imageUrls.length>1&&t>0&&s.jsx(G4,{onClick:i,children:s.jsx(Zu,{size:20})})}),s.jsx(Q4,{children:s.jsx("img",{src:co(e.imageUrls[t]),alt:`이미지 ${t+1}`})}),s.jsx(K4,{children:e.imageUrls.length>1&&t1&&s.jsx(Y4,{children:e.imageUrls.map((a,l)=>s.jsx("span",{className:t===l?"active":"",onClick:()=>o(l)},l))})}),s.jsx(X4,{children:s.jsxs(Z4,{children:[s.jsx(tI,{htmlFor:"urlInput",children:"URL 주소"}),s.jsx(eI,{children:e.productUrl})]})})]})},W4=u.div` + display: flex; + flex-direction: column; + align-items: center; + width: 490px; + height: 470px; + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px 11px; + position: relative; + box-sizing: border-box; +`,H4=u.div` + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; + height: 320px; + position: relative; + overflow: hidden; +`,Q4=u.div` + flex: 1; + display: flex; + align-items: center; + justify-content: center; + width: 400px; + height: 100%; + border: 1px solid #ccc; + border-radius: 10px; + overflow: hidden; + + img { + max-width: 100%; + max-height: 100%; + object-fit: contain; + } +`,V4=u.div` + flex: 0 0 32px; + display: flex; + justify-content: center; + align-items: center; + height: 100%; +`,K4=u.div` + flex: 0 0 32px; + display: flex; + justify-content: center; + align-items: center; + height: 100%; +`,G4=u.button` + background: none; + border: none; + color: #333; + cursor: pointer; +`,q4=u.button` + background: none; + border: none; + color: #333; + cursor: pointer; +`,J4=u.div` + width: 100%; + height: 54px; + display: flex; + align-items: center; + justify-content: center; +`,Y4=u.div` + display: flex; + justify-content: center; + gap: 5px; + + span { + width: 8px; + height: 8px; + border-radius: 50%; + background: #ddd; + cursor: pointer; + } + + span.active { + background: #000; + } +`,X4=u.div` + display: flex; + flex-direction: column; + align-items: flex-start; /* 세로로 가운데 정렬 */ + width: 100%; +`,Z4=u.div` + margin-left: 20px; + display: flex; + align-items: center; /* Label과 Url을 같은 높이에 배치 */ + gap: 10px; /* Label과 Url 사이 간격 */ + padding: 10px; + border: none; +`,eI=u.div` + width: 285px; + flex: 1; + padding: 10px; + border: none; + border-radius: 5px; +`,tI=u.label` + font-size: 1.2rem; + font-weight: bold; + margin-bottom: 4px; /* Label과 텍스트 사이 간격 */ +`,nI=({selectedPost:e,realTimeData:t,quantity:n,isParticipant:r,isNotParticipant:i,remainingTime:o,paymentRemainingTime:a,handleQuantityChange:l,handleJoin:c,handleCancel:d,handleRefund:p,handlePayment:f})=>e?s.jsxs(rI,{children:[s.jsxs(iI,{children:[s.jsxs(fI,{children:[s.jsxs(Zn,{children:[s.jsx(xn,{children:"제목"}),s.jsx(R0,{children:e.title})]}),s.jsxs(oI,{children:[s.jsx(xn,{children:"작성자"}),s.jsx(sI,{children:e.nickname})]}),s.jsxs(Zn,{children:[s.jsx(xn,{children:"참여 현황"})," ",(t==null?void 0:t.participationCount)||0," / ",e.availableNumber]}),s.jsxs(Zn,{children:[s.jsx(xn,{children:"개당 가격"})," ",e.unitAmount.toLocaleString()," ","원"]}),s.jsxs(Zn,{children:[s.jsx(xn,{children:"총 가격"})," ",e.totalAmount.toLocaleString()," ","원"]}),s.jsxs(Zn,{children:[s.jsx(xn,{children:"수량"}),s.jsxs(cI,{children:[i&&s.jsxs(s.Fragment,{children:[s.jsx(_m,{onClick:()=>l(-1)}),s.jsx("span",{children:n}),s.jsx(Dm,{onClick:()=>l(1)})]}),r&&s.jsx("span",{children:n})]})]})]}),s.jsxs(pI,{children:[s.jsxs(lI,{children:[s.jsx(xn,{children:"작성일"}),s.jsx(aI,{children:tl(e.createdAt).toLocaleString()})]}),s.jsxs(Zn,{children:[s.jsx(xn,{children:"카테고리"})," ",e.category]}),s.jsxs(Zn,{children:[s.jsx(xn,{children:"모집 마감"})," ",o]}),e.status==="PAYMENT_STANDBY"&&s.jsxs(Zn,{children:[s.jsx(xn,{children:"결제 마감"}),s.jsx(R0,{children:a})]}),r&&s.jsxs(Zn,{children:[s.jsx(xn,{children:"결제 금액"}),s.jsxs(uI,{children:[(n*e.unitAmount).toLocaleString()," 원"]})]})]})]}),s.jsx(hI,{children:s.jsx(dI,{children:e.status===Hn.PAYMENT_COMPLETED?s.jsx(sa,{primary:!0,onClick:p,children:"환불"}):e.status===Hn.PAYMENT_STANDBY?s.jsx(s.Fragment,{children:r&&s.jsxs(s.Fragment,{children:[s.jsx(sa,{primary:!0,onClick:f,children:"결제"}),s.jsx(sa,{onClick:d,children:"취소"})]})}):e.status===Hn.APPROVED?s.jsx(s.Fragment,{children:i?s.jsx(sa,{primary:!0,onClick:c,children:"참여"}):s.jsx(sa,{onClick:d,children:"취소"})}):null})})]}):null,rI=u.div` + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: space-between; + width: 490px; + max-width: 490px; + height: 470px; + flex-grow: 1; + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px; + box-sizing: border-box; +`,iI=u.div` + display: flex; + gap: 20px; + width: 100%; +`,Zn=u.div` + display: flex; + flex-direction: column; + margin-right: 50px; + font-size: 1rem; +`,xn=u.label` + font-size: 1.2rem; + font-weight: bold; + margin-bottom: 4px; +`,R0=u.span` + color: #333; +`,oI=u.div` + display: flex; + flex-direction: column; +`,sI=u.div` + font-size: 1rem; +`,aI=u.div` + font-size: 1rem; +`,lI=u.div` + display: flex; + flex-direction: column; + margin-right: 50px; +`,cI=u.div` + display: flex; + gap: 10px; + align-items: center; + + svg { + cursor: pointer; + } +`,uI=u.div` + color: #333; +`,dI=u.div` + display: flex; + gap: 10px; +`,sa=u.button` + padding: 10px 20px; + background: ${e=>e.primary?"#000":"#fff"}; + color: ${e=>e.primary?"#fff":"#000"}; + border: 1px solid #000; + border-radius: 5px; + cursor: pointer; +`,fI=u.div` + display: flex; + flex-direction: column; + gap: 20px; + width: 100%; +`,pI=u.div` + display: flex; + flex-direction: column; + gap: 20px; + width: 100%; +`,hI=u.div` + display: flex; + justify-content: flex-end; + width: 100%; +`,mI=({communityPostId:e,comments:t})=>{const n=Ns(),[r]=$t(Yb),[i,o]=C.useState(""),[a,l]=C.useState(null),[c,d]=C.useState(""),p=["postDetail",e],f=Gi({mutationFn:()=>S3(e,(r==null?void 0:r.id)||0,(r==null?void 0:r.nickname)||"",i),onSuccess:()=>{n.invalidateQueries({queryKey:p}),o("")},onError:()=>{alert("댓글 작성에 실패했습니다.")}}),h=()=>{if(!i.trim()){alert("댓글 내용을 입력해주세요.");return}f.mutate()},j=Gi({mutationFn:m=>P3(e,m),onSuccess:()=>{n.invalidateQueries({queryKey:p})},onError:()=>{alert("댓글 삭제에 실패했습니다.")}}),x=m=>{window.confirm("이 댓글을 삭제하시겠습니까?")&&j.mutate(m)},g=(m,v)=>{l(m),d(v)},S=Gi({mutationFn:()=>E3(e,a,c),onSuccess:()=>{n.invalidateQueries({queryKey:p}),l(null),d("")},onError:()=>{alert("댓글 수정에 실패했습니다.")}}),w=()=>{if(!c.trim()){alert("수정할 댓글 내용을 입력하세요.");return}if(c.length>300){alert("댓글은 최대 300자까지만 입력 가능합니다.");return}S.mutate()};return s.jsxs(gI,{children:[s.jsx(xI,{children:"댓글"}),s.jsxs(yI,{children:[t.map(m=>s.jsxs(vI,{children:[s.jsxs(wI,{children:[s.jsx(bI,{children:m.userNickname}),s.jsx(jI,{children:tl(m.createdAt).toLocaleString()})]}),a===m.commentId?s.jsxs(SI,{children:[s.jsx(PI,{value:c,onChange:v=>d(v.target.value)}),s.jsxs(I0,{children:[s.jsxs(A0,{overLimit:c.length>300,children:["(",c.length,"/300)"]}),s.jsx(oc,{onClick:w,children:"확인"}),s.jsx(oc,{onClick:()=>l(null),children:"취소"})]})]}):s.jsxs(s.Fragment,{children:[s.jsx(CI,{children:m.content}),m.userId===(r==null?void 0:r.id)&&s.jsxs(EI,{children:[s.jsx(oc,{onClick:()=>g(m.commentId,m.content),children:"수정"}),s.jsx(oc,{onClick:()=>x(m.commentId),children:"삭제"})]})]})]},m.commentId)),s.jsxs(kI,{children:[s.jsx(RI,{value:i,onChange:m=>o(m.target.value),placeholder:"댓글을 입력하세요.",maxLength:300}),s.jsxs(I0,{children:[s.jsxs(A0,{overLimit:i.length>300,children:["(",i.length,"/300)"]}),s.jsx(AI,{onClick:h,children:"작성"})]})]})]})]})},gI=u.div` + width: 100%; + margin-top: 20px; + border: 1px solid #ddd; + border-radius: 10px; + padding: 20px; +`,xI=u.h3` + font-size: 1.5rem; + font-weight: bold; + margin-bottom: 20px; +`,yI=u.ul` + list-style: none; + padding: 0; + margin: 0; +`,vI=u.li` + margin-bottom: 15px; + padding: 10px; + border: 1px solid #ddd; + border-radius: 8px; + display: flex; + flex-direction: column; +`,wI=u.div` + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 10px; +`,bI=u.div` + font-weight: bold; +`,jI=u.div` + font-size: 0.9rem; + color: #666; +`,CI=u.p` + margin: 0; + font-size: 1rem; +`,SI=u.div` + display: flex; + flex-direction: column; + gap: 10px; +`,A0=u.span` + font-size: 0.9rem; + color: ${e=>e.overLimit?"red":"#666"}; /* 300자를 초과하면 빨간색 */ + margin-right: 10px; /* 버튼과 간격 */ +`,PI=u.textarea` + width: 100%; + padding: 10px; + border: 1px solid #ddd; + border-radius: 8px; + resize: none; +`,EI=u.div` + display: flex; + justify-content: flex-end; + gap: 10px; + margin-top: 10px; +`,kI=u.div` + display: flex; + gap: 10px; + margin-top: 20px; +`,RI=u.textarea` + flex: 1; + padding: 10px; + border: 1px solid #ddd; + border-radius: 8px; + resize: none; +`,oc=u.button` + padding: 10px 20px; + background: #000; + color: #fff; + border: none; + border-radius: 5px; + cursor: pointer; +`,AI=u.button` + padding: 10px 20px; + background: #000; + color: #fff; + border: 1px solid #000; + border-radius: 5px; + cursor: pointer; + align-self: flex-end; /* 오른쪽 정렬 */ +`,I0=u.div` + display: flex; + gap: 10px; + justify-content: flex-end; + align-items: center; + margin-top: 10px; +`,Xb=Rt(null),II=({communityPostId:e})=>{const[,t]=$t(Xb),n=Ns(),r=["postDetail",e];return C.useEffect(()=>{const i=new EventSource(`/api/community/post/${e}/participants`);return i.onmessage=o=>{const a=JSON.parse(o.data);t(l=>({...l,participants:a.participants,participationCount:a.participationCount,postStatus:a.postStatus,paymentCount:a.paymentCount,refundedCount:a.refundedCount,participationStatus:a.participationStatus})),n.invalidateQueries({queryKey:r})},i.onerror=()=>{i.close()},()=>{i.close()}},[e,n,t]),null},Zb=C.createContext(null),OI=({children:e})=>{const[t,n]=C.useState(!1),[r,i]=C.useState(!1),o=()=>{const c=localStorage.getItem("token"),d=localStorage.getItem("role");n(!!c),i(d==="ROLE_ADMIN")};C.useEffect(()=>{o()},[t]);const a=()=>{n(!0);const c=localStorage.getItem("role");i(c==="ROLE_ADMIN")},l=()=>{localStorage.removeItem("role"),localStorage.removeItem("token"),n(!1),i(!1)};return s.jsx(Zb.Provider,{value:{isLoggedIn:t,isAdmin:r,login:a,logout:l},children:e})},zs=()=>{const e=C.useContext(Zb);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e},_I=()=>{const[e]=$t(Xb),{isAdmin:t}=zs();return t?!e||!e.participants.length?s.jsx("div",{children:"참여자 데이터가 없습니다."}):s.jsxs("div",{children:[s.jsx("h2",{children:"참여자 목록 (관리자 전용)"}),s.jsx("ul",{children:e.participants.map(n=>s.jsx("li",{children:s.jsxs("p",{children:["닉네임: ",n.nickname," | 수량: ",n.quantity," |"," ",n.isCancelled?"취소됨":"참여 중"," |"," ",n.isPaymentCompleted?"결제 완료":"결제 대기"," |"," "]})},n.userId))}),s.jsxs("p",{children:["참여 인원: ",e.participationCount]}),s.jsxs("p",{children:["결제 완료 인원: ",e.paymentCount]}),s.jsxs("p",{children:["환불 완료 인원: ",e.refundedCount]})]}):null},DI=()=>{var ee;const{communityPostId:e}=ao(),t=Ie(),n=Ns(),{isAdmin:r}=zs(),[i,o]=C.useState(null),[a,l]=C.useState(null),[c,d]=$t(td),[,p]=$t(si),[f]=$t(Yb),[h]=$t(R3),[j,x]=C.useState(1),[g,S]=C.useState(""),[w,m]=C.useState(""),[v,b]=C.useState(0),E=Number(e),P=["postDetail",E];C.useEffect(()=>{E?p(E):t("/community/post")},[E,p,t]),C.useEffect(()=>{e&&(async()=>{try{const Q=await Sl(Number(e));l(Q),o(Q.communityPost)}catch{t("*")}})()},[e,t]),C.useEffect(()=>{if(a){const B=a.participationStatus==="JOIN"||a.participationStatus==="PAYMENT_STANDBY"?h??1:1;x(B)}},[a,h]);const k=(c==null?void 0:c.participationStatus)==="JOIN"||(c==null?void 0:c.participationStatus)==="PAYMENT_STANDBY",R=!(c!=null&&c.participationStatus),I=(i==null?void 0:i.userId)===(f==null?void 0:f.id);C.useEffect(()=>{if(E){const B=new EventSource(`/api/community/post/${E}/participants`);return B.onmessage=Q=>{const ae=JSON.parse(Q.data);d(ae),n.invalidateQueries({queryKey:P})},B.onerror=()=>{B.close()},()=>B.close()}},[E,n,d]),C.useEffect(()=>{if(i!=null&&i.closeAt){const B=()=>{const le=new Date(i.closeAt||"").getTime()+9*24*60*60*1e3,he=Date.now(),me=le-he;if(me<=0)return"마감되었습니다.";const te=Math.floor(me/(1e3*60*60*24)),de=Math.floor(me%(1e3*60*60*24)/(1e3*60*60)),Ce=Math.floor(me%(1e3*60*60)/(1e3*60));return`${te}일 ${de}시간 ${Ce}분 남음`};S(B());const Q=setInterval(()=>{S(B())},6e4);return()=>clearInterval(Q)}},[i==null?void 0:i.createdAt,i==null?void 0:i.period]),C.useEffect(()=>{if((i==null?void 0:i.status)===Hn.PAYMENT_STANDBY&&(i!=null&&i.paymentDeadline)){const B=()=>{const le=new Date(i.paymentDeadline||"").getTime()+12*60*60*1e3,he=Date.now(),me=le-he;if(me<=0)return"결제 마감되었습니다.";const te=Math.floor(me/(1e3*60*60)),de=Math.floor(me%(1e3*60*60)/(1e3*60)),Ce=Math.floor(me%(1e3*60)/1e3);return`${te}시간 ${de}분 ${Ce}초 남음`};m(B());const Q=setInterval(()=>{m(B())},1e3);return()=>clearInterval(Q)}},[i==null?void 0:i.status,i==null?void 0:i.paymentDeadline]);const D=Gi({mutationFn:qb,onSuccess:()=>{n.invalidateQueries({queryKey:P}),alert("게시물이 삭제되었습니다."),t("/community/post")},onError:()=>{alert("게시물 삭제에 실패했습니다.")}}),_=()=>{window.confirm("정말 이 게시물을 삭제하시겠습니까?")&&(Si(E),D.mutate(E))},{mutate:N}=Gi({mutationFn:({communityPostId:B,quantity:Q})=>j3(B,Q),onSuccess:()=>{alert("공구 참여가 완료되었습니다."),n.invalidateQueries({queryKey:P})},onError:()=>{alert("공구 참여에 실패했습니다.")}}),F=()=>{if(!j){alert("수량을 입력해주세요.");return}Si(E),N({communityPostId:E,quantity:j},{onSuccess:()=>{d(B=>{const Q=B!=null&&B.participants?[...B.participants.filter(ae=>ae.userId!==(f==null?void 0:f.id)),{userId:(f==null?void 0:f.id)||0,nickname:(f==null?void 0:f.nickname)||"",isCancelled:!1,isPaymentCompleted:!1,quantity:j}]:[{userId:(f==null?void 0:f.id)||0,nickname:(f==null?void 0:f.nickname)||"",isCancelled:!1,isPaymentCompleted:!1,quantity:j}];return{...B,participants:Q,participationCount:Q.length,postStatus:(B==null?void 0:B.postStatus)||Hn.APPROVED,paymentCount:(B==null?void 0:B.paymentCount)||0,participationStatus:"JOIN"}}),alert("공구 참여가 완료되었습니다."),n.invalidateQueries({queryKey:P})},onError:()=>{alert("공구 참여에 실패했습니다.")}})};C.useEffect(()=>{(a==null?void 0:a.participationStatus)==="JOIN"&&h!==null&&x(h)},[a==null?void 0:a.participationStatus,h]);const $=Gi({mutationFn:()=>C3(E),onSuccess:()=>{n.invalidateQueries({queryKey:P}),alert("참여가 취소되었습니다.")},onError:()=>{alert("참여 취소에 실패했습니다.")}}),X=()=>{Si(E),$.mutate(void 0,{onSuccess:()=>{d(B=>{var ae;const Q=(ae=B==null?void 0:B.participants)==null?void 0:ae.map(le=>le.userId===(f==null?void 0:f.id)?{...le,isCancelled:!0}:le);return{...B,participants:Q,participationCount:Q==null?void 0:Q.filter(le=>!le.isCancelled).length,postStatus:(B==null?void 0:B.postStatus)||Hn.APPROVED,paymentCount:(B==null?void 0:B.paymentCount)||0}}),alert("참여가 취소되었습니다.")},onError:()=>{alert("참여 취소에 실패했습니다.")}})},ue=()=>{t(`/community/post/${e}/report`)},oe=B=>{const Q=j+B,ae=(i==null?void 0:i.availableNumber)||0;Q>0&&Q<=ae?x(Q):alert("유효한 수량을 입력하세요.")},H=()=>{if(Si(E),(a==null?void 0:a.participationStatus)!==Hn.PAYMENT_STANDBY){alert("현재 결제할 수 없는 상태입니다.");return}const B={post:{title:i==null?void 0:i.title,unitAmount:i==null?void 0:i.unitAmount,imageUrls:i==null?void 0:i.imageUrls},quantity:j};d(Q=>{var le;const ae=(le=Q==null?void 0:Q.participants)==null?void 0:le.map(he=>he.userId===(f==null?void 0:f.id)?{...he,isPaymentCompleted:!0}:he);return{...Q,participants:ae,paymentCount:ae==null?void 0:ae.filter(he=>he.isPaymentCompleted).length,postStatus:(Q==null?void 0:Q.postStatus)||Hn.PAYMENT_COMPLETED,participationCount:(ae==null?void 0:ae.length)||0}}),I?t(`/community/post/${e}/payment/author`,{state:B}):t(`/community/post/${e}/payment/participant`,{state:B})},V=()=>{if(Si(E),(a==null?void 0:a.participationStatus)==="PAYMENT_COMPLETE"){const B={post:{title:i==null?void 0:i.title,unitAmount:i==null?void 0:i.unitAmount},quantity:j};d(Q=>{var le;const ae=(le=Q==null?void 0:Q.participants)==null?void 0:le.map(he=>he.userId===(f==null?void 0:f.id)?{...he,isPaymentCompleted:!1}:he);return{...Q,participants:ae,paymentCount:ae==null?void 0:ae.filter(he=>he.isPaymentCompleted).length,postStatus:(Q==null?void 0:Q.postStatus)||Hn.APPROVED,participationCount:(ae==null?void 0:ae.length)||0}}),I?t(`/community/post/${e}/refund/author`,{state:B}):t(`/community/post/${e}/refund/participant`,{state:B})}else alert("환불 요청이 불가능한 상태입니다.")};return i?!a||!i?s.jsx("div",{children:"로딩 중입니다..."}):s.jsx(TI,{children:s.jsxs(MI,{children:[s.jsxs(LI,{children:[s.jsx(zI,{children:"공구 모집 및 진행"}),s.jsxs(NI,{children:[s.jsx($I,{onClick:()=>t(-1),children:s.jsx(Om,{size:24})}),s.jsx(FI,{children:I?R?s.jsx(O0,{onClick:_,children:"글 삭제"}):"":s.jsx(O0,{onClick:ue,children:"글 신고"})})]})]}),s.jsxs(UI,{children:[s.jsxs(BI,{children:[s.jsx(B4,{selectedPost:{imageUrls:(i==null?void 0:i.imageUrls)||[],productUrl:(i==null?void 0:i.productUrl)||""},currentIndex:v,setCurrentIndex:b}),s.jsx(nI,{selectedPost:i,realTimeData:c,quantity:j,isParticipant:k,isNotParticipant:R,remainingTime:g,paymentRemainingTime:w,handleQuantityChange:oe,handleJoin:F,handleCancel:X,handleRefund:V,handlePayment:H})]}),s.jsx(WI,{children:s.jsx(HI,{readOnly:!0,value:(i==null?void 0:i.description)||""})}),s.jsx(mI,{communityPostId:E,comments:((ee=i==null?void 0:i.comments)==null?void 0:ee.map(B=>({...B,commentId:Number(B.commentId)})))||[]})]}),r&&(c==null?void 0:c.participants)&&s.jsxs(s.Fragment,{children:[s.jsx(II,{communityPostId:E}),s.jsx(_I,{})]})]})}):s.jsx("div",{children:"게시물이 없습니다."})},TI=u.div` + display: flex; + justify-content: center; + padding: 20px; +`,MI=u.div` + width: 100%; + max-width: 1120px; + margin: 0 auto; +`,LI=u.div` + display: flex; + flex-direction: column; /* Title과 HeaderWrapper를 세로로 배치 */ + gap: 10px; /* Title과 HeaderWrapper 사이 간격 */ + margin-bottom: 1.5rem; +`,NI=u.div` + width: 1000px; + margin: 30px auto 0; + display: flex; + justify-content: space-between; + align-items: center; +`,$I=u.button` + background: none; + border: none; + cursor: pointer; +`,FI=u.div` + display: flex; + gap: 10px; +`,O0=u.button` + padding: 10px 15px; + background: #000; + color: #fff; + border: 1px solid #000; + border-radius: 5px; + cursor: pointer; +`,zI=u.h1` + font-size: 1.8rem; + font-weight: bold; + text-align: left; + margin: 0; /* Title의 기본 마진 제거 */ +`,UI=u.div` + display: flex; + flex-direction: column; + background: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +`,BI=u.div` + display: flex; /* 가로 정렬 */ + flex-direction: row; /* 기본값이므로 명시적으로 추가 */ + align-items: stretch; /* 양쪽 요소의 높이를 동일하게 */ + justify-content: center; /* 양쪽 여백 균등 배치 */ + gap: 20px; /* 두 컨테이너 사이 간격 */ + margin-bottom: 20px; /* 아래 요소와의 간격 */ +`,WI=u.div` + width: 100%; + max-width: 1000px; + margin: 0 auto; + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px; + margin-bottom: 20px; + box-sizing: border-box; +`,HI=u.textarea` + width: 100%; + height: 460px; /* 고정된 높이 */ + border: none; /* 테두리 제거 */ + border-radius: 10px; + padding: 20px; + outline: none; /* 포커스 시 외곽선 제거 */ + resize: none; /* 크기 조절 비활성화 */ + font-size: 1rem; /* 텍스트 크기 */ + line-height: 1.5; + color: #333; /* 텍스트 색상 */ + box-sizing: border-box; +`,QI="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAATCAYAAACKsM07AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAD8SURBVHgBtZXtDcIgEIZfSP/bEToCG8gIdYK6ihu4gSMYJ5BuUCeoG6gT4F0osSX9SKE+yZuWAncH1wNhrT0CqPDjIIR4YyMkKe+1NanEv6DVvEhnbEgWtBtSRU522IZb6KCG2yaNdArSZ/CFItfWkZQHmq+8HRn0Nd1TIw0d2Bt4v7OQAM2/klp+lyP9DxIvMUc8qrMz6sDA1YZCBBRYAZdgM+fARxGDCuyMRtHG5oELlQvWt+XEuBrxK9ij9/dkE4MMXEXzsbH24OPATrMjOFE2Hj7Pllff5eGCRLKZPs5DSU5qrIO31CzeKXwR2Xi0tyMWnBSIgKJ/+vcviL7xJoSwybgAAAAASUVORK5CYII=",VI="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA5MDAgNDAwIiBzdHlsZT0iYmFja2dyb3VuZC1jb2xvcjogd2hpdGU7Ij4NCiAgPGcgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMTAwLCA1MCkiPg0KICAgIDxjaXJjbGUgY3g9IjE1MCIgY3k9IjEyMCIgcj0iNTAiIGZpbGw9IiM0MkE1RjUiIG9wYWNpdHk9IjAuMyIvPg0KICAgIDxjaXJjbGUgY3g9IjI1MCIgY3k9IjEyMCIgcj0iNTAiIGZpbGw9IiM2NEI1RjYiIG9wYWNpdHk9IjAuMyIvPg0KICAgIDxjaXJjbGUgY3g9IjIwMCIgY3k9IjIyMCIgcj0iNTAiIGZpbGw9IiMyMTk2RjMiIG9wYWNpdHk9IjAuMyIvPg0KICAgIA0KICAgIDxwYXRoIGQ9Ik0xNTAsMTIwIEwyNTAsMTIwIE0yMDAsMjIwIEwxNTAsMTIwIE0yMDAsMjIwIEwyNTAsMTIwIiANCiAgICAgICAgICBzdHJva2U9IiMxRTg4RTUiIA0KICAgICAgICAgIHN0cm9rZS13aWR0aD0iNCIgDQogICAgICAgICAgc3Ryb2tlLWRhc2hhcnJheT0iMTAsMTAiLz4NCiAgICANCiAgICA8dGV4dCB4PSIzNTAiIHk9IjIwMCIgDQogICAgICAgICAgZm9udC1mYW1pbHk9IkFyaWFsIEJsYWNrLCBzYW5zLXNlcmlmIiANCiAgICAgICAgICBmb250LXNpemU9IjcwIiANCiAgICAgICAgICBmb250LXdlaWdodD0iOTAwIj4NCiAgICAgIDx0c3BhbiB4PSIyNTAiIGR5PSItMjAiIGZpbGw9IiMxNTY1QzAiPkdvb2Q8L3RzcGFuPg0KICAgICAgPHRzcGFuIHg9IjMwMCIgZHk9IjcwIiBmaWxsPSIjMjE5NkYzIj5CdXlVczwvdHNwYW4+DQogICAgPC90ZXh0Pg0KICA8L2c+DQo8L3N2Zz4=",KI="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='30px'%20viewBox='0%20-960%20960%20960'%20width='30px'%20fill='%23434343'%3e%3cpath%20d='M144-264v-72h672v72H144Zm0-180v-72h672v72H144Zm0-180v-72h672v72H144Z'/%3e%3c/svg%3e",GI=()=>{const{isLoggedIn:e,isAdmin:t,logout:n}=zs(),[r,i]=C.useState(!1),o=()=>{i(!r)};return s.jsx(qI,{children:s.jsxs(JI,{children:[s.jsx(YI,{children:s.jsx(Gn,{to:"/",children:s.jsx("img",{src:VI,alt:"로고"})})}),s.jsx(XI,{onClick:o,children:s.jsx("img",{src:KI,alt:"메뉴버튼"})}),s.jsx(ZI,{$isOpen:r,children:s.jsxs(eO,{children:[s.jsx(aa,{children:s.jsx(jr,{to:"/",onClick:o,children:"Home"})}),s.jsx(aa,{children:s.jsx(jr,{to:"/products",onClick:o,children:"Products"})}),s.jsx(aa,{children:s.jsx(jr,{to:"/mypage/notification",onClick:o,children:"Notifications"})}),s.jsx(aa,{children:s.jsx(jr,{to:"/community/post",onClick:o,children:"Community"})}),s.jsxs(aa,{children:[e&&s.jsx(jr,{to:t?"#":"/mypage/setting",onClick:a=>{t?a.preventDefault():o()},children:t?"Admin Page":"My Page"}),t&&s.jsxs(hh,{children:[s.jsx(_0,{children:s.jsx(jr,{to:"/admin/post",children:"Post Management"})}),s.jsx(_0,{children:s.jsx(jr,{to:"/admin/chatlist",children:"Chat Management"})})]})]}),e?s.jsxs(s.Fragment,{children:[s.jsx(D0,{onClick:n,children:s.jsx("a",{children:"LogOut"})}),s.jsx(D0,{children:s.jsx(nO,{children:s.jsx(jr,{to:"/mypage/wishlist",onClick:o,children:s.jsx("img",{src:QI,alt:"장바구니 아이콘"})})})})]}):s.jsx(tO,{children:s.jsx(Gn,{to:"/signin",onClick:o,children:"Login"})})," "]})})]})})},qI=u.header` + display: flex; + align-items: center; + justify-content: space-between; + padding: 10px 20px; + position: relative; +`,JI=u.div` + display: flex; + align-items: center; + justify-content: space-between; + width: 100%; + max-width: 1120px; + margin-left: auto; + margin-right: auto; + position: relative; +`,YI=u.div` + img { + margin-top: -10%; + margin-left: -25%; + height: auto; + width: 250px; + } + + @media (min-width: 576px) and (max-width: 767px) { + img { + margin-top: 0; + margin-left: 0; + width: 150px; + } + } +`,XI=u.button` + display: none; + + @media (min-width: 576px) and (max-width: 767px) { + display: block; + background: none; + border: none; + cursor: pointer; + position: absolute; + right: 0; + top: 50%; + transform: translateY(-50%); + z-index: 20; + } +`,ZI=u.nav` + display: flex; + justify-content: flex-end; + flex-grow: 1; + + @media (min-width: 576px) and (max-width: 767px) { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100vh; + background-color: white; + z-index: 10; + display: ${({$isOpen:e})=>e?"flex":"none"}; + align-items: center; + justify-content: center; + } +`,eO=u.ul` + display: flex; + list-style: none; + gap: 10px; + margin: 0; + padding: 0; + align-items: center; + + @media (min-width: 576px) and (max-width: 767px) { + flex-direction: column; + gap: 20px; + width: 100%; + align-items: center; + } +`,hh=u.ul` + display: none; + position: absolute; + top: 100%; + left: 0; + background: white; + border: 1px solid #ccc; + border-radius: 8px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + list-style: none; + padding: 5px 0; + margin: 0; + z-index: 1000; + + @media (min-width: 576px) and (max-width: 767px) { + position: static; + box-shadow: none; + border: none; + padding: 0; + background: transparent; + } +`,_0=u.li` + padding: 8px 12px; + + a { + text-decoration: none; + color: black; + display: block; + } + + &:hover { + background: #f4f4f4; + } + + @media (min-width: 576px) and (max-width: 767px) { + padding: 10px; + text-align: center; + } +`,aa=u.li` + margin: 0; + position: relative; + a { + display: block; + padding-bottom: 15px; + text-decoration: none; + color: #000; + font-weight: bold; + border-radius: 5px; + } + &:hover > ${hh} { + display: block; + } + &:hover { + background-color: #f4f4f4; + border-radius: 8px; + } + + @media (min-width: 576px) and (max-width: 767px) { + width: 100%; + text-align: center; + &:hover > ${hh} { + display: flex; + flex-direction: column; + align-items: center; + gap: 10px; + } + a { + padding: 10px; + width: 100%; + } + } +`,tO=u.li` + background-color: black; + height: 30px; + width: 70px; + border-radius: 5px; + overflow: hidden; + + a { + color: white; + text-decoration: none; + display: block; + text-align: center; + margin-top: 5px; + font-weight: bold; + } + + &:hover { + background-color: #333; + } + + @media (min-width: 576px) and (max-width: 767px) { + width: 130px; + height: 40px; + margin-left: 10px; + a { + margin-top: 10px; + font-size: 16px; + } + } +`,D0=u.li` + background-color: black; + height: 30px; + border-radius: 5px; + overflow: hidden; + display: inline-flex; + align-items: center; + padding: 0px 10px; + + a { + font-size: 15px; + color: white; + text-decoration: none; + display: block; + text-align: center; + font-weight: bold; + } + + &:hover { + background-color: #333; + } + + @media (min-width: 576px) and (max-width: 767px) { + width: 130px; + height: 40px; + margin-left: 10px; + + a { + margin-top: -1px; + margin-left: -8px; + font-size: 16px; + } + } +`,jr=u(Gn)` + text-decoration: none; + color: #000; + padding: 5px 12px; + margin-top: 10px; + transition: background-color 0.2s; + border-radius: 5px; + + @media (min-width: 576px) and (max-width: 767px) { + color: black; + padding: 10px; + width: 100%; + text-align: center; + } +`,nO=u.div` + img { + margin-top: -4px; + width: 22px; + height: 22px; + } + + @media (min-width: 576px) and (max-width: 767px) { + img { + width: 25px; + height: 25px; + } + } +`,rO=()=>s.jsx(iO,{children:s.jsx(oO,{children:"© 2024 LinkUp. All Rights Reserved."})}),iO=u.footer` + width: 100%; + + color: white; + background-color: black; + text-align: center; + padding: 1rem 0; + margin-top: auto; +`,oO=u.p` + margin: 0; + font-size: 1rem; +`,sO=()=>s.jsxs(aO,{children:[s.jsx(GI,{}),s.jsx(lO,{children:s.jsx(d2,{})}),s.jsx(rO,{})]}),aO=u.div` + display: flex; + flex-direction: column; + min-height: 100vh; +`,lO=u.main` + flex: 1; /* 남은 공간을 모두 차지 */ + padding: 1rem; + margin-bottom: 150px; +`,cO=async e=>(await se.post("/users/checkemail",e)).data,uO=async e=>(await se.post("/users/checkaddress",e)).data,dO=async e=>(await se.post("/users/checknickname",e)).data,T0=async e=>{const t=localStorage.getItem("email"),n=localStorage.getItem("password"),r=localStorage.getItem("password_confirm"),i=localStorage.getItem("name"),o=localStorage.getItem("phone"),a=localStorage.getItem("nickname"),l=localStorage.getItem("address"),c={email:t,password:n,password_confirm:r,name:i,phone:o,nickname:a,address:l},d=new FormData;if(d.append("user",new Blob([JSON.stringify(c)],{type:"application/json"})),e)d.append("profile",e);else{const h=await fetch("/public/images/origin.png").then(x=>x.blob()),j=new File([h],"origin.png",{type:h.type});d.append("profile",j)}return(await se.post("/users",d,{headers:{"Content-Type":"multipart/form-data"}})).data},fO=async e=>{const t=await se.post("/users/login",e),n=t.headers.authorization||t.headers.Authorization,r=t.data.roles;return n&&(localStorage.setItem("token",n),localStorage.setItem("role",r)),t},pO=async e=>(await se.post("/users/find",e)).data,hO=async(e,t)=>(await se.post(`/users/reset?token=${t}`,e)).data,mO=()=>{const e=Ie(),t=it(),[n,r]=C.useState(""),[i,o]=C.useState(""),{login:a}=zs();return C.useEffect(()=>{const c=new URLSearchParams(t.search).get("accessToken");c&&(localStorage.setItem("token",c),e("/"))},[t,e]),s.jsxs(jO,{children:[s.jsx(wO,{children:s.jsx("img",{src:"/images/login1.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"contain"}})}),s.jsxs(bO,{children:[s.jsx(vO,{children:"Welcome 👋🏼"}),s.jsx(N0,{children:"email address"}),s.jsx(L0,{placeholder:"이메일 입력",value:n,onChange:l=>{r(l.target.value)}}),s.jsx(N0,{children:"password"}),s.jsx(L0,{placeholder:"비밀번호 입력 (8 ~ 16자리)",value:i,type:"password",onChange:l=>{o(l.target.value)}}),s.jsx(yO,{onClick:async()=>{(await fO({email:n,password:i})).status===200?(a(),e("/")):alert("틀렸습니다.")},children:"Login"}),s.jsx(xO,{children:s.jsxs("a",{href:"http://15.164.5.135:8080/users/sociallogin",style:{textDecoration:"none",color:"inherit",display:"inline-flex",alignItems:"center",gap:"8px"},children:[s.jsx("img",{src:"/images/naverlogo.png",alt:"Naver Logo",style:{width:"50px",height:"15px"}}),"계정으로 로그인"]})}),s.jsxs(gO,{children:[s.jsx(M0,{onClick:()=>{e("/signup")},children:"회원가입 하기"}),s.jsx(M0,{onClick:()=>{e("/findpassword")},children:"비밀번호 찾기"})]})]})]})},M0=u.div` + font-size: 13px; + font-weight: 400; + cursor: pointer; +`,gO=u.div` + margin-top: 35px; + width: calc(100% - 20px); + display: inline-flex; + justify-content: space-around; +`,xO=u.div` + border: 1px solid #000; + width: calc(100% - 20px); + height: 35px; + display: inline-flex; + align-items: center; + justify-content: center; + margin-top: 10px; + border-radius: 5px; + font-size: 13px; + cursor: pointer; + gap: 5px; +`,yO=u.div` + background-color: #000; + color: #fff; + border-radius: 5px; + width: calc(100% - 20px); + height: 35px; + display: inline-flex; + align-items: center; + justify-content: center; + margin-top: 35px; + cursor: pointer; +`,L0=u.input` + width: calc(100% - 40px); + height: 25px; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 13px; + padding: 5px 10px; + box-shadow: none; + outline: none; + transition: border-color 0.3s ease; + + &:focus { + border-color: #000; + } +`,N0=u.div` + font-size: 12px; + font-weight: 500; + margin-top: 10px; +`,vO=u.div` + font-size: 30px; + font-weight: 900; + margin-bottom: 20px; +`,wO=u.div` + flex: 6; + background-color: #fff; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +`,bO=u.div` + flex: 4; + background-color: #fff; + display: flex; + align-items: flex-start; + justify-content: center; + flex-direction: column; + padding-left: 20px; +`,jO=u.div` + display: flex; + width: 100%; + height: 100vh; +`;function CO(){const e=Ie(),[t,n]=C.useState(""),[r,i]=C.useState(""),[o,a]=C.useState(""),[l,c]=C.useState(""),[d,p]=C.useState("");return s.jsxs(IO,{children:[s.jsx(RO,{children:s.jsx("img",{src:"/images/login4.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"cover"}})}),s.jsxs(AO,{children:[s.jsx(kO,{children:"회원가입"}),s.jsx(ca,{children:"Name"}),s.jsx(la,{placeholder:"이름 입력",value:t,onChange:f=>{n(f.target.value)}}),s.jsx(ca,{children:"Phone Number"}),s.jsx(la,{placeholder:"휴대폰 번호 입력",value:r,onChange:f=>{i(f.target.value)}}),s.jsx(ca,{children:"Email Address"}),s.jsx(la,{placeholder:"이메일 입력",value:o,onChange:f=>{a(f.target.value)}}),s.jsx(ca,{children:"Password"}),s.jsx(la,{placeholder:"비밀번호 입력 (8 ~ 16자리)",value:l,onChange:f=>{c(f.target.value)}}),s.jsx(ca,{children:"Confirm Password"}),s.jsx(la,{placeholder:"비밀번호 확인",value:d,onChange:f=>{p(f.target.value)}}),s.jsx(EO,{onClick:async()=>{if(l!==d)alert("비밀번호가 일치하지 않습니다.");else try{(await cO({email:o,password:l,password_confirm:d,name:t,phone:r})).message==="이메일, 전화번호 중복 확인 완료"?(localStorage.setItem("email",o),localStorage.setItem("password",l),localStorage.setItem("password_confirm",d),localStorage.setItem("name",t),localStorage.setItem("phone",r),e("/termsandservice")):alert("이메일 또는 전화번호가 중복 되었습니다.")}catch(f){qe.isAxiosError(f)&&f.response&&f.response.data&&f.response.data.error&&alert(f.response.data.error)}},children:"Signup"}),s.jsx(PO,{children:s.jsx(SO,{onClick:()=>{e("/signin")},children:"로그인하기"})})]})]})}const SO=u.div` + font-size: 13px; + font-weight: 400; + cursor: pointer; +`,PO=u.div` + margin-top: 35px; + width: calc(100% - 20px); + display: inline-flex; + justify-content: center; +`,EO=u.div` + background-color: #000; + color: #fff; + border-radius: 5px; + width: calc(100% - 20px); + height: 35px; + display: inline-flex; + align-items: center; + justify-content: center; + margin-top: 35px; + cursor: pointer; +`,la=u.input` + width: calc(100% - 40px); + height: 25px; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 13px; + padding: 5px 10px; + box-shadow: none; + outline: none; + transition: border-color 0.3s ease; + + &:focus { + border-color: #000; + } +`,ca=u.div` + font-size: 12px; + font-weight: 500; + margin-top: 10px; +`,kO=u.div` + font-size: 30px; + font-weight: 900; + margin-bottom: 20px; +`,RO=u.div` + flex: 6; + background-color: #fff; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +`,AO=u.div` + flex: 4; + background-color: #fff; + display: flex; + align-items: flex-start; + justify-content: center; + flex-direction: column; + padding-left: 20px; +`,IO=u.div` + display: flex; + width: 100%; + height: 100vh; +`,OO=()=>{const e=Ie(),[t,n]=C.useState(!1),[r,i]=C.useState("");return s.jsxs(s.Fragment,{children:[s.jsxs(HO,{children:[s.jsx(BO,{children:s.jsx("img",{src:"/images/login7.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"cover"}})}),s.jsxs(WO,{children:[s.jsxs(LO,{onClick:()=>{e(-1)},children:[s.jsx("img",{src:"/images/arrow-left.png",alt:"left arrow",style:{width:"20px",height:"20px"}}),"Back"]}),s.jsx(UO,{children:"비밀번호 찾기"}),s.jsx(NO,{children:"등록된 이메일 주소를 입력하고 확인 버튼을 클릭해주세요"}),s.jsx(zO,{children:"email address"}),s.jsx(FO,{placeholder:"이메일 입력",value:r,onChange:o=>{i(o.target.value)}}),s.jsx($O,{onClick:async()=>{n(!0),(await pO({email:r})).message==="비밀번호 재설정 링크가 이메일로 전송되었습니다."&&e("/resetpassword")},children:"확인"})]})]}),t&&s.jsx(MO,{children:s.jsxs(TO,{children:[s.jsx(DO,{children:"이메일을 확인해주세요"}),s.jsx(_O,{onClick:()=>n(!1),children:"확인"})]})})]})},_O=u.button` + background-color: #000; + color: #fff; + border: none; + border-radius: 5px; + padding: 8px 20px; + cursor: pointer; + width: 100px; + height: 35px; + font-size: 14px; + + &:hover { + opacity: 0.9; + } +`,DO=u.div` + font-size: 16px; + font-weight: 500; + color: #333; +`,TO=u.div` + background-color: white; + padding: 30px; + border-radius: 10px; + width: 300px; + display: flex; + flex-direction: column; + align-items: center; + gap: 20px; +`,MO=u.div` + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +`,LO=u.div` + margin-bottom: 35px; + display: inline-flex; + align-items: center; + cursor: pointer; +`,NO=u.div` + margin-bottom: 20px; + color: #a4a1aa; + font-size: 14px; + font-weight: 500; + margin-top: 10px; +`,$O=u.div` + background-color: #000; + color: #fff; + border-radius: 5px; + width: calc(100% - 20px); + height: 35px; + display: inline-flex; + align-items: center; + justify-content: center; + margin-top: 35px; + cursor: pointer; +`,FO=u.input` + width: calc(100% - 40px); + height: 25px; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 13px; + padding: 5px 10px; + box-shadow: none; + outline: none; + transition: border-color 0.3s ease; + + &:focus { + border-color: #000; + } +`,zO=u.div` + font-size: 12px; + font-weight: 500; + margin-top: 10px; +`,UO=u.div` + font-size: 30px; + font-weight: 900; +`,BO=u.div` + flex: 6; + background-color: #fff; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +`,WO=u.div` + flex: 4; + background-color: #fff; + display: flex; + align-items: flex-start; + justify-content: center; + flex-direction: column; + padding-left: 20px; +`,HO=u.div` + display: flex; + width: 100%; + height: 100vh; +`,QO=()=>{const e=Ie(),t=it(),[n,r]=C.useState(""),[i,o]=C.useState(""),[a,l]=C.useState(!1),d=new URLSearchParams(t.search).get("token"),p=async()=>{n===i&&n.length>=8&&d?(await hO({newPassword:n},d),l(!0)):alert("비밀번호가 일치하지 않거나 유효하지 않습니다.")};return s.jsxs(e5,{children:[s.jsx(XO,{children:s.jsx("img",{src:"/images/login6.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"cover"}})}),s.jsxs(ZO,{children:[s.jsx(YO,{children:"비밀번호 재설정"}),s.jsx(F0,{children:"password"}),s.jsx($0,{type:"password",placeholder:"비밀번호 입력 (8 ~ 16자리)",value:n,onChange:f=>r(f.target.value)}),s.jsx(F0,{children:"confirm password"}),s.jsx($0,{type:"password",placeholder:"비밀번호 확인",value:i,onChange:f=>o(f.target.value)}),s.jsx(JO,{onClick:p,children:"Confirm"})]}),a&&s.jsx(KO,{children:s.jsxs(GO,{children:[s.jsx(qO,{children:"비밀번호가 변경되었습니다."}),s.jsx(VO,{onClick:()=>{e("/signin")},children:"Back to Login"})]})})]})},VO=u.div` + background-color: #000; + color: #fff; + border-radius: 5px; + width: calc(100% - 40px); + height: 50px; + display: inline-flex; + align-items: center; + justify-content: center; + margin-top: 35px; + cursor: pointer; +`,KO=u.div` + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.7); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +`,GO=u.div` + width: 432px; + height: 332px; + background-color: white; + border-radius: 10px; + display: flex; + justify-content: center; + align-items: center; + text-align: center; + flex-direction: column; + z-index: 1001; +`,qO=u.div` + font-size: 18px; + font-weight: 800; + color: #333; +`,JO=u.div` + background-color: #000; + color: #fff; + border-radius: 5px; + width: calc(100% - 20px); + height: 35px; + display: inline-flex; + align-items: center; + justify-content: center; + margin-top: 35px; + cursor: pointer; +`,$0=u.input` + width: calc(100% - 20px); + height: 25px; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 13px; + padding: 5px 10px; + box-shadow: none; + outline: none; + transition: border-color 0.3s ease; + + &:focus { + border-color: #000; + } +`,F0=u.div` + font-size: 12px; + font-weight: 500; + margin-top: 10px; +`,YO=u.div` + font-size: 30px; + font-weight: 900; + margin-bottom: 20px; +`,XO=u.div` + flex: 6; + background-color: #fff; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +`,ZO=u.div` + flex: 4; + background-color: #fff; + display: flex; + align-items: flex-start; + justify-content: center; + flex-direction: column; + padding-left: 20px; +`,e5=u.div` + display: flex; + width: 100%; + height: 100vh; +`,t5=` +1. 서비스 이용약관 동의 + +제1조 (목적) + +이 약관은 사용자가 제공받는 서비스의 이용 조건 및 절차, 회사와 사용자 간의 권리·의무 및 책임사항, 기타 필요한 사항을 규정함을 목적으로 합니다. + +제2조 (서비스 제공의 범위 및 이용자의 책임) + +1. 회사는 사용자가 공동구매 및 할인 플랫폼에서 상품을 검색, 구매, 참여할 수 있는 서비스를 제공합니다. +2. 사용자는 서비스 이용 시 타인의 권리를 침해하거나 법령을 위반하는 행위를 해서는 안 됩니다. +3. 사용자는 자신의 계정 정보를 안전하게 관리할 책임이 있으며, 이를 제3자에게 공유하거나 양도해서는 안 됩니다. + +제3조 (서비스 이용 제한 및 해지 조건) + +1. 회사는 다음의 경우 사용자에게 사전 통지 없이 서비스 이용을 제한하거나 해지할 수 있습니다. + - 약관을 위반한 경우 + - 부정한 방법으로 서비스를 이용한 경우 + - 기타 공공질서 및 미풍양속에 반하는 행위를 한 경우 +2. 사용자는 서비스 이용을 원하지 않을 경우 언제든지 탈퇴 신청을 할 수 있습니다. + +제4조 (분쟁 해결 및 법적 준거법) + +1. 이 약관과 관련된 모든 분쟁은 회사가 위치한 지역의 법률을 준거법으로 합니다. +2. 분쟁이 발생할 경우, 회사와 사용자는 상호 협의하여 해결을 위해 노력합니다. +`,n5=` +2. 전자 금융거래 이용약관 동의 + +제1조 (목적) + +이 약관은 사용자가 전자 금융거래를 이용하는 경우 발생하는 권리, 의무 및 책임사항을 규정하는 것을 목적으로 합니다. + +제2조 (전자 금융거래의 정의 및 적용 범위) + +1. 전자 금융거래란 인터넷, 모바일 애플리케이션 등 전자적 매체를 통해 상품 구매 시 발생하는 결제 행위를 말합니다. +2. 본 약관은 사용자가 결제 서비스, 환불 절차 등과 관련하여 전자 금융거래를 이용하는 모든 경우에 적용됩니다. + +제3조 (전자 금융거래 이용자의 권리와 의무) + +1. 사용자는 정확한 결제 정보를 입력하고, 비밀번호 등 중요한 정보를 안전하게 관리해야 합니다. +2. 회사는 전자 금융거래와 관련된 모든 정보를 투명하고 명확하게 제공하며, 이용자의 권리를 보호합니다. + +제4조 (사고 발생 시 손해 배상 기준 및 절차) + +1. 사용자가 전자 금융거래 이용 중 사고를 경험한 경우, 회사는 관련 법령에 따라 손해를 배상합니다. +2. 사용자는 사고 발생 시 지체 없이 회사에 알리고 필요한 증빙 자료를 제출해야 합니다. +`,r5=` +3. 개인정보 제공 동의 + +제1조 (수집되는 개인정보의 항목 및 이용 목적) + +1. 회사는 서비스 제공을 위해 다음과 같은 개인정보를 수집합니다: + - 필수 정보: 이름, 연락처, 이메일, 결제 정보 + - 선택 정보: 배송 주소, 기타 서비스 이용 시 필요한 정보 +2. 수집된 개인정보는 다음 목적으로 이용됩니다: + - 회원 가입 및 관리 + - 상품 구매 및 배송 + - 고객 서비스 및 공지사항 전달 + +제2조 (개인정보 보관 기간 및 삭제 절차) + +1. 회사는 사용자의 개인정보를 법령에서 정한 기간 동안 보관하며, 그 이후에는 즉시 삭제합니다. + - 회원 정보: 회원 탈퇴 후 30일 내 삭제 + - 결제 정보: 거래 완료 후 5년간 보관 (전자상거래법에 의거) +2. 개인정보 삭제 요청 시, 회사는 7일 이내에 삭제를 완료합니다. + +제3조 (개인정보 제3자 제공 여부와 제공 목적) + +1. 회사는 사용자의 동의 없이 개인정보를 제3자에게 제공하지 않습니다. +2. 서비스 제공 과정에서 필요한 경우, 제3자에게 제공될 수 있으며, 주요 제공 대상과 목적은 다음과 같습니다: + - 배송 업체: 상품 배송 + - 결제 대행사: 결제 처리 + - 법적 요청: 관련 법령 준수를 위한 제공 + `,i5=()=>{const e=Ie(),[t,n]=C.useState(!1),[r,i]=C.useState(""),[o,a]=C.useState(""),l=h=>{switch(h){case"service":a("서비스 이용약관"),i(t5);break;case"finance":a("전자 금융거래 이용약관"),i(n5);break;case"privacy":a("개인정보 제공 동의"),i(r5);break}n(!0)},[c,d]=C.useState({all:!1,age:!1,service:!1,finance:!1,privacy:!1,marketing:!1}),p=()=>{const h=!c.all;d({all:h,age:h,service:h,finance:h,privacy:h,marketing:h})},f=h=>{d(j=>{const x={...j,[h]:!j[h]};return x.all=x.age&&x.service&&x.finance&&x.privacy&&x.marketing,x})};return s.jsxs(s.Fragment,{children:[s.jsxs(x5,{children:[s.jsx(m5,{children:s.jsx("img",{src:"/images/login2.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"cover"}})}),s.jsxs(g5,{children:[s.jsxs(h5,{children:["서비스 약관에",s.jsx("br",{}),"동의해주세요."]}),s.jsxs(d5,{children:[s.jsxs(wo,{children:[s.jsx("input",{type:"checkbox",checked:c.all,onChange:p}),"약관에 모두 동의"]}),s.jsx(f5,{}),s.jsxs(ac,{children:[s.jsxs(wo,{children:[s.jsx("input",{type:"checkbox",checked:c.age,onChange:()=>f("age")}),"(필수) 만 14세 이상입니다."]}),s.jsx(sc,{})]}),s.jsxs(ac,{children:[s.jsxs(wo,{children:[s.jsx("input",{type:"checkbox",checked:c.service,onChange:()=>f("service")}),"(필수) 서비스 이용약관 동의"]}),s.jsx(sc,{onClick:()=>l("service"),children:"보기"})]}),s.jsxs(ac,{children:[s.jsxs(wo,{children:[s.jsx("input",{type:"checkbox",checked:c.finance,onChange:()=>f("finance")}),"(필수) 전자 금융거래 이용약관 동의"]}),s.jsx(sc,{onClick:()=>l("finance"),children:"보기"})]}),s.jsxs(ac,{children:[s.jsxs(wo,{children:[s.jsx("input",{type:"checkbox",checked:c.privacy,onChange:()=>f("privacy")}),"(필수) 개인정보 제공 동의"]}),s.jsx(sc,{onClick:()=>l("privacy"),children:"보기"})]}),s.jsxs(wo,{children:[s.jsx("input",{type:"checkbox",checked:c.marketing,onChange:()=>f("marketing")}),"(선택) 마케팅 수신 동의"]})]}),s.jsx(p5,{onClick:()=>{c.age&&c.service&&c.finance&&c.privacy?e("/setlocation"):alert("필수 항목을 모두 동의해주세요.")},children:"Next"})]})]}),t&&s.jsx(u5,{children:s.jsxs(c5,{children:[s.jsxs(l5,{children:[s.jsx(a5,{children:o}),s.jsx(s5,{onClick:()=>n(!1),children:"×"})]}),s.jsx(o5,{children:s.jsx("pre",{children:r})})]})})]})},o5=u.div` + padding: 20px; + max-height: calc(80vh - 100px); + overflow-y: auto; + + pre { + white-space: pre-wrap; + font-family: inherit; + margin: 0; + } +`,s5=u.button` + background: none; + border: none; + font-size: 24px; + cursor: pointer; + padding: 0; +`,a5=u.h2` + margin: 0; + font-size: 20px; + font-weight: 600; +`,l5=u.div` + display: flex; + justify-content: space-between; + align-items: center; + padding: 20px; + border-bottom: 1px solid #eee; +`,c5=u.div` + background-color: white; + width: 80%; + max-width: 600px; + max-height: 80vh; + border-radius: 10px; + overflow: hidden; +`,u5=u.div` + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +`,sc=u.div` + font-size: 10px; + color: #737171; + cursor: pointer; +`,d5=u.div` + margin-top: 20px; + width: calc(100% - 20px); +`,ac=u.div` + display: inline-flex; + justify-content: space-between; + width: 100%; +`,wo=u.div` + margin-bottom: 10px; + display: flex; + align-items: center; + font-size: 14px; + + input { + margin-right: 10px; + } +`,f5=u.div` + height: 1px; + background-color: #ddd; + margin: 15px 0; +`,p5=u.div` + background-color: #000; + color: #fff; + border-radius: 5px; + width: calc(100% - 20px); + height: 35px; + display: inline-flex; + align-items: center; + justify-content: center; + margin-top: 35px; + cursor: pointer; +`,h5=u.div` + font-size: 30px; + font-weight: 900; + margin-bottom: 20px; +`,m5=u.div` + flex: 6; + background-color: #fff; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +`,g5=u.div` + flex: 4; + background-color: #fff; + display: flex; + align-items: flex-start; + justify-content: center; + flex-direction: column; + padding-left: 20px; +`,x5=u.div` + display: flex; + width: 100%; + height: 100vh; +`,y5=({input:e,setInput:t})=>s.jsx(v5,{children:s.jsx(w5,{type:"text",value:e,onChange:n=>t(n.target.value),placeholder:"검색어를 입력하세요"})}),v5=u.div` + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; + margin-top: 2rem; +`,w5=u.input` + padding: 1rem 2rem; + font-size: 1.5rem; + width: 60%; + border: 2px solid #ccc; + border-radius: 8px; + outline: none; + transition: all 0.3s ease; + + &:focus { + border-color: #4f86e6; + box-shadow: 0 0 10px rgba(79, 134, 230, 0.3); + } + + ::placeholder { + color: #888; + } + @media (min-width: 576px) and (max-width: 767px) { + font-size: 1rem; + } +`,b5=({input:e,products:t})=>{const[n,r]=C.useState(1),[i,o]=C.useState("판매 상품"),a=16,l=(n-1)*a,c=i==="마감 상품"?t.filter(f=>f.available===!1||new Date(f.deadline)f.available===!0&&new Date(f.deadline)>new Date),d=Math.ceil(c.length/a);C.useEffect(()=>{r(1)},[i]);const p=c.slice(l,l+a);return s.jsxs(j5,{children:[s.jsxs(C5,{children:[s.jsxs(S5,{children:[s.jsx(z0,{selected:i==="판매 상품",onClick:()=>o("판매 상품"),children:"판매 상품"}),s.jsx(z0,{selected:i==="마감 상품",onClick:()=>o("마감 상품"),children:"마감 상품"})]}),e?`${e}에 대한 검색 결과`:""]}),s.jsx(P5,{children:p.map(f=>s.jsxs(E5,{selected:i==="판매 상품",children:[s.jsxs(k5,{to:`/products/${f.id}`,children:[s.jsx(R5,{src:f.url||qn,alt:f.name,onError:h=>{h.currentTarget.src=qn}}),s.jsxs(A5,{children:[s.jsx(I5,{children:f.name}),s.jsxs(O5,{children:[" ",s.jsx(yl,{rating:f.rating})]}),s.jsx(_5,{children:f.available?s.jsxs(s.Fragment,{children:[s.jsxs(D5,{children:[f.originalprice,"원"]}),s.jsxs(T5,{children:[f.discountprice,"원"]})]}):s.jsx(M5,{children:"∞ (판매 종료)"})})]})]}),s.jsx(L5,{likes:f.likes})]},f.id))}),d>1&&s.jsx(N5,{children:s.jsx(Fm,{currentPage:n,totalPages:d,onPageChange:f=>r(f)})})]})},j5=u.div` + display: flex; + flex-wrap: wrap; + width: 80%; + height: auto; + margin: 0 auto; +`,C5=u.h2` + margin-left: 10px; + margin-bottom: 20px; + font-size: 1.5rem; + color: #333; +`,S5=u.div` + width: 200px; + display: flex; + gap: 25px; + margin-top: -15%; + margin-bottom: 5%; +`,z0=u.h2.withConfig({shouldForwardProp:e=>e!=="selected"})` + cursor: pointer; + text-decoration: ${({selected:e})=>e?"underline":"none"}; + font-size: 16px; +`,P5=u.div` + display: grid; + grid-template-columns: repeat(4, 1fr); + width: 100%; + gap: 20px; + margin-top: 20px; + @media (min-width: 576px) and (max-width: 767px) { + gap: 5px; + } +`,E5=u.div.withConfig({shouldForwardProp:e=>e!=="selected"})` + display: flex; + flex-direction: column; + justify-content: space-between; + padding: 15px; + margin: 10px; + width: 200px; + background-color: ${({selected:e})=>e?"white":"#474545"}; + border-radius: 8px; + box-shadow: ${({selected:e})=>e?"0 4px 6px rgba(0, 0, 0, 0.1)":"none"}; + opacity: ${({selected:e})=>e?1:.6}; + align-items: center; + position: relative; + transition: all 0.3s ease-in-out; + &::after { + content: ${({selected:e})=>e?'""':'"판매 종료"'}; + position: absolute; + top: 10px; + left: 50%; + transform: translateX(-50%); + color: #474545; + font-size: 14px; + font-weight: bold; + padding: 5px 10px; + border-radius: 5px; + } + &:hover { + cursor: pointer; + box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.4); + transform: translateY(-5px); + } + @media (min-width: 768px) and (max-width: 1024px) { + width: 130px; + } + @media (min-width: 576px) and (max-width: 767px) { + width: 90px; + } +`,k5=u(Gn)` + text-decoration: none; + &:link { + color: inherit; + } + &:visited { + color: inherit; + } + &:active { + color: inherit; + } +`,R5=u.img` + width: 90%; + height: 200px; + background-color: #e0e0e0; + border-radius: 8px; + object-fit: cover; + @media (min-width: 576px) and (max-width: 767px) { + width: 110px; + height: 110px; + } +`,A5=u.div` + display: flex; + flex-direction: column; + width: 90%; +`,I5=u.div` + font-size: 16px; + font-weight: bold; + margin-top: 10px; + text-align: left; + @media (min-width: 576px) and (max-width: 767px) { + font-size: 12px; + } +`,O5=u.div` + font-size: 20px; + color: #ffaa00; + text-align: left; + margin-left: -5px; + margin-top: 5px; + @media (min-width: 576px) and (max-width: 767px) { + display: none; + } +`,_5=u.div` + display: flex; + flex-direction: column; + width: 100%; + margin-top: 30px; + text-align: left; +`,D5=u.div` + text-decoration: line-through; + color: #999; + font-size: 14px; + @media (min-width: 576px) and (max-width: 767px) { + font-size: 10px; + position: absolute; + bottom: 25px; + } +`,T5=u.div` + font-size: 16px; + font-weight: bold; + color: #ff4d4f; + @media (min-width: 576px) and (max-width: 767px) { + font-size: 12px; + position: absolute; + bottom: 10px; + } +`,M5=u.div` + font-size: 20px; + color: gray; + @media (min-width: 576px) and (max-width: 767px) { + font-size: 12px; + position: absolute; + bottom: 10px; + } +`,L5=u.img.withConfig({shouldForwardProp:e=>e!=="likes"})` + position: absolute; + bottom: 20px; + right: 30px; + width: 25px; + height: 25px; + cursor: pointer; + content: ${({likes:e})=>`url(${e?_w:Ow})`}; + color: ${({likes:e})=>e?"red ":"transparent"}; + + &:hover { + cursor: pointer; + transform: scale(1.2); + transition: transform 0.2s ease-in-out; + } + @media (min-width: 576px) and (max-width: 767px) { + bottom: 10px; + right: 10px; + width: 18px; + height: 18px; + } +`,N5=u.div` + margin-top: 100px; + display: flex; + justify-content: center; + width: 100%; +`,$5=()=>{const{data:e,isLoading:t,isError:n}=Ab(),[r,i]=C.useState(""),o=it();C.useEffect(()=>{const p=new URLSearchParams(o.search).get("category");p&&i(p)},[]);const a=d=>[...d].sort((f,h)=>{var j,x;return(((j=h.reviews)==null?void 0:j.length)||0)-(((x=f.reviews)==null?void 0:x.length)||0)}),c=C.useMemo(()=>e?a(e):[],[e]).filter(d=>d.name.toLowerCase().includes(r.toLowerCase())||d.category.toLowerCase().includes(r.toLowerCase()));return s.jsx(s.Fragment,{children:s.jsxs(lo,{isLoading:t,isError:n,children:[s.jsx(U0,{children:s.jsx(B0,{children:s.jsx(y5,{input:r,setInput:i})})}),s.jsxs(U0,{children:[s.jsx(B0,{children:s.jsx(b5,{input:r,products:c})}),s.jsx(Tm,{})]})]})})},U0=u.div` + display: flex; + margin-top: 5vh; + align-items: center; + justify-content: center; + width: 100%; + max-width: 1400px; + margin-left: auto; + margin-right: auto; +`,B0=u.div` + display: flex; + align-items: center; + width: 100%; +`,F5=async(e,t)=>{try{const n=`/api/v1/orders?postId=${e}`;return(await se.post(n,{amount:t})).data}catch{throw new Error("주문에 실패하였습니다.")}},z5=async e=>{try{const t="/products/wishlist",{data:n}=await se.post(t,e);return n}catch{throw new Error("위시리스트 추가에 실패하였습니다.")}},U5=async(e,t)=>{const n=`/api/review/${e}`;return await se.post(n,t)},B5=async(e,t)=>{const n=`/api/review/update/${e}`;return await se.put(n,t)},W5=async e=>{const t=`/api/review/remove/${e}`;return await se.put(t)},H5=({initReviews:e,productId:t})=>{const[n,r]=C.useState(e),[i,o]=C.useState(""),[a,l]=C.useState(5),[c,d]=C.useState(10),[p,f]=C.useState(null),[h,j]=C.useState(""),[x,g]=C.useState(5),S=n.map((k,R)=>({...k,originalIndex:R})).filter(k=>k.using===!0),w=()=>{d(k=>k+10)},m=async k=>{k.preventDefault();try{await U5(t,{content:i,rate:a}),r(R=>[...R,{content:i,rating:a,using:!0}]),o(""),l(5)}catch{alert("현재 댓글을 작성할 수 없는 상태입니다.")}},v=(k,R,I)=>{f(k),j(R),g(I)},b=async k=>{try{const R=S[k].originalIndex,I=R+1;await B5(I,{content:h,rate:x}),r(D=>D.map((_,N)=>N===R?{..._,content:h,rating:x}:_)),f(null),j(""),g(5)}catch{alert("현재 댓글을 수정할 수 없는 상태입니다.")}},E=()=>{f(null),j(""),g(5)},P=async k=>{try{const R=S[k].originalIndex,I=R+1;await W5(I),r(D=>D.map((_,N)=>N===R?{..._,using:!1}:_))}catch{alert("현재 댓글을 삭제할 수 없는 상태입니다.")}};return s.jsxs(i_,{children:[s.jsx(Q5,{onSubmit:m,children:s.jsxs(V5,{children:[s.jsx(K5,{value:i,onChange:k=>o(k.target.value),placeholder:"댓글을 입력하세요"}),s.jsx(W0,{value:a,onChange:k=>l(Number(k.target.value)),children:[1,2,3,4,5].map(k=>s.jsx("option",{value:k,children:"⭐".repeat(k)},k))}),s.jsx(G5,{type:"submit",children:"댓글 달기"})]})}),s.jsxs("div",{children:[S.slice(0,c).map((k,R)=>s.jsx(q5,{children:p===R?s.jsxs(t_,{children:[s.jsx(n_,{value:h,onChange:I=>j(I.target.value)}),s.jsx(W0,{value:x,onChange:I=>g(Number(I.target.value)),children:[1,2,3,4,5].map(I=>s.jsx("option",{value:I,children:"⭐".repeat(I)},I))}),s.jsxs(r_,{children:[s.jsx(lc,{onClick:()=>b(R),color:"primary",children:"저장"}),s.jsx(lc,{onClick:E,color:"secondary",children:"취소"})]})]}):s.jsxs(s.Fragment,{children:[s.jsxs(J5,{children:[s.jsx(Y5,{children:k.content}),s.jsx(X5,{children:"⭐".repeat(k.rating)})]}),s.jsxs(ej,{children:[s.jsx(lc,{onClick:()=>v(R,k.content,k.rating),children:"수정"}),s.jsx(lc,{onClick:()=>P(R),children:"삭제"})]})]})},k.originalIndex)),s.jsx(Z5,{children:c{const[t,n]=C.useState(1);return s.jsx(tj.Provider,{value:{quantity:t,setQuantity:n},children:e})},nj=()=>{const e=C.useContext(tj);if(!e)throw new Error("useQuantity must be used within a QuantityProvider");return e},s_=()=>{const{id:e}=ao(),t=C.useMemo(()=>e&&!isNaN(Number(e))?Number(e):null,[e]);if(!t)return s.jsx("p",{children:"잘못된 상품 ID입니다."});const{data:n,isLoading:r,isError:i}=jl(t||0),{quantity:o,setQuantity:a}=nj(),[l,c]=C.useState(""),d=Ie(),h=(n?n.currentStock<0:!1)||l==="마감되었습니다.";C.useEffect(()=>{if(!n)return;const w=()=>{const v=new Date,E=new Date(n.deadline).getTime()-v.getTime();if(E<=0||n.available===!1){c("마감되었습니다.");return}const P=Math.floor(E/(1e3*60*60*24)),k=Math.floor(E%(1e3*60*60*24)/(1e3*60*60)),R=Math.floor(E%(1e3*60*60)/(1e3*60));c(`${P}일 ${k}시간 ${R}분 남음`)};w();const m=setInterval(w,6e4);return()=>clearInterval(m)},[n]);const j=w=>{const m=parseInt(w.target.value);m>0&&a(m)},x=async()=>{await F5(t,o),d(`/products/payment/${t}`)};if(!n)return s.jsx("p",{children:"상품 정보를 불러올 수 없습니다."});const g=n.minamount-(n.initstock-n.currentStock),S=Math.min((n.initstock-n.currentStock)/n.currentStock*100,100);return s.jsx(s.Fragment,{children:s.jsx(lo,{isLoading:r,isError:i,children:s.jsxs(a_,{children:[s.jsxs(l_,{children:[s.jsxs(c_,{children:[s.jsx(d_,{src:n.url||qn,alt:n.name,onError:w=>w.currentTarget.src=qn}),s.jsx(p_,{children:s.jsx(yl,{rating:n.rating})})]}),s.jsxs(u_,{children:[s.jsx(f_,{children:n.name}),s.jsx(h_,{children:n.available?s.jsxs(s.Fragment,{children:[s.jsxs(y_,{children:[n.originalprice,"원"]}),s.jsxs(g_,{children:[s.jsxs(v_,{children:[n.discountprice,"원"]}),s.jsxs(x_,{children:[n.minamount,"개부터 할인 적용"]})]}),g>0&&s.jsxs(w_,{children:["할인 적용까지 ",g,"개 남음"]})]}):s.jsx(m_,{children:"∞ (판매 종료)"})})," ",n.available&&s.jsx(b_,{children:n.description}),s.jsx(j_,{children:l}),s.jsxs(C_,{children:[s.jsx(S_,{children:"현재 구매 현황"}),s.jsx(P_,{children:s.jsx(E_,{style:{width:`${S}%`}})}),s.jsxs(k_,{children:[n.initstock-n.currentStock," /"," ",n.initstock," 구매됨"]})]}),s.jsxs(R_,{children:[s.jsxs(A_,{children:[s.jsx(I_,{children:"수량"}),s.jsx(O_,{type:"number",min:"1",value:o,onChange:j})]}),s.jsxs(__,{children:[s.jsx(D_,{disabled:h,onClick:x,children:"구매하기"}),s.jsx(T_,{onClick:()=>z5(n.id),children:"찜하기"})]})]})]})]}),s.jsx(H5,{productId:t,initReviews:n.reviews})]})})})},a_=u.div` + width: 90%; + max-width: 1200px; + margin: 0 auto; + padding: 20px; +`,l_=u.div` + display: flex; + gap: 40px; + margin-bottom: 40px; +`,c_=u.div` + position: relative; + flex: 1; + @media (min-width: 576px) and (max-width: 767px) { + height: 300px; + width: 300px; + } +`,u_=u.div` + flex: 1; +`,d_=u.img` + width: 100%; + height: 400px; + background-color: #f5f5f5; + object-fit: cover; + @media (min-width: 576px) and (max-width: 767px) { + height: 300px; + width: 300px; + } +`,f_=u.h2` + font-size: 24px; + font-weight: bold; + margin-bottom: 10px; +`,p_=u.div` + position: absolute; + font-size: 20px; + color: #ffaa00; + bottom: 13%; + right: 2%; + + @media (min-width: 768px) and (max-width: 1024px) { + bottom: 80px; + } + @media (min-width: 576px) and (max-width: 767px) { + bottom: 10px; + } +`,h_=u.div` + display: flex; + gap: 10px; + margin-bottom: 20px; + @media (min-width: 576px) and (max-width: 767px) { + flex-direction: column; + } +`,m_=u.div` + font-size: 2.3rem; + color: gray; +`,g_=u.div` + display: flex; + flex-direction: column; + gap: 4px; +`,x_=u.div` + font-size: 14px; + color: #888; + @media (min-width: 768px) and (max-width: 1024px) { + margin-left: -50%; + } + @media (min-width: 576px) and (max-width: 767px) { + font-size: 12px; + } +`,y_=u.div` + text-decoration: line-through; + color: #999; + font-size: 18px; + @media (min-width: 576px) and (max-width: 767px) { + font-size: 12px; + } +`,v_=u.div` + font-weight: bold; + color: #ff4d4f; + font-size: 24px; + @media (min-width: 576px) and (max-width: 767px) { + margin-top: -10px; + font-size: 18px; + } +`,w_=u.div` + display: inline-flex; + align-items: center; + background-color: #fff3f3; + border: 1px solid #ffcdd2; + border-radius: 20px; + padding: 8px 16px; + color: #ff4d4f; + font-size: 14px; + font-weight: 600; + &::before { + content: '🏷️'; + margin-right: 8px; + font-size: 16px; + } + @media (min-width: 768px) and (max-width: 1024px) { + width: 220px; + } +`,b_=u.p` + margin-bottom: 30px; + line-height: 1.6; + color: #666; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + @media (min-width: 576px) and (max-width: 767px) { + -webkit-line-clamp: 2; + } +`,j_=u.div` + font-size: 16px; + color: #ff4d4f; + margin-bottom: 20px; +`,C_=u.div` + margin-bottom: 20px; +`,S_=u.div` + font-size: 16px; + margin-bottom: 5px; + color: #333; +`,P_=u.div` + width: 100%; + height: 10px; + background-color: #ddd; + border-radius: 5px; + overflow: hidden; +`,E_=u.div` + height: 100%; + background-color: #4caf50; + transition: width 0.3s ease; +`,k_=u.div` + margin-top: 5px; + font-size: 14px; + color: #555; +`,R_=u.div` + display: flex; + flex-direction: column; + gap: 20px; + @media (min-width: 576px) and (max-width: 767px) { + margin-top: -40px; + margin-left: -340px; + } +`,A_=u.div` + display: flex; + align-items: center; + justify-content: space-between; + margin-top: 10px; + width: 120px; + font-size: 16px; + border-radius: 8px; + padding: 10px 15px; +`,I_=u.span` + font-weight: bold; + color: #333; +`,O_=u.input` + width: 40px; + height: 40px; + text-align: center; + font-size: 16px; + padding: 0 10px; + border: 1px solid #ccc; + border-radius: 5px; + background-color: #fff; + transition: border-color 0.3s ease; + + &:focus { + border-color: #4a90e2; + outline: none; + } + + &::placeholder { + color: #aaa; + } +`,__=u.div` + display: flex; + gap: 10px; +`,D_=u.button` + flex: 2; + padding: 15px; + background-color: ${({disabled:e})=>e?"#d1d5db":"#2563eb"}; + color: ${({disabled:e})=>e?"#9ca3af":"white"}; + border: none; + border-radius: 5px; + cursor: ${({disabled:e})=>e?"not-allowed":"pointer"}; + font-size: 16px; + font-weight: bold; + text-decoration: none; + text-align: center; + pointer-events: ${({disabled:e})=>e?"none":"auto"}; /* 비활성화 시 클릭 불가 */ + + &:hover { + cursor: ${({disabled:e})=>e?"not-allowed":"pointer"}; /* 비활성화 상태에서 hover 시 커서 변경 */ + background-color: ${({disabled:e})=>e?"#d1d5db":"white"}; + color: ${({disabled:e})=>e?"#9ca3af":"#2563eb"}; + border: ${({disabled:e})=>e?"none":"1px solid #2563eb"}; + } +`,T_=u.button` + flex: 1; + padding: 15px; + background-color: white; + color: #2563eb; + border: 1px solid #2563eb; + border-radius: 5px; + cursor: pointer; + font-size: 16px; + font-weight: bold; + &:hover { + cursor: pointer; + background-color: #2563eb; + color: white; + } +`,M_=u.div` + display: inline-flex; + gap: 20px; + width: 100%; +`,L_=u.div` + width: 100%; + padding: 0px 20px; +`,jt={Wrapper:M_,Content:L_},N_=async e=>(await se.post("/api/mypage/verify",e)).data,$_=async e=>(await se.post("/api/mypage/change",e)).data,F_=async e=>(await se.put("/api/mypage/changeneighbor",e)).data,z_=async()=>{const e=await se.get("/api/mypage/orders");return e.status!==204?e.data:[]},U_=async()=>(await se.get("/api/mypage/refund_orders")).data,rj=async()=>(await se.get("/api/mypage")).data,B_=async()=>(await se.get("/api/mypage/community")).data,W_=async()=>(await se.get("/api/mypage/post")).data,H_=async e=>(await se.delete(`/api/mypage/post/${e}`)).data,Q_=async e=>(await se.post("/api/v1/main-payments/cancel",e)).data,V_=async e=>{const t=new FormData;return t.append("profile",e),(await se.put("/api/mypage/editprofile",t,{headers:{"Content-Type":"multipart/form-data"}})).data},K_=async e=>(await se.put(`/api/mypage/change_nickname?nickName=${e}`)).data,hi=()=>{const e=Ie(),t=it(),[n,r]=C.useState(null),[i,o]=C.useState(""),a=l=>t.pathname===l;return C.useEffect(()=>{(async()=>{try{const c=await rj();r(c.profile),o(c.name)}catch(c){console.error("failed",c)}})()},[]),s.jsxs(q_,{children:[s.jsxs(J_,{children:[s.jsx(Y_,{src:n||"/images/origin.png",alt:"Profile"}),s.jsxs(X_,{children:[s.jsx(Z_,{children:"Hello 👋"}),s.jsx(eD,{children:i})]})]}),s.jsx(G_,{}),s.jsxs(tD,{children:[s.jsxs(Cr,{$isActive:a("/mypage/setting"),onClick:()=>e("/mypage/setting"),children:[s.jsx("img",{src:`/images/setting${a("/mypage/setting")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"설정"]}),s.jsxs(Cr,{$isActive:a("/mypage/orderlist"),onClick:()=>e("/mypage/orderlist"),children:[s.jsx("img",{src:`/images/orderlist${a("/mypage/orderlist")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"주문 내역"]}),s.jsxs(Cr,{$isActive:a("/mypage/wishlist"),onClick:()=>e("/mypage/wishlist"),children:[s.jsx("img",{src:`/images/wishlist${a("/mypage/wishlist")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"찜한 상품"]}),s.jsxs(Cr,{$isActive:a("/mypage/location"),onClick:()=>e("/mypage/location"),children:[s.jsx("img",{src:`/images/location${a("/mypage/location")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"동네인증"]}),s.jsxs(Cr,{$isActive:a("/mypage/refund"),onClick:()=>e("/mypage/refund"),children:[s.jsx("img",{src:`/images/refund${a("/mypage/refund")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"환불계좌 관리"]}),s.jsxs(Cr,{$isActive:a("/mypage/notification"),onClick:()=>e("/mypage/notification"),children:[s.jsx("img",{src:`/images/notification${a("/mypage/notification")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"알림내역"]}),s.jsxs(Cr,{$isActive:a("/mypage/myposts"),onClick:()=>e("/mypage/myposts"),children:[s.jsx("img",{src:`/images/myposts${a("/mypage/myposts")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"나의 게시글"]}),s.jsxs(Cr,{$isActive:a("/mypage/chatlist"),onClick:()=>e("/mypage/chatlist"),children:[s.jsx("img",{src:`/images/chatlist${a("/mypage/chatlist")?"_on":""}.png`,width:24,height:24,alt:"Icon"}),"나의 채팅방 목록"]})]})]})},G_=u.div` + width: 100%; + border: 0.5px solid #888; +`,q_=u.div` + width: 260px; + min-width: 260px; + background-color: #fff; + border-radius: 10px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +`,J_=u.div` + display: flex; + align-items: center; + padding: 10px 20px; +`,Y_=u.img` + width: 50px; + height: 50px; + border-radius: 50%; + margin-right: 15px; +`,X_=u.div` + display: flex; + flex-direction: column; +`,Z_=u.div` + font-size: 14px; + color: #888; +`,eD=u.div` + margin-top: 15px; + font-size: 16px; + font-weight: bold; +`,tD=u.div` + display: flex; + flex-direction: column; + gap: 15px; + padding: 10px 20px; +`,Cr=u.div` + display: flex; + align-items: center; + font-size: 14px; + font-weight: 500; + color: ${({$isActive:e})=>e?"#fff":"#333"}; + cursor: pointer; + height: 30px; + gap: 10px; + background-color: ${({$isActive:e})=>e?"#000":"transparent"}; + border-radius: 5px; + padding: 5px 10px; + + &:hover { + background-color: ${({$isActive:e})=>e?"#000":"#f1f1f1"}; + color: ${({$isActive:e})=>e?"#fff":"#000"}; + } +`,nD={addressList:[{id:1,name:"홍길동",address:"경기 성남시 분당구 판교역로 4",phone:"010-0000-0000"}]},rD=[{id:1,name:"트렌치코트",quantity:1,price:"148500원",thumb:"/images/trenchcoat.jpeg"},{id:2,name:"싱싱한 사과",quantity:1,price:"3500원",thumb:"/images/apple.png"},{id:3,name:"무선청소기",quantity:1,price:"118500원",thumb:"/images/vacuum.png"},{id:4,name:"목욕 수건",quantity:1,price:"3500원",thumb:"/images/towel.jpeg"}],iD=[{id:1,icon:"bell",title:"{제목} 공동구매 모집이 완료되었습니다.",time:"2024-11-20 13:30"},{id:2,icon:"bell",title:"{제목} 인원 부족으로 모집이 취소되었습니다.",time:"2024-11-19 11:30"},{id:3,icon:"chat",title:"{닉네임}님과 채팅을 시작했습니다.",time:"2024-11-17 15:00"},{id:4,icon:"comment",title:"{닉네임}님이 댓글을 남겼습니다.",time:"2024-11-16 11:10"}],oD=({onClose:e})=>{const[t,n]=C.useState(1),[r,i]=C.useState(""),[o,a]=C.useState(""),[l,c]=C.useState(""),d=async()=>{t===1?(await N_({currentPassword:r}),n(2)):t===2&&(o===l?(await $_({newPassword:o}),e()):alert("비밀번호가 일치하지 않습니다."))};return s.jsx(sD,{onClick:e,children:s.jsx(aD,{onClick:p=>p.stopPropagation(),children:s.jsxs(lD,{children:[t===1&&s.jsxs(s.Fragment,{children:[s.jsx(nf,{children:"현재 비밀번호"}),s.jsxs(rf,{children:[s.jsx(of,{type:"password",placeholder:"현재 비밀번호를 입력하세요",value:r,onChange:p=>i(p.target.value)}),s.jsx(H0,{onClick:d,children:"확인"})]})]}),t===2&&s.jsxs(s.Fragment,{children:[s.jsx(nf,{children:"변경할 비밀번호"}),s.jsx(rf,{children:s.jsx(of,{type:"password",placeholder:"새 비밀번호를 입력하세요",value:o,onChange:p=>a(p.target.value)})}),s.jsx(nf,{children:"비밀번호 확인"}),s.jsxs(rf,{children:[s.jsx(of,{type:"password",placeholder:"비밀번호를 다시 입력하세요",value:l,onChange:p=>c(p.target.value)}),s.jsx(H0,{onClick:d,children:"변경"})]})]})]})})})},sD=u.div` + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.7); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +`,aD=u.div` + background-color: #fff; + width: 400px; + padding: 20px; + border-radius: 10px; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); + z-index: 1001; +`,lD=u.div` + font-size: 16px; + margin-bottom: 20px; +`,nf=u.div` + font-size: 14px; + font-weight: bold; + margin-bottom: 10px; +`,rf=u.div` + display: flex; + gap: 10px; + margin-bottom: 20px; +`,of=u.input` + flex: 1; + padding: 10px; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 14px; +`,H0=u.button` + background-color: #000; + color: #fff; + border: none; + padding: 10px 20px; + border-radius: 5px; + cursor: pointer; + + &:hover { + background-color: #333; + } +`,cD=({onClose:e})=>{const t=Ie(),{logout:n}=zs();return s.jsx(uD,{onClick:e,children:s.jsx(dD,{onClick:r=>r.stopPropagation(),children:s.jsxs(fD,{children:[s.jsx(pD,{children:"로그아웃 하시겠습니까?"}),s.jsx(hD,{onClick:()=>{n(),t("/")},children:"확인"})]})})})},uD=u.div` + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.7); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +`,dD=u.div` + background-color: #fff; + width: 300px; + padding: 20px; + border-radius: 10px; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); + z-index: 1001; +`,fD=u.div` + font-size: 16px; +`,pD=u.div` + font-size: 14px; + font-weight: bold; + margin-bottom: 10px; +`,hD=u.button` + background-color: #000; + color: #fff; + border: none; + padding: 10px 20px; + border-radius: 5px; + cursor: pointer; + + &:hover { + background-color: #333; + } +`,mD=({onClose:e})=>{const t=Ie();return s.jsx(gD,{onClick:e,children:s.jsx(xD,{onClick:n=>n.stopPropagation(),children:s.jsxs(yD,{children:[s.jsx(vD,{children:"회원탈퇴 하시겠습니까?"}),s.jsx(wD,{onClick:()=>{t("/")},children:"확인"})]})})})},gD=u.div` + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.7); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +`,xD=u.div` + background-color: #fff; + width: 300px; + padding: 20px; + border-radius: 10px; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); + z-index: 1001; +`,yD=u.div` + font-size: 16px; +`,vD=u.div` + font-size: 14px; + font-weight: bold; + margin-bottom: 10px; +`,wD=u.button` + background-color: #000; + color: #fff; + border: none; + padding: 10px 20px; + border-radius: 5px; + cursor: pointer; + + &:hover { + background-color: #333; + } +`;var ij={},oj={},rd={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.postcodeScriptUrl=void 0;var t="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js";e.postcodeScriptUrl="https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js";var n=function(){var i=null;return function(){var o=0"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function b(_){return b=Object.setPrototypeOf?Object.getPrototypeOf:function(N){return N.__proto__||Object.getPrototypeOf(N)},b(_)}function E(_,N,F){return N in _?Object.defineProperty(_,N,{value:F,enumerable:!0,configurable:!0,writable:!0}):_[N]=F,_}var P=n.default.createElement("p",null,"현재 Daum 우편번호 서비스를 이용할 수 없습니다. 잠시 후 다시 시도해주세요."),k={width:"100%",height:400},R={scriptUrl:r.postcodeScriptUrl,errorMessage:P,autoClose:!0},I=function(_){function N(){var $;f(this,N);for(var X=arguments.length,ue=Array(X),oe=0;oe{const[e,t]=C.useState(nD.addressList),[n,r]=C.useState(!1),[i,o]=C.useState(!1),[a,l]=C.useState(!1),[c,d]=C.useState(""),[p,f]=C.useState(""),[h,j]=C.useState(""),[x,g]=C.useState(""),[S,w]=C.useState(""),[m,v]=C.useState(!1),[b,E]=C.useState(null),[P,k]=C.useState(""),I=ij.useDaumPostcodePopup("https://t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js"),D=$=>{d($.zonecode+" "+$.jibunAddress)},_=()=>{if(p&&h&&x&&S&&c){const $=`${h}-${x}-${S}`;e.push({id:Date.now(),name:p,address:c,phone:$}),f(""),j(""),g(""),w(""),d(""),v(!1)}},N=$=>{var ue;const X=(ue=$.target.files)==null?void 0:ue[0];if(X){const oe=new FileReader;oe.onload=()=>{oe.result&&E(oe.result.toString())},oe.readAsDataURL(X)}},F=$=>{t(X=>X.filter(ue=>ue.id!==$))};return C.useEffect(()=>{(async()=>{try{const X=await rj();E(X.profile)}catch(X){console.error("failed",X)}})()},[]),s.jsxs(jt.Wrapper,{children:[s.jsx(hi,{}),s.jsxs(jt.Content,{children:[s.jsxs(qD,{children:[s.jsx("img",{src:b||"/images/origin.png",alt:"Profile",width:80,height:80,onClick:()=>{var $;return($=document.getElementById("fileInput"))==null?void 0:$.click()},style:{cursor:"pointer"}}),s.jsx(GD,{onClick:async()=>{if(!b){alert("이미지를 먼저 업로드해주세요.");return}try{const $=await fetch(b).then(ue=>ue.blob()),X=new File([$],"profile.jpg",{type:$.type});await V_(X),alert("프로필이 성공적으로 업데이트되었습니다.")}catch($){alert("프로필 업데이트 중 오류가 발생했습니다."),console.error("API 오류:",$)}},children:"Edit Profile"}),s.jsx("input",{id:"fileInput",type:"file",accept:"image/*",style:{display:"none"},onChange:N})]}),s.jsxs(KD,{children:[s.jsx(cf,{children:"닉네임 변경"}),s.jsx(VD,{value:P,onChange:$=>{k($.target.value)},placeholder:"최소 2자 이상 ~ 15자 이내, 띄어쓰기 및 특수문자 사용 불가"}),s.jsx(QD,{onClick:async()=>{await K_(P),k("")},children:"변경하기"})]}),s.jsxs(HD,{children:[s.jsx(cf,{children:"배송지 주소 변경"}),m?s.jsxs(jD,{children:[s.jsxs(SD,{children:[s.jsxs(lf,{children:[s.jsx(af,{children:"이름"}),s.jsx(aj,{placeholder:"이름 입력",value:p,onChange:$=>f($.target.value)})]}),s.jsxs(lf,{children:[s.jsx(af,{children:"휴대폰 번호"}),s.jsxs(CD,{children:[s.jsx(sf,{placeholder:"010",value:h,onChange:$=>j($.target.value),maxLength:3}),s.jsx(Q0,{children:"-"}),s.jsx(sf,{placeholder:"0000",value:x,onChange:$=>g($.target.value),maxLength:4}),s.jsx(Q0,{children:"-"}),s.jsx(sf,{placeholder:"0000",value:S,onChange:$=>w($.target.value),maxLength:4})]})]})]}),s.jsx(RD,{children:s.jsxs(lf,{children:[s.jsx(af,{children:"주소"}),s.jsxs(kD,{children:[s.jsx(PD,{onClick:()=>{I({onComplete:D})},children:"주소 검색"}),c&&s.jsx(ED,{children:c})]})]})}),s.jsxs(OD,{children:[s.jsx(AD,{onClick:_,children:"완료"}),s.jsx(ID,{onClick:()=>v(!1),children:"취소"})]})]}):s.jsx(WD,{onClick:()=>v(!0),children:"Add New Address"}),s.jsx(DD,{children:e==null?void 0:e.map($=>s.jsxs(TD,{children:[s.jsxs(MD,{children:[s.jsx(LD,{children:$.name}),s.jsx(ND,{children:$.address}),s.jsx($D,{children:$.phone})]}),s.jsx(FD,{children:s.jsx(_D,{onClick:()=>F($.id),children:"Delete"})})]},$.id))})]}),s.jsxs(BD,{children:[s.jsx(cf,{children:"비밀번호 변경"}),s.jsx(UD,{onClick:()=>{r(!0)},children:"비밀번호 변경하기"})]}),s.jsxs(zD,{children:[s.jsx(V0,{onClick:()=>{o(!0)},children:"로그아웃"}),s.jsx(V0,{onClick:()=>{l(!0)},children:"회원탈퇴"})]}),n&&s.jsx(oD,{onClose:()=>{r(!1)}}),i&&s.jsx(cD,{onClose:()=>{o(!1)}}),a&&s.jsx(mD,{onClose:()=>{l(!1)}})]})]})},jD=u.div` + display: flex; + flex-direction: column; + gap: 5px; +`,Q0=u.span` + color: #000; + font-size: 16px; +`,sf=u.input` + width: 60px; + height: 25px; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 13px; + padding: 5px 10px; + box-shadow: none; + outline: none; + transition: border-color 0.3s ease; + text-align: center; + + &:focus { + border-color: #000; + } +`,CD=u.div` + display: flex; + align-items: center; + gap: 8px; +`,af=u.div` + font-size: 12px; + color: #131118; + margin-top: 15px; + margin-bottom: 5px; +`,lf=u.div` + display: flex; + flex-direction: column; +`,SD=u.div` + display: flex; + gap: 20px; + align-items: flex-end; +`,PD=u.div` + background-color: #000; + color: #fff; + border-radius: 5px; + padding: 5px 15px; + text-align: center; + cursor: pointer; + width: 90px; + height: 25px; + display: flex; + align-items: center; + justify-content: center; +`,ED=u.div` + margin-top: 5px; + font-size: 12px; + color: #555; +`,kD=u.div` + display: flex; + align-items: center; + gap: 15px; +`,RD=u.div``,AD=u.div` + display: inline-flex; + justify-content: center; + background-color: #f1f1f1; + border: 1px solid #ccc; + border-radius: 5px; + padding: 10px 20px; + text-align: center; + cursor: pointer; + flex: 1; + max-width: 175px; + + &:hover { + background-color: #ddd; + } +`,ID=u.div` + display: inline-flex; + justify-content: center; + background-color: #ffeded; + border: 1px solid #f5c6cb; + border-radius: 5px; + padding: 10px 20px; + text-align: center; + cursor: pointer; + color: #d9534f; + flex: 1; + max-width: 175px; + + &:hover { + background-color: #f8d7da; + } +`,OD=u.div` + display: flex; + gap: 10px; + margin-top: 10px; + width: 350px; +`,_D=u.div` + display: inline-flex; + justify-content: center; + background-color: #ffeded; + border: 1px solid #f5c6cb; + border-radius: 5px; + padding: 5px 10px; + cursor: pointer; + color: #d9534f; + + &:hover { + background-color: #f8d7da; + } +`,DD=u.div` + margin-top: 20px; +`,TD=u.div` + display: flex; + justify-content: space-between; + align-items: center; + padding: 10px; + border-bottom: 1px solid #ddd; + border-radius: 5px; + margin-bottom: 10px; +`,MD=u.div` + display: flex; + flex-direction: column; +`,LD=u.div` + font-size: 14px; + font-weight: bold; +`,ND=u.div` + font-size: 12px; + color: #555; + margin-top: 5px; +`,$D=u.div` + font-size: 12px; + color: #555; + margin-top: 5px; +`,FD=u.div` + display: flex; + gap: 10px; + flex-direction: column; +`,V0=u.div` + margin-top: 20px; + cursor: pointer; +`,zD=u.div` + margin-top: 10px; +`,UD=u.div` + margin-top: 10px; + background-color: #000; + color: #fff; + border-radius: 5px; + padding: 10px 20px; + display: inline-flex; + align-items: center; + justify-content: center; + cursor: pointer; +`,BD=u.div` + margin-top: 30px; +`,WD=u.div` + margin-top: 10px; + background-color: #000; + color: #fff; + border-radius: 5px; + padding: 10px 50px; + display: inline-flex; + align-items: center; + justify-content: center; + cursor: pointer; +`,HD=u.div` + margin-top: 30px; +`,aj=u.input` + width: 150px; + height: 25px; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 13px; + padding: 5px 10px; + box-shadow: none; + outline: none; + transition: border-color 0.3s ease; + + &:focus { + border-color: #000; + } +`,QD=u.div` + margin-top: 10px; + background-color: #000; + color: #fff; + border-radius: 5px; + padding: 10px 50px; + display: inline-flex; + align-items: center; + justify-content: center; + cursor: pointer; + margin-left: 15px; +`,VD=u(aj)` + width: 350px; +`,cf=u.div` + font-size: 12px; + color: #131118; +`,KD=u.div` + margin-top: 20px; +`,GD=u.div` + background-color: #000; + color: #fff; + border-radius: 5px; + padding: 10px 20px; + display: inline-flex; + align-items: center; + justify-content: center; + cursor: pointer; +`,qD=u.div` + display: inline-flex; + align-items: center; + justify-content: space-between; + width: 100%; +`,JD=()=>{const[e,t]=C.useState(!1),[n,r]=C.useState([]),[i,o]=C.useState(""),a=Ie(),l=()=>{t(!0)},c=async()=>{await Q_({paymentKey:i,cancelReason:"test"}),t(!1)},d=()=>{t(!1)},p=f=>{switch(f){case"PENDING":return"결제 대기 중";case"AUTH_COMPLETED":return"결제 요청 인증 성공";case"DONE":return"결제 완료";case"FAILED":return"결제 실패";case"CANCELED":return"결제 취소";case"PARTIAL_CANCELED":return"부분 취소";default:return"알 수 없는 상태"}};return C.useEffect(()=>{(async()=>{const h=await z_();r(h)})()},[]),s.jsxs(XD,{children:[s.jsx(ZD,{children:n.map((f,h)=>s.jsxs(eT,{children:[s.jsxs(YD,{children:[s.jsx(tT,{children:s.jsx(nT,{})}),s.jsxs(rT,{children:[s.jsx(iT,{children:f.productName}),s.jsxs(oT,{children:["Quantity: ",f.quantity]}),s.jsx(sT,{children:p(f.paymentStatus)})]})]}),s.jsxs(aT,{children:[f.price,"원"]}),s.jsxs(lT,{children:[s.jsx(cT,{onClick:()=>{a(`/products/${f.postId}`)},children:"상품 페이지 이동"}),f.paymentStatus==="DONE"&&s.jsx(uT,{onClick:()=>{l(),f.payment_key&&o(f.payment_key)},children:"주문 취소/환불"}),f.paymentStatus==="DONE"&&s.jsxs(dT,{onClick:()=>{a(`/products/${f.postId}`)},children:[s.jsx(fT,{src:"/images/qricon.png",alt:"review icon"}),s.jsx("span",{children:"리뷰 작성하기"})]})]})]},h))}),e&&s.jsx(pT,{children:s.jsxs(hT,{children:[s.jsx(mT,{children:"주문을 취소/환불하시겠습니까?"}),s.jsxs(gT,{children:[s.jsx(lj,{onClick:c,children:"Yes"}),s.jsx(xT,{onClick:d,children:"No"})]})]})})]})},YD=u.div` + display: inline-flex; + flex-direction: row; + width: 400px; +`,XD=u.div` + width: 100%; + margin: 20px 0; +`,ZD=u.div` + display: flex; + flex-direction: column; + gap: 20px; +`,eT=u.div` + display: flex; + align-items: center; + justify-content: space-between; + padding: 20px; + border: 1px solid #ddd; + border-radius: 8px; + background-color: #fff; +`,tT=u.div` + flex-shrink: 0; +`,nT=u.div` + width: 60px; + height: 60px; + background-color: #f0f0f0; + border-radius: 8px; +`,rT=u.div` + margin-left: 20px; +`,iT=u.div` + font-size: 16px; + font-weight: bold; +`,oT=u.div` + font-size: 14px; + color: #555; + margin-top: 4px; +`,sT=u.div` + margin-top: 10px; + font-size: 12px; + font-weight: bold; + color: #000; +`,aT=u.div` + font-size: 16px; + font-weight: bold; +`,lT=u.div` + display: flex; + flex-direction: column; + gap: 10px; +`,cT=u.div` + background: #fff; + color: #131118; + border: 1px solid #131118; + padding: 10px 10px; + border-radius: 8px; + cursor: pointer; + &:hover { + background: #131118; + color: #fff; + } +`,uT=u.div` + background: #fff; + color: #ff7262; + border: 1px solid #ff7262; + padding: 10px 10px; + border-radius: 8px; + cursor: pointer; + display: inline-flex; + justify-content: center; + transition: all 0.3s ease; + + &:hover { + background: #ff7262; + color: #fff; + } +`,dT=u.div` + display: flex; + align-items: center; + gap: 4px; + cursor: pointer; + margin-top: 8px; + + span { + border-bottom: 1px solid #131118; + } +`,fT=u.img` + width: 16px; + height: 16px; +`,pT=u.div` + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +`,hT=u.div` + background-color: white; + padding: 24px; + border-radius: 8px; + width: 300px; + text-align: center; +`,mT=u.p` + margin-bottom: 20px; + font-size: 16px; +`,gT=u.div` + display: flex; + justify-content: center; + gap: 12px; +`,lj=u.button` + padding: 8px 24px; + border-radius: 4px; + border: 1px solid #ff7262; + background-color: #fff; + color: #ff7262; + cursor: pointer; + transition: all 0.3s ease; + + &:hover { + background-color: #ff7262; + color: #fff; + } +`,xT=u(lj)` + border: 1px solid #131118; + color: #131118; + + &:hover { + background-color: #131118; + color: #fff; + } +`,yT=()=>{const[e,t]=C.useState([]),n=Ie();return C.useEffect(()=>{(async()=>{const i=await U_();t(i)})()},[]),s.jsx(wT,{children:s.jsx(bT,{children:e.map((r,i)=>s.jsxs(jT,{children:[s.jsxs(vT,{children:[s.jsx(CT,{children:s.jsx(ST,{})}),s.jsxs(PT,{children:[s.jsx(ET,{children:r.productName}),s.jsxs(kT,{children:["Quantity: ",r.quantity]}),s.jsx(RT,{status:r.paymentStatus,children:r.paymentStatus==="CANCELED"?"취소":"대기 중"})]})]}),s.jsxs(AT,{children:[r.price,"원"]}),s.jsx(OT,{children:s.jsx(IT,{onClick:()=>{n(`/products/${r.postId}`)},children:"상품 페이지 이동"})})]},i))})})},vT=u.div` + display: inline-flex; + flex-direction: row; + width: 400px; +`,wT=u.div` + width: 100%; + margin: 20px 0; +`,bT=u.div` + display: flex; + flex-direction: column; + gap: 20px; +`,jT=u.div` + display: flex; + align-items: center; + justify-content: space-between; + padding: 20px; + border: 1px solid #ddd; + border-radius: 8px; + background-color: #fff; +`,CT=u.div` + flex-shrink: 0; +`,ST=u.div` + width: 60px; + height: 60px; + background-color: #f0f0f0; + border-radius: 8px; +`,PT=u.div` + margin-left: 20px; +`,ET=u.div` + font-size: 16px; + font-weight: bold; +`,kT=u.div` + font-size: 14px; + color: #555; + margin-top: 4px; +`,RT=u.div` + margin-top: 10px; + font-size: 12px; + font-weight: bold; + color: ${e=>e.status==="환불 처리 중"?"#dc3545":"#007bff"}; +`,AT=u.div` + font-size: 16px; + font-weight: bold; +`,IT=u.div` + background: #fff; + color: #131118; + border: 1px solid #131118; + padding: 10px 10px; + border-radius: 8px; + cursor: pointer; + &:hover { + background-color: #131118; + color: #fff; + } +`,OT=u.div` + display: flex; + flex-direction: column; + gap: 10px; +`,_T=()=>{const[e,t]=C.useState([]),n=Ie();C.useEffect(()=>{(async()=>{try{const o=await B_();t(o)}catch(o){console.error("failed",o)}})()},[]);const r=i=>DT[i]||"알 수 없는 상태";return s.jsx(MT,{children:s.jsx(LT,{children:e.map((i,o)=>s.jsxs(NT,{children:[s.jsxs(TT,{children:[s.jsx($T,{children:i.imageUrls[0]!==""?s.jsx("img",{src:i.imageUrls[0],width:60,height:60}):s.jsx(FT,{})}),s.jsxs(zT,{children:[s.jsx(UT,{children:i.title}),s.jsxs(BT,{children:["Quantity: ",i.availableNumber]}),s.jsx(WT,{children:r(i.status)})]})]}),s.jsxs(HT,{children:[i.unitAmount,"원"]}),s.jsxs(QT,{children:[s.jsx(VT,{onClick:()=>{n(`/community/post/${i.communityPostId}`)},children:"상품 페이지 이동"}),i.status==="APPROVED"&&s.jsxs(s.Fragment,{children:[s.jsx(JT,{children:"QR 코드 확인"}),s.jsxs(GT,{children:[s.jsx(qT,{src:"/images/qricon.png",alt:"review icon"}),s.jsx("span",{children:"리뷰 작성하기"})]})]}),i.status==="NOT_APPROVED"&&s.jsx(s.Fragment,{children:s.jsx(KT,{children:"주문 취소하기"})})]})]},o))})})},DT={NOT_APPROVED:"승인대기",APPROVED:"승인완료",PAYMENT_STANDBY:"결제 대기",PAYMENT_COMPLETED:"결제 완료",REJECTED:"승인 거절",DELETED:"글 삭제"},TT=u.div` + display: inline-flex; + flex-direction: row; + width: 400px; +`,MT=u.div` + width: 100%; + margin: 20px 0; +`,LT=u.div` + display: flex; + flex-direction: column; + gap: 20px; +`,NT=u.div` + display: flex; + align-items: center; + justify-content: space-between; + padding: 20px; + border: 1px solid #ddd; + border-radius: 8px; + background-color: #fff; +`,$T=u.div` + flex-shrink: 0; +`,FT=u.div` + width: 60px; + height: 60px; + background-color: #f0f0f0; + border-radius: 8px; +`,zT=u.div` + margin-left: 20px; +`,UT=u.div` + font-size: 16px; + font-weight: bold; +`,BT=u.div` + font-size: 14px; + color: #555; + margin-top: 4px; +`,WT=u.div` + margin-top: 10px; + font-size: 12px; + font-weight: bold; + color: #000; +`,HT=u.div` + font-size: 16px; + font-weight: bold; +`,QT=u.div` + display: flex; + flex-direction: column; + gap: 10px; +`,VT=u.div` + background: #fff; + color: #131118; + border: 1px solid #131118; + padding: 10px 10px; + border-radius: 8px; + cursor: pointer; + &:hover { + background-color: #131118; + color: #fff; + } +`,KT=u.div` + background: #fff; + color: #ff7262; + border: 1px solid #ff7262; + padding: 10px 10px; + border-radius: 8px; + cursor: pointer; + display: inline-flex; + justify-content: center; + transition: all 0.3s ease; + + &:hover { + background: #ff7262; + color: #fff; + } +`,GT=u.div` + display: flex; + align-items: center; + gap: 4px; + cursor: pointer; + margin-top: 8px; + + span { + border-bottom: 1px solid #000; + } +`,qT=u.img` + width: 16px; + height: 16px; +`,JT=u.div` + background: #fff; + color: #131118; + border: 1px solid #131118; + padding: 10px 10px; + border-radius: 8px; + cursor: pointer; + display: inline-flex; + justify-content: center; + &:hover { + background: #131118; + color: #fff; + } +`;function YT(){const[e,t]=C.useState("order"),n=()=>{switch(e){case"order":return s.jsx(JD,{});case"refund":return s.jsx(yT,{});case"group":return s.jsx(_T,{});default:return null}};return s.jsxs(jt.Wrapper,{children:[s.jsx(hi,{}),s.jsxs(jt.Content,{children:[s.jsxs(XT,{children:[s.jsx(uf,{$isActive:e==="order",onClick:()=>t("order"),children:"주문내역"}),s.jsx(uf,{$isActive:e==="refund",onClick:()=>t("refund"),children:"환불내역"}),s.jsx(uf,{$isActive:e==="group",onClick:()=>t("group"),children:"공동구매 참여내역"})]}),n()]})]})}const XT=u.div` + display: flex; +`,uf=u.div` + padding: 10px 20px; + cursor: pointer; + font-size: 16px; + font-weight: ${e=>e.$isActive?"bold":"500"}; + color: ${e=>e.$isActive?"#000":"#555"}; + position: relative; + + &:after { + content: ''; + position: absolute; + bottom: -1px; + left: 0; + right: 0; + height: ${e=>e.$isActive?"2px":"0"}; + background-color: #000; + transition: height 0.3s ease; + } +`;function ZT(){const[e,t]=C.useState(rD),n=r=>{t(i=>i.filter(o=>o.id!==r))};return s.jsxs(jt.Wrapper,{children:[s.jsx(hi,{}),s.jsxs(jt.Content,{children:[s.jsx(t6,{children:"찜한 상품"}),s.jsx(r6,{children:s.jsx(i6,{children:e.map(r=>s.jsxs(o6,{children:[s.jsxs(n6,{children:[s.jsx(s6,{children:r.thumb!==""?s.jsx("img",{src:r.thumb,alt:r.name,width:60,height:60}):s.jsx(a6,{})}),s.jsxs(l6,{children:[s.jsx(c6,{children:r.name}),s.jsxs(u6,{children:["수량: ",r.quantity]})]})]}),s.jsx(d6,{children:r.price}),s.jsx(f6,{children:s.jsx(e6,{src:"/images/wish_on.png",onClick:()=>n(r.id),alt:"찜하기"})})]},r.id))})})]})]})}const e6=u.img` + width: 24px; + height: 24px; + cursor: pointer; + transition: transform 0.2s; + + &:hover { + transform: scale(1.1); + } +`,t6=u.div` + font-size: 16px; + font-weight: bold; +`,n6=u.div` + display: inline-flex; + flex-direction: row; + width: 400px; +`,r6=u.div` + width: 100%; + margin: 20px 0; +`,i6=u.div` + display: flex; + flex-direction: column; + gap: 20px; +`,o6=u.div` + display: flex; + align-items: center; + justify-content: space-between; + padding: 20px; + border: 1px solid #ddd; + border-radius: 8px; + background-color: #fff; +`,s6=u.div` + flex-shrink: 0; +`,a6=u.div` + width: 60px; + height: 60px; + background-color: #f0f0f0; + border-radius: 8px; +`,l6=u.div` + margin-left: 20px; +`,c6=u.div` + font-size: 16px; + font-weight: bold; +`,u6=u.div` + font-size: 14px; + color: #555; + margin-top: 4px; +`,d6=u.div` + font-size: 16px; + font-weight: bold; +`,f6=u.div` + display: flex; + flex-direction: column; + gap: 10px; +`,p6=e=>new Promise((t,n)=>{if(document.getElementById("kakao-map-script")){t(window.kakao);return}const r=document.createElement("script");r.id="kakao-map-script",r.src=`https://dapi.kakao.com/v2/maps/sdk.js?appkey=${e}&libraries=services&autoload=false`,r.onload=()=>{window.kakao.maps.load(()=>t(window.kakao))},r.onerror=()=>n(new Error("카카오맵 스크립트를 로드할 수 없습니다.")),document.head.appendChild(r)}),cj=({latitude:e,longitude:t,appKey:n,width:r})=>{const i=C.useRef(null);return C.useEffect(()=>{(async()=>{try{const a=await p6(n);if(!i.current)return;const l={center:new a.maps.LatLng(e,t),level:3},c=new a.maps.Map(i.current,l),d=new a.maps.LatLng(e,t);new a.maps.Marker({position:d}).setMap(c)}catch(a){console.error("카카오맵 초기화 중 오류 발생:",a)}})()},[e,t,n]),s.jsx("div",{ref:i,style:{width:`${r}px`,height:"350px"}})};function h6(){const[e,t]=C.useState(null),[n,r]=C.useState(null),[i,o]=C.useState(!1);return C.useEffect(()=>{navigator.geolocation&&!i&&navigator.geolocation.getCurrentPosition(a=>{const{latitude:l,longitude:c}=a.coords;t({latitude:l,longitude:c}),window.kakao&&new window.kakao.maps.services.Geocoder().coord2RegionCode(c,l,(p,f)=>{var h,j,x;if(f===window.kakao.maps.services.Status.OK){const g=`${((h=p[0])==null?void 0:h.region_1depth_name)||""} ${((j=p[0])==null?void 0:j.region_2depth_name)||""} ${((x=p[0])==null?void 0:x.region_3depth_name)||""}`;r(g),o(!0)}else console.error("주소를 가져오지 못했습니다.")})},a=>{console.error("위치 정보를 가져올 수 없습니다:",a)})},[e]),s.jsxs(jt.Wrapper,{children:[s.jsx(hi,{}),s.jsxs(jt.Content,{children:[s.jsx(y6,{children:"동네 인증"}),s.jsxs(x6,{children:[e?s.jsx(cj,{latitude:e.latitude,longitude:e.longitude,appKey:"af7394f12b174cad35e87960ddccf91f",width:600}):s.jsx("p",{children:"위치 정보를 불러오는 중..."}),s.jsxs(g6,{children:["현재 위치가 내 동네로 설정한 ",n||"00동","에 있습니다."]}),s.jsx(m6,{onClick:async()=>{n&&await F_({newAddress:n})},children:"동네인증 완료하기"})]})]})]})}const m6=u.div` + background-color: #000; + color: #fff; + border-radius: 5px; + width: 445px; + height: 56px; + display: inline-flex; + align-items: center; + justify-content: center; + cursor: pointer; +`,g6=u.div` + color: #88868c; +`,x6=u.div` + display: inline-flex; + align-items: center; + justify-content: center; + width: 100%; + flex-direction: column; + gap: 20px; +`,y6=u.div` + font-size: 16px; + font-weight: bold; + margin-bottom: 20px; +`;function v6(){const[e,t]=C.useState(!1),[n,r]=C.useState({bank:"신한은행",owner:"굿바이어",accountNumber:"111-111-111111"}),[i,o]=C.useState(n),a=()=>{o(n),t(!0)},l=()=>{t(!1)},c=()=>{r(i),t(!1)},d=p=>{const{name:f,value:h}=p.target;o(j=>({...j,[f]:h}))};return s.jsxs(jt.Wrapper,{children:[s.jsx(hi,{}),s.jsxs(jt.Content,{children:[s.jsx(b6,{children:"환불계좌 관리"}),s.jsxs(w6,{children:["계좌는 1개만 등록 가능하며 본인명의 계좌만 등록/변경 가능합니다.",s.jsx("br",{}),"등록된 계좌는 현금결제 주문 취소 시 해당 계좌로 환불 금액이 입금되오니 정확하게 기입해 주시기 바랍니다."]}),s.jsx(j6,{children:s.jsxs(C6,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx(yi,{children:"은행명"}),s.jsx(yi,{children:"예금주"}),s.jsx(yi,{children:"계좌번호"}),s.jsx(yi,{children:" "})]})}),s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx(vi,{children:n.bank}),s.jsx(vi,{children:n.owner}),s.jsx(vi,{children:n.accountNumber}),s.jsx(vi,{children:s.jsxs(S6,{children:[s.jsx(P6,{onClick:a,children:"수정"}),s.jsx(E6,{children:"삭제"})]})})]})})]})}),e&&s.jsx(k6,{children:s.jsxs(R6,{children:[s.jsxs(A6,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx(yi,{children:"은행명"}),s.jsx(yi,{children:"예금주"}),s.jsx(yi,{children:"계좌번호"})]})}),s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx(vi,{children:s.jsx(df,{type:"text",name:"bank",value:i.bank,onChange:d})}),s.jsx(vi,{children:s.jsx(df,{type:"text",name:"owner",value:i.owner,onChange:d})}),s.jsx(vi,{children:s.jsx(df,{type:"text",name:"accountNumber",value:i.accountNumber,onChange:d})})]})})]}),s.jsxs(I6,{children:[s.jsx(O6,{onClick:c,children:"등록"}),s.jsx(_6,{onClick:l,children:"취소"})]})]})})]})]})}const w6=u.div` + color: #88868c; + margin-bottom: 20px; +`,b6=u.div` + font-size: 16px; + font-weight: bold; + margin-bottom: 20px; +`,j6=u.div` + width: 100%; + overflow-x: auto; + margin-top: 20px; + border-top: 1px solid #000; + border-bottom: 1px solid #000; +`,C6=u.table` + width: 100%; + border-collapse: collapse; + text-align: left; +`,yi=u.th` + padding: 12px; + background-color: #f9f9f9; + border-bottom: 1px solid #ddd; + font-size: 14px; + font-weight: bold; + color: #333; + text-align: center; +`,vi=u.td` + padding: 12px; + border-bottom: 1px solid #ddd; + font-size: 14px; + color: #555; + text-align: center; +`,S6=u.div` + display: flex; + gap: 10px; + justify-content: center; +`,P6=u.button` + padding: 8px 16px; + font-size: 14px; + color: #fff; + background-color: #333; + border: none; + border-radius: 4px; + cursor: pointer; +`,E6=u.button` + padding: 8px 16px; + font-size: 14px; + color: #333; + background-color: #fff; + border: 1px solid #333; + border-radius: 4px; + cursor: pointer; +`,k6=u.div` + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.8); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +`,R6=u.div` + background: #fff; + padding: 20px; + border-radius: 8px; + width: 500px; + max-width: 90%; + text-align: center; +`,A6=u.table` + width: 100%; + border-collapse: collapse; + margin-bottom: 20px; +`,df=u.input` + width: 100%; + padding: 8px; + font-size: 14px; + border: 1px solid #ddd; + border-radius: 4px; +`,I6=u.div` + display: flex; + justify-content: space-evenly; +`,O6=u.button` + padding: 10px 20px; + background-color: #333; + color: #fff; + border: none; + border-radius: 4px; + cursor: pointer; +`,_6=u.button` + padding: 10px 20px; + background-color: #fff; + color: #333; + border: 1px solid #333; + border-radius: 4px; + cursor: pointer; +`;function D6(){return s.jsxs(jt.Wrapper,{children:[s.jsx(hi,{}),s.jsxs(jt.Content,{children:[s.jsx(z6,{children:"알림내역"}),s.jsx(M6,{children:iD.map(e=>s.jsxs(L6,{children:[s.jsxs(T6,{children:[s.jsx(N6,{children:s.jsx("img",{src:"/images/"+e.icon+".png"})}),s.jsx($6,{children:e.title})]}),s.jsx(F6,{children:e.time})]},e.id))})]})]})}const T6=u.div` + display: inline-flex; + align-items: center; +`,M6=u.div` + border: 1px solid #000; + border-radius: 5px; + padding: 16px; + background: #fff; + height: 450px; +`,L6=u.div` + display: flex; + align-items: center; + padding: 12px 0; + border-bottom: 1px solid #ddd; + justify-content: space-between; + + &:last-child { + border-bottom: none; + } +`,N6=u.div` + font-size: 20px; + margin-right: 12px; + + img { + width: 22px; + height: 22px; + } +`,$6=u.div` + font-size: 14px; + color: #333; + margin-bottom: 4px; + display: inline-flex; + align-items: center; +`,F6=u.div` + font-size: 12px; + color: #000; +`,z6=u.div` + font-size: 16px; + font-weight: bold; + margin-bottom: 20px; +`;function U6(){const e=Ie(),[t,n]=C.useState(!1),[r,i]=C.useState([]),[o,a]=C.useState(""),l=()=>{n(!0)},c=()=>{n(!1)},d=p=>{const f=new Date(p),h=f.getFullYear(),j=String(f.getMonth()+1).padStart(2,"0"),x=String(f.getDate()).padStart(2,"0"),g=String(f.getHours()).padStart(2,"0"),S=String(f.getMinutes()).padStart(2,"0"),w=String(f.getSeconds()).padStart(2,"0");return`${h}-${j}-${x} ${g}:${S}:${w}`};return C.useEffect(()=>{(async()=>{try{const f=await W_();console.log(f),i(f)}catch(f){console.error("failed",f)}})()},[]),s.jsxs(jt.Wrapper,{children:[s.jsx(hi,{}),s.jsxs(jt.Content,{children:[s.jsx(K6,{children:"나의 게시글"}),s.jsx(B6,{children:s.jsxs(W6,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx(ff,{children:"제목"}),s.jsx(ff,{children:"날짜"}),s.jsx(ff,{children:" "})]})}),s.jsx("tbody",{children:r.map((p,f)=>s.jsxs("tr",{children:[s.jsx(pf,{children:p.title}),s.jsx(pf,{children:d(p.createdAt)}),s.jsx(pf,{children:s.jsxs(H6,{children:[s.jsx(Q6,{onClick:()=>{e(`/community/post/${p.communityPostId}`)},children:"수정"}),s.jsx(V6,{onClick:()=>{l(),a(p.communityPostId+"")},children:"삭제"})]})})]},f))})]})}),t&&s.jsx(G6,{children:s.jsxs(q6,{children:["삭제하시겠습니까?",s.jsxs(J6,{children:[s.jsx(Y6,{onClick:async()=>{n(!1),await H_(o)},children:"예"}),s.jsx(X6,{onClick:c,children:"아니요"})]})]})})]})]})}const B6=u.div` + width: 100%; + overflow-x: auto; + margin-top: 20px; + border-top: 1px solid #000; + border-bottom: 1px solid #000; +`,W6=u.table` + width: 100%; + border-collapse: collapse; + text-align: left; +`,ff=u.th` + padding: 12px; + background-color: #f9f9f9; + border-bottom: 1px solid #ddd; + font-size: 14px; + font-weight: bold; + color: #333; + text-align: center; +`,pf=u.td` + padding: 12px; + border-bottom: 1px solid #ddd; + font-size: 14px; + color: #555; + text-align: center; +`,H6=u.div` + display: flex; + gap: 10px; + justify-content: center; +`,Q6=u.button` + padding: 8px 16px; + font-size: 14px; + color: #fff; + background-color: #333; + border: none; + border-radius: 4px; + cursor: pointer; +`,V6=u.button` + padding: 8px 16px; + font-size: 14px; + color: #333; + background-color: #fff; + border: 1px solid #333; + border-radius: 4px; + cursor: pointer; +`,K6=u.div` + font-size: 16px; + font-weight: bold; + margin-bottom: 20px; +`,G6=u.div` + position: fixed; + top: 0; + left: 0; + width: 100vw; + height: 100vh; + background-color: rgba(0, 0, 0, 0.8); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +`,q6=u.div` + background: #fff; + padding: 20px; + border-radius: 8px; + width: 250px; + max-width: 90%; + text-align: center; +`,J6=u.div` + margin-top: 30px; + display: flex; + justify-content: space-evenly; +`,Y6=u.button` + padding: 10px 20px; + background-color: #333; + color: #fff; + border: none; + border-radius: 4px; + cursor: pointer; +`,X6=u.button` + padding: 10px 20px; + background-color: #fff; + color: #333; + border: 1px solid #333; + border-radius: 4px; + cursor: pointer; +`;function Z6(){return s.jsxs(jt.Wrapper,{children:[s.jsx(hi,{}),s.jsx(jt.Content,{children:"asd"})]})}const eM=()=>{const e=Ie(),[t,n]=C.useState(""),[r,i]=C.useState(!0),[o,a]=C.useState(!0),l=d=>{i(d.length>=2&&d.length<=15),a(/^[가-힣ㄱ-ㅎㅏ-ㅣa-zA-Z0-9]+$/.test(d))},c=d=>{const p=d.target.value;n(p),l(p)};return s.jsxs(sM,{children:[s.jsx(iM,{children:s.jsx("img",{src:"/images/login5.jpeg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"cover"}})}),s.jsxs(oM,{children:[s.jsxs(rM,{children:["굿바이어스에서 사용할",s.jsx("br",{}),"닉네임을 정해주세요"]}),s.jsx(nM,{placeholder:"닉네임을 입력해주세요",value:t,onChange:c}),s.jsx(K0,{isValid:r,children:"최소 2자 이상 ~ 15자 이내"}),s.jsx(K0,{isValid:o,children:"띄어쓰기 및 특수문자 사용 불가"}),s.jsx(tM,{onClick:async()=>{if(r&&o)try{(await dO({nickname:t})).message==="닉네임 중복 확인 완료"?(localStorage.setItem("nickname",t),e("/setprofile")):alert("닉네임이 중복입니다.")}catch(d){qe.isAxiosError(d)&&d.response&&d.response.data&&d.response.data.error&&alert(d.response.data.error)}else alert("닉네임 조건을 만족시켜 주세요.")},children:"Next"})]})]})},K0=u.div` + color: ${({isValid:e})=>e?"#858282":"#EF2626"}; + margin-top: 20px; + font-size: 12px; +`,tM=u.div` + background-color: #000; + color: #fff; + border-radius: 5px; + width: calc(100% - 20px); + height: 35px; + display: inline-flex; + align-items: center; + justify-content: center; + margin-top: 235px; + cursor: pointer; +`,nM=u.input` + width: calc(100% - 42px); + height: 25px; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 13px; + padding: 5px 10px; + box-shadow: none; + outline: none; + transition: border-color 0.3s ease; + + &:focus { + border-color: #000; + } +`,rM=u.div` + font-size: 30px; + font-weight: 900; + margin-bottom: 20px; +`,iM=u.div` + flex: 6; + background-color: #fff; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +`,oM=u.div` + flex: 4; + background-color: #fff; + display: flex; + align-items: flex-start; + justify-content: center; + flex-direction: column; + padding-left: 20px; +`,sM=u.div` + display: flex; + width: 100%; + height: 100vh; +`,aM=()=>{const e=Ie(),[t,n]=C.useState(null),[r,i]=C.useState(null),o=a=>{var c;const l=(c=a.target.files)==null?void 0:c[0];if(l){const d=new FileReader;d.onload=()=>{n(d.result)},d.readAsDataURL(l),i(l)}};return s.jsxs(gM,{children:[s.jsx(hM,{children:s.jsx("img",{src:"/images/login3.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"cover"}})}),s.jsxs(mM,{children:[s.jsxs(pM,{children:["프로필 사진을",s.jsx("br",{}),"추가해주세요"]}),s.jsxs(cM,{children:[s.jsx(lM,{htmlFor:"file-input",children:s.jsx("img",{src:t||"/images/origin.png",alt:"Profile Preview",width:217,height:217})}),s.jsx("input",{type:"file",id:"file-input",accept:"image/*",onChange:o,style:{display:"none"}}),"사진 추가하기"]}),s.jsx(fM,{onClick:async()=>{await T0(r),e("/logincomplete")},children:"Next"}),s.jsx(uM,{children:s.jsx(dM,{onClick:async()=>{await T0(null),e("/logincomplete")},children:"건너뛰기"})})]})]})},lM=u.label` + cursor: pointer; +`,cM=u.div` + display: inline-flex; + justify-content: center; + width: calc(100% - 10px); + flex-direction: column; + align-items: center; + font-size: 12px; + color: #858282; +`,uM=u.div` + display: inline-flex; + justify-content: center; + width: calc(100% - 20px); +`,dM=u.div` + color: #858282; + font-size: 12px; + margin-top: 30px; +`,fM=u.div` + background-color: #000; + color: #fff; + border-radius: 5px; + width: calc(100% - 20px); + height: 35px; + display: inline-flex; + align-items: center; + justify-content: center; + margin-top: 100px; + cursor: pointer; +`,pM=u.div` + font-size: 30px; + font-weight: 900; + margin-bottom: 20px; +`,hM=u.div` + flex: 6; + background-color: #fff; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +`,mM=u.div` + flex: 4; + background-color: #fff; + display: flex; + align-items: flex-start; + justify-content: center; + flex-direction: column; + padding-left: 20px; +`,gM=u.div` + display: flex; + width: 100%; + height: 100vh; +`,xM=()=>{const e=Ie();return s.jsxs(SM,{children:[s.jsx(jM,{children:s.jsx("img",{src:"/images/login-compl.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"cover"}})}),s.jsxs(CM,{children:[s.jsx(bM,{children:"회원가입 완료!"}),s.jsx(vM,{children:s.jsx("img",{src:"/images/check.png",alt:"check",width:120,height:120})}),s.jsxs(yM,{children:[s.jsx(G0,{children:"굿바이어스에 오신것을 환영합니다."}),s.jsx(G0,{children:"공동구매를 시작해보세요."})]}),s.jsx(wM,{onClick:()=>{e("/")},children:"메인으로 가기"})]})]})},G0=u.div` + color: #302f2f; +`,yM=u.div` + margin-top: 50px; + display: inline-flex; + align-items: center; + justify-content: center; + width: calc(100% - 20px); + flex-direction: column; + gap: 10px; +`,vM=u.div` + display: inline-flex; + justify-content: center; + width: calc(100% - 10px); + flex-direction: column; + align-items: center; + font-size: 12px; + color: #858282; + margin-top: 50px; +`,wM=u.div` + background-color: #000; + color: #fff; + border-radius: 5px; + width: calc(100% - 20px); + height: 35px; + display: inline-flex; + align-items: center; + justify-content: center; + margin-top: 80px; + cursor: pointer; +`,bM=u.div` + font-size: 30px; + font-weight: 900; + margin-bottom: 20px; +`,jM=u.div` + flex: 6; + background-color: #fff; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +`,CM=u.div` + flex: 4; + background-color: #fff; + display: flex; + align-items: flex-start; + justify-content: center; + flex-direction: column; + padding-left: 20px; +`,SM=u.div` + display: flex; + width: 100%; + height: 100vh; +`,PM=async(e,t)=>{try{const n=`/api/v1/main-payments?postId=${e}`;return(await se.post(n,t)).data.checkoutPageUrl}catch{throw new Error("결제에 실패하였습니다.")}},EM=()=>{const{quantity:e}=nj(),{id:t}=ao(),n=C.useMemo(()=>!t||isNaN(Number(t))?null:Number(t),[t]);if(!n)return s.jsx("p",{children:"잘못된 상품 ID입니다."});const{data:r,isLoading:i,isError:o}=jl(n);if(!r)return s.jsx("p",{children:"해당 상품을 찾을 수 없습니다."});const[a,l]=C.useState(""),[c,d]=C.useState(""),[p,f]=C.useState(""),[h,j]=C.useState(""),[x,g]=C.useState(""),S=()=>a.trim()?c.trim()?p.trim()?h.trim()?x?!0:(alert("결제 방법을 선택해주세요."),!1):(alert("배송 시 요청사항을 입력해주세요."),!1):(alert("상세 주소를 입력해주세요."),!1):(alert("기본 주소를 입력해주세요."),!1):(alert("수령인을 입력해주세요."),!1),w={productName:r.name,url:r.url,price:r.discountprice*e,quantity:e,payMethod:x,deliveryRequestDTO:{name:a,address:{street:c,detail:p},needed:h}},m=b=>{g(b.target.value)},v=async()=>{if(S())try{const b=await PM(n,w);window.location.href=b}catch(b){alert(`결제에 실패하였습니다 ${b}`)}};return s.jsx(s.Fragment,{children:s.jsx(lo,{isLoading:i,isError:o,children:s.jsxs(kM,{children:[s.jsxs(hf,{children:[s.jsx(gf,{children:"주문 상품 정보"}),s.jsxs(mf,{children:[s.jsxs(mh,{children:[s.jsx(AM,{children:r.name}),s.jsxs(IM,{children:[r.discountprice,"원"]})]}),s.jsx(mh,{children:s.jsxs(_M,{children:["수량 : ",e]})}),s.jsxs(RM,{children:[s.jsx("span",{children:"합계:"}),s.jsxs(OM,{children:[r.discountprice*e,"원"]})]})]})]}),s.jsxs(hf,{children:[s.jsx(gf,{children:"배송 정보 확인"}),s.jsxs(mf,{children:[s.jsx(xf,{children:s.jsxs(yf,{children:["수령인",s.jsx(cc,{children:s.jsx(zm,{type:"text",placeholder:"이름 입력",value:a,onChange:b=>l(b.target.value)})})]})}),s.jsxs(xf,{children:[s.jsx(yf,{children:"배송지"}),s.jsx(cc,{children:s.jsx(DM,{type:"text",placeholder:"기본 주소를 입력해주세요",value:c,onChange:b=>d(b.target.value)})}),s.jsx(cc,{children:s.jsx(TM,{type:"text",placeholder:"상세 주소를 입력해주세요",value:p,onChange:b=>f(b.target.value)})})]}),s.jsx(xf,{children:s.jsxs(yf,{children:["배송 시 요청사항",s.jsx(cc,{children:s.jsx(MM,{rows:2,placeholder:"요청사항 입력",value:h,onChange:b=>j(b.target.value)})})]})})]})]}),s.jsxs(hf,{children:[s.jsx(gf,{children:"결제 정보 확인"}),s.jsx(mf,{children:s.jsx(LM,{children:s.jsxs(NM,{children:[s.jsx($M,{type:"radio",name:"payment-method",value:"카드",onChange:m}),s.jsx(FM,{children:"카드 결제"})]})})})]}),s.jsxs(zM,{children:[s.jsx(WM,{onClick:()=>{v()},children:"결제하기"}),s.jsx(BM,{to:`/products/${r.id}`,children:"뒤로 가기"})]})]})})})},kM=u.div` + width: 100%; + max-width: 650px; + margin: 0 auto; + padding: 20px; + background-color: #f8fafc; +`,hf=u.div` + margin-bottom: 24px; + background-color: white; + border-radius: 12px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + overflow: hidden; +`,mf=u.div` + padding: 20px; +`,gf=u.h2` + font-size: 1.125rem; + font-weight: 600; + color: #1e293b; + padding: 16px; + border-bottom: 1px solid #e2e8f0; + margin: 0; +`,mh=u.div` + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 12px; +`,RM=u(mh)` + margin-top: 16px; + padding-top: 16px; + border-top: 1px solid #e2e8f0; + font-weight: 600; + color: #1e293b; +`,AM=u.span` + font-weight: 500; + color: #1e293b; +`,IM=u.span` + color: #1e293b; + font-weight: 500; +`,OM=u.span` + color: #2563eb; + font-weight: 600; + font-size: 1.125rem; +`,_M=u.span` + color: #64748b; + font-size: 0.875rem; +`,xf=u.div` + margin-bottom: 16px; + + &:last-child { + margin-bottom: 0; + } +`,yf=u.label` + display: block; + color: #475569; + font-size: 0.875rem; + margin-bottom: 4px; +`,zm=u.input` + width: 100%; + padding: 10px 12px; + margin-top: 4px; + border: 1px solid #e2e8f0; + border-radius: 8px; + font-size: 0.875rem; + transition: all 0.2s; + + &:focus { + outline: none; + border-color: #2563eb; + box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); + } + + &::placeholder { + color: #94a3b8; + } +`,cc=u.div` + display: flex; + gap: 8px; + margin-bottom: 8px; +`,DM=u(zm)` + flex-grow: 1; + cursor: pointer; +`,TM=u(zm)` + margin-top: 8px; +`,MM=u.textarea` + width: 100%; + padding: 10px 12px; + margin-top: 4px; + border: 1px solid #e2e8f0; + border-radius: 8px; + font-size: 0.875rem; + resize: vertical; + min-height: 80px; + transition: all 0.2s; + + &:focus { + outline: none; + border-color: #2563eb; + box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); + } + + &::placeholder { + color: #94a3b8; + } +`,LM=u.div` + display: flex; + flex-direction: column; + gap: 12px; +`,NM=u.label` + display: flex; + align-items: center; + cursor: pointer; +`,$M=u.input` + width: 18px; + height: 18px; + margin: 0; + cursor: pointer; + + &:checked { + accent-color: #2563eb; + } +`,FM=u.span` + margin-left: 8px; + color: #1e293b; + font-size: 0.875rem; +`,zM=u.div` + display: flex; + gap: 12px; + margin-top: 32px; +`,UM=u.button` + flex: 1; + padding: 12px; + border-radius: 8px; + font-weight: 600; + font-size: 0.875rem; + cursor: pointer; + transition: all 0.2s; +`,BM=u(Gn)` + text-decoration: none; /* 링크의 기본 밑줄 제거 */ + display: flex; /* 버튼 스타일 유지 */ + justify-content: center; + align-items: center; + + background-color: white; + border: 1px solid #e2e8f0; + color: #475569; + border-radius: 8px; + padding: 12px; + font-weight: 600; + font-size: 0.875rem; + cursor: pointer; + transition: all 0.2s; + + &:hover { + cursor: pointer; + background-color: #f8fafc; + } +`,WM=u(UM)` + background-color: #2563eb; + border: none; + color: white; + + &:hover { + cursor: pointer; + background-color: #1d4ed8; + } +`,HM=()=>{const{id:e}=ao();if(!e)return s.jsx("p",{children:"상품 번호가 유실되었습니다."});const t=Number(e),n=window.location.search,i=new URLSearchParams(n).get("price"),{data:o,isLoading:a,isError:l}=jl(t);return o?s.jsx(s.Fragment,{children:s.jsx(lo,{isLoading:a,isError:l,children:s.jsxs(QM,{children:[s.jsxs(VM,{children:[s.jsx(KM,{children:"결제 완료"}),s.jsx(GM,{children:"주문해주셔서 감사합니다!"}),s.jsxs(qM,{children:[s.jsxs(q0,{children:[s.jsx(J0,{children:"상품명"}),s.jsx(Y0,{children:o==null?void 0:o.name})]}),s.jsxs(q0,{children:[s.jsx(J0,{children:"결제 금액"}),s.jsxs(Y0,{children:[i,"원"]})]})]})]}),s.jsxs(JM,{children:[s.jsx(YM,{to:"/mypage/orderlist",children:"주문 내역 보기"}),s.jsx(XM,{to:"/",children:"메인으로 돌아가기"})]})]})})}):s.jsx("p",{children:"해당 상품을 찾을 수 없습니다."})},QM=u.div` + width: 100%; + max-width: 650px; + margin: 0 auto; + padding: 20px; + background-color: #f8fafc; + display: flex; + flex-direction: column; + align-items: center; +`,VM=u.div` + width: 100%; + background-color: white; + border-radius: 12px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + padding: 32px 20px; + text-align: center; + margin-bottom: 24px; +`,KM=u.h1` + font-size: 1.5rem; + font-weight: 700; + color: #1e293b; + margin-bottom: 12px; +`,GM=u.p` + color: #64748b; + font-size: 1rem; + margin-bottom: 24px; +`,qM=u.div` + background-color: #f8fafc; + border-radius: 8px; + padding: 16px; + margin-top: 20px; +`,q0=u.div` + display: flex; + justify-content: space-between; + margin-bottom: 12px; + + &:last-child { + margin-bottom: 0; + } +`,J0=u.span` + color: #64748b; + font-size: 0.875rem; +`,Y0=u.span` + color: #1e293b; + font-weight: 500; +`,JM=u.div` + display: flex; + gap: 12px; + width: 100%; +`,uj=u(Gn)` + flex: 1; + text-decoration: none; + display: flex; + justify-content: center; + align-items: center; + padding: 12px; + border-radius: 8px; + font-weight: 600; + font-size: 0.875rem; + cursor: pointer; + transition: all 0.2s; +`,YM=u(uj)` + background-color: #2563eb; + border: none; + color: white; + + &:hover { + background-color: #1d4ed8; + } +`,XM=u(uj)` + background-color: white; + border: 1px solid #e2e8f0; + color: #475569; + + &:hover { + background-color: #f8fafc; + } +`,ZM=()=>{const{pathname:e}=it();return C.useEffect(()=>{window.scrollTo(0,0)},[e]),null},eL=()=>{const{communityPostId:e}=ao(),t=Ie(),[n]=$t(A3),[,r]=$t(si),[i,o]=C.useState({}),[a,l]=C.useState(""),[c,d]=C.useState(),[p,f]=C.useState(),[h,j]=C.useState(!1),[x,g]=C.useState(""),[S,w]=C.useState(""),[m,v]=C.useState([]),[b,E]=C.useState(-1),[P,k]=C.useState(""),[R,I]=C.useState(!1),[D,_]=C.useState(),N=Number(e),F=["post",N];if(!N){alert("유효하지 않은 게시물 ID입니다.");return}C.useEffect(()=>{N?r(N):(alert("잘못된 게시물 ID입니다."),t("/community/post"))},[N,r,t]);const{data:$,isError:X}=Pm({queryKey:F,queryFn:async()=>Sl(N)});C.useEffect(()=>{var ie,Pe,ct,tn,El,kl,Us,Rl,Al;$&&(o((ie=n.data)==null?void 0:ie.communityPost),g((Pe=n.data)==null?void 0:Pe.communityPost.title),w((ct=n.data)==null?void 0:ct.communityPost.description),v(((tn=n.data)==null?void 0:tn.communityPost.imageUrls)||[]),l(((El=n.data)==null?void 0:El.communityPost.category)||"생활용품"),d((kl=n.data)==null?void 0:kl.communityPost.availableNumber),f((Us=n.data)==null?void 0:Us.communityPost.totalAmount),k((Rl=n.data)==null?void 0:Rl.communityPost.productUrl),_((Al=n.data)==null?void 0:Al.communityPost.period))},[$]);const ue=()=>{j(!h)},oe=ie=>{_(ie),j(!1)},H=async()=>{if(!x||!c||!p||!D||m.length===0||!P||!S){alert("모든 필수 정보를 입력하세요.");return}if(!Ce(P)){I(!0);return}C.useEffect(()=>{X&&(alert("게시물을 불러오는 데 실패했습니다."),t("/community/post"))},[X,t]);const ie={...i,title:x,description:S,imageUrls:m,category:a||"생활용품",availableNumber:c,totalAmount:p,unitAmount:Math.floor(p/c),productUrl:P};try{await b3(Number(e),ie),alert("게시글이 성공적으로 수정되었습니다."),t(`/mypage/post/${e}`)}catch{alert("게시글 수정에 실패했습니다. 다시 시도해주세요.")}},V=ie=>{const Pe=ie.target.value.replace(/[^0-9]/g,""),ct=Number(Pe);Pe===""||ct<=0?d(void 0):d(ct)},ee=ie=>{const Pe=ie.target.value.replace(/[^0-9]/g,""),ct=Number(Pe);Pe===""||ct<=0?f(void 0):f(ct)},B=()=>{t(`/mypage/post/${e}`)},Q=ie=>{const Pe=ie.replace(/\D/g,"");return new Intl.NumberFormat().format(Number(Pe))},ae=p&&c?Q(String(Math.floor(p/c))):"자동 계산",le=ie=>{if(ie.target.files){const Pe=Array.from(ie.target.files).filter(ct=>ct instanceof File);v(ct=>[...ct,...Pe])}},he=()=>{b>=0&&v(ie=>{const Pe=ie.filter((ct,tn)=>tn!==b);if(Pe.length>0){const ct=b>=Pe.length?b-1:b;E(ct)}else E(-1);return Pe})},me=()=>{bie+1):b===m.length-1&&E(-1)},te=()=>{E(b===-1?m.length-1:ie=>Math.max(ie-1,0))},de=ie=>{E(ie)},Ce=ie=>!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|(\\d{1,3}\\.){3}\\d{1,3})(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(ie),mn=ie=>{k(ie.target.value),I(!Ce(ie.target.value))},We=async()=>{if(!i){alert("삭제할 게시글이 존재하지 않습니다.");return}if(window.confirm("정말 이 게시글을 삭제하시겠습니까?"))try{await qb(Number(e)),alert("게시글이 성공적으로 삭제되었습니다."),t("/mypage/post")}catch{alert("게시글 삭제에 실패했습니다. 다시 시도해주세요.")}};return s.jsx("div",{children:s.jsx(tL,{children:s.jsxs(nL,{children:[s.jsx(rL,{children:"공구 모집 및 진행"}),s.jsxs(iL,{children:[s.jsxs(oL,{children:[s.jsxs(sL,{children:[s.jsxs(aL,{children:[s.jsx(dL,{children:m.length>0&&(b>0||b===-1)&&s.jsx(pL,{onClick:te,children:s.jsx(Zu,{size:20})})}),b===-1?s.jsxs(cL,{children:[s.jsx(Dm,{size:30}),"이미지 추가",s.jsx("input",{type:"file",multiple:!0,accept:"image/*",onChange:le})]}):s.jsxs(lL,{children:[s.jsx("img",{src:co(m[b]),alt:"이미지 미리보기"}),s.jsx(uL,{onClick:he,children:s.jsx(_m,{size:30})})]}),s.jsx(fL,{children:m.length>0&&b!==-1&&s.jsx(hL,{onClick:me,children:s.jsx(ed,{size:20})})})]}),s.jsx(mL,{children:m.length>0&&s.jsx(gL,{children:m.map((ie,Pe)=>s.jsx("span",{className:b===Pe?"active":"",onClick:()=>de(Pe)},Pe))})}),s.jsxs(xL,{children:[s.jsxs(yL,{children:[s.jsx(bo,{htmlFor:"urlInput",children:"URL 주소"}),s.jsx(vL,{id:"urlInput",type:"text",placeholder:"상품 관련 URL 주소를 입력해주세요.",value:P,onChange:mn,isError:R,spellCheck:!1})]}),R&&s.jsx(wL,{children:"올바른 URL을 입력해주세요."})]})]}),s.jsxs(bL,{children:[s.jsxs(jL,{children:[s.jsxs(ua,{children:[s.jsx(bo,{children:"제목"}),s.jsx(CL,{placeholder:"제목을 입력해주세요.",value:x,onChange:ie=>g(ie.target.value),spellCheck:!1})]}),s.jsxs(SL,{children:[s.jsx(PL,{children:"카테고리 선택"}),s.jsx(EL,{categories:nl,selectedCategory:a,onCategoryChange:ie=>l(ie)})]})]}),s.jsxs(kL,{children:[s.jsxs(ua,{children:[s.jsx(bo,{children:"참여 필요 수량 선택"}),s.jsx(vf,{type:"text",placeholder:"수량 입력",value:c,onChange:V})]}),s.jsxs(ua,{children:[s.jsx(bo,{children:"모집 마감 기한 설정"}),s.jsxs(RL,{children:[s.jsxs(AL,{onClick:ue,children:[D,s.jsx(_b,{})]}),h&&s.jsx(IL,{children:Array.from({length:7},(ie,Pe)=>s.jsxs(OL,{onClick:()=>oe(Pe+1),isSelected:D===Pe+1,children:[Pe+1,"일"]},Pe))})]})]}),s.jsxs(_L,{children:[s.jsxs(ua,{children:[s.jsx(bo,{children:"총 가격 설정"}),s.jsx(vf,{type:"text",placeholder:"총 가격 입력",value:Q("totalAmount"),onChange:ee})," 원"]}),s.jsxs(ua,{children:[s.jsx(bo,{children:"개당 가격"}),s.jsx(vf,{disabled:!0,value:Q(ae)})," 원"]})]})]})]})]}),s.jsx(DL,{children:s.jsx(TL,{placeholder:"내용을 입력해주세요.",value:S,onChange:ie=>w(ie.target.value),spellCheck:!1})}),s.jsxs(ML,{children:[s.jsx(wf,{onClick:H,children:"확인"}),s.jsx(wf,{onClick:B,children:"취소"}),s.jsx(wf,{onClick:We,children:"삭제"})]})]})]})})})},tL=u.div` + display: flex; + justify-content: center; + padding: 20px; +`,nL=u.div` + width: 100%; + max-width: 1120px; + margin: 0 auto; +`,rL=u.h1` + font-size: 1.8rem; + font-weight: bold; + margin-bottom: 1.5rem; + text-align: left; +`,iL=u.div` + display: flex; + flex-direction: column; /* 내부 요소를 세로로 정렬 */ + background: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +`,oL=u.div` + display: flex; /* 가로 정렬 */ + flex-direction: row; /* 기본값이므로 명시적으로 추가 */ + align-items: stretch; /* 양쪽 요소의 높이를 동일하게 */ + justify-content: center; /* 양쪽 여백 균등 배치 */ + gap: 20px; /* 두 컨테이너 사이 간격 */ + margin-bottom: 20px; /* 아래 요소와의 간격 */ +`,sL=u.div` + display: flex; + flex-direction: column; + align-items: center; + width: 490px; + height: 495px; /* 고정된 높이 설정 */ + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px 11px; + position: relative; + box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ +`,aL=u.div` + display: flex; + justify-content: space-between; /* 좌우 버튼 공간 확보 */ + align-items: center; /* 수직 중앙 정렬 */ + width: 100%; + height: 320px; /* 기준 높이 */ + position: relative; /* 자식 요소 위치 기준 */ + overflow: hidden; /* 높이를 벗어난 콘텐츠 숨김 */ +`,lL=u.div` + flex: 1; /* 이미지 영역이 버튼 사이에 위치 */ + display: flex; + align-items: center; + justify-content: center; + width: 400px; + height: 100%; + border: 1px solid #ccc; + border-radius: 10px; + overflow: hidden; /* 콘텐츠가 영역을 벗어나지 않도록 */ + + img { + max-width: 100%; /* 부모 너비를 넘지 않도록 */ + max-height: 100%; /* 부모 높이를 넘지 않도록 */ + object-fit: contain; /* 비율을 유지하며 부모 크기 안에 맞춤 */ + } +`,cL=u.label` + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: 1.2rem; + color: #555; + cursor: pointer; + border-radius: 10px; + width: 400px; /* img의 크기와 동일하게 설정 */ + height: 100%; /* img의 높이와 동일하게 설정 */ + background-color: #ececec; /* 요구된 배경색 추가 */ + + input { + display: none; + } +`,uL=u.button` + position: absolute; + top: 0px; + right: 45px; + background: none; + border: none; + padding: 8px; + cursor: pointer; + z-index: 1; +`,dL=u.div` + flex: 0 0 32px; /* 버튼 고정 너비 */ + display: flex; + justify-content: center; + align-items: center; + height: 100%; /* PreviewWrapper의 높이에 맞춤 */ +`,fL=u.div` + flex: 0 0 32px; /* 버튼 고정 너비 */ + display: flex; + justify-content: center; + align-items: center; + height: 100%; /* PreviewWrapper의 높이에 맞춤 */ +`,pL=u.button` + background: none; + border: none; + color: #333; + cursor: pointer; +`,hL=u.button` + background: none; + border: none; + color: #333; + cursor: pointer; +`,mL=u.div` + width: 100%; + height: 54px; /* 높이 설정 */ + display: flex; /* 플렉스 박스로 변경 */ + align-items: center; /* 세로 중앙 정렬 */ + justify-content: center; /* 가로 중앙 정렬 */ +`,gL=u.div` + display: flex; + justify-content: center; + gap: 5px; + + span { + width: 8px; + height: 8px; + border-radius: 50%; + background: #ddd; + cursor: pointer; + } + + span.active { + background: #000; + } +`,xL=u.div` + display: flex; + flex-direction: column; + align-items: flex-start; /* 세로로 가운데 정렬 */ + width: 100%; +`,yL=u.div` + margin-left: 20px; + display: flex; + align-items: center; /* Label과 Url을 같은 높이에 배치 */ + gap: 10px; /* Label과 Url 사이 간격 */ + padding: 10px; + border: none; +`,vL=u.input` + width: 285px; + flex: 1; + padding: 10px; + background-color: #ececec; + border: 1px solid ${({isError:e})=>e?"red":"#ccc"}; + border-radius: 5px; +`,wL=u.span` + margin-left: 125px; + color: red; + font-size: 0.8rem; + margin-top: 5px; +`,bL=u.div` + display: flex; + flex-direction: column; /* 세로 정렬 */ + align-items: flex-start; /* 왼쪽 정렬 */ + justify-content: space-between; /* 위아래 요소 간격 균등 */ + width: 490px; + height: 495px; /* ImageUploadContainer와 동일한 고정 높이 */ + flex-grow: 1; /* 가로 공간을 균등 분배 */ + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px; + box-sizing: border-box; +`,jL=u.div` + display: flex; + flex-direction: column; /* 세로 정렬 */ + gap: 50px; /* 컴포넌트 간 간격 */ + width: 100%; +`,ua=u.div` + display: flex; + flex-direction: row; /* 가로 배치 */ + align-items: center; /* 세로 중앙 정렬 */ + gap: 10px; /* 컴포넌트 간 간격 */ + width: 100%; +`,bo=u.label` + font-size: 1.2rem; + font-weight: bold; + flex-shrink: 0; /* 라벨 크기를 고정 */ + text-align: left; /* 라벨 텍스트 왼쪽 정렬 */ +`,CL=u.input` + width: 80%; + padding: 10px; + background-color: #ececec; + border: 1px solid #ccc; + border-radius: 5px; +`,SL=u.div` + display: flex; + flex-direction: column; /* 라벨과 카테고리를 세로로 배치 */ +`,PL=u.label` + font-size: 1.2rem; + font-weight: bold; + margin-bottom: 10px; /* 라벨과 카테고리 사이 간격 */ +`,EL=u(nd)` + display: flex; + flex-wrap: wrap; + gap: 8px; + padding: 10px 0; + + div { + padding: 12px !important; /* 강제로 적용 */ + flex: 1 1 calc(25% - 8px); + box-sizing: border-box; + + &:hover { + background-color: #f0f0f0 !important; /* 호버 스타일도 강제 */ + } + + &.active { + font-weight: bold !important; /* 활성 상태 스타일 강제 */ + border-bottom: 2px solid black !important; + } + } +`,kL=u.div` + display: flex; + flex-direction: column; /* 세로 정렬 */ + gap: 20px; /* 컴포넌트 간 간격 */ + width: 100%; +`,vf=u.input` + width: 100px; + padding: 10px 0px; + text-align: center; + background-color: #ececec; + border: 1px solid #ccc; + border-radius: 5px; +`,RL=u.div` + position: relative; +`,AL=u.button` + width: 120px; + padding: 10px; + border: 1px solid #ccc; + border-radius: 5px; + font-weight: bold; + display: flex; + gap: 10px; + justify-content: center; + align-items: center; + box-sizing: border-box; +`,IL=u.div` + position: absolute; + width: 120px; + top: 100%; + left: 0; + right: 0; + font-size: 0.9rem; + border: 1px solid #ccc; + border-radius: 5px; + background: #fff; + z-index: 1000; + box-sizing: border-box; +`,OL=u.div` + padding: 10px; + text-align: center; + cursor: pointer; + background: ${({isSelected:e})=>e?"#f0f0f0":"#fff"}; + font-weight: ${({isSelected:e})=>e?"bold":"normal"}; + + &:hover { + background: #eaeaea; + } +`,_L=u.div` + display: flex; + flex-direction: row; /* 가로 배치 */ + gap: 20px; /* 두 요소 간 간격 */ + width: 100%; /* 부모 컨테이너에 맞게 확장 */ + align-items: center; /* 세로 중앙 정렬 */ +`,DL=u.div` + width: 100%; /* Wrapper 크기는 기존 유지 */ + max-width: 1100px; + margin: 0 auto; + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px; /* 내부 여백 */ + margin-bottom: 20px; + box-sizing: border-box; +`,TL=u.textarea` + width: 100%; + height: 460px; /* 고정된 높이 */ + background-color: #ececec; + border: none; /* 테두리 제거 */ + border-radius: 10px; + padding: 20px; + outline: none; /* 포커스 시 외곽선 제거 */ + resize: none; /* 크기 조절 비활성화 */ + font-size: 1rem; /* 텍스트 크기 */ + line-height: 1.5; + color: #333; /* 텍스트 색상 */ + box-sizing: border-box; +`,ML=u.div` + display: flex; + justify-content: flex-end; + gap: 10px; +`,wf=u.button` + padding: 10px 20px; + background: #000; + color: #fff; + border: 1px solid #000; + border-radius: 5px; + cursor: pointer; + + &:hover { + background: #333; + } +`;function LL(){const e=Ie(),[t,n]=C.useState(null),[r,i]=C.useState(null),[o,a]=C.useState(!1);return C.useEffect(()=>{navigator.geolocation&&!o&&navigator.geolocation.getCurrentPosition(l=>{const{latitude:c,longitude:d}=l.coords;n({latitude:c,longitude:d}),window.kakao&&new window.kakao.maps.services.Geocoder().coord2RegionCode(d,c,(f,h)=>{var j,x,g;if(h===window.kakao.maps.services.Status.OK){const S=`${((j=f[0])==null?void 0:j.region_1depth_name)||""} ${((x=f[0])==null?void 0:x.region_2depth_name)||""} ${((g=f[0])==null?void 0:g.region_3depth_name)||""}`;i(S),a(!0)}else console.error("주소를 가져오지 못했습니다.")})},l=>{console.error("위치 정보를 가져올 수 없습니다:",l)})},[t]),s.jsxs(HL,{children:[s.jsx(BL,{children:s.jsx("img",{src:"/images/login10.jpg",alt:"Login background",style:{width:"100%",height:"100%",objectFit:"cover"}})}),s.jsxs(WL,{children:[s.jsxs(UL,{children:["우리동네를 인증하고",s.jsx("br",{}),"공동구매를 시작하세요"]}),s.jsx(zL,{children:"위치서비스를 허용해주세요"}),s.jsxs($L,{children:[t?s.jsx(cj,{latitude:t.latitude,longitude:t.longitude,appKey:"af7394f12b174cad35e87960ddccf91f",width:400}):s.jsx("p",{children:"위치 정보를 불러오는 중..."}),s.jsxs(NL,{children:["현재 위치가 내 동네로 설정한 ",r||"00동","에 있습니다."]})]}),s.jsx(FL,{onClick:async()=>{r&&((await uO({address:r})).message==="주소 확인 완료"?(localStorage.setItem("address",r),e("/setnickname")):alert("주소를 다시 확인해주세요."))},children:"Next"})]})]})}const NL=u.div` + color: #88868c; +`,$L=u.div` + display: inline-flex; + align-items: center; + justify-content: center; + width: 100%; + flex-direction: column; + gap: 20px; + margin-top: 20px; +`,FL=u.div` + background-color: #000; + color: #fff; + border-radius: 5px; + width: calc(100% - 20px); + height: 35px; + display: inline-flex; + align-items: center; + justify-content: center; + margin-top: 35px; + cursor: pointer; +`,zL=u.div` + font-size: 12px; + font-weight: 500; + margin-top: 10px; +`,UL=u.div` + font-size: 30px; + font-weight: 900; + margin-bottom: 20px; +`,BL=u.div` + flex: 6; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +`,WL=u.div` + flex: 4; + background-color: #fff; + display: flex; + align-items: flex-start; + justify-content: center; + flex-direction: column; + padding-left: 20px; +`,HL=u.div` + display: flex; + width: 100%; + height: 100vh; +`,bf="http://localhost:8080/api/v1/virtual",dj=({orderId:e,amount:t,title:n,customerName:r,customerEmail:i,onClose:o,onComplete:a})=>{const[l,c]=C.useState(!1),d=async()=>{c(!0);try{const p=await se.post(`${bf}`,{orderId:e,amount:t,orderName:n,customerName:r,customerEmail:i,validHours:12,successUrl:`${bf}/success`,failUrl:`${bf}/fail`,method:"VIRTUAL_ACCOUNT"},{headers:{Authorization:`Basic ${btoa("토스 시크릿 키:")}`,"Content-Type":"application/json"}});a(p.data)}catch(p){console.error("가상 계좌 발급 실패:",p),alert("가상 계좌 발급에 실패했습니다.")}finally{c(!1)}};return s.jsx(QL,{children:s.jsxs(VL,{children:[s.jsx(KL,{children:"가상 계좌 발급"}),s.jsxs(GL,{children:[s.jsxs("p",{children:["상품명: ",n]}),s.jsxs("p",{children:["결제 금액: ",t.toLocaleString()," 원"]})]}),s.jsxs(qL,{children:[s.jsx(JL,{onClick:d,disabled:l,children:l?"발급 중...":"발급"}),s.jsx(YL,{onClick:o,children:"닫기"})]})]})})},QL=u.div` + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +`,VL=u.div` + background: #fff; + padding: 20px; + border-radius: 10px; + width: 400px; + text-align: center; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); +`,KL=u.h2` + font-size: 1.5rem; + font-weight: bold; + margin-bottom: 20px; +`,GL=u.div` + margin-bottom: 20px; + + p { + margin: 5px 0; + font-size: 1rem; + } +`,qL=u.div` + display: flex; + justify-content: space-between; +`,JL=u.button` + padding: 10px 20px; + font-size: 1rem; + background-color: #007bff; + color: #fff; + border: none; + border-radius: 5px; + cursor: pointer; + + &:disabled { + background-color: #ccc; + cursor: not-allowed; + } + + &:hover:not(:disabled) { + background-color: #0056b3; + } +`,YL=u.button` + padding: 10px 20px; + font-size: 1rem; + background-color: #6c757d; + color: #fff; + border: none; + border-radius: 5px; + cursor: pointer; + + &:hover { + background-color: #5a6268; + } +`,XL=()=>{const e=Ie(),{state:t}=it(),{post:n,quantity:r}=t||{},[i,o]=C.useState(null),[a,l]=C.useState(!1),[c,d]=C.useState({name:"",address:"",detailaddress:"",request:""});if(!n)return s.jsx("div",{children:"잘못된 접근입니다. 게시물 정보를 찾을 수 없습니다."});const p=()=>l(!1),f=x=>{var g;o(x),l(!1),alert(`가상계좌 발급 완료: ${(g=x.virtualAccount)==null?void 0:g.accountNumber}`)},h=x=>{const{name:g,value:S}=x.target;d({...c,[g]:S})},j=()=>{var x,g;if(!i){alert("먼저 가상계좌를 발급받아야 합니다.");return}e(`/community/post/${n.id}/payment/deposit`,{state:{bankCode:(x=i.virtualAccount)==null?void 0:x.bankCode,accountNumber:(g=i.virtualAccount)==null?void 0:g.accountNumber,totalAmount:r*n.unitAmount,onConfirm:()=>{alert("결제가 완료되었습니다."),e(`/community/post/${n.id}/payment/complete`,{state:{paymentKey:i.paymentKey,orderId:i.orderId,totalAmount:i.totalAmount,title:n.title,unitPrice:n.unitAmount,quantity:r}})}}})};return s.jsxs(ZL,{children:[s.jsxs(eN,{children:[s.jsx(tN,{children:s.jsx(X0,{children:"공구 진행 결제(공구 참여자)"})}),s.jsxs(nN,{children:[s.jsxs(jf,{children:[s.jsx(Z0,{children:"공구 모집 상품 정보"}),s.jsxs(rN,{children:[s.jsx(iN,{children:s.jsx(oN,{children:s.jsx(sN,{children:s.jsx("img",{src:co(n.imageUrls[0]),alt:"이미지"})})})}),s.jsxs(aN,{children:[s.jsxs(uc,{children:[s.jsx(dc,{children:"제목"}),s.jsx(lN,{children:n.title})]}),s.jsxs(uc,{children:[s.jsx(dc,{children:"개당 가격"}),n.unitAmount.toLocaleString()," 원"]}),s.jsxs(uc,{children:[s.jsx(dc,{children:"수량"})," ",s.jsx(cN,{children:r})]}),s.jsxs(uc,{children:[s.jsx(dc,{children:"결제 금액"})," ",s.jsxs(uN,{children:[(r*n.unitAmount).toLocaleString()," 원"]})]})]})]})]}),s.jsxs(jf,{children:[s.jsx(X0,{children:"배송 정보 확인"}),s.jsxs(fN,{children:[s.jsx(fc,{placeholder:"이름을 입력하세요.",name:"name",value:c.name,onChange:h}),s.jsx(fc,{placeholder:"주소를 입력하세요.",name:"address",value:c.address,onChange:h}),s.jsx(fc,{placeholder:"상세 주소를 입력하세요.",name:"detailaddress",value:c.detailaddress,onChange:h}),s.jsx(fc,{placeholder:"배송 요청사항을 입력하세요.",name:"request",value:c.request,onChange:h})]})]}),s.jsxs(jf,{children:[s.jsx(Z0,{children:"결제 정보 확인"}),s.jsx(dN,{children:s.jsx(pN,{onClick:()=>l(!0),children:"가상계좌 발급"})})]}),s.jsxs(hN,{children:[s.jsx(ey,{onClick:j,children:"결제하기"}),s.jsx(ey,{onClick:()=>e(-1),children:"뒤로가기"})]})]})]}),a&&s.jsx(dj,{orderId:`order-${Date.now()}`,amount:r*n.unitPrice,title:n.title,customerName:"홍길동",customerEmail:"customer@example.com",onClose:p,onComplete:f})]})},ZL=u.div` + display: flex; + justify-content: center; + align-items: center; + padding: 20px; +`,eN=u.div` + width: 100%; + max-width: 1120px; + margin: 0 auto; +`,tN=u.div` + margin-bottom: 30px; +`,X0=u.h1` + font-size: 1.8rem; + font-weight: bold; + color: #333; +`,nN=u.div` + display: flex; + flex-direction: column; + gap: 20px; + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px 11px; + margin-top: 50px; + position: relative; + box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ +`,jf=u.div` + background-color: #fff; + padding: 20px; + margin: 20px; + border: 1px solid #ccc; + border-radius: 10px; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + box-sizing: border-box; +`,Z0=u.div` + font-size: 1.6rem; + font-weight: bold; + margin: 15px 20px; + color: #333; +`,rN=u.div` + display: flex; + flex-direction: row; + gap: 20px; +`,iN=u.div` + display: flex; + flex-direction: column; + align-items: center; + width: 490px; + height: 400px; /* 고정된 높이 설정 */ + padding: 20px; + position: relative; + box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ +`,oN=u.div` + display: flex; + justify-content: space-between; /* 좌우 버튼 공간 확보 */ + align-items: center; /* 수직 중앙 정렬 */ + margin: auto 0; + width: 100%; + position: relative; /* 자식 요소 위치 기준 */ + overflow: hidden; /* 높이를 벗어난 콘텐츠 숨김 */ +`,sN=u.div` + flex: 1; /* 이미지 영역이 버튼 사이에 위치 */ + display: flex; + align-items: center; + justify-content: center; + width: 400px; + height: 100%; + border: 1px solid #fff; + border-radius: 10px; + overflow: hidden; /* 콘텐츠가 영역을 벗어나지 않도록 */ + + img { + max-width: 100%; /* 부모 너비를 넘지 않도록 */ + max-height: 100%; /* 부모 높이를 넘지 않도록 */ + object-fit: contain; /* 비율을 유지하며 부모 크기 안에 맞춤 */ + } +`,aN=u.div` + display: flex; + flex-direction: column; + justify-content: space-between; + width: 490px; + height: 400px; /* 고정된 높이 설정 */ + padding: 50px 20px; + position: relative; + box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ +`,uc=u.div` + display: flex; + align-items: center; +`,dc=u.div` + margin-right: 15px; + font-size: 1.4rem; + font-weight: bold; + flex-shrink: 0; /* 라벨 크기를 고정 */ +`,lN=u.div` + display: -webkit-box; /* Flexbox 기반으로 동작 */ + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; /* 수직 방향 박스 정렬 */ + overflow: hidden; /* 넘치는 텍스트 숨김 */ + text-overflow: ellipsis; /* 넘치는 텍스트에 ... 표시 */ + white-space: normal; /* 줄바꿈 허용 */ + color: #333; /* 텍스트 색상 */ +`,cN=u.div` + display: flex; + gap: 10px; + align-items: center; +`,uN=u.div` + display: flex; + gap: 10px; + align-items: center; +`,dN=u.div` + display: flex; + margin: 50px 0; + justify-content: center; + align-items: center; +`,fN=u.div` + border: 1px solid #ccc; + padding: 20px; + border-radius: 8px; +`,fc=u.input` + width: 100%; + margin-bottom: 10px; + padding: 10px; + border: 1px solid #ccc; + border-radius: 4px; +`,pN=u.button` + padding: 40px 50px; + font-size: 1.2rem; + font-weight: bold; + background-color: #f5f5f5; + border: 1px solid #000; + border-radius: 10px; + cursor: pointer; + box-sizing: border-box; + box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.1); + + &:hover { + background-color: #e5e5e5; + } +`,hN=u.div` + display: flex; + justify-content: flex-end; + padding: 0 20px; + gap: 20px; +`,ey=u.button` + padding: 10px 20px; + font-size: 16px; + font-weight: bold; + background-color: #000; + color: #fff; + border: none; + border-radius: 5px; + cursor: pointer; + + &:hover { + background-color: #444; + } +`,mN=()=>{const e=Ie(),{state:t}=it(),{post:n,quantity:r}=t||{},[i,o]=C.useState(null),[a,l]=C.useState(!1);if(!n)return s.jsx("div",{children:"잘못된 접근입니다. 게시물 정보를 찾을 수 없습니다."});const c=()=>l(!1),d=f=>{var h;o(f),l(!1),alert(`가상계좌 발급 완료: ${(h=f.virtualAccount)==null?void 0:h.accountNumber}`)},p=()=>{var f,h;if(!i){alert("먼저 가상계좌를 발급받아야 합니다.");return}e(`/community/post/${n.id}/payment/deposit`,{state:{bankCode:(f=i.virtualAccount)==null?void 0:f.bankCode,accountNumber:(h=i.virtualAccount)==null?void 0:h.accountNumber,totalAmount:r*n.unitAmount,onConfirm:()=>{alert("결제가 완료되었습니다."),e(`/community/post/${n.id}/payment/complete`,{state:{paymentKey:i.paymentKey,orderId:i.orderId,totalAmount:i.totalAmount,title:n.title,unitPrice:n.unitAmount,quantity:r}})}}})};return s.jsxs(gN,{children:[s.jsxs(xN,{children:[s.jsx(yN,{children:s.jsx(vN,{children:"공구 진행 결제(공구 참여자)"})}),s.jsxs(wN,{children:[s.jsxs(ty,{children:[s.jsx(ny,{children:"공구 모집 상품 정보"}),s.jsxs(bN,{children:[s.jsx(jN,{children:s.jsx(CN,{children:s.jsx(SN,{children:s.jsx("img",{src:co(n.imageUrls[0]),alt:"이미지"})})})}),s.jsxs(PN,{children:[s.jsxs(pc,{children:[s.jsx(hc,{children:"제목"}),s.jsx(EN,{children:n.title})]}),s.jsxs(pc,{children:[s.jsx(hc,{children:"개당 가격"}),n.unitAmount.toLocaleString()," 원"]}),s.jsxs(pc,{children:[s.jsx(hc,{children:"수량"})," ",s.jsx(kN,{children:r})]}),s.jsxs(pc,{children:[s.jsx(hc,{children:"결제 금액"})," ",s.jsxs(RN,{children:[(r*n.unitAmount).toLocaleString()," 원"]})]})]})]})]}),s.jsxs(ty,{children:[s.jsx(ny,{children:"결제 정보 확인"}),s.jsx(AN,{children:s.jsx(IN,{onClick:()=>l(!0),children:"가상계좌 발급"})})]}),s.jsxs(ON,{children:[s.jsx(ry,{onClick:p,children:"결제하기"}),s.jsx(ry,{onClick:()=>e(-1),children:"뒤로가기"})]})]})]}),a&&s.jsx(dj,{orderId:`order-${Date.now()}`,amount:r*n.unitPrice,title:n.title,customerName:"홍길동",customerEmail:"customer@example.com",onClose:c,onComplete:d})]})},gN=u.div` + display: flex; + justify-content: center; + align-items: center; + padding: 20px; +`,xN=u.div` + width: 100%; + max-width: 1120px; + margin: 0 auto; +`,yN=u.div` + margin-bottom: 30px; +`,vN=u.h1` + font-size: 1.8rem; + font-weight: bold; + color: #333; +`,wN=u.div` + display: flex; + flex-direction: column; + gap: 20px; + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px 11px; + margin-top: 50px; + position: relative; + box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ +`,ty=u.div` + background-color: #fff; + padding: 20px; + margin: 20px; + border: 1px solid #ccc; + border-radius: 10px; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + box-sizing: border-box; +`,ny=u.div` + font-size: 1.6rem; + font-weight: bold; + margin: 15px 20px; + color: #333; +`,bN=u.div` + display: flex; + flex-direction: row; + gap: 20px; +`,jN=u.div` + display: flex; + flex-direction: column; + align-items: center; + width: 490px; + height: 400px; /* 고정된 높이 설정 */ + padding: 20px; + position: relative; + box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ +`,CN=u.div` + display: flex; + justify-content: space-between; /* 좌우 버튼 공간 확보 */ + align-items: center; /* 수직 중앙 정렬 */ + margin: auto 0; + width: 100%; + position: relative; /* 자식 요소 위치 기준 */ + overflow: hidden; /* 높이를 벗어난 콘텐츠 숨김 */ +`,SN=u.div` + flex: 1; /* 이미지 영역이 버튼 사이에 위치 */ + display: flex; + align-items: center; + justify-content: center; + width: 400px; + height: 100%; + border: 1px solid #fff; + border-radius: 10px; + overflow: hidden; /* 콘텐츠가 영역을 벗어나지 않도록 */ + + img { + max-width: 100%; /* 부모 너비를 넘지 않도록 */ + max-height: 100%; /* 부모 높이를 넘지 않도록 */ + object-fit: contain; /* 비율을 유지하며 부모 크기 안에 맞춤 */ + } +`,PN=u.div` + display: flex; + flex-direction: column; + justify-content: space-between; + width: 490px; + height: 400px; /* 고정된 높이 설정 */ + padding: 50px 20px; + position: relative; + box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ +`,pc=u.div` + display: flex; + align-items: center; +`,hc=u.div` + margin-right: 15px; + font-size: 1.4rem; + font-weight: bold; + flex-shrink: 0; /* 라벨 크기를 고정 */ +`,EN=u.div` + display: -webkit-box; /* Flexbox 기반으로 동작 */ + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; /* 수직 방향 박스 정렬 */ + overflow: hidden; /* 넘치는 텍스트 숨김 */ + text-overflow: ellipsis; /* 넘치는 텍스트에 ... 표시 */ + white-space: normal; /* 줄바꿈 허용 */ + color: #333; /* 텍스트 색상 */ +`,kN=u.div` + display: flex; + gap: 10px; + align-items: center; +`,RN=u.div` + display: flex; + gap: 10px; + align-items: center; +`,AN=u.div` + display: flex; + margin: 50px 0; + justify-content: center; + align-items: center; +`,IN=u.button` + padding: 40px 50px; + font-size: 1.2rem; + font-weight: bold; + background-color: #f5f5f5; + border: 1px solid #000; + border-radius: 10px; + cursor: pointer; + box-sizing: border-box; + box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.1); + + &:hover { + background-color: #e5e5e5; + } +`,ON=u.div` + display: flex; + justify-content: flex-end; + padding: 0 20px; + gap: 20px; +`,ry=u.button` + padding: 10px 20px; + font-size: 16px; + font-weight: bold; + background-color: #000; + color: #fff; + border: none; + border-radius: 5px; + cursor: pointer; + + &:hover { + background-color: #444; + } +`,_N=async e=>{try{return(await se.get(`/api/v1/virtual/update-payment/${e}`)).data}catch{throw new Error("결제 상태 확인에 실패했습니다.")}};class DN{constructor(t){this.url=t,this.socket=null,this.subscriptions=new Map,this.reconnectSubscriptions=new Set,this.reconnectAttempts=0,this.maxReconnectAttempts=5}connect(t,n,r,i){this.socket=new WebSocket(this.url),this.socket.onopen=()=>{n&&n(),this.reconnectAttempts=0,this.resubscribe()},this.socket.onmessage=o=>{const a=JSON.parse(o.data),l=a.destination;if(l&&this.subscriptions.has(l)){const c=this.subscriptions.get(l);c&&c(a.message)}},this.socket.onclose=()=>{r&&r(),this.reconnect()},this.socket.onerror=o=>{i&&i(o)}}subscribe(t,n,r=!1){this.subscriptions.has(t)||this.subscriptions.set(t,n),r&&this.reconnectSubscriptions.add(t)}unsubscribe(t){this.subscriptions.has(t)&&(this.subscriptions.delete(t),this.reconnectSubscriptions.delete(t))}send(t,n){if(!this.socket||this.socket.readyState!==WebSocket.OPEN)return;const r=JSON.stringify({destination:t,message:n});this.socket.send(r)}isConnected(){var t;return((t=this.socket)==null?void 0:t.readyState)===WebSocket.OPEN}close(){this.socket&&this.socket.close()}reconnect(){this.reconnectAttempts{},3e3))}resubscribe(){this.reconnectSubscriptions.size>0&&this.reconnectSubscriptions.forEach(t=>{const n=this.subscriptions.get(t);n&&this.subscribe(t,n)})}}const Pl=new DN("ws://http://15.164.5.135:8080/websocket"),TN=async e=>{const t=await se.post("/api/chat",{postId:e});if(t.status!==200)throw new Error("Failed to create chat room");const{id:n,roomName:r}=t.data;return Pl.subscribe(`/sub/message/${n}`,i=>{},!0),t.data},MN=async e=>{const t=await se.delete(`/api/chat/${e}`,{headers:{Authorization:`Bearer ${localStorage.getItem("jwt")}`}});if(t.status!==200)throw new Error("Failed to delete chat room");return Pl.unsubscribe(`/sub/message/${e}`),t.data},LN=async()=>{const e=await se.get("/api/admin/chatlist",{headers:{Authorization:`Bearer ${localStorage.getItem("jwt")}`}});if(e.status!==200)throw new Error("Failed to fetch all chat rooms");return e.data},NN=async e=>{const t=await se.get(`/api/chat/${e}`,{headers:{Authorization:`Bearer ${localStorage.getItem("jwt")}`}});if(t.status!==200)throw new Error("Failed to fetch chat messages");return t.data},$N=({chatRoomId:e,chatMembers:t,webSocketService:n,isAdmin:r=!1})=>{const[i,o]=C.useState([]),[a,l]=C.useState(""),c=C.useRef(null),d="user-00001";C.useEffect(()=>{(async()=>{const S=await NN(e),w={senderId:"system",content:`${t.map(v=>p(v)).join(", ")}님이 입장하셨습니다.`,timestamp:null};o([w,{senderId:"system",content:` +안내사항: 환불 및 이탈 관련 정책 + 1. 환불 및 수령 시간/위치 조율 + - 공구 진행 중(최종 승인 이후)인 채팅방에서 + 수령 위치 및 시간을 조율합니다. + - 이탈자가 발생하거나 환불 요청이 있을 경우, + 이탈자는 채팅방에서 환불 의사를 명확히 + 표시해야 하며, 모든 참여 인원이 동의한 + 경우에 한해 환불이 진행됩니다. + 2. 환불 및 비용 부담 + - 환불 진행 시, 전체 환불 처리 및 해당 인원에 + 대한 신고 접수가 이루어지며, 이로 인해 + 발생하는 모든 비용(공구 물품 반송 등)은 + 이탈자 본인이 전액 부담합니다. + 3. 이탈자에 대한 페널티 제도 + - 이탈 행위가 반복될 경우, 아래와 같은 + 경고 시스템이 적용됩니다. + - 1회 경고: 계정 일주일 정지 + - 3회 경고: 계정 한 달 정지 + - 5회 경고: 계정 영구 정지 + + 💡 주의: 본 안내사항을 숙지하지 않아 발생하는 + 불이익은 본인에게 책임이 있습니다. + +공구 진행에 차질이 없도록 적극적인 협조 +부탁드립니다. 😊`,timestamp:null},...S])})()},[e,t]);const p=g=>g==="system"?"":g===d?"나":g;C.useEffect(()=>{const g=S=>{o(w=>[...w,S])};return n.connect(()=>{n.subscribe(`/sub/message/${e}`,S=>{const w=JSON.parse(S.body);g(w)})}),()=>{n.unsubscribe(`/sub/message/${e}`),n.close()}},[e,n]),C.useEffect(()=>{c.current&&(c.current.scrollTop=c.current.scrollHeight)},[i]);const f=()=>{if(!a.trim())return;const g={senderId:r?"system":d,content:r?`[관리자 메시지] ${a.trim()}`:a.trim(),timestamp:new Date().toISOString()};n.send(`/pub/message/${e}`,JSON.stringify(g)),o(S=>[...S,g]),l("")},h=g=>new Date(g).toLocaleDateString("ko-KR",{year:"numeric",month:"2-digit",day:"2-digit",weekday:"short"}),x=(g=>{const S=[];let w="";for(const m of g){const v=m.timestamp?h(m.timestamp):null;v&&v!==w&&(S.push({type:"date",content:v,senderId:"system",timestamp:null}),w=v),S.push(m)}return S})(i);return s.jsxs(FN,{children:[s.jsxs(zN,{children:[x.map((g,S)=>{var m;const w=g.senderId==="system"&&((m=g.content)==null?void 0:m.includes("안내사항: 환불 및 이탈 관련 정책"));return g.type==="date"?s.jsx(UN,{children:g.content},`date-${S}`):s.jsxs(BN,{isCurrentUser:g.senderId===d,isSystemMessage:g.senderId==="system",children:[s.jsx(WN,{children:g.senderId==="system"?"":p(g.senderId)}),s.jsx(HN,{isCurrentUser:g.senderId===d,isGroupNotice:w,isSystemMessage:g.senderId==="system",children:g.content}),g.timestamp&&g.senderId!=="system"&&s.jsx(QN,{children:new Date(g.timestamp).toLocaleTimeString()})]},S)}),s.jsx("div",{ref:c})]}),s.jsxs(VN,{children:[s.jsx(KN,{type:"text",value:a,onChange:g=>l(g.target.value),placeholder:"메시지를 입력하세요.",onKeyDown:g=>g.key==="Enter"&&f()}),s.jsx(GN,{onClick:f,disabled:!a.trim(),children:s.jsx(AA,{})})]})]})},FN=u.div` + display: flex; + flex-direction: column; + height: 100%; + max-height: 600px; + border: 1px solid #ccc; + border-radius: 8px; + overflow: hidden; + background-color: #fff; +`,zN=u.div` + flex: 1; + padding: 16px; + overflow-y: auto; + background-color: #f9f9f9; +`,UN=u.div` + text-align: center; + margin: 10px 0; + font-size: 0.9rem; + color: #888; + font-weight: bold; +`,BN=u.div` + display: flex; + flex-direction: column; + align-items: ${({isCurrentUser:e,isSystemMessage:t})=>t?"center":e?"flex-end":"flex-start"}; + margin-bottom: 12px; +`,WN=u.div` + font-size: 0.9rem; + font-weight: bold; + color: #333; + margin-bottom: 4px; +`,HN=u.div` + max-width: 70%; + background-color: ${({isCurrentUser:e,isGroupNotice:t,isSystemMessage:n})=>t||n?"#cecece":e?"#d9f9d9":"#e9e9e9"}; + color: #333; + padding: 10px; + border-radius: 12px; + word-wrap: break-word; + font-size: 1rem; + white-space: pre-wrap; /* 줄바꿈 유지 */ + text-align: ${({isGroupNotice:e})=>e?"left":"inherit"}; +`,QN=u.div` + font-size: 0.8rem; + color: #888; + margin-top: 4px; +`,VN=u.div` + display: flex; + padding: 12px; + border-top: 1px solid #ccc; + background-color: #fff; +`,KN=u.input` + flex: 1; + padding: 10px; + font-size: 1rem; + border: 1px solid #ccc; + border-radius: 8px; + outline: none; + margin-right: 8px; +`,GN=u.button` + padding: 10px 16px; + font-size: 1rem; + font-weight: bold; + color: #fff; + background-color: #4caf50; + border: none; + border-radius: 8px; + cursor: pointer; + + &:hover { + background-color: #45a049; + } + + &:disabled { + background-color: #ccc; + cursor: not-allowed; + } +`,fj=({isOpen:e,onClose:t,chatRoomId:n,chatRoomTitle:r,isAdminPage:i=!1})=>{const o=Ie(),a=it(),l=i||a.pathname==="/admin/chat";C.useEffect(()=>{e?o(`?roomId=${n}`,{replace:!0}):o(-1)},[e,n,o]);const c=async()=>{try{const p=new URLSearchParams(window.location.search).get("roomId");p&&(await MN(parseInt(p)),alert("채팅방이 성공적으로 삭제되었습니다."),t())}catch{alert("채팅방을 삭제할 수 없습니다.")}};return e?s.jsx(qN,{children:s.jsxs(JN,{children:[s.jsxs(YN,{children:[s.jsx(XN,{children:r}),s.jsxs(ZN,{children:[l&&s.jsx(e$,{onClick:c,children:s.jsx(RA,{})}),s.jsx(t$,{onClick:t,children:"×"})]})]}),s.jsx(n$,{children:s.jsx($N,{chatRoomId:parseInt(n,10),chatMembers:[],webSocketService:Pl,isAdmin:i})})]})}):null},qN=u.div` + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 9999; +`,JN=u.div` + width: 90%; + max-width: 600px; + background-color: #fff; + border-radius: 10px; + overflow: hidden; + display: flex; + flex-direction: column; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); +`,YN=u.div` + padding: 16px; + background-color: #f7f7f7; + border-bottom: 1px solid #ddd; + display: flex; + justify-content: space-between; + align-items: center; +`,XN=u.h2` + font-size: 18px; + font-weight: bold; + color: #333; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; +`,ZN=u.div` + display: flex; + gap: 8px; +`,e$=u.button` + background: none; + border: none; + padding: 6px 12px; + cursor: pointer; + color: #666; + + &:hover { + color: #333; + } +`,t$=u.button` + background: none; + border: none; + font-size: 20px; + cursor: pointer; + color: #666; + + &:hover { + color: #333; + } +`,n$=u.div` + flex: 1; + padding: 16px; + overflow-y: auto; +`,r$=()=>{const e=Ie(),n=it().state;if(!n||!n.communityPostId||!n.quantity)return s.jsx("div",{children:"잘못된 접근입니다."});const{communityPostId:r,quantity:i}=n,[o,a]=C.useState(null),[l,c]=C.useState(null),[d,p]=C.useState("WAITING_FOR_DEPOSIT"),[f,h]=C.useState(!1),[j,x]=C.useState(null);C.useEffect(()=>{const m=async()=>{try{const b=await _N(r);a(b),b.status==="DONE"&&p("DONE")}catch{alert("결제 상태를 확인할 수 없습니다.")}},v=async()=>{try{const b=await Sl(Number(r));c({title:b.communityPost.title,unitAmount:b.communityPost.unitAmount})}catch{alert("게시물 정보를 가져올 수 없습니다.")}};m(),v()},[r]);const g=async()=>{try{const m=await TN(parseInt(r));x(m)}catch{alert("채팅방을 생성할 수 없습니다.")}},S=async()=>{j||await g(),h(!0)},w=()=>h(!1);return!o||!l?s.jsx("div",{children:"로딩 중..."}):s.jsxs(i$,{children:[d==="WAITING_FOR_DEPOSIT"?s.jsx(s.Fragment,{children:s.jsx(iy,{children:"결제 상태를 확인 중입니다..."})}):s.jsxs(s.Fragment,{children:[s.jsx(iy,{children:"결제가 정상적으로 완료되었습니다."}),s.jsxs(o$,{children:[s.jsxs("p",{children:["주문 ID: ",o.orderId]}),s.jsxs("p",{children:["상품명: ",l.title]}),s.jsxs("p",{children:["개당 가격: ",l.unitAmount.toLocaleString()," 원"]}),s.jsxs("p",{children:["수량: ",i]}),s.jsxs("p",{children:["결제 금액: ",o.totalAmount.toLocaleString()," 원"]})]})]}),s.jsxs(s$,{children:[s.jsx(oy,{onClick:S,children:"채팅방 열기"}),s.jsx(oy,{onClick:()=>e("/mypage/orderlist"),children:"주문내역 보기"})]}),j&&s.jsx(fj,{isOpen:f,onClose:w,chatRoomId:j.id.toString(),chatRoomTitle:j.roomName,webSocketService:Pl,isAdminPage:!1})]})},i$=u.div` + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 20px; + height: 100vh; + text-align: center; +`,iy=u.h1` + font-size: 2rem; + font-weight: bold; + color: #333; + margin-bottom: 20px; +`,o$=u.div` + display: flex; + flex-direction: column; + align-items: center; + gap: 10px; + margin-bottom: 20px; +`,s$=u.div` + display: flex; + gap: 20px; + margin-top: 20px; +`,oy=u.button` + padding: 10px 20px; + font-size: 1rem; + font-weight: bold; + color: #fff; + background-color: #000; + border: none; + border-radius: 5px; + cursor: pointer; + + &:hover { + background-color: #444; + } +`,a$=[{id:"NOT_APPROVED",name:"작성글 게시 승인 대기 목록"},{id:"REPORTED",name:"신고 접수 된 글 목록"}],l$=async()=>{const e=await se.get("/api/admin/post",{headers:{Authorization:`Bearer ${localStorage.getItem("jwt")}`}});if(e.status!==200)throw new Error("Failed to fetch pending posts");return e.data},c$=async(e,t)=>{try{const n=await se.patch(`/api/admin/post/approve/${e}`,{title:t},{headers:{Authorization:`Bearer ${localStorage.getItem("jwt")}`}});if(n.status!==200)throw new Error("Failed to approve post");return n.data}catch{throw new Error(`Error approving post with ID ${e}`)}},u$=async(e,t)=>{try{const n=await se.patch(`/api/admin/post/reject/${e}`,{title:t},{headers:{Authorization:`Bearer ${localStorage.getItem("jwt")}`}});if(n.status!==200)throw new Error("Failed to reject post");return n.data}catch{throw new Error(`Error rejecting post with ID ${e}`)}},d$=()=>{var p;const t=((p=it().state)==null?void 0:p.selectedCategory)||"NOT_APPROVED",[n,r]=C.useState(t),[i,o]=C.useState([]),[,a]=$t(si),[l]=$t(td),c=typeof l=="object"&&l!==null?l:{};C.useEffect(()=>{(async()=>{const h=await l$();o(h)})()},[n]);const d=f=>{a(f)};return s.jsx("div",{children:s.jsx(f$,{children:s.jsxs(p$,{children:[s.jsx(m$,{children:"관리자 페이지"}),s.jsx(h$,{children:s.jsx(g$,{children:s.jsx(nd,{categories:a$,selectedCategory:n,onCategoryChange:f=>r(f),title:"게시글 관리"})})}),s.jsx(Jb,{selectedCategory:n,posts:i,hideWriteButton:!0,realTimeData:c,onPostSelect:d})]})})})},f$=u.div` + display: flex; + justify-content: center; + padding: 20px; +`,p$=u.div` + width: 100%; + max-width: 1120px; + margin: 0 auto; +`,h$=u.div` + display: flex; + align-items: center; /* 세로 가운데 정렬 */ + justify-content: flex-start; + margin-bottom: 20px; +`,m$=u.h1` + font-size: 1.8rem; + font-weight: bold; + margin-bottom: 1.5rem; + text-align: left; +`,g$=u.div` + display: flex; + justify-content: flex-end; + margin-left: 50px; +`,x$=()=>{var j;const{postId:e}=ao(),t=it(),n=Ie(),r=e||((j=t.state)==null?void 0:j.communityPostId),[i,o]=C.useState(null),[a,l]=C.useState(0);C.useEffect(()=>{(async()=>{if(!r){n("/admin/post");return}const g=await Sl(r);o(g.communityPost)})()},[r,n]);const c=()=>{i&&l(x=>(x+1)%i.imageUrls.length)},d=()=>{i&&l(x=>(x-1+i.imageUrls.length)%i.imageUrls.length)},p=x=>{l(x)},f=async()=>{if(i)try{const x=i.title.startsWith("(수정요망)")?i.title.replace(/^\(수정요망\)\s*/,""):i.title;Si(r),await c$(r,x),alert("게시물이 승인되었습니다."),n("/admin/post")}catch{alert("승인 처리 중 오류가 발생했습니다.")}},h=async()=>{if(i)try{const x=i.title.startsWith("(수정요망) ")?i.title:`(수정요망) ${i.title}`;Si(r),await u$(r,x),alert("게시물이 거절 처리되었습니다."),n("/admin/post")}catch{alert("거절 처리 중 오류가 발생했습니다.")}};return i?s.jsx(y$,{children:s.jsxs(v$,{children:[s.jsxs(w$,{children:[s.jsx(b$,{children:"작성글 게시 승인 대기"}),s.jsx(j$,{children:s.jsx(C$,{onClick:()=>n(-1),children:s.jsx(Om,{size:24})})})]}),s.jsxs(S$,{children:[s.jsxs(P$,{children:[s.jsxs(E$,{children:[s.jsxs(k$,{children:[s.jsx(A$,{children:i.imageUrls.length>1&&a>0&&s.jsx(O$,{onClick:d,children:s.jsx(Zu,{size:20})})}),s.jsx(R$,{children:s.jsx("img",{src:co(i.imageUrls[a]),alt:`이미지 ${a+1}`})}),s.jsx(I$,{children:i.imageUrls.length>1&&a1&&s.jsx(T$,{children:i.imageUrls.map((x,g)=>s.jsx("span",{className:a===g?"active":"",onClick:()=>p(g)},g))})}),s.jsx(M$,{children:s.jsxs(L$,{children:[s.jsx(er,{htmlFor:"urlInput",children:"URL 주소"}),s.jsx(N$,{children:i.productUrl})]})})]}),s.jsx($$,{children:s.jsxs(F$,{children:[s.jsxs(jo,{children:[s.jsx(er,{children:"제목"}),s.jsx(z$,{children:i.title})]}),s.jsxs(mc,{children:[s.jsxs(U$,{children:[s.jsx(er,{children:"작성자"}),s.jsx(B$,{children:i.nickname})]}),s.jsxs(W$,{children:[s.jsx(er,{children:"작성일"})," ",tl(i.createdAt).toLocaleString()]})]}),s.jsxs(mc,{children:[s.jsxs(jo,{children:[s.jsx(er,{children:"카테고리"})," ",i.category]}),s.jsxs(jo,{children:[s.jsx(er,{children:"참여 필요 수량"}),i.availableNumber]})]}),s.jsx(mc,{children:s.jsxs(jo,{children:[s.jsx(er,{children:"모집 마감 기간"})," ",i.period,"일"]})}),s.jsxs(mc,{children:[s.jsxs(jo,{children:[s.jsx(er,{children:"총 가격"})," ",i.totalAmount.toLocaleString()," ","원"]}),s.jsxs(jo,{children:[s.jsx(er,{children:"개당 가격"})," ",i.unitAmount.toLocaleString()," ","원"]})]})]})})]}),s.jsx(H$,{children:s.jsx(Q$,{readOnly:!0,value:i.description})}),s.jsxs(V$,{children:[s.jsx(K$,{onClick:f,children:"승인"}),s.jsx(G$,{onClick:h,children:"거절"})]})]})]})}):s.jsx("div",{children:"Loading..."})},y$=u.div` + padding: 20px; + display: flex; + flex-direction: column; + align-items: center; +`,v$=u.div` + width: 100%; + max-width: 1120px; + margin: 0 auto; +`,w$=u.div` + display: flex; + flex-direction: column; /* Title과 HeaderWrapper를 세로로 배치 */ + gap: 10px; /* Title과 HeaderWrapper 사이 간격 */ + margin-bottom: 1.5rem; +`,b$=u.h1` + font-size: 1.8rem; + font-weight: bold; + text-align: left; + margin: 0; /* Title의 기본 마진 제거 */ +`,j$=u.div` + width: 1000px; + margin: 30px auto 0; + display: flex; + justify-content: space-between; + align-items: center; +`,C$=u.button` + background: none; + border: none; + cursor: pointer; +`,S$=u.div` + display: flex; + flex-direction: column; + background: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +`,P$=u.div` + display: flex; /* 가로 정렬 */ + flex-direction: row; /* 기본값이므로 명시적으로 추가 */ + align-items: stretch; /* 양쪽 요소의 높이를 동일하게 */ + justify-content: center; /* 양쪽 여백 균등 배치 */ + gap: 20px; /* 두 컨테이너 사이 간격 */ + margin-bottom: 20px; /* 아래 요소와의 간격 */ +`,E$=u.div` + display: flex; + flex-direction: column; + align-items: center; + width: 490px; + height: 470px; /* 고정된 높이 설정 */ + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px 11px; + position: relative; + box-sizing: border-box; /* 패딩과 보더 포함한 크기 계산 */ +`,k$=u.div` + display: flex; + justify-content: space-between; /* 좌우 버튼 공간 확보 */ + align-items: center; /* 수직 중앙 정렬 */ + width: 100%; + height: 320px; /* 기준 높이 */ + position: relative; /* 자식 요소 위치 기준 */ + overflow: hidden; /* 높이를 벗어난 콘텐츠 숨김 */ +`,R$=u.div` + flex: 1; /* 이미지 영역이 버튼 사이에 위치 */ + display: flex; + align-items: center; + justify-content: center; + width: 400px; + height: 100%; + border: 1px solid #ccc; + border-radius: 10px; + overflow: hidden; /* 콘텐츠가 영역을 벗어나지 않도록 */ + + img { + max-width: 100%; /* 부모 너비를 넘지 않도록 */ + max-height: 100%; /* 부모 높이를 넘지 않도록 */ + object-fit: contain; /* 비율을 유지하며 부모 크기 안에 맞춤 */ + } +`,A$=u.div` + flex: 0 0 32px; /* 버튼 고정 너비 */ + display: flex; + justify-content: center; + align-items: center; + height: 100%; /* PreviewWrapper의 높이에 맞춤 */ +`,I$=u.div` + flex: 0 0 32px; /* 버튼 고정 너비 */ + display: flex; + justify-content: center; + align-items: center; + height: 100%; /* PreviewWrapper의 높이에 맞춤 */ +`,O$=u.button` + background: none; + border: none; + color: #333; + cursor: pointer; +`,_$=u.button` + background: none; + border: none; + color: #333; + cursor: pointer; +`,D$=u.div` + width: 100%; + height: 54px; /* 높이 설정 */ + display: flex; /* 플렉스 박스로 변경 */ + align-items: center; /* 세로 중앙 정렬 */ + justify-content: center; /* 가로 중앙 정렬 */ +`,T$=u.div` + display: flex; + justify-content: center; + gap: 5px; + + span { + width: 8px; + height: 8px; + border-radius: 50%; + background: #ddd; + cursor: pointer; + } + + span.active { + background: #000; + } +`,M$=u.div` + display: flex; + flex-direction: column; + align-items: flex-start; /* 세로로 가운데 정렬 */ + width: 100%; +`,L$=u.div` + margin-left: 20px; + display: flex; + align-items: center; /* Label과 Url을 같은 높이에 배치 */ + gap: 10px; /* Label과 Url 사이 간격 */ + padding: 10px; + border: none; +`,N$=u.div` + width: 285px; + flex: 1; + padding: 10px; + border: none; + border-radius: 5px; +`,$$=u.div` + display: flex; + flex-direction: column; /* 세로 정렬 */ + align-items: flex-start; /* 왼쪽 정렬 */ + justify-content: space-between; /* 위아래 요소 간격 균등 */ + width: 490px; + max-width: 490px; /* 최대 너비 고정 */ + height: 470px; /* ImageUploadContainer와 동일한 고정 높이 */ + flex-grow: 1; /* 가로 공간을 균등 분배 */ + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px; + box-sizing: border-box; +`,F$=u.div` + display: flex; + flex-direction: column; + gap: 20px; /* 컴포넌트 간 간격 */ + width: 100%; +`,jo=u.div` + display: flex; + flex-direction: column; + font-size: 1rem; +`,er=u.label` + font-size: 1.2rem; + font-weight: bold; + margin-bottom: 4px; /* Label과 텍스트 사이 간격 */ +`,z$=u.span` + display: -webkit-box; /* Flexbox 기반으로 동작 */ + -webkit-line-clamp: 2; /* 두 줄까지만 표시 */ + -webkit-box-orient: vertical; /* 수직 방향 박스 정렬 */ + overflow: hidden; /* 넘치는 텍스트 숨김 */ + text-overflow: ellipsis; /* 넘치는 텍스트에 ... 표시 */ + white-space: normal; /* 줄바꿈 허용 */ + color: #333; /* 텍스트 색상 */ +`,mc=u.div` + display: flex; /* 한 줄로 배치 */ + align-items: center; /* 세로 가운데 정렬 */ + justify-content: space-between; /* 양쪽 여백 균등 배치 */ + width: 100%; /* 부모 컨테이너 너비 */ + + & > div { + flex: 1; /* 내부 요소들이 동일한 크기로 영역 나눔 */ + } +`,U$=u.div` + display: flex; /* 가로 배치 */ + flex-direction: column; /* 내부 요소가 한 줄씩 배치되도록 */ + gap: 5px; /* 내부 요소 간 간격 */ +`,B$=u.div` + display: flex; /* 한 줄로 배치 */ + align-items: center; /* 세로로 가운데 정렬 */ + font-size: 1rem; /* 텍스트 크기 설정 */ +`,W$=u.div` + display: flex; /* 가로 배치 */ + flex-direction: column; /* 내부 요소가 한 줄씩 배치되도록 */ + gap: 5px; /* 내부 요소 간 간격 */ +`,H$=u.div` + width: 100%; + max-width: 1000px; + margin: 0 auto; + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px; + margin-bottom: 20px; + box-sizing: border-box; +`,Q$=u.textarea` + width: 100%; + height: 460px; /* 고정된 높이 */ + border: none; /* 테두리 제거 */ + border-radius: 10px; + padding: 20px; + outline: none; /* 포커스 시 외곽선 제거 */ + resize: none; /* 크기 조절 비활성화 */ + font-size: 1rem; /* 텍스트 크기 */ + line-height: 1.5; + color: #333; /* 텍스트 색상 */ + box-sizing: border-box; +`,V$=u.div` + display: flex; + justify-content: flex-end; + margin-top: 20px; + gap: 10px; +`,K$=u.button` + padding: 10px 20px; + background-color: #000; + color: white; + font-size: 1rem; + font-weight: bold; + border: none; + border-radius: 5px; + cursor: pointer; + + &:hover { + background-color: #484848; + } +`,G$=u.button` + padding: 10px 20px; + background-color: #ff0000; + color: white; + font-size: 1rem; + font-weight: bold; + border: none; + border-radius: 5px; + cursor: pointer; + + &:hover { + background-color: #ff1e1b; + } +`,q$=()=>{const{id:e}=ao();if(!e)return s.jsx("p",{children:"상품 번호가 유실되었습니다."});const t=Number(e),n=window.location.search,i=new URLSearchParams(n).get("price"),{data:o,isLoading:a,isError:l}=jl(t);return o?s.jsx(s.Fragment,{children:s.jsx(lo,{isLoading:a,isError:l,children:s.jsxs(J$,{children:[s.jsxs(Y$,{children:[s.jsx(X$,{children:"결제 실패"}),s.jsx(Z$,{children:"죄송합니다. 결제에 실패하였습니다."}),s.jsxs(eF,{children:[s.jsxs(sy,{children:[s.jsx(ay,{children:"상품명"}),s.jsx(ly,{children:o==null?void 0:o.name})]}),s.jsxs(sy,{children:[s.jsx(ay,{children:"결제 금액"}),s.jsxs(ly,{children:[i," 원"]})]})]})]}),s.jsxs(tF,{children:[s.jsx(nF,{to:`/products/${t}`,children:"다시 시도하기"}),s.jsx(rF,{to:"/",children:"메인으로 돌아가기"})]})]})})}):s.jsx("p",{children:"해당 상품을 찾을 수 없습니다."})},J$=u.div` + width: 100%; + max-width: 650px; + margin: 0 auto; + padding: 20px; + background-color: #f8fafc; + display: flex; + flex-direction: column; + align-items: center; +`,Y$=u.div` + width: 100%; + background-color: white; + border-radius: 12px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + padding: 32px 20px; + text-align: center; + margin-bottom: 24px; +`,X$=u.h1` + font-size: 1.5rem; + font-weight: 700; + color: #1e293b; + margin-bottom: 12px; +`,Z$=u.p` + color: #64748b; + font-size: 1rem; + margin-bottom: 24px; +`,eF=u.div` + background-color: #f8fafc; + border-radius: 8px; + padding: 16px; + margin-top: 20px; +`,sy=u.div` + display: flex; + justify-content: space-between; + margin-bottom: 12px; + + &:last-child { + margin-bottom: 0; + } +`,ay=u.span` + color: #64748b; + font-size: 0.875rem; +`,ly=u.span` + color: #1e293b; + font-weight: 500; +`,tF=u.div` + display: flex; + gap: 12px; + width: 100%; +`,pj=u(Gn)` + flex: 1; + text-decoration: none; + display: flex; + justify-content: center; + align-items: center; + padding: 12px; + border-radius: 8px; + font-weight: 600; + font-size: 0.875rem; + cursor: pointer; + transition: all 0.2s; +`,nF=u(pj)` + background-color: #2563eb; + border: none; + color: white; + + &:hover { + background-color: #1d4ed8; + } +`,rF=u(pj)` + background-color: white; + border: 1px solid #e2e8f0; + color: #475569; + + &:hover { + background-color: #f8fafc; + } +`,Cf=12,iF=()=>{var g;const e=Ie(),t=it(),[n,r]=C.useState([]),[i,o]=C.useState(1),[a,l]=C.useState(!1),d=new URLSearchParams(t.search).get("roomId"),p=Math.ceil(n.length/Cf);C.useEffect(()=>{(async()=>{const w=await LN();r(w)})()},[]);const f=(i-1)*Cf,h=n.slice(f,f+Cf),j=()=>{l(!0)},x=()=>{l(!1),e(-1)};return s.jsx(oF,{children:s.jsxs(sF,{children:[s.jsxs(aF,{children:[s.jsx(lF,{children:"채팅방 관리"}),s.jsx(cF,{children:s.jsx(uF,{onClick:()=>e(-1),children:s.jsx(Om,{size:24})})})]}),s.jsxs(dF,{children:[s.jsx(fF,{children:h.map(S=>s.jsxs(pF,{onClick:j,children:[s.jsx(hF,{children:S.roomName}),s.jsxs(mF,{children:["참여자: ",S.chatMembers.join(", ")]})]},S.postId))}),s.jsx(Fm,{currentPage:i,totalPages:p,onPageChange:S=>o(S)}),a&&d&&s.jsx(fj,{chatRoomId:d,chatRoomTitle:((g=n.find(S=>S.postId.toString()===d))==null?void 0:g.roomName)||"",isOpen:a,onClose:x,webSocketService:Pl,isAdminPage:!0})]})]})})},oF=u.div` + padding: 20px; + display: flex; + flex-direction: column; + align-items: center; +`,sF=u.div` + width: 100%; + max-width: 1120px; + margin: 0 auto; +`,aF=u.div` + display: flex; + flex-direction: column; /* Title과 HeaderWrapper를 세로로 배치 */ + gap: 10px; /* Title과 HeaderWrapper 사이 간격 */ + margin-bottom: 1.5rem; +`,lF=u.h1` + font-size: 1.8rem; + font-weight: bold; + text-align: left; + margin: 0; /* Title의 기본 마진 제거 */ +`,cF=u.div` + width: 1000px; + margin: 30px auto 0; + display: flex; + justify-content: space-between; + align-items: center; +`,uF=u.button` + background: none; + border: none; + cursor: pointer; +`,dF=u.div` + display: flex; + flex-direction: column; + background: #fff; + padding: 20px; + border-radius: 10px; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); +`,fF=u.div` + display: flex; + flex-wrap: wrap; + gap: 20px; + justify-content: flex-start; +`,pF=u.div` + background: #f9f9f9; + border: 1px solid #ddd; + border-radius: 10px; + padding: 20px; + width: 300px; + cursor: pointer; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + + &:hover { + background: #f1f1f1; + } +`,hF=u.h3` + font-size: 18px; + margin-bottom: 10px; +`,mF=u.p` + font-size: 14px; + color: #666; +`,gF=e=>({"004":"KB국민은행","045":"MG새마을금고","034":"광주은행","011":"NH농협은행","003":"IBK기업은행","088":"신한은행","020":"우리은행","007":"수협은행"})[e]||"알 수 없는 은행",xF=()=>{const e=it(),t=Ie(),n=e.state;if(!n)return s.jsx("div",{children:"잘못된 접근입니다."});const{bankCode:r,accountNumber:i,totalAmount:o,onConfirm:a,communityPostId:l}=n,[c,d]=C.useState(""),[p,f]=C.useState(""),[h,j]=C.useState("");C.useEffect(()=>{d(gF(r))},[r]);const x=S=>{f(S.target.value),j("")},g=()=>{const S=Number(p);if(S!==o){j(`입금 금액이 정확하지 않습니다. 총 금액: ${o.toLocaleString()} 원`);return}a(S),t(`/community/post/${l}/payment/complete`,{state:{communityPostId:l}})};return s.jsx(yF,{children:s.jsxs(vF,{children:[s.jsx(wF,{children:"입금 정보 확인"}),s.jsxs(bF,{children:[s.jsxs(Sf,{children:[s.jsx(Pf,{children:"은행명:"}),s.jsx(Ef,{children:c})]}),s.jsxs(Sf,{children:[s.jsx(Pf,{children:"계좌 번호:"}),s.jsx(Ef,{children:i})]}),s.jsxs(Sf,{children:[s.jsx(Pf,{children:"결제 금액:"}),s.jsxs(Ef,{children:[o.toLocaleString()," 원"]})]})]}),s.jsxs(jF,{children:[s.jsx(CF,{type:"number",placeholder:"입금 금액을 입력하세요",value:p,onChange:x}),h&&s.jsx(SF,{children:h})]}),s.jsx(PF,{children:s.jsx(EF,{onClick:g,children:"확인"})})]})})},yF=u.div` + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + background-color: #f8f9fa; +`,vF=u.div` + background: #fff; + padding: 30px; + border-radius: 10px; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + max-width: 400px; + width: 100%; +`,wF=u.h1` + font-size: 1.5rem; + font-weight: bold; + text-align: center; + margin-bottom: 20px; +`,bF=u.div` + margin-bottom: 20px; +`,Sf=u.div` + display: flex; + justify-content: space-between; + margin-bottom: 10px; +`,Pf=u.span` + font-weight: bold; + color: #333; +`,Ef=u.span` + color: #555; +`,jF=u.div` + margin-bottom: 20px; +`,CF=u.input` + width: 100%; + padding: 10px; + font-size: 1rem; + border: 1px solid #ccc; + border-radius: 5px; +`,SF=u.p` + color: red; + font-size: 0.9rem; + margin-top: 10px; +`,PF=u.div` + display: flex; + justify-content: center; +`,EF=u.button` + padding: 10px 20px; + font-size: 1rem; + font-weight: bold; + color: #fff; + background-color: #007bff; + border: none; + border-radius: 5px; + cursor: pointer; + + &:hover { + background-color: #0056b3; + } +`,da=({children:e})=>{const{isLoggedIn:t}=zs();return t?s.jsx(s.Fragment,{children:e}):s.jsx(u2,{to:"/signin"})},kF=v2([{path:"/",element:s.jsxs(s.Fragment,{children:[s.jsx(sO,{}),s.jsx(ZM,{}),s.jsx(Tm,{})]}),errorElement:s.jsx(T2,{}),children:[{path:"/",element:s.jsx(_A,{})},{path:"/products",element:s.jsx(da,{children:s.jsx($5,{})})},{path:"/products/:id",element:s.jsx(da,{children:s.jsx(s_,{})})},{path:"/products/payment/:id",element:s.jsx(EM,{})},{path:"/products/payment-success/:id",element:s.jsx(HM,{})},{path:"/products/payment-fail/:id",element:s.jsx(q$,{})},{path:"/community/post",element:s.jsx(da,{children:s.jsx(n4,{})})},{path:"/community/post/create",element:s.jsx(a4,{})},{path:"/community/post/:communityPostId",element:s.jsx(DI,{})},{path:"/mypage/post/:communityPostId/edit",element:s.jsx(eL,{})},{path:"/community/post/:communityPostId/payment/author",element:s.jsx(XL,{})},{path:"/community/post/:communityPostId/payment/participant",element:s.jsx(mN,{})},{path:"/community/post/:communityPostId/payment/deposit",element:s.jsx(xF,{})},{path:"/community/post/:communityPostId/payment/complete",element:s.jsx(r$,{})},{path:"/admin/post",element:s.jsx(da,{children:s.jsx(d$,{})})},{path:"/admin/post/approval/:communityPostId",element:s.jsx(x$,{})},{path:"/admin/chatlist",element:s.jsxs(da,{children:[" ",s.jsx(iF,{})]})},{path:"/mypage",children:[{path:"setting",element:s.jsx(bD,{})},{path:"orderlist",element:s.jsx(YT,{})},{path:"wishlist",element:s.jsx(ZT,{})},{path:"location",element:s.jsx(h6,{})},{path:"refund",element:s.jsx(v6,{})},{path:"notification",element:s.jsx(D6,{})},{path:"myposts",element:s.jsx(U6,{})},{path:"chatlist",element:s.jsx(Z6,{})}]}]},{path:"/signin",element:s.jsx(mO,{})},{path:"/signup",element:s.jsx(CO,{})},{path:"/findpassword",element:s.jsx(OO,{})},{path:"/resetpassword",element:s.jsx(QO,{})},{path:"/termsandservice",element:s.jsx(i5,{})},{path:"/setlocation",element:s.jsx(LL,{})},{path:"/setnickname",element:s.jsx(eM,{})},{path:"/setprofile",element:s.jsx(aM,{})},{path:"/logincomplete",element:s.jsx(xM,{})},{path:"*",element:s.jsx(M2,{})}],{future:{v7_relativeSplatPath:!0,v7_fetcherPersist:!0,v7_normalizeFormMethod:!0,v7_partialHydration:!0,v7_skipActionErrorRevalidation:!0}}),RF=LE` + body { + margin: 0; + font-family: 'Arial', sans-serif; + background-color: #fff; + } +`,AF=new ck({defaultOptions:{queries:{refetchOnWindowFocus:!1}}});B1(document.getElementById("root")).render(s.jsx(hk,{client:AF,children:s.jsx(OI,{children:s.jsxs(o_,{children:[s.jsx(RF,{}),s.jsx(R2,{router:kF,future:{v7_startTransition:!0}})]})})})); diff --git a/dist/index.html b/dist/index.html index 1468d48..254af57 100644 --- a/dist/index.html +++ b/dist/index.html @@ -13,7 +13,7 @@ Good-Buy-Us - +
diff --git a/src/components/common/ChatRoom.tsx b/src/components/common/ChatRoom.tsx index 8a76d6c..485229f 100644 --- a/src/components/common/ChatRoom.tsx +++ b/src/components/common/ChatRoom.tsx @@ -32,22 +32,21 @@ const ChatRoom: React.FC = ({ useEffect(() => { // 채팅방 초기 메시지 및 채팅 메시지 가져오기 const fetchMessages = async () => { - try { - const fetchedMessages = await fetchChatMessages(chatRoomId); - - // 입장 메시지 추가 - const joinMessage: Message = { - senderId: 'system', - content: `${chatMembers - .map((member) => getNicknameDisplay(member)) - .join(', ')}님이 입장하셨습니다.`, - timestamp: null, // timestamp 표시하지 않음 - }; - - // 그룹 채팅 안내 메시지 추가 - const groupChatNotice: Message = { - senderId: 'system', - content: ` + const fetchedMessages = await fetchChatMessages(chatRoomId); + + // 입장 메시지 추가 + const joinMessage: Message = { + senderId: 'system', + content: `${chatMembers + .map((member) => getNicknameDisplay(member)) + .join(', ')}님이 입장하셨습니다.`, + timestamp: null, // timestamp 표시하지 않음 + }; + + // 그룹 채팅 안내 메시지 추가 + const groupChatNotice: Message = { + senderId: 'system', + content: ` 안내사항: 환불 및 이탈 관련 정책 1. 환불 및 수령 시간/위치 조율 - 공구 진행 중(최종 승인 이후)인 채팅방에서 @@ -73,13 +72,10 @@ const ChatRoom: React.FC = ({ 공구 진행에 차질이 없도록 적극적인 협조 부탁드립니다. 😊`, - timestamp: null, - }; + timestamp: null, + }; - setMessages([joinMessage, groupChatNotice, ...fetchedMessages]); - } catch (error) { - console.error('Failed to fetch messages:', error); - } + setMessages([joinMessage, groupChatNotice, ...fetchedMessages]); }; fetchMessages(); @@ -96,20 +92,15 @@ const ChatRoom: React.FC = ({ setMessages((prev) => [...prev, data]); }; - webSocketService.connect( - () => { - webSocketService.subscribe( - `/sub/message/${chatRoomId}`, - (messageOutput) => { - const data = JSON.parse(messageOutput.body); - handleIncomingMessage(data); - } - ); - console.log('WebSocket connected to room'); - }, - () => console.log('WebSocket disconnected'), - () => console.error('WebSocket connection error') - ); + webSocketService.connect(() => { + webSocketService.subscribe( + `/sub/message/${chatRoomId}`, + (messageOutput) => { + const data = JSON.parse(messageOutput.body); + handleIncomingMessage(data); + } + ); + }); return () => { webSocketService.unsubscribe(`/sub/message/${chatRoomId}`); diff --git a/src/components/pages/admin/ChatRoomManagementPage.tsx b/src/components/pages/admin/ChatRoomManagementPage.tsx index f001134..e29fdbd 100644 --- a/src/components/pages/admin/ChatRoomManagementPage.tsx +++ b/src/components/pages/admin/ChatRoomManagementPage.tsx @@ -31,12 +31,8 @@ const ChatRoomManagementPage = () => { useEffect(() => { const fetchData = async () => { - try { - const rooms = await fetchAllChatRooms(); - setChatRooms(rooms); - } catch (error) { - console.error('Failed to fetch chat rooms:', error); - } + const rooms = await fetchAllChatRooms(); + setChatRooms(rooms); }; fetchData(); diff --git a/src/components/pages/admin/PostApprovalPage.tsx b/src/components/pages/admin/PostApprovalPage.tsx index 6daf251..8cd9d4d 100644 --- a/src/components/pages/admin/PostApprovalPage.tsx +++ b/src/components/pages/admin/PostApprovalPage.tsx @@ -22,12 +22,8 @@ const PostApprovalPage = () => { navigate('/admin/post'); // postId가 없을 경우 관리자 페이지로 리다이렉트 return; } - try { - const postDetails = await fetchPostById(postId); // 포스트 세부 정보 가져오기 - setPost(postDetails.communityPost); - } catch (error) { - console.error('Failed to fetch post details:', error); - } + const postDetails = await fetchPostById(postId); // 포스트 세부 정보 가져오기 + setPost(postDetails.communityPost); }; fetchPost(); }, [postId, navigate]); @@ -58,8 +54,8 @@ const PostApprovalPage = () => { await approvePost(postId, updatedTitle); // 포스트 상태를 APPROVED로 변경 alert('게시물이 승인되었습니다.'); navigate('/admin/post'); // 승인 후 관리자 페이지로 리다이렉트 + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (error) { - console.error('Failed to approve post:', error); alert('승인 처리 중 오류가 발생했습니다.'); } }; @@ -75,8 +71,8 @@ const PostApprovalPage = () => { await rejectPost(postId, updatedTitle); // 포스트 상태를 REJECTED로 변경 alert('게시물이 거절 처리되었습니다.'); navigate('/admin/post'); // 거절 후 관리자 페이지로 리다이렉트 + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (error) { - console.error('Failed to reject post:', error); alert('거절 처리 중 오류가 발생했습니다.'); } }; diff --git a/src/components/pages/admin/PostManagementPage.tsx b/src/components/pages/admin/PostManagementPage.tsx index 5748e63..56f7da6 100644 --- a/src/components/pages/admin/PostManagementPage.tsx +++ b/src/components/pages/admin/PostManagementPage.tsx @@ -26,12 +26,8 @@ const PostManagementPage = () => { useEffect(() => { const fetchPosts = async () => { - try { - const response = await fetchPendingPosts(); - setPosts(response); - } catch (error) { - console.error('Failed to fetch posts:', error); - } + const response = await fetchPendingPosts(); + setPosts(response); }; fetchPosts(); diff --git a/src/components/pages/admin/api/adminApi.ts b/src/components/pages/admin/api/adminApi.ts index c4fcea6..504770a 100644 --- a/src/components/pages/admin/api/adminApi.ts +++ b/src/components/pages/admin/api/adminApi.ts @@ -3,20 +3,15 @@ import { Post } from '../../../../types/postTypes'; // 관리자용 승인 대기 중인 포스트 목록 조회 export const fetchPendingPosts = async (): Promise => { - try { - const response = await axiosInstance.get('/api/admin/post', { - headers: { - Authorization: `Bearer ${localStorage.getItem('jwt')}`, - }, - }); - if (response.status !== 200) { - throw new Error('Failed to fetch pending posts'); - } - return response.data; - } catch (error) { - console.error('Error fetching pending posts:', error); - throw error; + const response = await axiosInstance.get('/api/admin/post', { + headers: { + Authorization: `Bearer ${localStorage.getItem('jwt')}`, + }, + }); + if (response.status !== 200) { + throw new Error('Failed to fetch pending posts'); } + return response.data; }; // 관리자용 포스트 승인 처리 diff --git a/src/components/pages/community/PaymentCompletePage.tsx b/src/components/pages/community/PaymentCompletePage.tsx index 486467a..2b53dfe 100644 --- a/src/components/pages/community/PaymentCompletePage.tsx +++ b/src/components/pages/community/PaymentCompletePage.tsx @@ -48,8 +48,8 @@ const PaymentCompletePage: React.FC = () => { if (data.status === 'DONE') { setStatus('DONE'); } + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (error) { - console.error('결제 상태 조회 오류:', error); alert('결제 상태를 확인할 수 없습니다.'); } }; @@ -62,8 +62,8 @@ const PaymentCompletePage: React.FC = () => { title: postData.communityPost.title, unitAmount: postData.communityPost.unitAmount, }); + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (error) { - console.error('게시물 정보 조회 오류:', error); alert('게시물 정보를 가져올 수 없습니다.'); } }; @@ -76,8 +76,8 @@ const PaymentCompletePage: React.FC = () => { try { const chatRoom = await createChatRoom(parseInt(communityPostId)); setChatRoom(chatRoom); + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (error) { - console.error('채팅방 생성 오류:', error); alert('채팅방을 생성할 수 없습니다.'); } }; diff --git a/src/components/pages/community/PostCreatePage.tsx b/src/components/pages/community/PostCreatePage.tsx index 6c4df2d..fce8d2c 100644 --- a/src/components/pages/community/PostCreatePage.tsx +++ b/src/components/pages/community/PostCreatePage.tsx @@ -42,8 +42,7 @@ const PostCreatePage = () => { alert('포스트가 작성되었습니다. 관리자의 승인을 대기 중입니다.'); navigate('/community/post'); }, - onError: (error) => { - console.error('포스트 생성 중 오류 발생:', error); + onError: () => { alert('포스트 생성에 실패했습니다.'); }, }); diff --git a/src/components/pages/community/PostDetailPage.tsx b/src/components/pages/community/PostDetailPage.tsx index 62c3900..3b6e1c5 100644 --- a/src/components/pages/community/PostDetailPage.tsx +++ b/src/components/pages/community/PostDetailPage.tsx @@ -66,8 +66,8 @@ const PostDetailPage: React.FC = () => { const data = await fetchPostById(Number(communityPostId!)); setData(data); setPost(data.communityPost); + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (error) { - console.error('Failed to fetch post details:', error); navigate('*'); } }; @@ -106,7 +106,6 @@ const PostDetailPage: React.FC = () => { }; eventSource.onerror = () => { - console.error('SSE 연결 오류 발생'); eventSource.close(); }; @@ -209,8 +208,7 @@ const PostDetailPage: React.FC = () => { alert('공구 참여가 완료되었습니다.'); queryClient.invalidateQueries({ queryKey }); // 정확한 queryKey 사용 }, - onError: (error: Error) => { - console.error('공구 참여 실패:', error.message); // 오류 메시지 출력 + onError: () => { alert('공구 참여에 실패했습니다.'); }, }); @@ -263,8 +261,7 @@ const PostDetailPage: React.FC = () => { alert('공구 참여가 완료되었습니다.'); queryClient.invalidateQueries({ queryKey }); }, - onError: (error: Error) => { - console.error('공구 참여 실패:', error.message); + onError: () => { alert('공구 참여에 실패했습니다.'); }, } diff --git a/src/components/pages/community/PostEditPage.tsx b/src/components/pages/community/PostEditPage.tsx index a92ae44..4a98530 100644 --- a/src/components/pages/community/PostEditPage.tsx +++ b/src/components/pages/community/PostEditPage.tsx @@ -127,8 +127,8 @@ const PostEditPage = () => { await updatePost(Number(communityPostId), updatedPost); // 게시글 수정 API 호출 alert('게시글이 성공적으로 수정되었습니다.'); navigate(`/mypage/post/${communityPostId}`); + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (error) { - console.error('게시글 수정 중 오류 발생:', error); alert('게시글 수정에 실패했습니다. 다시 시도해주세요.'); } }; @@ -252,8 +252,8 @@ const PostEditPage = () => { await deletePostById(Number(communityPostId)); // 삭제 API 호출 alert('게시글이 성공적으로 삭제되었습니다.'); navigate('/mypage/post'); + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (error) { - console.error('게시글 삭제 중 오류 발생:', error); alert('게시글 삭제에 실패했습니다. 다시 시도해주세요.'); } }; diff --git a/src/components/pages/community/api/chatApi.ts b/src/components/pages/community/api/chatApi.ts index 0dd6b60..baa4f1c 100644 --- a/src/components/pages/community/api/chatApi.ts +++ b/src/components/pages/community/api/chatApi.ts @@ -9,15 +9,14 @@ export const createChatRoom = async (postId: number) => { throw new Error('Failed to create chat room'); } + // eslint-disable-next-line @typescript-eslint/no-unused-vars const { id, roomName } = response.data; - console.log(`Chat room created: ${roomName} (ID: ${id})`); // 채팅방 구독 시작 webSocketService.subscribe( `/sub/message/${id}`, - (message) => { - console.log(`Message in room ${id}:`, message); - }, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + (message) => {}, true ); @@ -36,8 +35,6 @@ export const deleteChatRoom = async (chatRoomId: number) => { throw new Error('Failed to delete chat room'); } - console.log(`Chat room ${chatRoomId} deleted`); - // 채팅방 구독 취소 webSocketService.unsubscribe(`/sub/message/${chatRoomId}`); return response.data; @@ -55,7 +52,6 @@ export const fetchMyChatRooms = async () => { throw new Error('Failed to fetch my chat rooms'); } - console.log('Fetched my chat rooms:', response.data); return response.data; }; @@ -71,7 +67,6 @@ export const fetchAllChatRooms = async () => { throw new Error('Failed to fetch all chat rooms'); } - console.log('Fetched all chat rooms:', response.data); return response.data; }; @@ -89,7 +84,6 @@ export const sendMessage = ( }; webSocketService.send(`/pub/message/${chatRoomId}`, payload); - console.log(`Message sent to room ${chatRoomId}:`, payload); }; // 채팅 메시지 구독 @@ -99,35 +93,24 @@ export const subscribeToChatMessages = ( callback: (message: any) => void ) => { webSocketService.subscribe(`/sub/message/${chatRoomId}`, callback, true); - console.log(`Subscribed to messages for room ${chatRoomId}`); }; // 채팅 메시지 구독 취소 export const unsubscribeFromChatMessages = (chatRoomId: number) => { webSocketService.unsubscribe(`/sub/message/${chatRoomId}`); - console.log(`Unsubscribed from messages for room ${chatRoomId}`); }; // 채팅 내용 조회 export const fetchChatMessages = async (chatRoomId: number) => { - try { - const response = await axiosInstance.get(`/api/chat/${chatRoomId}`, { - headers: { - Authorization: `Bearer ${localStorage.getItem('jwt')}`, - }, - }); - - if (response.status !== 200) { - throw new Error('Failed to fetch chat messages'); - } - - console.log(`Fetched messages for chat room ${chatRoomId}:`, response.data); - return response.data; - } catch (error) { - console.error( - `Error fetching messages for chat room ${chatRoomId}:`, - error - ); - throw error; + const response = await axiosInstance.get(`/api/chat/${chatRoomId}`, { + headers: { + Authorization: `Bearer ${localStorage.getItem('jwt')}`, + }, + }); + + if (response.status !== 200) { + throw new Error('Failed to fetch chat messages'); } + + return response.data; }; diff --git a/src/components/pages/community/api/paymentApi.ts b/src/components/pages/community/api/paymentApi.ts index 78facbd..ecfcc74 100644 --- a/src/components/pages/community/api/paymentApi.ts +++ b/src/components/pages/community/api/paymentApi.ts @@ -53,8 +53,8 @@ export const fetchPaymentStatus = async (paymentKey: string) => { `/api/v1/virtual/update-payment/${paymentKey}` ); return response.data; + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (error) { - console.error('결제 상태 확인 실패:', error); throw new Error('결제 상태 확인에 실패했습니다.'); } }; @@ -68,21 +68,16 @@ export const requestPayment = async ( deliveryRequest: string; } ) => { - try { - const response = await axiosInstance.post( - `/api/v1/virtual/${communityPostId}`, - paymentInfo, - { - headers: { - Authorization: `Bearer ${localStorage.getItem('accessToken')}`, - }, - } - ); - return response.data; - } catch (error) { - console.error('결제 요청 중 오류:', error); - throw error; - } + const response = await axiosInstance.post( + `/api/v1/virtual/${communityPostId}`, + paymentInfo, + { + headers: { + Authorization: `Bearer ${localStorage.getItem('accessToken')}`, + }, + } + ); + return response.data; }; // 결제 승인 요청 @@ -93,21 +88,16 @@ export const confirmPayment = async ( orderId: string; } ) => { - try { - const response = await axiosInstance.post( - `/api/v1/virtual/confirm-payment/${paymentKey}`, - paymentData, - { - headers: { - Authorization: `Bearer ${localStorage.getItem('accessToken')}`, - }, - } - ); - return response.data; - } catch (error) { - console.error('결제 승인 요청 중 오류:', error); - throw error; - } + const response = await axiosInstance.post( + `/api/v1/virtual/confirm-payment/${paymentKey}`, + paymentData, + { + headers: { + Authorization: `Bearer ${localStorage.getItem('accessToken')}`, + }, + } + ); + return response.data; }; // 환불 요청 @@ -123,19 +113,14 @@ export const requestRefund = async ( }; } ) => { - try { - const response = await axiosInstance.post( - `/api/v1/virtual/cancel-payment/${communityPostId}`, - refundData, - { - headers: { - Authorization: `Bearer ${localStorage.getItem('accessToken')}`, - }, - } - ); - return response.data; - } catch (error) { - console.error('환불 요청 중 오류:', error); - throw error; - } + const response = await axiosInstance.post( + `/api/v1/virtual/cancel-payment/${communityPostId}`, + refundData, + { + headers: { + Authorization: `Bearer ${localStorage.getItem('accessToken')}`, + }, + } + ); + return response.data; }; diff --git a/src/components/pages/community/api/postApi.ts b/src/components/pages/community/api/postApi.ts index 0f4d5b9..5fa494e 100644 --- a/src/components/pages/community/api/postApi.ts +++ b/src/components/pages/community/api/postApi.ts @@ -62,8 +62,6 @@ export const createPost = async ( postData.imageUrls.forEach((file) => { if (file instanceof File) { formData.append('images', file); // Content-Type은 자동 설정됨 - } else { - console.warn('Invalid image file detected:', file); } }); @@ -227,25 +225,20 @@ export const handleSSEUpdate = ( // SSE 메시지 수신 eventSource.onmessage = (event) => { - try { - const data: SSEEvent = JSON.parse(event.data); + const data: SSEEvent = JSON.parse(event.data); - // 상태 갱신 함수가 있을 경우 호출 - if (updateState) { - updateState({ - postStatus: data.postStatus, - participationCount: data.participationCount, - paymentCount: data.paymentCount, - }); - } - } catch (error) { - console.error('Failed to parse SSE data:', error); + // 상태 갱신 함수가 있을 경우 호출 + if (updateState) { + updateState({ + postStatus: data.postStatus, + participationCount: data.participationCount, + paymentCount: data.paymentCount, + }); } }; // SSE 연결 오류 처리 - eventSource.onerror = (error) => { - console.error('SSE connection error:', error); + eventSource.onerror = () => { eventSource.close(); }; }; diff --git a/src/components/pages/community/modal/ChatRoomModal.tsx b/src/components/pages/community/modal/ChatRoomModal.tsx index baf60e7..187ec46 100644 --- a/src/components/pages/community/modal/ChatRoomModal.tsx +++ b/src/components/pages/community/modal/ChatRoomModal.tsx @@ -48,8 +48,8 @@ const ChatRoomModal: React.FC = ({ alert('채팅방이 성공적으로 삭제되었습니다.'); onClose(); // 모달 닫기 } + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (error) { - console.error('채팅방 삭제 실패:', error); alert('채팅방을 삭제할 수 없습니다.'); } }; diff --git a/src/components/pages/community/modal/VirtualAccountModal.tsx b/src/components/pages/community/modal/VirtualAccountModal.tsx index f0d7581..31f5ad0 100644 --- a/src/components/pages/community/modal/VirtualAccountModal.tsx +++ b/src/components/pages/community/modal/VirtualAccountModal.tsx @@ -50,8 +50,8 @@ const VirtualAccountModal: React.FC = ({ } ); onComplete(response.data); + // eslint-disable-next-line @typescript-eslint/no-unused-vars } catch (error) { - console.error('가상 계좌 발급 실패:', error); alert('가상 계좌 발급에 실패했습니다.'); } finally { setLoading(false); diff --git a/src/store/postStore.ts b/src/store/postStore.ts index dc25a9a..1a1aabf 100644 --- a/src/store/postStore.ts +++ b/src/store/postStore.ts @@ -13,8 +13,7 @@ export const postsAtom = atomWithQuery(() => ({ return response.data; }, // eslint-disable-next-line @typescript-eslint/no-explicit-any - onError: (error: any) => { - console.error('Error fetching posts:', error); + onError: () => { alert('포스트를 불러오는 데 실패했습니다.'); }, })); @@ -35,8 +34,7 @@ export const selectedPostAtom = atomWithQuery( return await fetchPostById(communityPostId); }, enabled: Boolean(get(selectedPostIdAtom)), // 유효성 검사 - onError: (error: unknown) => { - console.error('Error fetching selected post:', error); + onError: () => { alert('선택된 포스트를 불러오는 데 실패했습니다.'); }, }) @@ -59,8 +57,7 @@ export const subscribeToSSE = ( setRealTimeData(data); // 상태를 업데이트 }; - eventSource.onerror = (error) => { - console.error('SSE connection error:', error); + eventSource.onerror = () => { eventSource.close(); }; @@ -81,7 +78,6 @@ export const sseSubscriptionAtom = atom((get) => { // 컴포넌트가 해제되면 이벤트 소스 닫기 return () => { eventSource.close(); - console.log('SSE connection closed'); }; }; }); diff --git a/src/utils/GetImageSrc.tsx b/src/utils/GetImageSrc.tsx index ed44280..8d87a5d 100644 --- a/src/utils/GetImageSrc.tsx +++ b/src/utils/GetImageSrc.tsx @@ -2,7 +2,6 @@ export const getImageSrc = ( image: File | string | null | undefined ): string => { if (!image) { - console.error('No image provided'); return ''; } @@ -14,14 +13,8 @@ export const getImageSrc = ( const baseUrl = process.env.VITE_API_URL || 'http://15.164.5.135:8080'; return `${baseUrl}/${image}`; } else if (image instanceof File) { - try { - return URL.createObjectURL(image); - } catch (error) { - console.error('Failed to create object URL for file:', error); - return ''; - } + return URL.createObjectURL(image); } else { - console.error('Invalid image format:', image); return ''; } }; diff --git a/src/utils/SSEHandler.tsx b/src/utils/SSEHandler.tsx index 79763b6..3ce286b 100644 --- a/src/utils/SSEHandler.tsx +++ b/src/utils/SSEHandler.tsx @@ -34,7 +34,6 @@ const SSEHandler: React.FC<{ communityPostId: number }> = ({ }; eventSource.onerror = () => { - console.error('SSE 연결 오류'); eventSource.close(); }; diff --git a/src/utils/webSocket.ts b/src/utils/webSocket.ts index 57927d4..59367fc 100644 --- a/src/utils/webSocket.ts +++ b/src/utils/webSocket.ts @@ -17,7 +17,6 @@ export class WebSocketService { this.socket = new WebSocket(this.url); this.socket.onopen = () => { - console.log('WebSocket connected'); if (onOpen) onOpen(); this.reconnectAttempts = 0; // 성공적으로 연결되면 재시도 횟수 초기화 this.resubscribe(); // 재연결 시 특정 구독 복구 @@ -29,19 +28,15 @@ export class WebSocketService { if (destination && this.subscriptions.has(destination)) { const callback = this.subscriptions.get(destination); if (callback) callback(data.message); - } else { - console.warn('No subscription found for destination:', destination); } }; this.socket.onclose = () => { - console.log('WebSocket disconnected'); if (onClose) onClose(); this.reconnect(); }; this.socket.onerror = (error) => { - console.error('WebSocket error:', error); if (onError) onError(error); }; } @@ -53,9 +48,6 @@ export class WebSocketService { ) { if (!this.subscriptions.has(destination)) { this.subscriptions.set(destination, callback); - console.log(`Subscribed to ${destination}`); - } else { - console.warn(`Already subscribed to ${destination}`); } // 재구독이 필요한 경우에만 추가 if (enableReconnect) { @@ -66,21 +58,16 @@ export class WebSocketService { unsubscribe(destination: string) { if (this.subscriptions.has(destination)) { this.subscriptions.delete(destination); - this.reconnectSubscriptions.delete(destination); // 재구독 목록에서도 제거 - console.log(`Unsubscribed from ${destination}`); - } else { - console.warn(`No subscription found for ${destination}`); + this.reconnectSubscriptions.delete(destination); } } send(destination: string, message: any) { if (!this.socket || this.socket.readyState !== WebSocket.OPEN) { - console.warn('WebSocket is not connected'); return; } const payload = JSON.stringify({ destination, message }); - console.log(`Sending message to ${destination}:`, payload); this.socket.send(payload); } @@ -91,36 +78,21 @@ export class WebSocketService { close() { if (this.socket) { this.socket.close(); - console.log('WebSocket connection closed'); } } private reconnect() { if (this.reconnectAttempts < this.maxReconnectAttempts) { this.reconnectAttempts++; - console.log( - `Reconnecting... (${this.reconnectAttempts}/${this.maxReconnectAttempts})` - ); - setTimeout(() => { - this.connect( - (data) => console.log('Reconnected message:', data), // onMessage - () => console.log('Reconnected successfully'), // onOpen - () => console.log('Reconnection closed'), // onClose - (error) => console.error('Reconnection error:', error) // onError - ); - }, 3000); // 3초 후 재연결 시도 - } else { - console.error('Max reconnect attempts reached'); + setTimeout(() => {}, 3000); // 3초 후 재연결 시도 } } private resubscribe() { if (this.reconnectSubscriptions.size > 0) { - console.log('Resubscribing to specific channels after reconnect'); this.reconnectSubscriptions.forEach((destination) => { const callback = this.subscriptions.get(destination); if (callback) { - console.log(`Resubscribing to ${destination}`); this.subscribe(destination, callback); // 구독 복구 } });