"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[26],{16:function(e,t,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),s=a(n(1)),i=a(n(30));t.default=function({component:e="p",size:t="normal",color:n="black",children:a}){if(!a)return null;let l,o;switch(n){case"white":l="text-white";break;case"black":l="text-black"}switch(t){case"small":o="text-sm";break;case"normal":o="text-base";break;case"large":o="text-base md:text-lg";break;case"xlarge":o="text-lg md:text-xl"}const u={className:(0,s.default)(l,o,"div"===e&&i.default.divContentStyling)};switch(e){case"p":return(0,r.jsx)("p",Object.assign({},u,{children:a}));case"div":return(0,r.jsx)("div",Object.assign({},u,{children:a}))}}},62:function(e,t,n){var a=this&&this.__createBinding||(Object.create?function(e,t,n,a){void 0===a&&(a=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,a,r)}:function(e,t,n,a){void 0===a&&(a=n),e[a]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&a(t,e,n);return r(t,e),t},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=n(0),o=s(n(3)),u=i(n(1)),c=i(n(279)),d=n(44);t.default=function({id:e,size:t="normal",line:n=1,item:a,onChange:r}){var s;const[i,b]=(0,o.useState)(null!==(s=null==a?void 0:a.quantity)&&void 0!==s?s:1);(0,o.useEffect)((()=>{a&&b(a.quantity)}),[a]);const f=e=>{"decrease"===e?i>1?p(i-1):1===i&&p(0):i<1e3&&p(i+1)},[h]=(0,d.useDebounceCallback)(250);function p(e){b(e),h((()=>r(e)))}return(0,l.jsx)("div",Object.assign({className:"flex"},{children:(0,l.jsxs)("div",Object.assign({className:"relative"},{children:[(0,l.jsx)("button",Object.assign({type:"button",className:(0,u.default)("absolute bottom-0 left-0 top-0 p-1 border-r border-gray-200","hover:bg-gray-200"),onClick:()=>f("decrease"),"aria-label":"Decrease quantity"},{children:(0,l.jsx)("svg",Object.assign({"aria-hidden":"true",focusable:"false",role:"presentation",className:"w-2.5 h-2.5 stroke-current",viewBox:"0 0 20 20"},{children:(0,l.jsx)("path",{fill:"#444",d:"M17.543 11.029H2.1A1.032 1.032 0 0 1 1.071 10c0-.566.463-1.029 1.029-1.029h15.443c.566 0 1.029.463 1.029 1.029 0 .566-.463 1.029-1.029 1.029z"})}))})),(0,l.jsx)("label",Object.assign({htmlFor:`Updates_${e}`,className:"hidden"},{children:"Quantity:"})),(0,l.jsx)("input",{type:"text",value:i,className:(0,u.default)("py-3 text-center border border-gray-200 outline-none",c.default.input,"small"===t&&"h-8 w-24","normal"===t&&"h-10 w-32"),onChange:e=>{p(Number(e.target.value))},id:`Updates_${e}`,name:"updates[]",pattern:"[0-9]*","data-line":n,"aria-live":"polite"}),(0,l.jsx)("button",Object.assign({type:"button",className:(0,u.default)("absolute bottom-0 right-0 top-0 p-1 border-l border-r border-gray-200","hover:bg-gray-200"),onClick:()=>f("increase"),"aria-label":"Increase quantity"},{children:(0,l.jsx)("svg",Object.assign({"aria-hidden":"true",focusable:"false",role:"presentation",className:"w-2.5 h-2.5 stroke-current",viewBox:"0 0 20 20"},{children:(0,l.jsx)("path",{fill:"#444",d:"M17.409 8.929h-6.695V2.258c0-.566-.506-1.029-1.071-1.029s-1.071.463-1.071 1.029v6.671H1.967C1.401 8.929.938 9.435.938 10s.463 1.071 1.029 1.071h6.605V17.7c0 .566.506 1.029 1.071 1.029s1.071-.463 1.071-1.029v-6.629h6.695c.566 0 1.029-.506 1.029-1.071s-.463-1.071-1.029-1.071z"})}))}))]}))}))}},280:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.formatDuration=void 0;const n=[{unit:"hour",value:3600},{unit:"minute",value:60},{unit:"second",value:1}];t.formatDuration=function(e){if(e<=0)return"just a moment";const t=[];let a=e;for(const{unit:e,value:r}of n){const n=Math.floor(a/r);a-=n*r;const s=n>1||0===n?e+"s":e;t.push(`${n} ${s}`)}if(1===t.length)return t[0];const r=t.pop();return`${t.join(", ")}, and ${r}`}},44:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useDebounceCallback=void 0;const a=n(3);t.useDebounceCallback=function(e=250){const t=(0,a.useRef)(null);return[function(n){window.clearTimeout(t.current),t.current=window.setTimeout(n,e)}]}}}]);