import{f as Ft}from"./chunk-2FGKJSXG.js";import{a as Ot,b as Vt}from"./chunk-6N2DU4HB.js";import{b as It}from"./chunk-XKQYXDV6.js";import{a as Ct}from"./chunk-JFIKQKZJ.js";import{b as St,c as Et,d as Mt,e as Dt}from"./chunk-BAAM3DCZ.js";import{a as wt}from"./chunk-43NB6BM4.js";import{a as Ie}from"./chunk-OVEGWW7W.js";import{a as Ue,b as kt}from"./chunk-LL4377Z2.js";import{a as Nt}from"./chunk-W6JPMHYE.js";import{a as vt}from"./chunk-DQPTWMB2.js";import{a as bt,b as xt}from"./chunk-5TTXT2K2.js";import{a as ot}from"./chunk-JFJPOKIM.js";import{a as Tt}from"./chunk-XN7T54IM.js";import{a as yt}from"./chunk-RULWGB4E.js";import{a as Ne,b as mt}from"./chunk-2HIDUY57.js";import{a as ht}from"./chunk-HY3IUHOC.js";import{b as ut,c as ce,d as ze,i as D,j as _t}from"./chunk-2MELUOYA.js";import{$ as pt,A as se,B as st,Ea as Se,G as ct,I as dt,_ as He,ma as Re,n as rt,va as Z,w as Pe,wa as L,x as at,xa as gt,y as X,ya as ft}from"./chunk-WOPE6PPO.js";import{E as ae,a as lt,h as xe,o as ve}from"./chunk-MDIMQ3H3.js";import{a as be}from"./chunk-3DEA4WWC.js";import{q as Ce}from"./chunk-TKVDP62Z.js";import{Ad as Q,Bb as R,Bc as oe,Ca as x,Cc as Xe,Db as z,Dc as B,Ec as U,Fa as ge,Fc as Ze,Ib as a,Jb as g,Ka as K,Kb as h,Kc as et,Lb as N,Lc as tt,Pb as I,Qb as w,Qc as E,Rb as S,Tc as O,Ub as k,Xb as v,Xc as Le,Yc as J,Z as Oe,Za as c,Zb as s,ac as he,ad as Ae,bc as _e,cc as f,d as qe,da as Ve,dc as m,eb as ne,fd as b,ga as Qe,gd as $,hc as W,ia as Fe,ib as H,ic as Be,jb as fe,kc as G,lc as u,ma as pe,mb as me,mc as F,na as j,nb as ie,nc as ye,nd as nt,o as De,oa as ue,ob as d,oc as Y,pa as te,pd as le,qa as je,qd as re,ra as M,rc as Ge,rd as Te,sc as Ye,sd as q,tc as Je,td as it,va as _,wa as y,xa as V,xb as C,yb as Ke,zb as We}from"./chunk-GJDGQISV.js";import{a as ee}from"./chunk-SNAKHGZS.js";var Bt=`
    .p-tree {
        display: block;
        background: dt('tree.background');
        color: dt('tree.color');
        padding: dt('tree.padding');
        position: relative;
    }

    .p-tree-root-children,
    .p-tree-node-children {
        display: flex;
        list-style-type: none;
        flex-direction: column;
        margin: 0;
        gap: dt('tree.gap');
    }

    .p-tree-root-children {
        padding: 0;
        padding-block-start: dt('tree.gap');
    }

    .p-tree-node-children {
        padding: 0;
        padding-block-start: dt('tree.gap');
        padding-inline-start: dt('tree.indent');
    }

    .p-tree-node {
        padding: 0;
        outline: 0 none;
    }

    .p-tree-node-content {
        border-radius: dt('tree.node.border.radius');
        padding: dt('tree.node.padding');
        display: flex;
        align-items: center;
        outline-color: transparent;
        color: dt('tree.node.color');
        gap: dt('tree.node.gap');
        transition:
            background dt('tree.transition.duration'),
            color dt('tree.transition.duration'),
            outline-color dt('tree.transition.duration'),
            box-shadow dt('tree.transition.duration');
    }

    .p-tree-node-content[data-p-dragging] {
        outline: 1px dashed dt('primary.color');
        outline-offset: -1px;
    }

    .p-tree-node-content[data-pc-section="drag-image"] {
        background: dt('tree.background');
    }

    .p-tree-node:focus-visible > .p-tree-node-content {
        box-shadow: dt('tree.node.focus.ring.shadow');
        outline: dt('tree.node.focus.ring.width') dt('tree.node.focus.ring.style') dt('tree.node.focus.ring.color');
        outline-offset: dt('tree.node.focus.ring.offset');
    }

    .p-tree-node-content.p-tree-node-selectable:not(.p-tree-node-selected):hover {
        background: dt('tree.node.hover.background');
        color: dt('tree.node.hover.color');
    }

    .p-tree-node-content.p-tree-node-selectable:not(.p-tree-node-selected):hover .p-tree-node-icon {
        color: dt('tree.node.icon.hover.color');
    }

    .p-tree-node-content.p-tree-node-selected {
        background: dt('tree.node.selected.background');
        color: dt('tree.node.selected.color');
    }

    .p-tree-node-content.p-tree-node-selected .p-tree-node-toggle-button {
        color: inherit;
    }

    .p-tree-node-content.p-tree-node-dragover {
        background: dt('tree.node.hover.background');
        color: dt('tree.node.hover.color');
    }

    .p-tree-node-content:focus-visible,
    .p-tree-node-content.p-tree-node-contextmenu-selected {
        box-shadow: dt('tree.node.focus.ring.shadow');
        outline: dt('tree.node.focus.ring.width') dt('tree.node.focus.ring.style') dt('tree.node.focus.ring.color');
        outline-offset: dt('tree.node.focus.ring.offset');
    }

    .p-tree-node-drop-point {
		outline: 1px solid dt('primary.color');
	}

    .p-tree-node-toggle-button {
        cursor: pointer;
        user-select: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        position: relative;
        flex-shrink: 0;
        width: dt('tree.node.toggle.button.size');
        height: dt('tree.node.toggle.button.size');
        color: dt('tree.node.toggle.button.color');
        border: 0 none;
        background: transparent;
        border-radius: dt('tree.node.toggle.button.border.radius');
        transition:
            background dt('tree.transition.duration'),
            color dt('tree.transition.duration'),
            border-color dt('tree.transition.duration'),
            outline-color dt('tree.transition.duration'),
            box-shadow dt('tree.transition.duration');
        outline-color: transparent;
        padding: 0;
    }

    .p-tree-node-toggle-button:enabled:hover {
        background: dt('tree.node.toggle.button.hover.background');
        color: dt('tree.node.toggle.button.hover.color');
    }

    .p-tree-node-content.p-tree-node-selected .p-tree-node-toggle-button:hover {
        background: dt('tree.node.toggle.button.selected.hover.background');
        color: dt('tree.node.toggle.button.selected.hover.color');
    }

    .p-tree-root {
        overflow: auto;
    }

    .p-tree-node-selectable {
        cursor: pointer;
        user-select: none;
    }

    .p-tree-node-leaf > .p-tree-node-content .p-tree-node-toggle-button {
        visibility: hidden;
    }

    .p-tree-node-icon {
        color: dt('tree.node.icon.color');
        transition: color dt('tree.transition.duration');
    }

    .p-tree-node-content.p-tree-node-selected .p-tree-node-icon {
        color: dt('tree.node.icon.selected.color');
    }

    .p-tree-filter {
        margin: dt('tree.filter.margin');
    }

    .p-tree-filter-input {
        width: 100%;
    }

    .p-tree-loading-icon {
        font-size: dt('tree.loading.icon.size');
        width: dt('tree.loading.icon.size');
        height: dt('tree.loading.icon.size');
    }

    .p-tree .p-tree-mask {
        position: absolute;
        z-index: 1;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .p-tree-flex-scrollable {
        display: flex;
        flex: 1;
        height: 100%;
        flex-direction: column;
    }

    .p-tree-flex-scrollable .p-tree-root {
        flex: 1;
    }
`;var Rt=t=>({height:t}),Xt=(t,l)=>({$implicit:t,loading:l}),Zt=(t,l,e)=>({$implicit:t,partialSelected:l,class:e}),zt=t=>({$implicit:t}),en=()=>({next:!0});function tn(t,l){if(t&1&&N(0,"div",9),t&2){let e=s(2);u(e.cx("dropPoint")),a("pBind",e.getPTOptions("dropPoint")),C("aria-hidden",!0)}}function nn(t,l){if(t&1&&(V(),N(0,"svg",13)),t&2){let e=s(4);u(e.cx("nodeToggleIcon")),a("pBind",e.getPTOptions("nodeToggleIcon"))}}function on(t,l){if(t&1&&(V(),N(0,"svg",14)),t&2){let e=s(4);u(e.cx("nodeToggleIcon")),a("pBind",e.getPTOptions("nodeToggleIcon"))}}function ln(t,l){if(t&1&&(I(0),d(1,nn,1,3,"svg",11)(2,on,1,3,"svg",12),w()),t&2){let e=s(3);c(),a("ngIf",!e.node.expanded),c(),a("ngIf",e.node.expanded)}}function rn(t,l){if(t&1&&(I(0),V(),N(1,"svg",15),w()),t&2){let e=s(3);c(),u(e.cx("nodeToggleIcon")),a("pBind",e.getPTOptions("nodeToggleIcon"))}}function an(t,l){if(t&1&&(I(0),d(1,ln,3,2,"ng-container",6)(2,rn,2,3,"ng-container",6),w()),t&2){let e=s(2);c(),a("ngIf",!e.node.loading),c(),a("ngIf",e.loadingMode==="icon"&&e.node.loading)}}function sn(t,l){}function cn(t,l){t&1&&d(0,sn,0,0,"ng-template")}function dn(t,l){if(t&1&&(g(0,"span",9),d(1,cn,1,0,null,16),h()),t&2){let e=s(2);u(e.cx("nodeToggleIcon")),a("pBind",e.getPTOptions("nodeToggleIcon")),c(),a("ngTemplateOutlet",e.tree.togglerIconTemplate||e.tree._togglerIconTemplate)("ngTemplateOutletContext",U(5,Xt,e.node.expanded,e.node.loading))}}function pn(t,l){}function un(t,l){t&1&&d(0,pn,0,0,"ng-template")}function gn(t,l){if(t&1&&d(0,un,1,0,null,16),t&2){let e=s(4);a("ngTemplateOutlet",e.tree.checkboxIconTemplate||e.tree._checkboxIconTemplate)("ngTemplateOutletContext",Ze(2,Zt,e.isSelected(),e.node.partialSelected,e.cx("nodeCheckbox")))}}function fn(t,l){t&1&&(I(0),d(1,gn,1,6,"ng-template",null,0,E),w())}function mn(t,l){if(t&1&&(g(0,"p-checkbox",17),v("click",function(i){return i.preventDefault()}),d(1,fn,3,0,"ng-container",6),h()),t&2){let e=s(2);a("ngModel",e.isSelected())("styleClass",e.cx("nodeCheckbox"))("binary",!0)("indeterminate",e.node.partialSelected)("disabled",e.node.selectable===!1)("variant",(e.tree==null?null:e.tree.config.inputStyle())==="filled"||(e.tree==null?null:e.tree.config.inputVariant())==="filled"?"filled":"outlined")("tabindex",-1)("pt",e.getPTOptions("pcNodeCheckbox"))("unstyled",e.unstyled()),C("data-p-partialchecked",e.node.partialSelected),c(),a("ngIf",e.tree.checkboxIconTemplate||e.tree._checkboxIconTemplate)}}function hn(t,l){if(t&1&&N(0,"span",9),t&2){let e=s(2);u(e.getIcon()),a("pBind",e.getPTOptions("nodeIcon"))}}function _n(t,l){if(t&1&&(g(0,"span"),F(1),h()),t&2){let e=s(2);c(),ye(e.node.label)}}function yn(t,l){t&1&&S(0)}function Tn(t,l){if(t&1&&(g(0,"span"),d(1,yn,1,0,"ng-container",16),h()),t&2){let e=s(2);c(),a("ngTemplateOutlet",e.tree.getTemplateForNode(e.node))("ngTemplateOutletContext",B(2,zt,e.node))}}function bn(t,l){if(t&1&&N(0,"div",9),t&2){let e=s(2);u(e.cx("dropPoint",Xe(4,en))),a("pBind",e.getPTOptions("dropPoint")),C("aria-hidden",!0)}}function xn(t,l){if(t&1&&N(0,"p-treeNode",20),t&2){let e=l.$implicit,i=l.first,n=l.last,o=l.index,r=s(3);a("node",e)("parentNode",r.node)("firstChild",i)("lastChild",n)("index",o)("itemSize",r.itemSize)("level",r.level+1)("loadingMode",r.loadingMode)("pt",r.pt)("unstyled",r.unstyled())}}function vn(t,l){if(t&1&&(g(0,"ul",18),d(1,xn,1,10,"p-treeNode",19),h()),t&2){let e=s(2);u(e.cx("nodeChildren")),a("pBind",e.ptm("nodeChildren")),c(),a("ngForOf",e.node.children)("ngForTrackBy",e.tree.trackBy.bind(e))}}function Cn(t,l){if(t&1){let e=k();g(0,"li",2),v("keydown",function(n){_(e);let o=s();return y(o.onKeyDown(n))}),R(1,tn,1,4,"div",3),g(2,"div",4),v("click",function(n){_(e);let o=s();return y(o.onNodeClick(n))})("contextmenu",function(n){_(e);let o=s();return y(o.onNodeRightClick(n))})("dblclick",function(n){_(e);let o=s();return y(o.onNodeDblClick(n))})("touchend",function(){_(e);let n=s();return y(n.onNodeTouchEnd())})("drop",function(n){_(e);let o=s();return y(o.onNodeDrop(n))})("dragstart",function(n){_(e);let o=s();return y(o.onNodeDragStart(n))})("dragover",function(n){_(e);let o=s();return y(o.onNodeDragOver(n))})("dragleave",function(n){_(e);let o=s();return y(o.onNodeDragLeave(n))})("dragend",function(n){_(e);let o=s();return y(o.onNodeDragEnd(n))}),g(3,"button",5),v("click",function(n){_(e);let o=s();return y(o.toggle(n))}),d(4,an,3,2,"ng-container",6)(5,dn,2,8,"span",7),h(),d(6,mn,2,11,"p-checkbox",8)(7,hn,1,3,"span",7),g(8,"span",9),d(9,_n,2,1,"span",6)(10,Tn,2,4,"span",6),h()(),R(11,bn,1,5,"div",3),d(12,vn,2,5,"ul",10),h()}if(t&2){let e=s();G(e.node.style),u(e.cn(e.cx("node"),e.node.styleClass)),a("ngStyle",B(36,Rt,e.itemSize+"px"))("pBind",e.getPTOptions("node")),C("aria-label",e.node.label)("aria-checked",e.checked)("aria-setsize",e.node.children?e.node.children.length:0)("aria-selected",e.selected)("aria-expanded",e.node.expanded)("aria-posinset",e.index+1)("aria-level",e.level+1)("tabindex",e.index===0?0:-1)("data-id",e.node.key),c(),z(e.isPrevDropPointActive()?1:-1),c(),u(e.cx("nodeContent")),Be("padding-left",e.level*e.indentation+"rem"),a("draggable",e.tree.draggableNodes)("pBind",e.getPTOptions("nodeContent")),c(),u(e.cx("nodeToggleButton")),a("pBind",e.getPTOptions("nodeToggleButton")),c(),a("ngIf",!e.tree.togglerIconTemplate&&!e.tree._togglerIconTemplate),c(),a("ngIf",e.tree.togglerIconTemplate||e.tree._togglerIconTemplate),c(),a("ngIf",e.tree.selectionMode=="checkbox"),c(),a("ngIf",e.node.icon||e.node.expandedIcon||e.node.collapsedIcon),c(),u(e.cx("nodeLabel")),a("pBind",e.getPTOptions("nodeLabel")),c(),a("ngIf",!e.tree.getTemplateForNode(e.node)),c(),a("ngIf",e.tree.getTemplateForNode(e.node)),c(),z(e.isNextDropPointActive()?11:-1),c(),a("ngIf",!e.tree.virtualScroll&&e.node.children&&e.node.expanded)}}var Lt=["filter"],Sn=["node"],Nn=["header"],In=["footer"],wn=["loader"],En=["empty"],Mn=["togglericon"],kn=["checkboxicon"],Dn=["loadingicon"],On=["filtericon"],Vn=["scroller"],Fn=["wrapper"],Bn=["content"],Ln=t=>({options:t});function An(t,l){if(t&1&&N(0,"i",11),t&2){let e=s(2);u(e.cn(e.cx("loadingIcon"),"pi-spin"+e.loadingIcon)),a("pBind",e.ptm("loadingIcon"))}}function Pn(t,l){if(t&1&&(V(),N(0,"svg",13)),t&2){let e=s(3);u(e.cx("loadingIcon")),a("pBind",e.ptm("loadingIcon"))}}function Hn(t,l){}function Rn(t,l){t&1&&d(0,Hn,0,0,"ng-template")}function zn(t,l){if(t&1&&(g(0,"span",11),d(1,Rn,1,0,null,8),h()),t&2){let e=s(3);u(e.cx("loadingIcon")),a("pBind",e.ptm("loadingIcon")),c(),a("ngTemplateOutlet",e.loadingIconTemplate||e._loadingIconTemplate)}}function Un(t,l){if(t&1&&(I(0),d(1,Pn,1,3,"svg",12)(2,zn,2,4,"span",7),w()),t&2){let e=s(2);c(),a("ngIf",!e.loadingIconTemplate&&!e._loadingIconTemplate),c(),a("ngIf",e.loadingIconTemplate||e._loadingIconTemplate)}}function $n(t,l){if(t&1&&(g(0,"div",11),We("p-overlay-mask-leave-active"),Ke("p-overlay-mask-enter-active"),d(1,An,1,3,"i",7)(2,Un,3,2,"ng-container",10),h()),t&2){let e=s();u(e.cx("mask")),a("pBind",e.ptm("mask")),c(),a("ngIf",e.loadingIcon),c(),a("ngIf",!e.loadingIcon)}}function qn(t,l){t&1&&S(0)}function Qn(t,l){t&1&&S(0)}function jn(t,l){if(t&1&&d(0,Qn,1,0,"ng-container",14),t&2){let e=s();a("ngTemplateOutlet",e.filterTemplate||e._filterTemplate)("ngTemplateOutletContext",B(2,zt,e.filterOptions))}}function Kn(t,l){if(t&1&&(V(),N(0,"svg",19)),t&2){let e=s(3);u(e.cx("filterIcon")),a("pBind",e.ptm("filterIcon"))}}function Wn(t,l){}function Gn(t,l){t&1&&d(0,Wn,0,0,"ng-template")}function Yn(t,l){if(t&1&&(g(0,"span",11),d(1,Gn,1,0,null,8),h()),t&2){let e=s(3);u(e.cx("filterIcon")),a("pBind",e.ptm("filterIcon")),c(),a("ngTemplateOutlet",e.filterIconTemplate||e._filterIconTemplate)}}function Jn(t,l){if(t&1){let e=k();g(0,"p-iconfield",16)(1,"input",17,0),v("keydown.enter",function(n){return n.preventDefault()})("input",function(n){_(e);let o=s(2);return y(o._filter(n.target==null?null:n.target.value))}),h(),g(3,"p-inputicon",16),d(4,Kn,1,3,"svg",18)(5,Yn,2,4,"span",7),h()()}if(t&2){let e=s(2);u(e.cx("pcFilterContainer")),a("pt",e.ptm("pcFilterContainer"))("unstyled",e.unstyled()),c(),u(e.cx("pcFilterInput")),a("pAutoFocus",e.filterInputAutoFocus)("pt",e.ptm("pcFilterInput"))("unstyled",e.unstyled()),C("placeholder",e.filterPlaceholder),c(2),a("pt",e.ptm("pcFilterIconContainer"))("unstyled",e.unstyled()),c(),a("ngIf",!e.filterIconTemplate&&!e._filterIconTemplate),c(),a("ngIf",e.filterIconTemplate||e._filterIconTemplate)}}function Xn(t,l){if(t&1&&d(0,Jn,6,14,"p-iconfield",15),t&2){let e=s();a("ngIf",e.filter)}}function Zn(t,l){if(t&1&&N(0,"p-treeNode",25,3),t&2){let e=l.$implicit,i=l.first,n=l.last,o=l.index,r=s(2).options,p=s(3);a("level",e.level)("rowNode",e)("node",e.node)("parentNode",e.parent)("firstChild",i)("lastChild",n)("index",p.getIndex(r,o))("itemSize",r.itemSize)("indentation",p.indentation)("loadingMode",p.loadingMode)("pt",p.pt)("unstyled",p.unstyled())}}function ei(t,l){if(t&1&&(g(0,"ul",23,2),d(2,Zn,2,12,"p-treeNode",24),h()),t&2){let e=s(),i=e.$implicit,n=e.options,o=s(3);G(n.contentStyle),u(o.cx("rootChildren")),a("ngClass",n.contentStyleClass)("pBind",o.ptm("rootChildren")),C("aria-label",o.ariaLabel)("aria-labelledby",o.ariaLabelledBy),c(2),a("ngForOf",i)("ngForTrackBy",o.trackBy)}}function ti(t,l){if(t&1&&d(0,ei,3,10,"ul",22),t&2){let e=l.$implicit;a("ngIf",e)}}function ni(t,l){t&1&&S(0)}function ii(t,l){if(t&1&&d(0,ni,1,0,"ng-container",14),t&2){let e=l.options,i=s(4);a("ngTemplateOutlet",i.loaderTemplate||i._loaderTemplate)("ngTemplateOutletContext",B(2,Ln,e))}}function oi(t,l){t&1&&(I(0),d(1,ii,1,4,"ng-template",null,4,E),w())}function li(t,l){if(t&1){let e=k();g(0,"p-scroller",21,1),v("onScroll",function(n){_(e);let o=s(2);return y(o.onScroll.emit(n))})("onScrollIndexChange",function(n){_(e);let o=s(2);return y(o.onScrollIndexChange.emit(n))})("onLazyLoad",function(n){_(e);let o=s(2);return y(o.onLazyLoad.emit(n))}),d(2,ti,1,1,"ng-template",null,2,E)(4,oi,3,0,"ng-container",10),h()}if(t&2){let e=s(2);G(B(12,Rt,e.scrollHeight!=="flex"?e.scrollHeight:void 0)),a("items",e.serializedValue)("tabindex",-1)("styleClass",e.cx("wrapper"))("scrollHeight",e.scrollHeight!=="flex"?void 0:"100%")("itemSize",e.virtualScrollItemSize)("lazy",e.lazy)("options",e.virtualScrollOptions)("pt",e.ptm("virtualScroller")),C("data-p",e.wrapperDataP),c(4),a("ngIf",e.loaderTemplate||e._loaderTemplate)}}function ri(t,l){if(t&1&&N(0,"p-treeNode",29),t&2){let e=l.$implicit,i=l.first,n=l.last,o=l.index,r=s(4);a("node",e)("firstChild",i)("lastChild",n)("index",o)("level",0)("loadingMode",r.loadingMode)("pt",r.pt)("unstyled",r.unstyled())}}function ai(t,l){if(t&1&&(g(0,"ul",27,2),d(2,ri,1,8,"p-treeNode",28),h()),t&2){let e=s(3);u(e.cx("rootChildren")),a("pBind",e.ptm("rootChildren")),C("aria-label",e.ariaLabel)("aria-labelledby",e.ariaLabelledBy),c(2),a("ngForOf",e.getRootNode())("ngForTrackBy",e.trackBy.bind(e))}}function si(t,l){if(t&1&&(I(0),g(1,"div",11,5),d(3,ai,3,7,"ul",26),h(),w()),t&2){let e=s(2);c(),u(e.cx("wrapper")),Be("max-height",e.scrollHeight),a("pBind",e.ptm("wrapper")),C("data-p",e.wrapperDataP),c(2),a("ngIf",e.getRootNode())}}function ci(t,l){if(t&1&&(I(0),d(1,li,5,14,"p-scroller",20)(2,si,4,7,"ng-container",10),w()),t&2){let e=s();c(),a("ngIf",e.virtualScroll),c(),a("ngIf",!e.virtualScroll)}}function di(t,l){if(t&1&&(I(0),F(1),w()),t&2){let e=s(2);c(),Y(" ",e.emptyMessageLabel," ")}}function pi(t,l){}function ui(t,l){t&1&&d(0,pi,0,0,"ng-template",null,6,E)}function gi(t,l){if(t&1&&(g(0,"div",11),d(1,di,2,1,"ng-container",30)(2,ui,2,0,null,8),h()),t&2){let e=s();u(e.cx("emptyMessage")),a("pBind",e.ptm("emptyMessage")),c(),a("ngIf",!e.emptyTemplate&&!e._emptyTemplate)("ngIfElse",e.emptyFilter),c(),a("ngTemplateOutlet",e.emptyTemplate||e._emptyTemplate)}}function fi(t,l){t&1&&S(0)}var mi={root:({instance:t})=>["p-tree p-component",{"p-tree-selectable":t.selectionMode!=null,"p-tree-loading":t.loading,"p-tree-flex-scrollable":t.scrollHeight==="flex","p-tree-node-dragover":t.dragHover}],mask:"p-tree-mask p-overlay-mask",loadingIcon:"p-tree-loading-icon",pcFilterInput:"p-tree-filter-input",wrapper:"p-tree-root",rootChildren:"p-tree-root-children",node:({instance:t})=>({"p-tree-node":!0,"p-tree-node-leaf":t.isLeaf()}),nodeContent:({instance:t})=>({"p-tree-node-content":!0,"p-tree-node-selectable":t.selectable,"p-tree-node-dragover":t.isNodeDropActive(),"p-tree-node-selected":t.selectionMode==="checkbox"&&t.tree.highlightOnSelect?t.checked:t.selected,"p-tree-node-contextmenu-selected":t.isContextMenuSelected()}),nodeToggleButton:"p-tree-node-toggle-button",nodeToggleIcon:"p-tree-node-toggle-icon",nodeCheckbox:"p-tree-node-checkbox",nodeIcon:"p-tree-node-icon",nodeLabel:"p-tree-node-label",nodeChildren:"p-tree-node-children",emptyMessage:"p-tree-empty-message",dropPoint:"p-tree-node-drop-point"},we=(()=>{class t extends Se{name="tree";style=Bt;classes=mi;static \u0275fac=(()=>{let e;return function(n){return(e||(e=K(t)))(n||t)}})();static \u0275prov=j({token:t,factory:t.\u0275fac})}return t})();var At=new te("TREE_INSTANCE"),Pt=new te("TREENODE_INSTANCE"),hi=(()=>{class t extends ze{$pcTreeNode=M(Pt,{optional:!0,skipSelf:!0})??void 0;static ICON_CLASS="p-tree-node-icon ";rowNode;node;parentNode;root;index;firstChild;lastChild;level;indentation;itemSize;loadingMode;tree=M(pe(()=>Ee));timeout;isPrevDropPointHovered=ge(!1);isNextDropPointHovered=ge(!1);isNodeDropHovered=ge(!1);isPrevDropPointActive=O(()=>this.isPrevDropPointHovered()&&this.isDroppable());isNextDropPointActive=O(()=>this.isNextDropPointHovered()&&this.isDroppable());isNodeDropActive=O(()=>this.isNodeDropHovered()&&this.isNodeDroppable());dropPosition=O(()=>this.isPrevDropPointActive()?-1:this.isNextDropPointActive()?1:0);_componentStyle=M(we);_selected=O(()=>(this.tree.selection(),this.tree.isSelected(this.node)));_contextMenuSelected=O(()=>{let e=this.tree.contextMenuSelection();return!e||!this.node?!1:e===this.node||e.key&&e.key===this.node.key});get selected(){return this.tree.selectionMode==="single"||this.tree.selectionMode==="multiple"?this._selected():void 0}get checked(){return this.tree.selectionMode==="checkbox"?this._selected():void 0}get nodeClass(){return this.tree._componentStyle.classes.node({instance:this})}get selectable(){return this.node?.selectable===!1?!1:this.tree?.selectionMode!=null}get subNodes(){return this.node?.parent?this.node.parent.children:this.tree.value}getPTOptions(e){return this.ptm(e,{context:{node:this.node,index:this.index,expanded:this.node?.expanded,selected:this.selected,checked:this.checked,partialChecked:this.node?.partialSelected,leaf:this.isLeaf()}})}onInit(){this.node.parent=this.parentNode;let i=this.tree.el.nativeElement.closest("p-dialog");this.parentNode&&!i&&(this.setAllNodesTabIndexes(),this.tree.syncNodeOption(this.node,this.tree.value,"parent",this.tree.getNodeWithKey(this.parentNode.key,this.tree.value)))}getIcon(){let e;return this.node.icon?e=this.node.icon:e=this.node.expanded&&this.node.children&&this.node.children?.length?this.node.expandedIcon:this.node.collapsedIcon,t.ICON_CLASS+" "+e+" p-tree-node-icon"}isLeaf(){return this.tree.isNodeLeaf(this.node)}isSelected(){return this._selected()}isContextMenuSelected(){return this._contextMenuSelected()}isSameNode(e){return e.currentTarget&&(e.currentTarget.isSameNode(e.target)||e.currentTarget.isSameNode(e.target.closest('[role="treeitem"]')))}isDraggable(){return this.tree.draggableNodes}isDroppable(){return this.tree.droppableNodes&&this.tree.allowDrop(this.tree.dragNode,this.node,this.tree.dragNodeScope)}isNodeDroppable(){return this.node?.droppable!==!1&&this.isDroppable()}isNodeDraggable(){return this.node?.draggable!==!1&&this.isDraggable()}toggle(e){this.node.expanded?this.collapse(e):this.expand(e),e.stopPropagation()}expand(e){this.node.expanded=!0,this.tree.virtualScroll&&(this.tree.updateSerializedValue(),this.focusVirtualNode()),this.tree.onNodeExpand.emit({originalEvent:e,node:this.node})}collapse(e){this.node.expanded=!1,this.tree.virtualScroll&&this.tree.updateSerializedValue(),this.tree.onNodeCollapse.emit({originalEvent:e,node:this.node}),this.focusVirtualNode()}onNodeClick(e){this.tree.onNodeClick(e,this.node)}onNodeKeydown(e){e.key==="Enter"&&this.tree.onNodeClick(e,this.node)}onNodeTouchEnd(){this.tree.onNodeTouchEnd()}onNodeRightClick(e){this.tree.onNodeRightClick(e,this.node)}onNodeDblClick(e){this.tree.onNodeDblClick(e,this.node)}insertNodeOnDrop(){let{dragNode:e,dragNodeIndex:i,dragNodeSubNodes:n}=this.tree;if(!this.node||i==null||!e||!n)return;let o=this.dropPosition(),r=this.subNodes||[],p=this.index||0,T=n===r?i>p?p:p-1:p;n.splice(i,1),o<0?r.splice(T,0,e):o>0?r.splice(T+1,0,e):(this.node.children=this.node.children||[],this.node.children.push(e)),this.tree.dragDropService.stopDrag({node:e,subNodes:r,index:i})}onNodeDrop(e){if(e.preventDefault(),e.stopPropagation(),this.isDroppable()){let{dragNode:i}=this.tree,n=this.dropPosition();(n!==0||n===0&&this.isNodeDroppable())&&(this.tree.validateDrop?this.tree.onNodeDrop.emit({originalEvent:e,dragNode:i,dropNode:this.node,index:this.index,accept:()=>{this.insertNodeOnDrop()}}):(this.insertNodeOnDrop(),this.tree.onNodeDrop.emit({originalEvent:e,dragNode:i,dropNode:this.node,index:this.index})))}this.isPrevDropPointHovered.set(!1),this.isNextDropPointHovered.set(!1),this.isNodeDropHovered.set(!1)}onNodeDragStart(e){if(this.isNodeDraggable()){e.dataTransfer.effectAllowed="all",e.dataTransfer?.setData("text","data");let i=e.currentTarget,n=i.cloneNode(!0),o=n.querySelector('[data-pc-section="nodetogglebutton"]'),r=n.querySelector('[data-pc-name="pcnodecheckbox"]');i.setAttribute("data-p-dragging","true"),n.style.width=rt(i)+"px",n.style.height=dt(i)+"px",n.setAttribute("data-pc-section","drag-image"),o.style.visibility="hidden",r?.remove(),document.body.appendChild(n),e.dataTransfer?.setDragImage(n,0,0),setTimeout(()=>document.body.removeChild(n),0),this.tree.dragDropService.startDrag({tree:this,node:this.node,subNodes:this.subNodes,index:this.index,scope:this.tree.draggableScope})}else e.preventDefault()}onNodeDragOver(e){if(this.isDroppable()){e.dataTransfer.dropEffect="copy";let n=e.currentTarget.getBoundingClientRect(),o=e.clientY-parseInt(n.top);this.isPrevDropPointHovered.set(!1),this.isNextDropPointHovered.set(!1),this.isNodeDropHovered.set(!1),o<n.height*.25?this.isPrevDropPointHovered.set(!0):o>n.height*.75?this.isNextDropPointHovered.set(!0):this.isNodeDroppable()&&this.isNodeDropHovered.set(!0)}else e.dataTransfer.dropEffect="none";this.tree.droppableNodes&&(e.preventDefault(),e.stopPropagation())}onNodeDragLeave(){this.isPrevDropPointHovered.set(!1),this.isNextDropPointHovered.set(!1),this.isNodeDropHovered.set(!1)}onNodeDragEnd(e){e.currentTarget?.removeAttribute("data-p-dragging"),this.tree.dragDropService.stopDrag({node:this.node,subNodes:this.subNodes,index:this.index})}onKeyDown(e){if(!(!this.isSameNode(e)||this.tree.contextMenu&&this.tree.contextMenu.containerViewChild?.nativeElement.style.display==="block"))switch(e.code){case"ArrowDown":this.onArrowDown(e);break;case"ArrowUp":this.onArrowUp(e);break;case"ArrowRight":this.onArrowRight(e);break;case"ArrowLeft":this.onArrowLeft(e);break;case"Enter":case"Space":case"NumpadEnter":this.onEnter(e);break;case"Tab":this.setAllNodesTabIndexes();break;default:break}}onArrowUp(e){let i=e.target.getAttribute("data-pc-section")==="nodetogglebutton"?e.target.closest('[role="treeitem"]'):e.target.parentElement;if(i?.previousElementSibling)this.focusRowChange(i,i.previousElementSibling,this.findLastVisibleDescendant(i.previousElementSibling));else{let n=this.getParentNodeElement(i);n&&this.focusRowChange(i,n)}e.preventDefault()}onArrowDown(e){let i=e.target.getAttribute("data-pc-section")==="nodetogglebutton"?e.target.closest('[role="treeitem"]'):e.target,n=i?.children[1];if(n&&n.children.length>0)this.focusRowChange(i,n.children[0]);else if(i?.parentElement?.nextElementSibling)this.focusRowChange(i,i.parentElement.nextElementSibling);else{let o=this.findNextSiblingOfAncestor(i?.parentElement);o&&this.focusRowChange(i,o)}e.preventDefault()}onArrowRight(e){!this.node?.expanded&&!this.tree.isNodeLeaf(this.node)&&(this.expand(e),e.currentTarget.tabIndex=-1,setTimeout(()=>{this.onArrowDown(e)},1)),e.preventDefault()}onArrowLeft(e){let i=e.target.getAttribute("data-pc-section")==="nodetogglebutton"?e.target.closest('[role="treeitem"]'):e.target;if(this.level===0&&!this.node?.expanded)return!1;if(this.node?.expanded){this.collapse(e);return}let n=this.getParentNodeElement(i?.parentElement);n&&this.focusRowChange(e.currentTarget,n),e.preventDefault()}onEnter(e){this.tree.onNodeClick(e,this.node),this.setTabIndexForSelectionMode(e,this.tree.nodeTouched),e.preventDefault()}setAllNodesTabIndexes(){let e=Pe(this.tree.el.nativeElement,'[data-pc-section="node"]'),i=[...e].some(n=>n.getAttribute("aria-selected")==="true"||n.getAttribute("aria-checked")==="true");if([...e].forEach(n=>{n.tabIndex=-1}),i){let n=[...e].filter(o=>o.getAttribute("aria-selected")==="true"||o.getAttribute("aria-checked")==="true");n[0].tabIndex=0;return}e.length&&([...e][0].tabIndex=0)}setTabIndexForSelectionMode(e,i){if(this.tree.selectionMode!==null){let n=[...Pe(this.tree.el.nativeElement,'[role="treeitem"]')];e.currentTarget.tabIndex=i===!1?-1:0,n.every(o=>o.tabIndex===-1)&&(n[0].tabIndex=0)}}findNextSiblingOfAncestor(e){let i=this.getParentNodeElement(e);return i?i.nextElementSibling?i.nextElementSibling:this.findNextSiblingOfAncestor(i):null}findLastVisibleDescendant(e){let n=Array.from(e.children).find(o=>o.getAttribute("data-pc-section")==="node")?.children[1];if(n&&n.children.length>0){let o=n.children[n.children.length-1];return this.findLastVisibleDescendant(o)}else return e}getParentNodeElement(e){let i=e.parentElement?.parentElement?.parentElement;return i?.tagName==="P-TREENODE"?i:null}focusNode(e){e.children[0].focus()}focusRowChange(e,i,n){e.tabIndex="-1",i.children[0].tabIndex="0",this.focusNode(n||i)}focusVirtualNode(){this.timeout=setTimeout(()=>{let e=at(this.tree?.contentViewChild?.nativeElement,`[data-id="${this.node?.key??this.node?.data}"]`);X(e)},1)}static \u0275fac=(()=>{let e;return function(n){return(e||(e=K(t)))(n||t)}})();static \u0275cmp=H({type:t,selectors:[["p-treeNode"]],inputs:{rowNode:"rowNode",node:"node",parentNode:"parentNode",root:[2,"root","root",b],index:[2,"index","index",$],firstChild:[2,"firstChild","firstChild",b],lastChild:[2,"lastChild","lastChild",b],level:[2,"level","level",$],indentation:[2,"indentation","indentation",$],itemSize:[2,"itemSize","itemSize",$],loadingMode:"loadingMode"},features:[oe([we,{provide:Pt,useExisting:t},{provide:ce,useExisting:t}]),ie],decls:1,vars:1,consts:[["icon",""],["role","treeitem",3,"class","ngStyle","style","pBind"],["role","treeitem",3,"keydown","ngStyle","pBind"],[3,"class","pBind"],[3,"click","contextmenu","dblclick","touchend","drop","dragstart","dragover","dragleave","dragend","draggable","pBind"],["type","button","pRipple","","tabindex","-1",3,"click","pBind"],[4,"ngIf"],[3,"class","pBind",4,"ngIf"],[3,"ngModel","styleClass","binary","indeterminate","disabled","variant","tabindex","pt","unstyled","click",4,"ngIf"],[3,"pBind"],["role","group",3,"class","pBind",4,"ngIf"],["data-p-icon","chevron-right",3,"class","pBind",4,"ngIf"],["data-p-icon","chevron-down",3,"class","pBind",4,"ngIf"],["data-p-icon","chevron-right",3,"pBind"],["data-p-icon","chevron-down",3,"pBind"],["data-p-icon","spinner","spin","",3,"pBind"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"click","ngModel","styleClass","binary","indeterminate","disabled","variant","tabindex","pt","unstyled"],["role","group",3,"pBind"],[3,"node","parentNode","firstChild","lastChild","index","itemSize","level","loadingMode","pt","unstyled",4,"ngFor","ngForOf","ngForTrackBy"],[3,"node","parentNode","firstChild","lastChild","index","itemSize","level","loadingMode","pt","unstyled"]],template:function(i,n){i&1&&R(0,Cn,13,38,"li",1),i&2&&z(n.node?0:-1)},dependencies:[t,Q,le,re,q,Te,kt,vt,ae,xe,ve,Ct,Ie,Ue,L,_t,D],encapsulation:2,changeDetection:0})}return t})(),Ee=(()=>{class t extends ze{dragDropService;componentName="Tree";bindDirectiveInstance=M(D,{self:!0});$pcTree=M(At,{optional:!0,skipSelf:!0})??void 0;onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}value;selectionMode;loadingMode="mask";selection=Ae(null);styleClass;contextMenu;contextMenuSelectionMode="joint";contextMenuSelection=Ae(null);draggableScope;droppableScope;draggableNodes;droppableNodes;metaKeySelection=!1;propagateSelectionUp=!0;propagateSelectionDown=!0;loading;loadingIcon;emptyMessage="";ariaLabel;togglerAriaLabel;ariaLabelledBy;validateDrop;filter;filterInputAutoFocus=!1;filterBy="label";filterMode="lenient";filterOptions;filterPlaceholder;filteredNodes;filterLocale;scrollHeight;lazy=!1;virtualScroll;virtualScrollItemSize;virtualScrollOptions;indentation=1.5;_templateMap;trackBy=(e,i)=>i;highlightOnSelect=!1;onNodeSelect=new x;onNodeUnselect=new x;onNodeExpand=new x;onNodeCollapse=new x;onNodeContextMenuSelect=new x;onNodeDoubleClick=new x;onNodeDrop=new x;onLazyLoad=new x;onScroll=new x;onScrollIndexChange=new x;onFilter=new x;filterTemplate;nodeTemplate;headerTemplate;footerTemplate;loaderTemplate;emptyTemplate;togglerIconTemplate;checkboxIconTemplate;loadingIconTemplate;filterIconTemplate;filterViewChild;scroller;wrapperViewChild;contentViewChild;templates;_headerTemplate;_emptyTemplate;_footerTemplate;_loaderTemplate;_togglerIconTemplate;_checkboxIconTemplate;_loadingIconTemplate;_filterIconTemplate;_filterTemplate;onAfterContentInit(){this.templates.length&&(this._templateMap={}),this.templates.forEach(e=>{switch(e.getType()){case"header":this._headerTemplate=e.template;break;case"empty":this._emptyTemplate=e.template;break;case"footer":this._footerTemplate=e.template;break;case"loader":this._loaderTemplate=e.template;break;case"togglericon":this._togglerIconTemplate=e.template;break;case"checkboxicon":this._checkboxIconTemplate=e.template;break;case"loadingicon":this._loadingIconTemplate=e.template;break;case"filtericon":this._filterIconTemplate=e.template;break;case"filter":this._filterTemplate=e.template;break;default:this._templateMap[e.name]=e.template;break}})}serializedValue;nodeTouched;dragNodeTree;dragNode;dragNodeSubNodes;dragNodeIndex;dragNodeScope;dragHover;dragStartSubscription;dragStopSubscription;_componentStyle=M(we);handleDropEvent(e){this.onDrop(e)}handleDragOverEvent(e){this.onDragOver(e)}handleDragEnterEvent(){this.onDragEnter()}handleDragLeaveEvent(e){this.onDragLeave(e)}constructor(e){super(),this.dragDropService=e}onInit(){this.filterBy&&(this.filterOptions={filter:e=>this._filter(e),reset:()=>this.resetFilter()}),this.droppableNodes&&(this.dragStartSubscription=this.dragDropService.dragStart$.subscribe(e=>{this.dragNodeTree=e.tree,this.dragNode=e.node,this.dragNodeSubNodes=e.subNodes,this.dragNodeIndex=e.index,this.dragNodeScope=e.scope}),this.dragStopSubscription=this.dragDropService.dragStop$.subscribe(e=>{this.dragNodeTree=null,this.dragNode=null,this.dragNodeSubNodes=null,this.dragNodeIndex=null,this.dragNodeScope=null,this.dragHover=!1}))}onChanges(e){e.value&&(this.updateSerializedValue(),this.hasFilterActive()&&this._filter(this.filterViewChild?.nativeElement?.value))}get emptyMessageLabel(){return this.emptyMessage||this.config.getTranslation(gt.EMPTY_MESSAGE)}updateSerializedValue(){this.serializedValue=[],this.serializeNodes(null,this.getRootNode(),0,!0)}serializeNodes(e,i,n,o){if(i&&i.length)for(let r of i){r.parent=e;let p={node:r,parent:e,level:n,visible:o&&(e?e.expanded:!0)};this.serializedValue.push(p),p.visible&&r.expanded&&this.serializeNodes(r,r.children,n+1,p.visible)}}onNodeClick(e,i){let o=e.target?.getAttribute?.("data-pc-section");if(!(o==="nodetogglebutton"||o==="nodetoggleicon")){if(this.selectionMode){if(i.selectable===!1){i.style="--p-focus-ring-color: none;";return}else i.style?.includes("--p-focus-ring-color")||(i.style=i.style?`${i.style}--p-focus-ring-color: var(--primary-color)`:"--p-focus-ring-color: var(--primary-color)");if(this.hasFilteredNodes()&&(i=this.getNodeWithKey(i.key,this.filteredNodes),!i))return;let r=this.findIndexInSelection(i),p=r>=0,T=this.selection();if(this.isCheckboxSelectionMode())p?(this.propagateSelectionDown?this.propagateDown(i,!1):this.selection.set(T.filter((A,P)=>P!=r)),this.propagateSelectionUp&&i.parent&&this.propagateUp(i.parent,!1),this.onNodeUnselect.emit({originalEvent:e,node:i})):(this.propagateSelectionDown?this.propagateDown(i,!0):this.selection.set([...T||[],i]),this.propagateSelectionUp&&i.parent&&this.propagateUp(i.parent,!0),this.onNodeSelect.emit({originalEvent:e,node:i}));else if(this.nodeTouched?!1:this.metaKeySelection){let P=e.metaKey||e.ctrlKey;if(p&&P)this.isSingleSelectionMode()?this.selection.set(null):this.selection.set(T.filter((de,Wt)=>Wt!=r)),this.onNodeUnselect.emit({originalEvent:e,node:i});else{if(this.isSingleSelectionMode())this.selection.set(i);else if(this.isMultipleSelectionMode()){let de=P?T||[]:[];this.selection.set([...de,i])}this.onNodeSelect.emit({originalEvent:e,node:i})}}else this.isSingleSelectionMode()?p?(this.selection.set(null),this.onNodeUnselect.emit({originalEvent:e,node:i})):(this.selection.set(i),setTimeout(()=>{this.onNodeSelect.emit({originalEvent:e,node:i})})):p?(this.selection.set(T.filter((P,de)=>de!=r)),this.onNodeUnselect.emit({originalEvent:e,node:i})):(this.selection.set([...T||[],i]),setTimeout(()=>{this.onNodeSelect.emit({originalEvent:e,node:i})}))}this.nodeTouched=!1}}onNodeTouchEnd(){this.nodeTouched=!0}onNodeRightClick(e,i){if(this.contextMenu){let o=e.target.getAttribute("data-pc-section");if(o==="nodetogglebutton"||o==="nodetoggleicon")return;let p=this.findIndexInSelection(i)>=0,T=()=>{this.contextMenu.show(e),this.contextMenu.hideCallback=()=>{this.contextMenuSelection.set(null)},this.onNodeContextMenuSelect.emit({originalEvent:e,node:i})};this.contextMenuSelectionMode==="separate"?(this.contextMenuSelection.set(i),T()):this.contextMenuSelectionMode==="joint"&&(p||(this.isSingleSelectionMode()?this.selection.set(i):this.selection.set([i])),T())}}onNodeDblClick(e,i){this.onNodeDoubleClick.emit({originalEvent:e,node:i})}findIndexInSelection(e){let i=-1,n=this.selection();if(this.selectionMode&&n)if(this.isSingleSelectionMode()){let o=n;i=o.key&&o.key===e.key||o==e?0:-1}else{let o=n;for(let r=0;r<o.length;r++){let p=o[r];if(p.key&&p.key===e.key||p==e){i=r;break}}}return i}syncNodeOption(e,i,n,o){let r=this.hasFilteredNodes()?this.getNodeWithKey(e.key,i):null;r&&(r[n]=o||e[n])}hasFilteredNodes(){return this.filter&&this.filteredNodes&&this.filteredNodes.length}hasFilterActive(){return this.filter&&this.filterViewChild?.nativeElement?.value.length>0}getNodeWithKey(e,i){for(let n of i){if(n.key===e)return n;if(n.children){let o=this.getNodeWithKey(e,n.children);if(o)return o}}}propagateUp(e,i){if(e.children&&e.children.length){let o=0,r=!1;for(let T of e.children)this.isSelected(T)?o++:T.partialSelected&&(r=!0);let p=this.selection()||[];if(i&&o==e.children.length)this.selection.set([...p,e]),e.partialSelected=!1;else{if(!i){let T=this.findIndexInSelection(e);T>=0&&this.selection.set(p.filter((A,P)=>P!=T))}r||o>0&&o!=e.children.length?e.partialSelected=!0:e.partialSelected=!1}this.syncNodeOption(e,this.filteredNodes,"partialSelected")}let n=e.parent;n&&this.propagateUp(n,i)}propagateDown(e,i){let n=this.findIndexInSelection(e),o=this.selection()||[];if(i&&n==-1?this.selection.set([...o,e]):!i&&n>-1&&this.selection.set(o.filter((r,p)=>p!=n)),e.partialSelected=!1,this.syncNodeOption(e,this.filteredNodes,"partialSelected"),e.children&&e.children.length)for(let r of e.children)this.propagateDown(r,i)}isSelected(e){return this.findIndexInSelection(e)!=-1}isSingleSelectionMode(){return this.selectionMode&&this.selectionMode=="single"}isMultipleSelectionMode(){return this.selectionMode&&this.selectionMode=="multiple"}isCheckboxSelectionMode(){return this.selectionMode&&this.selectionMode=="checkbox"}isNodeLeaf(e){return e.leaf==!1?!1:!(e.children&&e.children.length)}getRootNode(){return this.filteredNodes?this.filteredNodes:this.value}getTemplateForNode(e){return this._templateMap?e.type?this._templateMap[e.type]:this._templateMap.default:null}onDragOver(e){this.droppableNodes&&this.allowDrop(this.dragNode,null,this.dragNodeScope)&&(e.dataTransfer.dropEffect="copy",e.preventDefault())}onDrop(e){if(this.droppableNodes){e.preventDefault();let i=this.dragNode;if(this.isSameTreeScope(this.dragNodeScope))return;if(this.allowDrop(i,null,this.dragNodeScope)){let n=this.dragNodeIndex;this.value=this.value||[],this.validateDrop?this.onNodeDrop.emit({originalEvent:e,dragNode:i,dropNode:null,index:n,accept:()=>{this.processTreeDrop(i,n)}}):(this.onNodeDrop.emit({originalEvent:e,dragNode:i,dropNode:null,index:n}),this.processTreeDrop(i,n))}}}processTreeDrop(e,i){this.dragNodeSubNodes.splice(i,1),this.value.push(e),this.dragDropService.stopDrag({node:e})}onDragEnter(){this.droppableNodes&&this.allowDrop(this.dragNode,null,this.dragNodeScope)&&(this.dragHover=!0)}onDragLeave(e){if(this.droppableNodes){let i=e.currentTarget.getBoundingClientRect();(e.x>parseInt(i.left)+i.width||e.x<parseInt(i.left)||e.y>parseInt(i.top)+i.height||e.y<parseInt(i.top))&&(this.dragHover=!1)}}allowDrop(e,i,n){if(e)if(this.isValidDragScope(n)){let o=!0;if(i)if(e===i)o=!1;else{let r=i.parent;for(;r!=null;){if(r===e){o=!1;break}r=r.parent}}return o}else return!1;else return!1}hasCommonScope(e,i){if(typeof i=="string"){if(typeof e=="string")return i===e;if(Array.isArray(e))return e.indexOf(i)!=-1}else if(Array.isArray(i)){if(typeof e=="string")return i.indexOf(e)!=-1;if(Array.isArray(e)){for(let n of i)for(let o of e)if(n===o)return!0}}return!1}isSameTreeScope(e){return this.hasCommonScope(e,this.draggableScope)}isValidDragScope(e){let i=this.droppableScope;return i?this.hasCommonScope(e,i):!0}_filter(e){let i=e;if(i==="")this.filteredNodes=null;else{this.filteredNodes=[];let n=this.filterBy.split(","),o=Re(i).toLocaleLowerCase(this.filterLocale),r=this.filterMode==="strict";for(let p of this.value){let T=ee({},p),A={searchFields:n,filterText:o,isStrictMode:r};(r&&(this.findFilteredNodes(T,A)||this.isFilterMatched(T,A))||!r&&(this.isFilterMatched(T,A)||this.findFilteredNodes(T,A)))&&this.filteredNodes.push(T)}}this.updateSerializedValue(),this.onFilter.emit({filter:i,filteredValue:this.filteredNodes})}resetFilter(){this.filteredNodes=null,this.filterViewChild&&this.filterViewChild.nativeElement&&(this.filterViewChild.nativeElement.value="")}scrollToVirtualIndex(e){this.virtualScroll&&this.scroller?.scrollToIndex(e)}scrollTo(e){this.virtualScroll?this.scroller?.scrollTo(e):this.wrapperViewChild&&this.wrapperViewChild.nativeElement&&(this.wrapperViewChild.nativeElement.scrollTo?this.wrapperViewChild.nativeElement.scrollTo(e):(this.wrapperViewChild.nativeElement.scrollLeft=e.left,this.wrapperViewChild.nativeElement.scrollTop=e.top))}findFilteredNodes(e,i){if(e){let n=!1;if(e.children){let o=[...e.children];e.children=[];for(let r of o){let p=ee({},r);this.isFilterMatched(p,i)&&(n=!0,e.children.push(p))}}if(n)return e.expanded=!0,!0}}isFilterMatched(e,i){let{searchFields:n,filterText:o,isStrictMode:r}=i,p=!1;for(let T of n)Re(String(pt(e,T))).toLocaleLowerCase(this.filterLocale).indexOf(o)>-1&&(p=!0);return(!p||r&&!this.isNodeLeaf(e))&&(p=this.findFilteredNodes(e,{searchFields:n,filterText:o,isStrictMode:r})||p),p}getIndex(e,i){let n=e.getItemOptions;return n?n(i).index:i}getBlockableElement(){return this.el.nativeElement.children[0]}onDestroy(){this.dragStartSubscription&&this.dragStartSubscription.unsubscribe(),this.dragStopSubscription&&this.dragStopSubscription.unsubscribe()}get containerDataP(){return this.cn({loading:this.loading,scrollable:this.scrollHeight==="flex"})}get wrapperDataP(){return this.cn({scrollable:this.scrollHeight==="flex"})}static \u0275fac=function(i){return new(i||t)(ne(ft,8))};static \u0275cmp=H({type:t,selectors:[["p-tree"]],contentQueries:function(i,n,o){if(i&1&&he(o,Lt,4)(o,Sn,4)(o,Nn,4)(o,In,4)(o,wn,4)(o,En,4)(o,Mn,4)(o,kn,4)(o,Dn,4)(o,On,4)(o,Z,4),i&2){let r;f(r=m())&&(n.filterTemplate=r.first),f(r=m())&&(n.nodeTemplate=r.first),f(r=m())&&(n.headerTemplate=r.first),f(r=m())&&(n.footerTemplate=r.first),f(r=m())&&(n.loaderTemplate=r.first),f(r=m())&&(n.emptyTemplate=r.first),f(r=m())&&(n.togglerIconTemplate=r.first),f(r=m())&&(n.checkboxIconTemplate=r.first),f(r=m())&&(n.loadingIconTemplate=r.first),f(r=m())&&(n.filterIconTemplate=r.first),f(r=m())&&(n.templates=r)}},viewQuery:function(i,n){if(i&1&&_e(Lt,5)(Vn,5)(Fn,5)(Bn,5),i&2){let o;f(o=m())&&(n.filterViewChild=o.first),f(o=m())&&(n.scroller=o.first),f(o=m())&&(n.wrapperViewChild=o.first),f(o=m())&&(n.contentViewChild=o.first)}},hostVars:3,hostBindings:function(i,n){i&1&&v("drop",function(r){return n.handleDropEvent(r)})("dragover",function(r){return n.handleDragOverEvent(r)})("dragenter",function(){return n.handleDragEnterEvent()})("dragleave",function(r){return n.handleDragLeaveEvent(r)}),i&2&&(C("data-p",n.containerDataP),u(n.cn(n.cx("root"),n.styleClass)))},inputs:{value:"value",selectionMode:"selectionMode",loadingMode:"loadingMode",selection:[1,"selection"],styleClass:"styleClass",contextMenu:"contextMenu",contextMenuSelectionMode:"contextMenuSelectionMode",contextMenuSelection:[1,"contextMenuSelection"],draggableScope:"draggableScope",droppableScope:"droppableScope",draggableNodes:[2,"draggableNodes","draggableNodes",b],droppableNodes:[2,"droppableNodes","droppableNodes",b],metaKeySelection:[2,"metaKeySelection","metaKeySelection",b],propagateSelectionUp:[2,"propagateSelectionUp","propagateSelectionUp",b],propagateSelectionDown:[2,"propagateSelectionDown","propagateSelectionDown",b],loading:[2,"loading","loading",b],loadingIcon:"loadingIcon",emptyMessage:"emptyMessage",ariaLabel:"ariaLabel",togglerAriaLabel:"togglerAriaLabel",ariaLabelledBy:"ariaLabelledBy",validateDrop:[2,"validateDrop","validateDrop",b],filter:[2,"filter","filter",b],filterInputAutoFocus:[2,"filterInputAutoFocus","filterInputAutoFocus",b],filterBy:"filterBy",filterMode:"filterMode",filterOptions:"filterOptions",filterPlaceholder:"filterPlaceholder",filteredNodes:"filteredNodes",filterLocale:"filterLocale",scrollHeight:"scrollHeight",lazy:[2,"lazy","lazy",b],virtualScroll:[2,"virtualScroll","virtualScroll",b],virtualScrollItemSize:[2,"virtualScrollItemSize","virtualScrollItemSize",$],virtualScrollOptions:"virtualScrollOptions",indentation:[2,"indentation","indentation",$],_templateMap:"_templateMap",trackBy:"trackBy",highlightOnSelect:[2,"highlightOnSelect","highlightOnSelect",b]},outputs:{selection:"selectionChange",contextMenuSelection:"contextMenuSelectionChange",onNodeSelect:"onNodeSelect",onNodeUnselect:"onNodeUnselect",onNodeExpand:"onNodeExpand",onNodeCollapse:"onNodeCollapse",onNodeContextMenuSelect:"onNodeContextMenuSelect",onNodeDoubleClick:"onNodeDoubleClick",onNodeDrop:"onNodeDrop",onLazyLoad:"onLazyLoad",onScroll:"onScroll",onScrollIndexChange:"onScrollIndexChange",onFilter:"onFilter"},features:[oe([we,{provide:At,useExisting:t},{provide:ce,useExisting:t}]),me([D]),ie],decls:7,vars:6,consts:[["filter",""],["scroller",""],["content",""],["treeNode",""],["loader",""],["wrapper",""],["emptyFilter",""],[3,"class","pBind",4,"ngIf"],[4,"ngTemplateOutlet"],[3,"class","pt","unstyled"],[4,"ngIf"],[3,"pBind"],["data-p-icon","spinner","spin","",3,"class","pBind",4,"ngIf"],["data-p-icon","spinner","spin","",3,"pBind"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"class","pt","unstyled",4,"ngIf"],[3,"pt","unstyled"],["pInputText","","type","search","autocomplete","off",3,"keydown.enter","input","pAutoFocus","pt","unstyled"],["data-p-icon","search",3,"class","pBind",4,"ngIf"],["data-p-icon","search",3,"pBind"],["hostName","tree",3,"items","tabindex","styleClass","style","scrollHeight","itemSize","lazy","options","pt","onScroll","onScrollIndexChange","onLazyLoad",4,"ngIf"],["hostName","tree",3,"onScroll","onScrollIndexChange","onLazyLoad","items","tabindex","styleClass","scrollHeight","itemSize","lazy","options","pt"],["role","tree",3,"class","ngClass","style","pBind",4,"ngIf"],["role","tree",3,"ngClass","pBind"],[3,"level","rowNode","node","parentNode","firstChild","lastChild","index","itemSize","indentation","loadingMode","pt","unstyled",4,"ngFor","ngForOf","ngForTrackBy"],[3,"level","rowNode","node","parentNode","firstChild","lastChild","index","itemSize","indentation","loadingMode","pt","unstyled"],["role","tree",3,"class","pBind",4,"ngIf"],["role","tree",3,"pBind"],[3,"node","firstChild","lastChild","index","level","loadingMode","pt","unstyled",4,"ngFor","ngForOf","ngForTrackBy"],[3,"node","firstChild","lastChild","index","level","loadingMode","pt","unstyled"],[4,"ngIf","ngIfElse"]],template:function(i,n){if(i&1&&(d(0,$n,3,5,"div",7)(1,qn,1,0,"ng-container",8),R(2,jn,1,4,"ng-container")(3,Xn,1,1,"p-iconfield",9),d(4,ci,3,2,"ng-container",10)(5,gi,3,6,"div",7)(6,fi,1,0,"ng-container",8)),i&2){let o;a("ngIf",n.loading&&n.loadingMode==="mask"),c(),a("ngTemplateOutlet",n.headerTemplate||n._headerTemplate),c(),z(n.filterTemplate||n._filterTemplate?2:3),c(2),a("ngIf",(o=n.getRootNode())==null?null:o.length),c(),a("ngIf",!n.loading&&(n.getRootNode()==null||n.getRootNode().length===0)),c(),a("ngTemplateOutlet",n.footerTemplate||n._footerTemplate)}},dependencies:[Q,nt,le,re,q,Dt,L,St,Ue,Tt,ae,Et,Mt,hi,mt,Ne,D],encapsulation:2,changeDetection:0})}return t})(),pl=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=fe({type:t});static \u0275inj=ue({imports:[Ee,L,L]})}return t})();var Ut=`
    .p-treeselect {
        display: inline-flex;
        cursor: pointer;
        position: relative;
        user-select: none;
        background: dt('treeselect.background');
        border: 1px solid dt('treeselect.border.color');
        transition:
            background dt('treeselect.transition.duration'),
            color dt('treeselect.transition.duration'),
            border-color dt('treeselect.transition.duration'),
            outline-color dt('treeselect.transition.duration'),
            box-shadow dt('treeselect.transition.duration');
        border-radius: dt('treeselect.border.radius');
        outline-color: transparent;
        box-shadow: dt('treeselect.shadow');
    }

    .p-treeselect:not(.p-disabled):hover {
        border-color: dt('treeselect.hover.border.color');
    }

    .p-treeselect:not(.p-disabled).p-focus {
        border-color: dt('treeselect.focus.border.color');
        box-shadow: dt('treeselect.focus.ring.shadow');
        outline: dt('treeselect.focus.ring.width') dt('treeselect.focus.ring.style') dt('treeselect.focus.ring.color');
        outline-offset: dt('treeselect.focus.ring.offset');
    }

    .p-treeselect.p-variant-filled {
        background: dt('treeselect.filled.background');
    }

    .p-treeselect.p-variant-filled:not(.p-disabled):hover {
        background: dt('treeselect.filled.hover.background');
    }

    .p-treeselect.p-variant-filled.p-focus {
        background: dt('treeselect.filled.focus.background');
    }

    .p-treeselect.p-invalid {
        border-color: dt('treeselect.invalid.border.color');
    }

    .p-treeselect.p-disabled {
        opacity: 1;
        background: dt('treeselect.disabled.background');
    }

    .p-treeselect-clear-icon {
        align-self: center;
        color: dt('treeselect.clear.icon.color');
        inset-inline-end: dt('treeselect.dropdown.width');
    }

    .p-treeselect-dropdown {
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        background: transparent;
        color: dt('treeselect.dropdown.color');
        width: dt('treeselect.dropdown.width');
        border-start-end-radius: dt('border.radius.md');
        border-end-end-radius: dt('border.radius.md');
    }

    .p-treeselect-label-container {
        overflow: hidden;
        flex: 1 1 auto;
        cursor: pointer;
    }

    .p-treeselect-label {
        display: flex;
        align-items: center;
        gap: calc(dt('treeselect.padding.y') / 2);
        white-space: nowrap;
        cursor: pointer;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: dt('treeselect.padding.y') dt('treeselect.padding.x');
        color: dt('treeselect.color');
    }

    .p-treeselect-label.p-placeholder {
        color: dt('treeselect.placeholder.color');
    }

    .p-treeselect.p-invalid .p-treeselect-label.p-placeholder {
        color: dt('treeselect.invalid.placeholder.color');
    }

    .p-treeselect:has(.p-select-clear-icon) .p-treeselect-label {
        padding-inline-end: dt('treeselect.padding.x');
    }

    .p-treeselect.p-disabled .p-treeselect-label {
        color: dt('treeselect.disabled.color');
    }

    .p-treeselect-label-empty {
        overflow: hidden;
        visibility: hidden;
    }

    .p-treeselect-overlay {
        position: absolute;
        top: 0;
        left: 0;
        background: dt('treeselect.overlay.background');
        color: dt('treeselect.overlay.color');
        border: 1px solid dt('treeselect.overlay.border.color');
        border-radius: dt('treeselect.overlay.border.radius');
        box-shadow: dt('treeselect.overlay.shadow');
        overflow: hidden;
        min-width: 100%;
        will-change: transform;
    }

    .p-treeselect-tree-container {
        overflow: auto;
    }

    .p-treeselect-empty-message {
        padding: dt('treeselect.empty.message.padding');
        background: transparent;
    }

    .p-treeselect-fluid {
        display: flex;
    }

    .p-treeselect-overlay .p-tree {
        padding: dt('treeselect.tree.padding');
    }

    .p-treeselect-overlay .p-tree-loading {
        min-height: 3rem;
    }

    .p-treeselect-label .p-chip {
        padding-block-start: calc(dt('treeselect.padding.y') / 2);
        padding-block-end: calc(dt('treeselect.padding.y') / 2);
        border-radius: dt('treeselect.chip.border.radius');
    }

    .p-treeselect-label:has(.p-chip) {
        padding: calc(dt('treeselect.padding.y') / 2) calc(dt('treeselect.padding.x') / 2);
    }

    .p-treeselect-sm .p-treeselect-label {
        font-size: dt('treeselect.sm.font.size');
        padding-block: dt('treeselect.sm.padding.y');
        padding-inline: dt('treeselect.sm.padding.x');
    }

    .p-treeselect-sm .p-treeselect-dropdown .p-icon {
        font-size: dt('treeselect.sm.font.size');
        width: dt('treeselect.sm.font.size');
        height: dt('treeselect.sm.font.size');
    }

    .p-treeselect-lg .p-treeselect-label {
        font-size: dt('treeselect.lg.font.size');
        padding-block: dt('treeselect.lg.padding.y');
        padding-inline: dt('treeselect.lg.padding.x');
    }

    .p-treeselect-lg .p-treeselect-dropdown .p-icon {
        font-size: dt('treeselect.lg.font.size');
        width: dt('treeselect.lg.font.size');
        height: dt('treeselect.lg.font.size');
    }
`;var _i=["value"],yi=["header"],Ti=["empty"],bi=["footer"],xi=["clearicon"],vi=["triggericon"],Ci=["dropdownicon"],Si=["filtericon"],Ni=["closeicon"],Ii=["itemtogglericon"],wi=["itemcheckboxicon"],Ei=["itemloadingicon"],Mi=["focusInput"],ki=["filter"],Di=["tree"],Oi=["panel"],Vi=["overlay"],Fi=["firstHiddenFocusableEl"],Bi=["lastHiddenFocusableEl"],Li=(t,l)=>({$implicit:t,placeholder:l}),$t=(t,l)=>({$implicit:t,options:l}),Ai=t=>({"max-height":t}),Pi=t=>({$implicit:t}),Hi=(t,l)=>({$implicit:t,partialSelected:l});function Ri(t,l){t&1&&S(0)}function zi(t,l){if(t&1&&(I(0),d(1,Ri,1,0,"ng-container",24),w()),t&2){let e=s();c(),a("ngTemplateOutlet",e.valueTemplate||e._valueTemplate)("ngTemplateOutletContext",U(2,Li,e.value,e.placeholder))}}function Ui(t,l){if(t&1&&(I(0),F(1),w()),t&2){let e=s(2);c(),Y(" ",e.label||"empty"," ")}}function $i(t,l){if(t&1&&(g(0,"div",16),N(1,"p-chip",26),h()),t&2){let e=l.$implicit,i=s(3);u(i.cx("chipItem")),a("pBind",i.ptm("chipItem")),c(),u(i.cx("pcChip")),a("unstyled",i.unstyled())("label",e.label)("pt",i.ptm("pcChip"))}}function qi(t,l){if(t&1&&(I(0),F(1),w()),t&2){let e=s(3);c(),ye(e.placeholder||"empty")}}function Qi(t,l){if(t&1&&d(0,$i,2,8,"div",25)(1,qi,2,1,"ng-container",19),t&2){let e=s(2);a("ngForOf",e.value),c(),a("ngIf",e.emptyValue)}}function ji(t,l){if(t&1&&d(0,Ui,2,1,"ng-container",18)(1,Qi,2,2,"ng-template",null,4,E),t&2){let e=W(2),i=s();a("ngIf",i.display==="comma")("ngIfElse",e)}}function Ki(t,l){if(t&1){let e=k();V(),g(0,"svg",29),v("click",function(n){_(e);let o=s(2);return y(o.clear(n))}),h()}if(t&2){let e=s(2);u(e.cx("clearIcon")),a("pBind",e.ptm("clearIcon"))}}function Wi(t,l){}function Gi(t,l){t&1&&d(0,Wi,0,0,"ng-template")}function Yi(t,l){if(t&1){let e=k();g(0,"span",30),v("click",function(n){_(e);let o=s(2);return y(o.clear(n))}),d(1,Gi,1,0,null,31),h()}if(t&2){let e=s(2);u(e.cx("clearIcon")),a("pBind",e.ptm("clearIcon")),c(),a("ngTemplateOutlet",e.clearIconTemplate||e._clearIconTemplate)}}function Ji(t,l){if(t&1&&(I(0),d(1,Ki,1,3,"svg",27)(2,Yi,2,4,"span",28),w()),t&2){let e=s();c(),a("ngIf",!e.clearIconTemplate&&!e._clearIconTemplate),c(),a("ngIf",e.clearIconTemplate||e.clearIconTemplate)}}function Xi(t,l){if(t&1&&(V(),N(0,"svg",32)),t&2){let e=s();u(e.cx("dropdownIcon")),a("pBind",e.ptm("dropdownIcon"))}}function Zi(t,l){}function eo(t,l){t&1&&d(0,Zi,0,0,"ng-template")}function to(t,l){if(t&1&&(g(0,"span",16),d(1,eo,1,0,null,31),h()),t&2){let e=s();u(e.cx("dropdownIcon")),a("pBind",e.ptm("dropdownIcon")),c(),a("ngTemplateOutlet",e.triggerIconTemplate||e._triggerIconTemplate||e.dropdownIconTemplate||e._dropdownIconTemplate)}}function no(t,l){t&1&&S(0)}function io(t,l){t&1&&S(0)}function oo(t,l){if(t&1&&d(0,io,1,0,"ng-container",31),t&2){let e=s(3);a("ngTemplateOutlet",e.emptyTemplate||e._emptyTemplate)}}function lo(t,l){t&1&&(I(0),d(1,oo,1,1,"ng-template",null,9,E),w())}function ro(t,l){t&1&&S(0)}function ao(t,l){if(t&1&&d(0,ro,1,0,"ng-container",24),t&2){let e=l.$implicit,i=s(3);a("ngTemplateOutlet",i.itemTogglerIconTemplate||i._itemTogglerIconTemplate)("ngTemplateOutletContext",B(2,Pi,e))}}function so(t,l){t&1&&d(0,ao,1,4,"ng-template",null,10,E)}function co(t,l){t&1&&S(0)}function po(t,l){if(t&1&&d(0,co,1,0,"ng-container",24),t&2){let e=l.$implicit,i=l.partialSelected,n=s(3);a("ngTemplateOutlet",n.itemCheckboxIconTemplate||n._itemCheckboxIconTemplate)("ngTemplateOutletContext",U(2,Hi,e,i))}}function uo(t,l){t&1&&d(0,po,1,5,"ng-template",null,11,E)}function go(t,l){t&1&&S(0)}function fo(t,l){if(t&1&&d(0,go,1,0,"ng-container",31),t&2){let e=s(3);a("ngTemplateOutlet",e.itemLoadingIconTemplate||e._itemLoadingIconTemplate)}}function mo(t,l){t&1&&d(0,fo,1,1,"ng-template",null,12,E)}function ho(t,l){t&1&&S(0)}function _o(t,l){if(t&1&&d(0,ho,1,0,"ng-container",31),t&2){let e=s(3);a("ngTemplateOutlet",e.filterIconTemplate||e._filterIconTemplate)}}function yo(t,l){t&1&&d(0,_o,1,1,"ng-template",null,13,E)}function To(t,l){t&1&&S(0)}function bo(t,l){if(t&1){let e=k();g(0,"div",17,5)(2,"span",33,6),v("focus",function(n){_(e);let o=s();return y(o.onFirstHiddenFocus(n))}),h(),d(4,no,1,0,"ng-container",24),g(5,"div",17)(6,"p-tree",34,7),v("selectionChange",function(n){_(e);let o=s();return y(o.onSelectionChange(n))})("onNodeExpand",function(n){_(e);let o=s();return y(o.nodeExpand(n))})("onNodeCollapse",function(n){_(e);let o=s();return y(o.nodeCollapse(n))})("onNodeSelect",function(n){_(e);let o=s();return y(o.onSelect(n))})("onNodeUnselect",function(n){_(e);let o=s();return y(o.onUnselect(n))}),d(8,lo,3,0,"ng-container",19)(9,so,2,0,null,19)(10,uo,2,0,null,19)(11,mo,2,0,null,19)(12,yo,2,0,null,19),h()(),d(13,To,1,0,"ng-container",24),g(14,"span",33,8),v("focus",function(n){_(e);let o=s();return y(o.onLastHiddenFocus(n))}),h()()}if(t&2){let e=s();u(e.cn(e.cx("panel"),e.panelStyleClass,e.panelClass)),a("ngStyle",e.panelStyle)("pBind",e.ptm("panel")),C("id",e.listId),c(2),a("pBind",e.ptm("hiddenFirstFocusableEl")),C("tabindex",0)("data-p-hidden-accessible",!0)("data-p-hidden-focusable",!0),c(2),a("ngTemplateOutlet",e.headerTemplate||e._headerTemplate)("ngTemplateOutletContext",U(48,$t,e.value,e.options)),c(),u(e.cx("treeContainer")),a("ngStyle",B(51,Ai,e.scrollHeight))("pBind",e.ptm("treeContainer")),c(),a("value",e.options)("propagateSelectionDown",e.propagateSelectionDown)("propagateSelectionUp",e.propagateSelectionUp)("selectionMode",e.selectionMode)("selection",e.value)("metaKeySelection",e.metaKeySelection)("emptyMessage",e.emptyMessage)("filter",e.filter)("filterBy",e.filterBy)("filterMode",e.filterMode)("filterPlaceholder",e.filterPlaceholder)("filterLocale",e.filterLocale)("filteredNodes",e.filteredNodes)("virtualScroll",e.virtualScroll)("virtualScrollItemSize",e.virtualScrollItemSize)("virtualScrollOptions",e.virtualScrollOptions)("_templateMap",e.templateMap)("loading",e.loading)("filterInputAutoFocus",e.filterInputAutoFocus)("loadingMode",e.loadingMode)("pt",e.ptm("pcTree"))("unstyled",e.unstyled()),c(2),a("ngIf",e.emptyTemplate||e._emptyTemplate),c(),a("ngIf",e.itemTogglerIconTemplate||e._itemTogglerIconTemplate),c(),a("ngIf",e.itemCheckboxIconTemplate||e._itemCheckboxIconTemplate),c(),a("ngIf",e.itemLoadingIconTemplate||e._itemLoadingIconTemplate),c(),a("ngIf",e.filterIconTemplate||e._filterIconTemplate),c(),a("ngTemplateOutlet",e.footerTemplate)("ngTemplateOutletContext",U(53,$t,e.value,e.options)),c(),a("pBind",e.ptm("hiddenLastFocusableEl")),C("tabindex",0)("data-p-hidden-accessible",!0)("data-p-hidden-focusable",!0)}}var xo=`
    ${Ut}

    /* For PrimeNG */

    .p-treeselect.ng-invalid.ng-dirty {
        border-color: dt('treeselect.invalid.border.color');
    }

    p-treeselect.ng-invalid.ng-dirty.p-focus {
        border-color: dt('treeselect.focus.border.color');
    }

    p-treeselect.ng-invalid.ng-dirty .p-treeselect-label.p-placeholder {
        color: dt('treeselect.invalid.placeholder.color');
    }

    .p-treeselect-clear-icon.p-icon {
        flex-shrink: 0;
    }
`,vo={root:({instance:t})=>ee({position:t.$appendTo()==="self"?"relative":void 0},t.containerStyle)},Co={root:({instance:t})=>["p-treeselect p-component p-inputwrapper",{"p-treeselect-display-chip":t.display==="chip","p-disabled":t.$disabled(),"p-invalid":t.invalid(),"p-focus":t.focused,"p-variant-filled":t.$variant()==="filled","p-inputwrapper-filled":!t.emptyValue,"p-inputwrapper-focus":t.focused||t.overlayVisible,"p-treeselect-open":t.overlayVisible,"p-treeselect-clearable":t.showClear,"p-treeselect-fluid":t.hasFluid,"p-treeselect-sm p-inputfield-sm":t.size()==="small","p-treeselect-lg p-inputfield-lg":t.size()==="large"}],labelContainer:"p-treeselect-label-container",label:({instance:t})=>["p-treeselect-label",{"p-placeholder":t.label===t.placeholder,"p-treeselect-label-empty":!t.placeholder&&t.emptyValue}],clearIcon:"p-treeselect-clear-icon",chip:"p-treeselect-chip-item",pcChip:"p-treeselect-chip",dropdown:"p-treeselect-dropdown",dropdownIcon:"p-treeselect-dropdown-icon",panel:"p-treeselect-overlay p-component-overlay p-component",treeContainer:"p-treeselect-tree-container",emptyMessage:"p-treeselect-empty-message"},qt=(()=>{class t extends Se{name="treeselect";style=xo;classes=Co;inlineStyles=vo;static \u0275fac=(()=>{let e;return function(n){return(e||(e=K(t)))(n||t)}})();static \u0275prov=j({token:t,factory:t.\u0275fac})}return t})();var So={provide:lt,useExisting:pe(()=>Me),multi:!0},Qt=new te("TREESELECT_INSTANCE"),Me=(()=>{class t extends ht{componentName="TreeSelect";$pcTreeSelect=M(Qt,{optional:!0,skipSelf:!0})??void 0;bindDirectiveInstance=M(D,{self:!0});_componentStyle=M(qt);onAfterViewChecked(){this.bindDirectiveInstance.setAttrs(this.ptms(["host","root"]))}inputId;scrollHeight="400px";metaKeySelection=!1;display="comma";selectionMode="single";tabindex="0";ariaLabel;ariaLabelledBy;placeholder;panelClass;panelStyle;panelStyleClass;containerStyle;containerStyleClass;labelStyle;labelStyleClass;overlayOptions;emptyMessage="";filter=!1;filterBy="label";filterMode="lenient";filterPlaceholder;filterLocale;filterInputAutoFocus=!0;propagateSelectionDown=!0;propagateSelectionUp=!0;showClear=!1;resetFilterOnHide=!0;virtualScroll;virtualScrollItemSize;virtualScrollOptions;autofocus;get options(){return this._options}set options(e){this._options=e,this.updateTreeState()}loading;loadingMode="mask";size=J();variant=J();fluid=J(void 0,{transform:b});appendTo=J(void 0);motionOptions=J(void 0);onNodeExpand=new x;onNodeCollapse=new x;onShow=new x;onHide=new x;onClear=new x;onFilter=new x;onFocus=new x;onBlur=new x;onNodeUnselect=new x;onNodeSelect=new x;$appendTo=O(()=>this.appendTo()||this.config.overlayAppendTo());focusInput;filterViewChild;treeViewChild;panelEl;overlayViewChild;firstHiddenFocusableElementOnOverlay;lastHiddenFocusableElementOnOverlay;$variant=O(()=>this.variant()||this.config.inputStyle()||this.config.inputVariant());pcFluid=M(yt,{optional:!0,host:!0,skipSelf:!0});get hasFluid(){return this.fluid()??!!this.pcFluid}filteredNodes;filterValue=null;serializedValue;valueTemplate;headerTemplate;emptyTemplate;footerTemplate;clearIconTemplate;triggerIconTemplate;dropdownIconTemplate;filterIconTemplate;closeIconTemplate;itemTogglerIconTemplate;itemCheckboxIconTemplate;itemLoadingIconTemplate;templates;_valueTemplate;_headerTemplate;_emptyTemplate;_footerTemplate;_clearIconTemplate;_triggerIconTemplate;_filterIconTemplate;_closeIconTemplate;_itemTogglerIconTemplate;_itemCheckboxIconTemplate;_itemLoadingIconTemplate;_dropdownIconTemplate;focused;overlayVisible;value;expandedNodes=[];_options;templateMap;listId="";onHostClick(e){this.onClick(e)}onInit(){this.listId=ut("pn_id_")+"_list",this.updateTreeState()}onAfterContentInit(){this.templates.length&&(this.templateMap={}),this.templates.forEach(e=>{switch(e.getType()){case"value":this._valueTemplate=e.template;break;case"header":this._headerTemplate=e.template;break;case"empty":this._emptyTemplate=e.template;break;case"footer":this._footerTemplate=e.template;break;case"clearicon":this._clearIconTemplate=e.template;break;case"triggericon":this._triggerIconTemplate=e.template;break;case"filtericon":this._filterIconTemplate=e.template;break;case"closeicon":this._closeIconTemplate=e.template;break;case"itemtogglericon":this._itemTogglerIconTemplate=e.template;break;case"itemcheckboxicon":this._itemCheckboxIconTemplate=e.template;break;case"dropdownicon":this._dropdownIconTemplate=e.template;break;case"itemloadingicon":this._itemLoadingIconTemplate=e.template;break;default:e.name?this.templateMap[e.name]=e.template:this.valueTemplate=e.template;break}})}onOverlayBeforeEnter(){if(this.filter)He(this.filterValue)&&this.treeViewChild?._filter(this.filterValue),this.filterInputAutoFocus&&this.filterViewChild?.nativeElement.focus();else{let e=se(this.panelEl?.nativeElement);e&&e.length>0&&e[0].focus()}}onOverlayBeforeHide(){let e=se(this.el.nativeElement);e&&e.length>0&&e[0].focus()}onSelectionChange(e){this.value=e,this.onModelChange(this.value),this.cd.markForCheck()}onClick(e){if(this.$disabled())return;let i=e.target?.getAttribute?.("data-pc-section");!this.overlayViewChild?.el?.nativeElement?.contains(e.target)&&i!=="box"&&i!=="icon"&&(this.overlayVisible?this.hide():this.show(),this.focusInput?.nativeElement.focus())}onKeyDown(e){switch(e.code){case"ArrowDown":this.overlayVisible||(this.show(),e.preventDefault()),this.onArrowDown(e),e.preventDefault();break;case"Space":case"Enter":this.overlayVisible||(this.show(),e.preventDefault());break;case"Escape":this.overlayVisible&&(this.hide(),this.focusInput?.nativeElement.focus(),e.preventDefault());break;case"Tab":this.onTabKey(e);break;default:break}}onFilterInput(e){this.filterValue=e.target.value,this.treeViewChild?._filter(this.filterValue),this.onFilter.emit({filter:this.filterValue,filteredValue:this.treeViewChild?.filteredNodes}),setTimeout(()=>{this.overlayViewChild?.alignOverlay()})}onArrowDown(e){if(this.overlayVisible&&this.panelEl?.nativeElement){let i=se(this.panelEl.nativeElement,'[data-pc-section="node"]');i&&i.length>0&&i[0].focus(),e.preventDefault()}}onFirstHiddenFocus(e){let i=e.relatedTarget===this.focusInput?.nativeElement?st(this.overlayViewChild?.overlayViewChild?.nativeElement,':not([data-p-hidden-focusable="true"])'):this.focusInput?.nativeElement;X(i)}onLastHiddenFocus(e){let i=e.relatedTarget===this.focusInput?.nativeElement?ct(this.overlayViewChild?.overlayViewChild?.nativeElement,':not([data-p-hidden-focusable="true"])'):this.focusInput?.nativeElement;X(i)}show(){this.overlayVisible=!0}hide(e){this.overlayVisible=!1,this.resetFilter(),this.onHide.emit(e),this.cd.markForCheck()}clear(e){this.value=null,this.resetExpandedNodes(),this.resetPartialSelected(),this.onModelChange(this.value),this.onClear.emit(),e.stopPropagation()}checkValue(){return this.value!==null&&He(this.value)}onTabKey(e,i=!1){i||(this.overlayVisible&&this.hasFocusableElements()?(X(e.shiftKey?this.lastHiddenFocusableElementOnOverlay?.nativeElement:this.firstHiddenFocusableElementOnOverlay?.nativeElement),e.preventDefault()):this.overlayVisible&&this.hide(this.filter))}hasFocusableElements(){return se(this.overlayViewChild?.overlayViewChild?.nativeElement,':not([data-p-hidden-focusable="true"])').length>0}resetFilter(){this.filter&&!this.resetFilterOnHide?(this.filteredNodes=this.treeViewChild?.filteredNodes,this.treeViewChild?.resetFilter()):this.filterValue=null}updateTreeState(){if(this.value){let e=this.selectionMode==="single"?[this.value]:[...this.value];this.resetExpandedNodes(),this.resetPartialSelected(),e&&this.options&&this.updateTreeBranchState(null,null,e)}}updateTreeBranchState(e,i,n){if(e){if(this.isSelected(e)&&(this.expandPath(i),n.splice(n.indexOf(e),1)),n.length>0&&e.children)for(let o of e.children)this.updateTreeBranchState(o,[...i,e],n)}else for(let o of this.options)this.updateTreeBranchState(o,[],n)}expandPath(e){for(let i of e)i.expanded=!0;this.expandedNodes=[...e]}nodeExpand(e){this.onNodeExpand.emit(e),this.expandedNodes.push(e.node),setTimeout(()=>{this.overlayViewChild?.alignOverlay()})}nodeCollapse(e){this.onNodeCollapse.emit(e),this.expandedNodes.splice(this.expandedNodes.indexOf(e.node),1),setTimeout(()=>{this.overlayViewChild?.alignOverlay()})}resetExpandedNodes(){for(let e of this.expandedNodes)e.expanded=!1;this.expandedNodes=[]}resetPartialSelected(e=this.options){if(e)for(let i of e)i.partialSelected=!1,i.children&&i.children?.length>0&&this.resetPartialSelected(i.children)}findSelectedNodes(e,i,n){if(e){if(this.isSelected(e)&&(n.push(e),delete i[e.key]),Object.keys(i).length&&e.children)for(let o of e.children)this.findSelectedNodes(o,i,n)}else for(let o of this.options)this.findSelectedNodes(o,i,n)}isSelected(e){return this.findIndexInSelection(e)!=-1}findIndexInSelection(e){let i=-1;if(this.value)if(this.selectionMode==="single")i=this.value.key&&this.value.key===e.key||this.value==e?0:-1;else for(let n=0;n<this.value.length;n++){let o=this.value[n];if(o.key&&o.key===e.key||o==e){i=n;break}}return i}onSelect(e){this.onNodeSelect.emit(e),this.selectionMode==="single"&&(this.hide(),this.focusInput?.nativeElement.focus())}onUnselect(e){this.onNodeUnselect.emit(e)}onInputFocus(e){this.$disabled()||(this.focused=!0,this.onFocus.emit(e))}onInputBlur(e){this.focused=!1,this.onBlur.emit(e),this.onModelTouched()}writeControlValue(e){this.value=e,this.updateTreeState(),this.cd.markForCheck()}get emptyValue(){return!this.value||Object.keys(this.value).length===0}get emptyOptions(){return!this.options||this.options.length===0}get label(){let e=this.value||[];return e.length?e.map(i=>i.label).join(", "):this.selectionMode==="single"&&this.value?e.label:this.placeholder}static \u0275fac=(()=>{let e;return function(n){return(e||(e=K(t)))(n||t)}})();static \u0275cmp=H({type:t,selectors:[["p-treeSelect"],["p-treeselect"],["p-tree-select"]],contentQueries:function(i,n,o){if(i&1&&he(o,_i,4)(o,yi,4)(o,Ti,4)(o,bi,4)(o,xi,4)(o,vi,4)(o,Ci,4)(o,Si,4)(o,Ni,4)(o,Ii,4)(o,wi,4)(o,Ei,4)(o,Z,4),i&2){let r;f(r=m())&&(n.valueTemplate=r.first),f(r=m())&&(n.headerTemplate=r.first),f(r=m())&&(n.emptyTemplate=r.first),f(r=m())&&(n.footerTemplate=r.first),f(r=m())&&(n.clearIconTemplate=r.first),f(r=m())&&(n.triggerIconTemplate=r.first),f(r=m())&&(n.dropdownIconTemplate=r.first),f(r=m())&&(n.filterIconTemplate=r.first),f(r=m())&&(n.closeIconTemplate=r.first),f(r=m())&&(n.itemTogglerIconTemplate=r.first),f(r=m())&&(n.itemCheckboxIconTemplate=r.first),f(r=m())&&(n.itemLoadingIconTemplate=r.first),f(r=m())&&(n.templates=r)}},viewQuery:function(i,n){if(i&1&&_e(Mi,5)(ki,5)(Di,5)(Oi,5)(Vi,5)(Fi,5)(Bi,5),i&2){let o;f(o=m())&&(n.focusInput=o.first),f(o=m())&&(n.filterViewChild=o.first),f(o=m())&&(n.treeViewChild=o.first),f(o=m())&&(n.panelEl=o.first),f(o=m())&&(n.overlayViewChild=o.first),f(o=m())&&(n.firstHiddenFocusableElementOnOverlay=o.first),f(o=m())&&(n.lastHiddenFocusableElementOnOverlay=o.first)}},hostVars:4,hostBindings:function(i,n){i&1&&v("mousedown",function(r){return n.onHostClick(r)}),i&2&&(G(n.sx("root")),u(n.cn(n.cx("root"),n.containerStyleClass)))},inputs:{inputId:"inputId",scrollHeight:"scrollHeight",metaKeySelection:[2,"metaKeySelection","metaKeySelection",b],display:"display",selectionMode:"selectionMode",tabindex:"tabindex",ariaLabel:"ariaLabel",ariaLabelledBy:"ariaLabelledBy",placeholder:"placeholder",panelClass:"panelClass",panelStyle:"panelStyle",panelStyleClass:"panelStyleClass",containerStyle:"containerStyle",containerStyleClass:"containerStyleClass",labelStyle:"labelStyle",labelStyleClass:"labelStyleClass",overlayOptions:"overlayOptions",emptyMessage:"emptyMessage",filter:[2,"filter","filter",b],filterBy:"filterBy",filterMode:"filterMode",filterPlaceholder:"filterPlaceholder",filterLocale:"filterLocale",filterInputAutoFocus:[2,"filterInputAutoFocus","filterInputAutoFocus",b],propagateSelectionDown:[2,"propagateSelectionDown","propagateSelectionDown",b],propagateSelectionUp:[2,"propagateSelectionUp","propagateSelectionUp",b],showClear:[2,"showClear","showClear",b],resetFilterOnHide:[2,"resetFilterOnHide","resetFilterOnHide",b],virtualScroll:"virtualScroll",virtualScrollItemSize:"virtualScrollItemSize",virtualScrollOptions:"virtualScrollOptions",autofocus:[2,"autofocus","autofocus",b],options:"options",loading:[2,"loading","loading",b],loadingMode:"loadingMode",size:[1,"size"],variant:[1,"variant"],fluid:[1,"fluid"],appendTo:[1,"appendTo"],motionOptions:[1,"motionOptions"]},outputs:{onNodeExpand:"onNodeExpand",onNodeCollapse:"onNodeCollapse",onShow:"onShow",onHide:"onHide",onClear:"onClear",onFilter:"onFilter",onFocus:"onFocus",onBlur:"onBlur",onNodeUnselect:"onNodeUnselect",onNodeSelect:"onNodeSelect"},features:[oe([So,qt,{provide:Qt,useExisting:t},{provide:ce,useExisting:t}]),me([D]),ie],decls:16,vars:37,consts:[["focusInput",""],["defaultValueTemplate",""],["overlay",""],["content",""],["chipsValueTemplate",""],["panel",""],["firstHiddenFocusableEl",""],["tree",""],["lastHiddenFocusableEl",""],["empty",""],["togglericon",""],["checkboxicon",""],["loadingicon",""],["filtericon",""],[1,"p-hidden-accessible",3,"pBind"],["type","text","role","combobox","readonly","",3,"focus","blur","keydown","pAutoFocus","pBind"],[3,"pBind"],[3,"ngStyle","pBind"],[4,"ngIf","ngIfElse"],[4,"ngIf"],["role","button","aria-haspopup","tree",3,"pBind"],["data-p-icon","chevron-down",3,"class","pBind",4,"ngIf"],[3,"class","pBind",4,"ngIf"],[3,"visibleChange","onBeforeEnter","onBeforeHide","onShow","onHide","hostAttrSelector","visible","options","target","appendTo","unstyled","pt","motionOptions"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"class","pBind",4,"ngFor","ngForOf"],[3,"unstyled","label","pt"],["data-p-icon","times",3,"class","pBind","click",4,"ngIf"],[3,"class","pBind","click",4,"ngIf"],["data-p-icon","times",3,"click","pBind"],[3,"click","pBind"],[4,"ngTemplateOutlet"],["data-p-icon","chevron-down",3,"pBind"],["role","presentation",1,"p-hidden-accessible","p-hidden-focusable",3,"focus","pBind"],[3,"selectionChange","onNodeExpand","onNodeCollapse","onNodeSelect","onNodeUnselect","value","propagateSelectionDown","propagateSelectionUp","selectionMode","selection","metaKeySelection","emptyMessage","filter","filterBy","filterMode","filterPlaceholder","filterLocale","filteredNodes","virtualScroll","virtualScrollItemSize","virtualScrollOptions","_templateMap","loading","filterInputAutoFocus","loadingMode","pt","unstyled"]],template:function(i,n){if(i&1){let o=k();g(0,"div",14)(1,"input",15,0),v("focus",function(p){return n.onInputFocus(p)})("blur",function(p){return n.onInputBlur(p)})("keydown",function(p){return n.onKeyDown(p)}),h()(),g(3,"div",16)(4,"div",17),d(5,zi,2,5,"ng-container",18)(6,ji,3,2,"ng-template",null,1,E),h()(),d(8,Ji,3,2,"ng-container",19),g(9,"div",20),d(10,Xi,1,3,"svg",21)(11,to,2,4,"span",22),h(),g(12,"p-overlay",23,2),Je("visibleChange",function(p){return _(o),Ye(n.overlayVisible,p)||(n.overlayVisible=p),y(p)}),v("onBeforeEnter",function(){return n.onOverlayBeforeEnter()})("onBeforeHide",function(){return n.onOverlayBeforeHide()})("onShow",function(p){return n.onShow.emit(p)})("onHide",function(p){return n.hide(p)}),d(14,bo,16,56,"ng-template",null,3,E),h()}if(i&2){let o=W(7);a("pBind",n.ptm("hiddenInputContainer")),C("data-p-hidden-accessible",!0),c(),a("pAutoFocus",n.autofocus)("pBind",n.ptm("hiddenInput")),C("id",n.inputId)("disabled",n.$disabled()?"":void 0)("tabindex",n.$disabled()?-1:n.tabindex)("aria-controls",n.overlayVisible?n.listId:null)("aria-haspopup","tree")("aria-expanded",n.overlayVisible??!1)("aria-labelledby",n.ariaLabelledBy)("aria-label",n.ariaLabel||(n.label==="p-emptylabel"?void 0:n.label)),c(2),u(n.cx("labelContainer")),a("pBind",n.ptm("labelContainer")),c(),u(n.cn(n.cx("label"),n.labelStyleClass)),a("ngStyle",n.labelStyle)("pBind",n.ptm("label")),c(),a("ngIf",n.valueTemplate||n._valueTemplate)("ngIfElse",o),c(3),a("ngIf",n.checkValue()&&!n.$disabled()&&n.showClear),c(),u(n.cx("dropdown")),a("pBind",n.ptm("dropdown")),C("aria-expanded",n.overlayVisible??!1)("aria-label","treeselect trigger"),c(),a("ngIf",!n.triggerIconTemplate&&!n._triggerIconTemplate&&!n.dropdownIconTemplate&&!n._dropdownIconTemplate),c(),a("ngIf",n.triggerIconTemplate||n._triggerIconTemplate||n.dropdownIconTemplate||n._dropdownIconTemplate),c(),a("hostAttrSelector",n.$attrSelector),Ge("visible",n.overlayVisible),a("options",n.overlayOptions)("target","@parent")("appendTo",n.$appendTo())("unstyled",n.unstyled())("pt",n.ptm("pcOverlay"))("motionOptions",n.motionOptions())}},dependencies:[Q,le,re,q,Te,wt,L,Ee,Ne,Nt,Ie,It,D],encapsulation:2,changeDetection:0})}return t})(),jt=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=fe({type:t});static \u0275inj=ue({imports:[Me,L,L]})}return t})();var ke=class t{signalRClient=M(ot);continuedCategories$;allCategories$;_onOpenTreeSelector=new qe;onOpenTreeSelector$=this._onOpenTreeSelector.asObservable();constructor(l){this.continuedCategories$=this.onOpenTreeSelector$.pipe(Fe(this.signalRClient.recacheCategory$),Ve((e,[i,n])=>n||!e.length?(this.signalRClient.resetCategoryCache(),l.get("/API/catalog/category/ActiveOptions")):De(e),[]),Oe(1)),this.allCategories$=this.onOpenTreeSelector$.pipe(Fe(this.signalRClient.recacheCategory$),Ve((e,[i,n])=>n||!e.length?l.get("/API/catalog/category/SelectOptions"):De(e),[]),Oe(1))}onOpenTreeSelector(){this._onOpenTreeSelector.next(!0)}forceLoadCategories(){this._onOpenTreeSelector.next(!0)}static \u0275fac=function(e){return new(e||t)(je(Ce))};static \u0275prov=j({token:t,factory:t.\u0275fac,providedIn:"root"})};function Eo(t,l){t&1&&S(0)}function Mo(t,l){if(t&1&&(g(0,"p-floatLabel",1),d(1,Eo,1,0,"ng-container",2),g(2,"label",3),F(3,"Category"),h()()),t&2){s();let e=W(3);c(),a("ngTemplateOutlet",e)}}function ko(t,l){t&1&&S(0)}function Do(t,l){if(t&1&&d(0,ko,1,0,"ng-container",2),t&2){s();let e=W(3);a("ngTemplateOutlet",e)}}function Oo(t,l){if(t&1&&(g(0,"div",6),F(1),h()),t&2){let e=s(2);a("matTooltip",e.selectedCategoryLabel),c(),Y(" ",e.selectedCategoryLabel," ")}}function Vo(t,l){if(t&1){let e=k();g(0,"p-treeSelect",4),et(1,"async"),v("onShow",function(){_(e);let n=s();return y(n.loadCategories())})("ngModelChange",function(n){_(e);let o=s();return y(o.onSelectCategory(n))})("onClear",function(){_(e);let n=s();return y(n.onClear())})("onNodeUnselect",function(n){_(e);let o=s();return y(o.onUnselectCategory(n))}),d(2,Oo,2,2,"ng-template",5),h()}if(t&2){let e=s();a("options",tt(1,4,e.categories$))("ngModel",e.selectedCategory)("showClear",e.showClear)("placeholder",e.showLabel?"":e.placeholder)}}var Kt=class t{constructor(l,e){this.http=l;this.treeSelector=e}continuedCategoriesOnly=!0;categories=[];showClear=!1;showLabel=!1;placeholder="Select Category";isInitializedCategoryLabel=!1;selectedCategory;selectedCategoryID;selectedCategoryIDChange=new x;onSelectedCategory=Le();_onClearCategory=Le({alias:"onClearCategory"});selectedCategoryLabel;top=0;isLoadCategories=!1;categories$;ngAfterViewInit(){let l=document.querySelector("body");this.top=l.getBoundingClientRect().top*-1}ngOnInit(){this.isInitializedCategoryLabel&&(be.IsEmpty(this.selectedCategoryID)&&be.IsNotEmpty(this.categories)&&(this.selectedCategoryID=this.categories[0]?.key),this.selectedCategory=this.findSelectedCategory(this.categories,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)),this.categories$=this.continuedCategoriesOnly?this.treeSelector.continuedCategories$:this.treeSelector.allCategories$,this.categories$=this.categories$.pipe(Qe(l=>{this.selectedCategory=this.findSelectedCategory(l,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)}))}onSelectCategory(l){l&&(this.selectedCategory=l,this.generateLabelSelectedCategory(this.selectedCategory),this.selectedCategoryID=l?.key,this.selectedCategoryIDChange.emit(this.selectedCategoryID),this.onSelectedCategory.emit(this.selectedCategory))}onUnselectCategory(l){this.onSelectCategory(l.node)}generateLabelSelectedCategory(l){if(l){let e=[];this.selectedCategoryLabel="";do e=[...e,l.label],l=l.parent;while(l!==void 0);this.selectedCategoryLabel=e.reverse().join("/")}else this.selectedCategoryLabel=this.placeholder}findSelectedCategory(l,e){if(be.IsNotEmpty(e))for(let i of l){if(i.key===e)return i;{i.children=i.children?i.children:[],i.children=i.children.map(o=>(o.parent=i,o));let n=this.findSelectedCategory(i.children,e);if(n)return n}}else return null}loadCategories(){try{setTimeout(()=>{let l=document.querySelector(".p-overlay.p-component"),e=this.top+l.getBoundingClientRect().top,i=l.getAttribute("style")||"";l.setAttribute("style",`${i} top: ${e+this.top}px;`)},0)}catch(l){console.error("Error adjusting top position:",l)}finally{this.treeSelector.onOpenTreeSelector()}}onClear(){this.selectedCategory=null,this.generateLabelSelectedCategory(null),this.selectedCategoryID=null,this.selectedCategoryIDChange.emit(null),this._onClearCategory.emit()}static \u0275fac=function(e){return new(e||t)(ne(Ce),ne(ke))};static \u0275cmp=H({type:t,selectors:[["POS-product-category-select"]],inputs:{continuedCategoriesOnly:"continuedCategoriesOnly",categories:"categories",showClear:"showClear",showLabel:"showLabel",placeholder:"placeholder",isInitializedCategoryLabel:"isInitializedCategoryLabel",selectedCategoryID:"selectedCategoryID"},outputs:{selectedCategoryIDChange:"selectedCategoryIDChange",onSelectedCategory:"onSelectedCategory",_onClearCategory:"onClearCategory"},decls:4,vars:1,consts:[["categorySelectTemplate",""],["variant","on",1,"w-100"],[4,"ngTemplateOutlet"],["for","selectCategory",1,"tree-category-label",2,"z-index","99 !important"],["appendTo","body","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","inputId","selectCategory",3,"onShow","ngModelChange","onClear","onNodeUnselect","options","ngModel","showClear","placeholder"],["pTemplate","value"],["matTooltipPosition","above",3,"matTooltip"]],template:function(e,i){e&1&&(R(0,Mo,4,1,"p-floatLabel",1)(1,Do,1,1,"ng-container"),d(2,Vo,3,6,"ng-template",null,0,E)),e&2&&z(i.showLabel?0:1)},dependencies:[Q,q,xt,bt,jt,Me,Z,ae,xe,ve,Vt,Ot,Ft,it],styles:[".p-overlay.p-component{z-index:10000000000000000000000!important}  .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important}  .p-float-label .p-inputwrapper-filled~label.tree-category-label{left:.5rem!important}"]})};export{pl as a,Me as b,jt as c,ke as d,Kt as e};
