import{a as v}from"./chunk-LIVIUXQS.js";import{Cb as y,Ka as i,T as c,Za as o,_a as a,hb as p,ib as l,jb as s,lb as u,ma as b,na as r}from"./chunk-MFMPTNOZ.js";var _=class m{value=r.required();min=r(1);max=r(99);itemLabel=r("this item");valueChange=b();step(n){this.emit(this.value()+n)}onInput(n){let t=Number(n.target.value);this.emit(Number.isFinite(t)?t:this.value())}emit(n){let t=Math.min(Math.max(Math.round(n),this.min()),this.max());this.valueChange.emit(t)}static \u0275fac=function(t){return new(t||m)};static \u0275cmp=c({type:m,selectors:[["app-quantity-stepper"]],inputs:{value:[1,"value"],min:[1,"min"],max:[1,"max"],itemLabel:[1,"itemLabel"]},outputs:{valueChange:"valueChange"},standalone:!0,features:[y],decls:6,vars:10,consts:[[1,"qty"],["type","button",1,"qty__btn",3,"click","disabled"],["name","minus",3,"size"],["type","number","inputmode","numeric",1,"qty__input",3,"change","value","min","max"],["name","plus",3,"size"]],template:function(t,e){t&1&&(p(0,"div",0)(1,"button",1),u("click",function(){return e.step(-1)}),s(2,"app-icon",2),l(),p(3,"input",3),u("change",function(g){return e.onInput(g)}),l(),p(4,"button",1),u("click",function(){return e.step(1)}),s(5,"app-icon",4),l()()),t&2&&(i(),a("disabled",e.value()<=e.min()),o("aria-label","Decrease quantity for "+e.itemLabel()),i(),a("size",16),i(),a("value",e.value())("min",e.min())("max",e.max()),o("aria-label","Quantity for "+e.itemLabel()),i(),a("disabled",e.value()>=e.max()),o("aria-label","Increase quantity for "+e.itemLabel()),i(),a("size",16))},dependencies:[v],styles:[".qty[_ngcontent-%COMP%]{display:inline-flex;align-items:center;border:1.5px solid var(--line-strong);border-radius:var(--r-pill);background:var(--surface);overflow:hidden}.qty__btn[_ngcontent-%COMP%]{display:grid;place-items:center;width:44px;height:44px;border:0;background:none;cursor:pointer;color:var(--ink);transition:background var(--fast) var(--ease)}.qty__btn[_ngcontent-%COMP%]:hover:not(:disabled){background:var(--canvas-2)}.qty__btn[_ngcontent-%COMP%]:disabled{opacity:.35;cursor:not-allowed}.qty__input[_ngcontent-%COMP%]{width:46px;height:44px;border:0;text-align:center;font:inherit;font-weight:700;background:none;color:var(--ink);appearance:textfield;-moz-appearance:textfield}.qty__input[_ngcontent-%COMP%]::-webkit-outer-spin-button, .qty__input[_ngcontent-%COMP%]::-webkit-inner-spin-button{appearance:none;margin:0}.qty__input[_ngcontent-%COMP%]:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}"],changeDetection:0})};export{_ as a};
