1import{a as N}from"./chunk-ENVWXQN6.js";import{a as ne}from"./chunk-62KI5KM2.js";import{G as Z,H as ee,I as te}from"./chunk-OPG7WIVC.js";import{$b as G,Bc as Y,Ca as V,Ea as a,Eb as Q,Fb as $,Gb as S,Hb as R,Jb as _,Lb as m,Mb as M,Nb as K,Ra as j,X as w,Ya as I,aa as A,ab as f,ba as T,bb as z,ca as x,cb as P,cc as h,db as y,eb as b,fb as F,gb as B,hb as D,hc as U,ib as k,ic as d,jb as s,jc as O,kb as r,kc as C,la as v,lb as l,lc as J,mb as u,mc as X,na as E,tb as W,vb as g,xb as c,ya as q,yb as H,zb as L}from"./chunk-2B6X3O7I.js";var oe=["dropdownRef"],ae=["overlayRef"],re=["inputRef"],le=[[["label-content"]]],de=["label-content"];function se(o,n){o&1&&(r(0,"div",6),m(1,"*"),l())}function pe(o,n){if(o&1&&u(0,"div",21),o&2){let t=c(2);s("innerHTML",t.tooltipText(),q)}}function ue(o,n){if(o&1&&(x(),r(0,"svg",13),u(1,"g",14),r(2,"g")(3,"g",15),u(4,"circle",16)(5,"rect",17)(6,"path",18),l(),r(7,"defs")(8,"clipPath",19),u(9,"rect",20),l()()()(),I(10,pe,1,1,"ng-template",null,2,G)),o&2){let t=R(11);s("tooltip",t)}}function ce(o,n){if(o&1){let t=W();r(0,"li",24)(1,"button",26),g("click",function(){let i=A(t).$implicit,p=c(2);return T(p.selectOption(i))}),m(2),l()()}if(o&2){let t=n.$implicit,e=n.$index,i=c(2);s("id",i.inputId+"-option-"+e),f("aria-selected",t.value===i.value()),a(),_("bg-pure-blue-100",e===i.activeIndex())("dark:bg-pure-blue-700",e===i.activeIndex()),s("disabled",t.disabled||i.disabled()),a(),K(" ",t.label," ")}}function me(o,n){o&1&&(r(0,"li",25),m(1,"No matches"),l())}function ve(o,n){if(o&1&&(r(0,"div",22,3),P("animate-disappear"),z("animate-appear"),r(2,"ul",23),D(3,ce,3,8,"li",24,F,!1,me,2,0,"li",25),l()()),o&2){let t=c();a(2),s("id",t.inputId+"-listbox"),a(),k(t.filteredOptions())}}function ge(o,n){if(o&1&&(r(0,"div"),m(1),l()),o&2){let t=n.$implicit;a(),M(t.message)}}function he(o,n){if(o&1&&(r(0,"div",12),D(1,ge,2,1,"div",null,B),l()),o&2){let t=c();a(),k(t.errors())}}var fe=0,ie=class o{value=O(null);touched=O(!1);dirty=O(!1);disabled=d(!1);disabledReasons=d([]);readonly=d(!1);hidden=d(!1);invalid=d(!1);errors=d([]);required=d(!1);name=d("");options=d([]);placeholder=d("Type to search\u2026");tooltipText=d(null);label=d(null);filterPredicate=d(null);selectionChange=U();appOptions=J(N);dropdownRef=C("dropdownRef");overlayRef=C("overlayRef");inputRef=C("inputRef");resizeObserver;cdr=w(X);platformId=w(E);isOpen=v(!1);overlayWidth=0;query=v("");editing=v(!1);activeIndex=v(-1);inputId=`app-input-autocomplete-signal-${fe++}`;dropdownOptions=h(()=>{let n=this.options();return n.length>0?n.map(e=>typeof e=="object"&&e!==null?{value:e.value,label:e.label,disabled:!!e.disabled}:typeof e=="string"||typeof e=="number"?{value:e,label:e,disabled:!1}:{value:null,label:"",disabled:!1}):this.appOptions().map(e=>({value:e.value(),label:e.label(),disabled:e.disabled()}))});displayValue=h(()=>this.dropdownOptions().find(t=>t.value===this.value())?.label??null);filteredOptions=h(()=>{let n=this.dropdownOptions(),t=this.query().trim().toLowerCase();if(!t)return n;let e=this.filterPredicate();return e?n.filter(i=>e(i,t)):n.filter(i=>String(i.label).toLowerCase().includes(t))});text=h(()=>{if(this.editing())return this.query();let n=this.displayValue();return n==null?"":String(n)});ngAfterViewInit(){!this.inputRef()||!Y(this.platformId)||(this.resizeObserver=new ResizeObserver(n=>{for(let t of n){let e=t.borderBoxSize,i=Array.isArray(e)?e[0]?.inlineSize:e?.inlineSize;this.overlayWidth=i??t.contentRect?.width??0,this.cdr.detectChanges()}}),this.resizeObserver.observe(this.inputRef().elementRef.nativeElement))}ngOnDestroy(){this.resizeObserver?.disconnect()}onMouseDown(n){if(!this.isOpen()||!this.dropdownRef()||!this.overlayRef())return;let t=n.target;if(!t)return;let e=this.dropdownRef().nativeElement.contains(t),i=this.overlayRef().nativeElement.contains(t);!e&&!i&&this.closeDropdown(!0)}beginEdit(){this.disabled()||this.readonly()||(this.editing.set(!0),this.query.set(""),this.activeIndex.set(-1),this.isOpen.set(!0),this.touched.set(!0))}onInput(n){this.editing.set(!0),this.dirty.set(!0),this.query.set(n),this.isOpen.set(!0),this.activeIndex.set(this.filteredOptions().length?0:-1),n.trim()===""&&this.value()!=null&&(this.value.set(null),this.selectionChange.emit(this.value()))}onKeydown(n){if(!(this.disabled()||this.readonly()))switch(n.key){case"ArrowDown":{if(n.preventDefault(),!this.isOpen()){this.beginEdit();return}this.moveActive(1);break}case"ArrowUp":{n.preventDefault(),this.moveActive(-1);break}case"Enter":{if(!this.isOpen())return;n.preventDefault();let e=this.filteredOptions()[this.activeIndex()];e&&this.selectOption(e);break}case"Escape":{this.isOpen()&&(n.preventDefault(),this.closeDropdown(!0));break}}}moveActive(n){let t=this.filteredOptions();if(!t.length){this.activeIndex.set(-1);return}let e=this.activeIndex();for(let i=0;i<t.length&&(e=(e+n+t.length)%t.length,!!t[e].disabled);i++);this.activeIndex.set(e)}selectOption(n){if(this.disabled()||this.readonly()||n.disabled)return;let t=this.appOptions();this.options().length===0&&t.length>0&&t.find(i=>i.value()===n.value)?.selected.emit(n),this.value.set(n.value),this.editing.set(!1),this.query.set(""),this.isOpen.set(!1),this.activeIndex.set(-1),this.dirty.set(!0),this.touched.set(!0),this.selectionChange.emit(this.value())}closeDropdown(n=!1){this.isOpen.set(!1),this.editing.set(!1),this.query.set(""),this.activeIndex.set(-1),n&&this.touched.set(!0)}clear(){this.disabled()||this.readonly()||(this.value.set(null),this.query.set(""),this.editing.set(!1),this.dirty.set(!0),this.touched.set(!0),this.selectionChange.emit(this.value()))}get resolvedName(){return this.name().trim()||this.inputId}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=j({type:o,selectors:[["app-input-autocomplete-signal"]],contentQueries:function(t,e,
1i){t&1&&Q(i,e.appOptions,N,4),t&2&&S()},viewQuery:function(t,e){t&1&&$(e.dropdownRef,oe,5)(e.overlayRef,ae,5)(e.inputRef,re,5),t&2&&S(3)},hostBindings:function(t,e){t&1&&g("mousedown",function(p){return e.onMouseDown(p)},V)},inputs:{value:[1,"value"],touched:[1,"touched"],dirty:[1,"dirty"],disabled:[1,"disabled"],disabledReasons:[1,"disabledReasons"],readonly:[1,"readonly"],hidden:[1,"hidden"],invalid:[1,"invalid"],errors:[1,"errors"],required:[1,"required"],name:[1,"name"],options:[1,"options"],placeholder:[1,"placeholder"],tooltipText:[1,"tooltipText"],label:[1,"label"],filterPredicate:[1,"filterPredicate"]},outputs:{value:"valueChange",touched:"touchedChange",dirty:"dirtyChange",selectionChange:"selectionChange"},ngContentSelectors:de,decls:15,vars:21,consts:[["dropdownRef",""],["inputRef","cdkOverlayOrigin"],["customTooltip",""],["overlayRef",""],[1,"mb-2","flex","items-center","justify-between"],[1,"inline-flex","items-center","gap-1","text-sm","font-medium"],[1,"text-red-500"],[1,"relative","w-full"],["type","text","autocomplete","off","role","combobox","aria-autocomplete","list","cdkOverlayOrigin","",1,"relative","aptg-input","pe-9",3,"focus","input","keydown","value","placeholder","id","disabled","readonly"],["cdkConnectedOverlay","",3,"detach","cdkConnectedOverlayMinWidth","cdkConnectedOverlayOrigin","cdkConnectedOverlayOpen"],["aria-hidden","true","xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 10 6",1,"w-4","h-4","ms-2.5","absolute","right-4","top-1/3","pointer-events-none","transition-transform","duration-200"],["stroke","currentColor","stroke-linecap","round","stroke-linejoin","round","stroke-width","1","d","m1 1 4 4 4-4"],[1,"text-sm","text-red-500"],["viewBox","0 0 24 24","fill","none","xmlns","http://www.w3.org/2000/svg",1,"size-5",3,"tooltip"],["stroke-linecap","round","stroke-linejoin","round"],["clip-path","url(#clip0_429_11160)"],["cx","12","cy","11.9999","r","9","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"],["x","12","y","8","width","0.01","height","0.01","stroke","currentColor","stroke-width","2.25","stroke-linejoin","round"],["d","M12 12V16","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"],["id","clip0_429_11160"],["width","24","height","24"],[1,"max-w-lg",3,"innerHTML"],[1,"w-full","mt-1","font-normal","bg-white","border","border-pure-blue-500","divide-y","divide-gray-100","rounded-lg","shadow-sm","dark:bg-gray-700","dark:divide-gray-600"],["role","listbox",1,"py-2","dark:text-gray-400","overflow-y-auto","scrolling-touch","max-h-54",3,"id"],["role","option",3,"id"],[1,"px-4","py-2","text-sm","text-tech-gray-400"],["type","button",1,"px-4","py-2","min-h-10","w-full","text-left","enabled:hover:bg-pure-blue-100","enabled:dark:hover:bg-pure-blue-700","dark:hover:text-white","disabled:cursor-not-allowed","disabled:text-tech-gray-400",3,"click","disabled"]],template:function(t,e){if(t&1&&(H(le),r(0,"div",4)(1,"label",5)(2,"div"),m(3),l(),y(4,se,2,0,"div",6),L(5),l(),y(6,ue,12,1),l(),r(7,"div",7,0)(9,"input",8,1),g("focus",function(){return e.beginEdit()})("input",function(p){return e.onInput(p.target.value)})("keydown",function(p){return e.onKeydown(p)}),l(),I(11,ve,6,2,"ng-template",9),g("detach",function(){return e.closeDropdown()}),x(),r(12,"svg",10),u(13,"path",11),l()(),y(14,he,3,0,"div",12)),t&2){let i=R(10);a(),f("for",e.resolvedName),a(2),M(e.label()),a(),b(e.required()?4:-1),a(2),b(e.tooltipText()?6:-1),a(3),_("invalid",e.invalid()),s("value",e.text())("placeholder",e.placeholder())("id",e.resolvedName)("disabled",e.disabled())("readonly",e.readonly()),f("aria-expanded",e.isOpen())("aria-controls",e.inputId+"-listbox")("aria-activedescendant",e.isOpen()&&e.activeIndex()>=0?e.inputId+"-option-"+e.activeIndex():null)("aria-invalid",e.invalid()),a(2),s("cdkConnectedOverlayMinWidth",e.overlayWidth)("cdkConnectedOverlayOrigin",i)("cdkConnectedOverlayOpen",e.isOpen()),a(),_("rotate-180",e.isOpen()),a(2),b(e.invalid()&&(e.dirty()||e.touched())?14:-1)}},dependencies:[te,ee,Z,ne],encapsulation:2})};export{ie as a};
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.