/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
var u={hideChildren:"hide-children"},b=["label","description","metadata"],m=10,h=2;function g({exclusive:t,visible:i,visibilityAppearance:n}){let e=n==="checkbox";return i?t?"circle-f":e?"check-square-f":"view-visible":t?"circle":e?"square":"view-hide"}function v({connectionStatus:t,publishing:i}){return t?t==="connected"?"beacon":"offline":i?"square":"bullet-point"}function x(t){return t?.listMode===u.hideChildren}function L(t){t?.removeMany(t.filter(i=>i?.destroyed))}function l(t){if(!(!t||"type"in t&&t.type==="wmts"))return"sublayers"in t?"sublayers":"layers"in t?"layers":void 0}function C(t,i,n){t&&(t.filterPredicate=i?e=>{let r=p(e,n);return r?i(r):!1}:void 0)}function M(t){let i=(t?.layer&&d(t.layer)?t.layer.layer:void 0)??t?.layer;return i?i.type==="catalog"?!1:f(i)??!0:!1}function c(t,i){t?.sort((n,e)=>{let r="uid"in n&&n.uid?i.indexOf(n.uid):-1,a="uid"in e&&e.uid?i.indexOf(e.uid):-1;return r>a?-1:r<a?1:0})}function O(t,i){let n=t?.layer;if(!n)return;let e=l(n);if(!e)return;let r;e==="layers"&&"layers"in n?r=n.layers:e==="sublayers"&&"sublayers"in n&&(r=n.sublayers),c(r,i)}function d(t){return t!=null&&"layer"in t&&t.layer!=null}function f(t){let i=y(t);return i!=null&&"supportsDynamicLayers"in i?i.supportsDynamicLayers:void 0}function y(t){return t&&"capabilities"in t&&t.capabilities!=null&&"exportMap"in t.capabilities?t.capabilities.exportMap:void 0}function p(t,i){if(t?.tagName.toLowerCase()==="calcite-list-item")return t.value;let n=t?.getAttribute("data-item")??t?.querySelector("calcite-list-item")?.getAttribute("data-item");return n&&i?i.find(e=>e.uid===n)??null:null}function S(t){return t?.getAttribute("data-layer-type")??null}function q(t){let{children:i,error:n}=t,e="incompatible"in t?t.incompatible:!1;return!!i?.filter(r=>!r.hidden).length&&!n&&!e}function w(t){for(let i of t)for(let n of i)if(n.type==="button"||n.type==="toggle")return n}function A(t,i){let n=t.parent,e=t.layer;if(e?.type!=="map-image"||!e.sourceJSON||!n)return!1;let r=e.sourceJSON.layers;if(!r)return!1;let a=r.find(s=>t.id===s.id),o=i==="footprints"?"Feature Layer":"Catalog Dynamic Group Layer";return a?.type!==o?!1:r.find(s=>s.id===n.id)?.type==="Catalog Layer"}export{b as a,m as b,h as c,g as d,v as e,x as f,L as g,C as h,M as i,c as j,O as k,d as l,p as m,S as n,q as o,w as p,A as q};
