codicent-app-sdk 0.4.0 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/bootstrap.js +1 -1
- package/dist/cjs/components/AiInput.js +1 -1
- package/dist/cjs/components/AudioIcon.js +1 -1
- package/dist/cjs/components/BulkUploadDialog.js +1 -1
- package/dist/cjs/components/Button.js +1 -1
- package/dist/cjs/components/ChatInput.js +1 -1
- package/dist/cjs/components/ChatMessage.js +1 -1
- package/dist/cjs/components/CombinedPlaceholderDialog.js +1 -1
- package/dist/cjs/components/CompoundButton.js +1 -1
- package/dist/cjs/components/Content.js +1 -1
- package/dist/cjs/components/Dialog.js +1 -1
- package/dist/cjs/components/FileThumbnail.js +1 -1
- package/dist/cjs/components/Footer.js +1 -1
- package/dist/cjs/components/GenericJsonRenderer.js +1 -1
- package/dist/cjs/components/Header.js +1 -1
- package/dist/cjs/components/HtmlView.js +1 -1
- package/dist/cjs/components/Input.js +1 -1
- package/dist/cjs/components/Label.js +1 -1
- package/dist/cjs/components/LanguageSelector.js +1 -1
- package/dist/cjs/components/ListView.js +1 -1
- package/dist/cjs/components/Markdown.js +1 -1
- package/dist/cjs/components/MessageInput.js +1 -1
- package/dist/cjs/components/MessageItem.js +1 -1
- package/dist/cjs/components/OfflineMessage.js +1 -1
- package/dist/cjs/components/Page.js +1 -1
- package/dist/cjs/components/Profile.js +1 -1
- package/dist/cjs/components/Prompt.js +1 -1
- package/dist/cjs/components/QrCodeDialog.js +1 -1
- package/dist/cjs/components/QrScanner.js +1 -1
- package/dist/cjs/components/RecordModal.js +1 -1
- package/dist/cjs/components/SearchBox.js +1 -1
- package/dist/cjs/components/SnapFooter.js +1 -1
- package/dist/cjs/components/Spinner.js +1 -1
- package/dist/cjs/components/Text.js +1 -1
- package/dist/cjs/components/TextHeader.js +1 -1
- package/dist/cjs/components/Textarea.js +1 -1
- package/dist/cjs/components/Title.js +1 -1
- package/dist/cjs/components/TypingIndicator.js +1 -1
- package/dist/cjs/components/UploadFile.js +1 -1
- package/dist/cjs/components/UrlProcessor.js +1 -1
- package/dist/cjs/components/VoiceIcon.js +1 -1
- package/dist/cjs/hooks/useAppStyles.js +1 -1
- package/dist/cjs/hooks/useAuthState.js +1 -1
- package/dist/cjs/hooks/useCodicentState.js +1 -1
- package/dist/cjs/hooks/useToaster.js +1 -1
- package/dist/cjs/node_modules/@fluentui/keyboard-keys/lib/keys.js +1 -1
- package/dist/cjs/node_modules/@fluentui/react-calendar-compat/lib/components/Calendar/calendarNavigationIcons.js +1 -1
- package/dist/cjs/node_modules/@fluentui/react-combobox/lib/components/Combobox/useCombobox.js +1 -1
- package/dist/cjs/node_modules/@fluentui/react-combobox/lib/components/Option/useOption.js +1 -1
- package/dist/cjs/node_modules/@fluentui/react-datepicker-compat/lib/components/DatePicker/useDatePicker.js +1 -1
- package/dist/cjs/node_modules/@fluentui/react-field/lib/contexts/FieldContext.js +1 -1
- package/dist/cjs/node_modules/@fluentui/react-shared-contexts/lib/CustomStyleHooksContext/CustomStyleHooksContext.js +1 -1
- package/dist/cjs/node_modules/@fluentui/react-shared-contexts/lib/OverridesContext/OverridesContext.js +1 -1
- package/dist/cjs/node_modules/@fluentui/react-shared-contexts/lib/ProviderContext/ProviderContext.js +1 -1
- package/dist/cjs/node_modules/@fluentui/react-shared-contexts/lib/ThemeClassNameContext/ThemeClassNameContext.js +1 -1
- package/dist/cjs/node_modules/@fluentui/react-tabster/lib/focus/constants.js +1 -1
- package/dist/cjs/node_modules/@fluentui/react-timepicker-compat/lib/components/TimePicker/useTimePicker.js +1 -1
- package/dist/cjs/node_modules/@fluentui/react-utilities/lib/ssr/SSRContext.js +1 -1
- package/dist/cjs/node_modules/@griffel/core/constants.esm.js +1 -1
- package/dist/cjs/node_modules/@griffel/react/TextDirectionContext.esm.js +1 -1
- package/dist/cjs/node_modules/tabster/dist/tabster.esm.js +17 -21
- package/dist/cjs/pages/AppFrame.js +1 -1
- package/dist/cjs/pages/Chat.js +1 -1
- package/dist/cjs/pages/Compose.js +1 -1
- package/dist/cjs/pages/CrmPage.js +1 -1
- package/dist/cjs/pages/CrmPagePersistent.js +1 -1
- package/dist/cjs/pages/FormAccept.js +1 -1
- package/dist/cjs/pages/FormInvite.js +1 -1
- package/dist/cjs/pages/HtmlViewer.js +1 -1
- package/dist/cjs/pages/ImageView.js +1 -1
- package/dist/cjs/pages/Login.js +1 -1
- package/dist/cjs/pages/Purchase.js +1 -1
- package/dist/cjs/pages/QrScan.js +1 -1
- package/dist/cjs/pages/Sales.js +1 -1
- package/dist/cjs/pages/SchemaEditor.js +1 -1
- package/dist/cjs/pages/Search.js +1 -1
- package/dist/cjs/pages/Snap.js +1 -1
- package/dist/esm/bootstrap.js +1 -1
- package/dist/esm/components/AiInput.js +1 -1
- package/dist/esm/components/AudioIcon.js +1 -1
- package/dist/esm/components/BulkUploadDialog.js +1 -1
- package/dist/esm/components/Button.js +1 -1
- package/dist/esm/components/ChatInput.js +1 -1
- package/dist/esm/components/ChatMessage.js +1 -1
- package/dist/esm/components/CombinedPlaceholderDialog.js +1 -1
- package/dist/esm/components/CompoundButton.js +1 -1
- package/dist/esm/components/Content.js +1 -1
- package/dist/esm/components/Dialog.js +1 -1
- package/dist/esm/components/FileThumbnail.js +1 -1
- package/dist/esm/components/Footer.js +1 -1
- package/dist/esm/components/GenericJsonRenderer.js +1 -1
- package/dist/esm/components/Header.js +1 -1
- package/dist/esm/components/HtmlView.js +1 -1
- package/dist/esm/components/Input.js +1 -1
- package/dist/esm/components/Label.js +1 -1
- package/dist/esm/components/LanguageSelector.js +1 -1
- package/dist/esm/components/ListView.js +1 -1
- package/dist/esm/components/Markdown.js +1 -1
- package/dist/esm/components/MessageInput.js +1 -1
- package/dist/esm/components/MessageItem.js +1 -1
- package/dist/esm/components/OfflineMessage.js +1 -1
- package/dist/esm/components/Page.js +1 -1
- package/dist/esm/components/Profile.js +1 -1
- package/dist/esm/components/Prompt.js +1 -1
- package/dist/esm/components/QrCodeDialog.js +1 -1
- package/dist/esm/components/QrScanner.js +1 -1
- package/dist/esm/components/RecordModal.js +1 -1
- package/dist/esm/components/SearchBox.js +1 -1
- package/dist/esm/components/SnapFooter.js +1 -1
- package/dist/esm/components/Spinner.js +1 -1
- package/dist/esm/components/Text.js +1 -1
- package/dist/esm/components/TextHeader.js +1 -1
- package/dist/esm/components/Textarea.js +1 -1
- package/dist/esm/components/Title.js +1 -1
- package/dist/esm/components/TypingIndicator.js +1 -1
- package/dist/esm/components/UploadFile.js +1 -1
- package/dist/esm/components/UrlProcessor.js +1 -1
- package/dist/esm/components/VoiceIcon.js +1 -1
- package/dist/esm/hooks/useAppStyles.js +1 -1
- package/dist/esm/hooks/useAuthState.js +1 -1
- package/dist/esm/hooks/useCodicentState.js +1 -1
- package/dist/esm/hooks/useToaster.js +1 -1
- package/dist/esm/node_modules/@fluentui/keyboard-keys/lib/keys.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-calendar-compat/lib/components/Calendar/calendarNavigationIcons.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-combobox/lib/components/Combobox/useCombobox.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-combobox/lib/components/Listbox/useListbox.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-combobox/lib/components/Option/useOption.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-combobox/lib/contexts/useListboxContextValues.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-datepicker-compat/lib/components/DatePicker/useDatePicker.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-field/lib/contexts/FieldContext.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-shared-contexts/lib/CustomStyleHooksContext/CustomStyleHooksContext.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-shared-contexts/lib/OverridesContext/OverridesContext.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-shared-contexts/lib/ProviderContext/ProviderContext.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-shared-contexts/lib/ThemeClassNameContext/ThemeClassNameContext.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-tabster/lib/focus/constants.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-tabster/lib/hooks/useArrowNavigationGroup.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-timepicker-compat/lib/components/TimePicker/useTimePicker.js +1 -1
- package/dist/esm/node_modules/@fluentui/react-utilities/lib/ssr/SSRContext.js +1 -1
- package/dist/esm/node_modules/@griffel/core/constants.esm.js +1 -1
- package/dist/esm/node_modules/@griffel/react/TextDirectionContext.esm.js +1 -1
- package/dist/esm/node_modules/tabster/dist/tabster.esm.js +17 -21
- package/dist/esm/pages/AppFrame.js +1 -1
- package/dist/esm/pages/Chat.js +1 -1
- package/dist/esm/pages/Compose.js +1 -1
- package/dist/esm/pages/CrmPage.js +1 -1
- package/dist/esm/pages/CrmPagePersistent.js +1 -1
- package/dist/esm/pages/FormAccept.js +1 -1
- package/dist/esm/pages/FormInvite.js +1 -1
- package/dist/esm/pages/HtmlViewer.js +1 -1
- package/dist/esm/pages/ImageView.js +1 -1
- package/dist/esm/pages/Login.js +1 -1
- package/dist/esm/pages/Purchase.js +1 -1
- package/dist/esm/pages/QrScan.js +1 -1
- package/dist/esm/pages/Sales.js +1 -1
- package/dist/esm/pages/SchemaEditor.js +1 -1
- package/dist/esm/pages/Search.js +1 -1
- package/dist/esm/pages/Snap.js +1 -1
- package/package.json +2 -2
|
@@ -2,66 +2,62 @@ import{nativeFocus as e,KEYBORG_FOCUSIN as t,KEYBORG_FOCUSOUT as s,createKeyborg
|
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
4
4
|
* Licensed under the MIT License.
|
|
5
|
-
*/const n="data-tabster",r="data-tabster-dummy",l=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","*[tabindex]","*[contenteditable]","details > summary","audio[controls]","video[controls]"].join(", "),a={EscapeGroupper:1,Restorer:2,Deloser:3},
|
|
5
|
+
*/const n="data-tabster",r="data-tabster-dummy",l=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","*[tabindex]","*[contenteditable]","details > summary","audio[controls]","video[controls]"].join(", "),a={EscapeGroupper:1,Restorer:2,Deloser:3},d={Invisible:0,PartiallyVisible:1,Visible:2},u={Source:0,Target:1},c={Both:0,Vertical:1,Horizontal:2,Grid:3,GridLinear:4},h={ArrowUp:1,ArrowDown:2,ArrowLeft:3,ArrowRight:4,PageUp:5,PageDown:6,Home:7,End:8},m={Auto:0,Inside:1,Outside:2};
|
|
6
6
|
/*!
|
|
7
7
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
8
|
* Licensed under the MIT License.
|
|
9
9
|
*/
|
|
10
|
-
function
|
|
10
|
+
function _(e,t){var s;return null===(s=e.storageEntry(t))||void 0===s?void 0:s.tabster}function v(e,t,s){var i,o;const r=s||e._noop?void 0:t.getAttribute(n);let l,a=e.storageEntry(t);if(r){if(r===(null===(i=null==a?void 0:a.attr)||void 0===i?void 0:i.string))return;try{const e=JSON.parse(r);if("object"!=typeof e)throw new Error(`Value is not a JSON object, got '${r}'.`);l={string:r,object:e}}catch(e){"development"===process.env.NODE_ENV&&console.error(`data-tabster attribute error: ${e}`,t)}}else if(!a)return;a||(a=e.storageEntry(t,!0)),a.tabster||(a.tabster={});const d=a.tabster||{},u=(null===(o=a.attr)||void 0===o?void 0:o.object)||{},c=(null==l?void 0:l.object)||{};for(const s of Object.keys(u))if(!c[s]){if("root"===s){const t=d[s];t&&e.root.onRoot(t,!0)}switch(s){case"deloser":case"root":case"groupper":case"modalizer":case"restorer":case"mover":const i=d[s];i&&(i.dispose(),delete d[s]);break;case"observed":delete d[s],e.observedElement&&e.observedElement.onObservedElementUpdate(t);break;case"focusable":case"outline":case"uncontrolled":case"sys":delete d[s]}}for(const s of Object.keys(c)){const i=c.sys;switch(s){case"deloser":d.deloser?d.deloser.setProps(c.deloser):e.deloser?d.deloser=e.deloser.createDeloser(t,c.deloser):"development"===process.env.NODE_ENV&&console.error("Deloser API used before initialization, please call `getDeloser()`");break;case"root":d.root?d.root.setProps(c.root):d.root=e.root.createRoot(t,c.root,i),e.root.onRoot(d.root);break;case"modalizer":d.modalizer?d.modalizer.setProps(c.modalizer):e.modalizer?d.modalizer=e.modalizer.createModalizer(t,c.modalizer,i):"development"===process.env.NODE_ENV&&console.error("Modalizer API used before initialization, please call `getModalizer()`");break;case"restorer":d.restorer?d.restorer.setProps(c.restorer):e.restorer?c.restorer&&(d.restorer=e.restorer.createRestorer(t,c.restorer)):"development"===process.env.NODE_ENV&&console.error("Restorer API used before initialization, please call `getRestorer()`");break;case"focusable":d.focusable=c.focusable;break;case"groupper":d.groupper?d.groupper.setProps(c.groupper):e.groupper?d.groupper=e.groupper.createGroupper(t,c.groupper,i):"development"===process.env.NODE_ENV&&console.error("Groupper API used before initialization, please call `getGroupper()`");break;case"mover":d.mover?d.mover.setProps(c.mover):e.mover?d.mover=e.mover.createMover(t,c.mover,i):"development"===process.env.NODE_ENV&&console.error("Mover API used before initialization, please call `getMover()`");break;case"observed":e.observedElement?(d.observed=c.observed,e.observedElement.onObservedElementUpdate(t)):"development"===process.env.NODE_ENV&&console.error("ObservedElement API used before initialization, please call `getObservedElement()`");break;case"uncontrolled":d.uncontrolled=c.uncontrolled;break;case"outline":e.outline?d.outline=c.outline:"development"===process.env.NODE_ENV&&console.error("Outline API used before initialization, please call `getOutline()`");break;case"sys":d.sys=c.sys;break;default:console.error(`Unknown key '${s}' in data-tabster attribute value.`)}}l?a.attr=l:(0===Object.keys(d).length&&(delete a.tabster,delete a.attr),e.storageEntry(t,!1))}
|
|
11
11
|
/*!
|
|
12
12
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
13
13
|
* Licensed under the MIT License.
|
|
14
|
-
*/const
|
|
14
|
+
*/const f="tabster:focusin",b="tabster:focusout",p="tabster:movefocus",g="tabster:modalizer:active",E="tabster:modalizer:inactive",y="tabster:mover:state",w="tabster:mover:movefocus",T="tabster:mover:memorized-element",F="tabster:restorer:restore-focus",I="tabster:root:focus",C="tabster:root:blur",D="undefined"!=typeof CustomEvent?CustomEvent:function(){};class O extends D{constructor(e,t){super(e,{bubbles:!0,cancelable:!0,composed:!0,detail:t}),this.details=t}}class k extends O{constructor(e){super(f,e)}}class N extends O{constructor(e){super(b,e)}}class A extends O{constructor(e){super(p,e)}}class R extends O{constructor(e){super(y,e)}}class P extends O{constructor(e){super(g,e)}}class M extends O{constructor(e){super(E,e)}}class x extends O{constructor(){super(F)}}class z extends O{constructor(e){super(I,e)}}class W extends O{constructor(e){super(C,e)}}
|
|
15
15
|
/*!
|
|
16
16
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
17
17
|
* Licensed under the MIT License.
|
|
18
|
-
*/const
|
|
18
|
+
*/const L={createMutationObserver:e=>new MutationObserver(e),createTreeWalker:(e,t,s,i)=>e.createTreeWalker(t,s,i),getParentNode:e=>e?e.parentNode:null,getParentElement:e=>e?e.parentElement:null,nodeContains:(e,t)=>!(!t||!(null==e?void 0:e.contains(t))),getActiveElement:e=>e.activeElement,querySelector:(e,t)=>e.querySelector(t),querySelectorAll:(e,t)=>Array.prototype.slice.call(e.querySelectorAll(t),0),getElementById:(e,t)=>e.getElementById(t),getFirstChild:e=>(null==e?void 0:e.firstChild)||null,getLastChild:e=>(null==e?void 0:e.lastChild)||null,getNextSibling:e=>(null==e?void 0:e.nextSibling)||null,getPreviousSibling:e=>(null==e?void 0:e.previousSibling)||null,getFirstElementChild:e=>(null==e?void 0:e.firstElementChild)||null,getLastElementChild:e=>(null==e?void 0:e.lastElementChild)||null,getNextElementSibling:e=>(null==e?void 0:e.nextElementSibling)||null,getPreviousElementSibling:e=>(null==e?void 0:e.previousElementSibling)||null,appendChild:(e,t)=>e.appendChild(t),insertBefore:(e,t,s)=>e.insertBefore(t,s),getSelection:e=>{var t;return(null===(t=e.ownerDocument)||void 0===t?void 0:t.getSelection())||null},getElementsByName:(e,t)=>e.ownerDocument.getElementsByName(t)};
|
|
19
19
|
/*!
|
|
20
20
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
21
21
|
* Licensed under the MIT License.
|
|
22
22
|
*/
|
|
23
|
-
let U;const K="undefined"!=typeof DOMRect?DOMRect:class{constructor(e,t,s,i){this.left=e||0,this.top=t||0,this.right=(e||0)+(s||0),this.bottom=(t||0)+(i||0)}};let j=0;try{document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT),U=!1}catch(e){U=!0}function G(e){const t=e();let s=t.__tabsterInstanceContext;return s||(s={elementByUId:{},basics:{Promise:t.Promise||void 0,WeakRef:t.WeakRef||void 0},containerBoundingRectCache:{},lastContainerBoundingRectCacheId:0,fakeWeakRefs:[],fakeWeakRefsStarted:!1},t.__tabsterInstanceContext=s),s}class H{constructor(e){this._target=e}deref(){return this._target}static cleanup(e,t){return!e._target||!(!t&&ie(e._target.ownerDocument,e._target))&&(delete e._target,!0)}}class Q{constructor(e,t,s){const i=G(e);let o;i.WeakRef?o=new i.WeakRef(t):(o=new H(t),i.fakeWeakRefs.push(o)),this._ref=o,this._data=s}get(){const e=this._ref;let t;return e&&(t=e.deref(),t||delete this._ref),t}getData(){return this._data}}function q(e,t){const s=G(e);s.fakeWeakRefs=s.fakeWeakRefs.filter((e=>!H.cleanup(e,t)))}function J(e){const t=G(e);t.fakeWeakRefsStarted||(t.fakeWeakRefsStarted=!0,t.WeakRef=function(e){return e.basics.WeakRef}(t)),t.fakeWeakRefsTimer||(t.fakeWeakRefsTimer=e().setTimeout((()=>{t.fakeWeakRefsTimer=void 0,q(e),J(e)}),12e4))}function $(e,t,s){if(t.nodeType!==Node.ELEMENT_NODE)return;const i=U?s:{acceptNode:s};return V.createTreeWalker(e,t,NodeFilter.SHOW_ELEMENT,i,!1)}function Y(e,t){let s=t.__tabsterCacheId;const i=G(e),o=s?i.containerBoundingRectCache[s]:void 0;if(o)return o.rect;const n=t.ownerDocument&&t.ownerDocument.documentElement;if(!n)return new K;let r=0,l=0,a=n.clientWidth,u=n.clientHeight;if(t!==n){const e=t.getBoundingClientRect();r=Math.max(r,e.left),l=Math.max(l,e.top),a=Math.min(a,e.right),u=Math.min(u,e.bottom)}const d=new K(r<a?r:-1,l<u?l:-1,r<a?a-r:0,l<u?u-l:0);return s||(s="r-"+ ++i.lastContainerBoundingRectCacheId,t.__tabsterCacheId=s),i.containerBoundingRectCache[s]={rect:d,element:t},i.containerBoundingRectCacheTimer||(i.containerBoundingRectCacheTimer=window.setTimeout((()=>{i.containerBoundingRectCacheTimer=void 0;for(const e of Object.keys(i.containerBoundingRectCache))delete i.containerBoundingRectCache[e].element.__tabsterCacheId;i.containerBoundingRectCache={}}),50)),d}function X(e,t,s){const i=Z(t);if(!i)return!1;const o=Y(e,i),n=t.getBoundingClientRect(),r=n.height*(1-s),l=Math.max(0,o.top-n.top)+Math.max(0,n.bottom-o.bottom);return 0===l||l<=r}function Z(e){const t=e.ownerDocument;if(t){for(let t=V.getParentElement(e);t;t=V.getParentElement(t))if(t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight)return t;return t.documentElement}return null}function ee(e){return!!e.__shouldIgnoreFocus}function te(e,t){const s=G(e);let i=t.__tabsterElementUID;return i||(i=t.__tabsterElementUID=function(e){const t=new Uint32Array(4);if(e.crypto&&e.crypto.getRandomValues)e.crypto.getRandomValues(t);else if(e.msCrypto&&e.msCrypto.getRandomValues)e.msCrypto.getRandomValues(t);else for(let e=0;e<t.length;e++)t[e]=4294967295*Math.random();const s=[];for(let e=0;e<t.length;e++)s.push(t[e].toString(36));return s.push("|"),s.push((++j).toString(36)),s.push("|"),s.push(Date.now().toString(36)),s.join("")}(e())),!s.elementByUId[i]&&ie(t.ownerDocument,t)&&(s.elementByUId[i]=new Q(e,t)),i}function se(e,t){const s=G(e);for(const e of Object.keys(s.elementByUId)){const i=s.elementByUId[e],o=i&&i.get();o&&t&&!V.nodeContains(t,o)||delete s.elementByUId[e]}}function ie(e,t){return V.nodeContains(null==e?void 0:e.body,t)}function oe(e,t){const s=e.matches||e.matchesSelector||e.msMatchesSelector||e.webkitMatchesSelector;return s&&s.call(e,t)}let ne=0;class re{constructor(e,t,s){const i=e.getWindow;this._tabster=e,this._element=new Q(i,t),this._props={...s},this.id="i"+ ++ne}getElement(){return this._element.get()}getProps(){return this._props}setProps(e){this._props={...e}}}class le{constructor(t,s,i,o,n){var l;this._focusIn=t=>{if(this._fixedTarget){const t=this._fixedTarget.get();return void(t&&e(t))}const s=this.input;if(this.onFocusIn&&s){const e=t.relatedTarget;this.onFocusIn(this,this._isBackward(!0,s,e),e)}},this._focusOut=e=>{if(this._fixedTarget)return;this.useDefaultAction=!1;const t=this.input;if(this.onFocusOut&&t){const s=e.relatedTarget;this.onFocusOut(this,this._isBackward(!1,t,s),s)}};const a=t(),u=a.document.createElement("i");u.tabIndex=0,u.setAttribute("role","none"),u.setAttribute(r,""),u.setAttribute("aria-hidden","true");const d=u.style;d.position="fixed",d.width=d.height="1px",d.opacity="0.001",d.zIndex="-1",d.setProperty("content-visibility","hidden"),function(e){e.__shouldIgnoreFocus=!0}(u),this.input=u,this.isFirst=i.isFirst,this.isOutside=s,this._isPhantom=null!==(l=i.isPhantom)&&void 0!==l&&l,this._fixedTarget=n,u.addEventListener("focusin",this._focusIn),u.addEventListener("focusout",this._focusOut),u.__tabsterDummyContainer=o,this._isPhantom&&(this._disposeTimer=a.setTimeout((()=>{delete this._disposeTimer,this.dispose()}),0),this._clearDisposeTimeout=()=>{this._disposeTimer&&(a.clearTimeout(this._disposeTimer),delete this._disposeTimer),delete this._clearDisposeTimeout})}dispose(){var e;this._clearDisposeTimeout&&this._clearDisposeTimeout();const t=this.input;t&&(delete this._fixedTarget,delete this.onFocusIn,delete this.onFocusOut,delete this.input,t.removeEventListener("focusin",this._focusIn),t.removeEventListener("focusout",this._focusOut),delete t.__tabsterDummyContainer,null===(e=V.getParentNode(t))||void 0===e||e.removeChild(t))}setTopLeft(e,t){var s;const i=null===(s=this.input)||void 0===s?void 0:s.style;i&&(i.top=`${e}px`,i.left=`${t}px`)}_isBackward(e,t,s){return e&&!s?!this.isFirst:!!(s&&t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING)}}const ae=1,ue=2,de=3,ce=4;class he{constructor(e,t,s,i,o,n){this._element=t,this._instance=new ve(e,t,this,s,i,o,n)}_setHandlers(e,t){this._onFocusIn=e,this._onFocusOut=t}moveOut(e){var t;null===(t=this._instance)||void 0===t||t.moveOut(e)}moveOutWithDefaultAction(e,t){var s;null===(s=this._instance)||void 0===s||s.moveOutWithDefaultAction(e,t)}getHandler(e){return e?this._onFocusIn:this._onFocusOut}setTabbable(e){var t;null===(t=this._instance)||void 0===t||t.setTabbable(this,e)}dispose(){this._instance&&(this._instance.dispose(this),delete this._instance),delete this._onFocusIn,delete this._onFocusOut}static moveWithPhantomDummy(t,s,i,o,n){const r=new le(t.getWindow,!0,{isPhantom:!0,isFirst:!0}).input;if(r){let l,a;if("BODY"===s.tagName)l=s,a=i&&o||!i&&!o?V.getFirstElementChild(s):null;else{let e,n;i&&(!o||o&&!t.focusable.isFocusable(s,!1,!0,!0))?(l=s,a=o?s.firstElementChild:null):(l=V.getParentElement(s),a=i&&o||!i&&!o?s:V.getNextElementSibling(s));do{e=i&&o||!i&&!o?V.getPreviousElementSibling(a):a,n=ge(e),n===s?a=i&&o||!i&&!o?e:V.getNextElementSibling(e):n=null}while(n)}(null==l?void 0:l.dispatchEvent(new M({by:"root",owner:l,next:null,relatedEvent:n})))&&(V.insertBefore(l,r,a),e(r))}}static addPhantomDummyWithTarget(e,t,s,i){const o=new le(e.getWindow,!0,{isPhantom:!0,isFirst:!0},void 0,new Q(e.getWindow,i)).input;if(o){let e,i;t.querySelector(l)&&!s?(e=t,i=V.getFirstElementChild(t)):(e=V.getParentElement(t),i=s?t:V.getNextElementSibling(t)),e&&V.insertBefore(e,o,i)}}}function me(e,t){var s;const i={1:"Root",2:"Modalizer",3:"Mover",4:"Groupper"};null===(s=e.input)||void 0===s||s.setAttribute(r,[`isFirst=${e.isFirst}`,`isOutside=${e.isOutside}`,...t.map((e=>`(${i[e.priority]}, tabbable=${e.tabbable})`))].join(", "))}class _e{constructor(e){this._updateQueue=new Set,this._lastUpdateQueueTime=0,this._changedParents=new WeakSet,this._dummyElements=[],this._dummyCallbacks=new WeakMap,this._domChanged=e=>{var t;this._changedParents.has(e)||(this._changedParents.add(e),this._updateDummyInputsTimer||(this._updateDummyInputsTimer=null===(t=this._win)||void 0===t?void 0:t.call(this).setTimeout((()=>{delete this._updateDummyInputsTimer;for(const e of this._dummyElements){const t=e.get();if(t){const e=this._dummyCallbacks.get(t);if(e){const s=V.getParentNode(t);s&&!this._changedParents.has(s)||e()}}}this._changedParents=new WeakSet}),100)))},this._win=e}add(e,t){!this._dummyCallbacks.has(e)&&this._win&&(this._dummyElements.push(new Q(this._win,e)),this._dummyCallbacks.set(e,t),this.domChanged=this._domChanged)}remove(e){this._dummyElements=this._dummyElements.filter((t=>{const s=t.get();return s&&s!==e})),this._dummyCallbacks.delete(e),0===this._dummyElements.length&&delete this.domChanged}dispose(){var e;const t=null===(e=this._win)||void 0===e?void 0:e.call(this);this._updateTimer&&(null==t||t.clearTimeout(this._updateTimer),delete this._updateTimer),this._updateDummyInputsTimer&&(null==t||t.clearTimeout(this._updateDummyInputsTimer),delete this._updateDummyInputsTimer),this._changedParents=new WeakSet,this._dummyCallbacks=new WeakMap,this._dummyElements=[],this._updateQueue.clear(),delete this.domChanged,delete this._win}updatePositions(e){this._win&&(this._updateQueue.add(e),this._lastUpdateQueueTime=Date.now(),this._scheduledUpdatePositions())}_scheduledUpdatePositions(){var e;this._updateTimer||(this._updateTimer=null===(e=this._win)||void 0===e?void 0:e.call(this).setTimeout((()=>{if(delete this._updateTimer,this._lastUpdateQueueTime+100<=Date.now()){const e=new Map,t=[];for(const s of this._updateQueue)t.push(s(e));this._updateQueue.clear();for(const e of t)e();e.clear()}else this._scheduledUpdatePositions()}),100))}}class ve{constructor(t,s,i,o,n,r,l){this._wrappers=[],this._isOutside=!1,this._transformElements=new Set,this._onFocusIn=(e,t,s)=>{this._onFocus(!0,e,t,s)},this._onFocusOut=(e,t,s)=>{this._onFocus(!1,e,t,s)},this.moveOut=t=>{var s;const i=this._firstDummy,o=this._lastDummy;if(i&&o){this._ensurePosition();const n=i.input,r=o.input,l=null===(s=this._element)||void 0===s?void 0:s.get();if(n&&r&&l){let s;t?(n.tabIndex=0,s=n):(r.tabIndex=0,s=r),s&&e(s)}}},this.moveOutWithDefaultAction=(t,s)=>{var i;const o=this._firstDummy,n=this._lastDummy;if(o&&n){this._ensurePosition();const r=o.input,l=n.input,a=null===(i=this._element)||void 0===i?void 0:i.get();if(r&&l&&a){let i;t?!o.isOutside&&this._tabster.focusable.isFocusable(a,!0,!0,!0)?i=a:(o.useDefaultAction=!0,r.tabIndex=0,i=r):(n.useDefaultAction=!0,l.tabIndex=0,i=l),i&&a.dispatchEvent(new M({by:"root",owner:a,next:null,relatedEvent:s}))&&e(i)}}},this.setTabbable=(e,t)=>{var s,i;for(const s of this._wrappers)if(s.manager===e){s.tabbable=t;break}const o=this._getCurrent();if(o){const e=o.tabbable?0:-1;let t=null===(s=this._firstDummy)||void 0===s?void 0:s.input;t&&(t.tabIndex=e),t=null===(i=this._lastDummy)||void 0===i?void 0:i.input,t&&(t.tabIndex=e)}"development"===process.env.NODE_ENV&&(this._firstDummy&&me(this._firstDummy,this._wrappers),this._lastDummy&&me(this._lastDummy,this._wrappers))},this._addDummyInputs=()=>{this._addTimer||(this._addTimer=this._getWindow().setTimeout((()=>{delete this._addTimer,this._ensurePosition(),"development"===process.env.NODE_ENV&&(this._firstDummy&&me(this._firstDummy,this._wrappers),this._lastDummy&&me(this._lastDummy,this._wrappers)),this._addTransformOffsets()}),0))},this._addTransformOffsets=()=>{this._tabster._dummyObserver.updatePositions(this._computeTransformOffsets)},this._computeTransformOffsets=e=>{var t,s;const i=(null===(t=this._firstDummy)||void 0===t?void 0:t.input)||(null===(s=this._lastDummy)||void 0===s?void 0:s.input),o=this._transformElements,n=new Set;let r=0,l=0;const a=this._getWindow();for(let t=i;t&&t.nodeType===Node.ELEMENT_NODE;t=V.getParentElement(t)){let s=e.get(t);if(void 0===s){const i=a.getComputedStyle(t).transform;i&&"none"!==i&&(s={scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),e.set(t,s||null)}s&&(n.add(t),o.has(t)||t.addEventListener("scroll",this._addTransformOffsets),r+=s.scrollTop,l+=s.scrollLeft)}for(const e of o)n.has(e)||e.removeEventListener("scroll",this._addTransformOffsets);return this._transformElements=n,()=>{var e,t;null===(e=this._firstDummy)||void 0===e||e.setTopLeft(r,l),null===(t=this._lastDummy)||void 0===t||t.setTopLeft(r,l)}};const a=s.get();if(!a)throw new Error("No element");this._tabster=t,this._getWindow=t.getWindow,this._callForDefaultAction=l;const u=a.__tabsterDummy;if((u||this)._wrappers.push({manager:i,priority:o,tabbable:!0}),u)return"development"===process.env.NODE_ENV&&(this._firstDummy&&me(this._firstDummy,u._wrappers),this._lastDummy&&me(this._lastDummy,u._wrappers)),u;a.__tabsterDummy=this;const d=null==n?void 0:n.dummyInputsPosition,c=a.tagName;this._isOutside=d?d===v.Outside:(r||"UL"===c||"OL"===c||"TABLE"===c)&&!("LI"===c||"TD"===c||"TH"===c),this._firstDummy=new le(this._getWindow,this._isOutside,{isFirst:!0},s),this._lastDummy=new le(this._getWindow,this._isOutside,{isFirst:!1},s);const h=this._firstDummy.input;h&&t._dummyObserver.add(h,this._addDummyInputs),this._firstDummy.onFocusIn=this._onFocusIn,this._firstDummy.onFocusOut=this._onFocusOut,this._lastDummy.onFocusIn=this._onFocusIn,this._lastDummy.onFocusOut=this._onFocusOut,this._element=s,this._addDummyInputs()}dispose(e,t){var s,i,o,n;const r=this._wrappers=this._wrappers.filter((s=>s.manager!==e&&!t));if("development"===process.env.NODE_ENV&&(this._firstDummy&&me(this._firstDummy,r),this._lastDummy&&me(this._lastDummy,r)),0===r.length){delete(null===(s=this._element)||void 0===s?void 0:s.get()).__tabsterDummy;for(const e of this._transformElements)e.removeEventListener("scroll",this._addTransformOffsets);this._transformElements.clear();const e=this._getWindow();this._addTimer&&(e.clearTimeout(this._addTimer),delete this._addTimer);const t=null===(i=this._firstDummy)||void 0===i?void 0:i.input;t&&this._tabster._dummyObserver.remove(t),null===(o=this._firstDummy)||void 0===o||o.dispose(),null===(n=this._lastDummy)||void 0===n||n.dispose()}}_onFocus(e,t,s,i){var o;const n=this._getCurrent();!n||t.useDefaultAction&&!this._callForDefaultAction||null===(o=n.manager.getHandler(e))||void 0===o||o(t,s,i)}_getCurrent(){return this._wrappers.sort(((e,t)=>e.tabbable!==t.tabbable?e.tabbable?-1:1:e.priority-t.priority)),this._wrappers[0]}_ensurePosition(){var e,t,s;const i=null===(e=this._element)||void 0===e?void 0:e.get(),o=null===(t=this._firstDummy)||void 0===t?void 0:t.input,n=null===(s=this._lastDummy)||void 0===s?void 0:s.input;if(i&&o&&n)if(this._isOutside){const e=V.getParentNode(i);if(e){const t=V.getNextSibling(i);t!==n&&V.insertBefore(e,n,t),V.getPreviousElementSibling(i)!==o&&V.insertBefore(e,o,i)}}else{V.getLastElementChild(i)!==n&&V.appendChild(i,n);const e=V.getFirstElementChild(i);e&&e!==o&&e.parentNode&&V.insertBefore(e.parentNode,o,e)}}}function fe(e){let t=null;for(let s=V.getLastElementChild(e);s;s=V.getLastElementChild(s))t=s;return t||void 0}function pe(e,t,s,i){const o=e.storageEntry(t,!0);let n=!1;if(!o.aug){if(void 0===i)return n;o.aug={}}if(void 0===i){if(s in o.aug){const e=o.aug[s];delete o.aug[s],null===e?t.removeAttribute(s):t.setAttribute(s,e),n=!0}}else{let e;s in o.aug||(e=t.getAttribute(s)),void 0!==e&&e!==i&&(o.aug[s]=e,null===i?t.removeAttribute(s):t.setAttribute(s,i),n=!0)}return void 0===i&&0===Object.keys(o.aug).length&&(delete o.aug,e.storageEntry(t,!1)),n}function be(e){return"INPUT"===e.tagName&&!!e.name&&"radio"===e.type}function ge(e){var t;return(null===(t=null==e?void 0:e.__tabsterDummyContainer)||void 0===t?void 0:t.get())||null}
|
|
23
|
+
let S;const B="undefined"!=typeof DOMRect?DOMRect:class{constructor(e,t,s,i){this.left=e||0,this.top=t||0,this.right=(e||0)+(s||0),this.bottom=(t||0)+(i||0)}};let V=0;try{document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT),S=!1}catch(e){S=!0}function U(e){const t=e();let s=t.__tabsterInstanceContext;return s||(s={elementByUId:{},basics:{Promise:t.Promise||void 0,WeakRef:t.WeakRef||void 0},containerBoundingRectCache:{},lastContainerBoundingRectCacheId:0,fakeWeakRefs:[],fakeWeakRefsStarted:!1},t.__tabsterInstanceContext=s),s}class K{constructor(e){this._target=e}deref(){return this._target}static cleanup(e,t){return!e._target||!(!t&&ee(e._target.ownerDocument,e._target))&&(delete e._target,!0)}}class j{constructor(e,t,s){const i=U(e);let o;i.WeakRef?o=new i.WeakRef(t):(o=new K(t),i.fakeWeakRefs.push(o)),this._ref=o,this._data=s}get(){const e=this._ref;let t;return e&&(t=e.deref(),t||delete this._ref),t}getData(){return this._data}}function H(e,t){const s=U(e);s.fakeWeakRefs=s.fakeWeakRefs.filter((e=>!K.cleanup(e,t)))}function Q(e){const t=U(e);t.fakeWeakRefsStarted||(t.fakeWeakRefsStarted=!0,t.WeakRef=function(e){return e.basics.WeakRef}(t)),t.fakeWeakRefsTimer||(t.fakeWeakRefsTimer=e().setTimeout((()=>{t.fakeWeakRefsTimer=void 0,H(e),Q(e)}),12e4))}function G(e,t,s){if(t.nodeType!==Node.ELEMENT_NODE)return;const i=S?s:{acceptNode:s};return L.createTreeWalker(e,t,NodeFilter.SHOW_ELEMENT,i,!1)}function q(e,t){let s=t.__tabsterCacheId;const i=U(e),o=s?i.containerBoundingRectCache[s]:void 0;if(o)return o.rect;const n=t.ownerDocument&&t.ownerDocument.documentElement;if(!n)return new B;let r=0,l=0,a=n.clientWidth,d=n.clientHeight;if(t!==n){const e=t.getBoundingClientRect();r=Math.max(r,e.left),l=Math.max(l,e.top),a=Math.min(a,e.right),d=Math.min(d,e.bottom)}const u=new B(r<a?r:-1,l<d?l:-1,r<a?a-r:0,l<d?d-l:0);return s||(s="r-"+ ++i.lastContainerBoundingRectCacheId,t.__tabsterCacheId=s),i.containerBoundingRectCache[s]={rect:u,element:t},i.containerBoundingRectCacheTimer||(i.containerBoundingRectCacheTimer=window.setTimeout((()=>{i.containerBoundingRectCacheTimer=void 0;for(const e of Object.keys(i.containerBoundingRectCache))delete i.containerBoundingRectCache[e].element.__tabsterCacheId;i.containerBoundingRectCache={}}),50)),u}function J(e,t,s){const i=$(t);if(!i)return!1;const o=q(e,i),n=t.getBoundingClientRect(),r=n.height*(1-s),l=Math.max(0,o.top-n.top)+Math.max(0,n.bottom-o.bottom);return 0===l||l<=r}function $(e){const t=e.ownerDocument;if(t){for(let t=L.getParentElement(e);t;t=L.getParentElement(t))if(t.scrollWidth>t.clientWidth||t.scrollHeight>t.clientHeight)return t;return t.documentElement}return null}function Y(e){return!!e.__shouldIgnoreFocus}function X(e,t){const s=U(e);let i=t.__tabsterElementUID;return i||(i=t.__tabsterElementUID=function(e){const t=new Uint32Array(4);if(e.crypto&&e.crypto.getRandomValues)e.crypto.getRandomValues(t);else if(e.msCrypto&&e.msCrypto.getRandomValues)e.msCrypto.getRandomValues(t);else for(let e=0;e<t.length;e++)t[e]=4294967295*Math.random();const s=[];for(let e=0;e<t.length;e++)s.push(t[e].toString(36));return s.push("|"),s.push((++V).toString(36)),s.push("|"),s.push(Date.now().toString(36)),s.join("")}(e())),!s.elementByUId[i]&&ee(t.ownerDocument,t)&&(s.elementByUId[i]=new j(e,t)),i}function Z(e,t){const s=U(e);for(const e of Object.keys(s.elementByUId)){const i=s.elementByUId[e],o=i&&i.get();o&&t&&!L.nodeContains(t,o)||delete s.elementByUId[e]}}function ee(e,t){return L.nodeContains(null==e?void 0:e.body,t)}function te(e,t){const s=e.matches||e.matchesSelector||e.msMatchesSelector||e.webkitMatchesSelector;return s&&s.call(e,t)}let se=0;class ie{constructor(e,t,s){const i=e.getWindow;this._tabster=e,this._element=new j(i,t),this._props={...s},this.id="i"+ ++se}getElement(){return this._element.get()}getProps(){return this._props}setProps(e){this._props={...e}}}class oe{constructor(t,s,i,o,n){var l;this._focusIn=t=>{if(this._fixedTarget){const t=this._fixedTarget.get();return void(t&&e(t))}const s=this.input;if(this.onFocusIn&&s){const e=t.relatedTarget;this.onFocusIn(this,this._isBackward(!0,s,e),e)}},this._focusOut=e=>{if(this._fixedTarget)return;this.useDefaultAction=!1;const t=this.input;if(this.onFocusOut&&t){const s=e.relatedTarget;this.onFocusOut(this,this._isBackward(!1,t,s),s)}};const a=t(),d=a.document.createElement("i");d.tabIndex=0,d.setAttribute("role","none"),d.setAttribute(r,""),d.setAttribute("aria-hidden","true");const u=d.style;u.position="fixed",u.width=u.height="1px",u.opacity="0.001",u.zIndex="-1",u.setProperty("content-visibility","hidden"),function(e){e.__shouldIgnoreFocus=!0}(d),this.input=d,this.isFirst=i.isFirst,this.isOutside=s,this._isPhantom=null!==(l=i.isPhantom)&&void 0!==l&&l,this._fixedTarget=n,d.addEventListener("focusin",this._focusIn),d.addEventListener("focusout",this._focusOut),d.__tabsterDummyContainer=o,this._isPhantom&&(this._disposeTimer=a.setTimeout((()=>{delete this._disposeTimer,this.dispose()}),0),this._clearDisposeTimeout=()=>{this._disposeTimer&&(a.clearTimeout(this._disposeTimer),delete this._disposeTimer),delete this._clearDisposeTimeout})}dispose(){var e;this._clearDisposeTimeout&&this._clearDisposeTimeout();const t=this.input;t&&(delete this._fixedTarget,delete this.onFocusIn,delete this.onFocusOut,delete this.input,t.removeEventListener("focusin",this._focusIn),t.removeEventListener("focusout",this._focusOut),delete t.__tabsterDummyContainer,null===(e=L.getParentNode(t))||void 0===e||e.removeChild(t))}setTopLeft(e,t){var s;const i=null===(s=this.input)||void 0===s?void 0:s.style;i&&(i.top=`${e}px`,i.left=`${t}px`)}_isBackward(e,t,s){return e&&!s?!this.isFirst:!!(s&&t.compareDocumentPosition(s)&Node.DOCUMENT_POSITION_FOLLOWING)}}const ne=1,re=2,le=3;class ae{constructor(e,t,s,i,o,n){this._element=t,this._instance=new ce(e,t,this,s,i,o,n)}_setHandlers(e,t){this._onFocusIn=e,this._onFocusOut=t}moveOut(e){var t;null===(t=this._instance)||void 0===t||t.moveOut(e)}moveOutWithDefaultAction(e,t){var s;null===(s=this._instance)||void 0===s||s.moveOutWithDefaultAction(e,t)}getHandler(e){return e?this._onFocusIn:this._onFocusOut}setTabbable(e){var t;null===(t=this._instance)||void 0===t||t.setTabbable(this,e)}dispose(){this._instance&&(this._instance.dispose(this),delete this._instance),delete this._onFocusIn,delete this._onFocusOut}static moveWithPhantomDummy(t,s,i,o,n){const r=new oe(t.getWindow,!0,{isPhantom:!0,isFirst:!0}).input;if(r){let l,a;if("BODY"===s.tagName)l=s,a=i&&o||!i&&!o?L.getFirstElementChild(s):null;else{let e,n;i&&(!o||o&&!t.focusable.isFocusable(s,!1,!0,!0))?(l=s,a=o?s.firstElementChild:null):(l=L.getParentElement(s),a=i&&o||!i&&!o?s:L.getNextElementSibling(s));do{e=i&&o||!i&&!o?L.getPreviousElementSibling(a):a,n=ve(e),n===s?a=i&&o||!i&&!o?e:L.getNextElementSibling(e):n=null}while(n)}(null==l?void 0:l.dispatchEvent(new A({by:"root",owner:l,next:null,relatedEvent:n})))&&(L.insertBefore(l,r,a),e(r))}}static addPhantomDummyWithTarget(e,t,s,i){const o=new oe(e.getWindow,!0,{isPhantom:!0,isFirst:!0},void 0,new j(e.getWindow,i)).input;if(o){let e,i;t.querySelector(l)&&!s?(e=t,i=L.getFirstElementChild(t)):(e=L.getParentElement(t),i=s?t:L.getNextElementSibling(t)),e&&L.insertBefore(e,o,i)}}}function de(e,t){var s;const i={1:"Root",2:"Modalizer",3:"Mover",4:"Groupper"};null===(s=e.input)||void 0===s||s.setAttribute(r,[`isFirst=${e.isFirst}`,`isOutside=${e.isOutside}`,...t.map((e=>`(${i[e.priority]}, tabbable=${e.tabbable})`))].join(", "))}class ue{constructor(e){this._updateQueue=new Set,this._lastUpdateQueueTime=0,this._changedParents=new WeakSet,this._dummyElements=[],this._dummyCallbacks=new WeakMap,this._domChanged=e=>{var t;this._changedParents.has(e)||(this._changedParents.add(e),this._updateDummyInputsTimer||(this._updateDummyInputsTimer=null===(t=this._win)||void 0===t?void 0:t.call(this).setTimeout((()=>{delete this._updateDummyInputsTimer;for(const e of this._dummyElements){const t=e.get();if(t){const e=this._dummyCallbacks.get(t);if(e){const s=L.getParentNode(t);s&&!this._changedParents.has(s)||e()}}}this._changedParents=new WeakSet}),100)))},this._win=e}add(e,t){!this._dummyCallbacks.has(e)&&this._win&&(this._dummyElements.push(new j(this._win,e)),this._dummyCallbacks.set(e,t),this.domChanged=this._domChanged)}remove(e){this._dummyElements=this._dummyElements.filter((t=>{const s=t.get();return s&&s!==e})),this._dummyCallbacks.delete(e),0===this._dummyElements.length&&delete this.domChanged}dispose(){var e;const t=null===(e=this._win)||void 0===e?void 0:e.call(this);this._updateTimer&&(null==t||t.clearTimeout(this._updateTimer),delete this._updateTimer),this._updateDummyInputsTimer&&(null==t||t.clearTimeout(this._updateDummyInputsTimer),delete this._updateDummyInputsTimer),this._changedParents=new WeakSet,this._dummyCallbacks=new WeakMap,this._dummyElements=[],this._updateQueue.clear(),delete this.domChanged,delete this._win}updatePositions(e){this._win&&(this._updateQueue.add(e),this._lastUpdateQueueTime=Date.now(),this._scheduledUpdatePositions())}_scheduledUpdatePositions(){var e;this._updateTimer||(this._updateTimer=null===(e=this._win)||void 0===e?void 0:e.call(this).setTimeout((()=>{if(delete this._updateTimer,this._lastUpdateQueueTime+100<=Date.now()){const e=new Map,t=[];for(const s of this._updateQueue)t.push(s(e));this._updateQueue.clear();for(const e of t)e();e.clear()}else this._scheduledUpdatePositions()}),100))}}class ce{constructor(t,s,i,o,n,r,l){this._wrappers=[],this._isOutside=!1,this._transformElements=new Set,this._onFocusIn=(e,t,s)=>{this._onFocus(!0,e,t,s)},this._onFocusOut=(e,t,s)=>{this._onFocus(!1,e,t,s)},this.moveOut=t=>{var s;const i=this._firstDummy,o=this._lastDummy;if(i&&o){this._ensurePosition();const n=i.input,r=o.input,l=null===(s=this._element)||void 0===s?void 0:s.get();if(n&&r&&l){let s;t?(n.tabIndex=0,s=n):(r.tabIndex=0,s=r),s&&e(s)}}},this.moveOutWithDefaultAction=(t,s)=>{var i;const o=this._firstDummy,n=this._lastDummy;if(o&&n){this._ensurePosition();const r=o.input,l=n.input,a=null===(i=this._element)||void 0===i?void 0:i.get();if(r&&l&&a){let i;t?!o.isOutside&&this._tabster.focusable.isFocusable(a,!0,!0,!0)?i=a:(o.useDefaultAction=!0,r.tabIndex=0,i=r):(n.useDefaultAction=!0,l.tabIndex=0,i=l),i&&a.dispatchEvent(new A({by:"root",owner:a,next:null,relatedEvent:s}))&&e(i)}}},this.setTabbable=(e,t)=>{var s,i;for(const s of this._wrappers)if(s.manager===e){s.tabbable=t;break}const o=this._getCurrent();if(o){const e=o.tabbable?0:-1;let t=null===(s=this._firstDummy)||void 0===s?void 0:s.input;t&&(t.tabIndex=e),t=null===(i=this._lastDummy)||void 0===i?void 0:i.input,t&&(t.tabIndex=e)}"development"===process.env.NODE_ENV&&(this._firstDummy&&de(this._firstDummy,this._wrappers),this._lastDummy&&de(this._lastDummy,this._wrappers))},this._addDummyInputs=()=>{this._addTimer||(this._addTimer=this._getWindow().setTimeout((()=>{delete this._addTimer,this._ensurePosition(),"development"===process.env.NODE_ENV&&(this._firstDummy&&de(this._firstDummy,this._wrappers),this._lastDummy&&de(this._lastDummy,this._wrappers)),this._addTransformOffsets()}),0))},this._addTransformOffsets=()=>{this._tabster._dummyObserver.updatePositions(this._computeTransformOffsets)},this._computeTransformOffsets=e=>{var t,s;const i=(null===(t=this._firstDummy)||void 0===t?void 0:t.input)||(null===(s=this._lastDummy)||void 0===s?void 0:s.input),o=this._transformElements,n=new Set;let r=0,l=0;const a=this._getWindow();for(let t=i;t&&t.nodeType===Node.ELEMENT_NODE;t=L.getParentElement(t)){let s=e.get(t);if(void 0===s){const i=a.getComputedStyle(t).transform;i&&"none"!==i&&(s={scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),e.set(t,s||null)}s&&(n.add(t),o.has(t)||t.addEventListener("scroll",this._addTransformOffsets),r+=s.scrollTop,l+=s.scrollLeft)}for(const e of o)n.has(e)||e.removeEventListener("scroll",this._addTransformOffsets);return this._transformElements=n,()=>{var e,t;null===(e=this._firstDummy)||void 0===e||e.setTopLeft(r,l),null===(t=this._lastDummy)||void 0===t||t.setTopLeft(r,l)}};const a=s.get();if(!a)throw new Error("No element");this._tabster=t,this._getWindow=t.getWindow,this._callForDefaultAction=l;const d=a.__tabsterDummy;if((d||this)._wrappers.push({manager:i,priority:o,tabbable:!0}),d)return"development"===process.env.NODE_ENV&&(this._firstDummy&&de(this._firstDummy,d._wrappers),this._lastDummy&&de(this._lastDummy,d._wrappers)),d;a.__tabsterDummy=this;const u=null==n?void 0:n.dummyInputsPosition,c=a.tagName;this._isOutside=u?u===m.Outside:(r||"UL"===c||"OL"===c||"TABLE"===c)&&!("LI"===c||"TD"===c||"TH"===c),this._firstDummy=new oe(this._getWindow,this._isOutside,{isFirst:!0},s),this._lastDummy=new oe(this._getWindow,this._isOutside,{isFirst:!1},s);const h=this._firstDummy.input;h&&t._dummyObserver.add(h,this._addDummyInputs),this._firstDummy.onFocusIn=this._onFocusIn,this._firstDummy.onFocusOut=this._onFocusOut,this._lastDummy.onFocusIn=this._onFocusIn,this._lastDummy.onFocusOut=this._onFocusOut,this._element=s,this._addDummyInputs()}dispose(e,t){var s,i,o,n;const r=this._wrappers=this._wrappers.filter((s=>s.manager!==e&&!t));if("development"===process.env.NODE_ENV&&(this._firstDummy&&de(this._firstDummy,r),this._lastDummy&&de(this._lastDummy,r)),0===r.length){delete(null===(s=this._element)||void 0===s?void 0:s.get()).__tabsterDummy;for(const e of this._transformElements)e.removeEventListener("scroll",this._addTransformOffsets);this._transformElements.clear();const e=this._getWindow();this._addTimer&&(e.clearTimeout(this._addTimer),delete this._addTimer);const t=null===(i=this._firstDummy)||void 0===i?void 0:i.input;t&&this._tabster._dummyObserver.remove(t),null===(o=this._firstDummy)||void 0===o||o.dispose(),null===(n=this._lastDummy)||void 0===n||n.dispose()}}_onFocus(e,t,s,i){var o;const n=this._getCurrent();!n||t.useDefaultAction&&!this._callForDefaultAction||null===(o=n.manager.getHandler(e))||void 0===o||o(t,s,i)}_getCurrent(){return this._wrappers.sort(((e,t)=>e.tabbable!==t.tabbable?e.tabbable?-1:1:e.priority-t.priority)),this._wrappers[0]}_ensurePosition(){var e,t,s;const i=null===(e=this._element)||void 0===e?void 0:e.get(),o=null===(t=this._firstDummy)||void 0===t?void 0:t.input,n=null===(s=this._lastDummy)||void 0===s?void 0:s.input;if(i&&o&&n)if(this._isOutside){const e=L.getParentNode(i);if(e){const t=L.getNextSibling(i);t!==n&&L.insertBefore(e,n,t),L.getPreviousElementSibling(i)!==o&&L.insertBefore(e,o,i)}}else{L.getLastElementChild(i)!==n&&L.appendChild(i,n);const e=L.getFirstElementChild(i);e&&e!==o&&e.parentNode&&L.insertBefore(e.parentNode,o,e)}}}function he(e){let t=null;for(let s=L.getLastElementChild(e);s;s=L.getLastElementChild(s))t=s;return t||void 0}function me(e,t,s,i){const o=e.storageEntry(t,!0);let n=!1;if(!o.aug){if(void 0===i)return n;o.aug={}}if(void 0===i){if(s in o.aug){const e=o.aug[s];delete o.aug[s],null===e?t.removeAttribute(s):t.setAttribute(s,e),n=!0}}else{let e;s in o.aug||(e=t.getAttribute(s)),void 0!==e&&e!==i&&(o.aug[s]=e,null===i?t.removeAttribute(s):t.setAttribute(s,i),n=!0)}return void 0===i&&0===Object.keys(o.aug).length&&(delete o.aug,e.storageEntry(t,!1)),n}function _e(e){return"INPUT"===e.tagName&&!!e.name&&"radio"===e.type}function ve(e){var t;return(null===(t=null==e?void 0:e.__tabsterDummyContainer)||void 0===t?void 0:t.get())||null}
|
|
24
24
|
/*!
|
|
25
25
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
26
26
|
* Licensed under the MIT License.
|
|
27
|
-
*/function
|
|
27
|
+
*/function fe(e,t){const s=JSON.stringify(e);return!0===t?s:{[n]:s}}function be(e,t){for(const s of Object.keys(t)){const i=t[s];i?e[s]=i:delete e[s]}}function pe(e,t,s){let i;if(s){const t=e.getAttribute(n);if(t)try{i=JSON.parse(t)}catch(t){"development"===process.env.NODE_ENV&&console.error(`data-tabster attribute error: ${t}`,e)}}i||(i={}),be(i,t),Object.keys(i).length>0?e.setAttribute(n,fe(i,!0)):e.removeAttribute(n)}
|
|
28
28
|
/*!
|
|
29
29
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
30
30
|
* Licensed under the MIT License.
|
|
31
|
-
*/function
|
|
31
|
+
*/function ge(e,t,s){if("development"===process.env.NODE_ENV){const i=e.get();i&&(t?i.style.removeProperty("--tabster-root"):i.style.setProperty("--tabster-root",s+","))}}class Ee extends ae{constructor(t,s,i,o){super(t,s,ne,o,void 0,!0),this._onDummyInputFocus=t=>{var s;if(t.useDefaultAction)this._setFocused(!1);else{this._tabster.keyboardNavigation.setNavigatingWithKeyboard(!0);const i=this._element.get();if(i){this._setFocused(!0);const s=this._tabster.focusedElement.getFirstOrLastTabbable(t.isFirst,{container:i,ignoreAccessibility:!0});if(s)return void e(s)}null===(s=t.input)||void 0===s||s.blur()}},this._setHandlers(this._onDummyInputFocus),this._tabster=t,this._setFocused=i}}class ye extends ie{constructor(e,i,o,n,r){super(e,i,n),this._isFocused=!1,this._setFocused=e=>{var t;if(this._setFocusedTimer&&(this._tabster.getWindow().clearTimeout(this._setFocusedTimer),delete this._setFocusedTimer),this._isFocused===e)return;const s=this._element.get();s&&(e?(this._isFocused=!0,null===(t=this._dummyManager)||void 0===t||t.setTabbable(!1),s.dispatchEvent(new z({element:s}))):this._setFocusedTimer=this._tabster.getWindow().setTimeout((()=>{var e;delete this._setFocusedTimer,this._isFocused=!1,null===(e=this._dummyManager)||void 0===e||e.setTabbable(!0),s.dispatchEvent(new W({element:s}))}),0))},this._onFocusIn=e=>{const t=this._tabster.getParent,s=this._element.get();let i=e.composedPath()[0];do{if(i===s)return void this._setFocused(!0);i=i&&t(i)}while(i)},this._onFocusOut=()=>{this._setFocused(!1)},this._onDispose=o;const l=e.getWindow;this.uid=X(l,i),this._sys=r,(e.controlTab||e.rootDummyInputs)&&this.addDummyInputs();const a=l().document;a.addEventListener(t,this._onFocusIn),a.addEventListener(s,this._onFocusOut),this._add()}addDummyInputs(){this._dummyManager||(this._dummyManager=new Ee(this._tabster,this._element,this._setFocused,this._sys))}dispose(){var e;this._onDispose(this);const i=this._tabster.getWindow(),o=i.document;o.removeEventListener(t,this._onFocusIn),o.removeEventListener(s,this._onFocusOut),this._setFocusedTimer&&(i.clearTimeout(this._setFocusedTimer),delete this._setFocusedTimer),null===(e=this._dummyManager)||void 0===e||e.dispose(),this._remove()}moveOutWithDefaultAction(e,t){const s=this._dummyManager;if(s)s.moveOutWithDefaultAction(e,t);else{const s=this.getElement();s&&Ee.moveWithPhantomDummy(this._tabster,s,!0,e,t)}}_add(){"development"===process.env.NODE_ENV&&ge(this._element,!1,this.uid)}_remove(){"development"===process.env.NODE_ENV&&ge(this._element,!0)}}class we{constructor(e,t){this._autoRootWaiting=!1,this._roots={},this._forceDummy=!1,this.rootById={},this._autoRootCreate=()=>{var e;const t=this._win().document,s=t.body;if(s){this._autoRootUnwait(t);const i=this._autoRoot;if(i)return pe(s,{root:i},!0),v(this._tabster,s),null===(e=_(this._tabster,s))||void 0===e?void 0:e.root}else this._autoRootWaiting||(this._autoRootWaiting=!0,t.addEventListener("readystatechange",this._autoRootCreate))},this._onRootDispose=e=>{delete this._roots[e.id]},this._tabster=e,this._win=e.getWindow,this._autoRoot=t,e.queueInit((()=>{this._autoRoot&&this._autoRootCreate()}))}_autoRootUnwait(e){e.removeEventListener("readystatechange",this._autoRootCreate),this._autoRootWaiting=!1}dispose(){const e=this._win();this._autoRootUnwait(e.document),delete this._autoRoot,Object.keys(this._roots).forEach((e=>{this._roots[e]&&(this._roots[e].dispose(),delete this._roots[e])})),this.rootById={}}createRoot(e,t,s){process.env.NODE_ENV;const i=new ye(this._tabster,e,this._onRootDispose,t,s);return this._roots[i.id]=i,this._forceDummy&&i.addDummyInputs(),i}addDummyInputs(){this._forceDummy=!0;const e=this._roots;for(const t of Object.keys(e))e[t].addDummyInputs()}static getRootByUId(e,t){const s=e().__tabsterInstance;return s&&s.root.rootById[t]}static getTabsterContext(e,t,s){var i,o,n,r;if(void 0===s&&(s={}),!t.ownerDocument)return;const{checkRtl:l,referenceElement:a}=s,d=e.getParent;let u,c,h,m;e.drainInitQueue();let v,f,b,p,g=!1,E=a||t;const y={};for(;E&&(!u||l);){const s=_(e,E);if(l&&void 0===b){const e=E.dir;e&&(b="rtl"===e.toLowerCase())}if(!s){E=d(E);continue}const r=E.tagName;(s.uncontrolled||"IFRAME"===r||"WEBVIEW"===r)&&e.focusable.isVisible(E)&&(p=E),m||!(null===(i=s.focusable)||void 0===i?void 0:i.excludeFromMover)||h||(g=!0);const a=s.modalizer,w=s.groupper,T=s.mover;!c&&a&&(c=a),h||!w||c&&!a||(c?(!w.isActive()&&w.getProps().tabbability&&c.userId!==(null===(o=e.modalizer)||void 0===o?void 0:o.activeId)&&(c=void 0,h=w),f=w):h=w),m||!T||c&&!a||w&&E===t||!E.contains(t)||(m=T,v=!!h&&h!==w),s.root&&(u=s.root),(null===(n=s.focusable)||void 0===n?void 0:n.ignoreKeydown)&&Object.assign(y,s.focusable.ignoreKeydown),E=d(E)}if(!u){const s=e.root;s._autoRoot&&(null===(r=t.ownerDocument)||void 0===r?void 0:r.body)&&(u=s._autoRootCreate())}h&&!m&&(v=!0),"development"!==process.env.NODE_ENV||u||(c||h||m)&&console.error("Tabster Root is required for Mover, Groupper and Modalizer to work.");return u?{root:u,modalizer:c,groupper:h,mover:m,groupperBeforeMover:v,modalizerInGroupper:f,rtl:l?!!b:void 0,uncontrolled:p,excludedFromMover:g,ignoreKeydown:e=>!!y[e.key]}:void 0}static getRoot(e,t){var s;const i=e.getParent;for(let o=t;o;o=i(o)){const t=null===(s=_(e,o))||void 0===s?void 0:s.root;if(t)return t}}onRoot(e,t){t?delete this.rootById[e.uid]:this.rootById[e.uid]=e}}
|
|
32
32
|
/*!
|
|
33
33
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
34
34
|
* Licensed under the MIT License.
|
|
35
|
-
*/class
|
|
35
|
+
*/class Te{constructor(){this._callbacks=[]}dispose(){this._callbacks=[],delete this._val}subscribe(e){const t=this._callbacks;t.indexOf(e)<0&&t.push(e)}subscribeFirst(e){const t=this._callbacks,s=t.indexOf(e);s>=0&&t.splice(s,1),t.unshift(e)}unsubscribe(e){const t=this._callbacks.indexOf(e);t>=0&&this._callbacks.splice(t,1)}setVal(e,t){this._val!==e&&(this._val=e,this._callCallbacks(e,t))}getVal(){return this._val}trigger(e,t){this._callCallbacks(e,t)}_callCallbacks(e,t){this._callbacks.forEach((s=>s(e,t)))}}
|
|
36
36
|
/*!
|
|
37
37
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
38
38
|
* Licensed under the MIT License.
|
|
39
|
-
*/class
|
|
39
|
+
*/class Fe{constructor(e){this._tabster=e}dispose(){}getProps(e){const t=_(this._tabster,e);return t&&t.focusable||{}}isFocusable(e,t,s,i){return!(!te(e,l)||!t&&-1===e.tabIndex)&&((s||this.isVisible(e))&&(i||this.isAccessible(e)))}isVisible(e){if(!e.ownerDocument||e.nodeType!==Node.ELEMENT_NODE)return!1;if(function(e){var t,s;const i=e.ownerDocument,o=null===(t=i.defaultView)||void 0===t?void 0:t.getComputedStyle(e);if(null===e.offsetParent&&i.body!==e&&"fixed"!==(null==o?void 0:o.position))return!0;if("hidden"===(null==o?void 0:o.visibility))return!0;if("fixed"===(null==o?void 0:o.position)){if("none"===o.display)return!0;if(null===(null===(s=e.parentElement)||void 0===s?void 0:s.offsetParent)&&i.body!==e.parentElement)return!0}return!1}(e))return!1;const t=e.ownerDocument.body.getBoundingClientRect();return 0!==t.width||0!==t.height}isAccessible(e){var t;for(let s=e;s;s=L.getParentElement(s)){const e=_(this._tabster,s);if(this._isHidden(s))return!1;if(!(null===(t=null==e?void 0:e.focusable)||void 0===t?void 0:t.ignoreAriaDisabled)&&this._isDisabled(s))return!1}return!0}_isDisabled(e){return e.hasAttribute("disabled")}_isHidden(e){var t;const s=e.getAttribute("aria-hidden");return!(!s||"true"!==s.toLowerCase()||(null===(t=this._tabster.modalizer)||void 0===t?void 0:t.isAugmented(e)))}findFirst(e,t){return this.findElement({...e},t)}findLast(e,t){return this.findElement({isBackward:!0,...e},t)}findNext(e,t){return this.findElement({...e},t)}findPrev(e,t){return this.findElement({...e,isBackward:!0},t)}findDefault(e,t){return this.findElement({...e,acceptCondition:t=>this.isFocusable(t,e.includeProgrammaticallyFocusable)&&!!this.getProps(t).isDefault},t)||null}findAll(e){return this._findElements(!0,e)||[]}findElement(e,t){const s=this._findElements(!1,e,t);return s?s[0]:s}_findElements(e,t,s){var i,o,n;const{container:r,currentElement:l=null,includeProgrammaticallyFocusable:a,useActiveModalizer:d,ignoreAccessibility:u,modalizerId:c,isBackward:h,onElement:m}=t;s||(s={});const _=[];let{acceptCondition:v}=t;const f=!!v;if(!r)return null;v||(v=e=>this.isFocusable(e,a,!1,u));const b={container:r,modalizerUserId:void 0===c&&d?null===(i=this._tabster.modalizer)||void 0===i?void 0:i.activeId:c||(null===(n=null===(o=we.getTabsterContext(this._tabster,r))||void 0===o?void 0:o.modalizer)||void 0===n?void 0:n.userId),from:l||r,isBackward:h,isFindAll:e,acceptCondition:v,hasCustomCondition:f,includeProgrammaticallyFocusable:a,ignoreAccessibility:u,cachedGrouppers:{},cachedRadioGroups:{}},p=G(r.ownerDocument,r,(e=>this._acceptElement(e,b)));if(!p)return null;const g=t=>{var i,o;const n=null!==(i=b.foundElement)&&void 0!==i?i:b.foundBackward;return n&&_.push(n),e?!(n&&(b.found=!1,delete b.foundElement,delete b.foundBackward,delete b.fromCtx,b.from=n,m&&!m(n)))&&!(!n&&!t):(n&&s&&(s.uncontrolled=null===(o=we.getTabsterContext(this._tabster,n))||void 0===o?void 0:o.uncontrolled),!(!t||n))};if(l||(s.outOfDOMOrder=!0),l&&L.nodeContains(r,l))p.currentNode=l;else if(h){const e=he(r);if(!e)return null;if(this._acceptElement(e,b)===NodeFilter.FILTER_ACCEPT&&!g(!0))return b.skippedFocusable&&(s.outOfDOMOrder=!0),_;p.currentNode=e}do{h?p.previousNode():p.nextNode()}while(g());return b.skippedFocusable&&(s.outOfDOMOrder=!0),_.length?_:null}_acceptElement(e,t){var s,i,o;if(t.found)return NodeFilter.FILTER_ACCEPT;const n=t.foundBackward;if(n&&(e===n||!L.nodeContains(n,e)))return t.found=!0,t.foundElement=n,NodeFilter.FILTER_ACCEPT;const r=t.container;if(e===r)return NodeFilter.FILTER_SKIP;if(!L.nodeContains(r,e))return NodeFilter.FILTER_REJECT;if(ve(e))return NodeFilter.FILTER_REJECT;if(L.nodeContains(t.rejectElementsFrom,e))return NodeFilter.FILTER_REJECT;const l=t.currentCtx=we.getTabsterContext(this._tabster,e);if(!l)return NodeFilter.FILTER_SKIP;if(Y(e))return this.isFocusable(e,void 0,!0,!0)&&(t.skippedFocusable=!0),NodeFilter.FILTER_SKIP;if(!t.hasCustomCondition&&("IFRAME"===e.tagName||"WEBVIEW"===e.tagName))return this.isVisible(e)&&(null===(s=l.modalizer)||void 0===s?void 0:s.userId)===(null===(i=this._tabster.modalizer)||void 0===i?void 0:i.activeId)?(t.found=!0,t.rejectElementsFrom=t.foundElement=e,NodeFilter.FILTER_ACCEPT):NodeFilter.FILTER_REJECT;if(!t.ignoreAccessibility&&!this.isAccessible(e))return this.isFocusable(e,!1,!0,!0)&&(t.skippedFocusable=!0),NodeFilter.FILTER_REJECT;let a,d=t.fromCtx;d||(d=t.fromCtx=we.getTabsterContext(this._tabster,t.from));const u=null==d?void 0:d.mover;let c=l.groupper,h=l.mover;if(a=null===(o=this._tabster.modalizer)||void 0===o?void 0:o.acceptElement(e,t),void 0!==a&&(t.skippedFocusable=!0),void 0===a&&(c||h||u)){const s=null==c?void 0:c.getElement(),i=null==u?void 0:u.getElement();let o=null==h?void 0:h.getElement();if(o&&L.nodeContains(i,o)&&L.nodeContains(r,i)&&(!s||!h||L.nodeContains(i,s))&&(h=u,o=i),s)if(s!==r&&L.nodeContains(r,s)){if(!L.nodeContains(s,e))return NodeFilter.FILTER_REJECT}else c=void 0;if(o)if(L.nodeContains(r,o)){if(!L.nodeContains(o,e))return NodeFilter.FILTER_REJECT}else h=void 0;c&&h&&(o&&s&&!L.nodeContains(s,o)?h=void 0:c=void 0),c&&(a=c.acceptElement(e,t)),h&&(a=h.acceptElement(e,t))}if(void 0===a&&(a=t.acceptCondition(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP,a===NodeFilter.FILTER_SKIP&&this.isFocusable(e,!1,!0,!0)&&(t.skippedFocusable=!0)),a===NodeFilter.FILTER_ACCEPT&&!t.found){if(!t.isFindAll&&_e(e)&&!e.checked){const s=e.name;let i=t.cachedRadioGroups[s];if(i||(i=function(e){if(!_e(e))return;const t=e.name;let s,i=Array.from(L.getElementsByName(e,t));return i=i.filter((e=>!!_e(e)&&(e.checked&&(s=e),!0))),{name:t,buttons:new Set(i),checked:s}}(e),i&&(t.cachedRadioGroups[s]=i)),(null==i?void 0:i.checked)&&i.checked!==e)return NodeFilter.FILTER_SKIP}t.isBackward?(t.foundBackward=e,a=NodeFilter.FILTER_SKIP):(t.found=!0,t.foundElement=e)}return a}}
|
|
40
40
|
/*!
|
|
41
41
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
42
42
|
* Licensed under the MIT License.
|
|
43
|
-
*/const
|
|
43
|
+
*/const Ie="Tab",Ce="Escape",De="PageUp",Oe="PageDown",ke="End",Ne="Home",Ae="ArrowLeft",Re="ArrowUp",Pe="ArrowRight",Me="ArrowDown";
|
|
44
44
|
/*!
|
|
45
45
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
46
46
|
* Licensed under the MIT License.
|
|
47
|
-
*/const
|
|
47
|
+
*/const xe={[a.Restorer]:0,[a.Deloser]:1,[a.EscapeGroupper]:2};class ze extends Te{constructor(i,o){super(),this._init=()=>{const e=this._win(),i=e.document;i.addEventListener(t,this._onFocusIn,!0),i.addEventListener(s,this._onFocusOut,!0),e.addEventListener("keydown",this._onKeyDown,!0);const o=L.getActiveElement(i);o&&o!==i.body&&this._setFocusedElement(o),this.subscribe(this._onChanged)},this._onFocusIn=e=>{const t=e.composedPath()[0];t&&this._setFocusedElement(t,e.detail.relatedTarget,e.detail.isFocusedProgrammatically)},this._onFocusOut=e=>{var t;this._setFocusedElement(void 0,null===(t=e.detail)||void 0===t?void 0:t.originalEvent.relatedTarget)},this._validateFocusedElement=e=>{},this._onKeyDown=t=>{if(t.key!==Ie||t.ctrlKey)return;const s=this.getVal();if(!s||!s.ownerDocument||"true"===s.contentEditable)return;const i=this._tabster,o=i.controlTab,n=we.getTabsterContext(i,s);if(!n||n.ignoreKeydown(t))return;const r=t.shiftKey,l=ze.findNextTabbable(i,n,void 0,s,void 0,r,!0),a=n.root.getElement();if(!a)return;const d=null==l?void 0:l.element,u=function(e,t){var s;const i=e.getParent;let o=t;do{const t=null===(s=_(e,o))||void 0===s?void 0:s.uncontrolled;if(t&&e.uncontrolled.isUncontrolledCompletely(o,!!t.completely))return o;o=i(o)}while(o)}(i,s);if(d){const c=l.uncontrolled;if(n.uncontrolled||L.nodeContains(c,s)){if(!l.outOfDOMOrder&&c===n.uncontrolled||u&&!L.nodeContains(u,d))return;return void ae.addPhantomDummyWithTarget(i,s,r,d)}if(c&&i.focusable.isVisible(c)||"IFRAME"===d.tagName&&i.focusable.isVisible(d))return void(a.dispatchEvent(new A({by:"root",owner:a,next:d,relatedEvent:t}))&&ae.moveWithPhantomDummy(i,null!=c?c:d,!1,r,t));(o||(null==l?void 0:l.outOfDOMOrder))&&a.dispatchEvent(new A({by:"root",owner:a,next:d,relatedEvent:t}))&&(t.preventDefault(),t.stopImmediatePropagation(),e(d))}else!u&&a.dispatchEvent(new A({by:"root",owner:a,next:null,relatedEvent:t}))&&n.root.moveOutWithDefaultAction(r,t)},this._onChanged=(e,t)=>{var s,i;if(e)e.dispatchEvent(new k(t));else{const e=null===(s=this._lastVal)||void 0===s?void 0:s.get();if(e){const s={...t},o=we.getTabsterContext(this._tabster,e),n=null===(i=null==o?void 0:o.modalizer)||void 0===i?void 0:i.userId;n&&(s.modalizerId=n),e.dispatchEvent(new N(s))}}},this._tabster=i,this._win=o,i.queueInit(this._init)}dispose(){super.dispose();const e=this._win(),i=e.document;i.removeEventListener(t,this._onFocusIn,!0),i.removeEventListener(s,this._onFocusOut,!0),e.removeEventListener("keydown",this._onKeyDown,!0),this.unsubscribe(this._onChanged);const o=this._asyncFocus;o&&(e.clearTimeout(o.timeout),delete this._asyncFocus),delete ze._lastResetElement,delete this._nextVal,delete this._lastVal}static forgetMemorized(e,t){var s,i;let o=ze._lastResetElement,n=o&&o.get();n&&L.nodeContains(t,n)&&delete ze._lastResetElement,n=null===(i=null===(s=e._nextVal)||void 0===s?void 0:s.element)||void 0===i?void 0:i.get(),n&&L.nodeContains(t,n)&&delete e._nextVal,o=e._lastVal,n=o&&o.get(),n&&L.nodeContains(t,n)&&delete e._lastVal}getFocusedElement(){return this.getVal()}getLastFocusedElement(){var e;let t=null===(e=this._lastVal)||void 0===e?void 0:e.get();return(!t||t&&!ee(t.ownerDocument,t))&&(this._lastVal=t=void 0),t}focus(e,t,s,i){return!!this._tabster.focusable.isFocusable(e,t,!1,s)&&(e.focus({preventScroll:i}),!0)}focusDefault(e){const t=this._tabster.focusable.findDefault({container:e});return!!t&&(this._tabster.focusedElement.focus(t),!0)}getFirstOrLastTabbable(e,t){var s;const{container:i,ignoreAccessibility:o}=t;let n;if(i){const t=we.getTabsterContext(this._tabster,i);t&&(n=null===(s=ze.findNextTabbable(this._tabster,t,i,void 0,void 0,!e,o))||void 0===s?void 0:s.element)}return n&&!L.nodeContains(i,n)&&(n=void 0),n||void 0}_focusFirstOrLast(e,t){const s=this.getFirstOrLastTabbable(e,t);return!!s&&(this.focus(s,!1,!0),!0)}focusFirst(e){return this._focusFirstOrLast(!0,e)}focusLast(e){return this._focusFirstOrLast(!1,e)}resetFocus(e){if(!this._tabster.focusable.isVisible(e))return!1;if(this._tabster.focusable.isFocusable(e,!0,!0,!0))this.focus(e);else{const t=e.getAttribute("tabindex"),s=e.getAttribute("aria-hidden");e.tabIndex=-1,e.setAttribute("aria-hidden","true"),ze._lastResetElement=new j(this._win,e),this.focus(e,!0,!0),this._setOrRemoveAttribute(e,"tabindex",t),this._setOrRemoveAttribute(e,"aria-hidden",s)}return!0}requestAsyncFocus(e,t,s){const i=this._tabster.getWindow(),o=this._asyncFocus;if(o){if(xe[e]>xe[o.source])return;i.clearTimeout(o.timeout)}this._asyncFocus={source:e,callback:t,timeout:i.setTimeout((()=>{this._asyncFocus=void 0,t()}),s)}}cancelAsyncFocus(e){const t=this._asyncFocus;(null==t?void 0:t.source)===e&&(this._tabster.getWindow().clearTimeout(t.timeout),this._asyncFocus=void 0)}_setOrRemoveAttribute(e,t,s){null===s?e.removeAttribute(t):e.setAttribute(t,s)}_setFocusedElement(e,t,s){var i,o;if(this._tabster._noop)return;const n={relatedTarget:t};if(e){const t=null===(i=ze._lastResetElement)||void 0===i?void 0:i.get();if(ze._lastResetElement=void 0,t===e||Y(e))return;n.isFocusedProgrammatically=s;const r=we.getTabsterContext(this._tabster,e),l=null===(o=null==r?void 0:r.modalizer)||void 0===o?void 0:o.userId;l&&(n.modalizerId=l)}const r=this._nextVal={element:e?new j(this._win,e):void 0,detail:n};e&&e!==this._val&&this._validateFocusedElement(e),this._nextVal===r&&this.setVal(e,n),this._nextVal=void 0}setVal(e,t){super.setVal(e,t),e&&(this._lastVal=new j(this._win,e))}static findNextTabbable(e,t,s,i,o,n,r){const l=s||t.root.getElement();if(!l)return null;let a=null;const d=ze._isTabbingTimer,u=e.getWindow();d&&u.clearTimeout(d),ze.isTabbing=!0,ze._isTabbingTimer=u.setTimeout((()=>{delete ze._isTabbingTimer,ze.isTabbing=!1}),0);const c=t.modalizer,h=t.groupper,m=t.mover,_=t=>{if(a=t.findNextTabbable(i,o,n,r),i&&!(null==a?void 0:a.element)){const o=t!==c&&L.getParentElement(t.getElement());if(o){const l=we.getTabsterContext(e,i,{referenceElement:o});if(l){const i=t.getElement(),d=n?i:i&&he(i)||i;d&&(a=ze.findNextTabbable(e,l,s,d,o,n,r),a&&(a.outOfDOMOrder=!0))}}}};if(h&&m)_(t.groupperBeforeMover?h:m);else if(h)_(h);else if(m)_(m);else if(c)_(c);else{const t={container:l,currentElement:i,referenceElement:o,ignoreAccessibility:r,useActiveModalizer:!0},s={},d=e.focusable[n?"findPrev":"findNext"](t,s);a={element:d,outOfDOMOrder:s.outOfDOMOrder,uncontrolled:s.uncontrolled}}return a}}ze.isTabbing=!1;
|
|
48
48
|
/*!
|
|
49
49
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
50
50
|
* Licensed under the MIT License.
|
|
51
51
|
*/
|
|
52
|
-
class
|
|
52
|
+
class We extends Te{constructor(e){super(),this._onChange=e=>{this.setVal(e,void 0)},this._keyborg=i(e()),this._keyborg.subscribe(this._onChange)}dispose(){super.dispose(),this._keyborg&&(this._keyborg.unsubscribe(this._onChange),o(this._keyborg),delete this._keyborg)}setNavigatingWithKeyboard(e){var t;null===(t=this._keyborg)||void 0===t||t.setVal(e)}isNavigatingWithKeyboard(){var e;return!!(null===(e=this._keyborg)||void 0===e?void 0:e.isNavigatingWithKeyboard())}}
|
|
53
53
|
/*!
|
|
54
54
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
55
55
|
* Licensed under the MIT License.
|
|
56
|
-
*/class
|
|
56
|
+
*/let Le=0;const Se="aria-hidden";function Be(e,t,s,i,o,n){if("development"===process.env.NODE_ENV){const r=e.get();r&&(t?r.style.removeProperty("--tabster-modalizer"):r.style.setProperty("--tabster-modalizer",s+","+i+","+(o?"active":"inactive")+",,"+(n?`focused(${n})`:"not-focused")))}}class Ve extends ae{constructor(t,s,i){super(s,t,re,i),this._setHandlers(((i,o)=>{var n,r;const l=t.get(),a=l&&(null===(n=we.getRoot(s,l))||void 0===n?void 0:n.getElement()),d=i.input;let u;if(a&&d){const t=ve(d),i=we.getTabsterContext(s,t||d);i&&(u=null===(r=ze.findNextTabbable(s,i,a,d,void 0,o,!0))||void 0===r?void 0:r.element),u&&e(u)}}))}}class Ue extends ie{constructor(e,t,s,i,o,n){super(e,t,i),this._wasFocused=0,this.userId=i.id,this._onDispose=s,this._activeElements=n,e.controlTab||(this.dummyManager=new Ve(this._element,e,o)),"development"===process.env.NODE_ENV&&Be(this._element,!1,this.id,this.userId,this._isActive,this._wasFocused)}makeActive(e){if(this._isActive!==e){this._isActive=e;const t=this.getElement();if(t){const s=this._activeElements,i=s.map((e=>e.get())).indexOf(t);e?i<0&&s.push(new j(this._tabster.getWindow,t)):i>=0&&s.splice(i,1)}"development"===process.env.NODE_ENV&&Be(this._element,!1,this.id,this.userId,this._isActive,this._wasFocused),this._dispatchEvent(e)}}focused(e){return e||(this._wasFocused=++Le),this._wasFocused}setProps(e){e.id&&(this.userId=e.id),this._props={...e}}dispose(){var e;this.makeActive(!1),this._onDispose(this),null===(e=this.dummyManager)||void 0===e||e.dispose(),delete this.dummyManager,this._activeElements=[],this._remove()}isActive(){return!!this._isActive}contains(e){return L.nodeContains(this.getElement(),e)}findNextTabbable(e,t,s,i){var o,n;if(!this.getElement())return null;const r=this._tabster;let l,a=null,d=!1;const u=e&&(null===(o=we.getRoot(r,e))||void 0===o?void 0:o.getElement());if(u){const o={container:u,currentElement:e,referenceElement:t,ignoreAccessibility:i,useActiveModalizer:!0},c={};a=r.focusable[s?"findPrev":"findNext"](o,c),!a&&this._props.isTrapped&&(null===(n=r.modalizer)||void 0===n?void 0:n.activeId)?(a=r.focusable[s?"findLast":"findFirst"]({container:u,ignoreAccessibility:i,useActiveModalizer:!0},c),null===a&&(a=e),d=!0):d=!!c.outOfDOMOrder,l=c.uncontrolled}return{element:a,uncontrolled:l,outOfDOMOrder:d}}_dispatchEvent(e,t){const s=this.getElement();let i=!1;if(s){const o=t?this._activeElements.map((e=>e.get())):[s];for(const t of o)if(t){const o={id:this.userId,element:s},n=e?new P(o):new M(o);t.dispatchEvent(n),n.defaultPrevented&&(i=!0)}}return i}_remove(){"development"===process.env.NODE_ENV&&Be(this._element,!0)}}class Ke{constructor(e,t,s){this._onModalizerDispose=e=>{const t=e.id,s=e.userId,i=this._parts[s];if(delete this._modalizers[t],i&&(delete i[t],0===Object.keys(i).length)){delete this._parts[s];const e=this._activationHistory,t=[];let i;for(let o=e.length;o--;){const n=e[o];n!==s&&(n!==i&&(i=n,(n||t.length>0)&&t.unshift(n)))}if(this._activationHistory=t,this.activeId===s){const e=t[0],s=e?Object.values(this._parts[e])[0]:void 0;this.setActive(s)}}},this._onKeyDown=e=>{var t;if(e.key!==Ce)return;const s=this._tabster,i=s.focusedElement.getFocusedElement();if(i){const o=we.getTabsterContext(s,i),n=null==o?void 0:o.modalizer;if(o&&!o.groupper&&(null==n?void 0:n.isActive())&&!o.ignoreKeydown(e)){const i=n.userId;if(i){const o=this._parts[i];if(o){const i=Object.keys(o).map((e=>{var t;const i=o[e],n=i.getElement();let r;return n&&(r=null===(t=_(s,n))||void 0===t?void 0:t.groupper),i&&n&&r?{el:n,focusedSince:i.focused(!0)}:{focusedSince:0}})).filter((e=>e.focusedSince>0)).sort(((e,t)=>e.focusedSince>t.focusedSince?-1:e.focusedSince<t.focusedSince?1:0));if(i.length){const o=i[0].el;o&&(null===(t=s.groupper)||void 0===t||t.handleKeyPress(o,e,!0))}}}}}},this._onFocus=(e,t)=>{var s;const i=this._tabster,o=e&&we.getTabsterContext(i,e);if(!o||!e)return;const n=this._augMap;for(let t=e;t;t=L.getParentElement(t))n.has(t)&&(n.delete(t),me(i,t,Se));let r=o.modalizer;const l=_(i,e),a=null==l?void 0:l.modalizer;if(a&&(a.focused(),a.userId===this.activeId&&l.groupper)){const t=i.getParent(e),o=t&&(null===(s=we.getTabsterContext(i,t))||void 0===s?void 0:s.modalizer);if(!o)return void this.setActive(void 0);r=o}if(null==r||r.focused(),(null==r?void 0:r.userId)!==this.activeId)if(t.isFocusedProgrammatically||this.currentIsOthersAccessible||(null==r?void 0:r.getProps().isAlwaysAccessible))this.setActive(r);else{const t=this._win();t.clearTimeout(this._restoreModalizerFocusTimer),this._restoreModalizerFocusTimer=t.setTimeout((()=>this._restoreModalizerFocus(e)),100)}else this.currentIsOthersAccessible=null==r?void 0:r.getProps().isOthersAccessible},this._tabster=e,this._win=e.getWindow,this._modalizers={},this._parts={},this._augMap=new WeakMap,this._aug=[],this._alwaysAccessibleSelector=t,this._accessibleCheck=s,this._activationHistory=[],this.activeElements=[],e.controlTab||e.root.addDummyInputs();this._win().addEventListener("keydown",this._onKeyDown,!0),e.queueInit((()=>{this._tabster.focusedElement.subscribe(this._onFocus)}))}dispose(){const e=this._win();e.removeEventListener("keydown",this._onKeyDown,!0),Object.keys(this._modalizers).forEach((e=>{this._modalizers[e]&&(this._modalizers[e].dispose(),delete this._modalizers[e])})),e.clearTimeout(this._restoreModalizerFocusTimer),e.clearTimeout(this._hiddenUpdateTimer),this._parts={},delete this.activeId,this.activeElements=[],this._augMap=new WeakMap,this._aug=[],this._tabster.focusedElement.unsubscribe(this._onFocus)}createModalizer(e,t,s){var i;process.env.NODE_ENV;const o=new Ue(this._tabster,e,this._onModalizerDispose,t,s,this.activeElements),n=o.id,r=t.id;this._modalizers[n]=o;let l=this._parts[r];l||(l=this._parts[r]={}),l[n]=o;const a=null!==(i=this._tabster.focusedElement.getFocusedElement())&&void 0!==i?i:null;return e!==a&&L.nodeContains(e,a)&&(r!==this.activeId?this.setActive(o):o.makeActive(!0)),o}isAugmented(e){return this._augMap.has(e)}hiddenUpdate(){this._hiddenUpdateTimer||(this._hiddenUpdateTimer=this._win().setTimeout((()=>{delete this._hiddenUpdateTimer,this._hiddenUpdate()}),250))}setActive(e){const t=null==e?void 0:e.userId,s=this.activeId;if(s===t)return;if(this.activeId=t,s){const e=this._parts[s];if(e)for(const t of Object.keys(e))e[t].makeActive(!1)}if(t){const e=this._parts[t];if(e)for(const t of Object.keys(e))e[t].makeActive(!0)}this.currentIsOthersAccessible=null==e?void 0:e.getProps().isOthersAccessible,this.hiddenUpdate();const i=this._activationHistory;i[0]!==t&&(void 0!==t||i.length>0)&&i.unshift(t)}focus(e,t,s){const i=this._tabster,o=we.getTabsterContext(i,e),n=null==o?void 0:o.modalizer;if(n){this.setActive(n);const e=n.getProps(),o=n.getElement();if(o){if(void 0===t&&(t=e.isNoFocusFirst),!t&&i.keyboardNavigation.isNavigatingWithKeyboard()&&i.focusedElement.focusFirst({container:o}))return!0;if(void 0===s&&(s=e.isNoFocusDefault),!s&&i.focusedElement.focusDefault(o))return!0;i.focusedElement.resetFocus(o)}}else"development"===process.env.NODE_ENV&&console.error("Element is not in Modalizer.",e);return!1}activate(e){var t;const s=e?null===(t=we.getTabsterContext(this._tabster,e))||void 0===t?void 0:t.modalizer:void 0;return!(e&&!s)&&(this.setActive(s),!0)}acceptElement(e,t){var s;const i=t.modalizerUserId,o=null===(s=t.currentCtx)||void 0===s?void 0:s.modalizer;if(i)for(const t of this.activeElements){const s=t.get();if(s&&(L.nodeContains(e,s)||s===e))return NodeFilter.FILTER_SKIP}const n=i===(null==o?void 0:o.userId)||!i&&(null==o?void 0:o.getProps().isAlwaysAccessible)?void 0:NodeFilter.FILTER_SKIP;return void 0!==n&&(t.skippedFocusable=!0),n}_hiddenUpdate(){var e;const t=this._tabster,s=t.getWindow().document.body,i=this.activeId,o=this._parts,n=[],r=[],l=this._alwaysAccessibleSelector,a=l?Array.from(L.querySelectorAll(s,l)):[],d=[];for(const e of Object.keys(o)){const t=o[e];for(const s of Object.keys(t)){const o=t[s],l=o.getElement(),u=o.getProps().isAlwaysAccessible;l&&(e===i?(d.push(l),this.currentIsOthersAccessible||n.push(l)):u?a.push(l):r.push(l))}}const u=this._augMap,c=n.length>0?[...n,...a]:void 0,h=[],m=new WeakMap,_=(e,s)=>{var i;const o=e.tagName;if("SCRIPT"===o||"STYLE"===o)return;let n=!1;u.has(e)?s?n=!0:(u.delete(e),me(t,e,Se)):s&&!(null===(i=this._accessibleCheck)||void 0===i?void 0:i.call(this,e,d))&&me(t,e,Se,"true")&&(u.set(e,!0),n=!0),n&&(h.push(new j(t.getWindow,e)),m.set(e,!0))},v=e=>{var s;for(let i=L.getFirstElementChild(e);i;i=L.getNextElementSibling(i)){let e=!1,o=!1,n=!1;if(c){const r=t.getParent(i);for(const t of c){if(i===t){e=!0;break}if(L.nodeContains(i,t)){o=!0;break}L.nodeContains(t,r)&&(n=!0)}o||(null===(s=i.__tabsterElementFlags)||void 0===s?void 0:s.noDirectAriaHidden)?v(i):e||n||_(i,!0)}else _(i,!1)}};c||a.forEach((e=>_(e,!1))),r.forEach((e=>_(e,!0))),s&&v(s),null===(e=this._aug)||void 0===e||e.map((e=>e.get())).forEach((e=>{e&&!m.get(e)&&_(e,!1)})),this._aug=h,this._augMap=m}_restoreModalizerFocus(e){var t;const s=null==e?void 0:e.ownerDocument;if(!e||!s)return;const i=this._tabster.focusedElement.getFocusedElement(),o=i&&(null===(t=we.getTabsterContext(this._tabster,i))||void 0===t?void 0:t.modalizer);if(!i||i&&(null==o?void 0:o.userId)===this.activeId)return;const n=this._tabster,r=we.getTabsterContext(n,e),l=null==r?void 0:r.modalizer,a=this.activeId;if(!l&&!a||l&&a===l.userId)return;const d=null==r?void 0:r.root.getElement();if(d){let t=n.focusable.findFirst({container:d,useActiveModalizer:!0});if(t){if(e.compareDocumentPosition(t)&document.DOCUMENT_POSITION_PRECEDING&&(t=n.focusable.findLast({container:d,useActiveModalizer:!0}),!t))throw new Error("Something went wrong.");return void n.focusedElement.focus(t)}}e.blur()}}
|
|
57
57
|
/*!
|
|
58
58
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
59
59
|
* Licensed under the MIT License.
|
|
60
|
-
*/let Qe=0;const qe="aria-hidden";function Je(e,t,s,i,o,n){if("development"===process.env.NODE_ENV){const r=e.get();r&&(t?r.style.removeProperty("--tabster-modalizer"):r.style.setProperty("--tabster-modalizer",s+","+i+","+(o?"active":"inactive")+",,"+(n?`focused(${n})`:"not-focused")))}}class $e extends he{constructor(t,s,i){super(s,t,ue,i),this._setHandlers(((i,o)=>{var n,r;const l=t.get(),a=l&&(null===(n=Ie.getRoot(s,l))||void 0===n?void 0:n.getElement()),u=i.input;let d;if(a&&u){const t=ge(u),i=Ie.getTabsterContext(s,t||u);i&&(d=null===(r=Ve.findNextTabbable(s,i,a,u,void 0,o,!0))||void 0===r?void 0:r.element),d&&e(d)}}))}}class Ye extends re{constructor(e,t,s,i,o,n){super(e,t,i),this._wasFocused=0,this.userId=i.id,this._onDispose=s,this._activeElements=n,e.controlTab||(this.dummyManager=new $e(this._element,e,o)),"development"===process.env.NODE_ENV&&Je(this._element,!1,this.id,this.userId,this._isActive,this._wasFocused)}makeActive(e){if(this._isActive!==e){this._isActive=e;const t=this.getElement();if(t){const s=this._activeElements,i=s.map((e=>e.get())).indexOf(t);e?i<0&&s.push(new Q(this._tabster.getWindow,t)):i>=0&&s.splice(i,1)}"development"===process.env.NODE_ENV&&Je(this._element,!1,this.id,this.userId,this._isActive,this._wasFocused),this._dispatchEvent(e)}}focused(e){return e||(this._wasFocused=++Qe),this._wasFocused}setProps(e){e.id&&(this.userId=e.id),this._props={...e}}dispose(){var e;this.makeActive(!1),this._onDispose(this),null===(e=this.dummyManager)||void 0===e||e.dispose(),delete this.dummyManager,this._activeElements=[],this._remove()}isActive(){return!!this._isActive}contains(e){return V.nodeContains(this.getElement(),e)}findNextTabbable(e,t,s,i){var o,n;if(!this.getElement())return null;const r=this._tabster;let l,a=null,u=!1;const d=e&&(null===(o=Ie.getRoot(r,e))||void 0===o?void 0:o.getElement());if(d){const o={container:d,currentElement:e,referenceElement:t,ignoreAccessibility:i,useActiveModalizer:!0},c={};a=r.focusable[s?"findPrev":"findNext"](o,c),!a&&this._props.isTrapped&&(null===(n=r.modalizer)||void 0===n?void 0:n.activeId)?(a=r.focusable[s?"findLast":"findFirst"]({container:d,ignoreAccessibility:i,useActiveModalizer:!0},c),null===a&&(a=e),u=!0):u=!!c.outOfDOMOrder,l=c.uncontrolled}return{element:a,uncontrolled:l,outOfDOMOrder:u}}_dispatchEvent(e,t){const s=this.getElement();let i=!1;if(s){const o=t?this._activeElements.map((e=>e.get())):[s];for(const t of o)if(t){const o={id:this.userId,element:s},n=e?new z(o):new L(o);t.dispatchEvent(n),n.defaultPrevented&&(i=!0)}}return i}_remove(){"development"===process.env.NODE_ENV&&Je(this._element,!0)}}class Xe{constructor(e,t,s){this._onModalizerDispose=e=>{const t=e.id,s=e.userId,i=this._parts[s];if(delete this._modalizers[t],i&&(delete i[t],0===Object.keys(i).length)){delete this._parts[s];const e=this._activationHistory,t=[];let i;for(let o=e.length;o--;){const n=e[o];n!==s&&(n!==i&&(i=n,(n||t.length>0)&&t.unshift(n)))}if(this._activationHistory=t,this.activeId===s){const e=t[0],s=e?Object.values(this._parts[e])[0]:void 0;this.setActive(s)}}},this._onKeyDown=e=>{var t;if(e.key!==Ae)return;const s=this._tabster,i=s.focusedElement.getFocusedElement();if(i){const o=Ie.getTabsterContext(s,i),n=null==o?void 0:o.modalizer;if(o&&!o.groupper&&(null==n?void 0:n.isActive())&&!o.ignoreKeydown(e)){const i=n.userId;if(i){const o=this._parts[i];if(o){const i=Object.keys(o).map((e=>{var t;const i=o[e],n=i.getElement();let r;return n&&(r=null===(t=f(s,n))||void 0===t?void 0:t.groupper),i&&n&&r?{el:n,focusedSince:i.focused(!0)}:{focusedSince:0}})).filter((e=>e.focusedSince>0)).sort(((e,t)=>e.focusedSince>t.focusedSince?-1:e.focusedSince<t.focusedSince?1:0));if(i.length){const o=i[0].el;o&&(null===(t=s.groupper)||void 0===t||t.handleKeyPress(o,e,!0))}}}}}},this._onFocus=(e,t)=>{var s;const i=this._tabster,o=e&&Ie.getTabsterContext(i,e);if(!o||!e)return;const n=this._augMap;for(let t=e;t;t=V.getParentElement(t))n.has(t)&&(n.delete(t),pe(i,t,qe));let r=o.modalizer;const l=f(i,e),a=null==l?void 0:l.modalizer;if(a&&(a.focused(),a.userId===this.activeId&&l.groupper)){const t=i.getParent(e),o=t&&(null===(s=Ie.getTabsterContext(i,t))||void 0===s?void 0:s.modalizer);if(!o)return void this.setActive(void 0);r=o}if(null==r||r.focused(),(null==r?void 0:r.userId)!==this.activeId)if(t.isFocusedProgrammatically||this.currentIsOthersAccessible||(null==r?void 0:r.getProps().isAlwaysAccessible))this.setActive(r);else{const t=this._win();t.clearTimeout(this._restoreModalizerFocusTimer),this._restoreModalizerFocusTimer=t.setTimeout((()=>this._restoreModalizerFocus(e)),100)}else this.currentIsOthersAccessible=null==r?void 0:r.getProps().isOthersAccessible},this._tabster=e,this._win=e.getWindow,this._modalizers={},this._parts={},this._augMap=new WeakMap,this._aug=[],this._alwaysAccessibleSelector=t,this._accessibleCheck=s,this._activationHistory=[],this.activeElements=[],e.controlTab||e.root.addDummyInputs();this._win().addEventListener("keydown",this._onKeyDown,!0),e.queueInit((()=>{this._tabster.focusedElement.subscribe(this._onFocus)}))}dispose(){const e=this._win();e.removeEventListener("keydown",this._onKeyDown,!0),Object.keys(this._modalizers).forEach((e=>{this._modalizers[e]&&(this._modalizers[e].dispose(),delete this._modalizers[e])})),e.clearTimeout(this._restoreModalizerFocusTimer),e.clearTimeout(this._hiddenUpdateTimer),this._parts={},delete this.activeId,this.activeElements=[],this._augMap=new WeakMap,this._aug=[],this._tabster.focusedElement.unsubscribe(this._onFocus)}createModalizer(e,t,s){var i;process.env.NODE_ENV;const o=new Ye(this._tabster,e,this._onModalizerDispose,t,s,this.activeElements),n=o.id,r=t.id;this._modalizers[n]=o;let l=this._parts[r];l||(l=this._parts[r]={}),l[n]=o;const a=null!==(i=this._tabster.focusedElement.getFocusedElement())&&void 0!==i?i:null;return e!==a&&V.nodeContains(e,a)&&(r!==this.activeId?this.setActive(o):o.makeActive(!0)),o}isAugmented(e){return this._augMap.has(e)}hiddenUpdate(){this._hiddenUpdateTimer||(this._hiddenUpdateTimer=this._win().setTimeout((()=>{delete this._hiddenUpdateTimer,this._hiddenUpdate()}),250))}setActive(e){const t=null==e?void 0:e.userId,s=this.activeId;if(s===t)return;if(this.activeId=t,s){const e=this._parts[s];if(e)for(const t of Object.keys(e))e[t].makeActive(!1)}if(t){const e=this._parts[t];if(e)for(const t of Object.keys(e))e[t].makeActive(!0)}this.currentIsOthersAccessible=null==e?void 0:e.getProps().isOthersAccessible,this.hiddenUpdate();const i=this._activationHistory;i[0]!==t&&(void 0!==t||i.length>0)&&i.unshift(t)}focus(e,t,s){const i=this._tabster,o=Ie.getTabsterContext(i,e),n=null==o?void 0:o.modalizer;if(n){this.setActive(n);const e=n.getProps(),o=n.getElement();if(o){if(void 0===t&&(t=e.isNoFocusFirst),!t&&i.keyboardNavigation.isNavigatingWithKeyboard()&&i.focusedElement.focusFirst({container:o}))return!0;if(void 0===s&&(s=e.isNoFocusDefault),!s&&i.focusedElement.focusDefault(o))return!0;i.focusedElement.resetFocus(o)}}else"development"===process.env.NODE_ENV&&console.error("Element is not in Modalizer.",e);return!1}activate(e){var t;const s=e?null===(t=Ie.getTabsterContext(this._tabster,e))||void 0===t?void 0:t.modalizer:void 0;return!(e&&!s)&&(this.setActive(s),!0)}acceptElement(e,t){var s;const i=t.modalizerUserId,o=null===(s=t.currentCtx)||void 0===s?void 0:s.modalizer;if(i)for(const t of this.activeElements){const s=t.get();if(s&&(V.nodeContains(e,s)||s===e))return NodeFilter.FILTER_SKIP}const n=i===(null==o?void 0:o.userId)||!i&&(null==o?void 0:o.getProps().isAlwaysAccessible)?void 0:NodeFilter.FILTER_SKIP;return void 0!==n&&(t.skippedFocusable=!0),n}_hiddenUpdate(){var e;const t=this._tabster,s=t.getWindow().document.body,i=this.activeId,o=this._parts,n=[],r=[],l=this._alwaysAccessibleSelector,a=l?Array.from(V.querySelectorAll(s,l)):[],u=[];for(const e of Object.keys(o)){const t=o[e];for(const s of Object.keys(t)){const o=t[s],l=o.getElement(),d=o.getProps().isAlwaysAccessible;l&&(e===i?(u.push(l),this.currentIsOthersAccessible||n.push(l)):d?a.push(l):r.push(l))}}const d=this._augMap,c=n.length>0?[...n,...a]:void 0,h=[],m=new WeakMap,_=(e,s)=>{var i;const o=e.tagName;if("SCRIPT"===o||"STYLE"===o)return;let n=!1;d.has(e)?s?n=!0:(d.delete(e),pe(t,e,qe)):s&&!(null===(i=this._accessibleCheck)||void 0===i?void 0:i.call(this,e,u))&&pe(t,e,qe,"true")&&(d.set(e,!0),n=!0),n&&(h.push(new Q(t.getWindow,e)),m.set(e,!0))},v=e=>{var s;for(let i=V.getFirstElementChild(e);i;i=V.getNextElementSibling(i)){let e=!1,o=!1,n=!1;if(c){const r=t.getParent(i);for(const t of c){if(i===t){e=!0;break}if(V.nodeContains(i,t)){o=!0;break}V.nodeContains(t,r)&&(n=!0)}o||(null===(s=i.__tabsterElementFlags)||void 0===s?void 0:s.noDirectAriaHidden)?v(i):e||n||_(i,!0)}else _(i,!1)}};c||a.forEach((e=>_(e,!1))),r.forEach((e=>_(e,!0))),s&&v(s),null===(e=this._aug)||void 0===e||e.map((e=>e.get())).forEach((e=>{e&&!m.get(e)&&_(e,!1)})),this._aug=h,this._augMap=m}_restoreModalizerFocus(e){var t;const s=null==e?void 0:e.ownerDocument;if(!e||!s)return;const i=this._tabster.focusedElement.getFocusedElement(),o=i&&(null===(t=Ie.getTabsterContext(this._tabster,i))||void 0===t?void 0:t.modalizer);if(!i||i&&(null==o?void 0:o.userId)===this.activeId)return;const n=this._tabster,r=Ie.getTabsterContext(n,e),l=null==r?void 0:r.modalizer,a=this.activeId;if(!l&&!a||l&&a===l.userId)return;const u=null==r?void 0:r.root.getElement();if(u){let t=n.focusable.findFirst({container:u,useActiveModalizer:!0});if(t){if(e.compareDocumentPosition(t)&document.DOCUMENT_POSITION_PRECEDING&&(t=n.focusable.findLast({container:u,useActiveModalizer:!0}),!t))throw new Error("Something went wrong.");return void n.focusedElement.focus(t)}}e.blur()}}
|
|
61
|
-
/*!
|
|
62
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
63
|
-
* Licensed under the MIT License.
|
|
64
|
-
*/const Ze=["input","textarea","*[contenteditable]"].join(", ");class et extends he{constructor(t,s,i,o){super(s,t,de,o),this._onFocusDummyInput=t=>{var s,i;const o=this._element.get(),n=t.input;if(o&&n){const r=Ie.getTabsterContext(this._tabster,o);let l;r&&(l=null===(s=Ve.findNextTabbable(this._tabster,r,void 0,n,void 0,!t.isFirst,!0))||void 0===s?void 0:s.element);const a=null===(i=this._getMemorized())||void 0===i?void 0:i.get();a&&this._tabster.focusable.isFocusable(a)&&(l=a),l&&e(l)}},this._tabster=s,this._getMemorized=i,this._setHandlers(this._onFocusDummyInput)}}class tt extends re{constructor(e,t,s,i,o){var n;super(e,t,i),this._visible={},this._onIntersection=e=>{for(const t of e){const e=t.target,s=te(this._win,e);let i,o=this._fullyVisible;if(t.intersectionRatio>=.25?(i=t.intersectionRatio>=.75?u.Visible:u.PartiallyVisible,i===u.Visible&&(o=s)):i=u.Invisible,this._visible[s]!==i){void 0===i?(delete this._visible[s],o===s&&delete this._fullyVisible):(this._visible[s]=i,this._fullyVisible=o);const t=this.getState(e);t&&e.dispatchEvent(new x(t))}}},this._win=e.getWindow,this.visibilityTolerance=null!==(n=i.visibilityTolerance)&&void 0!==n?n:.8,(this._props.trackState||this._props.visibilityAware)&&(this._intersectionObserver=new IntersectionObserver(this._onIntersection,{threshold:[0,.25,.5,.75,1]}),this._observeState()),this._onDispose=s;const r=()=>i.memorizeCurrent?this._current:void 0;e.controlTab||(this.dummyManager=new et(this._element,e,r,o))}dispose(){var e;this._onDispose(this),this._intersectionObserver&&(this._intersectionObserver.disconnect(),delete this._intersectionObserver),delete this._current,delete this._fullyVisible,delete this._allElements,delete this._updateQueue,this._unobserve&&(this._unobserve(),delete this._unobserve);const t=this._win();this._setCurrentTimer&&(t.clearTimeout(this._setCurrentTimer),delete this._setCurrentTimer),this._updateTimer&&(t.clearTimeout(this._updateTimer),delete this._updateTimer),null===(e=this.dummyManager)||void 0===e||e.dispose(),delete this.dummyManager}setCurrent(e){this._current=e?new Q(this._win,e):void 0,!this._props.trackState&&!this._props.visibilityAware||this._setCurrentTimer||(this._setCurrentTimer=this._win().setTimeout((()=>{var e;delete this._setCurrentTimer;const t=[];this._current!==this._prevCurrent&&(t.push(this._current),t.push(this._prevCurrent),this._prevCurrent=this._current);for(const s of t){const t=null==s?void 0:s.get();if(t&&(null===(e=this._allElements)||void 0===e?void 0:e.get(t))===this){const e=this._props;if(t&&(void 0!==e.visibilityAware||e.trackState)){const e=this.getState(t);e&&t.dispatchEvent(new x(e))}}}})))}getCurrent(){var e;return(null===(e=this._current)||void 0===e?void 0:e.get())||null}findNextTabbable(e,t,s,i){const o=this.getElement(),n=o&&ge(e)===o;if(!o)return null;let r,l=null,a=!1;if(this._props.tabbable||n||e&&!V.nodeContains(o,e)){const n={currentElement:e,referenceElement:t,container:o,ignoreAccessibility:i,useActiveModalizer:!0},u={};l=this._tabster.focusable[s?"findPrev":"findNext"](n,u),a=!!u.outOfDOMOrder,r=u.uncontrolled}return{element:l,uncontrolled:r,outOfDOMOrder:a}}acceptElement(e,t){var s,i;if(!Ve.isTabbing)return(null===(s=t.currentCtx)||void 0===s?void 0:s.excludedFromMover)?NodeFilter.FILTER_REJECT:void 0;const{memorizeCurrent:o,visibilityAware:n,hasDefault:r=!0}=this._props,l=this.getElement();if(l&&(o||n||r)&&(!V.nodeContains(l,t.from)||ge(t.from)===l)){let e;if(o){const s=null===(i=this._current)||void 0===i?void 0:i.get();s&&t.acceptCondition(s)&&(e=s)}if(!e&&r&&(e=this._tabster.focusable.findDefault({container:l,useActiveModalizer:!0})),!e&&n&&(e=this._tabster.focusable.findElement({container:l,useActiveModalizer:!0,isBackward:t.isBackward,acceptCondition:e=>{var s;const i=te(this._win,e),o=this._visible[i];return l!==e&&!!(null===(s=this._allElements)||void 0===s?void 0:s.get(e))&&t.acceptCondition(e)&&(o===u.Visible||o===u.PartiallyVisible&&(n===u.PartiallyVisible||!this._fullyVisible))}})),e)return t.found=!0,t.foundElement=e,t.rejectElementsFrom=l,t.skippedFocusable=!0,NodeFilter.FILTER_ACCEPT}}_observeState(){const e=this.getElement();if(this._unobserve||!e||"undefined"==typeof MutationObserver)return;const t=this._win(),s=this._allElements=new WeakMap,i=this._tabster.focusable;let o=this._updateQueue=[];const n=V.createMutationObserver((e=>{for(const t of e){const e=t.target,s=t.removedNodes,i=t.addedNodes;if("attributes"===t.type)"tabindex"===t.attributeName&&o.push({element:e,type:2});else{for(let e=0;e<s.length;e++)o.push({element:s[e],type:3});for(let e=0;e<i.length;e++)o.push({element:i[e],type:1})}}d()})),r=(e,t)=>{var i,o;const n=s.get(e);n&&t&&(null===(i=this._intersectionObserver)||void 0===i||i.unobserve(e),s.delete(e)),n||t||(s.set(e,this),null===(o=this._intersectionObserver)||void 0===o||o.observe(e))},l=e=>{const t=i.isFocusable(e);s.get(e)?t||r(e,!0):t&&r(e)},a=e=>{const{mover:s}=c(e);if(s&&s!==this){if(s.getElement()!==e||!i.isFocusable(e))return;r(e)}const o=$(t.document,e,(e=>{const{mover:t,groupper:s}=c(e);if(t&&t!==this)return NodeFilter.FILTER_REJECT;const o=null==s?void 0:s.getFirst(!0);return s&&s.getElement()!==e&&o&&o!==e?NodeFilter.FILTER_REJECT:(i.isFocusable(e)&&r(e),NodeFilter.FILTER_SKIP)}));if(o)for(o.currentNode=e;o.nextNode(););},u=e=>{s.get(e)&&r(e,!0);for(let t=V.getFirstElementChild(e);t;t=V.getNextElementSibling(t))u(t)},d=()=>{!this._updateTimer&&o.length&&(this._updateTimer=t.setTimeout((()=>{delete this._updateTimer;for(const{element:e,type:t}of o)switch(t){case 2:l(e);break;case 1:a(e);break;case 3:u(e)}o=this._updateQueue=[]}),0))},c=e=>{const t={};for(let s=e;s;s=V.getParentElement(s)){const e=f(this._tabster,s);if(e&&(e.groupper&&!t.groupper&&(t.groupper=e.groupper),e.mover)){t.mover=e.mover;break}}return t};o.push({element:e,type:1}),d(),n.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex"]}),this._unobserve=()=>{n.disconnect()}}getState(e){const t=te(this._win,e);if(t in this._visible){const s=this._visible[t]||u.Invisible;return{isCurrent:this._current?this._current.get()===e:void 0,visibility:s}}}}class st{constructor(e,t){this._init=()=>{const e=this._win();e.addEventListener("keydown",this._onKeyDown,!0),e.addEventListener(F,this._onMoveFocus),e.addEventListener(C,this._onMemorizedElement),this._tabster.focusedElement.subscribe(this._onFocus)},this._onMoverDispose=e=>{delete this._movers[e.id]},this._onFocus=e=>{var t;let s=e,i=e;for(let o=V.getParentElement(e);o;o=V.getParentElement(o)){const e=null===(t=f(this._tabster,o))||void 0===t?void 0:t.mover;e&&(e.setCurrent(i),s=void 0),!s&&this._tabster.focusable.isFocusable(o)&&(s=i=o)}},this._onKeyDown=async e=>{var t;if(this._ignoredInputTimer&&(this._win().clearTimeout(this._ignoredInputTimer),delete this._ignoredInputTimer),null===(t=this._ignoredInputResolve)||void 0===t||t.call(this,!1),e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)return;const s=e.key;let i;if(s===Se?i=h.ArrowDown:s===We?i=h.ArrowRight:s===Le?i=h.ArrowUp:s===ze?i=h.ArrowLeft:s===Re?i=h.PageDown:s===Pe?i=h.PageUp:s===xe?i=h.Home:s===Me&&(i=h.End),!i)return;const o=this._tabster.focusedElement.getFocusedElement();o&&!await this._isIgnoredInput(o,s)&&this._moveFocus(o,i,e)},this._onMoveFocus=e=>{var t;const s=e.composedPath()[0],i=null===(t=e.detail)||void 0===t?void 0:t.key;s&&void 0!==i&&!e.defaultPrevented&&(this._moveFocus(s,i),e.stopImmediatePropagation())},this._onMemorizedElement=e=>{var t;const s=e.composedPath()[0];let i=null===(t=e.detail)||void 0===t?void 0:t.memorizedElement;if(s){const t=Ie.getTabsterContext(this._tabster,s),o=null==t?void 0:t.mover;o&&(i&&!V.nodeContains(o.getElement(),i)&&(i=void 0),o.setCurrent(i),e.stopImmediatePropagation())}},this._tabster=e,this._win=t,this._movers={},e.queueInit(this._init)}dispose(){var e;const t=this._win();this._tabster.focusedElement.unsubscribe(this._onFocus),null===(e=this._ignoredInputResolve)||void 0===e||e.call(this,!1),this._ignoredInputTimer&&(t.clearTimeout(this._ignoredInputTimer),delete this._ignoredInputTimer),t.removeEventListener("keydown",this._onKeyDown,!0),t.removeEventListener(F,this._onMoveFocus),t.removeEventListener(C,this._onMemorizedElement),Object.keys(this._movers).forEach((e=>{this._movers[e]&&(this._movers[e].dispose(),delete this._movers[e])}))}createMover(e,t,s){process.env.NODE_ENV;const i=new tt(this._tabster,e,this._onMoverDispose,t,s);return this._movers[i.id]=i,i}moveFocus(e,t){return this._moveFocus(e,t)}_moveFocus(t,s,i){var o,n;const r=this._tabster,l=Ie.getTabsterContext(r,t,{checkRtl:!0});if(!l||!l.mover||l.excludedFromMover||i&&l.ignoreKeydown(i))return null;const a=l.mover,u=a.getElement();if(l.groupperBeforeMover){const e=l.groupper;if(!e||e.isActive(!0))return null;for(let t=V.getParentElement(e.getElement());t&&t!==u;t=V.getParentElement(t))if(null===(n=null===(o=f(r,t))||void 0===o?void 0:o.groupper)||void 0===n?void 0:n.isActive(!0))return null}if(!u)return null;const d=r.focusable,m=a.getProps(),_=m.direction||c.Both,v=_===c.Both,p=v||_===c.Vertical,b=v||_===c.Horizontal,g=_===c.GridLinear,E=g||_===c.Grid,y=m.cyclic;let w,T,F,C=0,I=0;if(E&&(F=t.getBoundingClientRect(),C=Math.ceil(F.left),I=Math.floor(F.right)),l.rtl&&(s===h.ArrowRight?s=h.ArrowLeft:s===h.ArrowLeft&&(s=h.ArrowRight)),s===h.ArrowDown&&p||s===h.ArrowRight&&(b||E))if(w=d.findNext({currentElement:t,container:u,useActiveModalizer:!0}),w&&E){const e=Math.ceil(w.getBoundingClientRect().left);!g&&I>e&&(w=void 0)}else!w&&y&&(w=d.findFirst({container:u,useActiveModalizer:!0}));else if(s===h.ArrowUp&&p||s===h.ArrowLeft&&(b||E))if(w=d.findPrev({currentElement:t,container:u,useActiveModalizer:!0}),w&&E){const e=Math.floor(w.getBoundingClientRect().right);!g&&e>C&&(w=void 0)}else!w&&y&&(w=d.findLast({container:u,useActiveModalizer:!0}));else if(s===h.Home)E?d.findElement({container:u,currentElement:t,useActiveModalizer:!0,isBackward:!0,acceptCondition:e=>{var s;if(!d.isFocusable(e))return!1;const i=Math.ceil(null!==(s=e.getBoundingClientRect().left)&&void 0!==s?s:0);return e!==t&&C<=i||(w=e,!1)}}):w=d.findFirst({container:u,useActiveModalizer:!0});else if(s===h.End)E?d.findElement({container:u,currentElement:t,useActiveModalizer:!0,acceptCondition:e=>{var s;if(!d.isFocusable(e))return!1;const i=Math.ceil(null!==(s=e.getBoundingClientRect().left)&&void 0!==s?s:0);return e!==t&&C>=i||(w=e,!1)}}):w=d.findLast({container:u,useActiveModalizer:!0});else if(s===h.PageUp){if(d.findElement({currentElement:t,container:u,useActiveModalizer:!0,isBackward:!0,acceptCondition:e=>!!d.isFocusable(e)&&(!X(this._win,e,a.visibilityTolerance)||(w=e,!1))}),E&&w){const e=Math.ceil(w.getBoundingClientRect().left);d.findElement({currentElement:w,container:u,useActiveModalizer:!0,acceptCondition:t=>{if(!d.isFocusable(t))return!1;const s=Math.ceil(t.getBoundingClientRect().left);return C<s||e>=s||(w=t,!1)}})}T=!1}else if(s===h.PageDown){if(d.findElement({currentElement:t,container:u,useActiveModalizer:!0,acceptCondition:e=>!!d.isFocusable(e)&&(!X(this._win,e,a.visibilityTolerance)||(w=e,!1))}),E&&w){const e=Math.ceil(w.getBoundingClientRect().left);d.findElement({currentElement:w,container:u,useActiveModalizer:!0,isBackward:!0,acceptCondition:t=>{if(!d.isFocusable(t))return!1;const s=Math.ceil(t.getBoundingClientRect().left);return C>s||e<=s||(w=t,!1)}})}T=!0}else if(E){const e=s===h.ArrowUp,i=C,o=Math.ceil(F.top),n=I,r=Math.floor(F.bottom);let l,a,c=0;d.findAll({container:u,currentElement:t,isBackward:e,onElement:t=>{const s=t.getBoundingClientRect(),u=Math.ceil(s.left),d=Math.ceil(s.top),h=Math.floor(s.right),m=Math.floor(s.bottom);if(e&&o<m||!e&&r>d)return!0;const _=Math.ceil(Math.min(n,h))-Math.floor(Math.max(i,u)),v=Math.ceil(Math.min(n-i,h-u));if(_>0&&v>=_){const e=_/v;e>c&&(l=t,c=e)}else if(0===c){const e=function(e,t,s,i,o,n,r,l){const a=s<o?o-s:r<e?e-r:0,u=i<n?n-i:l<t?t-l:0;return 0===a?u:0===u?a:Math.sqrt(a*a+u*u)}(i,o,n,r,u,d,h,m);(void 0===a||e<a)&&(a=e,l=t)}else if(c>0)return!1;return!0}}),w=l}return w&&(!i||i&&u.dispatchEvent(new M({by:"mover",owner:u,next:w,relatedEvent:i})))?(void 0!==T&&function(e,t,s){const i=Z(t);if(i){const o=Y(e,i),n=t.getBoundingClientRect();i.scrollTop+=s?n.top-o.top:n.bottom-o.bottom}}(this._win,w,T),i&&(i.preventDefault(),i.stopImmediatePropagation()),e(w),w):null}async _isIgnoredInput(e,t){if("true"===e.getAttribute("aria-expanded")&&e.hasAttribute("aria-activedescendant"))return!0;if(oe(e,Ze)){let s,i=0,o=0,n=0;if("INPUT"===e.tagName||"TEXTAREA"===e.tagName){const s=e.type,r=e.value;if(n=(r||"").length,"email"===s||"number"===s){if(n){const s=V.getSelection(e);if(s){const e=s.toString().length,i=t===ze||t===Le;if(s.modify("extend",i?"backward":"forward","character"),e!==s.toString().length)return s.modify("extend",i?"forward":"backward","character"),!0;n=0}}}else{const t=e.selectionStart;if(null===t)return"hidden"===s;i=t||0,o=e.selectionEnd||0}}else"true"===e.contentEditable&&(s=new(function(e){const t=G(e);if(t.basics.Promise)return t.basics.Promise;throw new Error("No Promise defined.")}(this._win))((t=>{this._ignoredInputResolve=e=>{delete this._ignoredInputResolve,t(e)};const s=this._win();this._ignoredInputTimer&&s.clearTimeout(this._ignoredInputTimer);const{anchorNode:r,focusNode:l,anchorOffset:a,focusOffset:u}=V.getSelection(e)||{};this._ignoredInputTimer=s.setTimeout((()=>{var t,s,d;delete this._ignoredInputTimer;const{anchorNode:c,focusNode:h,anchorOffset:m,focusOffset:_}=V.getSelection(e)||{};if(c===r&&h===l&&m===a&&_===u){if(i=m||0,o=_||0,n=(null===(s=e.textContent)||void 0===s?void 0:s.length)||0,c&&h&&V.nodeContains(e,c)&&V.nodeContains(e,h)&&c!==e){let t=!1;const s=e=>{if(e===c)t=!0;else if(e===h)return!0;const n=e.textContent;if(n&&!V.getFirstChild(e)){const e=n.length;t?h!==c&&(o+=e):(i+=e,o+=e)}let r=!1;for(let t=V.getFirstChild(e);t&&!r;t=t.nextSibling)r=s(t);return r};s(e)}null===(d=this._ignoredInputResolve)||void 0===d||d.call(this,!0)}else null===(t=this._ignoredInputResolve)||void 0===t||t.call(this,!1)}),0)})));if(s&&!await s)return!0;if(i!==o)return!0;if(i>0&&(t===ze||t===Le||t===xe))return!0;if(i<n&&(t===We||t===Se||t===Me))return!0}return!1}}
|
|
60
|
+
*/const je=["input","textarea","*[contenteditable]"].join(", ");class He extends ae{constructor(t,s,i,o){super(s,t,le,o),this._onFocusDummyInput=t=>{var s,i;const o=this._element.get(),n=t.input;if(o&&n){const r=we.getTabsterContext(this._tabster,o);let l;r&&(l=null===(s=ze.findNextTabbable(this._tabster,r,void 0,n,void 0,!t.isFirst,!0))||void 0===s?void 0:s.element);const a=null===(i=this._getMemorized())||void 0===i?void 0:i.get();a&&this._tabster.focusable.isFocusable(a)&&(l=a),l&&e(l)}},this._tabster=s,this._getMemorized=i,this._setHandlers(this._onFocusDummyInput)}}class Qe extends ie{constructor(e,t,s,i,o){var n;super(e,t,i),this._visible={},this._onIntersection=e=>{for(const t of e){const e=t.target,s=X(this._win,e);let i,o=this._fullyVisible;if(t.intersectionRatio>=.25?(i=t.intersectionRatio>=.75?d.Visible:d.PartiallyVisible,i===d.Visible&&(o=s)):i=d.Invisible,this._visible[s]!==i){void 0===i?(delete this._visible[s],o===s&&delete this._fullyVisible):(this._visible[s]=i,this._fullyVisible=o);const t=this.getState(e);t&&e.dispatchEvent(new R(t))}}},this._win=e.getWindow,this.visibilityTolerance=null!==(n=i.visibilityTolerance)&&void 0!==n?n:.8,(this._props.trackState||this._props.visibilityAware)&&(this._intersectionObserver=new IntersectionObserver(this._onIntersection,{threshold:[0,.25,.5,.75,1]}),this._observeState()),this._onDispose=s;const r=()=>i.memorizeCurrent?this._current:void 0;e.controlTab||(this.dummyManager=new He(this._element,e,r,o))}dispose(){var e;this._onDispose(this),this._intersectionObserver&&(this._intersectionObserver.disconnect(),delete this._intersectionObserver),delete this._current,delete this._fullyVisible,delete this._allElements,delete this._updateQueue,this._unobserve&&(this._unobserve(),delete this._unobserve);const t=this._win();this._setCurrentTimer&&(t.clearTimeout(this._setCurrentTimer),delete this._setCurrentTimer),this._updateTimer&&(t.clearTimeout(this._updateTimer),delete this._updateTimer),null===(e=this.dummyManager)||void 0===e||e.dispose(),delete this.dummyManager}setCurrent(e){this._current=e?new j(this._win,e):void 0,!this._props.trackState&&!this._props.visibilityAware||this._setCurrentTimer||(this._setCurrentTimer=this._win().setTimeout((()=>{var e;delete this._setCurrentTimer;const t=[];this._current!==this._prevCurrent&&(t.push(this._current),t.push(this._prevCurrent),this._prevCurrent=this._current);for(const s of t){const t=null==s?void 0:s.get();if(t&&(null===(e=this._allElements)||void 0===e?void 0:e.get(t))===this){const e=this._props;if(t&&(void 0!==e.visibilityAware||e.trackState)){const e=this.getState(t);e&&t.dispatchEvent(new R(e))}}}})))}getCurrent(){var e;return(null===(e=this._current)||void 0===e?void 0:e.get())||null}findNextTabbable(e,t,s,i){const o=this.getElement(),n=o&&ve(e)===o;if(!o)return null;let r,l=null,a=!1;if(this._props.tabbable||n||e&&!L.nodeContains(o,e)){const n={currentElement:e,referenceElement:t,container:o,ignoreAccessibility:i,useActiveModalizer:!0},d={};l=this._tabster.focusable[s?"findPrev":"findNext"](n,d),a=!!d.outOfDOMOrder,r=d.uncontrolled}return{element:l,uncontrolled:r,outOfDOMOrder:a}}acceptElement(e,t){var s,i;if(!ze.isTabbing)return(null===(s=t.currentCtx)||void 0===s?void 0:s.excludedFromMover)?NodeFilter.FILTER_REJECT:void 0;const{memorizeCurrent:o,visibilityAware:n,hasDefault:r=!0}=this._props,l=this.getElement();if(l&&(o||n||r)&&(!L.nodeContains(l,t.from)||ve(t.from)===l)){let e;if(o){const s=null===(i=this._current)||void 0===i?void 0:i.get();s&&t.acceptCondition(s)&&(e=s)}if(!e&&r&&(e=this._tabster.focusable.findDefault({container:l,useActiveModalizer:!0})),!e&&n&&(e=this._tabster.focusable.findElement({container:l,useActiveModalizer:!0,isBackward:t.isBackward,acceptCondition:e=>{var s;const i=X(this._win,e),o=this._visible[i];return l!==e&&!!(null===(s=this._allElements)||void 0===s?void 0:s.get(e))&&t.acceptCondition(e)&&(o===d.Visible||o===d.PartiallyVisible&&(n===d.PartiallyVisible||!this._fullyVisible))}})),e)return t.found=!0,t.foundElement=e,t.rejectElementsFrom=l,t.skippedFocusable=!0,NodeFilter.FILTER_ACCEPT}}_observeState(){const e=this.getElement();if(this._unobserve||!e||"undefined"==typeof MutationObserver)return;const t=this._win(),s=this._allElements=new WeakMap,i=this._tabster.focusable;let o=this._updateQueue=[];const n=L.createMutationObserver((e=>{for(const t of e){const e=t.target,s=t.removedNodes,i=t.addedNodes;if("attributes"===t.type)"tabindex"===t.attributeName&&o.push({element:e,type:2});else{for(let e=0;e<s.length;e++)o.push({element:s[e],type:3});for(let e=0;e<i.length;e++)o.push({element:i[e],type:1})}}u()})),r=(e,t)=>{var i,o;const n=s.get(e);n&&t&&(null===(i=this._intersectionObserver)||void 0===i||i.unobserve(e),s.delete(e)),n||t||(s.set(e,this),null===(o=this._intersectionObserver)||void 0===o||o.observe(e))},l=e=>{const t=i.isFocusable(e);s.get(e)?t||r(e,!0):t&&r(e)},a=e=>{const{mover:s}=c(e);if(s&&s!==this){if(s.getElement()!==e||!i.isFocusable(e))return;r(e)}const o=G(t.document,e,(e=>{const{mover:t,groupper:s}=c(e);if(t&&t!==this)return NodeFilter.FILTER_REJECT;const o=null==s?void 0:s.getFirst(!0);return s&&s.getElement()!==e&&o&&o!==e?NodeFilter.FILTER_REJECT:(i.isFocusable(e)&&r(e),NodeFilter.FILTER_SKIP)}));if(o)for(o.currentNode=e;o.nextNode(););},d=e=>{s.get(e)&&r(e,!0);for(let t=L.getFirstElementChild(e);t;t=L.getNextElementSibling(t))d(t)},u=()=>{!this._updateTimer&&o.length&&(this._updateTimer=t.setTimeout((()=>{delete this._updateTimer;for(const{element:e,type:t}of o)switch(t){case 2:l(e);break;case 1:a(e);break;case 3:d(e)}o=this._updateQueue=[]}),0))},c=e=>{const t={};for(let s=e;s;s=L.getParentElement(s)){const e=_(this._tabster,s);if(e&&(e.groupper&&!t.groupper&&(t.groupper=e.groupper),e.mover)){t.mover=e.mover;break}}return t};o.push({element:e,type:1}),u(),n.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["tabindex"]}),this._unobserve=()=>{n.disconnect()}}getState(e){const t=X(this._win,e);if(t in this._visible){const s=this._visible[t]||d.Invisible;return{isCurrent:this._current?this._current.get()===e:void 0,visibility:s}}}}class Ge{constructor(e,t){this._init=()=>{const e=this._win();e.addEventListener("keydown",this._onKeyDown,!0),e.addEventListener(w,this._onMoveFocus),e.addEventListener(T,this._onMemorizedElement),this._tabster.focusedElement.subscribe(this._onFocus)},this._onMoverDispose=e=>{delete this._movers[e.id]},this._onFocus=e=>{var t;let s=e,i=e;for(let o=L.getParentElement(e);o;o=L.getParentElement(o)){const e=null===(t=_(this._tabster,o))||void 0===t?void 0:t.mover;e&&(e.setCurrent(i),s=void 0),!s&&this._tabster.focusable.isFocusable(o)&&(s=i=o)}},this._onKeyDown=async e=>{var t;if(this._ignoredInputTimer&&(this._win().clearTimeout(this._ignoredInputTimer),delete this._ignoredInputTimer),null===(t=this._ignoredInputResolve)||void 0===t||t.call(this,!1),e.ctrlKey||e.altKey||e.shiftKey||e.metaKey)return;const s=e.key;let i;if(s===Me?i=h.ArrowDown:s===Pe?i=h.ArrowRight:s===Re?i=h.ArrowUp:s===Ae?i=h.ArrowLeft:s===Oe?i=h.PageDown:s===De?i=h.PageUp:s===Ne?i=h.Home:s===ke&&(i=h.End),!i)return;const o=this._tabster.focusedElement.getFocusedElement();o&&!await this._isIgnoredInput(o,s)&&this._moveFocus(o,i,e)},this._onMoveFocus=e=>{var t;const s=e.composedPath()[0],i=null===(t=e.detail)||void 0===t?void 0:t.key;s&&void 0!==i&&!e.defaultPrevented&&(this._moveFocus(s,i),e.stopImmediatePropagation())},this._onMemorizedElement=e=>{var t;const s=e.composedPath()[0];let i=null===(t=e.detail)||void 0===t?void 0:t.memorizedElement;if(s){const t=we.getTabsterContext(this._tabster,s),o=null==t?void 0:t.mover;o&&(i&&!L.nodeContains(o.getElement(),i)&&(i=void 0),o.setCurrent(i),e.stopImmediatePropagation())}},this._tabster=e,this._win=t,this._movers={},e.queueInit(this._init)}dispose(){var e;const t=this._win();this._tabster.focusedElement.unsubscribe(this._onFocus),null===(e=this._ignoredInputResolve)||void 0===e||e.call(this,!1),this._ignoredInputTimer&&(t.clearTimeout(this._ignoredInputTimer),delete this._ignoredInputTimer),t.removeEventListener("keydown",this._onKeyDown,!0),t.removeEventListener(w,this._onMoveFocus),t.removeEventListener(T,this._onMemorizedElement),Object.keys(this._movers).forEach((e=>{this._movers[e]&&(this._movers[e].dispose(),delete this._movers[e])}))}createMover(e,t,s){process.env.NODE_ENV;const i=new Qe(this._tabster,e,this._onMoverDispose,t,s);return this._movers[i.id]=i,i}moveFocus(e,t){return this._moveFocus(e,t)}_moveFocus(t,s,i){var o,n;const r=this._tabster,l=we.getTabsterContext(r,t,{checkRtl:!0});if(!l||!l.mover||l.excludedFromMover||i&&l.ignoreKeydown(i))return null;const a=l.mover,d=a.getElement();if(l.groupperBeforeMover){const e=l.groupper;if(!e||e.isActive(!0))return null;for(let t=L.getParentElement(e.getElement());t&&t!==d;t=L.getParentElement(t))if(null===(n=null===(o=_(r,t))||void 0===o?void 0:o.groupper)||void 0===n?void 0:n.isActive(!0))return null}if(!d)return null;const u=r.focusable,m=a.getProps(),v=m.direction||c.Both,f=v===c.Both,b=f||v===c.Vertical,p=f||v===c.Horizontal,g=v===c.GridLinear,E=g||v===c.Grid,y=m.cyclic;let w,T,F,I=0,C=0;if(E&&(F=t.getBoundingClientRect(),I=Math.ceil(F.left),C=Math.floor(F.right)),l.rtl&&(s===h.ArrowRight?s=h.ArrowLeft:s===h.ArrowLeft&&(s=h.ArrowRight)),s===h.ArrowDown&&b||s===h.ArrowRight&&(p||E))if(w=u.findNext({currentElement:t,container:d,useActiveModalizer:!0}),w&&E){const e=Math.ceil(w.getBoundingClientRect().left);!g&&C>e&&(w=void 0)}else!w&&y&&(w=u.findFirst({container:d,useActiveModalizer:!0}));else if(s===h.ArrowUp&&b||s===h.ArrowLeft&&(p||E))if(w=u.findPrev({currentElement:t,container:d,useActiveModalizer:!0}),w&&E){const e=Math.floor(w.getBoundingClientRect().right);!g&&e>I&&(w=void 0)}else!w&&y&&(w=u.findLast({container:d,useActiveModalizer:!0}));else if(s===h.Home)E?u.findElement({container:d,currentElement:t,useActiveModalizer:!0,isBackward:!0,acceptCondition:e=>{var s;if(!u.isFocusable(e))return!1;const i=Math.ceil(null!==(s=e.getBoundingClientRect().left)&&void 0!==s?s:0);return e!==t&&I<=i||(w=e,!1)}}):w=u.findFirst({container:d,useActiveModalizer:!0});else if(s===h.End)E?u.findElement({container:d,currentElement:t,useActiveModalizer:!0,acceptCondition:e=>{var s;if(!u.isFocusable(e))return!1;const i=Math.ceil(null!==(s=e.getBoundingClientRect().left)&&void 0!==s?s:0);return e!==t&&I>=i||(w=e,!1)}}):w=u.findLast({container:d,useActiveModalizer:!0});else if(s===h.PageUp){if(u.findElement({currentElement:t,container:d,useActiveModalizer:!0,isBackward:!0,acceptCondition:e=>!!u.isFocusable(e)&&(!J(this._win,e,a.visibilityTolerance)||(w=e,!1))}),E&&w){const e=Math.ceil(w.getBoundingClientRect().left);u.findElement({currentElement:w,container:d,useActiveModalizer:!0,acceptCondition:t=>{if(!u.isFocusable(t))return!1;const s=Math.ceil(t.getBoundingClientRect().left);return I<s||e>=s||(w=t,!1)}})}T=!1}else if(s===h.PageDown){if(u.findElement({currentElement:t,container:d,useActiveModalizer:!0,acceptCondition:e=>!!u.isFocusable(e)&&(!J(this._win,e,a.visibilityTolerance)||(w=e,!1))}),E&&w){const e=Math.ceil(w.getBoundingClientRect().left);u.findElement({currentElement:w,container:d,useActiveModalizer:!0,isBackward:!0,acceptCondition:t=>{if(!u.isFocusable(t))return!1;const s=Math.ceil(t.getBoundingClientRect().left);return I>s||e<=s||(w=t,!1)}})}T=!0}else if(E){const e=s===h.ArrowUp,i=I,o=Math.ceil(F.top),n=C,r=Math.floor(F.bottom);let l,a,c=0;u.findAll({container:d,currentElement:t,isBackward:e,onElement:t=>{const s=t.getBoundingClientRect(),d=Math.ceil(s.left),u=Math.ceil(s.top),h=Math.floor(s.right),m=Math.floor(s.bottom);if(e&&o<m||!e&&r>u)return!0;const _=Math.ceil(Math.min(n,h))-Math.floor(Math.max(i,d)),v=Math.ceil(Math.min(n-i,h-d));if(_>0&&v>=_){const e=_/v;e>c&&(l=t,c=e)}else if(0===c){const e=function(e,t,s,i,o,n,r,l){const a=s<o?o-s:r<e?e-r:0,d=i<n?n-i:l<t?t-l:0;return 0===a?d:0===d?a:Math.sqrt(a*a+d*d)}(i,o,n,r,d,u,h,m);(void 0===a||e<a)&&(a=e,l=t)}else if(c>0)return!1;return!0}}),w=l}return w&&(!i||i&&d.dispatchEvent(new A({by:"mover",owner:d,next:w,relatedEvent:i})))?(void 0!==T&&function(e,t,s){const i=$(t);if(i){const o=q(e,i),n=t.getBoundingClientRect();i.scrollTop+=s?n.top-o.top:n.bottom-o.bottom}}(this._win,w,T),i&&(i.preventDefault(),i.stopImmediatePropagation()),e(w),w):null}async _isIgnoredInput(e,t){if("true"===e.getAttribute("aria-expanded")&&e.hasAttribute("aria-activedescendant"))return!0;if(te(e,je)){let s,i=0,o=0,n=0;if("INPUT"===e.tagName||"TEXTAREA"===e.tagName){const s=e.type,r=e.value;if(n=(r||"").length,"email"===s||"number"===s){if(n){const s=L.getSelection(e);if(s){const e=s.toString().length,i=t===Ae||t===Re;if(s.modify("extend",i?"backward":"forward","character"),e!==s.toString().length)return s.modify("extend",i?"forward":"backward","character"),!0;n=0}}}else{const t=e.selectionStart;if(null===t)return"hidden"===s;i=t||0,o=e.selectionEnd||0}}else"true"===e.contentEditable&&(s=new(function(e){const t=U(e);if(t.basics.Promise)return t.basics.Promise;throw new Error("No Promise defined.")}(this._win))((t=>{this._ignoredInputResolve=e=>{delete this._ignoredInputResolve,t(e)};const s=this._win();this._ignoredInputTimer&&s.clearTimeout(this._ignoredInputTimer);const{anchorNode:r,focusNode:l,anchorOffset:a,focusOffset:d}=L.getSelection(e)||{};this._ignoredInputTimer=s.setTimeout((()=>{var t,s,u;delete this._ignoredInputTimer;const{anchorNode:c,focusNode:h,anchorOffset:m,focusOffset:_}=L.getSelection(e)||{};if(c===r&&h===l&&m===a&&_===d){if(i=m||0,o=_||0,n=(null===(s=e.textContent)||void 0===s?void 0:s.length)||0,c&&h&&L.nodeContains(e,c)&&L.nodeContains(e,h)&&c!==e){let t=!1;const s=e=>{if(e===c)t=!0;else if(e===h)return!0;const n=e.textContent;if(n&&!L.getFirstChild(e)){const e=n.length;t?h!==c&&(o+=e):(i+=e,o+=e)}let r=!1;for(let t=L.getFirstChild(e);t&&!r;t=t.nextSibling)r=s(t);return r};s(e)}null===(u=this._ignoredInputResolve)||void 0===u||u.call(this,!0)}else null===(t=this._ignoredInputResolve)||void 0===t||t.call(this,!1)}),0)})));if(s&&!await s)return!0;if(i!==o)return!0;if(i>0&&(t===Ae||t===Re||t===Ne))return!0;if(i<n&&(t===Pe||t===Me||t===ke))return!0}return!1}}
|
|
65
61
|
/*!
|
|
66
62
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
67
63
|
* Licensed under the MIT License.
|
|
@@ -70,12 +66,12 @@ class Ue extends he{constructor(t,s,i,o){super(i,t,ce,o,!0),this._setHandlers(((
|
|
|
70
66
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
71
67
|
* Licensed under the MIT License.
|
|
72
68
|
*/
|
|
73
|
-
class
|
|
69
|
+
class qe{constructor(e){this._isUncontrolledCompletely=e}isUncontrolledCompletely(e,t){var s;const i=null===(s=this._isUncontrolledCompletely)||void 0===s?void 0:s.call(this,e,t);return void 0===i?t:i}}
|
|
74
70
|
/*!
|
|
75
71
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
76
72
|
* Licensed under the MIT License.
|
|
77
|
-
*/class
|
|
73
|
+
*/class Je extends ie{constructor(e,t,s){var i;if(super(e,t,s),this._hasFocus=!1,this._onFocusOut=e=>{var t;const s=null===(t=this._element)||void 0===t?void 0:t.get();s&&null===e.relatedTarget&&s.dispatchEvent(new x),s&&!L.nodeContains(s,e.relatedTarget)&&(this._hasFocus=!1)},this._onFocusIn=()=>{this._hasFocus=!0},this._props.type===u.Source){const e=null===(i=this._element)||void 0===i?void 0:i.get();null==e||e.addEventListener("focusout",this._onFocusOut),null==e||e.addEventListener("focusin",this._onFocusIn),this._hasFocus=L.nodeContains(e,e&&L.getActiveElement(e.ownerDocument))}}dispose(){var e;if(this._props.type===u.Source){const t=null===(e=this._element)||void 0===e?void 0:e.get();if(null==t||t.removeEventListener("focusout",this._onFocusOut),null==t||t.removeEventListener("focusin",this._onFocusIn),this._hasFocus){this._tabster.getWindow().document.body.dispatchEvent(new x)}}}}class $e{constructor(e){this._stack=[],this._getWindow=e}push(e){var t;(null===(t=this._stack[this._stack.length-1])||void 0===t?void 0:t.get())!==e&&(this._stack.length>$e.DEPTH&&this._stack.shift(),this._stack.push(new j(this._getWindow,e)))}pop(e){var t;void 0===e&&(e=()=>!0);const s=this._getWindow().document;for(let i=this._stack.length-1;i>=0;i--){const i=null===(t=this._stack.pop())||void 0===t?void 0:t.get();if(i&&L.nodeContains(s.body,L.getParentElement(i))&&e(i))return i}}}$e.DEPTH=10;class Ye{constructor(e){this._onRestoreFocus=e=>{var t,s;this._focusedElementState.cancelAsyncFocus(a.Restorer);const i=e.composedPath()[0];if(i){const e=null===(s=null===(t=_(this._tabster,i))||void 0===t?void 0:t.restorer)||void 0===s?void 0:s.getProps().id;this._focusedElementState.requestAsyncFocus(a.Restorer,(()=>this._restoreFocus(i,e)),0)}},this._onFocusIn=e=>{var t;if(!e)return;const s=_(this._tabster,e);(null===(t=null==s?void 0:s.restorer)||void 0===t?void 0:t.getProps().type)===u.Target&&this._history.push(e)},this._restoreFocus=(e,t)=>{var s;const i=this._getWindow().document;if(L.getActiveElement(i)!==i.body)return;if(!this._keyboardNavState.isNavigatingWithKeyboard()&&L.nodeContains(i.body,e))return;const o=e=>{var t,s;const i=null===(s=null===(t=_(this._tabster,e))||void 0===t?void 0:t.restorer)||void 0===s?void 0:s.getProps();return i?i.id:null};null===(s=this._history.pop((e=>t===o(e))))||void 0===s||s.focus()},this._tabster=e,this._getWindow=e.getWindow,this._getWindow().addEventListener(F,this._onRestoreFocus),this._history=new $e(this._getWindow),this._keyboardNavState=e.keyboardNavigation,this._focusedElementState=e.focusedElement,this._focusedElementState.subscribe(this._onFocusIn)}dispose(){const e=this._getWindow();this._focusedElementState.unsubscribe(this._onFocusIn),this._focusedElementState.cancelAsyncFocus(a.Restorer),e.removeEventListener(F,this._onRestoreFocus)}createRestorer(e,t){const s=new Je(this._tabster,e,t);return t.type===u.Target&&L.getActiveElement(e.ownerDocument)===e&&this._history.push(e),s}}
|
|
78
74
|
/*!
|
|
79
75
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
80
76
|
* Licensed under the MIT License.
|
|
81
|
-
*/class
|
|
77
|
+
*/class Xe{constructor(e){this.keyboardNavigation=e.keyboardNavigation,this.focusedElement=e.focusedElement,this.focusable=e.focusable,this.root=e.root,this.uncontrolled=e.uncontrolled,this.core=e}}class Ze{constructor(e,t){var s,i;this._forgetMemorizedElements=[],this._wrappers=new Set,this._initQueue=[],this._version="8.5.6",this._noop=!1,this.getWindow=()=>{if(!this._win)throw new Error("Using disposed Tabster.");return this._win},this._storage=function(e){const t=e.__tabsterInstanceContext;return new((null==t?void 0:t.basics.WeakMap)||WeakMap)}(e),this._win=e;const o=this.getWindow;(null==t?void 0:t.DOMAPI)&&function(e){for(const t of Object.keys(e))L[t]=e[t]}({...t.DOMAPI}),this.keyboardNavigation=new We(o),this.focusedElement=new ze(this,o),this.focusable=new Fe(this),this.root=new we(this,null==t?void 0:t.autoRoot),this.uncontrolled=new qe((null==t?void 0:t.checkUncontrolledCompletely)||(null==t?void 0:t.checkUncontrolledTrappingFocus)),this.controlTab=null===(s=null==t?void 0:t.controlTab)||void 0===s||s,this.rootDummyInputs=!!(null==t?void 0:t.rootDummyInputs),this._dummyObserver=new ue(o),this.getParent=null!==(i=null==t?void 0:t.getParent)&&void 0!==i?i:L.getParentNode,this.internal={stopObserver:()=>{this._unobserve&&(this._unobserve(),delete this._unobserve)},resumeObserver:e=>{if(!this._unobserve){const t=o().document;this._unobserve=function(e,t,s,i){if("undefined"==typeof MutationObserver)return()=>{};const o=t.getWindow;let r;function l(t,s){r||(r=U(o).elementByUId),a(t,s);const i=G(e,t,(e=>a(e,s)));if(i)for(;i.nextNode(););}function a(e,i){var l;if(!e.getAttribute)return NodeFilter.FILTER_SKIP;const a=e.__tabsterElementUID;return a&&r&&(i?delete r[a]:null!==(l=r[a])&&void 0!==l||(r[a]=new j(o,e))),(_(t,e)||e.hasAttribute(n))&&s(t,e,i),NodeFilter.FILTER_SKIP}const d=L.createMutationObserver((e=>{var i,o,r,a,d;const u=new Set;for(const d of e){const e=d.target,c=d.removedNodes,h=d.addedNodes;if("attributes"===d.type)d.attributeName===n&&(u.has(e)||s(t,e));else{for(let s=0;s<c.length;s++){const n=c[s];u.add(n),l(n,!0),null===(o=(i=t._dummyObserver).domChanged)||void 0===o||o.call(i,e)}for(let s=0;s<h.length;s++)l(h[s]),null===(a=(r=t._dummyObserver).domChanged)||void 0===a||a.call(r,e)}}u.clear(),null===(d=t.modalizer)||void 0===d||d.hiddenUpdate()}));return i&&l(o().document.body),d.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[n]}),()=>{d.disconnect()}}(t,this,v,e)}}},Q(o),this.queueInit((()=>{this.internal.resumeObserver(!0)}))}_mergeProps(e){var t;e&&(this.getParent=null!==(t=e.getParent)&&void 0!==t?t:this.getParent)}createTabster(e,t){const s=new Xe(this);return e||this._wrappers.add(s),this._mergeProps(t),s}disposeTabster(e,t){t?this._wrappers.clear():this._wrappers.delete(e),0===this._wrappers.size&&this.dispose()}dispose(){var e,t,s,i,o,n,r,l;this.internal.stopObserver();const a=this._win;null==a||a.clearTimeout(this._initTimer),delete this._initTimer,this._initQueue=[],this._forgetMemorizedElements=[],a&&this._forgetMemorizedTimer&&(a.clearTimeout(this._forgetMemorizedTimer),delete this._forgetMemorizedTimer),null===(e=this.outline)||void 0===e||e.dispose(),null===(t=this.crossOrigin)||void 0===t||t.dispose(),null===(s=this.deloser)||void 0===s||s.dispose(),null===(i=this.groupper)||void 0===i||i.dispose(),null===(o=this.mover)||void 0===o||o.dispose(),null===(n=this.modalizer)||void 0===n||n.dispose(),null===(r=this.observedElement)||void 0===r||r.dispose(),null===(l=this.restorer)||void 0===l||l.dispose(),this.keyboardNavigation.dispose(),this.focusable.dispose(),this.focusedElement.dispose(),this.root.dispose(),this._dummyObserver.dispose(),function(e){const t=U(e);t.fakeWeakRefsStarted=!1,t.fakeWeakRefsTimer&&(e().clearTimeout(t.fakeWeakRefsTimer),t.fakeWeakRefsTimer=void 0,t.fakeWeakRefs=[])}(this.getWindow),Z(this.getWindow),this._storage=new WeakMap,this._wrappers.clear(),a&&(!function(e){const t=e.__tabsterInstanceContext;t&&(t.elementByUId={},delete t.WeakRef,t.containerBoundingRectCache={},t.containerBoundingRectCacheTimer&&e.clearTimeout(t.containerBoundingRectCacheTimer),t.fakeWeakRefsTimer&&e.clearTimeout(t.fakeWeakRefsTimer),t.fakeWeakRefs=[],delete e.__tabsterInstanceContext)}(a),delete a.__tabsterInstance,delete this._win)}storageEntry(e,t){const s=this._storage;let i=s.get(e);return i?!1===t&&0===Object.keys(i).length&&s.delete(e):!0===t&&(i={},s.set(e,i)),i}forceCleanup(){this._win&&(this._forgetMemorizedElements.push(this._win.document.body),this._forgetMemorizedTimer||(this._forgetMemorizedTimer=this._win.setTimeout((()=>{delete this._forgetMemorizedTimer;for(let e=this._forgetMemorizedElements.shift();e;e=this._forgetMemorizedElements.shift())Z(this.getWindow,e),ze.forgetMemorized(this.focusedElement,e)}),0),H(this.getWindow,!0)))}queueInit(e){var t;this._win&&(this._initQueue.push(e),this._initTimer||(this._initTimer=null===(t=this._win)||void 0===t?void 0:t.setTimeout((()=>{delete this._initTimer,this.drainInitQueue()}),0)))}drainInitQueue(){if(!this._win)return;const e=this._initQueue;this._initQueue=[],e.forEach((e=>e()))}}function et(e,t){let s=function(e){return e.__tabsterInstance}(e);return s?s.createTabster(!1,t):(s=new Ze(e,t),e.__tabsterInstance=s,s.createTabster())}function tt(e){const t=e.core;return t.mover||(t.mover=new Ge(t,t.getWindow)),t.mover}function st(e,t,s){const i=e.core;return i.modalizer||(i.modalizer=new Ke(i,t,s)),i.modalizer}function it(e){const t=e.core;return t.restorer||(t.restorer=new Ye(t)),t.restorer}function ot(e,t){e.core.disposeTabster(e,t)}export{a as AsyncFocusSources,l as FOCUSABLE_SELECTOR,P as ModalizerActiveEvent,g as ModalizerActiveEventName,M as ModalizerInactiveEvent,E as ModalizerInactiveEventName,c as MoverDirections,h as MoverKeys,T as MoverMemorizedElementEventName,w as MoverMoveFocusEventName,R as MoverStateEvent,y as MoverStateEventName,x as RestorerRestoreFocusEvent,F as RestorerRestoreFocusEventName,u as RestorerTypes,W as RootBlurEvent,C as RootBlurEventName,z as RootFocusEvent,I as RootFocusEventName,m as SysDummyInputsPositions,n as TABSTER_ATTRIBUTE_NAME,r as TABSTER_DUMMY_INPUT_ATTRIBUTE_NAME,O as TabsterCustomEvent,k as TabsterFocusInEvent,f as TabsterFocusInEventName,N as TabsterFocusOutEvent,b as TabsterFocusOutEventName,A as TabsterMoveFocusEvent,p as TabsterMoveFocusEventName,d as Visibilities,et as createTabster,ot as disposeTabster,ve as getDummyInputContainer,st as getModalizer,tt as getMover,it as getRestorer,fe as getTabsterAttribute,be as mergeTabsterProps,pe as setTabsterAttribute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import"../components/Markdown.js";import"../components/Textarea.js";import"../components/Button.js";import"../components/CompoundButton.js";import"../components/Spinner.js";import"../components/TextHeader.js";import"../components/TypingIndicator.js";import"../components/Dialog.js";import"../components/ChatInput.js";import"../components/CombinedPlaceholderDialog.js";import"../components/ChatMessage.js";import"../components/Header.js";import"react";import"../services/codicent.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"../_virtual/index.js";import"../config/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"./Chat.js";import"./Compose.js";import"./Snap.js";import"./Search.js";import"./Login.js";import"./CrmPage.js";import"./CrmPagePersistent.js";import"./ImageView.js";import"./FormInvite.js";import"./FormAccept.js";import"./Sales.js";import"./Purchase.js";import"../components/Content.js";import{Page as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{makeStyles as t}from"@fluentui/react-components";import"../components/Markdown.js";import"../components/Textarea.js";import"../components/Button.js";import"../components/CompoundButton.js";import"../components/Spinner.js";import"../components/TextHeader.js";import"../components/TypingIndicator.js";import"../components/Dialog.js";import"../components/ChatInput.js";import"../components/CombinedPlaceholderDialog.js";import"../components/ChatMessage.js";import"../components/Header.js";import"react";import"@fluentui/react-icons";import"../services/codicent.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"../_virtual/index.js";import"../config/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"./Chat.js";import"./Compose.js";import"./Snap.js";import"./Search.js";import"./Login.js";import"./CrmPage.js";import"./CrmPagePersistent.js";import"./ImageView.js";import"./FormInvite.js";import"./FormAccept.js";import"./Sales.js";import"./Purchase.js";import"../components/Content.js";import{Page as e}from"../components/Page.js";import"./QrScan.js";import"../hooks/useLocalization.js";import"../components/FileThumbnail.js";import"react-dom/client";import"react-router-dom";import"../node_modules/@auth0/auth0-react/dist/auth0-react.esm.js";import"../hooks/useAppStyles.js";import"../components/MessageInput.js";import"../components/UploadFile.js";import"../components/SnapFooter.js";import"../components/Profile.js";import"../components/MessageItem.js";import"../components/AiInput.js";import"../components/SearchBox.js";import"../components/HtmlView.js";import"../components/Footer.js";import"../components/QrCodeDialog.js";import"../components/QrScanner.js";import"../components/OfflineMessage.js";import"../components/LanguageSelector.js";import"../components/ListView.js";import"../components/RecordModal.js";import"../components/BulkUploadDialog.js";const s=t({iframe:{width:"100%",height:"100%",border:"none"},scrollable:{overflow:"auto"},nonScrollable:{overflow:"hidden"},fixFrameHeight:{height:"calc(100% - 5px)"}}),r=({src:t,showFooter:r,title:i})=>{const m=s();return r?o(e,{hideFooter:!r,hideHeader:!0,children:o("iframe",{title:i,src:t,className:`${m.iframe} ${r?m.fixFrameHeight:""}`})}):o("iframe",{title:i,src:t,className:m.iframe})};export{r as default};
|
package/dist/esm/pages/Chat.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useRef as t,useState as n,useEffect as r}from"react";import{useNavigate as
|
|
1
|
+
import{jsxs as e,jsx as o}from"react/jsx-runtime";import{useRef as t,useState as n,useEffect as r}from"react";import{makeStyles as s}from"@fluentui/react-components";import{useNavigate as i,useSearchParams as a}from"react-router-dom";import{CalendarWeekStart24Regular as m}from"@fluentui/react-icons";import"../components/Markdown.js";import"../components/Textarea.js";import"../components/Button.js";import"../components/CompoundButton.js";import"../components/Spinner.js";import l from"../components/TextHeader.js";import c from"../components/TypingIndicator.js";import p from"../components/Prompt.js";import d from"../components/ChatInput.js";import{CombinedPlaceholderDialog as h}from"../components/CombinedPlaceholderDialog.js";import g from"../components/ChatMessage.js";import"../components/Header.js";import u from"../hooks/useStateWithLocalStorage.js";import{CodicentService as j}from"../services/codicent.js";import"../utils/MessageContent.js";import"../node_modules/tinycolor2/esm/tinycolor.js";import"../_virtual/index.js";import{getConfigValue as f}from"../config/index.js";import"../utils/cacheManager.js";import"../lib/wavtools/lib/wav_packer.js";import"../lib/wavtools/lib/analysis/audio_analysis.js";import"../lib/wavtools/lib/wav_stream_player.js";import"../lib/wavtools/lib/wav_recorder.js";import"./AppFrame.js";import"./Compose.js";import"./Snap.js";import"./Search.js";import"./Login.js";import"./CrmPage.js";import"./CrmPagePersistent.js";import"./ImageView.js";import"./FormInvite.js";import"./FormAccept.js";import"./Sales.js";import"./Purchase.js";import"../components/Content.js";import{Page as b}from"../components/Page.js";import"./QrScan.js";import C from"../hooks/useLocalization.js";import"../components/FileThumbnail.js";import"react-dom/client";import"../node_modules/@auth0/auth0-react/dist/auth0-react.esm.js";import{useChat as x}from"../hooks/useChat.js";import{useTemplateVariables as w}from"../hooks/useTemplateVariables.js";import"../hooks/useAppStyles.js";import"../components/MessageInput.js";import"../components/UploadFile.js";import"../components/SnapFooter.js";import"../components/Profile.js";import"../components/MessageItem.js";import"../components/AiInput.js";import"../components/SearchBox.js";import"../components/HtmlView.js";import"../components/Footer.js";import"../components/QrCodeDialog.js";import"../components/QrScanner.js";import"../components/OfflineMessage.js";import"../components/LanguageSelector.js";import"../components/ListView.js";import"../components/RecordModal.js";import"../components/BulkUploadDialog.js";const S=s({chatContainer:{width:"100%",flex:1,maxWidth:"800px",height:"100%",display:"flex",flexDirection:"column",margin:"0 auto",overflow:"hidden","@media (max-width: 768px)":{maxWidth:"100%",borderRadius:"0"},"@media (max-width: 480px)":{},backgroundPosition:"calc(50%) center",backgroundRepeat:"no-repeat",backgroundSize:"contain",touchAction:"pan-y"},chatMessages:{display:"flex",flexDirection:"column",flex:1,padding:"16px",overflowY:"auto",touchAction:"pan-y"}}),v=({state:s,hideFooter:v,codicent:y,title:F,welcomeMessage:P})=>{const k=S(),{t:T,tAsync:I,getLanguageInfo:_}=C(),A=i(),M=t(null),[L,H]=a(),V=L.get("codicent"),R=V||y,{messages:B,isBotTyping:N,handleSend:U,newChat:O,openChat:D}=x(s.stateMachine,R||void 0),[W,E]=n(null),[z,Q]=n(!1),[G,Y]=n(!1),{service:$,currentStateName:K}=s,[q,J]=n([]),[X,Z]=n([]),[ee,oe]=n(!1),[te,ne]=n(),[re,se]=u(s.context.selectedApp+"_prompts",[]),[ie,ae]=n(!1),{extractTemplateVariables:me,replaceTemplateVariables:le,extractFilePlaceholders:ce,replaceFilePlaceholders:pe,handleSelectFiles:de}=w($.uploadFile),he=t(!1),ge=t(null);r((()=>{const e=window.history.length>1,o=Boolean(document.referrer&&document.referrer!==window.location.href);Y(e||o)}),[]);r((()=>{f("SHOW_CHAT_PROMPTS")&&0===B.length&&s.service.getAppPrompts().then(se).catch((e=>{console.error("Failed to get prompts",e)}))}),[s.service,se,B.length]),r((()=>{setTimeout((()=>{M.current?.scrollIntoView({behavior:"smooth"})}),10)}),[B]),r((()=>{if(he.current)return;he.current=!0;const e=L.get("text"),o=L.get("id"),t=L.get("fid");if(V){console.log("Using temporary codicent from URL param:",V);const e=new URLSearchParams(L);e.delete("codicent"),H(e,{replace:!0})}if(e){(async()=>{const o=ce(e),t=me(e);O(),o.length>0||t.length>0?(Z(o),J(t),oe(!0),E(T(e))):E(T(e))})()}else o?D(o):t&&ne(t)}),[]),r((()=>{te&&"anonymous"===K&&ge.current!==te&&(ge.current=te,$.getFormById(te).then((async e=>{O();const o=_().language,t=e.prompt.replace("{{fid}}",te).replace("{{fname}}",e.name).replace("{{language}}",o);ae(!0);const n=await I(t);ae(!1),E(n),Y(!1)})))}),[te,O,$,E,K,I,_,ae]),r((()=>{if(W&&!ee){let e=W;X.length>0&&(e=pe(e,X)),q.length>0&&(e=le(e,q)),U(e),H({},{replace:!0}),E(null),J([]),Z([])}}),[W,ee,U,H,pe,le,X,q]);const ue=e=>{const o=L.get("append");o&&(e+="\n---\n"+o),U(e)};return e(b,{hideHeader:!0,hideFooter:!!te||v,children:[e("div",{id:"chat-container",className:k.chatContainer,style:{backgroundImage:`url(${f("CHAT_BACKGROUND_IMAGE_URL")})`},children:[G&&o("button",{onClick:()=>{G&&A(-1)},"aria-label":T("Tillbaka"),style:{position:"absolute",top:12,left:12,zIndex:100,background:"var(--colorNeutralBackground1)",border:"none",cursor:"pointer",padding:8,borderRadius:8,boxShadow:"0 2px 8px rgba(0,0,0,0.08)",display:"flex",alignItems:"center",justifyContent:"center"},children:o(m,{style:{transform:"rotate(180deg)"}})}),o("div",{style:{marginLeft:G?40:0},children:o(l,{title:F||T(f("APP_CHAT_TITLE")||"Chatt"),onNewChat:te?void 0:()=>Q(!0)})}),e("div",{className:k.chatMessages,children:[P&&o(g,{sender:"bot",content:P}),f("SHOW_CHAT_PROMPTS")&&re.length>0&&0===B.length&&o(g,{sender:"bot",content:T(f("CHAT_WELCOME")||T("Välkommen!")),children:re.map(((t,n)=>e("div",{children:["> ",o("a",{href:"./#/chat",onClick:()=>{ue(t.title+"\n---\n"+t.prompt)},children:T(t.title)}),o("br",{})]},`prompt-${n}`)))}),B.map(((t,n)=>e("div",{children:[(N&&n===B.length-1||!N&&n===B.length-2)&&o("div",{ref:M}),o(g,{sender:t.sender,content:t.content,isNew:t.isNew,showSuggestions:n===B.length-1,onSuggestionClicked:U},t.id)]},t.id))),ie&&o(g,{sender:"user",content:T("Översätter...")}),N&&o(c,{})]}),o(d,{codicent:R||s.context.selectedApp,disableSend:N,onSend:ue,onSelectFiles:de,getImageUrl:j.getImageUrl,getFileInfo:e=>$.getFileInfo(e)})]}),o(p,{open:z,title:T("Vill du rensa chatten?"),content:T("En ny startas, men chatten kommer först sparas."),onYes:()=>{Q(!1),O()},onNo:()=>Q(!1)}),o(h,{open:ee,templateVariables:q,filePlaceholders:X,onTemplateVariablesChange:J,onFilePlaceholdersChange:Z,onConfirm:()=>oe(!1),onCancel:()=>{oe(!1),E(null),J([]),Z([])},uploadFile:$.uploadFile})]})};export{v as default};
|