WordPress/wp-includes/js/dist/dom.min.js

2 lines
12 KiB
JavaScript
Raw Normal View History

/*! This file is auto-generated */
(()=>{"use strict";var t={n:e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return t.d(n,{a:n}),n},d:(e,n)=>{for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{__unstableStripHTML:()=>$,computeCaretRect:()=>b,documentHasSelection:()=>w,documentHasTextSelection:()=>N,documentHasUncollapsedSelection:()=>C,focus:()=>st,getFilesFromDataTransfer:()=>at,getOffsetParent:()=>O,getPhrasingContentSchema:()=>tt,getRectangleFromRange:()=>g,getScrollContainer:()=>v,insertAfter:()=>z,isEmpty:()=>J,isEntirelySelected:()=>A,isFormElement:()=>D,isHorizontalEdge:()=>x,isNumberInput:()=>_,isPhrasingContent:()=>et,isRTL:()=>P,isTextContent:()=>nt,isTextField:()=>E,isVerticalEdge:()=>F,placeCaretAtHorizontalEdge:()=>j,placeCaretAtVerticalEdge:()=>U,remove:()=>q,removeInvalidHTML:()=>it,replace:()=>W,replaceTag:()=>X,safeHTML:()=>Y,unwrap:()=>k,wrap:()=>G});var n={};t.r(n),t.d(n,{find:()=>i});var r={};function o(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0}function i(t,{sequential:e=!1}={}){const n=t.querySelectorAll(function(t){return[t?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}(e));return Array.from(n).filter((t=>{if(!o(t))return!1;const{nodeName:e}=t;return"AREA"!==e||function(t){const e=t.closest("map[name]");if(!e)return!1;const n=t.ownerDocument.querySelector('img[usemap="#'+e.name+'"]');return!!n&&o(n)}(t)}))}function a(t){const e=t.getAttribute("tabindex");return null===e?0:parseInt(e,10)}function s(t){return-1!==a(t)}function c(t,e){return{element:t,index:e}}function u(t){return t.element}function l(t,e){const n=a(t.element),r=a(e.element);return n===r?t.index-e.index:n-r}function d(t){return t.filter(s).map(c).sort(l).map(u).reduce(function(){const t={};return function(e,n){const{nodeName:r,type:o,checked:i,name:a}=n;if("INPUT"!==r||"radio"!==o||!a)return e.concat(n);const s=t.hasOwnProperty(a);if(!i&&s)return e;if(s){const n=t[a];e=e.filter((t=>t!==n))}return t[a]=n,e.concat(n)}}(),[])}function f(t){return d(i(t))}function m(t){return d(i(t.ownerDocument.body)).reverse().find((e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_PRECEDING))}function h(t){return d(i(t.ownerDocument.body)).find((e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_FOLLOWING))}function p(t,e){0}function g(t){if(!t.collapsed){const e=Array.from(t.getClientRects());if(1===e.length)return e[0];const n=e.filter((({width:t})=>t>1));if(0===n.length)return t.getBoundingClientRect();if(1===n.length)return n[0];let{top:r,bottom:o,left:i,right:a}=n[0];for(const{top:t,bottom:e,left:s,right:c}of n)t<r&&(r=t),e>o&&(o=e),s<i&&(i=s),c>a&&(a=c);return new window.DOMRect(i,r,a-i,o-r)}const{startContainer:e}=t,{ownerDocument:n}=e;if("BR"===e.nodeName){const{parentNode:r}=e;p();const o=Array.from(r.childNodes).indexOf(e);p(),(t=n.createRange()).setStart(r,o),t.setEnd(r,o)}const r=t.getClientRects();if(r.length>1)return null;let o=r[0];if(!o||0===o.height){p();const e=n.createTextNode("");(t=t.cloneRange()).insertNode(e),o=t.getClientRects()[0],p(e.parentNode),e.parentNode.removeChild(e)}return o}function b(t){const e=t.getSelection();p();const n=e.rangeCount?e.getRangeAt(0):null;return n?g(n):null}function N(t){p(t.defaultView);const e=t.defaultView.getSelection();p();const n=e.rangeCount?e.getRangeAt(0):null;return!!n&&!n.collapsed}function y(t){return"INPUT"===t?.nodeName}function E(t){return y(t)&&t.type&&!["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"].includes(t.type)||"TEXTAREA"===t.nodeName||"true"===t.contentEditable}function C(t){return N(t)||!!t.activeElemen