1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,15013,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0,n.default=function(){for(var e,t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];"u">typeof window&&(void 0===window.gtag&&(window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)}),(e=window).gtag.apply(e,n))}},9905,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",o=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=n||"";return o&&(a=n.toString().trim().replace(/[A-Za-z0-9\u00C0-\u00FF]+[^\s-]*/g,function(e,t,n){return t>0&&t+e.length!==n.length&&e.search(r)>-1&&":"!==n.charAt(t-2)&&("-"!==n.charAt(t+e.length)||"-"===n.charAt(t-1))&&0>n.charAt(t-1).search(/[^\s-]/)?e.toLowerCase():e.substr(1).search(/[A-Z]|\../)>-1?e:e.charAt(0).toUpperCase()+e.substr(1)})),i&&(a="string"==typeof(t=e=a)&&-1!==t.indexOf("@")?(console.warn("This arg looks like an email address, redacting."),"REDACTED (Potential Email Address)"):e),a};var r=/^(a|an|and|as|at|but|by|en|for|if|in|nor|of|on|or|per|the|to|vs?\.?|via)$/i},49868,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.GA4=void 0;var r=s(e.r(15013)),o=s(e.r(9905)),i=["eventCategory","eventAction","eventLabel","eventValue","hitType"],a=["title","location"],l=["page","hitType"];function s(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||m(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?f(Object(n),!0).forEach(function(t){h(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):f(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function m(e,t){if(e){if("string"==typeof e)return g(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return g(e,t)}}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function h(e,t,n){return(t=v(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){var t=function(e,t){if("object"!==c(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!==c(r))return r;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===c(t)?t:String(t)}var y=function(){var e;function t(){var e=this;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");h(this,"reset",function(){e.isInitialized=!1,e._testMode=!1,e._currentMeasurementId,e._hasLoadedGA=!1,e._isQueuing=!1,e._queueGtag=[]}),h(this,"_gtag",function(){for(var t=arguments.length,n=Array(t),o=0;o<t;o++)n[o]=arguments[o];e._testMode||e._isQueuing?e._queueGtag.push(n):r.default.apply(void 0,n)}),h(this,"_loadGA",function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"https://www.googletagmanager.com/gtag/js";if("u">typeof window&&"u">typeof document&&!e._hasLoadedGA){var o=document.createElement("script");o.async=!0,o.src="".concat(r,"?id=").concat(t),n&&o.setAttribute("nonce",n),document.body.appendChild(o),window.dataLayer=window.dataLayer||[],window.gtag=function(){window.dataLayer.push(arguments)},e._hasLoadedGA=!0}}),h(this,"_toGtagOptions",function(e){if(e){var t={cookieUpdate:"cookie_update",cookieExpires:"cookie_expires",cookieDomain:"cookie_domain",cookieFlags:"cookie_flags",userId:"user_id",clientId:"client_id",anonymizeIp:"anonymize_ip",contentGroup1:"content_group1",contentGroup2:"content_group2",contentGroup3:"content_group3",contentGroup4:"content_group4",contentGroup5:"content_group5",allowAdFeatures:"allow_google_signals",allowAdPersonalizationSignals:"allow_ad_personalization_signals",nonInteraction:"non_interaction",page:"page_path",hitCallback:"event_callback"};return Object.entries(e).reduce(function(e,n){var r=function(e){if(Array.isArray(e))return e}(n)||function(e){var t=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,r,o,i,a=[],l=!0,s=!1;try{o=(t=t.call(e)).next,!1;for(;!(l=(n=o.call(t)).done)&&(a.push(n.value),2!==a.length);l=!0);}catch(e){s=!0,r=e}
1finally{try{if(!l&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(s)throw r}}return a}}(n)||m(n,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],i=r[1];return t[o]?e[t[o]]=i:e[o]=i,e},{})}}),h(this,"initialize",function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)throw Error("Require GA_MEASUREMENT_ID");var r="string"==typeof t?[{trackingId:t}]:t;e._currentMeasurementId=r[0].trackingId;var o=n.gaOptions,i=n.gtagOptions,a=n.nonce,l=n.testMode,s=void 0!==l&&l,u=n.gtagUrl;if(e._testMode=s,s||e._loadGA(e._currentMeasurementId,a,u),e.isInitialized||(e._gtag("js",new Date),r.forEach(function(t){var n=p(p(p({},e._toGtagOptions(p(p({},o),t.gaOptions))),i),t.gtagOptions);Object.keys(n).length?e._gtag("config",t.trackingId,n):e._gtag("config",t.trackingId)})),e.isInitialized=!0,!s){var c=d(e._queueGtag);for(e._queueGtag=[],e._isQueuing=!1;c.length;){var f=c.shift();e._gtag.apply(e,d(f)),"get"===f[0]&&(e._isQueuing=!0)}}}),h(this,"set",function(t){t?"object"!==c(t)?console.warn("Expected `fieldsObject` arg to be an Object"):(0===Object.keys(t).length&&console.warn("empty `fieldsObject` given to .set()"),e._gaCommand("set",t)):console.warn("`fieldsObject` is required in .set()")}),h(this,"_gaCommandSendEvent",function(t,n,r,o,i){e._gtag("event",n,p(p({event_category:t,event_label:r,value:o},i&&{non_interaction:i.nonInteraction}),e._toGtagOptions(i)))}),h(this,"_gaCommandSendEventParameters",function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];if("string"==typeof n[0])e._gaCommandSendEvent.apply(e,d(n.slice(1)));else{var o=n[0],a=o.eventCategory,l=o.eventAction,s=o.eventLabel,c=o.eventValue,f=(o.hitType,u(o,i));e._gaCommandSendEvent(a,l,s,c,f)}}),h(this,"_gaCommandSendTiming",function(t,n,r,o){e._gtag("event","timing_complete",{name:n,value:r,event_category:t,event_label:o})}),h(this,"_gaCommandSendPageview",function(t,n){if(n&&Object.keys(n).length){var r=e._toGtagOptions(n),o=r.title,i=r.location,l=u(r,a);e._gtag("event","page_view",p(p(p(p({},t&&{page_path:t}),o&&{page_title:o}),i&&{page_location:i}),l))}else t?e._gtag("event","page_view",{page_path:t}):e._gtag("event","page_view")}),h(this,"_gaCommandSendPageviewParameters",function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];if("string"==typeof n[0])e._gaCommandSendPageview.apply(e,d(n.slice(1)));else{var o=n[0],i=o.page,a=(o.hitType,u(o,l));e._gaCommandSendPageview(i,a)}}),h(this,"_gaCommandSend",function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];var o="string"==typeof n[0]?n[0]:n[0].hitType;switch(o){case"event":e._gaCommandSendEventParameters.apply(e,n);break;case"pageview":e._gaCommandSendPageviewParameters.apply(e,n);break;case"timing":e._gaCommandSendTiming.apply(e,d(n.slice(1)));break;case"screenview":case"transaction":case"item":case"social":case"exception":console.warn("Unsupported send command: ".concat(o));break;default:console.warn("Send command doesn't exist: ".concat(o))}}),h(this,"_gaCommandSet",function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];"string"==typeof n[0]&&(n[0]=h({},n[0],n[1])),e._gtag("set",e._toGtagOptions(n[0]))}),h(this,"_gaCommand",function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];switch(t){case"send":e._gaCommandSend.apply(e,r);break;case"set":e._gaCommandSet.apply(e,r);break;default:console.warn("Command doesn't exist: ".concat(t))}}),h(this,"ga",function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];if("string"==typeof n[0])e._gaCommand.apply(e,n);else{var o=n[0];e._gtag("get",e._currentMeasurementId,"client_id",function(t){e._isQueuing=!1;var n=e._queueGtag;for(o({get:function(n){return"clientId"===n?t:"trackingId"===n?e._currentMeasurementId:"apiVersion"===n?"1":void 0}});n.length;){var r=n.shift();e._gtag.apply(e,d(r))}}),e._isQueuing=!0}return e.ga}),h(this,"event",function(t,n){if("string"==typeof t)e._gtag("event",t,e._toGtagOptions(n));else{var r=t.action,i=t.category,a=t.label,l=t.value,s=t.nonInteraction,u=t.transport;if(!i||!r)return void console.warn("args.category AND args.action are required in event()");var c={hitType:"event",eventCategory:(0,o.default)(i),eventAction:(0,o.default)(r)};a&&(c.eventLabel=(0,o.default)(a)),void 0!==l&&("number"!=typeof l?console.warn("Expected `args.value` arg to be a Number."):c.eventValue=l),void 0!==s&&("boolean"!=typeof s?console.warn("`args.nonInteraction` must be a boolean."):c.nonInteraction=s),void 0!==u&&("string"!=typeof u?console.warn("`args.transport` must be a string."):(-1===["beacon","xhr","image"].indexOf(u)&&console.warn("`args.transport` must be either one of these values: `beacon`, `xhr` or `image`"),c.transport=u)),e._gaCommand("send",c)}}),h(this,"send",function(t){e._gaCommand("send",t)}),this.reset()}return e=[{key:"gtag",value:function(){this._gtag.apply(this,arguments)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,v(r.key),r)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();n.GA4=y,n.default=new y},68817,(e,t,n)=>{"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=n.ReactGAImplementation=void 0;
1var o=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!==r(e)&&"function"!=typeof e)return{default:e};var t=i(void 0);if(t&&t.has(e))return t.get(e);var n={},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var l=o?Object.getOwnPropertyDescriptor(e,a):null;l&&(l.get||l.set)?Object.defineProperty(n,a,l):n[a]=e[a]}return n.default=e,t&&t.set(e,n),n}(e.r(49868));function i(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,n=new WeakMap;return(i=function(e){return e?n:t})(e)}n.ReactGAImplementation=o.GA4,n.default=o.default},19610,e=>{"use strict";var t=e.i(68817);e.s(["handleLogEvent",0,(e="",n="",r="")=>{e&&n&&t.default.event({category:e,action:n,label:r})}])},77201,e=>{"use strict";var t=e.i(43476),n=e.i(61946);e.s(["default",0,({discount:e,product:r,slug:o,modal:i})=>{let{getNumber:a}=(0,n.default)(),l=r?.campaign,s=!!(l&&!1!==l.inCampaign),u=a(s?l.campaignPrice:r?.isCombination?r?.variants?.[0]?.price:r?.prices?.price),c=a(s?l.campaignOriginalPrice:r?.isCombination?r?.variants?.[0]?.originalPrice:r?.prices?.originalPrice),d=c>0?Math.round((c-u)/c*100):0,f=i?"absolute z-10 left-4 top-4 inline-flex items-center rounded-full bg-orange-50 px-2 py-1 text-xs font-semibold text-orange-700 ring-1 ring-orange-500/20 ring-inset":o?"inline-flex items-center rounded-full bg-orange-50 px-2 py-1 text-xs font-semibold text-orange-700 ring-1 ring-orange-500/20 ring-inset":"absolute z-10 right-3 top-3 inline-flex items-center rounded-full bg-orange-50 px-2 py-1 text-xs font-semibold text-orange-700 ring-1 ring-orange-500/20 ring-inset",p=i?"absolute z-10 left-4 top-4 inline-flex items-center rounded-full bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-red-600/10 ring-inset":o?"inline-flex items-center rounded-full bg-red-50 px-2 py-1 text-xs font-medium text-red-700 ring-1 ring-red-600/10 ring-inset":"absolute z-10 right-3 top-3 inline-flex items-center rounded-full bg-red-50 px-2 py-1 text-xs font-medium text-red-600 ring-1 ring-red-600/10 ring-inset";return e>1?(0,t.jsxs)("span",{className:s?f:p,children:[e,"% Off"]}):void 0===e&&d>1?(0,t.jsxs)("span",{className:s?f:p,children:[d,"% Off"]}):null}])},80359,e=>{"use strict";var t=e.i(43476),n=e.i(61946);e.s(["default",0,({product:e,price:r,card:o,originalPrice:i,currency:a,campaign:l})=>{let{formatPrice:s}=(0,n.default)(),u=e?.isCombination,c=l||u?r:e?.prices?.price,d=i>c?i-c:0;return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("div",{className:"product-price font-bold",children:[(0,t.jsx)("span",{className:`${o?"inline-block text-base text-foreground":"inline-block text-xl"}`,children:s(c,a)}),d>0&&(0,t.jsx)("span",{className:o?"sm:text-sm font-normal text-base text-muted-foreground ml-1":"text-sm font-normal text-muted-foreground ml-1",children:(0,t.jsxs)("del",{children:[" ",s(i,a)]})})]})})}])},87883,e=>{"use strict";var t=e.i(43476);e.i(91918);var n=e.i(25913);e.i(80064),(0,n.cva)("inline-flex items-center justify-center dark:text-muted-foreground rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",success:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90 focus-visible:ring-primary/20 dark:focus-visible:ring-primary/40 dark:bg-primary/60",parked:"border-transparent bg-orange-500 text-white [a&]:hover:bg-orange-500/90 focus-visible:ring-orange-500/20 dark:focus-visible:ring-orange-500/40 dark:bg-orange-500/60",error:"border-transparent bg-rose-500 text-white [a&]:hover:bg-rose-500/90 focus-visible:ring-rose-500/20 dark:focus-visible:ring-rose-500/40 dark:bg-rose-500/60",published:"border-transparent bg-sky-500 text-white [a&]:hover:bg-sky-500/90 focus-visible:ring-sky-500/20 dark:focus-visible:ring-sky-500/40 dark:bg-sky-500/60",unpublished:"border-transparent bg-pink-500 text-white [a&]:hover:bg-pink-500/90 focus-visible:ring-pink-500/20 dark:focus-visible:ring-pink-500/40 dark:bg-pink-500/60"}},defaultVariants:{variant:"default"}}),e.s(["default",0,({stock:e,card:n})=>(0,t.jsx)(t.Fragment,{children:e<=0?(0,t.jsx)("span",{className:"text-red-700 inline-flex items-center justify-center text-xs",children:"Stock out"}):(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)("span",{className:`${n?"text-xs text-muted-foreground":"inline-flex items-center justify-center text-xs text-muted-foreground"}`,children:["In stock:",(0,t.jsxs)("span",{className:"text-green-600 pl-1 font-normal",children:[e," "]})]})})})],87883)},44486,e=>{"use strict";var t=e.i(43476);e.i(71645),e.s(["default",0,({product:e})=>{let n=[];try{let t=e?.tag;if(Array.isArray(t))if(1===t.length&&"string"==typeof t[0])try{let e=JSON.parse(t[0]);n=Array.isArray(e)?e:[e]}catch{n=t[0]&&"[]"!==t[0]?[t[0]]:[]}else n=t;else if("string"==typeof t&&t.trim())try{let e=JSON.parse(t);n=Array.isArray(e)?e:[e]}catch{n=[t]}n=(n||[]).filter(e=>e&&"string"==typeof e&&"[]"!==e&&e.trim()).map(e=>e.trim())}catch(e){n=[]}return n&&0!==n.length?(0,t.jsx)("div",{className:"flex flex-row flex-wrap",children:n.map((e,n)=>(0,t.jsx)("span",{className:"bg-muted px-2 py-1 mr-2 border-0 text-muted-foreground rounded inline-flex items-center justify-center text-xs mt-2",children:e},n+1))}):null}])},86192,18060,e=>{"use strict";var t=e.i(43476),n=e.i(22016),r=e.i(57688),o=e.i(80359),i=e.i(44486),a=e.i(80236),l=e.i(77201),s=e.i(8586),u=e.i(61946),c=e.i(43449),d=e.i(87883),f=e.i(71645),p=e.i(18566),m=e.i(75210),g=e.i(48572);function h({product:e,attributes:t,globalSetting:n,campaignInfo:r=null,onCloseModal:o,withRouter:i=!1}){let l=(0,p.useRouter)(),{setIsLoading:s,isLoading:c}=(0,f.useContext)(m.SidebarContext)||{},{handleAddItem:d}=(0,a.default)(),{getNumber:v,showingTranslateValue:y}=(0,u.default)(),[b,x]=(0,f.useState)(""),[w,S]=(0,f.useState)(0),[C,j]=(0,f.useState)(""),[E,k]=(0,f.useState)(0),[_,O]=(0,f.useState)(0),[P,R]=(0,f.useState)(0),[A,N]=(0,f.useState)({}),[I,M]=(0,f.useState)({}),[T,L]=(0,f.useState)([]),[D,F]=(0,f.useState)([]),[z,B]=(0,f.useState)(!1),W=n?.default_currency||"$",U=r||e?.campaign||null,V=!!(U&&!1!==U.inCampaign);(0,f.useEffect)(()=>
1{if(b){let t=e?.variants?.filter(e=>Object.keys(I).every(t=>I[t]===e[t])),n=Object.keys(Object.assign({},...t?.map(({originalPrice:e,price:t,discount:n,quantity:r,barcode:o,sku:i,productId:a,image:l,...s})=>({...s})))),r=Object.entries(n?.reduce((e,t)=>({...e,[t]:A[t]}),{})).reduce((e,[t,n])=>(n&&(e[t]=n),e),{}),o=t?.find(e=>Object.keys(r).every(t=>r[t]===e[t]));if(t.length<=0||void 0===o)return O(0);if(F(t),N(o),M(o),j(o?.image),V){O(Math.min(o?.quantity||0,U.campaignRemainingStock));let e=v(U.campaignPrice),t=v(U.campaignOriginalPrice||o?.originalPrice);R(t>0?v((t-e)/t*100):0),S(e),k(t)}else{O(o?.quantity);let e=v(o?.price),t=v(o?.originalPrice),n=v((t-e)/t*100);R(v(n)),S(e),k(t)}}else if(e?.variants?.length>0)if(F(e?.variants?.filter(e=>Object.keys(I).every(t=>I[t]===e[t]))),N(e.variants[0]),M(e.variants[0]),j(e.variants[0]?.image),V){O(Math.min(e.variants[0]?.quantity||0,U.campaignRemainingStock));let t=v(U.campaignPrice),n=v(U.campaignOriginalPrice||e.variants[0]?.originalPrice);R(n>0?v((n-t)/n*100):0),S(t),k(n)}else{O(e.variants[0]?.quantity);let t=v(e.variants[0]?.price),n=v(e.variants[0]?.originalPrice),r=v((n-t)/n*100);R(v(r)),S(t),k(n)}else if(V){O(U.campaignRemainingStock),j(e?.image?.[0]||null);let t=v(U.campaignPrice),n=v(U.campaignOriginalPrice||e?.prices?.originalPrice);R(n>0?v((n-t)/n*100):0),S(t),k(n)}else{O(e?.stock),j(e?.image?.[0]||null);let t=v(e?.prices?.price),n=v(e?.prices?.originalPrice),r=v((n-t)/n*100);R(v(r)),S(t),k(n)}},[e?.prices?.discount,e?.prices?.originalPrice,e?.prices?.price,e?.stock,e?.variants,I,A,b]),(0,f.useEffect)(()=>{if(!e?.variants||!t)return;let n=Object.keys(Object.assign({},...e?.variants)),r=t?.filter(e=>n.includes(e?._id));L(r?.sort())},[D,t,e?.variants]);let $=y(e?.category?.name)||"";return{value:b,setValue:x,price:w,stock:_,discount:P,isReadMore:z,setIsReadMore:B,selectedImage:C,originalPrice:E,setSelectedImage:j,selectVariant:A,setSelectVariant:N,selectVa:I,setSelectVa:M,variantTitle:T,variants:D,currency:W,category_name:$?.toLowerCase()?.replace(/[^A-Z0-9]+/gi,"-"),category_display_name:$,isInCampaign:V,campaign:U,handleAddToCart:t=>{if(e?.variants?.length===1&&e?.variants[0].quantity<1||_<=0)return(0,g.notifyError)("Insufficient stock");let n=T?.map(e=>e?.variants?.find(t=>t._id===A[e._id])).map(e=>y(e?.name));if(!e?.variants.map(e=>Object.entries(e).sort().toString()===Object.entries(A).sort().toString()))return(0,g.notifyError)("Please select all variant first!");{let{variants:r,categories:o,description:i,campaign:a,...l}=e;d({...l,id:e?.variants.length<=0?e._id:e._id+"-"+T?.map(e=>A[e._id]).join("-"),title:e?.variants.length<=0?y(e.title):y(e.title)+"-"+n,image:C,variant:A||{},price:v(w),originalPrice:v(E),...V?{campaignId:U.campaignId,campaignPrice:U.campaignPrice,inCampaign:!0,campaignRemainingStock:U.campaignRemainingStock}:{}},"number"==typeof t?t:1)}},handleMoreInfo:e=>{i&&(o&&o(),l.push(`/product/${e}`),s?.(!c))}}}e.s(["default",0,h],18060);var v=e.i(32762),y=e.i(92199),b=e.i(84880);e.s(["default",0,({product:e,modalOpen:f,attributes:p,setModalOpen:m,campaignInfo:g})=>{let{globalSetting:x}=(0,v.useSetting)(),{showingTranslateValue:w}=(0,u.default)(),{item:S,setItem:C}=(0,a.default)(),{setValue:j,price:E,stock:k,discount:_,isReadMore:O,setIsReadMore:P,selectedImage:R,originalPrice:A,selectVariant:N,setSelectVariant:I,setSelectVa:M,variantTitle:T,category_name:L,isInCampaign:D,campaign:F,handleAddToCart:z}=h({product:e,attributes:p,globalSetting:x,campaignInfo:g,onCloseModal:()=>m(!1),withRouter:!0}),B=w(e?.description),W=B?.length>140;return(0,t.jsx)(b.default,{modalOpen:f,handleCloseModal:()=>m(!1),children:(0,t.jsx)("div",{className:"w-full min-w-0",children:(0,t.jsxs)("div",{className:"flex flex-col gap-6 lg:flex-row lg:gap-8",children:[(0,t.jsx)(n.default,{href:`/product/${e.slug}`,onClick:()=>m(!1),className:"w-full shrink-0 lg:w-[38%]",children:(0,t.jsx)("div",{className:"relative aspect-square w-full overflow-hidden rounded-lg bg-muted",children:(0,t.jsx)(r.default,{src:R||e?.image?.[0]||"https://res.cloudinary.com/ahossain/image/upload/v1655097002/placeholder_kvepfp.png",f
1ill:!0,sizes:"(max-width: 1024px) 100vw, 420px",alt:w(e?.title)||"product",className:"object-cover"})})}),(0,t.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,t.jsxs)("div",{className:"mb-3",children:[(0,t.jsx)(d.default,{In:!0,stock:k}),(0,t.jsx)(n.default,{href:`/product/${e.slug}`,onClick:()=>m(!1),children:(0,t.jsx)("h2",{className:"mt-2 text-lg font-semibold text-foreground transition-colors hover:text-primary sm:text-xl",children:w(e?.title)})}),(0,t.jsx)("div",{className:"mt-1.5",children:(0,t.jsx)(c.default,{size:"md",showReviews:!0,rating:e?.average_rating,totalReviews:e?.total_reviews})})]}),B?(0,t.jsxs)("div",{className:"mb-4",children:[(0,t.jsx)("p",{className:`text-sm leading-6 text-muted-foreground ${!O?"line-clamp-3":""}`,children:B}),W&&(0,t.jsx)("button",{type:"button",onClick:()=>P(!O),className:"mt-1 text-xs font-medium text-primary hover:underline",children:O?"Show less":"Read more"})]}):null,(0,t.jsxs)("div",{className:"mb-4 flex flex-wrap items-center gap-2",children:[(0,t.jsx)(o.default,{price:E,product:e,originalPrice:A,campaign:D?F:null}),(0,t.jsx)(l.default,{slug:!0,product:e,discount:_})]}),D&&F&&(0,t.jsx)("div",{className:"mb-4 rounded-lg border border-red-200 bg-red-50 px-3 py-2 dark:border-red-800 dark:bg-red-900/20",children:(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs font-semibold text-red-600 dark:text-red-400",children:[(0,t.jsx)("span",{className:"h-2 w-2 animate-pulse rounded-full bg-red-500"}),"Campaign Deal â Only ",F.campaignRemainingStock," left!"]})}),T?.length>0&&(0,t.jsx)("div",{className:"mb-5 space-y-3",children:T.map(n=>(0,t.jsxs)("div",{children:[(0,t.jsxs)("h4",{className:"mb-1.5 text-sm font-medium text-foreground",children:[w(n?.name),":"]}),(0,t.jsx)(s.default,{att:n._id,option:n.option,setValue:j,varTitle:T,variants:e?.variants,setSelectVa:M,selectVariant:N,setSelectVariant:I})]},n._id))}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-stretch",children:[(0,t.jsxs)("div",{className:"flex w-full items-center justify-between overflow-hidden rounded-lg border border-border sm:w-auto sm:min-w-[7.5rem]",children:[(0,t.jsx)("button",{type:"button",onClick:()=>C(S-1),disabled:1===S,className:"flex h-11 w-10 shrink-0 items-center justify-center border-r border-border text-foreground transition-colors hover:text-muted-foreground disabled:opacity-50",children:(0,t.jsx)(y.FiMinus,{})}),(0,t.jsx)("p",{className:"min-w-[2.5rem] text-center text-sm font-semibold",children:S}),(0,t.jsx)("button",{type:"button",onClick:()=>C(S+1),disabled:e.quantity<S||e.quantity===S,className:"flex h-11 w-10 shrink-0 items-center justify-center border-l border-border text-foreground transition-colors hover:text-muted-foreground disabled:opacity-50",children:(0,t.jsx)(y.FiPlus,{})})]}),(0,t.jsxs)("button",{type:"button",onClick:()=>z(S),disabled:e.quantity<1,className:"inline-flex h-11 min-w-0 flex-1 items-center justify-center whitespace-nowrap rounded-lg bg-primary px-4 text-sm font-semibold text-primary-foreground transition-colors hover:bg-primary/90 disabled:cursor-not-allowed disabled:opacity-60 sm:min-w-[9.5rem]",children:[(0,t.jsx)(y.FiShoppingBag,{className:"mr-2 shrink-0"}),"Add to cart"]}),(0,t.jsxs)(n.default,{href:`/product/${e.slug}`,onClick:()=>m(!1),className:"inline-flex h-11 min-w-0 flex-1 items-center justify-center whitespace-nowrap rounded-lg border border-border bg-card px-4 text-sm font-semibold text-foreground transition-colors hover:bg-accent hover:text-primary sm:min-w-[9.5rem]",children:[(0,t.jsx)(y.FiEye,{className:"mr-2 shrink-0"}),"View details"]})]}),(0,t.jsxs)("div",{className:"mt-5",children:[L?(0,t.jsxs)("p",{className:"text-sm",children:[(0,t.jsx)("span",{className:"font-semibold text-muted-foreground",children:"Category"})," ",(0,t.jsx)(n.default,{href:`/search?category=${L}&_id=${e?.category?._id}`,onClick:()=>m(!1),className:"font-medium text-muted-foreground transition-colors hover:text-primary",children:L})]}):null,(0,t.jsx)(i.default,{product:e})]}),(0,t.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-1 border-t border-border pt-4 text-sm text-muted-foreground",children:[(0,t.jsx)(y.FiHeadphones,{className:"shrink-0"}),(0,t.jsx)("span",{children:"Call Us for Order"}),(0,t.jsx)("a",{href:`tel:${x?.contact||"+099949343"}`,className:"font-semibold text-primary",children:x?.contact||"+099949343"})]})]})]})})})}],86192)},8586,e=>{"use strict";var t,n,r,o,i,a,l,s,u=e.i(43476),c=e.i(56902),d=e.i(71645),f=e.i(74080);function p(e,[t,n]){return Math.min(n,Math.max(t,e))}(0,Object.defineProperty)(p,"name",{value:"clamp",configurable:!0});var m=Object.defineProperty,g=(e,t)=>m(e,"name",{value:t,configurable:!0}),h=!!("u">typeof window&&window.document&&window.document.createElement);function v(e,t,{checkForDefaultPrevented:n=!0}={}){return g(function(r){if(e?.(r),!1===n||!r||!r.defaultPrevented)return t?.(r)},"handleEvent")}function y(e){if(!h)throw Error("Cannot access document outside of the DOM");return e?.ownerDocument??document}function b(e){return"IFRAME"===e.tagName}g(v,"composeEventHandlers"),g(function(e){if(!h)throw Error("Cannot access window outside of the DOM");return e?.ownerDocument?.defaultView??window},"getOwnerWindow"),g(y,"getOwnerDocument"),g(function e(t,n=!1){let{activeElement:r}=y(t);if(!r?.nodeName)return null;if(b(r)&&r.contentDocument)return e(r.contentDocument.body,n);if(n){let e=r.getAttribute("aria-activedescendant");if(e){let t=y(r).getElementById(e);if(t)return t}}return r},"getActiveElement"),g(b,"isFrame");var x=Object.defineProperty,w=(e,t)=>x(e,"name",{value:t,configurable:!0});function S(e,t=[]){let n=[];function r(t,r){let o=d.createContext(r);o.displayName=t+"Context";let i=n.length;n=[...n,r];let a=w(t=>{let{scope:n,children:r,...a}=t,l=n?.[e]?.[i]||o,s=d.useMemo(()=>a,Object.values(a));return(0,u.jsx)(l.Provider,{value:s,children:r})},"Provider");function l(n,a,s={}){let{optional:u=!1}=s,c=a?.[e]?.[i]||o,f=d.useContext(c);if(f)return f;if(void 0!==r)return r;if(!u)throw Error(`\`${n}\` must be used within \`${t}\``)}return a.displayName=t+"Provider",w(l,"useContext"),[a,l]}w(r,"createContext");let o=w(()=>{let t=n.map(e=>d.createContext(e));return w(function(n){let r=n?.[e]||t;return d.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},"useScope")},"createScope");return o.scopeName=e,[r,C(o,...t)]}function C(...e){let t=e[0];if(1===e.length)return t;let n=w(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return w(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let o=n(e)[`__scope${r}`];return{...t,...o}},{});return d.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}w(function(e,t){let n=d.createContext(t);n.displayName=e+"Context";let r=w(e=>{let{children:t,...r}=e,o=d.useMemo(()=>r,Object.values(r));return(0,u.jsx)(n.Provider,{value:o,children:t})},"Provider");function o(r,i={}){let{optional:a=!1}=i,l=d.useContext(n);if(l)return l;if(void 0!==t)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return r.displayName=e+"Provider",w(o,"useContext"),[r,o]},"createContext"),w(S,"createContextScope"),w(C,"composeContextScopes");var j=e.i(20783),E=e.i(91918),k=Object.defineProperty,_=(e,t)=>
1k(e,"name",{value:t,configurable:!0});function O(e){let t=e+"CollectionProvider",[n,r]=S(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=_(e=>{let{scope:t,children:n}=e,r=d.useRef(null),i=d.useRef(new Map).current;return(0,u.jsx)(o,{scope:t,itemMap:i,collectionRef:r,children:n})},"CollectionProvider");a.displayName=t;let l=e+"CollectionSlot",s=(0,E.createSlot)(l),c=d.forwardRef((e,t)=>{let{scope:n,children:r}=e,o=i(l,n),a=(0,j.useComposedRefs)(t,o.collectionRef);return(0,u.jsx)(s,{ref:a,children:r})});c.displayName=l;let f=e+"CollectionItemSlot",p="data-radix-collection-item",m=(0,E.createSlot)(f),g=d.forwardRef((e,t)=>{let{scope:n,children:r,...o}=e,a=d.useRef(null),l=(0,j.useComposedRefs)(t,a),s=i(f,n);return d.useEffect(()=>(s.itemMap.set(a,{ref:a,...o}),()=>void s.itemMap.delete(a))),(0,u.jsx)(m,{...{[p]:""},ref:l,children:r})});function h(t){let n=i(e+"CollectionConsumer",t);return d.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return g.displayName=f,_(h,"useCollection"),[{Provider:a,Slot:c,ItemSlot:g},h,r]}_(O,"createCollection");var P=new WeakMap,R=class e extends Map{static{_(this,"OrderedDict")}#e;constructor(e){super(e),this.#e=[...super.keys()],P.set(this,!0)}set(e,t){return P.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r,o=this.has(t),i=this.#e.length,a=I(e),l=a>=0?a:i+a,s=l<0||l>=i?-1:l;if(s===this.size||o&&s===this.size-1||-1===s)return this.set(t,n),this;let u=this.size+ +!o;a<0&&l++;let c=[...this.#e],d=!1;for(let e=l;e<u;e++)if(l===e){let i=c[e];c[e]===t&&(i=c[e+1]),o&&this.delete(t),r=this.get(i),this.set(t,n)}else{d||c[e-1]!==t||(d=!0);let n=c[d?e:e-1],o=r;r=this.get(n),this.delete(n),this.set(n,o)}return this}with(t,n,r){let o=new e(this);return o.insert(t,n,r),o}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(-1!==(t=-1===t||t===this.size-1?-1:t+1))return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return -1===r?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return void 0!==t&&this.delete(t)}at(e){let t=A(this.#e,e);if(void 0!==t)return this.get(t)}entryAt(e){let t=A(this.#e,e);if(void 0!==t)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return A(this.#e,e)}from(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(-1===n)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return -1}filter(t,n){let r=[],o=0;for(let e of this)Reflect.apply(t,n,[e,o,this])&&r.push(e),o++;return new e(r)}map(t,n){let r=[],o=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,o,this])]),o++;return new e(r)}reduce(...e){let[t,n]=e,r=0,o=n??this.at(0);for(let n of this)o=0===r&&1===e.length?n:Reflect.apply(t,this,[o,n,r,this]),r++;return o}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let o=this.at(n);r=n===this.size-1&&1===e.length?o:Reflect.apply(t,this,[r,o,n,this])}return r}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,o=this.size-1;if(void 0===t)return r;t<0&&(t+=this.size),void 0!==n&&n>0&&(o=n-1);for(let e=t;e<=o;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function A(e,t){if("at"in Array.prototype)return Array.prototype.at.call(e,t);let n=N(e,t);return -1===n?void 0:e[n]}function N(e,t){let n=e.length,r=I(t),o=r>=0?r:n+r;return o<0||o>=n?-1:o}function I(e){return e!=e||0===e?0:Math.trunc(e)}function M(e,t){if(e===t)return!0;
1if("object"!=typeof e||"object"!=typeof t||null==e||null==t)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}function T(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function L(e,t){return e[1].element&&t[1].element?T(e[1].element,t[1].element)?-1:1:0}function D(e){return new MutationObserver(t=>{for(let n of t)if("childList"===n.type)return void e()})}_(A,"at"),_(N,"toSafeIndex"),_(I,"toSafeInteger"),_(function(e){let t=e+"CollectionProvider",[n,r]=S(t),[o,i]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new R,setItemMap:_(()=>void 0,"setItemMap")}),a=_(({state:e,...t})=>e?(0,u.jsx)(s,{...t,state:e}):(0,u.jsx)(l,{...t}),"CollectionProvider");a.displayName=t;let l=_(e=>{let t=v();return(0,u.jsx)(s,{...e,state:t})},"CollectionInit");l.displayName=t+"Init";let s=_(e=>{let{scope:t,children:n,state:r}=e,i=d.useRef(null),[a,l]=d.useState(null),s=(0,j.useComposedRefs)(i,l),[c,f]=r;return d.useEffect(()=>{if(!a)return;let e=D(()=>{});return e.observe(a,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[a]),(0,u.jsx)(o,{scope:t,itemMap:c,setItemMap:f,collectionRef:s,collectionRefObject:i,collectionElement:a,children:n})},"CollectionProviderImpl");s.displayName=t+"Impl";let c=e+"CollectionSlot",f=(0,E.createSlot)(c),p=d.forwardRef((e,t)=>{let{scope:n,children:r}=e,o=i(c,n),a=(0,j.useComposedRefs)(t,o.collectionRef);return(0,u.jsx)(f,{ref:a,children:r})});p.displayName=c;let m=e+"CollectionItemSlot",g=(0,E.createSlot)(m),h=d.forwardRef((e,t)=>{let{scope:n,children:r,...o}=e,a=d.useRef(null),[l,s]=d.useState(null),c=(0,j.useComposedRefs)(t,a,s),{setItemMap:f}=i(m,n),p=d.useRef(o);M(p.current,o)||(p.current=o);let h=p.current;return d.useEffect(()=>(f(e=>l?e.has(l)?e.set(l,{...h,element:l}).toSorted(L):(e.set(l,{...h,element:l}),e.toSorted(L)):e),()=>{f(e=>l&&e.has(l)?(e.delete(l),new R(e)):e)}),[l,h,f]),(0,u.jsx)(g,{"data-radix-collection-item":"",ref:c,children:r})});function v(){return d.useState(new R)}function y(t){let{itemMap:n}=i(e+"CollectionConsumer",t);return n}return h.displayName=m,_(v,"useInitCollection"),_(y,"useCollection"),[{Provider:a,Slot:p,ItemSlot:h},{createCollectionScope:r,useCollection:y,useInitCollection:v}]},"createCollection"),_(M,"shallowEqual"),_(T,"isElementPreceding"),_(L,"sortByDocumentPosition"),_(D,"getChildListObserver");var F=Object.defineProperty,z=d.createContext(void 0);function B(e){let t=d.useContext(z);return e||t||"ltr"}F(B,"name",{value:"useDirection",configurable:!0});var W=Object.defineProperty,U=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=(0,E.createSlot)(`Primitive.${t}`),r=d.forwardRef((e,r)=>{let{asChild:o,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,u.jsx)(o?n:t,{...i,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function V(e,t){e&&f.flushSync(()=>e.dispatchEvent(t))}function $(e){let t=d.useRef(e);return d.useEffect(()=>{t.current=e}),d.useMemo(()=>(...e)=>t.current?.(...e),[])}W(V,"name",{value:"dispatchDiscreteCustomEvent",configurable:!0}),(0,Object.defineProperty)($,"name",{value:"useCallbackRef",configurable:!0});var H=Object.defineProperty,G=(e,t)=>H(e,"name",{value:t,configurable:!0}),K="dismissableLayer.update",q=d.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),X=d.forwardRef(G(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:c,...f}=e,p=d.useContext(q),[m,g]=d.useState(null),h=m?.ownerDocument??globalThis?.document,[,y]=d.useState({}),b=(0,j.useComposedRefs)(t,g),x=Array.from(p.layers),[w]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),S=w?x.indexOf(w):-1,C=m?x.indexOf(m):-1,E=p.layersWithOutsidePointerEventsDisabled.size>0,k=C>=S,_=d.useRef(!1),O=Z(e=>{i?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:h,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:_,dismissableSurfaces:p.dismissableSurfaces,shouldHandlePointerDownOutside:d.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...p.branches].some(t=>t.contains(e));return k&&!t},[p.branches,k])}),P=Q(e=>{if(r&&_.current)return;let t=e.target;![...p.branches].some(e=>e.contains(t))&&(a?.(e),s?.(e),e.defaultPrevented||c?.())},h),R=!!m&&C===x.length-1,A=$(e=>{"Escape"===e.key&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return d.useEffect(()=>{if(R)return h.addEventListener("keydown",A,{capture:!0}),()=>h.removeEventListener("keydown",A,{capture:!0})},[h,R,A]),d.useEffect(()=>{if(m)return n&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(l=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),J(),()=>{n&&(p.layersWithOutsidePointerEventsDisabled.delete(m),0===p.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=l))}},[m,h,n,p]),d.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),J())},[m,p]),d.useEffect(()=>{let e=G(()=>y({}),"handleUpdate");return document.addEventListener(K,e),()=>document.removeEventListener(K,e)},[]),(0,u.jsx)(U.div,{...f,ref:b,style:{pointerEvents:E?k?"auto":"none":void 0,...e.style},onFocusCapture:v(e.onFocusCapture,P.onFocusCapture),onBlurCapture:v(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:v(e.onPointerDownCapture,O.onPointerDownCapture)})},"DismissableLayer"));
1G(function(){let e=d.useContext(q),[t,n]=d.useState(null);return d.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n},"useDismissableLayerSurface");var Y=G(()=>!0,"IS_TRUE");function Z(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:i,shouldHandlePointerDownOutside:a=Y}=t,l=$(e),s=d.useRef(!1),u=d.useRef(!1),c=d.useRef(new Map),f=d.useRef(()=>{});return d.useEffect(()=>{function e(){u.current=!1,o.current=!1,c.current.clear()}function t(){return Array.from(c.current.values()).some(Boolean)}function d(e){if(!u.current)return;let t=e.target;t instanceof Node&&[...i].some(e=>e.contains(t))||c.current.set(e.type,!0),"click"===e.type&&window.setTimeout(()=>{u.current&&f.current()},0)}function p(e){u.current&&c.current.set(e.type,!1)}G(e,"resetOutsideInteraction"),G(t,"isOutsideInteractionIntercepted"),G(d,"handleInteractionCapture"),G(p,"handleInteractionBubble");
1let m=G(i=>{if(i.target&&!s.current){let d=function(){n.removeEventListener("click",f.current);let r=t();e(),r||ee("dismissableLayer.pointerDownOutside",l,p,{discrete:!0})};if(G(d,"handleAndDispatchPointerDownOutsideEvent"),!a(i.target)){n.removeEventListener("click",f.current),e(),s.current=!1;return}let p={originalEvent:i};u.current=!0,o.current=r&&0===i.button,c.current.clear(),r&&0===i.button?(n.removeEventListener("click",f.current),f.current=d,n.addEventListener("click",f.current,{once:!0})):d()}else n.removeEventListener("click",f.current),e();s.current=!1},"handlePointerDown"),g=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(let e of g)n.addEventListener(e,d,!0),n.addEventListener(e,p);let h=window.setTimeout(()=>{n.addEventListener("pointerdown",m)},0);return()=>{for(let e of(window.clearTimeout(h),n.removeEventListener("pointerdown",m),n.removeEventListener("click",f.current),g))n.removeEventListener(e,d,!0),n.removeEventListener(e,p)}},[n,l,r,o,i,a]),{onPointerDownCapture:G(()=>s.current=!0,"onPointerDownCapture")}}function Q(e,t=globalThis?.document){let n=$(e),r=d.useRef(!1);return d.useEffect(()=>{let e=G(e=>{e.target&&!r.current&&ee("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,n]),{onFocusCapture:G(()=>r.current=!0,"onFocusCapture"),onBlurCapture:G(()=>r.current=!1,"onBlurCapture")}}function J(){let e=new CustomEvent(K);document.dispatchEvent(e)}function ee(e,t,n,{discrete:r}){let o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?V(o,i):o.dispatchEvent(i)}G(Z,"usePointerDownOutside"),G(Q,"useFocusOutside"),G(J,"dispatchUpdate"),G(ee,"handleAndDispatchCustomEvent");var et=Object.defineProperty,en=(e,t)=>et(e,"name",{value:t,configurable:!0}),er=0,eo=null;function ei(){d.useEffect(()=>{eo||(eo={start:ea(),end:ea()});let{start:e,end:t}=eo;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),er++,()=>{1===er&&(eo?.start.remove(),eo?.end.remove(),eo=null),er=Math.max(0,er-1)}},[])}function ea(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}en(function(e){return ei(),e.children},"FocusGuards"),en(ei,"useFocusGuards"),en(ea,"createFocusGuard");var el=Object.defineProperty,es=(e,t)=>el(e,"name",{value:t,configurable:!0}),eu="focusScope.autoFocusOnMount",ec="focusScope.autoFocusOnUnmount",ed={bubbles:!1,cancelable:!0},ef=d.forwardRef(es(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...a}
1=e,[l,s]=d.useState(null),c=$(o),f=$(i),p=d.useRef(null),m=(0,j.useComposedRefs)(t,s),g=d.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;d.useEffect(()=>{if(r){let e=function(e){if(g.paused||!l)return;let t=e.target;l.contains(t)?p.current=t:eb(p.current,{select:!0})},t=function(e){if(g.paused||!l)return;let t=e.relatedTarget;null!==t&&(l.contains(t)||eb(p.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&eb(l)};es(e,"handleFocusIn"),es(t,"handleFocusOut"),es(n,"handleMutations"),document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[r,l,g.paused]),d.useEffect(()=>{if(l){ex.add(g);let e=document.activeElement;if(!l.contains(e)){let t=new CustomEvent(eu,ed);l.addEventListener(eu,c),l.dispatchEvent(t),t.defaultPrevented||(ep(eC(eg(l)),{select:!0}),document.activeElement===e&&eb(l))}return()=>{l.removeEventListener(eu,c),setTimeout(()=>{let t=new CustomEvent(ec,ed);l.addEventListener(ec,f),l.dispatchEvent(t),t.defaultPrevented||eb(e??document.body,{select:!0}),l.removeEventListener(ec,f),ex.remove(g)},0)}}},[l,c,f,g]);let h=d.useCallback(e=>{if(!n&&!r||g.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){let t=e.currentTarget,[r,i]=em(t);r&&i?e.shiftKey||o!==i?e.shiftKey&&o===r&&(e.preventDefault(),n&&eb(i,{select:!0})):(e.preventDefault(),n&&eb(r,{select:!0})):o===t&&e.preventDefault()}},[n,r,g.paused]);return(0,u.jsx)(U.div,{tabIndex:-1,...a,ref:m,onKeyDown:h})},"FocusScope"));function ep(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(eb(r,{select:t}),document.activeElement!==n)return}function em(e){let t=eg(e);return[eh(t,e),eh(t.reverse(),e)]}function eg(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:es(e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;n.nextNode();)t.push(n.currentNode);return t}function eh(e,t){let n="function"==typeof t.checkVisibility&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):ev(r,{upTo:t})))return r}function ev(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===t||e!==t);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function ey(e){return e instanceof HTMLInputElement&&"select"in e}function eb(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ey(e)&&t&&e.select()}}es(ep,"focusFirst"),es(em,"getTabbableEdges"),es(eg,"getTabbableCandidates"),es(eh,"findVisible"),es(ev,"isHidden"),es(ey,"isSelectableInput"),es(eb,"focus");var ex=ew();function ew(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),(e=eS(e,t)).unshift(t)},remove(t){e=eS(e,t),e[0]?.resume()}}}function eS(e,t){let n=[...e],r=n.indexOf(t);return -1!==r&&n.splice(r,1),n}function eC(e){return e.filter(e=>"A"!==e.tagName)}es(ew,"createFocusScopesStack"),es(eS,"arrayRemove"),es(eC,"removeLinks");var ej=globalThis?.document?d.useLayoutEffect:()=>{},eE=Object.defineProperty,ek=d[" useId ".trim().toString()]||(()=>void 0),e_=0;function eO(e){let[t,n]=d.useState(ek());return ej(()=>{e||n(e=>e??String(e_++))},[e]),e||(t?`radix-${t}`:"")}eE(eO,"name",{value:"useId",configurable:!0});var eP=e.i(58950),eR=e.i(53760),eA=Object.defineProperty,eN=d.forwardRef(eA(function(e,t){let{children:n,width:r=10,height:o=5,...i}=e;return(0,u.jsx)(U.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:(0,u.jsx)("polygon",{points:"0,0 30,0 15,10"})})},"name",{value:"Arrow",configurable:!0}));function eI(e){let[t,n]=d.useState(void 0);return ej(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,o;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,o=t.blockSize}else r=e.offsetWidth,o=e.offsetHeight;n({width:r,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}(0,Object.defineProperty)(eI,"name",{value:"useSize",configurable:!0});var eM=Object.defineProperty,eT=(e,t)=>
1eM(e,"name",{value:t,configurable:!0}),eL="Popper",[eD,eF]=S(eL),[ez,eB]=eD(eL),eW=eT(e=>{let{__scopePopper:t,children:n}=e,[r,o]=d.useState(null),[i,a]=d.useState(void 0);return(0,u.jsx)(ez,{scope:t,anchor:r,onAnchorChange:o,placementState:i,setPlacementState:a,children:n})},"Popper"),eU=d.forwardRef(eT(function(e,t){let{__scopePopper:n,virtualRef:r,...o}=e,i=eB("PopperAnchor",n),a=d.useRef(null),l=i.onAnchorChange,s=d.useCallback(e=>{a.current=e,e&&l(e)},[l]),c=(0,j.useComposedRefs)(t,s),f=d.useRef(null);d.useEffect(()=>{if(!r)return;let e=f.current;f.current=r.current,e!==f.current&&l(f.current)});let p=i.placementState&&eY(i.placementState),m=p?.[0],g=p?.[1];return r?null:(0,u.jsx)(U.div,{"data-radix-popper-side":m,"data-radix-popper-align":g,...o,ref:c})},"PopperAnchor")),eV="PopperContent",[e$,eH]=eD(eV),eG=d.forwardRef(eT(function(e,t){let{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:s=!0,collisionBoundary:c=[],collisionPadding:f=0,sticky:p="partial",hideWhenDetached:m=!1,updatePositionStrategy:g="optimized",onPlaced:h,...v}=e,y=eB(eV,n),[b,x]=d.useState(null),w=(0,j.useComposedRefs)(t,x),[S,C]=d.useState(null),E=eI(S),k=E?.width??0,_=E?.height??0,O="number"==typeof f?f:{top:0,right:0,bottom:0,left:0,...f},P=Array.isArray(c)?c:[c],R=P.length>0,A={padding:O,boundary:P.filter(eq),altBoundary:R},{refs:N,floatingStyles:I,placement:M,isPositioned:T,middlewareData:L}=(0,eP.useFloating)({strategy:"fixed",placement:r+("center"!==i?"-"+i:""),whileElementsMounted:eT((...e)=>(0,eR.autoUpdate)(...e,{animationFrame:"always"===g}),"whileElementsMounted"),elements:{reference:y.anchor},middleware:[(0,eP.offset)({mainAxis:o+_,alignmentAxis:a}),s&&(0,eP.shift)({mainAxis:!0,crossAxis:!1,limiter:"partial"===p?(0,eP.limitShift)():void 0,...A}),s&&(0,eP.flip)({...A}),(0,eP.size)({...A,apply:eT(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)},"apply")}),S&&(0,eP.arrow)({element:S,padding:l}),eX({arrowWidth:k,arrowHeight:_}),m&&(0,eP.hide)({strategy:"referenceHidden",...A,boundary:R?A.boundary:void 0})]}),D=y.setPlacementState;ej(()=>(D(M),()=>{D(void 0)}),[M,D]);let[F,z]=eY(M),B=$(h);ej(()=>{T&&B?.()},[T,B]);let W=L.arrow?.x,V=L.arrow?.y,H=L.arrow?.centerOffset!==0,[G,K]=d.useState();return ej(()=>{b&&K(window.getComputedStyle(b).zIndex)},[b]),(0,u.jsx)("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...I,transform:T?I.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,u.jsx)(e$,{scope:n,placedSide:F,placedAlign:z,onArrowChange:C,arrowX:W,arrowY:V,shouldHideArrow:H,children:(0,u.jsx)(U.div,{"data-side":F,"data-align":z,...v,ref:w,style:{...v.style,animation:T?v.style?.animation:"none"}})})})},"PopperContent")),eK={top:"bottom",right:"left",bottom:"top",left:"right"};function eq(e){return null!==e}eT(eq,"isNotNull");var eX=eT(e=>({name:"transformOrigin",options:e,fn(t){let{placement:n,rects:r,middlewareData:o}=t,i=o.arrow?.centerOffset!==0,a=i?0:e.arrowWidth,l=i?0:e.arrowHeight,[s,u]=eY(n),c={start:"0%",center:"50%",end:"100%"}[u],d=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+l/2,p="",m="";return"bottom"===s?(p=i?c:`${d}px`,m=`${-l}px`):"top"===s?(p=i?c:`${d}px`,m=`${r.floating.height+l}px`):"right"===s?(p=`${-l}px`,m=i?c:`${f}px`):"left"===s&&(p=`${r.floating.width+l}px`,m=i?c:`${f}px`),{data:{x:p,y:m}}}}),"transformOrigin");function eY(e){let[t,n="center"]=e.split("-");return[t,n]}eT(eY,"getSideAndAlignFromPlacement");var eZ=Object.defineProperty,eQ=d.forwardRef(eZ(function(e,t){let{container:n,...r}=e,[o,i]=d.useState(!1);ej(()=>i(!0),[]);let a=n||o&&globalThis?.document?.body;return a?f.createPortal((0,u.jsx)(U.div,{...r,ref:t}),a):null},"name",{value:"Portal",configurable:!0})),eJ=Object.defineProperty,e0=(e,t)=>eJ(e,"name",{value:t,configurable:!0});function e1(e,t){return d.useReducer((e,n)=>t[e][n]??e,e)}e0(e1,"useStateMachine");var e2=e0(e=>{let{present:t,children:n}=e,r=e5(t),o="function"==typeof n?n({present:r.isPresent}):d.Children.only(n),i=e6(r.ref,e8(o));return"function"==typeof n||r.isPresent?d.cloneElement(o,{ref:i}):null},"Presence");
1function e5(e){let[t,n]=d.useState(),r=d.useRef(null),o=d.useRef(e),i=d.useRef("none"),a=d.useRef(void 0),[l,s]=e1(e?"mounted":"unmounted",{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return d.useEffect(()=>{"mounted"===l?(i.current=a.current??e9(r.current),a.current=void 0):i.current="none"},[l]),ej(()=>{let t=r.current,n=o.current;if(n!==e){let r=i.current,l=e9(t);e?(a.current=l,s("MOUNT")):"none"===l||t?.display==="none"?s("UNMOUNT"):n&&r!==l?s("ANIMATION_OUT"):s("UNMOUNT"),o.current=e}},[e,s]),ej(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,a=e0(i=>{let a=e9(r.current).includes(CSS.escape(i.animationName));if(i.target===t&&a&&(s("ANIMATION_END"),!o.current)){let r=t.style.animationFillMode;t.style.animationFillMode="forwards",e=n.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=r)})}},"handleAnimationEnd"),l=e0(e=>{e.target===t&&(i.current=e9(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",l),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),()=>{n.clearTimeout(e),t.removeEventListener("animationstart",l),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}}s("ANIMATION_END")},[t,s]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:d.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,a.current=e9(t)}else r.current=null;n(e)},[])}}function e4(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function e6(...e){let t=d.useRef(e);return t.current=e,d.useCallback(e=>{let n=t.current,r=!1,o=n.map(t=>{let n=e4(t,e);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let e=0;e<o.length;e++){let t=o[e];"function"==typeof t?t():e4(n[e],null)}}},[])}function e9(e){return e?.animationName||"none"}function e8(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(n=(t=Object.getOwnPropertyDescriptor(e,"ref")?.get)&&"isReactWarning"in t&&t.isReactWarning)?e.props.ref:e.props.ref||e.ref}e0(e5,"usePresence"),e0(e4,"setRef"),e0(e6,"useStableComposedRefs"),e0(e9,"getAnimationName"),e0(e8,"getElementRef");var e3=Object.defineProperty,e7=d[" useEffectEvent ".trim().toString()],te=d[" useInsertionEffect ".trim().toString()];function tt(e){if("function"==typeof e7)return e7(e);let t=d.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return"function"==typeof te?te(()=>{t.current=e}):ej(()=>{t.current=e}),d.useMemo(()=>(...e)=>t.current?.(...e),[])}e3(tt,"name",{value:"useEffectEvent",configurable:!0});var tn=Object.defineProperty,tr=(e,t)=>tn(e,"name",{value:t,configurable:!0}),to=d[" useInsertionEffect ".trim().toString()]||ej;function ti({prop:e,defaultProp:t,onChange:n=tr(()=>{},"onChange"),caller:r}){let[o,i,a]=ta({defaultProp:t,onChange:n}),l=void 0!==e,s=l?e:o;return[s,d.useCallback(t=>{if(l){let n=tl(t)?t(e):t;n!==e&&a.current?.(n)}else i(t)},[l,e,i,a])]}function ta({defaultProp:e,onChange:t}){let[n,r]=d.useState(e),o=d.useRef(n),i=d.useRef(t);return to(()=>{i.current=t},[t]),d.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function tl(e){return"function"==typeof e}tr(ti,"useControllableState"),tr(ta,"useUncontrolledState"),tr(tl,"isFunction");var ts=Symbol("RADIX:SYNC_STATE");function tu(e){let t=d.useRef({value:e,previous:e});return d.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}tr(function(e,t,n,r){let{prop:o,defaultProp:i,onChange:a,caller:l}=t,s=void 0!==o,u=tt(a),c=[{...n,state:i}];r&&c.push(r);let[f,p]=d.useReducer((t,n)=>{if(n.type===ts)return{...t,state:n.state};let r=e(t,n);return s&&!Object.is(r.state,t.state)&&u(r.state),r},...c),m=f.state,g=d.useRef(m);d.useEffect(()=>{g.current!==m&&(g.current=m,s||u(m))},[m,g,s]);let h=d.useMemo(()=>void 0!==o?{...f,state:o}:f,[f,o]);return d.useEffect(()=>{s&&!Object.is(o,f.state)&&p({type:ts,state:o})},[o,f.state,s]),[h,p]},"useControllableStateReducer"),(0,Object.defineProperty)(tu,"name",{value:"usePrevious",configurable:!0});var tc=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),td=new WeakMap,tf=new WeakMap,tp={},tm=0,tg=function(e){return e&&(e.host||tg(e.parentNode))},th=function(e,t,n,r){var o=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var n=tg(e);return n&&t.contains(n)?n:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});tp[n]||(tp[n]=new WeakMap);var i=tp[n],a=[],l=new Set,s=new Set(o),u=function(e){!e||l.has(e)||(l.add(e),u(e.parentNode))};o.forEach(u);var c=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(l.has(e))c(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,s=(td.get(e)||0)+1,u=(i.get(e)||0)+1;td.set(e,s),i.set(e,u),a.push(e),1===s&&o&&tf.set(e,!0),1===u&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return c(t),l.clear(),tm++,function(){a.forEach(function(e){var t=td.get(e)-1,o=i.get(e)-1;td.set(e,t),i.set(e,o),t||(tf.has(e)||e.removeAttribute(r),tf.delete(e)),o||e.removeAttribute(n)}),--tm||(td=new WeakMap,td=new WeakMap,tf=new WeakMap,tp={})}},tv=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||("u"<typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),th(r,o,n,"aria-hidden")):function(){return null}},ty=e.i(90571),tb="right-scroll-bar-position",tx="width-before-scroll-bar";function tw(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var tS="u">typeof window?d.useLayoutEffect:d.useEffect,tC=new WeakMap,tj=(void 0===t&&(t={}),(void 0===n&&(n=function(e){return e}),r=[],o=!1,i={read:function(){if(o)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:null},useMedium:function(e){var t=n(e,o);return r.push(t),function(){r=r.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(o=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){o=!0;var t=[];if(r.length){var n=r;
1r=[],n.forEach(e),t=r}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),r={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),r}}}}).options=(0,ty.__assign)({async:!0,ssr:!1},t),i),tE=function(){},tk=d.forwardRef(function(e,t){var n,r,o,i,a=d.useRef(null),l=d.useState({onScrollCapture:tE,onWheelCapture:tE,onTouchMoveCapture:tE}),s=l[0],u=l[1],c=e.forwardProps,f=e.children,p=e.className,m=e.removeScrollBar,g=e.enabled,h=e.shards,v=e.sideCar,y=e.noRelative,b=e.noIsolation,x=e.inert,w=e.allowPinchZoom,S=e.as,C=e.gapMode,j=(0,ty.__rest)(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=(n=[a,t],r=function(e){return n.forEach(function(t){return tw(t,e)})},(o=(0,d.useState)(function(){return{value:null,callback:r,facade:{get current(){return o.value},set current(value){var e=o.value;e!==value&&(o.value=value,o.callback(value,e))}}}})[0]).callback=r,i=o.facade,tS(function(){var e=tC.get(i);if(e){var t=new Set(e),r=new Set(n),o=i.current;t.forEach(function(e){r.has(e)||tw(e,null)}),r.forEach(function(e){t.has(e)||tw(e,o)})}tC.set(i,n)},[n]),i),k=(0,ty.__assign)((0,ty.__assign)({},j),s);return d.createElement(d.Fragment,null,g&&d.createElement(v,{sideCar:tj,removeScrollBar:m,shards:h,noRelative:y,noIsolation:b,inert:x,setCallbacks:u,allowPinchZoom:!!w,lockRef:a,gapMode:C}),c?d.cloneElement(d.Children.only(f),(0,ty.__assign)((0,ty.__assign)({},k),{ref:E})):d.createElement(void 0===S?"div":S,(0,ty.__assign)({},k,{className:p,ref:E}),f))});tk.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},tk.classNames={fullWidth:tx,zeroRight:tb};var t_=function(e){var t=e.sideCar,n=(0,ty.__rest)(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error("Sidecar medium not found");return d.createElement(r,(0,ty.__assign)({},n))};t_.isSideCarExport=!0;var tO=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=s||("u">typeof __webpack_nonce__?__webpack_nonce__:void 0);return t&&e.setAttribute("nonce",t),e}())){var r,o;(r=t).styleSheet?r.styleSheet.cssText=n:r.appendChild(document.createTextNode(n)),o=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(o)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tP=function(){var e=tO();return function(t,n){d.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},tR=function(){var e=tP();return function(t){return e(t.styles,t.dynamic),null}},tA={left:0,top:0,right:0,gap:0},tN=function(e){return parseInt(e||"",10)||0},tI=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[tN(n),tN(r),tN(o)]},tM=function(e){if(void 0===e&&(e="margin"),"u"<typeof window)return tA;var t=tI(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},tT=tR(),tL="data-scroll-locked",tD=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(l,"px ").concat(r,";\n }\n body[").concat(tL,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(l,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(tb," {\n right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(tx," {\n margin-right: ").concat(l,"px ").concat(r,";\n }\n \n .").concat(tb," .").concat(tb," {\n right: 0 ").concat(r,";\n }\n \n .").concat(tx," .").concat(tx," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(tL,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(l,"px;\n }\n")},tF=function(){var e=parseInt(document.body.getAttribute(tL)||"0",10);return isFinite(e)?e:0},tz=function(){d.useEffect(function(){return document.body.setAttribute(tL,(tF()+1).toString()),function(){var e=tF()-1;e<=0?document.body.removeAttribute(tL):document.body.setAttribute(tL,e.toString())}},[])},tB=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=void 0===r?"margin":r;tz();var i=d.useMemo(function(){return tM(o)},[o]);return d.createElement(tT,{styles:tD(i,!t,o,n?"":"!important")})},tW=!1;if("u">typeof window)try{var tU=Object.defineProperty({},"passive",{get:function(){return tW=!0,!0}});window.addEventListener("test",tU,tU),window.removeEventListener("test",tU,tU)}catch(e){tW=!1}var tV=!!tW&&{passive:!1},t$=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&(n.overflowY!==n.overflowX||"TEXTAREA"===e.tagName||"visible"!==n[t])},tH=function(e,t){var n=t.ownerDocument,r=t;do{if("u">typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),tG(e,r)){var o=tK(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body)return!1},tG=function(e,t){return"v"===e?t$(t,"overflowY"):t$(t,"overflowX")},tK=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},tq=function(e,t,n,r,o){var i,a=(i=window.getComputedStyle(t).direction,"h"===e&&"rtl"===i?-1:1),l=a*r,s=n.target,u=t.contains(s),c=!1,d=l>0,f=0,p=0;
1do{if(!s)break;var m=tK(e,s),g=m[0],h=m[1]-m[2]-a*g;(g||h)&&tG(e,s)&&(f+=h,p+=g);var v=s.parentNode;s=v&&v.nodeType===Node.DOCUMENT_FRAGMENT_NODE?v.host:v}while(!u&&s!==document.body||u&&(t.contains(s)||t===s))return d&&(o&&1>Math.abs(f)||!o&&l>f)?c=!0:!d&&(o&&1>Math.abs(p)||!o&&-l>p)&&(c=!0),c},tX=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},tY=function(e){return[e.deltaX,e.deltaY]},tZ=function(e){return e&&"current"in e?e.current:e},tQ=0,tJ=[];let t0=(a=function(e){var t=d.useRef([]),n=d.useRef([0,0]),r=d.useRef(),o=d.useState(tQ++)[0],i=d.useState(tR)[0],a=d.useRef(e);d.useEffect(function(){a.current=e},[e]),d.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(0,ty.__spreadArray)([e.lockRef.current],(e.shards||[]).map(tZ),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=d.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!a.current.allowPinchZoom;var o,i=tX(e),l=n.current,s="deltaX"in e?e.deltaX:l[0]-i[0],u="deltaY"in e?e.deltaY:l[1]-i[1],c=e.target,d=Math.abs(s)>Math.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===c||p.contains(c)))return!1;var m=tH(d,c);if(!m)return!0;if(m?o=d:(o="v"===d?"h":"v",m=tH(d,c)),!m)return!1;if(!r.current&&"changedTouches"in e&&(s||u)&&(r.current=o),!o)return!0;var g=r.current||o;return tq(g,t,e,"h"===g?s:u,!0)},[]),s=d.useCallback(function(e){if(tJ.length&&tJ[tJ.length-1]===i){var n="deltaY"in e?tY(e):tX(e),r=t.current.filter(function(t){var r;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(r=t.delta,r[0]===n[0]&&r[1]===n[1])})[0];if(r&&r.should){e.cancelable&&e.preventDefault();return}if(!r){var o=(a.current.shards||[]).map(tZ).filter(Boolean).filter(function(t){return t.contains(e.target)});(o.length>0?l(e,o[0]):!a.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),u=d.useCallback(function(e,n,r,o){var i={name:e,delta:n,target:r,should:o,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(r)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),c=d.useCallback(function(e){n.current=tX(e),r.current=void 0},[]),f=d.useCallback(function(t){u(t.type,tY(t),t.target,l(t,e.lockRef.current))},[]),p=d.useCallback(function(t){u(t.type,tX(t),t.target,l(t,e.lockRef.current))},[]);d.useEffect(function(){return tJ.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",s,tV),document.addEventListener("touchmove",s,tV),document.addEventListener("touchstart",c,tV),function(){tJ=tJ.filter(function(e){return e!==i}),document.removeEventListener("wheel",s,tV),document.removeEventListener("touchmove",s,tV),document.removeEventListener("touchstart",c,tV)}},[]);var m=e.removeScrollBar,g=e.inert;return d.createElement(d.Fragment,null,g?d.createElement(i,{styles:"\n .block-interactivity-".concat(o," {pointer-events: none;}\n .allow-interactivity-").concat(o," {pointer-events: all;}\n")}):null,m?d.createElement(tB,{noRelative:e.noRelative,gapMode:e.gapMode}):null)},tj.useMedium(a),t_);var t1=d.forwardRef(function(e,t){return d.createElement(tk,(0,ty.__assign)({},e,{ref:t,sideCar:t0}))});t1.classNames=tk.classNames;var t2=Object.defineProperty,t5=(e,t)=>t2(e,"name",{value:t,configurable:!0}),t4=[" ","Enter","ArrowUp","ArrowDown"],t6=[" ","Enter"],t9="Select",[t8,t3,t7]=O(t9),[ne,nt]=S(t9,[t7,eF]),nn=eF(),[nr,no]=ne(t9),[ni,na]=ne(t9);function nl(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:i,value:a,defaultValue:l,onValueChange:s,dir:c,name:f,autoComplete:p,disabled:m,required:g,form:h,internal_do_not_use_render:v}
1=e,y=nn(t),[b,x]=d.useState(null),[w,S]=d.useState(null),[C,j]=d.useState(!1),E=B(c),[k,_]=ti({prop:r,defaultProp:o??!1,onChange:i,caller:t9}),[O,P]=ti({prop:a,defaultProp:l,onChange:s,caller:t9}),R=d.useRef(null),A=d.useRef(O);d.useEffect(()=>{let e=h?b?.ownerDocument.getElementById(h):b?.form;if(e instanceof HTMLFormElement){let t=t5(()=>P(A.current),"reset");return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[h,b,P]);let N=!b||!!h||!!b.closest("form"),[I,M]=d.useState(new Set),T=eO(),L=Array.from(I).map(e=>e.props.value).join(";"),D=d.useCallback(e=>{M(t=>new Set(t).add(e))},[]),F=d.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),z={required:g,trigger:b,onTriggerChange:x,valueNode:w,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:j,contentId:T,value:O,onValueChange:P,open:k,onOpenChange:_,dir:E,triggerPointerDownPosRef:R,disabled:m,name:f,autoComplete:p,form:h,nativeOptions:I,nativeSelectKey:L,isFormControl:N};return(0,u.jsx)(eW,{...y,children:(0,u.jsx)(nr,{scope:t,...z,children:(0,u.jsx)(t8.Provider,{scope:t,children:(0,u.jsx)(ni,{scope:t,onNativeOptionAdd:D,onNativeOptionRemove:F,children:nV(v)?v(z):n})})})})}t5(nl,"SelectProvider");var ns=t5(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,u.jsx)(nl,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,u.jsxs)(u.Fragment,{children:[n,e?(0,u.jsx)(nU,{__scopeSelect:t}):null]})})},"Select"),nu=d.forwardRef(t5(function(e,t){let{__scopeSelect:n,disabled:r=!1,...o}=e,i=nn(n),a=no("SelectTrigger",n),l=a.disabled||r,s=(0,j.useComposedRefs)(t,a.onTriggerChange),c=t3(n),f=d.useRef("touch"),[p,m,g]=nH(e=>{let t=c().filter(e=>!e.disabled),n=t.find(e=>e.value===a.value),r=nG(t,e,n);void 0!==r&&a.onValueChange(r.value)}),h=t5(e=>{l||(a.onOpenChange(!0),g()),e&&(a.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},"handleOpen");return(0,u.jsx)(eU,{asChild:!0,...i,children:(0,u.jsx)(U.button,{type:"button",role:"combobox","aria-controls":a.open?a.contentId:void 0,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":n$(a.value)?"":void 0,...o,ref:s,onClick:v(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==f.current&&h(e)}),onPointerDown:v(o.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(h(e),e.preventDefault())}),onKeyDown:v(o.onKeyDown,e=>{let t=""!==p.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||m(e.key),(!t||" "!==e.key)&&t4.includes(e.key)&&(h(),e.preventDefault())})})})},"SelectTrigger")),nc=d.forwardRef(t5(function(e,t){let{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...l}=e,s=no("SelectValue",n),{onValueNodeHasChildrenChange:c}=s,f=void 0!==i,p=(0,j.useComposedRefs)(t,s.onValueNodeChange);ej(()=>{c(f)},[c,f]);let m=n$(s.value);return(0,u.jsx)(U.span,{...l,asChild:!m&&l.asChild,ref:p,style:{pointerEvents:"none"},children:(0,u.jsx)(d.Fragment,{children:m?a:i},m?"placeholder":"value")})},"SelectValue")),nd=d.forwardRef(t5(function(e,t){let{__scopeSelect:n,children:r,...o}=e;return(0,u.jsx)(U.span,{"aria-hidden":!0,...o,ref:t,children:r||"â¼"})},"SelectIcon")),[nf,np]=ne("SelectPortal",{forceMount:void 0}),nm=t5(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,u.jsx)(nf,{scope:e.__scopeSelect,forceMount:n,children:(0,u.jsx)(eQ,{asChild:!0,...r})})},"SelectPortal"),ng="SelectContent",nh=d.forwardRef(t5(function(e,t){let n=np(ng,e.__scopeSelect),{forceMount:r=n.forceMount,...o}=e,i=no(ng,e.__scopeSelect),[a,l]=d.useState();return ej(()=>{l(new DocumentFragment)},[]),(0,u.jsx)(e2,{present:r||i.open,children:({present:e})=>e?(0,u.jsx)(nw,{...o,ref:t}):(0,u.jsx)(nv,{...o,fragment:a})})},"SelectContent")),nv=d.forwardRef(t5(function(e,t){let{__scopeSelect:n,children:r,fragment:o}=e;return o?f.createPortal((0,u.jsx)(ny,{scope:n,children:(0,u.jsx)(t8.Slot,{scope:n,children:(0,u.jsx)("div",{ref:t,children:r})})}),o):null},"SelectContentFragment")),[ny,nb]=ne(ng),nx=(0,E.createSlot)("SelectContent.RemoveScroll"),nw=d.forwardRef(t5(function(e,t){let{__scopeSelect:n}=e,{position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:i,onPointerDownOutside:a,side:l,sideOffset:s,align:c,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:
1h,hideWhenDetached:y,avoidCollisions:b,...x}=e,w=no(ng,n),[S,C]=d.useState(null),[E,k]=d.useState(null),_=(0,j.useComposedRefs)(t,C),[O,P]=d.useState(null),[R,A]=d.useState(null),N=t3(n),[I,M]=d.useState(!1),T=d.useRef(!1);d.useEffect(()=>{if(S)return tv(S)},[S]),ei();let L=d.useCallback(e=>{let[t,...n]=N().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(let n of e)if(n===o||(n?.scrollIntoView({block:"nearest"}),n===t&&E&&(E.scrollTop=0),n===r&&E&&(E.scrollTop=E.scrollHeight),n?.focus(),document.activeElement!==o))return},[N,E]),D=d.useCallback(()=>L([O,S]),[L,O,S]);d.useEffect(()=>{I&&D()},[I,D]);let{onOpenChange:F,triggerPointerDownPosRef:z}=w;d.useEffect(()=>{if(S){let e={x:0,y:0},t=t5(t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},"handlePointerMove"),n=t5(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(S)||F(!1),document.removeEventListener("pointermove",t),z.current=null},"handlePointerUp");return null!==z.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[S,F,z]),d.useEffect(()=>{let e=t5(()=>F(!1),"close");return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[F]);let[B,W]=nH(e=>{let t=N().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=nG(t,e,n);r&&setTimeout(()=>r.ref.current?.focus())}),U=d.useCallback((e,t,n)=>{let r=!T.current&&!n;(void 0!==w.value&&w.value===t||r)&&(P(e),r&&(T.current=!0))},[w.value]),V=d.useCallback(()=>S?.focus(),[S]),$=d.useCallback((e,t,n)=>{let r=!T.current&&!n;(void 0!==w.value&&w.value===t||r)&&A(e)},[w.value]),H="popper"===r?nC:nS;return(0,u.jsx)(ny,{scope:n,content:S,viewport:E,onViewportChange:k,itemRefCallback:U,selectedItem:O,onItemLeave:V,itemTextRefCallback:$,focusSelectedItem:D,selectedItemText:R,position:r,isPositioned:I,searchRef:B,children:(0,u.jsx)(t1,{as:nx,allowPinchZoom:!0,children:(0,u.jsx)(ef,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:v(o,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,u.jsx)(X,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:(0,u.jsx)(H,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...x,...H===nC?{side:l,sideOffset:s,align:c,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:g,sticky:h,hideWhenDetached:y,avoidCollisions:b}:{},onPlaced:()=>M(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:v(x.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||W(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=N().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>L(t)),e.preventDefault()}})})})})})})},"SelectContentImpl")),nS=d.forwardRef(t5(function(e,t){let{__scopeSelect:n,onPlaced:r,...o}=e,i=no(ng,n),a=nb(ng,n),[l,s]=d.useState(null),[c,f]=d.useState(null),m=(0,j.useComposedRefs)(t,f),g=t3(n),h=d.useRef(!1),v=d.useRef(!0),{viewport:y,selectedItem:b,selectedItemText:x,focusSelectedItem:w}=a,S=d.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&c&&y&&b&&x){let e=i.trigger.getBoundingClientRect(),t=c.getBoundingClientRect(),n=i.valueNode.getBoundingClientRect(),o=x.getBoundingClientRect();if("rtl"!==i.dir){let r=o.left-t.left,i=n.left-r,a=e.left-i,s=e.width+a,u=Math.max(s,t.width),c=p(i,[10,Math.max(10,window.innerWidth-10-u)]);l.style.minWidth=s+"px",l.style.left=c+"px"}else{let r=t.right-o.right,i=window.innerWidth-n.right-r,a=window.innerWidth-e.right-i,s=e.width+a,u=Math.max(s,t.width),c=p(i,[10,Math.max(10,window.innerWidth-10-u)]);l.style.minWidth=s+"px",l.style.right=c+"px"}let a=g(),s=window.innerHeight-20,u=y.scrollHeight,d=window.getComputedStyle(c),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),v=parseInt(d.borderBottomWidth,10),w=f+m+u+parseInt(d.paddingBottom,10)+v,S=Math.min(5*b.offsetHeight,w),C=window.getComputedStyle(y),j=parseInt(C.paddingTop,10),E=parseInt(C.paddingBottom,10),k=e.top+e.height/2-10,_=b.offsetHeight/2,O=f+m+(b.offsetTop+_);if(O<=k){let e=a.length>0&&b===a[a.length-1].ref.current;l.style.bottom="0px";let t=Math.max(s-k,_+(e?E:0)+(c.clientHeight-y.offsetTop-y.offsetHeight)+v);l.style.height=O+t+"px"}else{let e=a.length>0&&b===a[0].ref.current;l.style.top="0px";let t=Math.max(k,f+y.offsetTop+(e?j:0)+_);l.style.height=t+(w-O)+"px",y.scrollTop=O-k+y.offsetTop}
1l.style.margin="10px 0",l.style.minHeight=S+"px",l.style.maxHeight=s+"px",r?.(),requestAnimationFrame(()=>h.current=!0)}},[g,i.trigger,i.valueNode,l,c,y,b,x,i.dir,r]);ej(()=>S(),[S]);let[C,E]=d.useState();ej(()=>{c&&E(window.getComputedStyle(c).zIndex)},[c]);let k=d.useCallback(e=>{e&&!0===v.current&&(S(),w?.(),v.current=!1)},[S,w]);return(0,u.jsx)(nj,{scope:n,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:k,children:(0,u.jsx)("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:C},children:(0,u.jsx)(U.div,{...o,ref:m,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})},"SelectItemAlignedPosition")),nC=d.forwardRef(t5(function(e,t){let{__scopeSelect:n,align:r="start",collisionPadding:o=10,...i}=e,a=nn(n);return(0,u.jsx)(eG,{...a,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})},"SelectPopperPosition")),[nj,nE]=ne(ng,{}),nk="SelectViewport",n_=d.forwardRef(t5(function(e,t){let{__scopeSelect:n,nonce:r,...o}=e,i=nb(nk,n),a=nE(nk,n),l=(0,j.useComposedRefs)(t,i.onViewportChange),s=d.useRef(0);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),(0,u.jsx)(t8.Slot,{scope:n,children:(0,u.jsx)(U.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:v(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=a;if(r?.current&&n){let e=Math.abs(s.current-t.scrollTop);if(e>0){let r=window.innerHeight-20,o=Math.max(parseFloat(n.style.minHeight),parseFloat(n.style.height));if(o<r){let i=o+e,a=Math.min(r,i),l=i-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=l>0?l:0,n.style.justifyContent="flex-end")}}}s.current=t.scrollTop})})})]})},"SelectViewport")),[nO,nP]=ne("SelectGroup"),nR="SelectItem",[nA,nN]=ne(nR),nI=d.forwardRef(t5(function(e,t){let{__scopeSelect:n,value:r,disabled:o=!1,textValue:i,...a}=e,l=no(nR,n),s=nb(nR,n),c=l.value===r,[f,p]=d.useState(i??""),[m,g]=d.useState(!1),h=$(e=>s.itemRefCallback?.(e,r,o)),y=(0,j.useComposedRefs)(t,h),b=eO(),x=d.useRef("touch"),w=t5(()=>{o||(l.onValueChange(r),l.onOpenChange(!1))},"handleSelect");return(0,u.jsx)(nA,{scope:n,value:r,disabled:o,textId:b,isSelected:c,onItemTextChange:d.useCallback(e=>{p(t=>t||(e?.textContent??"").trim())},[]),children:(0,u.jsx)(t8.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:(0,u.jsx)(U.div,{role:"option","aria-labelledby":b,"data-highlighted":m?"":void 0,"aria-selected":c&&m,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...a,ref:y,onFocus:v(a.onFocus,()=>g(!0)),onBlur:v(a.onBlur,()=>g(!1)),onClick:v(a.onClick,()=>{"mouse"!==x.current&&w()}),onPointerUp:v(a.onPointerUp,()=>{"mouse"===x.current&&w()}),onPointerDown:v(a.onPointerDown,e=>{x.current=e.pointerType}),onPointerMove:v(a.onPointerMove,e=>{x.current=e.pointerType,o?s.onItemLeave?.():"mouse"===x.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:v(a.onPointerLeave,e=>{e.currentTarget===document.activeElement&&s.onItemLeave?.()}),onKeyDown:v(a.onKeyDown,e=>{o||e.target!==e.currentTarget||(s.searchRef?.current===""||" "!==e.key)&&(t6.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})},"SelectItem")),nM="SelectItemText",nT=d.forwardRef(t5(function(e,t){let{__scopeSelect:n,className:r,style:o,...i}=e,a=no(nM,n),l=nb(nM,n),s=nN(nM,n),c=na(nM,n),[p,m]=d.useState(null),g=$(e=>l.itemTextRefCallback?.(e,s.value,s.disabled)),h=(0,j.useComposedRefs)(t,m,s.onItemTextChange,g),v=p?.textContent,y=d.useMemo(()=>(0,u.jsx)("option",{value:s.value,disabled:s.disabled,children:v},s.value),[s.disabled,s.value,v]),{onNativeOptionAdd:b,onNativeOptionRemove:x}=c;return ej(()=>(b(y),()=>x(y)),[b,x,y]),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(U.span,{id:s.textId,...i,ref:h}),s.isSelected&&a.valueNode&&!a.valueNodeHasChildren&&!n$(a.value)?f.createPortal(i.children,a.valueNode):null]})}
1,"SelectItemText")),nL=d.forwardRef(t5(function(e,t){let{__scopeSelect:n,...r}=e;return nN("SelectItemIndicator",n).isSelected?(0,u.jsx)(U.span,{"aria-hidden":!0,...r,ref:t}):null},"SelectItemIndicator")),nD="SelectScrollUpButton",nF=d.forwardRef(t5(function(e,t){let n=nb(nD,e.__scopeSelect),r=nE(nD,e.__scopeSelect),[o,i]=d.useState(!1),a=(0,j.useComposedRefs)(t,r.onScrollButtonChange);return ej(()=>{if(n.viewport&&n.isPositioned){let e=function(){i(t.scrollTop>0)};t5(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),o?(0,u.jsx)(nW,{...e,ref:a,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null},"SelectScrollUpButton")),nz="SelectScrollDownButton",nB=d.forwardRef(t5(function(e,t){let n=nb(nz,e.__scopeSelect),r=nE(nz,e.__scopeSelect),[o,i]=d.useState(!1),a=(0,j.useComposedRefs)(t,r.onScrollButtonChange);return ej(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;i(Math.ceil(t.scrollTop)<e)};t5(e,"handleScroll");let t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),o?(0,u.jsx)(nW,{...e,ref:a,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null},"SelectScrollDownButton")),nW=d.forwardRef(t5(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...o}=e,i=nb("SelectScrollButton",n),a=d.useRef(null),l=t3(n),s=d.useCallback(()=>{null!==a.current&&(window.clearInterval(a.current),a.current=null)},[]);return d.useEffect(()=>()=>s(),[s]),ej(()=>{let e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),(0,u.jsx)(U.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:v(o.onPointerDown,()=>{null===a.current&&(a.current=window.setInterval(r,50))}),onPointerMove:v(o.onPointerMove,()=>{i.onItemLeave?.(),null===a.current&&(a.current=window.setInterval(r,50))}),onPointerLeave:v(o.onPointerLeave,()=>{s()})})},"SelectScrollButtonImpl")),nU=d.forwardRef(t5(function({__scopeSelect:e,...t},n){let r=no("SelectBubbleInput",e),{value:o,onValueChange:i,required:a,disabled:l,name:s,autoComplete:c,form:f}=r,{nativeOptions:p,nativeSelectKey:m}=r,g=d.useRef(null),h=(0,j.useComposedRefs)(n,g),v=o??"",y=tu(v),b=Array.from(p).some(e=>(e.props.value??"")==="");return d.useEffect(()=>{let e=g.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(y!==v&&t){let n=new Event("change",{bubbles:!0});t.call(e,v),e.dispatchEvent(n)}},[y,v]),(0,u.jsxs)(U.select,{"aria-hidden":!0,required:a,tabIndex:-1,name:s,autoComplete:c,disabled:l,form:f,onChange:e=>i(e.target.value),...t,style:{...tc,...t.style},ref:h,defaultValue:v,children:[n$(o)&&!b?(0,u.jsx)("option",{value:""}):null,Array.from(p)]},m)},"SelectBubbleInput"));function nV(e){return"function"==typeof e}function n$(e){return""===e||void 0===e}function nH(e){let t=$(e),n=d.useRef(""),r=d.useRef(0),o=d.useCallback(e=>{t(n.current+e)},[t]),i=d.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return d.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,i]}function nG(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=n?e.indexOf(n):-1,i=nK(e,Math.max(o,0));1===r.length&&(i=i.filter(e=>e!==n));let a=i.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return a!==n?a:void 0}function nK(e,t){return e.map((n,r)=>e[(t+r)%e.length])}t5(nV,"isFunction"),t5(n$,"shouldShowPlaceholder"),t5(nH,"useTypeaheadSearch"),t5(nG,"findNextItem"),t5(nK,"wrapArray");var nq=e.i(75254);let nX=(0,nq.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var nY=e.i(9797);let nZ=(0,nq.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);var nQ=e.i(80064);function nJ({...e}){return(0,u.jsx)(ns,{"data-slot":"select",...e})}function n0({...e}){return(0,u.jsx)(nc,{"data-slot":"select-value",...e})}function n1({className:e,size:t="default",children:n,...r}){return(0,u.jsxs)(nu,{"data-slot":"select-trigger","data-size":t,className:(0,nQ.cn)("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[1px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-9 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,(0,u.jsx)(nd,{asChild:!0,children:(0,u.jsx)(nY.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function n2({className:e,children:t,position:n="popper",...r}){return(0,u.jsx)(nm,{children:(0,u.jsxs)(nh,{"data-slot":"select-content",className:(0,nQ.cn)("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[(0,u.jsx)(n4,{}),(0,u.jsx)(n_,{className:(0,nQ.cn)("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:t}),(0,u.jsx)(n6,{})]})})}function n5({className:e,children:t,...n}){return(0,u.jsxs)(nI,{"data-slot":"select-item",className:(0,nQ.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...n,children:[(0,u.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,u.jsx)(nL,{children:(0,u.jsx)(nX,{className:"size-4"})})}),(0,u.jsx)(nT,{children:t})]})}function n4({className:e,...t}){return(0,u.jsx)(nF,{"data-slot":"select-scroll-up-button",className:(0,nQ.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,u.jsx)(nZ,{className:"size-4"})})}function n6({className:e,...t}){return(0,u.jsx)(nB,{"data-slot":"select-scroll-down-button",className:(0,nQ.cn)("flex cursor-default items-center justify-center py-1",e),...t,children:(0,u.jsx)(nY.ChevronDownIcon,{className:"size-4"})})}var n9=e.i(61946);e.s(["default",0,({att:e,option:t,variants:n,setValue:r,varTitle:o,selectVariant:i,setSelectVariant:a,setSelectVa:l})=>{let{showingTranslateValue:s}=(0,n9.default)(),d=t=>{r(t),a({...i,[e]:t}),l({[e]:t})},f=[...new Map(n?.map(t=>[t[e],t]).filter(Boolean)).values()].filter(Boolean);return(0,u.jsx)(u.Fragment,{children:"Dropdown"===t?(0,u.jsxs)(nJ,{onValueChange:d,value:i[e]||"",children:[(0,u.jsx)(n1,{className:"col-start-1 row-start-1 w-full appearance-none rounded-md bg-background py-1.5 pr-8 pl-3 text-base text-muted-foreground outline-1 -outline-offset-1 outline-border focus:outline-2 focus:-outline-offset-2 focus:outline-primary sm:text-sm/6",children:(0,u.jsx)(n0,{placeholder:"Select Variant"})}),(0,u.jsx)(n2,{children:f.map(t=>o.map(n=>n?.variants?.map(r=>n?._id===e&&r?._id===t[e]&&(0,u.jsx)(n5,{value:t[e],children:s(r.name)},r._id))))})]}):(0,u.jsx)("div",{className:"w-full flex flex-wrap gap-2",children:f.map(t=>o.map(n=>n?.variants?.map(r=>n?._id===e&&r?._id===t[e]&&(0,u.jsx)(c.Button,{size:"sm",onClick:()=>d(t[e]),variant:Object?.values(i).includes(t[e])?"active":"outline",className:`h-7 text-xs ${Object?.values(i).includes(t[e])?"cursor-pointer inline-flex items-center rounded-full bg-accent px-3 py-1 text-xs font-medium text-primary":"cursor-pointer inline-flex items-center rounded-full bg-background hover:bg-accent hover:shadow-md px-3 py-1 text-xs font-medium text-muted-foreground hover:text-green-700"}`,children:s(r.name)},r._id))))})})}],8586)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.