123456 |
- /*!
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
- * v1.0.0-beta.97
- */
- import{C as n}from"./p-af9e6e54.js";import{g as t}from"./p-d5bfadd8.js";function r(n){return n?n.id=n.id||`${n.tagName.toLowerCase()}-${t()}`:""}function o(n){return Array.isArray(n)?n:Array.from(n)}function u(t){const r=f(t,`.${n.darkTheme}, .${n.lightTheme}`);return(null==r?void 0:r.classList.contains("calcite-theme-dark"))?"dark":"light"}function l(n){const t=f(n,"[dir]");return t?t.getAttribute("dir"):"ltr"}function i(n,t,r){const o=n.closest(`[${t}]`);return o?o.getAttribute(t):r}function e(n){return n.getRootNode()}function s(n){return n.host||null}function c(n,{selector:t,id:r}){return function n(o){if(!o)return null;o.assignedSlot&&(o=o.assignedSlot);const u=e(o),l=r?"getElementById"in u?u.getElementById(r):null:t?u.querySelector(t):null,i=s(u);return l||(i?n(i):null)}(n)}function f(n,t){return function n(r){return r?r.closest(t)||n(s(e(r))):null}(n)}function a(n,t){return d(n,t)}function d(n,t){if(!n)return;const r=t(n);if(void 0!==r)return r;const{parentNode:o}=n;return d(o instanceof ShadowRoot?o.host:o,t)}function v(n,t){return!!a(t,(t=>t===n||void 0))}function y(n){return"function"==typeof(null==n?void 0:n.setFocus)}async function p(n){if(n)return y(n)?n.setFocus():n.focus()}function A(n,t,r){t&&!Array.isArray(t)&&"string"!=typeof t&&(r=t,t=null);const o=t?Array.isArray(t)?t.map((n=>`[slot="${n}"]`)).join(","):`[slot="${t}"]`:":not([slot])";return(null==r?void 0:r.all)?function(n,t,r){let o=":not([slot])"===t?m(n,":not([slot])"):Array.from(n.querySelectorAll(t));o=r&&!1===r.direct?o:o.filter((t=>t.parentElement===n)),o=(null==r?void 0:r.matches)?o.filter((n=>null==n?void 0:n.matches(r.matches))):o;const u=null==r?void 0:r.selector;return u?o.map((n=>Array.from(n.querySelectorAll(u)))).reduce(((n,t)=>[...n,...t]),[]).filter((n=>!!n)):o}(n,o,r):function(n,t,r){let o=":not([slot])"===t?m(n,":not([slot])")[0]||null:n.querySelector(t);o=r&&!1===r.direct||(null==o?void 0:o.parentElement)===n?o:null,o=(null==r?void 0:r.matches)?(null==o?void 0:o.matches(r.matches))?o:null:o;const u=null==r?void 0:r.selector;return u?null==o?void 0:o.querySelector(u):o}(n,o,r)}function m(n,t){return n?Array.from(n.children||[]).filter((n=>null==n?void 0:n.matches(t))):[]}function $(n,t){return Array.from(n.children).filter((n=>n.matches(t)))}function g(n,t,r){return"string"==typeof t&&""!==t?t:""===t?n[r]:void 0}function h(n,t){return!(t.left>n.right||t.right<n.left||t.top>n.bottom||t.bottom<n.top)}function j(n){return Boolean(n).toString()}function k(n){return!(!n.isPrimary||0!==n.button)}export{l as a,v as b,f as c,u as d,i as e,p as f,A as g,r as h,k as i,y as j,h as k,e as l,$ as m,o as n,c as q,g as s,j as t}
|